/* TV board for the Cast receiver. Layout and colours follow design-proposals/tv (shared.css + tv.css).
   The page draws a fixed 1920 x 1080 stage that app.js scales to the viewport, so 1rem = 16px on the stage. */

@font-face {
  font-family: Nunito;
  src: url(assets/nunito-latin-ext.woff2) format("woff2");
  font-style: normal;
  font-weight: 600 1000;
  font-display: block;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Nunito;
  src: url(assets/nunito-latin.woff2) format("woff2");
  font-style: normal;
  font-weight: 600 1000;
  font-display: block;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #082b4a;
  --cream: #fff3d8;
  --paper: #f2fbfa;
  --lime: #a9db1e;
  --lime-light: #def56d;
  --blue: #1286ff;
  --orange: #ff6a18;
  --pink: #ff3f78;
  --rim: rgb(255 255 255 / .54);
  --shadow: rgb(8 43 74 / .18);
  --stage-bg:
    radial-gradient(ellipse at 0 0, rgb(204 253 246 / .27), transparent 45%),
    linear-gradient(146deg, #61bdc5 0%, #3c929f 35%, #23576e 76%, #123651 100%);
}

* { box-sizing: border-box; }
html, body, h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-inline-size: 100%; }
html { font-size: 16px; }
html, body {
  block-size: 100%;
  overflow: hidden;
  background: #23576e;
}
body { background: var(--stage-bg); }

/* A black layer dims the whole picture, including areas outside the scaled stage. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  background: black;
  opacity: 0;
  transition: opacity 1.5s ease;
}
.is-dimmed body::after { opacity: 0.75; }

/* Fixed design canvas, scaled from the top-left corner by app.js. */
#stage {
  position: absolute;
  inset: 0 auto auto 0;
  inline-size: 1920px;
  block-size: 1080px;
  overflow: hidden;
  transform-origin: 0 0;
  isolation: isolate;
  color: var(--ink);
  font-family: Nunito, system-ui, sans-serif;
  font-weight: 750;
  background: var(--stage-bg);
}

.screen {
  --origin-y: 25%;
  position: absolute;
  inset: 0;
  isolation: isolate;
}
/* Seven light rays from StageBackground / AnimatedLightRays, static to keep the TV hardware idle. */
.screen::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: .81;
  background: conic-gradient(from 0deg at 50% var(--origin-y),
    transparent 0deg 13deg, #e5ffff39 13deg 31deg,
    transparent 31deg 55deg, #e5ffff2a 55deg 69deg,
    transparent 69deg 100deg, #e5ffff38 100deg 118deg,
    transparent 118deg 145deg, #e5ffff30 145deg 161deg,
    transparent 161deg 192deg, #e5ffff26 192deg 212deg,
    transparent 212deg 238deg, #e5ffff25 238deg 254deg,
    transparent 254deg 330deg, #e5ffff31 330deg 346deg,
    transparent 346deg);
  -webkit-mask-image: radial-gradient(ellipse 89% 110% at 50% var(--origin-y), transparent 3%, #000 12%, #000 63%, transparent 100%);
  mask-image: radial-gradient(ellipse 89% 110% at 50% var(--origin-y), transparent 3%, #000 12%, #000 63%, transparent 100%);
}
/* Christmas theme: snow behind every screen (app.js `snow`). */
.snow { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.snow i {
  position: absolute;
  inset: -1.5rem auto auto var(--x);
  inline-size: var(--s);
  block-size: var(--s);
  border-radius: 50%;
  background: #fff;
  opacity: var(--o);
  animation: snow-fall var(--d) linear var(--delay) infinite;
}
@keyframes snow-fall { to { transform: translate3d(var(--drift), 1130px, 0); } }

.screen.is-entering { animation: screen-in .5s cubic-bezier(.2, .8, .2, 1) both; }
.screen.is-leaving { animation: screen-out .35s ease-in both; pointer-events: none; }
@keyframes screen-in { from { opacity: 0; transform: translateY(2rem) scale(.985); } }
@keyframes screen-out { to { opacity: 0; transform: translateY(-1.25rem); } }

/* 5% overscan-safe margins: 54px vertical, 96px horizontal. */
.safe-tv {
  display: grid;
  inline-size: 100%;
  block-size: 100%;
  padding: 54px 96px;
  min-inline-size: 0;
}

.num { font-variant-numeric: tabular-nums; }

/* Avatars: FamilyAvatar palette as soft gradients. */
.avatar {
  --av-a: #bbf4f2;
  --av-b: #53ccd6;
  --av-fg: var(--ink);
  display: grid;
  place-items: center;
  flex: none;
  aspect-ratio: 1;
  overflow: hidden;
  border: .075em solid var(--rim);
  border-radius: 50%;
  background: linear-gradient(160deg, var(--av-a), var(--av-b));
  color: var(--av-fg);
  line-height: 1;
}
.avatar img { inline-size: 94%; block-size: 94%; object-fit: contain; }
.avatar .av-text { font-weight: 1000; font-size: 2.15em; letter-spacing: -.02em; white-space: nowrap; }
.avatar .av-emoji { font-size: 3.4em; font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; }
.avatar.c-aqua { --av-a: #bbf4f2; --av-b: #53ccd6; }
.avatar.c-lime { --av-a: #eefaa8; --av-b: #a9db1e; }
.avatar.c-gold { --av-a: #fff0b0; --av-b: #ffc928; }
.avatar.c-orange { --av-a: #ffd2a8; --av-b: #ff8a45; }
.avatar.c-coral { --av-a: #ffd0dd; --av-b: #ff7099; }
.avatar.c-cream { --av-a: #fffbf1; --av-b: #fff3d8; border-color: rgb(8 43 74 / .22); }
.avatar.c-navy { --av-a: #24557e; --av-b: #082b4a; --av-fg: #fff; }
.avatar.c-purple { --av-a: #9d7be6; --av-b: #7046c7; --av-fg: #fff; }

.cast-icon {
  position: relative;
  display: inline-block;
  flex: none;
  inline-size: 1.2em;
  block-size: .85em;
  border: .09em solid currentColor;
  border-radius: .12em;
}
.cast-icon::after {
  position: absolute;
  inset: auto auto -.11em -.11em;
  inline-size: .63em;
  block-size: .63em;
  content: "";
  background:
    radial-gradient(circle at 0 100%, currentColor 0 .12em, transparent .15em .24em, currentColor .27em .34em, transparent .37em .46em, currentColor .49em .56em, transparent .59em);
  box-shadow: 0 0 0 .03em var(--cast-cutout, var(--paper));
  border-start-end-radius: 100%;
  background-color: var(--cast-cutout, var(--paper));
}
.status-dot { display: block; flex: none; inline-size: .49em; aspect-ratio: 1; border-radius: 50%; background: var(--lime-light); }
.joke { text-align: center; text-wrap: balance; }
.joke p + p { margin-block-start: .3em; font-weight: 950; }
.joke .is-new { animation: punchline-in .6s ease-out both; }
.joke .punch-slot { visibility: hidden; }
@keyframes punchline-in { from { opacity: 0; transform: translateY(.4em); } }

/* ---------- Idle ---------- */
.screen-idle { --origin-y: 36%; --logo-height: 480px; }
.screen-idle::before { opacity: 1; }
.idle-content {
  position: absolute;
  inset-block-start: calc(1080px * .36 - var(--logo-height) / 2);
  inset-inline: 96px;
  display: grid;
  justify-items: center;
  gap: 1rem;
}
.idle-content .brand {
  inline-size: auto;
  block-size: var(--logo-height);
  object-fit: contain;
  filter: drop-shadow(0 .55rem .5rem rgb(8 43 74 / .2));
}
.idle-panel {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: .65rem;
  inline-size: min(100%, 55rem);
  min-block-size: 14.75rem;
  padding: 1.8rem 3rem 1.45rem;
  border: .1rem solid #c2e9ef66;
  border-radius: 2rem;
  background: #123954;
  box-shadow: 0 .75rem 1.75rem var(--shadow);
  color: #fff;
  text-align: center;
}
.idle-status {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: #d3edf2;
  font-size: 1.8rem;
  font-weight: 850;
}
.idle-panel .joke {
  min-block-size: 2.5em;
  font-size: 3.3rem;
  font-weight: 900;
  line-height: 1.1;
}
.idle-panel .joke p + p { color: var(--lime-light); }
.idle-connect { align-content: center; }
.idle-connect h1 { font-size: 3.3rem; font-weight: 1000; line-height: 1.04; }
.idle-connect p { color: #d3edf2; font-size: 2.25rem; line-height: 1.2; text-wrap: balance; }
.cast-label { color: var(--lime-light); white-space: nowrap; }
.idle-connect .cast-icon { --cast-cutout: #123954; margin-inline-start: .2em; vertical-align: -.045em; }

/* ---------- Shared headings ---------- */
.tv-heading {
  color: #fff;
  text-align: center;
  text-wrap: balance;
  font-size: 4.65rem;
  line-height: 1.02;
  font-weight: 950;
  letter-spacing: -.025em;
  text-shadow: 0 .16rem .55rem rgb(8 43 74 / .26);
  overflow-wrap: anywhere;
}
.brand { inline-size: 29rem; filter: drop-shadow(0 .55rem .5rem rgb(8 43 74 / .2)); }

/* ---------- Matchup ---------- */
.matchup {
  display: grid;
  justify-items: center;
  justify-self: center;
  align-self: center;
  gap: 1.6rem;
  inline-size: min(100%, 73rem);
}
.matchup .brand { inline-size: 26rem; margin-block-end: .15rem; }
.matchup .tv-heading { font-size: 3.4rem; }
.matchup-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5rem minmax(0, 1fr);
  inline-size: 100%;
  gap: 1.5rem;
  align-items: center;
}
.matchup-team { display: grid; justify-items: center; gap: .85rem; color: #fff; text-align: center; }
.matchup-team .avatar { inline-size: 12rem; font-size: 2rem; box-shadow: 0 .6rem 1rem var(--shadow); }
.matchup-team h2 { font-size: 3rem; font-weight: 1000; line-height: 1.1; overflow-wrap: anywhere; }
.versus {
  display: grid;
  place-items: center;
  inline-size: 5rem;
  aspect-ratio: 1;
  background: #ffd36b;
  border-radius: 50%;
  font-size: 2.05rem;
  font-weight: 1000;
}
.matchup .joke {
  inline-size: min(100%, 47rem);
  padding: 1.05rem 2rem;
  border-radius: 1.85rem;
  background: var(--paper);
  box-shadow: 0 .6rem 1.2rem var(--shadow);
  font-size: 2.1rem;
  line-height: 1.12;
}

/* ---------- Round board ---------- */
.tv-board {
  inline-size: min(100%, 96rem);
  justify-self: center;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 1.25rem;
  min-block-size: 0;
}
.scorebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15.5rem minmax(0, 1fr);
  min-block-size: 10.25rem;
  background: rgb(8 43 74 / .94);
  color: #fff;
  border-radius: 2.15rem;
  box-shadow: 0 .75rem 1.75rem var(--shadow);
  overflow: hidden;
}
.scorebar.pulse { animation: bar-pulse .55s ease-out; }
@keyframes bar-pulse { 40% { transform: scale(1.012); } }
.score-team {
  position: relative;
  display: grid;
  grid-template-columns: 6.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.35rem;
  min-inline-size: 0;
  padding: 1.35rem 2rem;
  border-block-end: .45rem solid transparent;
  transition: border-color .35s ease;
}
.score-team.right { grid-template-columns: auto minmax(0, 1fr) 6.25rem; }
.score-team.right .avatar { grid-column: 3; grid-row: 1; }
.score-team.right .team-ident { grid-column: 2; grid-row: 1; justify-items: end; text-align: end; }
.score-team.right .team-score { grid-column: 1; grid-row: 1; }
.score-team .avatar { inline-size: 6.25rem; font-size: 1rem; }
.score-team::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0;
  background: linear-gradient(0deg, rgb(169 219 30 / .32), transparent 80%);
}
.score-team { z-index: 0; }
.score-team.flash::after { animation: side-flash 1.4s ease-out; }
@keyframes side-flash { 15%, 55% { opacity: 1; } }
.team-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1.06;
  overflow-wrap: anywhere;
}
.team-ident { display: grid; justify-items: start; gap: .6rem; min-inline-size: 0; }
.team-score { font-size: 4.65rem; font-weight: 1000; line-height: .98; }
.score-team.is-active { border-color: var(--lime); }
.pool {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .12rem;
  background: rgb(255 255 255 / .066);
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.1;
}
.pool-points { font-size: 4.8rem; font-weight: 1000; color: var(--lime-light); line-height: .98; }
.pool-multiplier { color: var(--lime-light); font-size: 1.85rem; }
.steal-badge {
  padding: .24rem .85rem;
  border-radius: 4rem;
  background: #ffcd79;
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 950;
  line-height: 1.12;
}
.board-area {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(70%, 66rem) minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  min-block-size: 0;
}
.hearts { display: inline-flex; align-items: center; gap: .27em; flex: none; }
.board-lives {
  grid-row: 1;
  flex-direction: column;
  gap: .14em;
  font-size: 5.75rem;
}
.board-lives.is-blue { grid-column: 1; --life-rim: #dbf4ff; --life-fill: linear-gradient(150deg, #6cdbff, var(--blue) 82%); }
.board-lives.is-orange { grid-column: 3; --life-rim: #ffe8c5; --life-fill: linear-gradient(150deg, #ffbd75, var(--orange) 82%); }
.board-lives.is-entering { animation: hearts-in .55s cubic-bezier(.2, .9, .3, 1.25) both; }
@keyframes hearts-in { from { opacity: 0; transform: scale(.4); } }
.heart {
  position: relative;
  display: block;
  inline-size: 1em;
  block-size: 1em;
  background: var(--life-rim);
  clip-path: polygon(50% 21%, 60% 10%, 75% 7%, 88% 13%, 96% 24%, 98% 40%, 92% 55%, 77% 71%, 50% 94%, 23% 71%, 8% 55%, 2% 40%, 4% 24%, 12% 13%, 25% 7%, 40% 10%);
}
.heart::before {
  position: absolute;
  inset: 0;
  clip-path: inherit;
  transform: scale(.87);
  background: var(--life-fill);
  content: "";
}
/* Shadow without CSS filters: a darker copy of the shape just below. */
.heart-wrap { position: relative; display: block; inline-size: 1em; block-size: 1em; }
.heart-wrap::before {
  position: absolute;
  inset: 0;
  transform: translateY(.045em);
  content: "";
  background: rgb(8 43 74 / .2);
  clip-path: polygon(50% 21%, 60% 10%, 75% 7%, 88% 13%, 96% 24%, 98% 40%, 92% 55%, 77% 71%, 50% 94%, 23% 71%, 8% 55%, 2% 40%, 4% 24%, 12% 13%, 25% 7%, 40% 10%);
}
.heart.spent { --life-rim: #84b5c1; --life-fill: #2c6276; }
.heart.losing { animation: heart-lose .6s ease-out; }
@keyframes heart-lose { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }

.miss-mark {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  inline-size: 10rem;
  aspect-ratio: 1;
  border: .27rem solid #ffc2cf;
  border-radius: 2.2rem;
  background: #a71849;
  color: #fff;
  box-shadow: 0 .6rem 1.5rem rgb(60 14 41 / .32);
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-8deg) scale(.5);
  visibility: hidden;
}
.miss-mark::before {
  inline-size: 58%;
  aspect-ratio: 1;
  background: currentColor;
  clip-path: polygon(14% 0, 50% 36%, 86% 0, 100% 14%, 64% 50%, 100% 86%, 86% 100%, 50% 64%, 14% 100%, 0 86%, 36% 50%, 0 14%);
  content: "";
}
.miss-mark.is-held { visibility: visible; opacity: 1; transform: translate(-50%, -50%) rotate(-8deg); }
.miss-mark.show { visibility: visible; animation: miss-pop 1.2s ease-out both; }
@keyframes miss-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-20deg) scale(.4); }
  14% { opacity: 1; transform: translate(-50%, -50%) rotate(-5deg) scale(1.12); }
  24%, 78% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(.92); }
}

.answer-board {
  --answer-size: 3.2rem;
  display: grid;
  grid-area: 1 / 2;
  inline-size: 100%;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: minmax(6.5rem, max-content);
  gap: .7rem;
  padding: 1.1rem;
  border: .1rem solid rgb(238 255 255 / .6);
  border-radius: 2.6rem;
  background: rgb(198 239 239 / .67);
  box-shadow: 0 .8rem 1.9rem var(--shadow);
  perspective: 90rem;
}
.answer-board.is-shaking { animation: shake .45s ease-in-out; }
.answer-tile {
  position: relative;
  min-inline-size: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .6em;
  align-items: center;
  padding: .625rem 1.55rem .625rem 1.75rem;
  background: #fffcf1;
  border-radius: 1.65rem;
  font-size: var(--answer-size);
  font-weight: 950;
  line-height: 1.04;
  overflow-wrap: anywhere;
}
.answer-tile::after {
  position: absolute;
  inset: 0;
  content: "";
  border: .4rem solid var(--lime-light);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
}
.answer-points {
  min-inline-size: 2.23em;
  padding: .23em .27em;
  border-radius: .38em;
  background: #e6f3bc;
  text-align: center;
  font-size: .98em;
  font-weight: 1000;
}
.answer-tile.is-hidden {
  grid-template-columns: 1fr;
  justify-items: center;
  border: .12rem solid rgb(24 82 103 / .16);
  background: rgb(11 65 88 / .11);
}
/* Uncovered after the round without a guess. */
.answer-tile.is-uncovered { background: rgb(255 252 241 / .62); color: #31566c; }
.answer-tile.is-uncovered .answer-points { background: rgb(255 255 255 / .55); }
.answer-tile.flip { animation: tile-flip .7s cubic-bezier(.2, .7, .3, 1.15) both; }
.answer-tile.flip::after { animation: tile-glow 1.5s ease-out .35s both; }
.answer-tile.appear { animation: tile-appear .5s ease-out both; }
.answer-tile.shake { animation: shake .5s ease-in-out; }
.answer-tile.shake::after { border-color: #ffcd79; animation: tile-glow .9s ease-out both; }
@keyframes tile-flip {
  0% { transform: rotateX(90deg); }
  60% { transform: rotateX(-12deg); }
  100% { transform: rotateX(0); }
}
@keyframes tile-glow { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tile-appear { from { opacity: .3; transform: translateY(.5rem); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-1rem); }
  40% { transform: translateX(.9rem); }
  60% { transform: translateX(-.6rem); }
  80% { transform: translateX(.35rem); }
}
.lock-icon {
  position: relative;
  display: block;
  inline-size: .76em;
  block-size: .56em;
  margin-block-start: .22em;
  border: .074em solid #35657a;
  border-radius: .115em;
}
.lock-icon::before {
  position: absolute;
  inset: auto 50% 100% auto;
  transform: translateX(50%);
  inline-size: .28em;
  block-size: .27em;
  content: "";
  border: .065em solid #35657a;
  border-block-end: 0;
  border-radius: .3em .3em 0 0;
}

/* ---------- Round summary ---------- */
.result-col, .match-end { display: grid; justify-items: center; align-content: center; gap: 1.15rem; }
.round-summary {
  display: grid;
  grid-template-columns: minmax(0, .93fr) minmax(0, 1.07fr);
  gap: 3.25rem;
  inline-size: min(100%, 96rem);
  justify-self: center;
  align-items: center;
}
.round-sticker { inline-size: 15rem; filter: drop-shadow(0 .7rem .45rem var(--shadow)); }
.result-col .tv-heading { font-size: 3.65rem; }
.award {
  padding: .3rem 1.45rem;
  border-radius: 4rem;
  background: var(--lime-light);
  color: var(--ink);
  font-size: 2.4rem;
  font-weight: 1000;
}
.result-col .joke {
  min-block-size: 2.66em;
  margin-block-start: .9rem;
  color: white;
  font-size: 1.93rem;
  line-height: 1.18;
}
.round-details { display: grid; min-inline-size: 0; gap: 1.2rem; }
.results-board {
  padding: 1.35rem 1.7rem;
  border: .1rem solid #ffffff70;
  border-radius: 2rem;
  background: #f2fbfa;
  box-shadow: 0 .6rem 1.4rem var(--shadow);
}
.results-board h2 {
  padding-block-end: .65rem;
  text-align: center;
  text-wrap: balance;
  font-size: 2.8rem;
  font-weight: 1000;
  line-height: 1.08;
}
.results-list { margin-block-start: .6rem; }
.result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .8em;
  min-block-size: 3.7rem;
  padding: .25rem .8rem;
  border-block-start: .0625rem solid rgb(8 43 74 / .12);
  font-size: 2.14rem;
  line-height: 1.1;
  font-weight: 850;
  overflow-wrap: anywhere;
}
.result-row .num { font-weight: 1000; }
.result-row.is-counted {
  border-color: transparent;
  border-radius: .7rem;
  background: #e5f4bf;
  margin-block-end: .2rem;
}
.score-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; inline-size: 100%; }
.result-team {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  align-items: center;
  align-content: center;
  gap: .2rem .65rem;
  min-inline-size: 0;
  padding: .85rem 1rem;
  border-radius: 1.35rem;
  border-block-end: .35rem solid #ffc35c;
  background: var(--paper);
  box-shadow: 0 .5rem 1.3rem var(--shadow);
  color: var(--ink);
}
.result-team.winner { border-color: var(--lime); }
.result-team .avatar { grid-row: span 2; inline-size: 3.4rem; font-size: .55rem; }
.result-team h2 { font-size: 1.75rem; font-weight: 950; line-height: 1.1; overflow-wrap: anywhere; }
.result-team .num { font-size: 3rem; font-weight: 1000; line-height: 1; }

/* ---------- Match end ---------- */
.match-end { align-self: center; justify-self: center; inline-size: min(100%, 63rem); gap: 1.25rem; }
.trophy { inline-size: 20rem; filter: drop-shadow(0 .8rem .65rem var(--shadow)); }
.early-note { color: white; text-align: center; font-size: 1.95rem; font-weight: 850; }
.match-end .score-pair { margin-block-start: .8rem; gap: 1.2rem; inline-size: min(100%, 48rem); }
.match-end .result-team { grid-template-columns: 5.35rem minmax(0, 1fr); gap: .4rem .85rem; padding: 1.15rem 1.35rem; }
.match-end .result-team .avatar { inline-size: 5.35rem; font-size: .85rem; }
.match-end .result-team h2 { font-size: 2rem; }
.match-end .result-team .num { font-size: 4.1rem; }
.confetti-burst { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.confetti-piece {
  position: absolute;
  inset-block-start: -3rem;
  inset-inline-start: var(--x);
  inline-size: var(--w);
  block-size: var(--h);
  border-radius: .2rem;
  background: var(--c);
  opacity: 0;
  animation: confetti-fall var(--d) cubic-bezier(.35, .1, .6, 1) var(--delay) 1 both;
}
@keyframes confetti-fall {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(var(--r0)); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--dx), 1160px, 0) rotate(var(--r1)); }
}

/* ?still=1: no motion, for screenshots. */
.still *, .still *::before, .still *::after { animation: none !important; transition: none !important; }

/* ---------- Debug overlay (?debug=1) ---------- */
#log {
  position: fixed;
  inset: auto auto 12px 12px;
  z-index: 10;
  max-inline-size: 60vw;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgb(0 0 0 / .55);
  color: #fff;
  font: 13px/1.35 ui-monospace, monospace;
  white-space: pre-wrap;
}

@media (prefers-reduced-motion: reduce) {
  .screen.is-entering { animation: fade-in .25s ease-out both; }
  .screen.is-leaving { animation: fade-out .2s ease-in both; }
  .scorebar.pulse, .board-lives.is-entering, .heart.losing, .answer-tile.appear,
  .answer-tile.shake, .answer-board.is-shaking, .joke .is-new { animation: none; }
  .answer-tile.flip { animation: fade-in .3s ease-out both; }
  .answer-tile.flip::after, .answer-tile.shake::after { animation: tile-glow 1.2s ease-out both; }
  .score-team.flash::after { animation: side-flash 1.4s linear; }
  .miss-mark.show { animation: miss-fade 1.2s linear both; }
  .confetti-burst { display: none; }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes miss-fade {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg); }
  10%, 85% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg); }
}
