/* NiliGames — shared styles.
   A dark game-show stage: flat surfaces + borders, the logo's two colors as
   the two TEAM colors (gold vs blue), one accent per game. Motion is tied to
   real state — cursor, timer, a point being scored, a card being played —
   never decoration looping on its own. */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&family=Poppins:wght@400;500;600;700&display=swap');

@view-transition { navigation: auto; }

:root {
  --accent: #00befb;
  --accent-ink: #052330;
  --reveal: #f9be0b;
  --reveal-ink: #2b1c00;
  --teal: #2dd4bf;
  --teal-ink: #062b26;
  --violet: #a78bfa;
  --violet-ink: #1c1240;
  --rose: #fb7185;
  --rose-ink: #3a0a14;
  --danger: #ef4444;

  /* The two teams wear the logo's colors: "Nili" gold vs "Games" blue. */
  --team1: var(--reveal);
  --team1-ink: var(--reveal-ink);
  --team2: var(--accent);
  --team2-ink: var(--accent-ink);

  --game: var(--accent);
  --game-ink: var(--accent-ink);

  --ink: #f2f1f3;
  --ink-muted: rgba(242, 241, 243, 0.58);
  --ink-faint: rgba(242, 241, 243, 0.32);
  --bg: #0a0a0c;
  --panel: #131316;
  --panel-2: #18181d;
  --panel-3: #1f1f25;
  --border: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.22);
  --radius: 18px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* overflow-x lives on <html>, not <body> — on body it breaks position:sticky. */
html { overflow-x: hidden; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Poppins', system-ui, sans-serif;
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    radial-gradient(ellipse 900px 480px at 50% -8%, color-mix(in srgb, var(--game) 14%, transparent), transparent 70%);
  background-size: 24px 24px, 100% 100%;
}

body.home {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    radial-gradient(ellipse 1000px 560px at 50% -5%, rgba(0, 190, 251, 0.13), transparent 65%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.team-ink.team1 { color: var(--team1); }
.team-ink.team2 { color: var(--team2); }

/* ---------- Keyframes ---------- */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes popIn {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes flipIn {
  from { transform: rotateY(90deg) scale(0.9); opacity: 0.2; }
  to { transform: rotateY(0) scale(1); opacity: 1; }
}

@keyframes revealText {
  from { opacity: 0; transform: scale(0.7); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}

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

@keyframes eqBounce {
  0%, 100% { transform: scaleY(0.25); }
  50% { transform: scaleY(1); }
}

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

@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

@keyframes chosen {
  0%, 100% { transform: perspective(900px) scale(1.04); }
  50% { transform: perspective(900px) scale(1.08); }
}

@keyframes trophy {
  0% { transform: translateY(30px) scale(0.4) rotate(-20deg); opacity: 0; }
  60% { transform: translateY(-8px) scale(1.15) rotate(6deg); opacity: 1; }
  100% { transform: none; }
}

@keyframes logoIn {
  from { opacity: 0; transform: scale(0.92); filter: blur(10px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* ---------- Buttons ---------- */

.btn {
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.65rem 1.35rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--ink);
  transition: filter 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:active { transform: scale(0.95); }
.btn[disabled] { opacity: 0.35; cursor: default; box-shadow: none; pointer-events: none; }

.btn-primary { background: var(--game); color: var(--game-ink); }
.btn-primary:hover { box-shadow: 0 0 0 5px color-mix(in srgb, var(--game) 22%, transparent); }

.btn-secondary { background: var(--panel-2); color: var(--ink-muted); border-color: var(--border); }
.btn-secondary:hover { color: var(--ink); border-color: var(--border-hover); }

.btn-stop { background: var(--danger); color: #fff; }
.btn-stop:hover { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.2); }
.btn-stop.paused { background: var(--panel-2); color: var(--ink); border-color: var(--border-hover); }
.btn-stop.paused:hover { box-shadow: none; }

.btn-ghost-danger { background: none; color: rgba(239, 68, 68, 0.85); border-color: rgba(239, 68, 68, 0.3); }
.btn-ghost-danger:hover { border-color: var(--danger); color: var(--danger); }

.btn-big { font-size: 1.1rem; padding: 0.9rem 2rem; }
.btn-small { font-size: 0.8rem; padding: 0.45rem 0.9rem; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.icon-btn:hover { border-color: var(--border-hover); }
.icon-btn:active { transform: scale(0.92); }

.controls {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}

/* ---------- Header + shared actions ---------- */

.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  width: 100%;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.logo { display: inline-flex; align-items: center; }
.logo img { height: 34px; width: auto; display: block; }

.back-link {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink-muted);
  transition: color 0.15s ease;
}

.back-link:hover { color: var(--ink); }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.corner-actions {
  position: fixed;
  top: 0.9rem;
  right: 1.1rem;
  z-index: 30;
}

.settings-trigger {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  height: 38px;
  transition: border-color 0.15s ease;
}

.settings-trigger:hover { border-color: var(--border-hover); }

/* ---------- Homepage ---------- */

.stage-light {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, -20%), rgba(255, 255, 255, 0.045), transparent 65%);
}

.landing {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(3.5rem, 7vh, 4.5rem) clamp(1rem, 3vw, 2rem) 3rem;
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 4vh, 2.75rem);
}

.hero { text-align: center; }

.landing-logo {
  width: clamp(200px, 24vw, 360px);
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 0 40px rgba(0, 190, 251, 0.22));
  animation: logoIn 0.8s var(--ease-out) both;
}

.landing-tagline {
  color: var(--ink-muted);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  margin: 0.5rem 0 0;
  animation: fadeUp 0.6s 0.15s var(--ease-out) both;
}

/* Tonight's match */

.match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0 clamp(0.75rem, 2vw, 1.5rem);
  align-items: stretch;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: clamp(1rem, 2.5vw, 1.5rem);
  animation: fadeUp 0.6s 0.25s var(--ease-out) both;
}

/* Sports-scoreboard layout: names on the outside, scores facing the VS. */
.match-team {
  --team: var(--team1);
  position: relative;
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  background: linear-gradient(90deg, color-mix(in srgb, var(--team) 10%, transparent), transparent 80%);
  border: 1px solid color-mix(in srgb, var(--team) 26%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.match-team.team2 {
  --team: var(--team2);
  flex-direction: row-reverse;
  text-align: right;
  background: linear-gradient(270deg, color-mix(in srgb, var(--team) 10%, transparent), transparent 80%);
}

.match-info { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; flex: 1; }
.team2 .match-info { align-items: flex-end; }

.match.lead-1 .team1,
.match.lead-2 .team2 {
  border-color: var(--team);
  box-shadow: 0 0 0 1px var(--team), 0 0 44px color-mix(in srgb, var(--team) 22%, transparent);
}

.match-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--team);
}

.match-name {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  line-height: 1.15;
  color: var(--ink);
  background: none;
  border: none;
  border-bottom: 2px dashed transparent;
  padding: 0;
  width: 100%;
  min-width: 0;
  text-align: inherit;
  transition: border-color 0.15s ease;
}

.match-name:hover { border-bottom-color: var(--border-hover); }
.match-name:focus { outline: none; border-bottom-color: var(--team); }

.match-players {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink-muted);
  font-size: 0.82rem;
  cursor: pointer;
  text-align: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.match-players:hover { color: var(--ink); }
.match-players .add { color: var(--team); font-weight: 600; }

.match-score {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: clamp(2.8rem, 5.5vw, 4.25rem);
  line-height: 1;
  color: var(--team);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 28px color-mix(in srgb, var(--team) 35%, transparent);
}
.match-score.bump { animation: bump 0.5s var(--ease-spring); }

.match-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  max-width: 150px;
}

.match-vs {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  background: var(--panel-3);
  border: 1px solid var(--border-hover);
}

.match-leader {
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.35;
}

.match-leader .team-ink { font-weight: 700; }

.match-foot {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.match-breakdown { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.breakdown-chip {
  font-size: 0.78rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.breakdown-chip b { color: var(--ink); font-weight: 600; margin-right: 0.2rem; }
.breakdown-empty { font-size: 0.8rem; color: var(--ink-faint); }
.match-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Games grid */

.games { animation: fadeUp 0.6s 0.35s var(--ease-out) both; }

.games-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.games-head h2 {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  margin: 0;
}

.btn-surprise {
  background: var(--panel-2);
  border-color: var(--border-hover);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-surprise .dice { display: inline-block; transition: transform 0.4s var(--ease-spring); }
.btn-surprise:hover { border-color: var(--reveal); }
.btn-surprise:hover .dice { transform: rotate(200deg) scale(1.15); }
.btn-surprise[disabled] { opacity: 1; }
body.spinning .btn-surprise .dice { animation: spin 0.45s linear infinite; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(0.75rem, 1.5vw, 1.15rem);
}

@media (max-width: 1080px) { .game-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .game-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .game-grid { grid-template-columns: 1fr; } }

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0));
  transition: transform 0.25s var(--ease-out), border-color 0.2s ease, box-shadow 0.25s ease, opacity 0.2s ease;
  will-change: transform;
}

.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: radial-gradient(240px circle at var(--x, 50%) var(--y, 0%), rgba(255, 255, 255, 0.09), transparent 70%);
}

.game-card:hover,
.game-card:focus-visible,
.game-card.playing {
  --lift: -4px;
  border-color: color-mix(in srgb, var(--game) 60%, transparent);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 34px color-mix(in srgb, var(--game) 18%, transparent);
}

.game-card:hover::after { opacity: 1; }

body.spinning .game-card { opacity: 0.45; pointer-events: none; }

.game-card.roulette,
body.spinning .game-card.roulette {
  opacity: 1;
  border-color: var(--game);
  box-shadow: 0 0 0 2px var(--game), 0 0 48px color-mix(in srgb, var(--game) 40%, transparent);
  transform: perspective(900px) scale(1.04);
  transition-duration: 0.08s;
}

body.spinning .game-card.chosen {
  opacity: 1;
  border-color: var(--game);
  box-shadow: 0 0 0 3px var(--game), 0 0 70px color-mix(in srgb, var(--game) 55%, transparent);
  animation: chosen 0.5s ease-in-out infinite;
}

.card-stage {
  position: relative;
  height: 136px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--game) 16%, transparent), transparent 70%),
    var(--panel-2);
}

.pv-answer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9px;
  text-align: center;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--game);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.35s var(--ease-spring);
}

.card-stage.revealed .pv-answer { opacity: 1; transform: none; }

/* Emoji preview */
.pv-clue {
  font-size: 2.5rem;
  letter-spacing: 0.15rem;
  transition: transform 0.35s var(--ease-out);
}

.pv-clue b { font-family: 'Baloo 2', sans-serif; font-weight: 800; }
.pv-clue.swap { animation: popIn 0.4s var(--ease-out); }
.pv-emoji.revealed .pv-clue { transform: translateY(-12px) scale(0.85); }

/* Movie preview: a strip of film frames */
.pv-frames { display: flex; gap: 6px; transform: translateY(-6px); }

.pv-frames span {
  width: 50px;
  height: 66px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background:
    radial-gradient(circle, var(--panel-2) 2px, transparent 2.5px) 0 2px / 9px 9px repeat-x,
    radial-gradient(circle, var(--panel-2) 2px, transparent 2.5px) 0 calc(100% - 2px) / 9px 9px repeat-x,
    #0d0d10;
  border: 1px solid var(--border);
  filter: grayscale(1);
  opacity: 0.35;
  transition: opacity 0.3s ease, filter 0.3s ease, transform 0.4s var(--ease-spring), border-color 0.3s ease;
}

.pv-frames span.lit { opacity: 1; filter: none; transform: translateY(-3px) scale(1.06); border-color: var(--game); }

/* BGM preview: vinyl + equalizer */
.pv-bgm { grid-auto-flow: column; justify-content: center; gap: 1rem; }

.pv-vinyl {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    repeating-radial-gradient(circle, #111 0 2px, #1d1d22 2px 4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
}

.pv-vinyl span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, #111 3px, var(--game) 3.5px);
}

.game-card.playing .pv-vinyl { animation: spin 1.6s linear infinite; }

.pv-eq { display: flex; align-items: flex-end; gap: 4px; height: 44px; }

.pv-eq span {
  width: 6px;
  height: 100%;
  border-radius: 3px;
  background: var(--game);
  transform-origin: bottom;
  transform: scaleY(0.2);
  transition: transform 0.3s ease;
}

.game-card.playing .pv-eq span { animation: eqBounce 0.8s ease-in-out infinite; }
.pv-eq span:nth-child(2) { animation-delay: 0.12s !important; }
.pv-eq span:nth-child(3) { animation-delay: 0.3s !important; }
.pv-eq span:nth-child(4) { animation-delay: 0.05s !important; }
.pv-eq span:nth-child(5) { animation-delay: 0.22s !important; }

/* Rebus preview: tiles flip to emoji one by one */
.pv-tiles { display: flex; gap: 6px; transform: translateY(-8px); perspective: 400px; }

.pv-tiles span {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--panel-3);
  border: 1px solid var(--border);
  color: var(--ink-faint);
  font-weight: 700;
  font-size: 1.05rem;
}

.pv-tiles span.flip { font-size: 1.4rem; color: var(--ink); border-color: color-mix(in srgb, var(--game) 50%, transparent); animation: flipIn 0.4s var(--ease-out); }

/* Close-Up preview: zoomed into the eyes, zooms out on hover */
.pv-zoom-frame {
  position: relative;
  width: clamp(120px, 21vh, 168px);
  aspect-ratio: 3 / 2;
  border-radius: 12px;
  overflow: hidden;
  transform: translateY(-10px);
  border: 1px solid var(--border-hover);
  background: var(--panel-3);
}

.pv-zoom-frame img {
  position: absolute;
  top: 0;
  transform-origin: 0 0;
  transition: transform 0.9s var(--ease-out), opacity 0.25s ease;
}

.pv-zoom-frame.loading img { opacity: 0; transition: none; }

.pv-zoom .pv-answer {
  left: 50%;
  right: auto;
  bottom: 8px;
  white-space: nowrap;
  font-size: 0.85rem;
  padding: 0.05rem 0.65rem;
  border-radius: 999px;
  background: var(--game);
  color: var(--game-ink);
  transform: translate(-50%, 8px);
}

.pv-zoom.revealed .pv-answer { transform: translate(-50%, 0); }

/* Card body */

.card-body {
  padding: 0.95rem 1.05rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.card-icon { font-size: 1.35rem; line-height: 1; }

.card-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--game);
  background: color-mix(in srgb, var(--game) 13%, transparent);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
}

.game-card h3 {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1.1;
  margin: 0.1rem 0 0;
}

.game-card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.86rem;
  line-height: 1.45;
  flex: 1;
}

.game-card .play-btn {
  align-self: flex-start;
  margin-top: 0.35rem;
  background: var(--game);
  color: var(--game-ink);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.42rem 1rem;
  border-radius: 999px;
}

.game-card .play-btn span { display: inline-block; transition: transform 0.2s var(--ease-spring); }
.game-card:hover .play-btn span { transform: translateX(4px); }

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.25rem 1.5rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--border);
}

.site-footer a { font-weight: 600; color: var(--ink); }
.footer-note { margin-top: 0.35rem; font-size: 0.74rem; color: var(--ink-faint); }

/* ---------- Game pages ---------- */

.game-main {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem clamp(0.75rem, 3vw, 1.5rem) 7.5rem;
}

.game-shell {
  position: relative;
  background:
    radial-gradient(ellipse 70% 220px at 50% 0, color-mix(in srgb, var(--game) 10%, transparent), transparent),
    var(--panel);
  border: 1px solid var(--border);
  border-top: 3px solid var(--game);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2rem);
  text-align: center;
  animation: fadeUp 0.45s var(--ease-out) both;
}

.game-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.game-icon { font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1; }

.game-title h1 {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  margin: 0;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  line-height: 1.1;
}

.game-shell .subtitle {
  color: var(--ink-muted);
  margin: 0 auto 1.5rem;
  font-size: 0.98rem;
  max-width: 34rem;
  line-height: 1.5;
}

/* Category / difficulty picker */

.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.pick-grid-2 { max-width: 460px; margin: 0 auto; grid-template-columns: 1fr 1fr; }

.pick-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 1.25rem 0.75rem 1.1rem;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), border-color 0.15s ease, box-shadow 0.2s ease;
}

.pick-tile:hover {
  transform: translateY(-4px);
  border-color: var(--game);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 26px color-mix(in srgb, var(--game) 16%, transparent);
}

.pick-tile:active { transform: scale(0.96); }
.pick-emoji { font-size: 2.3rem; line-height: 1.2; transition: transform 0.3s var(--ease-spring); }
.pick-tile:hover .pick-emoji { transform: scale(1.15) rotate(-6deg); }
.pick-tile b { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 1.15rem; }
.pick-tile small { color: var(--ink-muted); font-size: 0.78rem; }

/* Round */

.round-head {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.round-counter { font-size: 0.85rem; color: var(--ink-muted); }

.points-badge {
  background: color-mix(in srgb, var(--game) 15%, transparent);
  color: var(--game);
  border-radius: 999px;
  padding: 0.28rem 0.85rem;
  font-weight: 700;
  font-size: 0.82rem;
}

.timer-ring {
  width: 104px;
  height: 104px;
  margin: 0 auto;
  position: relative;
  display: grid;
  place-items: center;
}

.timer-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 7; }
.timer-ring .bg { stroke: var(--border); }

.timer-ring .progress {
  stroke: var(--game);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.95s linear, stroke 0.3s ease;
}

.timer-ring .time-left {
  position: relative;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
}

.timer-ring.urgent .progress { stroke: var(--danger); }
.timer-ring.urgent { animation: urgentPulse 0.5s ease-in-out infinite; }
.timer-ring.urgent .time-left { color: var(--danger); }
.timer-ring.paused { opacity: 0.45; }

.timer-caption { font-size: 0.78rem; color: var(--ink-muted); margin-top: 0.4rem; min-height: 1.1rem; }

.clue-area {
  margin: 1.25rem 0 0.75rem;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-clue {
  font-size: clamp(3rem, 12vw, 5.5rem);
  letter-spacing: 0.3rem;
  line-height: 1.25;
}

.emoji-clue.swap { animation: popIn 0.45s var(--ease-out); }

.emoji-clue .text-part {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  vertical-align: middle;
}

.answer-reveal {
  min-height: 3.6rem;
  margin: 0.75rem 0 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.answer-text {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 5.5vw, 2.6rem);
  line-height: 1.1;
  color: var(--game);
  animation: revealText 0.5s var(--ease-out) both;
}

.answer-reveal .sub {
  display: block;
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin-top: 0.25rem;
  animation: fadeUp 0.4s 0.15s var(--ease-out) both;
}

.answer-reveal .pending { color: var(--ink-faint); font-size: 0.95rem; }

/* Award bar: one big button per team */

.award-bar { gap: 0.75rem; }

.btn-team {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.8rem 1.1rem 0.8rem 1.4rem;
  min-width: 150px;
  justify-content: space-between;
}

.btn-team.team1 { background: var(--team1); color: var(--team1-ink); }
.btn-team.team2 { background: var(--team2); color: var(--team2-ink); }
.btn-team.team1:hover { box-shadow: 0 0 0 5px color-mix(in srgb, var(--team1) 25%, transparent); }
.btn-team.team2:hover { box-shadow: 0 0 0 5px color-mix(in srgb, var(--team2) 25%, transparent); }

.award-name { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.award-pts {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* Movie */

.tamil-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin: 1.25rem 0 0.5rem;
  perspective: 900px;
}

.clue-img-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel-2);
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  animation: flipIn 0.5s var(--ease-out) both;
}

.clue-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.clue-img-wrap img.loaded { opacity: 1; }

.placeholder-art { color: var(--ink-muted); padding: 0.75rem; font-size: 0.8rem; }

.placeholder-art .num {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.3rem;
  color: var(--ink);
}

/* Close-Up */

.closeup-stage { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; width: 100%; }

.feature-label {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: clamp(1.3rem, 3.6vh, 2.2rem);
  color: var(--game);
  line-height: 1.1;
}

.zoom-frame {
  position: relative;
  width: min(100%, calc((100svh - 300px) * 1.5));
  min-width: 240px;
  aspect-ratio: 3 / 2;
  border-radius: 22px;
  overflow: hidden;
  background: #0d0d10;
  border: 1px solid var(--border-hover);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 60px color-mix(in srgb, var(--game) 12%, transparent);
}

.zoom-img {
  position: absolute;
  top: 0;
  max-width: none;
  transform-origin: 0 0;
  transition: transform 1s var(--ease-out), opacity 0.25s ease;
}

/* Blurred copy fills the sides once the full (portrait) photo is shown. */
.zoom-backdrop {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  object-fit: cover;
  filter: blur(28px) brightness(0.45);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.zoom-frame.revealed .zoom-backdrop { opacity: 1; }

/* While a new photo loads nothing is visible — no flash of the full face. */
.zoom-frame.loading .zoom-img,
.zoom-frame.loading .zoom-backdrop { opacity: 0; transition: none; }

.zoom-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background:
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--game) 18%, #111114) 0 14px, #111114 14px 28px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.zoom-cover span { font-size: clamp(2rem, 7vh, 4rem); }
.zoom-cover b { font-family: 'Baloo 2', sans-serif; font-size: clamp(1.3rem, 4vh, 2.2rem); color: var(--game); }
.zoom-frame.timed-out .zoom-cover { opacity: 1; }

/* BGM */

.bgm-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  margin: 0.5rem 0;
}

.bgm-play-btn {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: none;
  transition: transform 0.2s var(--ease-spring), filter 0.2s ease;
}

.bgm-vinyl {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 26%, rgba(255, 255, 255, 0.04) 26.5% 27%, transparent 27.5%),
    radial-gradient(circle, var(--game) 0 25%, transparent 25.5%),
    repeating-radial-gradient(circle, #101013 0 2px, #1c1c21 2px 4px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border);
}

.bgm-vinyl::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 30deg, transparent 0 20%, rgba(255, 255, 255, 0.07) 25%, transparent 30% 70%, rgba(255, 255, 255, 0.05) 75%, transparent 80%);
}

.bgm-play-icon {
  position: relative;
  font-size: 1.9rem;
  color: var(--game-ink);
  padding-left: 0.2rem;
}

.bgm-play-btn:hover:not([disabled]) { transform: scale(1.05); }
.bgm-play-btn:active:not([disabled]) { transform: scale(0.96); }
.bgm-play-btn[disabled] { cursor: default; filter: grayscale(0.7) brightness(0.7); }

.bgm-stage.playing .bgm-vinyl { animation: spin 1.8s linear infinite; }
.bgm-stage.playing .bgm-play-icon { font-size: 0; padding-left: 0; }
.bgm-stage.playing .bgm-play-icon::before { content: "❚❚"; font-size: 1.4rem; }

.bgm-eq { display: flex; align-items: flex-end; gap: 5px; height: 40px; }

.bgm-eq span {
  width: 7px;
  height: 100%;
  border-radius: 4px;
  background: var(--game);
  transform-origin: bottom;
  transform: scaleY(0.12);
  opacity: 0.6;
  transition: transform 0.3s ease;
}

.bgm-stage.playing .bgm-eq span { animation: eqBounce 0.85s ease-in-out infinite; opacity: 1; }
.bgm-eq span:nth-child(2) { animation-delay: 0.15s !important; }
.bgm-eq span:nth-child(3) { animation-delay: 0.32s !important; }
.bgm-eq span:nth-child(4) { animation-delay: 0.08s !important; }
.bgm-eq span:nth-child(5) { animation-delay: 0.4s !important; }
.bgm-eq span:nth-child(6) { animation-delay: 0.22s !important; }
.bgm-eq span:nth-child(7) { animation-delay: 0.5s !important; }

.bgm-status { color: var(--ink-muted); font-size: 0.88rem; min-height: 1.2rem; }

/* Rebus */

.rebus-tiles {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0 0.5rem;
  perspective: 600px;
}

.rebus-tile {
  width: 92px;
  height: 92px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 2.6rem;
}

.rebus-tile.hidden-tile { font-size: 1.5rem; font-weight: 700; color: var(--ink-faint); border-style: dashed; }
.rebus-tile.revealed { border-color: color-mix(in srgb, var(--game) 45%, transparent); animation: flipIn 0.45s var(--ease-out) both; }

/* Result */

.result-trophy { font-size: 4rem; line-height: 1; animation: trophy 0.8s var(--ease-out) both; }

.result-headline {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: clamp(1.4rem, 4vw, 2rem);
  line-height: 1.2;
  margin: 0.75rem 0 1rem;
}

.result-night {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.7rem 1.25rem;
  margin-bottom: 0.5rem;
}

.result-night > span { font-size: 0.75rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.result-night strong { font-family: 'Baloo 2', sans-serif; font-size: 1.25rem; }

/* Host hint */

.host-hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin: 1rem 0 0;
}

kbd {
  font-family: inherit;
  font-size: 0.72rem;
  background: var(--panel-2);
  border: 1px solid var(--border-hover);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.05rem 0.4rem;
  color: var(--ink-muted);
}

@media (hover: none) { .host-hint { display: none; } }

/* ---------- Scoreboard (bottom corners, game pages) ---------- */

.scoreboard {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  pointer-events: none;
  z-index: 15;
}

.score-pill {
  --team: var(--team1);
  text-align: center;
  background: rgba(19, 19, 22, 0.88);
  border: 1px solid color-mix(in srgb, var(--team) 40%, transparent);
  border-bottom: 3px solid var(--team);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 0.5rem 1.2rem 0.45rem;
  min-width: 110px;
}

.score-pill.team2 { --team: var(--team2); }
.score-pill.bump { animation: bump 0.5s var(--ease-spring); }

.score-team {
  font-size: 0.74rem;
  color: var(--team);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.score-value {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.score-caption { font-size: 0.62rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; }

.fly-points {
  --chip: var(--reveal);
  position: fixed;
  z-index: 80;
  pointer-events: none;
  transform: translate(-50%, -50%);
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  color: var(--chip);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;
}

/* ---------- Teams modal ---------- */

.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}

.settings-overlay.open { display: flex; animation: fadeUp 0.2s ease both; }

.settings-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 620px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  text-align: left;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.settings-panel-header { display: flex; align-items: center; justify-content: space-between; }

.settings-panel-header h2 {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  margin: 0;
}

.settings-close {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.settings-close:hover { color: var(--ink); }

.settings-panel .subtitle { color: var(--ink-muted); font-size: 0.88rem; margin: 0.2rem 0 1.1rem; }
.settings-panel .controls { justify-content: flex-start; }

.team-setup { display: flex; flex-wrap: wrap; gap: 1rem; }

.team-setup-col {
  --team: var(--team1);
  flex: 1;
  min-width: 230px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-top: 3px solid var(--team);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}

.team-setup-col.team2 { --team: var(--team2); }

.team-setup-col label {
  display: block;
  font-size: 0.76rem;
  color: var(--ink-muted);
  font-weight: 600;
  margin: 0.75rem 0 0.35rem;
}

.team-setup-col label:first-child { margin-top: 0; color: var(--team); }

.team-setup-col input[type="text"] {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
}

.team-setup-col input[type="text"]:focus { outline: none; border-color: var(--team); }

.player-input-row { display: flex; gap: 0.4rem; }
.player-input-row input { flex: 1; }
.player-input-row .btn { padding: 0.5rem 0.95rem; font-size: 1rem; line-height: 1; }

.player-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }

.player-chip {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.5rem 0.25rem 0.75rem;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.player-chip button {
  background: none;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.1rem;
}

.player-chip button:hover { color: var(--ink); }

.score-adjust {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.score-adjust span { margin-right: auto; }
.score-adjust .icon-btn { width: 32px; height: 32px; }

.score-adjust strong {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.4rem;
  color: var(--team);
  min-width: 2.2rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------- Small screens ---------- */

/* Below ~1180px the game column reaches the corners, so the scoreboard moves
   up into the sticky header where it can never cover the buttons. */
@media (max-width: 1180px) {
  .scoreboard {
    top: 0;
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    height: 62px;
    padding: 0;
    align-items: center;
    gap: 0.5rem;
    z-index: 25;
  }
  .score-pill { min-width: 0; padding: 0.3rem 0.75rem; display: flex; align-items: center; gap: 0.5rem; border-radius: 12px; border-bottom-width: 1px; border-color: var(--team); }
  .score-pill.team2 { flex-direction: row-reverse; }
  .score-value { font-size: 1.3rem; }
  .score-team { max-width: 120px; font-size: 0.68rem; }
  .score-caption { display: none; }
  .game-main { padding-bottom: 3rem; }
}

@media (max-width: 640px) {
  .match { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .match-mid { grid-column: 1 / -1; grid-row: 1; flex-direction: row; max-width: none; gap: 0.6rem; margin-bottom: 0.4rem; }
  .match-vs { width: 38px; height: 38px; font-size: 0.85rem; }
  .match-team { padding: 0.8rem 0.85rem; flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .match-team.team2 { flex-direction: column; align-items: flex-end; }
  .match-info { width: 100%; }
  .match-name { font-size: 1.15rem; }
  .match-score { font-size: 2.8rem; }
  .match-foot { justify-content: center; }
  .games-head h2 { font-size: 1.2rem; }
  .card-stage { height: 120px; }
}

@media (max-width: 560px) {
  .site-header { padding: 0.6rem 0.85rem; gap: 0.6rem; }
  .logo img { height: 28px; }
  .settings-trigger { padding: 0.45rem 0.75rem; }
  .tamil-images { gap: 0.45rem; }
  .rebus-tile { width: 70px; height: 70px; font-size: 2rem; }
  .scoreboard { height: 57px; gap: 0.35rem; }
  .site-header .back-link { display: none; }
  .site-header .settings-trigger { width: 38px; padding: 0; }
  .site-header .settings-trigger .label { display: none; }
  .score-team { display: none; }
  .score-pill { padding: 0.15rem 0.7rem; }
  .award-bar { gap: 0.5rem; }
  .btn-team { min-width: 0; flex: 1; font-size: 0.95rem; padding: 0.7rem 0.55rem 0.7rem 0.9rem; gap: 0.35rem; }
  .award-pts { font-size: 0.75rem; padding: 0.1rem 0.4rem; }
  .bgm-play-btn { width: 124px; height: 124px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .game-card { transform: none !important; }
}

/* ---------- Round layout: stage + side panel ----------
   On landscape screens (laptops, TVs) the round splits into two columns so
   everything fits one 16:9 screen with no scrolling. */

.round-layout { display: flex; flex-direction: column; gap: 1rem; }
.round-stage { display: flex; align-items: center; justify-content: center; min-width: 0; }
.round-side { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; min-width: 0; }
.round-side .round-head { margin-bottom: 0.4rem; }
.round-side .controls { margin-top: 0.6rem; }

.btn-reveal { background: var(--panel-3); color: var(--ink); border-color: var(--border-hover); }
.btn-reveal:hover { border-color: var(--game); }

.points-badge.awarded.team1 { background: color-mix(in srgb, var(--team1) 18%, transparent); color: var(--team1); }
.points-badge.awarded.team2 { background: color-mix(in srgb, var(--team2) 18%, transparent); color: var(--team2); }

.answer-reveal .time-up { color: var(--danger); font-weight: 600; }

.bgm-buttons { display: flex; gap: 0.5rem; }

@media (min-width: 860px) and (min-aspect-ratio: 5/4) {
  .game-main { max-width: 1280px; }
  .round-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
    gap: clamp(1.25rem, 3vw, 3rem);
    align-items: center;
  }
  .round-stage { min-height: calc(100svh - 280px); }
  .round-side { padding-left: clamp(1rem, 2vw, 2rem); border-left: 1px solid var(--border); }
}

/* Height-driven sizing so game pages fit a TV / laptop screen. */
@media (min-width: 860px) and (min-aspect-ratio: 5/4) { body[data-game] { height: 100svh; } }
body[data-game] .game-main { padding-top: clamp(0.6rem, 2vh, 1.5rem); padding-bottom: 0.5rem; display: flex; flex-direction: column; min-height: 0; }
body[data-game] .game-shell { padding: clamp(0.9rem, 2.4vh, 1.75rem) clamp(1rem, 2.5vw, 2rem); }
body[data-game] .game-title { margin-bottom: clamp(0.25rem, 1.2vh, 0.75rem); }
body[data-game] .game-title h1 { font-size: clamp(1.5rem, 4vh, 2.4rem); }
body[data-game] .game-icon { font-size: clamp(1.4rem, 3.6vh, 2.2rem); }
body[data-game] .site-footer { padding: 0.5rem 1rem; font-size: 0.74rem; }
body[data-game] .site-footer .footer-note { display: inline; margin: 0 0 0 0.35rem; }
body[data-game] .host-hint { margin-top: 0.6rem; }
.timer-ring { width: clamp(72px, 13vh, 120px); height: clamp(72px, 13vh, 120px); }
.timer-ring .time-left { font-size: clamp(1.4rem, 3.6vh, 2.2rem); }
.emoji-clue { font-size: clamp(3rem, 15vh, 9rem); }
.clue-area { min-height: 0; margin: 0; }
.answer-text { font-size: clamp(1.6rem, 4.6vh, 2.9rem); }
.tamil-images { width: min(100%, calc((100svh - 300px) / 1.5 * 3 + 1.7rem)); margin: 0 auto; }
.rebus-tile { width: clamp(64px, min(15vh, 19vw), 140px); height: clamp(64px, min(15vh, 19vw), 140px); font-size: clamp(1.9rem, min(8vh, 10vw), 4.4rem); }
.bgm-play-btn { width: clamp(120px, min(26vh, 45vw), 240px); height: clamp(120px, min(26vh, 45vw), 240px); }

/* Homepage: scale with the screen height so logo, scoreboard and all five
   cards fit a 16:9 screen. */
body.home .landing {
  padding-top: clamp(1rem, 3vh, 3rem);
  padding-bottom: clamp(0.75rem, 2vh, 2rem);
  gap: clamp(0.9rem, 2.6vh, 2.25rem);
  justify-content: center;
}
body.home .landing-logo { width: clamp(180px, 30vh, 420px); }
body.home .landing-tagline { font-size: clamp(0.9rem, 1.9vh, 1.15rem); margin-top: 0.25rem; }
body.home .match { padding: clamp(0.75rem, 1.8vh, 1.5rem); }
body.home .match-score { font-size: clamp(2.4rem, 6.5vh, 4.5rem); }
body.home .match-foot { margin-top: clamp(0.5rem, 1.4vh, 1rem); padding-top: clamp(0.5rem, 1.2vh, 0.9rem); }
body.home .games-head { margin-bottom: clamp(0.5rem, 1.4vh, 1rem); }
body.home .card-stage { height: clamp(96px, 15vh, 170px); }
body.home .site-footer { padding: 0.6rem 1rem; }
body.home .footer-note { display: inline; margin-left: 0.35rem; }

@media (max-height: 820px) and (min-width: 721px) {
  body.home .game-card p { display: none; }
  body.home .card-body { gap: 0.25rem; padding: 0.7rem 0.95rem 0.8rem; }
  body.home .match-team { padding: 0.55rem 1.1rem; }
  body.home .match-foot { margin-top: 0.5rem; padding-top: 0.5rem; }
  body.home .match-foot .btn-small { padding: 0.3rem 0.8rem; }
  body.home .match-vs { width: 46px; height: 46px; font-size: 1rem; }
  body.home .landing { gap: 0.8rem; padding-top: 0.8rem; padding-bottom: 0.6rem; }
}

/* Big landscape screens (full-HD TVs, large monitors): scale the whole UI up
   so it reads from the sofa, and let the game area use the extra width. */
@media (min-width: 1600px) and (min-height: 950px) {
  html { font-size: 20px; }
  body.home .game-card p { display: none; }
}

@media (min-width: 860px) and (min-aspect-ratio: 5/4) {
  .game-main { max-width: min(1700px, 160vh); }
  body.home .landing { max-width: min(1500px, 140vh); }
}

/* Close-Up: the photo is the reveal control (no "Show answer" button). */
.zoom-frame { cursor: pointer; }
.zoom-frame.loading,
.zoom-frame.revealed { cursor: default; }
.zoom-cover small {
  margin-top: 0.4rem;
  font-size: clamp(0.85rem, 2vh, 1.1rem);
  font-weight: 600;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-hover);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.zoom-frame.timed-out:hover .zoom-cover small { background: var(--game); color: var(--game-ink); border-color: var(--game); }
.zoom-frame:focus-visible { outline: 3px solid var(--game); outline-offset: 3px; }

.zoom-hint {
  position: absolute;
  left: 50%;
  bottom: 0.9rem;
  transform: translate(-50%, 8px);
  font-size: clamp(0.8rem, 1.8vh, 1rem);
  font-weight: 600;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--border-hover);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.3s var(--ease-out);
}
.zoom-frame.awarded .zoom-hint { opacity: 1; transform: translate(-50%, 0); }

/* All games: the stage becomes the reveal control. "Time's up" covers the
   clue and is one big click target; after a team scores, a pill appears. */
.round-stage.has-cover { position: relative; }

.stage-cover {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 150px;
  border-radius: var(--radius);
  border: 1px solid var(--border-hover);
  color: var(--ink);
  cursor: pointer;
  background:
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--game) 18%, #111114) 0 14px, #111114 14px 28px);
  animation: fadeUp 0.25s ease both;
}

.round-stage.timed-out .stage-cover { display: flex; }
.stage-cover span { font-size: clamp(2rem, 7vh, 4rem); line-height: 1.1; }
.stage-cover b { font-family: 'Baloo 2', sans-serif; font-size: clamp(1.4rem, 4.2vh, 2.4rem); color: var(--game); }

.stage-cover small {
  margin-top: 0.4rem;
  font-size: clamp(0.85rem, 2vh, 1.1rem);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-hover);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.stage-cover:hover small { background: var(--game); color: var(--game-ink); border-color: var(--game); }
.stage-cover:focus-visible, .stage-hint:focus-visible { outline: 3px solid var(--game); outline-offset: 3px; }

.stage-hint {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 0.5rem;
  transform: translateX(-50%);
  display: none;
  white-space: nowrap;
  font-size: clamp(0.85rem, 2vh, 1.05rem);
  font-weight: 600;
  color: var(--ink);
  background: rgba(10, 10, 12, 0.85);
  border: 1px solid var(--game);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  animation: fadeUp 0.25s ease both;
}

.stage-hint:hover { background: var(--game); color: var(--game-ink); }
.round-stage.show-hint .stage-hint { display: block; }
