:root {
  --bg: #14006f;
  --card: rgba(255, 255, 255, 0.118);
  --card-strong: rgba(255, 255, 255, 0.19);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.78);
  --accent: #fdc820;
  --accent-2: #22cddc;
  --accent-3: #8a16ff;
  --hot: #ff2bb8;
  --danger: #ff8d8d;
  --good: #67dd42;
  --ink: #170052;
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.3);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 4%, rgba(253, 200, 32, 0.28), transparent 18rem),
    radial-gradient(circle at 86% 8%, rgba(34, 205, 220, 0.26), transparent 20rem),
    radial-gradient(circle at 42% 42%, rgba(255, 43, 184, 0.16), transparent 18rem),
    linear-gradient(135deg, #14006f 0%, #37008c 48%, #061a78 100%);
  overflow-x: hidden;
  touch-action: manipulation;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

a { color: var(--accent-2); }

button, input, textarea, select { font: inherit; }
button, a, input, label { -webkit-tap-highlight-color: transparent; }

.shell {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: max(10px, var(--safe-top)) 10px calc(22px + var(--safe-bottom));
}

.card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--card);
  box-shadow: var(--shadow);
  border-radius: 24px;
  padding: 16px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  margin: 10px 0;
}

.compact-card { padding: 16px; }

.hero {
  text-align: left;
  padding: 18px 16px;
}

.brand-hero {
  display: grid;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.brand-logo {
  display: block;
  width: min(232px, 76vw);
  max-height: 190px;
  object-fit: contain;
  margin: -10px auto -6px;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.35));
}

.brand-copy .brand-pill { margin: 0 auto; }
.brand-copy h1 { text-shadow: 0 4px 0 rgba(23, 0, 82, 0.22); }

.game-brand-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.game-logo {
  width: clamp(54px, 17vw, 86px);
  height: clamp(54px, 17vw, 86px);
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 9px 14px rgba(0, 0, 0, 0.32));
}

.game-brand-line h2 { margin-top: 5px; }

h1, h2 { margin: 8px 0; line-height: 1.04; }
h1 { font-size: clamp(1.85rem, 9vw, 3.2rem); letter-spacing: -0.055em; }
h2 { font-size: clamp(1.35rem, 5.6vw, 2rem); letter-spacing: -0.03em; }
p { line-height: 1.45; }

.hero p, .intro-copy { margin-bottom: 0; }
.muted, .legal { color: var(--muted); }
.legal { font-size: 0.84rem; margin: 2px 0 0; }
.tight { margin: 5px 0 0; }

.brand-pill, .seat-pill, .eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 207, 74, 0.16);
  color: var(--accent);
  font-weight: 900;
  letter-spacing: 0.08em;
  font-size: 0.69rem;
  text-transform: uppercase;
}

.eyebrow {
  background: rgba(125, 249, 216, 0.14);
  color: var(--accent-2);
}

.seat-pill {
  background: rgba(169, 255, 186, 0.14);
  color: var(--good);
  white-space: nowrap;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.remember-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(125, 249, 216, 0.2);
  border-radius: 18px;
  background: rgba(125, 249, 216, 0.09);
}

.remember-panel p { margin: 4px 0 0; color: var(--muted); font-size: 0.82rem; }

.mini-button {
  min-height: 40px;
  padding: 8px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 900;
}

form { display: grid; gap: 11px; margin-top: 14px; }
label { display: grid; gap: 6px; font-weight: 800; font-size: 0.94rem; }

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 13px 13px;
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  outline: none;
  font-size: 16px;
}

input::placeholder { color: rgba(255, 255, 255, 0.48); }
input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 4px rgba(125, 249, 216, 0.14); }
input[type="checkbox"] { width: 22px; min-height: 22px; margin: 1px 0 0; accent-color: var(--accent); }
.optional { color: var(--muted); font-weight: 700; }
.check { grid-template-columns: auto 1fr; align-items: start; gap: 10px; font-weight: 650; line-height: 1.35; }
.remember-check { color: rgba(255, 255, 255, 0.9); }
.error { color: var(--danger); min-height: 1.3em; margin: 0; font-weight: 800; }

button, .primary, .secondary, .ghost {
  appearance: none;
  border: 0;
  border-radius: 18px;
  min-height: 52px;
  padding: 14px 16px;
  font-weight: 950;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

button:active, .primary:active, .secondary:active, .ghost:active { transform: translateY(1px) scale(0.99); }
button:disabled { cursor: not-allowed; opacity: 0.48; box-shadow: none; }

.primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, var(--accent), #ff7a18);
  color: var(--ink);
  box-shadow: 0 12px 24px rgba(255, 207, 74, 0.24);
}

.secondary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  color: #101329;
  box-shadow: 0 12px 24px rgba(125, 249, 216, 0.18);
}

.ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.start-button { width: 100%; }
.hidden { display: none !important; }

.game-card {
  overflow: visible;
  padding: 13px;
  min-height: calc(100dvh - 20px - var(--safe-top) - var(--safe-bottom));
}

.game-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.game-title-block h2 { margin-bottom: 0; }

.caller-stage {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 9px;
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.16);
  min-width: 106px;
}

.caller-label {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.call-ball {
  display: grid;
  place-items: center;
  width: clamp(72px, 23vw, 112px);
  height: clamp(72px, 23vw, 112px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.18) 18%, transparent 19%),
    radial-gradient(circle at 50% 52%, #fff 0 33%, var(--accent) 34% 100%);
  color: var(--ink);
  font-weight: 1000;
  font-size: clamp(1.24rem, 6.2vw, 2.2rem);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34), inset -10px -14px 24px rgba(0, 0, 0, 0.16);
}

.call-ball.pop { animation: ballPop 360ms cubic-bezier(.2, 1.4, .45, 1); }

@keyframes ballPop {
  from { transform: scale(0.72) rotate(-12deg); opacity: 0.2; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}

.bingo-wrap {
  margin-top: 12px;
  padding: 9px;
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(4px, 1.5vw, 8px);
}

.bingo-head { display: none !important; }

.board button {
  aspect-ratio: 1;
  min-height: 0;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: clamp(10px, 3.2vw, 17px);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 1000;
  font-size: clamp(0.72rem, 3.75vw, 1.05rem);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: transform 220ms ease, background 220ms ease, box-shadow 220ms ease;
}


.call-ball.sending {
  animation: ballSendPulse 720ms ease-in-out infinite;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34), 0 0 32px rgba(255, 207, 74, 0.44), inset -10px -14px 24px rgba(0, 0, 0, 0.16);
}

@keyframes ballSendPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.055); }
}

.match-flyer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  pointer-events: none;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.18) 18%, transparent 19%),
    radial-gradient(circle at 50% 52%, #fff 0 33%, var(--accent) 34% 100%);
  color: var(--ink);
  font-weight: 1000;
  font-size: clamp(0.9rem, 5vw, 1.46rem);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.48), 0 0 32px rgba(255, 207, 74, 0.42);
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.match-flyer::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: inherit;
  border: 2px solid rgba(255, 255, 255, 0.7);
  opacity: 0.45;
}

.board button.match-target {
  box-shadow: 0 0 0 3px rgba(125, 249, 216, 0.42), 0 0 28px rgba(125, 249, 216, 0.32);
  transform: translateY(-2px) scale(1.03);
}

.board button.match-impact {
  animation: cardImpact 620ms cubic-bezier(.2, 1.4, .45, 1);
}

@keyframes cardImpact {
  0% { transform: scale(1); filter: brightness(1); }
  36% { transform: scale(1.12) rotate(-2deg); filter: brightness(1.38); }
  100% { transform: scale(1); filter: brightness(1); }
}

.board button.callable {
  background: rgba(255, 207, 74, 0.28);
  box-shadow: 0 0 0 3px rgba(255, 207, 74, 0.34), 0 0 22px rgba(255, 207, 74, 0.34);
  transform: translateY(-2px);
  animation: pulseSquare 920ms ease-in-out infinite;
}

@keyframes pulseSquare {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.28); }
}

.board button.marked {
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  color: #101329;
  transform: scale(0.94) rotate(-1deg);
}

.board button.free {
  background: rgba(255, 207, 74, 0.88);
  color: #20112d;
}

.board button.bingo-line {
  box-shadow: 0 0 0 4px rgba(255, 207, 74, 0.42), 0 0 28px rgba(255, 207, 74, 0.34);
}

.caller-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 11px 0 9px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.caller-copy { display: grid; gap: 3px; min-width: 0; }
.caller-copy strong { font-size: 0.96rem; }
.caller-copy span { color: var(--muted); font-size: 0.84rem; }
.draw-count { color: var(--accent); font-weight: 1000; font-size: 0.96rem; white-space: nowrap; }

.ball-tray {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  overflow-x: auto;
  padding: 4px 1px 10px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.tray-ball {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--muted);
  font-weight: 1000;
  font-size: 0.76rem;
}

.tray-ball.possible-hit { color: #fff; border-color: rgba(125, 249, 216, 0.38); }
.tray-ball.filled { background: linear-gradient(135deg, var(--accent-2), #91a7ff); color: #101329; }
.tray-ball.miss { opacity: 0.7; }

.progress { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden; margin: 2px 0 9px; }
.progress div { width: 0%; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width 260ms ease; }

.game-controls {
  position: sticky;
  bottom: calc(8px + var(--safe-bottom));
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  background: rgba(19, 15, 38, 0.86);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.game-controls button { min-height: 56px; border-radius: 16px; font-size: 1rem; }
.fill-action { text-transform: uppercase; letter-spacing: 0.04em; }
.auto-action { grid-column: 1 / -1; min-height: 46px !important; }

.result-card { text-align: center; }
.result-card .prize-code {
  display: inline-block;
  margin: 10px 0;
  padding: 12px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.12);
}

.share-row { display: grid; gap: 10px; margin-top: 16px; }

@media (max-width: 359px) {
  .shell { padding-left: 7px; padding-right: 7px; }
  .card { border-radius: 20px; padding: 12px; }
  .game-card { padding: 10px; }
  .caller-stage { min-width: 92px; padding: 8px; }
  .call-ball { width: 66px; height: 66px; }
  .game-controls button { min-height: 52px; font-size: 0.95rem; }
}

@media (min-width: 700px) {
  .shell { width: min(920px, 100%); padding: 18px; }
  .card { padding: 22px; border-radius: 28px; margin: 14px 0; }
  .hero { text-align: left; padding: 26px 24px; }
  .brand-hero { grid-template-columns: 265px 1fr; text-align: left; gap: 18px; }
  .brand-logo { width: 265px; margin: -10px 0 -14px; }
  .brand-copy .brand-pill { margin: 0; }
  .entry-card form { grid-template-columns: 1fr 1fr; }
  .entry-card .check, .entry-card .legal, .entry-card .primary, .entry-card .error { grid-column: 1 / -1; }
  .game-card { min-height: auto; padding: 22px; }
  .game-top { grid-template-columns: 1fr auto; gap: 18px; }
  .bingo-wrap { padding: 14px; }
  .caller-panel { margin: 16px 0 12px; padding: 14px; }
  .tray-ball { min-width: 44px; height: 44px; font-size: 0.84rem; }
  .progress { height: 10px; margin-bottom: 16px; }
  .game-controls { position: static; grid-template-columns: 1.2fr 1.2fr 0.9fr; padding: 0; border: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
  .auto-action { grid-column: auto; min-height: 56px !important; }
  .share-row { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Winning-line celebration */
.bingo-wrap {
  position: relative;
}

.winning-line-draw {
  position: absolute;
  z-index: 12;
  height: clamp(9px, 2.2vw, 15px);
  margin-top: clamp(-5px, -1.1vw, -7px);
  border-radius: 999px;
  pointer-events: none;
  transform-origin: left center;
  transform: rotate(var(--line-angle, 0deg)) scaleX(0);
  background: linear-gradient(90deg, #fff7a6, var(--accent), #ff7d4a);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28), 0 0 34px rgba(255, 207, 74, 0.68), 0 0 58px rgba(255, 125, 74, 0.36);
  opacity: 0;
}

.winning-line-draw.is-visible {
  opacity: 1;
  animation: winningLineDraw 840ms cubic-bezier(.18, 1.15, .32, 1) forwards, winningLineGlow 980ms ease-in-out 820ms infinite;
}

.winning-line-draw::after {
  content: "BINGO";
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: clamp(0.62rem, 2.6vw, 0.82rem);
  font-weight: 1000;
  letter-spacing: 0.1em;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

@keyframes winningLineDraw {
  0% { transform: rotate(var(--line-angle, 0deg)) scaleX(0); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: rotate(var(--line-angle, 0deg)) scaleX(1); opacity: 1; }
}

@keyframes winningLineGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.35); }
}

.board button.bingo-line {
  position: relative;
  z-index: 10;
  background: linear-gradient(135deg, #fff8a8, var(--accent));
  color: var(--ink);
  box-shadow: 0 0 0 4px rgba(255, 207, 74, 0.52), 0 0 34px rgba(255, 207, 74, 0.48);
}

.board button.line-win-pop {
  animation: lineSquareWin 780ms cubic-bezier(.18, 1.45, .34, 1) both;
}

@keyframes lineSquareWin {
  0% { transform: scale(0.94) rotate(-1deg); }
  45% { transform: scale(1.15) rotate(2deg); }
  100% { transform: scale(1.02) rotate(0deg); }
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -24px;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  background: var(--accent);
  animation: confettiFall linear forwards;
  transform: translate3d(0, 0, 0) rotate(0deg);
}

.confetti-piece:nth-child(5n + 1) { background: var(--accent-2); }
.confetti-piece:nth-child(5n + 2) { background: #ff8a4a; }
.confetti-piece:nth-child(5n + 3) { background: #fff; }
.confetti-piece:nth-child(5n + 4) { background: #91a7ff; }
.confetti-piece.circle { border-radius: 999px; width: 9px; height: 9px; }
.confetti-piece.ribbon { width: 6px; height: 22px; border-radius: 999px; }

@keyframes confettiFall {
  0% { transform: translate3d(0, -24px, 0) rotate(0deg); }
  100% { transform: translate3d(var(--drift, 0px), calc(100vh + 70px), 0) rotate(var(--spin, 720deg)); }
}

.winner-burst {
  width: 84px;
  height: 84px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(255,207,74,0.92));
  color: var(--ink);
  font-size: 2.4rem;
  box-shadow: 0 0 0 8px rgba(255, 207, 74, 0.14), 0 20px 44px rgba(0, 0, 0, 0.32);
  animation: winnerBurst 900ms cubic-bezier(.2, 1.5, .36, 1) both;
}

@keyframes winnerBurst {
  from { transform: scale(0.55) rotate(-12deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* v3: unmistakable win event - fixed viewport line, overlay, JS-driven confetti */
.bingo-wrap.win-active {
  box-shadow: 0 0 0 4px rgba(255, 207, 74, 0.28), 0 0 58px rgba(255, 207, 74, 0.28);
  animation: boardWinGlow 1100ms ease-in-out infinite;
}

@keyframes boardWinGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

.winning-line-draw {
  position: fixed !important;
  z-index: 2147482500;
  height: clamp(15px, 4vw, 24px);
  margin-top: clamp(-12px, -2vw, -8px);
  border-radius: 999px;
  pointer-events: none;
  transform-origin: left center;
  transform: rotate(var(--line-angle, 0deg)) scaleX(0);
  background: linear-gradient(90deg, #ffffff, #ffcf4a 42%, #ff6b35);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.42),
    0 0 34px rgba(255, 207, 74, 0.88),
    0 0 72px rgba(255, 107, 53, 0.64);
  opacity: 0;
}

.winning-line-draw.is-visible {
  opacity: 1;
  animation: winningLineDraw 760ms cubic-bezier(.18, 1.25, .28, 1) forwards, winningLineGlow 860ms ease-in-out 760ms infinite;
}

.winning-line-draw::after {
  content: "BINGO!";
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  padding: 6px 13px;
  border-radius: 999px;
  background: #fff;
  color: #17112a;
  font-size: clamp(0.72rem, 3.5vw, 1rem);
  font-weight: 1000;
  letter-spacing: 0.12em;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34);
}

.bingo-win-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147482600;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 170ms ease, transform 170ms ease;
}

.bingo-win-overlay.is-showing {
  opacity: 1;
  transform: scale(1);
}

.bingo-win-overlay.is-leaving {
  opacity: 0;
  transform: scale(1.04);
  transition-duration: 360ms;
}

.bingo-win-card {
  width: min(86vw, 390px);
  padding: 22px 18px;
  border-radius: 30px;
  text-align: center;
  color: #17112a;
  background: radial-gradient(circle at 50% 0%, #fff 0 32%, #ffcf4a 33% 100%);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.58), 0 0 0 9px rgba(255, 255, 255, 0.18);
  animation: bingoWinCardPop 720ms cubic-bezier(.18, 1.48, .34, 1) both;
}

.bingo-win-card strong {
  display: block;
  font-size: clamp(2.7rem, 17vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
  text-transform: uppercase;
}

.bingo-win-card span {
  display: block;
  font-weight: 1000;
}

.bingo-win-eyebrow {
  margin-bottom: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

@keyframes bingoWinCardPop {
  0% { transform: scale(0.58) rotate(-6deg); opacity: 0; }
  55% { transform: scale(1.07) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.confetti-layer {
  z-index: 2147482700 !important;
}

.confetti-layer .confetti-piece {
  position: fixed;
  top: 0;
  width: 12px;
  height: 16px;
  border-radius: 3px;
  animation: none !important;
  will-change: transform, opacity;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.16);
}

.confetti-layer .confetti-piece.circle {
  width: 11px;
  height: 11px;
  border-radius: 999px;
}

.confetti-layer .confetti-piece.ribbon {
  width: 7px;
  height: 26px;
  border-radius: 999px;
}

.winner-proof {
  display: inline-block;
  margin: 2px 0 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 207, 74, 0.22);
  color: #fff;
  font-weight: 900;
}

/* numbers-only-v5: play-area B/I/N/G/O headers are intentionally hidden; play balls use numeric labels only. */
body[data-build="numbers-only-v5"] .bingo-head { display: none !important; }


/* logo-v7: TC Bingo logo and palette applied to player game. */
body[data-build="logo-v7-numbers-result-cleanup"] .brand-pill {
  background: rgba(253, 200, 32, 0.18);
  color: #ffe876;
  box-shadow: inset 0 0 0 1px rgba(253, 200, 32, 0.18);
}
body[data-build="logo-v7-numbers-result-cleanup"] .card {
  border-color: rgba(255, 255, 255, 0.22);
}
body[data-build="logo-v7-numbers-result-cleanup"] .call-ball,
body[data-build="logo-v7-numbers-result-cleanup"] .match-flyer {
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.2) 18%, transparent 19%),
    radial-gradient(circle at 50% 52%, #fff 0 33%, var(--accent) 34% 66%, #ff7a18 67% 100%);
}
body[data-build="logo-v7-numbers-result-cleanup"] .confetti-piece:nth-child(5n + 1) { background: var(--accent-2); }
body[data-build="logo-v7-numbers-result-cleanup"] .confetti-piece:nth-child(5n + 2) { background: var(--hot); }
body[data-build="logo-v7-numbers-result-cleanup"] .confetti-piece:nth-child(5n + 3) { background: var(--accent); }
body[data-build="logo-v7-numbers-result-cleanup"] .confetti-piece:nth-child(5n + 4) { background: var(--good); }

/* logo-v9: top hero artwork removed; logo and hero text animated in place. */
body[data-build="logo-v9-animated-hero"] .brand-pill {
  background: linear-gradient(135deg, rgba(253, 200, 32, 0.26), rgba(255, 43, 184, 0.14));
  color: #fff2a2;
  box-shadow: inset 0 0 0 1px rgba(253, 200, 32, 0.24), 0 0 22px rgba(253, 200, 32, 0.12);
}

body[data-build="logo-v9-animated-hero"] .card {
  border-color: rgba(255, 255, 255, 0.23);
}

body[data-build="logo-v9-animated-hero"] .call-ball,
body[data-build="logo-v9-animated-hero"] .match-flyer {
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.2) 18%, transparent 19%),
    radial-gradient(circle at 50% 52%, #fff 0 33%, var(--accent) 34% 66%, #ff7a18 67% 100%);
}

body[data-build="logo-v9-animated-hero"] .confetti-piece:nth-child(5n + 1) { background: var(--accent-2); }
body[data-build="logo-v9-animated-hero"] .confetti-piece:nth-child(5n + 2) { background: var(--hot); }
body[data-build="logo-v9-animated-hero"] .confetti-piece:nth-child(5n + 3) { background: var(--accent); }
body[data-build="logo-v9-animated-hero"] .confetti-piece:nth-child(5n + 4) { background: var(--good); }

.animated-hero-shell {
  overflow: hidden;
  padding: 18px 16px 20px;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% -8%, rgba(253, 200, 32, 0.26), transparent 16rem),
    radial-gradient(circle at 9% 18%, rgba(255, 43, 184, 0.22), transparent 12rem),
    radial-gradient(circle at 92% 30%, rgba(34, 205, 220, 0.23), transparent 13rem),
    linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.07));
}

.animated-hero-shell::before,
.animated-hero-shell::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.animated-hero-shell::before {
  inset: -34% -30% auto;
  height: 230px;
  background: conic-gradient(from 90deg, transparent, rgba(34, 205, 220, 0.28), transparent, rgba(253, 200, 32, 0.28), transparent);
  filter: blur(26px);
  animation: heroAuraSpin 9s linear infinite;
}

.animated-hero-shell::after {
  inset: 0;
  background:
    radial-gradient(circle at 13% 68%, rgba(255, 255, 255, 0.44) 0 2px, transparent 3px),
    radial-gradient(circle at 88% 22%, rgba(255, 255, 255, 0.38) 0 2px, transparent 3px),
    radial-gradient(circle at 80% 78%, rgba(253, 200, 32, 0.6) 0 2px, transparent 3px),
    linear-gradient(110deg, transparent 0 34%, rgba(255, 255, 255, 0.16) 43%, transparent 55%);
  transform: translateX(-140%);
  animation: heroSweep 4.4s ease-in-out infinite;
}

.animated-brand-hero {
  position: relative;
  gap: 4px;
}

.logo-stage {
  position: relative;
  display: grid;
  place-items: center;
  margin: -2px auto 0;
  width: min(270px, 82vw);
  min-height: 168px;
}

.logo-stage::before {
  content: "";
  position: absolute;
  width: 92%;
  height: 64%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 43, 184, 0.2), rgba(34, 205, 220, 0.14), transparent 68%);
  filter: blur(16px);
  animation: logoGlow 2.7s ease-in-out infinite;
}

.logo-stage::after {
  content: "";
  position: absolute;
  inset: 17% 3%;
  border-radius: 50%;
  border: 2px solid rgba(34, 205, 220, 0.24);
  box-shadow: 0 0 28px rgba(255, 43, 184, 0.24), inset 0 0 26px rgba(253, 200, 32, 0.12);
  transform: rotate(-7deg);
  animation: logoRingPulse 2.9s ease-in-out infinite;
}

.hero-logo {
  position: relative;
  z-index: 2;
  width: min(248px, 76vw);
  max-height: 190px;
  margin: -10px auto -6px;
  transform-origin: 50% 68%;
  animation: logoFloatPop 3.6s ease-in-out infinite;
}

.logo-spark {
  position: absolute;
  z-index: 3;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 12px #fff, 0 0 24px var(--accent), 0 0 38px var(--hot);
  opacity: 0;
  animation: sparklePop 2.4s ease-in-out infinite;
}

.spark-one { top: 18%; left: 13%; animation-delay: 0s; }
.spark-two { top: 28%; right: 10%; animation-delay: 0.75s; }
.spark-three { bottom: 18%; left: 28%; animation-delay: 1.35s; }

.hero-copy-animated {
  position: relative;
  z-index: 2;
  animation: heroCopyRise 0.75s cubic-bezier(.2,.95,.28,1) both;
}

.hero-copy-animated h1 {
  text-shadow:
    0 4px 0 rgba(23, 0, 82, 0.3),
    0 0 22px rgba(34, 205, 220, 0.22),
    0 0 38px rgba(255, 43, 184, 0.18);
  animation: heroHeadlinePulse 2.7s ease-in-out infinite;
}

.hero-copy-animated p {
  margin-top: 8px;
  animation: heroTextFadeUp 0.85s cubic-bezier(.2,.95,.28,1) 0.14s both;
}

.hero-word-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 14px;
}

.hero-word-row span {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 9px 8px 10px;
  border-radius: 16px;
  font-weight: 1000;
  line-height: 1;
  letter-spacing: -0.035em;
  font-size: clamp(1rem, 5.2vw, 1.45rem);
  color: #180054;
  text-shadow: 0 1px 0 rgba(255,255,255,0.45);
  background: linear-gradient(180deg, #fff384, #fdc820 54%, #ff8b17);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 8px 0 rgba(23, 0, 82, 0.35), 0 0 22px rgba(253, 200, 32, 0.2);
  transform: translateY(10px) scale(0.96);
  opacity: 0;
  animation: wordTilePop 0.72s cubic-bezier(.18,1.35,.28,1) forwards, wordTileBounce 2.8s ease-in-out infinite;
}

.hero-word-row span:nth-child(1) { animation-delay: 0.18s, 1.05s; }
.hero-word-row span:nth-child(2) { animation-delay: 0.34s, 1.2s; background: linear-gradient(180deg, #81f5ff, #22cddc 52%, #0087ff); color: #fff; text-shadow: 0 2px 0 rgba(23,0,82,0.4); }
.hero-word-row span:nth-child(3) { animation-delay: 0.5s, 1.35s; background: linear-gradient(180deg, #ff8ae0, #ff2bb8 54%, #9f00ff); color: #fff; text-shadow: 0 2px 0 rgba(23,0,82,0.42); }

.game-hype-strip.text-only {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  padding: 12px 14px;
  margin-top: 10px;
}

.game-hype-strip.text-only span {
  width: 100%;
  animation: hypeTextPulse 2.6s ease-in-out infinite;
}

@keyframes heroAuraSpin {
  to { transform: rotate(360deg); }
}

@keyframes heroSweep {
  0%, 42% { transform: translateX(-140%); }
  66%, 100% { transform: translateX(140%); }
}

@keyframes logoGlow {
  0%, 100% { transform: scale(0.95); opacity: 0.72; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes logoRingPulse {
  0%, 100% { transform: rotate(-7deg) scale(0.98); opacity: 0.58; }
  50% { transform: rotate(4deg) scale(1.05); opacity: 0.96; }
}

@keyframes logoFloatPop {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-1deg) scale(1); filter: drop-shadow(0 18px 24px rgba(0,0,0,0.35)) saturate(1.08); }
  42% { transform: translate3d(0, -7px, 0) rotate(1.2deg) scale(1.025); filter: drop-shadow(0 24px 30px rgba(0,0,0,0.38)) saturate(1.18); }
  56% { transform: translate3d(0, -4px, 0) rotate(-0.5deg) scale(1.012); }
}

@keyframes sparklePop {
  0%, 100% { transform: scale(0.1) rotate(0deg); opacity: 0; }
  18% { transform: scale(1.05) rotate(90deg); opacity: 1; }
  34% { transform: scale(0.2) rotate(180deg); opacity: 0; }
}

@keyframes heroCopyRise {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes heroTextFadeUp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes heroHeadlinePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.012); }
}

@keyframes wordTilePop {
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes wordTileBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.015); }
}

@keyframes hypeTextPulse {
  0%, 100% { transform: scale(1); text-shadow: 0 3px 0 rgba(23, 0, 82, 0.26), 0 0 18px rgba(255, 207, 74, 0.28); }
  50% { transform: scale(1.03); text-shadow: 0 3px 0 rgba(23, 0, 82, 0.3), 0 0 26px rgba(34, 205, 220, 0.38); }
}

@media (min-width: 700px) {
  .animated-hero-shell { padding: 24px; }
  .animated-brand-hero {
    grid-template-columns: 280px 1fr;
    text-align: left;
    gap: 22px;
  }
  .logo-stage { width: 280px; min-height: 196px; margin: 0; }
  .hero-logo { width: 274px; max-height: 210px; margin: -10px 0 -10px; }
  .hero-copy-animated .brand-pill { margin: 0; }
  .hero-word-row { max-width: 430px; }
}

@media (max-width: 380px) {
  .logo-stage { width: min(232px, 82vw); min-height: 148px; }
  .hero-logo { width: min(218px, 76vw); max-height: 164px; }
  .hero-word-row { gap: 6px; }
  .hero-word-row span { min-height: 38px; border-radius: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .animated-hero-shell::before,
  .animated-hero-shell::after,
  .logo-stage::before,
  .logo-stage::after,
  .hero-logo,
  .logo-spark,
  .hero-copy-animated,
  .hero-copy-animated h1,
  .hero-copy-animated p,
  .hero-word-row span,
  .game-hype-strip.text-only span {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}


/* v10 policy/play-interval pages */
.play-limit-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(253, 200, 32, 0.13);
  border: 1px solid rgba(253, 200, 32, 0.22);
  color: #fff4b6;
  font-weight: 900;
  font-size: 0.88rem;
}
.legal-shell { width: min(860px, 100%); }
.legal-card { padding: clamp(18px, 4vw, 34px); }
.legal-logo { width: min(230px, 72vw); display: block; margin: -8px auto 8px; filter: drop-shadow(0 16px 24px rgba(0,0,0,.28)); }
.back-link { display: inline-flex; margin-bottom: 10px; color: var(--accent-2); font-weight: 900; text-decoration: none; }
.legal-content {
  margin-top: 18px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255,255,255,.92);
  color: #1d1438;
  line-height: 1.62;
  box-shadow: inset 0 0 0 1px rgba(23,0,82,.08);
}
.legal-content h1, .legal-content h2, .legal-content h3, .legal-content h4 { color: #170052; letter-spacing: -0.025em; }
.legal-content a { color: #4d16d8; font-weight: 900; }
.legal-content ul, .legal-content ol { padding-left: 1.25rem; }


/* v12: in-play legal popups and once-only interval support */
body.legal-modal-open { overflow: hidden; }
.legal a { font-weight: 900; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: max(14px, var(--safe-top)) 12px max(14px, var(--safe-bottom));
}
.legal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 0, 42, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.legal-modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(82vh, 760px);
  overflow: auto;
  border-radius: 26px 26px 20px 20px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,242,255,.98));
  color: #1d1438;
  box-shadow: 0 24px 70px rgba(0,0,0,.42), 0 0 0 1px rgba(255,255,255,.55) inset;
  outline: none;
}
.legal-modal-card .brand-pill { color: #fff; }
.legal-modal-card h2 {
  margin: 10px 42px 12px 0;
  color: var(--ink);
  font-size: clamp(1.5rem, 7vw, 2.2rem);
  letter-spacing: -0.04em;
}
.legal-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, #ff5fd1, #6d16ff);
  box-shadow: 0 10px 24px rgba(109,22,255,.25);
  font-size: 1.8rem;
  line-height: 1;
}
.legal-modal .legal-content {
  margin-top: 0;
  max-height: none;
  box-shadow: inset 0 0 0 1px rgba(23,0,82,.08);
}
.legal-modal-actions {
  position: sticky;
  bottom: -18px;
  margin: 14px -18px -18px;
  padding: 12px 18px calc(12px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(246,242,255,0), rgba(246,242,255,.98) 28%);
  display: flex;
  justify-content: flex-end;
}
.legal-modal-actions .secondary { min-width: 130px; }
@media (min-width: 720px) {
  .legal-modal { align-items: center; }
  .legal-modal-card { border-radius: 28px; padding: 24px; }
  .legal-modal-actions { margin: 18px -24px -24px; padding: 14px 24px 18px; }
}

.game-legal { text-align: center; margin: 12px 0 calc(70px + var(--safe-bottom)); font-size: 0.82rem; }
@media (min-width: 720px) { .game-legal { margin-bottom: 8px; } }
