/* Against brand theme: the same palette, type and card treatments as the phone app
   (src/Against.App/Resources/Styles/Colors.xaml + Styles.xaml) and the party host
   (hosts/AgainstPartyHost/Assets/Scripts/UI/HostUi.cs). Keep the three in step.
   Type sizes are in rem so the browser's text-size setting scales them. */

@font-face {
  font-family: "Bebas Neue";
  src: url("../fonts/BebasNeue-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("../fonts/OpenSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("../fonts/OpenSans-Semibold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink: #16161c;
  --surface: #22222a;
  --surface-high: #2c2c36;
  --hairline: #45454f;
  --hairline-soft: #363640;
  --card-black: #101014;
  --paper: #f7f5f1;
  --paper-shade: #e9e6e0;
  --paper-ink: #141216;
  --paper-muted: #6b6973;
  --text-primary: #f3f2ef;
  --text-muted: #bdbbc4;
  --text-faint: #8e8c97;
  --red: #e01a22;
  --red-deep: #8d0801;
  --red-press: #b0121a;
  --red-glow: rgba(224, 26, 34, 0.4);
  --gold: #e8b341;
  --silver: #c7cbd1;
  --bronze: #cd7f32;
  --success: #3fb66b;
  --danger: #ff5c5c;

  --font-display: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --font-body: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Page backdrop: soft charcoal falloff, not flat black. */
  --page-backdrop: linear-gradient(180deg, #24242d 0%, #16161c 55%, #121217 100%);
  --red-sweep: linear-gradient(135deg, #e01a22 0%, #a50d14 100%);
  --hero-fade: linear-gradient(180deg, #2c2c36 0%, #16161c 100%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
}
/* The root stays at the browser's size (rem = the reader's chosen text size); the body is 15px at the default. */
body { background: var(--page-backdrop) fixed; font-size: 0.9375rem; }

#app { min-height: 100vh; display: flex; flex-direction: column; }

main { flex: 1; display: flex; flex-direction: column; }

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 18px;
  width: 100%;
}

/* ----- Typography ----- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 1.5px;
  margin: 0;
}
h1 { font-size: 2.75rem; letter-spacing: 2px; line-height: 1; }
h2 { font-size: 1.875rem; }

/* Small caps-style section headers ("STREAMER'S HAND", "RESULTS"). */
.section-label,
h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 18px 2px 10px;
}

.hint { color: var(--text-faint); font-size: 0.8125rem; }
.muted { color: var(--text-muted); line-height: 1.35; }
.error { color: var(--danger); font-size: 0.8125rem; }

/* The room code: big red display type, like the app's game-room header. */
.room-code {
  font-family: var(--font-display);
  font-size: 1.875rem;
  letter-spacing: 4px;
  color: var(--red);
  line-height: 1;
}

/* The Against logo on a red-framed white tile (app LogoTile / party host splash):
   the logo is mostly black and would vanish straight on the dark page. Set --size. */
.logo-tile {
  --size: 46px;
  width: var(--size);
  height: var(--size);
  padding: calc(var(--size) * 0.1);
  background: white;
  border: max(1.5px, calc(var(--size) * 0.03)) solid var(--red);
  border-radius: max(6px, calc(var(--size) * 0.12));
  flex: 0 0 auto;
}
.logo-tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-tile.hero {
  --size: 140px;
  margin: 0 auto 8px;
  box-shadow: 0 0 44px var(--red-glow);
}

/* ----- Form fields ----- */
label.hint { display: block; margin: 0 2px 6px; }

input[type="text"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--hairline-soft);
  border-radius: 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  min-height: 52px;
  padding: 12px 14px;
}
input[type="text"]::placeholder { color: var(--text-faint); }
input[type="text"]:focus { outline: none; border-color: var(--red); }
/* Room codes read like the room-code header. */
input.code-input {
  font-family: var(--font-display);
  font-size: 1.625rem;
  letter-spacing: 4px;
  text-transform: uppercase;
}

/* ----- Buttons ----- */
button {
  cursor: pointer;
  border: none;
  border-radius: 14px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  min-height: 48px;
  padding: 0 18px;
  color: var(--text-primary);
  background: var(--surface-high);
  transition: transform 0.08s ease, opacity 0.08s ease;
}
button:active:not(:disabled) { transform: scale(0.98); opacity: 0.8; }
button:disabled { opacity: 0.35; cursor: not-allowed; }
/* Keyboard focus: a white ring (as on the TV hosts), never shown for taps. */
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--text-primary);
  outline-offset: 2px;
}
@media (hover: hover) {
  button:hover:not(:disabled) { filter: brightness(1.12); }
  .btn-ghost:hover:not(:disabled) { border-color: var(--text-muted); color: var(--text-primary); }
}

.btn-primary {
  background: var(--red-sweep);
  color: white;
  width: 100%;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  letter-spacing: 1.5px;
  border-radius: 16px;
  min-height: 56px;
  box-shadow: 0 6px 24px var(--red-glow);
}
.btn-primary:disabled { box-shadow: none; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--hairline);
}
.btn-block { width: 100%; }

/* ----- Get-the-app banner (persistent) ----- */
.app-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--hairline-soft);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.app-banner a { color: var(--gold); text-decoration: none; font-weight: 600; }

/* ----- Game-room header ----- */
.room-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}
.room-header .status {
  margin-inline-start: auto;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ----- Round line + player strip (docs/SPRINT2-ROUND-SCREEN.md section 1) ----- */
/* ROUND 3 - SAM JUDGES - FIRST TO 7 */
.round-line {
  font-family: var(--font-display);
  font-size: 1.125rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 14px;
}
.round-line > span + span::before { content: " \00B7  "; color: var(--text-faint); }
.round-line .judge-name { color: var(--red); }

/* One row of avatars in seat order; scrolls sideways when it overflows. */
.player-strip {
  list-style: none;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0;
  padding: 10px 0 4px;
  scrollbar-width: none;
}
.player-strip-item {
  position: relative;
  flex: 0 0 auto;
  width: 56px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.player-strip-name {
  max-width: 100%;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Initial on a userId-coloured disc (PlayerAvatar.razor sets --avatar-bg). */
.avatar {
  --avatar-size: 44px;
  position: relative;
  flex: 0 0 auto;
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  background: var(--avatar-bg, var(--surface-high));
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-initial {
  font-family: var(--font-display);
  font-size: calc(var(--avatar-size) * 0.55);
  line-height: 1;
  color: white;
}
.avatar.me { box-shadow: 0 0 0 3px var(--red); }
.avatar.offline > .avatar-initial,
.avatar.offline > .avatar-score { opacity: 0.4; }
.avatar.offline { background: color-mix(in srgb, var(--avatar-bg, var(--surface-high)) 40%, var(--ink)); }
/* Score pill, top end. */
.avatar-score {
  position: absolute;
  inset-block-start: -4px;
  inset-inline-end: -6px;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 9px;
  background: var(--paper);
  color: var(--paper-ink);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}
/* Status disc, bottom end: judge / played / still picking / offline. */
.avatar-status {
  position: absolute;
  inset-block-end: -3px;
  inset-inline-end: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}
.status-judge { color: var(--red); }
.status-done { color: var(--success); }
.status-muted { color: var(--text-muted); }

.progress-line { margin: 2px 2px 0; font-size: 0.75rem; color: var(--text-faint); }

/* Game-over standings: avatar, name, score per row. */
.standings {
  list-style: none;
  margin: 0;
  padding: 0;
  width: min(100%, 320px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.standings li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--hairline-soft);
  border-radius: 14px;
  text-align: start;
}
.standings li.me { background: var(--surface-high); border-color: var(--hairline); }
.standings .avatar { --avatar-size: 36px; }
.standings .avatar.me { box-shadow: none; }
.standings-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.standings-score { font-family: var(--font-display); font-size: 1.375rem; }

/* Screen-reader-only text (status words next to the strip's icons). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ----- Phase headline (PICK 2 CARDS, SAM IS JUDGING...) ----- */
.phase-headline {
  font-size: 1.25rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 16px 2px 0;
  min-height: 1.2em;
}

/* ----- Cards ----- */
/* The question ("black card"): red-bordered, like the app's QuestionCard and the
   party host's question card. */
.prompt-card {
  position: relative;
  background: var(--card-black);
  border: 2px solid var(--red);
  border-radius: 20px;
  padding: 18px 20px 12px;
  margin: 14px 0 4px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55);
}
.prompt-text {
  flex: 1;
  font-size: 1.3125rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}
/* Combo preview: the picked answers in the blanks. */
.prompt-text .combo-pick { color: var(--red); }
/* PICK 2 on multi-blank prompts. */
.pick-tag {
  align-self: flex-end;
  margin-block: -6px 6px;
  margin-inline: 0 -8px;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--red);
  color: white;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* The red "A" in each card's corner, like the physical cards. */
.brand-mark {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--red);
  line-height: 1;
  align-self: flex-end;
}

.hand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 6px 0 16px;
}

/* The white answer card (app PaperCard). */
.answer-card {
  background: var(--paper);
  color: var(--paper-ink);
  border: 1px solid var(--paper-shade);
  border-radius: 16px;
  padding: 14px 16px 10px;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.45);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.answer-card .card-text { flex: 1; }
/* The card's text as its button (Play.razor): looks like plain card text. */
.answer-card .card-hit {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  min-height: 0;
  border-radius: 0;
  text-align: start;
  cursor: inherit;
  transition: none;
}
/* A closed vote's cards stay readable (not the dimmed disabled-button look). */
.answer-card .card-hit:disabled,
.answer-card .card-hit:active,
.answer-card .card-hit:hover { opacity: 1; transform: none; filter: none; cursor: inherit; }
.answer-card .card-hit:focus { outline: none; }
/* Keyboard focus rings the whole card (white, as on the TV hosts). */
.answer-card:has(.card-hit:focus-visible) {
  outline: 3px solid var(--text-primary);
  outline-offset: 3px;
}
@media (hover: hover) {
  .answer-card:not(.readonly):hover { transform: translateY(-2px); }
  .answer-card.selected:not(.readonly):hover { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  .answer-card { transition: none; }
}
.answer-card .card-footer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.answer-card .card-footer .author {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--paper-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.answer-card .card-footer .brand-mark { font-size: 1.0625rem; margin-inline-start: auto; }
.answer-card.selected {
  border: 3px solid var(--red);
  transform: translateY(-4px);
  box-shadow: 0 6px 18px var(--red-glow);
}
.answer-card input[type="text"] {
  margin-top: 8px;
  min-height: 44px;
  font-size: 1rem; /* under 16px, iOS Safari zooms the page on focus */
  padding: 8px;
  background: white;
  color: var(--paper-ink);
  border: 1px solid var(--paper-shade);
  border-radius: 10px;
}
.answer-card input[type="text"]:focus { border-color: var(--red); }
/* Shown, not tappable: judging/results, or a followed streamer's hand outside a vote. */
.answer-card.readonly { cursor: default; }

/* Podium finishes: gold/silver/bronze glow + lift, same tiers as the app. */
.answer-card.winner {
  border: 4px solid var(--gold);
  transform: scale(1.04) translateY(-2px);
  box-shadow: 0 8px 28px rgba(232, 179, 65, 0.6);
}
.answer-card.second {
  border: 3px solid #c7cbd1;
  transform: scale(1.02);
  box-shadow: 0 5px 20px rgba(199, 203, 209, 0.4);
}
.answer-card.third {
  border: 3px solid #cd7f32;
  transform: scale(1.01);
  box-shadow: 0 5px 16px rgba(205, 127, 50, 0.35);
}
.answer-card.winner .author { color: #9c6f00; font-weight: 600; font-size: 0.875rem; }
.answer-card.second .author { color: #5b6470; font-weight: 600; font-size: 0.875rem; }
.answer-card.third .author { color: #8a4b1e; font-weight: 600; font-size: 0.875rem; }

/* Judging: a submission the judge hasn't flipped yet (black card back, red A). */
.answer-card.face-down {
  background: var(--card-black);
  border: 2px solid var(--red-deep);
  align-items: center;
  justify-content: center;
}
.answer-card.face-down .brand-mark { font-size: 2.75rem; color: var(--red); }
/* The judge just flipped it: in sync with the big screen's flip. */
.answer-card.flip-in { animation: card-flip-in 0.3s ease-out; }
@keyframes card-flip-in {
  from { transform: perspective(600px) rotateY(90deg); }
  to { transform: perspective(600px) rotateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .answer-card.flip-in { animation: none; }
}

/* Streamer-vote share on a card. */
.vote-badge {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--red);
  line-height: 1;
}

/* ----- Countdown bar: Red fill draining on a visible track, seconds beside it ----- */
.countdown {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}
.timer-track {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--hairline-soft);
  overflow: hidden;
}
.timer-fill {
  height: 100%;
  background: var(--red);
  transition: width 0.25s linear;
}
.timer-text {
  font-family: var(--font-display);
  font-size: 1.125rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* Last 10 s: Danger, pulsing. */
.countdown.urgent .timer-fill { background: var(--danger); }
.countdown.urgent .timer-text { color: var(--danger); }
.countdown.urgent .timer-fill,
.countdown.urgent .timer-text { animation: timer-pulse 1s ease-in-out infinite; }
@keyframes timer-pulse {
  50% { opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
  .timer-fill { transition: none; }
  .countdown.urgent .timer-fill,
  .countdown.urgent .timer-text { animation: none; }
}

/* ----- Sticky Submit bar (PICK 1 MORE / SUBMIT (2/2)) ----- */
.action-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin: 12px -18px 0;
  padding: 10px 18px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(22, 22, 28, 0) 0%, var(--ink) 30%);
}
.action-bar .error { margin: 0 2px 8px; }

/* ----- Full-screen takeovers (game over, game ended, can't join) ----- */
.cta-overlay {
  position: fixed;
  inset: 0;
  background: var(--page-backdrop);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
  z-index: 100;
  /* Game over can run taller than the screen: scroll, still centred when it fits. */
  overflow-y: auto;
  justify-content: safe center;
}
.cta-overlay .btn-ghost { min-width: 220px; }
.store-badges { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.store-badges a {
  display: inline-block;
  padding: 12px 20px;
  background: var(--surface-high);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
}

footer.presented-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
}
/* Muted, not faded: the old 60% opacity on faint text read about 2:1. */
footer.presented-by .hint { color: var(--text-muted); }

/* Pre-boot placeholder in index.html. */
.boot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

h1:focus {
    outline: none;
}

#blazor-error-ui {
    background: var(--surface-high);
    color: var(--text-primary);
    border-top: 1px solid var(--red);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
    #blazor-error-ui a { color: var(--gold); }

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        inset-inline-end: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ----- Hub connection banner (Play) ----- */
.connection-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 8px 14px;
  background: var(--surface-high);
  border: 1px solid var(--danger);
  border-radius: 10px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.875rem;
}
.connection-banner span:not(.spinner) { flex: 1; }
.connection-banner .btn-ghost { min-height: 36px; color: var(--text-primary); }
.connection-banner .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--hairline);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: connection-spin 0.9s linear infinite;
}
@keyframes connection-spin { to { transform: rotate(360deg); } }

/* ----- Icons (Components/Icon.razor; sprite built by design/icons) ----- */
.icon {
  display: inline-block;
  vertical-align: -0.18em;
  flex-shrink: 0;
}
.icon-gold { color: var(--gold); }

/* ===== Sprint 3: payoff moments + front door (docs/SPRINT3-PAYOFF-FRONT-DOOR.md) ===== */

/* Generic spinner (join buttons, rematch wait). */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--hairline);
  border-top-color: var(--gold);
  border-radius: 50%;
  vertical-align: -3px;
  animation: connection-spin 0.9s linear infinite;
}
.btn-primary .spinner {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: white;
  margin-inline-end: 8px;
}
.btn-ghost .spinner { margin-inline-end: 8px; }

/* ----- A. Winner reveal ----- */
/* Gold = winner only: SAM WINS THE ROUND!, the winning text, the trophy. */
.winner-headline { color: var(--gold); }
.prompt-text .combo-win { color: var(--gold); }

/* +N popping over the winner's avatar in the strip, then fading. */
.avatar-gain {
  position: absolute;
  inset-inline: 0;
  inset-block-start: 8px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  opacity: 0;
  animation: gain-pop 1.8s ease-out forwards;
}
@keyframes gain-pop {
  0% { opacity: 0; transform: translateY(10px) scale(0.6); }
  20% { opacity: 1; transform: translateY(0) scale(1.25); }
  65% { opacity: 1; transform: translateY(-4px) scale(1); }
  100% { opacity: 0; transform: translateY(-10px) scale(1); }
}

/* YOUR CARD on the viewer's own submission in the results. */
.your-card-tag {
  align-self: flex-start;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--paper-ink);
  color: var(--paper);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Winner's own phone: confetti (pieces made by againstConfetti in index.html). */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 150;
}
.confetti i {
  position: absolute;
  top: -16px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  animation-name: confetti-fall;
  animation-timing-function: cubic-bezier(0.25, 0.6, 0.5, 1);
  animation-fill-mode: forwards;
}
@keyframes confetti-fall {
  to { transform: translate(var(--dx), 105vh) rotate(var(--spin)); }
}

/* ----- B. Game over ----- */
.cta-overlay.game-over { gap: 14px; }
.finish-line {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
/* Stepped blocks: 1st in the middle and tallest, 2nd before it, 3rd after it. */
.podium {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  width: min(100%, 360px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
}
.podium-step {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.podium-slot-1 { order: 2; }
.podium-slot-2 { order: 1; }
.podium-slot-3 { order: 3; }
.podium-name {
  max-width: 100%;
  font-weight: 600;
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.podium-score { font-family: var(--font-display); font-size: 1.375rem; line-height: 1; }
.podium-block {
  width: 100%;
  border-radius: 10px 10px 0 0;
  display: flex;
  justify-content: center;
  padding-top: 6px;
  font-family: var(--font-display);
  font-size: 2.125rem;
  line-height: 1;
  color: var(--paper-ink);
}
.podium-place-1 .podium-block { height: 110px; background: var(--gold); }
.podium-place-2 .podium-block { height: 80px; background: var(--silver); }
.podium-place-3 .podium-block { height: 56px; background: var(--bronze); }
.podium-place-1 .avatar { --avatar-size: 56px; box-shadow: 0 0 0 3px var(--gold); }
.standings-place {
  width: 22px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-faint);
}
.game-over h3 { margin: 8px 0 0; }
/* Best of the night: winning combos, the winning text in Gold. */
.best-combos {
  list-style: none;
  margin: 0;
  padding: 0;
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.best-combo {
  background: var(--card-black);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: start;
}
.best-combo p { margin: 0; font-weight: 600; line-height: 1.3; }
.best-combo .combo-win { color: var(--gold); }
.best-combo-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.best-combo-by { display: block; font-size: 0.75rem; color: var(--text-muted); }
.best-combo-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: -6px -8px -6px 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.best-combo-share:hover, .best-combo-share:focus-visible { color: var(--gold); }
.btn-share-game { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.game-poster {
  display: block;
  width: min(100%, 320px);
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid var(--hairline);
}
.rematch-wait {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--text-muted);
}

/* ----- C. Reactions ----- */
.reaction-toggle {
  width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.reaction-toggle.open { color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--hairline); }
.reaction-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 0;
}
.reaction-btn {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--hairline-soft);
  font-size: 1.5rem;
  line-height: 1;
}
/* Floating reactions (againstFloatReaction): rise ~120px from the sender's avatar and fade. */
#reaction-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 200;
}
.reaction-float {
  position: absolute;
  font-size: 1.875rem;
  line-height: 1;
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: reaction-rise 1.6s ease-out forwards;
}
.reaction-float.still { animation-name: reaction-fade; }
@keyframes reaction-rise {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  12% { opacity: 1; transform: translate(-50%, calc(-50% - 14px)) scale(1.1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--drift, 0px)), calc(-50% - 120px)) scale(1); }
}
@keyframes reaction-fade {
  0% { opacity: 0; }
  15% { opacity: 1; }
  100% { opacity: 0; }
}

/* ----- F. Landing ----- */
.landing { padding-top: 28px; max-width: 420px; }
/* Hero: a fanned trio (one black prompt card, two white answer cards). */
.hero-fan {
  position: relative;
  width: 220px;
  height: 168px;
  margin: 0 auto 10px;
}
.fan-card {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-start: 50%;
  width: 104px;
  height: 144px;
  margin-inline-start: -52px;
  padding: 12px 10px 8px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55);
  transform-origin: 50% 100%;
}
.fan-answer { background: var(--paper); border: 1px solid var(--paper-shade); }
.fan-start { transform: translateX(-40px) rotate(-14deg); }
.fan-end { transform: translateX(40px) rotate(14deg); }
.fan-prompt {
  z-index: 1;
  background: var(--card-black);
  border: 2px solid var(--red);
  transform: translateY(-6px);
  box-shadow: 0 10px 28px var(--red-glow);
}
.fan-line { display: block; width: 85%; height: 7px; border-radius: 4px; background: var(--paper-shade); }
.fan-line.short { width: 55%; }
.fan-blank { display: block; width: 60%; height: 3px; margin-top: 30px; background: var(--text-primary); }
.fan-card .brand-mark { margin-top: auto; }

.join-form { margin: 24px 0 8px; }
.join-form .field { margin-bottom: 18px; }
.label-note { font-size: 0.75rem; color: var(--text-faint); }
.field-error { margin: 8px 2px 0; }
input[type="text"][aria-invalid="true"] { border-color: var(--danger); }
/* Clipboard holds a room code or join link: one tap fills it in. */
.paste-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 20px;
  border: 1px dashed var(--hairline);
  font-size: 0.875rem;
}
.how-it-works {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.how-it-works li { display: flex; align-items: center; gap: 12px; color: var(--text-muted); }
.how-step {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-high);
  border: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--text-primary);
}

/* Still versions of every Sprint 3 animation. */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  .avatar-gain { animation-name: reaction-fade; }
  .confetti { display: none; }
}

/* ----- Report a hand card: corner button, reason sheet, status line ----- */
.answer-card .card-report {
  min-height: 0;
  width: 32px;
  height: 32px;
  margin: -6px 0 -4px -6px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: transparent;
  color: var(--paper-muted);
  position: relative;
}
/* A bigger tap target than it looks, without crowding the card. */
.answer-card .card-report::after { content: ""; position: absolute; inset: -6px; }
.answer-card .card-report:active:not(:disabled) { background: var(--paper-shade); }
@media (hover: hover) {
  .answer-card .card-report:hover:not(:disabled) { background: var(--paper-shade); color: var(--paper-ink); filter: none; }
}
.report-status { margin: 0 2px 10px; font-size: 0.8125rem; text-align: center; color: var(--success); }
.report-status.muted { color: var(--text-faint); }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(8, 8, 12, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--hairline-soft);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 20px 18px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}
.sheet h2 { margin: 0 0 10px; font-size: 1.625rem; }
.sheet-card {
  margin: 0 0 8px;
  padding: 10px 12px;
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: 12px;
  font-weight: 600;
  line-height: 1.25;
}
.sheet-hint { margin: 0 2px 12px; font-size: 0.8125rem; }
.sheet-options { display: flex; flex-direction: column; gap: 8px; }
.sheet-options .btn-ghost { color: var(--text-primary); min-height: 44px; text-align: start; }
.sheet-cancel { margin-top: 12px; }

/* ----- One-time 16+ content notice before the first join ----- */
.content-warning { max-width: 420px; margin: 0 auto; }
.content-warning h1 { color: var(--red); font-size: 2.25rem; }
.content-warning ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; text-align: start; }
.content-warning li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-muted); line-height: 1.35; }
.content-warning li .icon { flex: none; margin-top: 1px; color: var(--red); }
.content-warning .btn-primary { margin-top: 6px; }
