:root {
  /* Responsive sizing so the 6×6 grid never overflows on narrow phones */
  --tile-size: clamp(40px, 12vw, 56px);
  --gap: clamp(6px, 2.2vw, 10px);
  /* Slightly taller play area so the goal-row frame has comfortable vertical padding */
  --row-gap: 16px;
  --goal-frame-pad-x: 8px;
  --goal-frame-pad-y: 8px;
  /*
    One rhythm value: space under logo ↔ matchup block matches space under stats ↔ board card.
    vmin tracks the shorter viewport axis so spacing scales consistently across phones & rotation.
  */
  --slide-tackle-hero-gap: clamp(12px, 3.9vmin, 22px);
}

html,
body {
  height: 100%;
}

/* Pitch background + children are full-width; avoid horizontal rubber-band growing layout */
html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

/* Pull-to-refresh on Chrome/Android requires the document/root not be overflow-clipped vertically. */

/* (Intentionally no global scrollbar hiding.) */

/* Pitch-like background (CSS-only, no asset needed) */
body {
  background:
    radial-gradient(1200px 700px at 50% 25%, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.82)),
    repeating-linear-gradient(
      135deg,
      rgba(88, 165, 72, 0.92) 0px,
      rgba(88, 165, 72, 0.92) 44px,
      rgba(110, 186, 78, 0.92) 44px,
      rgba(110, 186, 78, 0.92) 88px
    );
  background-attachment: fixed;
}

/* Mobile browsers often repaint/flicker with fixed backgrounds on frequent UI updates. */
@media (hover: none) and (pointer: coarse) {
  body {
    background-attachment: scroll;
  }
}

/* Substitution-board vibe */
.board-surface {
  background: radial-gradient(1000px 500px at 50% 0%, rgba(251, 146, 60, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 25%),
    #050505;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.kickoff-wrap {
  position: relative;
}

.grid-clip {
  overflow: hidden;
  position: relative;
  border-radius: 16px;
}

.kickoff-blur {
  filter: blur(10px);
  opacity: 0.75;
}

.slide-tackle-hint-dock {
  padding-top: 0;
  padding-bottom: 0;
}

/* Less air between matchup block (incl. hint row) and the board card when hints are in play */
.slide-tackle-board-below-hint-row {
  margin-top: clamp(4px, 1vmin, 10px);
}

.slide-tackle-board-below-hero {
  margin-top: var(--slide-tackle-hero-gap);
}

@keyframes slideTackleHintGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0);
    border-color: rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 0 0 14px 3px rgba(250, 204, 21, 0.38);
    border-color: rgba(250, 204, 21, 0.5);
  }
}

.slide-tackle-hint-btn-glow {
  animation: slideTackleHintGlow 2.8s ease-in-out infinite;
}

.kickoff-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
}

.kickoff-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(700px 380px at 50% 45%, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.78));
  border-radius: 16px;
}

.kickoff-instructions {
  position: relative;
  z-index: 1;
  max-width: 520px;
  text-align: center;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-size: 14px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
}

.kickoff-btn {
  position: relative;
  z-index: 1;
  background: rgba(16, 185, 129, 0.95);
  color: #fff;
  border: 1px solid rgba(16, 185, 129, 0.55);
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.22),
    0 0 28px rgba(16, 185, 129, 0.22),
    0 18px 40px rgba(0, 0, 0, 0.55);
  border-radius: 18px;
  padding: 18px 26px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-weight: 900;
  font-size: 28px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kickoff-btn:hover {
  filter: brightness(1.05);
}

.kickoff-btn:active {
  transform: translateY(1px);
}

.goal-cta {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
}

.goal-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(700px 380px at 50% 45%, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.72));
  border-radius: 16px;
}

@keyframes goalPop {
  0% {
    transform: translateY(10px) scale(0.92);
    opacity: 0;
    filter: blur(2px);
  }
  60% {
    transform: translateY(0px) scale(1.02);
    opacity: 1;
    filter: blur(0px);
  }
  100% {
    transform: translateY(0px) scale(1);
    opacity: 1;
  }
}

.goal-btn {
  position: relative;
  z-index: 1;
  border-radius: 18px;
  padding: 16px 22px;
  background: rgba(16, 185, 129, 0.95);
  border: 1px solid rgba(16, 185, 129, 0.55);
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.22),
    0 0 34px rgba(16, 185, 129, 0.24),
    0 20px 44px rgba(0, 0, 0, 0.55);
  animation: goalPop 520ms cubic-bezier(0.2, 0.9, 0.2, 1) 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  color: #fff;
}

.goal-btn .goal-title {
  font-weight: 900;
  font-size: 34px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
}

.goal-btn .goal-sub {
  margin-top: 6px;
  font-size: 16px;
  opacity: 0.9;
  text-align: center;
}

@media (min-width: 640px) {
  .goal-btn .goal-sub {
    font-size: 17px;
  }
}

.goal-btn:hover {
  filter: brightness(1.05);
}

.goal-btn:active {
  transform: translateY(1px);
}

.scorecard-weekly-attendance {
  letter-spacing: 0.02em;
}

.top-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 0;
}

.slide-tackle-hero-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--slide-tackle-hero-gap);
  width: 100%;
}

.slide-tackle-hero-stack > header {
  padding-top: 0;
}

.top-logo img {
  height: 76px;
  width: auto;
  object-fit: contain;
  opacity: 0.95;
}

@media (min-width: 640px) {
  .top-logo img {
    height: 176px;
  }
}

/* Short phones / landscape: reclaim vertical space above the banner without shrinking the grid harshly first */
@media (max-height: 720px) {
  .top-logo img {
    height: 62px !important;
  }
}

.tile {
  width: var(--tile-size);
  height: var(--tile-size);
  min-width: var(--tile-size);
  flex: 0 0 var(--tile-size);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.5),
    0 10px 18px rgba(0, 0, 0, 0.4);
  will-change: transform;
  font-size: 18px;
}

.goal-slot {
  position: relative;
}

/* Single outer goal-row frame (matches mockup). */
.goal-row-frame {
  position: absolute;
  pointer-events: none;
  left: calc(0px - var(--goal-frame-pad-x));
  top: calc((2 * (var(--tile-size) + var(--row-gap))) - var(--goal-frame-pad-y)); /* GOAL_ROW = 2 */
  width: calc((var(--tile-size) * 6) + (var(--gap) * 5) + (2 * var(--goal-frame-pad-x)));
  height: calc(var(--tile-size) + (2 * var(--goal-frame-pad-y)));
  border-radius: 18px;
  border: 3px solid rgba(251, 146, 60, 0.95);
  box-shadow:
    0 0 0 1px rgba(251, 146, 60, 0.28),
    0 0 28px rgba(251, 146, 60, 0.16);
}

.goal-row-frame-solved {
  border-color: rgba(16, 185, 129, 0.9);
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.24),
    0 0 30px rgba(16, 185, 129, 0.18);
}

/* Make letters in the goal zone stand out (text only) */
.goal-slot .tile {
  font-size: 34px;
  letter-spacing: 0.02em;
}

.grid-interactive {
  touch-action: none; /* enables consistent swipe handling on mobile */
  overflow: visible;
}

.tile-dragging {
  cursor: grabbing;
}

.tile-shell {
  position: relative;
  overflow: visible;
}

.drag-overlay {
  position: absolute;
  z-index: 30;
  pointer-events: none;
}

.drag-viewport {
  overflow: hidden;
  border-radius: 12px;
}

.drag-track-row {
  display: flex;
  column-gap: var(--gap);
  will-change: transform;
}

.drag-track-col {
  display: flex;
  flex-direction: column;
  row-gap: var(--row-gap);
  will-change: transform;
}

.league-table-surface {
  /* Reduce mobile paint/compositor jitter (“flicker”) inside layered cards. */
  contain: layout paint;
  transform: translateZ(0);
  will-change: transform;
}

.scorecard-countdown-surface {
  /* Keep the 1s countdown repaint from affecting siblings. */
  contain: layout paint;
  transform: translateZ(0);
}

.tile-drag-layer {
  position: relative;
  will-change: transform;
}

.tile-drag-active .tile-drag-layer {
  transition: transform 0ms;
}

.tile-drag-snap .tile-drag-layer {
  transition: transform 160ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.tile-idle {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.82);
}

.tile-blank {
  background: rgba(0, 0, 0, 0.9);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.tile-goal {
  /* Goal-line tiles use border states (white/orange/green) like your mockup. */
  border-width: 2px;
}

.tile-goal-white {
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.10);
}

.tile-goal-orange {
  border-color: rgba(251, 146, 60, 0.9);
}

.tile-goal-green {
  border-color: rgba(16, 185, 129, 0.85);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.12);
}

.tile-blank.tile-goal-white {
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.tile-blank.tile-goal-green {
  box-shadow:
    inset 0 0 0 1px rgba(16, 185, 129, 0.22),
    0 0 18px rgba(16, 185, 129, 0.12);
}

.tile-blank.tile-goal-orange {
  box-shadow:
    inset 0 0 0 1px rgba(251, 146, 60, 0.22),
    0 0 18px rgba(251, 146, 60, 0.12);
}

.tile-green {
  color: rgba(16, 185, 129, 0.96);
  text-shadow:
    0 0 14px rgba(16, 185, 129, 0.24),
    0 0 24px rgba(16, 185, 129, 0.14);
}

.tile-orange {
  color: rgba(251, 146, 60, 0.98);
  text-shadow:
    0 0 14px rgba(251, 146, 60, 0.22),
    0 0 26px rgba(251, 146, 60, 0.14);
}

.tile-red {
  color: rgba(248, 113, 113, 0.98);
  text-shadow:
    0 0 14px rgba(248, 113, 113, 0.2),
    0 0 22px rgba(248, 113, 113, 0.12);
}

@keyframes pulseSolved {
  0% {
    filter: drop-shadow(0 0 0 rgba(16, 185, 129, 0));
  }
  55% {
    filter: drop-shadow(0 0 18px rgba(16, 185, 129, 0.38));
  }
  100% {
    filter: drop-shadow(0 0 0 rgba(16, 185, 129, 0));
  }
}

.solved-pulse {
  animation: pulseSolved 900ms ease-out 1;
}

/* AdSense slot (live /slidetackle/ only; script injects from app.js) */
.slide-tackle-ad-slot {
  max-width: 100%;
  /* Reserve a leaderboard-style strip so the slot stays visible while the creative loads */
  min-height: clamp(72px, 11vmin, 100px);
  /* Horizontal units are short; avoid clipping ad boundaries */
  overflow: visible;
  /* Avoid stray inline/iframe baseline gaps below the board */
  line-height: 0;
}

.slide-tackle-ad-slot ins.adsbygoogle {
  line-height: normal;
}

@media (max-height: 720px) {
  :root {
    --tile-size: clamp(36px, 10.5vw, 52px);
    --row-gap: 12px;
  }
}
