/* GameNight shared theme. Games can layer their own styles on top using these tokens. */
:root {
    --gn-bg-1: #1b0f3b;
    --gn-bg-2: #3a1468;
    --gn-bg-3: #0d2a5c;
    --gn-ink: #fff8ec;
    --gn-ink-dim: rgba(255, 248, 236, 0.66);
    --gn-panel: rgba(255, 255, 255, 0.09);
    --gn-panel-strong: rgba(255, 255, 255, 0.16);
    --gn-line: rgba(255, 255, 255, 0.18);
    --gn-accent: #ffb43b;
    --gn-accent-2: #ff5d73;
    --gn-accent-3: #38d4ff;
    --gn-good: #5ce08a;
    --gn-bad: #ff5d73;
    --gn-radius: 22px;
    --gn-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
    --gn-font-display: "Bungee", "Impact", system-ui, sans-serif;
    --gn-font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
    --gn-ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
    --gn-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--gn-bg-1); }

html, body {
    margin: 0;
    min-height: 100%;
    color: var(--gn-ink);
    font-family: var(--gn-font);
    -webkit-tap-highlight-color: transparent;
}

/* The page color lives on <html> so the z-index:-1 backdrop shows through a transparent body. */
body { overflow-x: hidden; background: transparent; }

h1, h2, h3, .gn-display { font-family: var(--gn-font-display); font-weight: 400; letter-spacing: 0.02em; margin: 0; }

button, input, textarea, select { font: inherit; color: inherit; }

/* ---------------------------------------------------------------- backdrop */
/* A still picture on its own layer, so it's drawn once. Moving, blurred shapes made slow screens redraw everything for
   every frame. For the same reason, don't add backdrop-filter to panels. */
.gn-backdrop {
    position: fixed; inset: 0; z-index: -1; pointer-events: none; will-change: transform;
    background: radial-gradient(90% 100% at 0% 0%, rgba(214, 63, 140, 0.42), transparent 65%),
                radial-gradient(90% 100% at 100% 100%, rgba(38, 150, 230, 0.42), transparent 65%),
                radial-gradient(70% 60% at 50% 0%, var(--gn-bg-2), transparent 75%),
                var(--gn-bg-1);
}

#gn-boot { position: fixed; inset: 0; z-index: 1; display: grid; place-items: center; background: var(--gn-bg-1); }
#gn-boot div { font-family: var(--gn-font-display); font-size: clamp(2.8rem, 8vw, 8rem); line-height: 1; color: var(--gn-accent); text-shadow: 0 .07em 0 #b86d00; }
#gn-boot span { color: var(--gn-accent-2); text-shadow: 0 .07em 0 #a82238; }
.gn-noscript { position: fixed; inset: auto 0 12vh; z-index: 2; padding: 0 16px; text-align: center; font-weight: 800; }

/* Real-time games cover the page, so don't draw the backdrop behind them. */
.ca-driving .gn-backdrop, .ca-tv .gn-backdrop, .gn-pad-open .gn-backdrop, .gn-canvas-tv .gn-backdrop { display: none; }
.ca-driving, .ca-driving body, .gn-pad-open, .gn-pad-open body { overflow: hidden; overscroll-behavior: none; }

/* ---------------------------------------------------------------- building blocks */
.gn-panel {
    background: var(--gn-panel); border: 1px solid var(--gn-line); border-radius: var(--gn-radius);
    box-shadow: var(--gn-shadow);
}

.gn-btn {
    appearance: none; border: 0; cursor: pointer; border-radius: 999px;
    padding: 0.85em 1.6em; font-family: var(--gn-font-display); font-size: 1.05rem; letter-spacing: 0.04em;
    color: #2b1600; background: linear-gradient(180deg, #ffd36b, var(--gn-accent));
    box-shadow: 0 6px 0 #b86d00, 0 12px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.12s var(--gn-ease-out), box-shadow 0.12s var(--gn-ease-out), filter 0.2s;
    touch-action: manipulation; user-select: none;
}
a.gn-btn { text-decoration: none; }
.gn-btn:hover { filter: brightness(1.06); }
.gn-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #b86d00, 0 6px 12px rgba(0, 0, 0, 0.3); }
.gn-btn:disabled { filter: grayscale(0.8) brightness(0.7); cursor: not-allowed; transform: none; }
.gn-btn.gn-btn-block { width: 100%; }
.gn-btn.gn-btn-pink { color: #fff; background: linear-gradient(180deg, #ff8a9b, var(--gn-accent-2)); box-shadow: 0 6px 0 #a82238, 0 12px 24px rgba(0,0,0,.3); }
.gn-btn.gn-btn-blue { color: #04202b; background: linear-gradient(180deg, #8be6ff, var(--gn-accent-3)); box-shadow: 0 6px 0 #0a7fa0, 0 12px 24px rgba(0,0,0,.3); }
.gn-btn.gn-btn-ghost { color: var(--gn-ink); background: var(--gn-panel-strong); box-shadow: none; border: 1px solid var(--gn-line); }
.gn-btn.gn-btn-small { font-size: 0.8rem; padding: 0.55em 1.1em; }

.gn-input {
    width: 100%; border-radius: 16px; border: 2px solid var(--gn-line); background: rgba(0, 0, 0, 0.25);
    padding: 0.8em 1em; font-size: 1.25rem; font-weight: 800; letter-spacing: 0.04em; outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.gn-input:focus { border-color: var(--gn-accent); box-shadow: 0 0 0 4px rgba(255, 180, 59, 0.25); }
textarea.gn-input { resize: none; min-height: 7em; font-weight: 700; letter-spacing: 0; }
.gn-label { display: block; font-weight: 900; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gn-ink-dim); margin: 0 0 0.45em 0.3em; }
.gn-error { color: #ffb3bf; font-weight: 800; animation: gn-shake 0.4s; }
.gn-muted { color: var(--gn-ink-dim); }

/* ---------------------------------------------------------------- avatars */
.gn-avatar { display: inline-flex; flex-direction: column; align-items: center; gap: 0.35em; --size: 64px; }
.gn-avatar-face {
    width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center;
    font-size: calc(var(--size) * 0.58); background: var(--c, #fff); position: relative;
    box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.18), 0 8px 18px rgba(0, 0, 0, 0.3);
    transition: filter 0.4s, transform 0.4s var(--gn-ease-pop);
}
.gn-avatar-name {
    font-weight: 900; font-size: calc(var(--size) * 0.22 + 6px); letter-spacing: 0.04em; max-width: calc(var(--size) * 2.2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c);
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.gn-avatar.is-offline .gn-avatar-face { filter: grayscale(1) brightness(0.55); }
.gn-avatar.is-pop { animation: gn-pop-in 0.6s var(--gn-ease-pop) both; }
.gn-avatar.is-done .gn-avatar-face { transform: translateY(-6px); }
.gn-avatar .gn-badge {
    position: absolute; right: -6%; bottom: -6%; min-width: 42%; height: 42%; border-radius: 999px; display: grid; place-items: center;
    background: var(--gn-good); color: #062b14; font-size: calc(var(--size) * 0.24); font-weight: 900; border: 3px solid var(--gn-bg-1);
    animation: gn-pop-in 0.45s var(--gn-ease-pop) both;
}
.gn-avatar .gn-crown { position: absolute; top: -32%; font-size: calc(var(--size) * 0.36); animation: gn-bob 2s ease-in-out infinite; }

/* ---------------------------------------------------------------- timer ring */
.gn-timer { position: relative; width: var(--size, 96px); height: var(--size, 96px); }
.gn-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gn-timer .track { stroke: rgba(255, 255, 255, 0.15); }
.gn-timer .bar { stroke: var(--gn-accent); stroke-linecap: round; transition: stroke 0.3s; }
.gn-timer.is-low .bar { stroke: var(--gn-accent-2); }
.gn-timer.is-low { animation: gn-throb 1s ease-in-out infinite; }
.gn-timer .num {
    position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--gn-font-display);
    font-size: calc(var(--size, 96px) * 0.36);
}

/* ---------------------------------------------------------------- narration caption */
.gn-caption {
    position: fixed; left: 50%; bottom: 3.2vh; transform: translateX(-50%); z-index: 50;
    max-width: min(80vw, 1300px); padding: 0.7em 1.4em 0.7em 3.2em; border-radius: 999px;
    background: rgba(10, 4, 28, 0.82); border: 1px solid var(--gn-line); box-shadow: var(--gn-shadow);
    font-size: clamp(1rem, 1.7vw, 1.8rem); font-weight: 800; line-height: 1.3;
    animation: gn-caption-in 0.45s var(--gn-ease-out) both;
}
.gn-caption::before {
    content: "🎙️"; position: absolute; left: 0.9em; top: 50%; transform: translateY(-50%); animation: gn-bob 0.9s ease-in-out infinite;
}
/* Leaves room for the Skip intro button. */
.gn-caption.is-narrow { max-width: min(58vw, 1120px); border-radius: 40px; }
.gn-caption.is-out { animation: gn-caption-out 0.5s ease-in both; }
@keyframes gn-caption-in { from { opacity: 0; transform: translate(-50%, 30px) scale(0.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes gn-caption-out { to { opacity: 0; transform: translate(-50%, 20px); } }

/* ---------------------------------------------------------------- host chrome */
.gn-host { min-height: 100vh; display: flex; flex-direction: column; padding: 2.2vh 3vw 12vh; }
.gn-host-top { display: flex; align-items: center; justify-content: space-between; gap: 2vw; }
.gn-host-title { font-family: var(--gn-font-display); font-size: clamp(1.2rem, 2.4vw, 2.6rem); }
.gn-host-code { text-align: right; line-height: 1.1; font-weight: 900; }
.gn-host-code .url { color: var(--gn-ink-dim); font-size: clamp(0.8rem, 1.2vw, 1.3rem); }
.gn-host-code .code { font-family: var(--gn-font-display); font-size: clamp(1.4rem, 3vw, 3.2rem); color: var(--gn-accent); letter-spacing: 0.12em; }
.gn-host-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; }
.gn-host-tools { position: fixed; top: 1vh; left: 50%; transform: translateX(-50%); display: flex; gap: 0.5em; opacity: 0.18; transition: opacity 0.3s; z-index: 60; }
.gn-host-tools:hover { opacity: 1; }
/* The host's voice is downloading or starting (gamenight-voice.js). It only redraws when something changes, for slow TVs. */
.gn-voice-ring { position: fixed; top: 1vh; right: .5vw; z-index: 60; display: flex; align-items: center; gap: .5em; pointer-events: none; }
.gn-voice-ring i { position: relative; flex: none; width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(var(--gn-accent) var(--done, 0%), #5b4790 0); }
.gn-voice-ring i::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #1b0f3b; }
/* Games can use the whole top of the screen, so there it's only the ring. Everywhere else, it also says what it's doing. */
.gn-voice-ring span { display: none; }
:is(body:has(.picker), body:has(.gn-lobby), body:has(.gn-phone)) .gn-voice-ring {
    top: 1.6vh; right: 1.2vw; padding: .35em .8em .35em .5em; border: 2px solid var(--gn-accent); border-radius: 999px; background: #1b0f3b;
    color: var(--gn-ink); font-size: clamp(14px, 1.05vw, 28px); font-weight: 900; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums;
}
:is(body:has(.picker), body:has(.gn-lobby), body:has(.gn-phone)) .gn-voice-ring span { display: inline; }
/* On the picker, the tabs are on the right, so it goes between them and the logo. */
body:has(.picker) .gn-voice-ring { top: 3.2vh; right: auto; left: 34.2%; transform: translateX(-50%); font-size: clamp(13px, .95vw, 26px); }
/* There isn't room for the message there on smaller screens, so only show the ring. */
@media (max-width: 1360px) {
    body:has(.picker) .gn-voice-ring { top: .5vh; right: 2px; left: auto; transform: none; padding: 0; border: 0; background: none; }
    body:has(.picker) .gn-voice-ring span { display: none; }
}
/* For games with something important at the top of the screen: hidden until you point at them. */
.gn-tools-away .gn-host-tools:not(:hover):not(:focus-within) { opacity: 0; }
.gn-icon-btn {
    width: 2.6em; height: 2.6em; border-radius: 50%; border: 1px solid var(--gn-line); background: var(--gn-panel-strong);
    cursor: pointer; font-size: 1rem; display: grid; place-items: center;
}
.gn-icon-btn.is-off { opacity: 0.45; text-decoration: line-through; }

.gn-player-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.6vw; margin-top: 2vh; }
.gn-player-strip.is-many { gap: .9vw; }

/* ---------------------------------------------------------------- phone chrome */
.gn-phone {
    min-height: 100dvh; max-width: 520px; margin: 0 auto;
    /* Clear of the notch, and the bar at the bottom of the screen. */
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(32px, calc(env(safe-area-inset-bottom) + 12px)) max(16px, env(safe-area-inset-left));
    display: flex; flex-direction: column; gap: 16px; }
.gn-phone-bar {
    display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; border-radius: 999px;
    background: var(--gn-panel); border: 1px solid var(--gn-line);
}
.gn-phone-bar .name { font-weight: 900; letter-spacing: 0.04em; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gn-phone-bar .score { font-family: var(--gn-font-display); color: var(--gn-accent); }
.gn-phone-main { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.gn-phone-center { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 18px; }
.gn-big-emoji { font-size: 5rem; animation: gn-bob 2.2s ease-in-out infinite; }

/* ---------------------------------------------------------------- utility animations */
.gn-enter { animation: gn-rise-in 0.6s var(--gn-ease-out) both; }
.gn-enter-pop { animation: gn-pop-in 0.6s var(--gn-ease-pop) both; }
.gn-enter-left { animation: gn-slide-left 0.7s var(--gn-ease-out) both; }
.gn-enter-right { animation: gn-slide-right 0.7s var(--gn-ease-out) both; }
.gn-stagger > * { animation: gn-rise-in 0.55s var(--gn-ease-out) both; }
.gn-stagger > *:nth-child(1) { animation-delay: 0.05s; } .gn-stagger > *:nth-child(2) { animation-delay: 0.12s; }
.gn-stagger > *:nth-child(3) { animation-delay: 0.19s; } .gn-stagger > *:nth-child(4) { animation-delay: 0.26s; }
.gn-stagger > *:nth-child(5) { animation-delay: 0.33s; } .gn-stagger > *:nth-child(6) { animation-delay: 0.40s; }
.gn-stagger > *:nth-child(7) { animation-delay: 0.47s; } .gn-stagger > *:nth-child(8) { animation-delay: 0.54s; }
.gn-stagger > *:nth-child(9) { animation-delay: 0.61s; } .gn-stagger > *:nth-child(10) { animation-delay: 0.68s; }
.gn-wiggle { animation: gn-wiggle 2.4s ease-in-out infinite; }
.gn-bob { animation: gn-bob 2s ease-in-out infinite; }

@keyframes gn-rise-in { from { opacity: 0; transform: translateY(28px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes gn-pop-in { 0% { opacity: 0; transform: scale(0.3) rotate(-8deg); } 100% { opacity: 1; transform: none; } }
@keyframes gn-slide-left { from { opacity: 0; transform: translateX(-12vw) rotate(-4deg); } to { opacity: 1; transform: none; } }
@keyframes gn-slide-right { from { opacity: 0; transform: translateX(12vw) rotate(4deg); } to { opacity: 1; transform: none; } }
@keyframes gn-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes gn-wiggle { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes gn-throb { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes gn-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes gn-stamp { 0% { opacity: 0; transform: scale(3) rotate(-14deg); } 60% { opacity: 1; transform: scale(0.92) rotate(-10deg); } 100% { opacity: 1; transform: scale(1) rotate(-10deg); } }

.gn-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 100; }

.tesla-full { min-height: 48px; text-align: center; }
.tesla-full small { display: block; margin-top: .3em; font: 700 .75rem/1.2 var(--gn-font); letter-spacing: 0; }

/* ---------------------------------------------------------------- lobby */
.gn-lobby { width: 100%; display: grid; grid-template-columns: 1fr 1.4fr; gap: 3vw; align-items: center; }
.gn-lobby-join { text-align: center; padding: 3vh 2vw; }
.gn-lobby-join .big-code { font-family: var(--gn-font-display); font-size: clamp(3rem, 9vw, 9rem); color: var(--gn-accent); letter-spacing: 0.1em; margin-right: -0.1em; line-height: 1; text-shadow: 0 8px 0 rgba(0,0,0,.3); }
/* Phones can scan a code from about 10 times its width away, so it has to be big to reach the couch. */
.gn-lobby-join .qr { width: min(19vw, 31vh, 560px); margin: 2vh auto 0; background: #fff; border-radius: 16px; padding: 10px; }
.gn-lobby-join .qr svg { display: block; width: 100%; height: auto; }
.gn-lobby-seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.2vw 1.5vw; justify-items: center; }
.gn-seat-empty { --size: clamp(56px, 7vw, 120px); width: var(--size); height: var(--size); border-radius: 50%; border: 3px dashed var(--gn-line); display: grid; place-items: center; color: var(--gn-line); font-family: var(--gn-font-display); font-size: calc(var(--size) * .3); }
/* Always two rows, so there's still room for the settings. */
.gn-lobby-seats.is-many { grid-template-columns: repeat(var(--seats), minmax(0, 1fr)); gap: 1.6vh .6vw; }
.gn-lobby-seats.is-many .gn-seat-empty { --size: clamp(40px, min(5.2vw, 8.2vh), 100px); }
.gn-lobby-seats.is-many .gn-seat { max-width: 100%; }
.gn-lobby-seats.is-many .gn-avatar { max-width: 100%; }
.gn-lobby-seats.is-many .gn-avatar-name { max-width: 100%; }
.gn-seat { position: relative; }
.gn-seat .kick { position: absolute; top: -6px; right: -6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--gn-bad); color: #fff; font-weight: 900; cursor: pointer; opacity: 0; transition: opacity 0.2s; }
.gn-seat:hover .kick { opacity: 1; }

.gn-avatar-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.gn-avatar-picker button {
    aspect-ratio: 1; border-radius: 50%; border: 3px solid transparent; background: var(--gn-panel-strong); font-size: 1.8rem; cursor: pointer;
    transition: transform 0.2s var(--gn-ease-pop), border-color 0.2s;
}
.gn-avatar-picker button:active { transform: scale(0.9); }
.gn-avatar-picker button.is-mine { border-color: var(--gn-accent); transform: scale(1.08); background: var(--c); }
.gn-avatar-picker button:disabled { opacity: 0.25; cursor: not-allowed; }
/* Solid colors, because it can be on top of a game. */
.gn-report {
    position: fixed; inset: 0; z-index: 90; width: min(560px, calc(100vw - 24px)); height: fit-content; max-height: calc(100dvh - 24px); margin: auto; padding: 18px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 12px; border: 3px solid var(--gn-accent); border-radius: var(--gn-radius); background: #1b0f3b; font-weight: 700; line-height: 1.35; text-align: left;
}
.gn-report > b { font-family: var(--gn-font-display); font-weight: 400; font-size: 1.3rem; }
.gn-report label { display: grid; gap: 6px; }
.gn-report .gn-input { min-height: 48px; padding: .5em .7em; font-size: 1rem; }
.gn-report select option { background: #1b0f3b; }
.gn-report textarea.gn-input { min-height: 4.6em; }
.gn-report > div { display: flex; flex-wrap: wrap; gap: 10px; }
.gn-report .gn-btn { min-height: 48px; }
.gn-report-open { align-self: center; min-height: 44px; padding: 8px 16px; border: 0; background: none; color: var(--gn-ink-dim); font-weight: 800; cursor: pointer; }
.gn-notice { display: grid; gap: 10px; padding: 12px 14px; border: 2px solid var(--gn-accent); border-radius: 16px; background: #4a2a0c; font-size: .92rem; font-weight: 600; line-height: 1.35; text-align: left; }
.gn-notice label { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.gn-notice input { flex: none; width: 28px; height: 28px; accent-color: var(--gn-accent); }
.gn-notice a { color: var(--gn-accent-3); }
.gn-legal-line { text-align: center; font-size: .85rem; line-height: 1.5; color: var(--gn-ink-dim); }
.gn-legal-line a { color: inherit; font-weight: 800; }
.gn-public-note { display: grid; gap: 6px; padding: 14px 16px; border-color: var(--gn-accent); line-height: 1.35; }
.gn-public-note a { color: var(--gn-accent-3); font-weight: 800; }
.gn-optin { display: grid; gap: 10px; padding: 16px; text-align: center; font-size: 1.05rem; }
.gn-optin > div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gn-optin button { min-height: 64px; padding: 8px; border: 3px solid var(--gn-line); border-radius: 16px; background: var(--gn-panel-strong); font-weight: 900; cursor: pointer; touch-action: manipulation; }
.gn-optin button.is-on { border-color: var(--gn-accent); background: #6b4310; }
.gn-optin span { font-size: .9rem; }
.gn-color-picker { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.gn-color-picker button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: transform 0.2s var(--gn-ease-pop); }
.gn-color-picker button.is-mine { border-color: #fff; transform: scale(1.2); }

@media (max-width: 900px) {
    .gn-lobby { grid-template-columns: 1fr; }
    .gn-lobby-seats:not(.is-many) { grid-template-columns: repeat(4, 1fr); }
}

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

/* ================================================================ shared game-show pieces
   Reusable by any game: kicker labels, slam titles, prompt cards, stamps, rule cards,
   scoreboard and podium. */
.gn-kicker { font-family: var(--gn-font-display); letter-spacing: .14em; color: var(--gn-accent-3); font-size: clamp(.9rem, 1.4vw, 1.5rem); }

.gn-slam {
    font-family: var(--gn-font-display); font-size: clamp(4rem, 13vw, 14rem); line-height: .95; color: var(--gn-accent);
    text-shadow: 0 0.06em 0 #b86d00, 0 0.15em 0.3em rgba(0,0,0,.5);
    animation: gn-slam 0.8s var(--gn-ease-pop) both;
}
@keyframes gn-slam { 0% { opacity: 0; transform: scale(4) rotate(-6deg); filter: blur(8px); } 70% { opacity: 1; transform: scale(.94) rotate(-2deg); filter: none; } 100% { transform: scale(1) rotate(-2deg); } }

.gn-card {
    background: #fff8ec; color: #1b0f3b; border-radius: 28px; padding: 1.1em 1.6em; max-width: min(88vw, 1400px);
    font-weight: 900; font-size: clamp(1.6rem, 3.6vw, 4rem); line-height: 1.15; box-shadow: 0 .25em 0 rgba(0,0,0,.25), var(--gn-shadow);
    transform: rotate(-1deg);
}

.gn-stamp {
    font-family: var(--gn-font-display); font-size: clamp(3rem, 10vw, 11rem); color: var(--gn-accent-2);
    border: .08em solid currentColor; border-radius: .2em; padding: .05em .35em; transform: rotate(-10deg);
    animation: gn-stamp .55s var(--gn-ease-pop) both; text-shadow: 0 4px 0 rgba(0,0,0,.25);
}

.gn-rules { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.6vw; }
.gn-rules .gn-panel { width: clamp(150px, 17vw, 300px); padding: 1.4em 1.2em; display: flex; flex-direction: column; gap: .3em; text-align: center; }
.gn-rules .ico { font-size: clamp(2rem, 3.4vw, 3.6rem); }
.gn-rules b { font-family: var(--gn-font-display); font-weight: 400; font-size: clamp(1rem, 1.5vw, 1.6rem); color: var(--gn-accent); }
.gn-rules span { color: var(--gn-ink-dim); font-weight: 700; font-size: clamp(.85rem, 1.1vw, 1.2rem); }

@keyframes gn-grow { from { width: 0; } }

.gn-scoreboard { width: min(92vw, 1200px); display: flex; flex-direction: column; gap: 1.2vh; align-items: stretch; text-align: center; }
.gn-scoreboard .gn-kicker { margin-bottom: 2vh; }
.gn-score-row {
    display: grid; grid-template-columns: 2.2em auto 10em 1fr 5em 4em; align-items: center; gap: 1vw;
    font-weight: 900; font-size: clamp(1rem, 1.7vw, 1.9rem); animation: gn-slide-left .6s var(--gn-ease-out) both;
}
.gn-scoreboard.is-many { gap: .5vh; }
.gn-scoreboard.is-many .gn-kicker { margin-bottom: .8vh; }
.gn-scoreboard.is-many .gn-score-row { font-size: clamp(.9rem, min(1.45vw, 2.5vh), 1.6rem); }
.gn-score-row .rank { font-family: var(--gn-font-display); color: var(--gn-ink-dim); }
.gn-score-row .name { color: var(--c); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gn-score-row .bar { height: 1.1em; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.gn-score-row .bar .fill { height: 100%; width: var(--w); background: var(--c); border-radius: 999px; animation: gn-grow 1.2s var(--gn-ease-out) .6s both; }
.gn-score-row .score { font-family: var(--gn-font-display); text-align: right; }
.gn-score-row .gain { color: var(--gn-good); font-size: .8em; text-align: left; animation: gn-pop-in .5s var(--gn-ease-pop) 1.6s both; }

.gn-podium-wrap { display: flex; flex-direction: column; align-items: center; gap: 2vh; margin-top: -4vh; }
.gn-podium { display: flex; align-items: flex-end; justify-content: center; gap: 2vw; margin-top: 2vh; }
.gn-step { display: flex; flex-direction: column; align-items: center; width: clamp(140px, 18vw, 300px); }
.gn-step .who { display: flex; flex-direction: column; align-items: center; gap: .4em; position: relative; animation: gn-pop-in .7s var(--gn-ease-pop) both; }
/* Some games use deep colors, so lighten names to keep them readable. */
.gn-step .gn-avatar-name { color: color-mix(in srgb, var(--c) 65%, #fff); }
.gn-step .score { font-family: var(--gn-font-display); font-size: clamp(1.2rem, 2.4vw, 2.6rem); color: var(--gn-accent); }
.gn-step .crown { font-size: clamp(2.4rem, 4.5vw, 5rem); animation: gn-drop .8s var(--gn-ease-pop) 2.2s both, gn-bob 2s ease-in-out 3s infinite; }
.gn-step .block {
    width: 100%; margin-top: 1vh; border-radius: 18px 18px 0 0; display: grid; place-items: start center; padding-top: .3em;
    font-family: var(--gn-font-display); font-size: clamp(2rem, 4vw, 4.4rem); color: rgba(0,0,0,.35);
    background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 55%, #1b0f3b));
    animation: gn-rise .9s var(--gn-ease-out) both; transform-origin: bottom;
}
.gn-step.step-1 .block { height: 15vh; }
.gn-step.step-2 .block { height: 10vh; }
.gn-step.step-3 .block { height: 6vh; }
.gn-step.step-1 .who { animation-delay: 1.6s; }
.gn-step.step-2 .who { animation-delay: .9s; }
.gn-step.step-3 .who { animation-delay: .4s; }
.gn-runners { display: flex; flex-wrap: wrap; gap: 1vw; justify-content: center; }
.gn-runners > * { animation-delay: 2.5s !important; }
.gn-podium-wrap.is-many { gap: 1.2vh; }
.gn-podium-wrap.is-many .step-1 .block { height: 11vh; }
.gn-podium-wrap.is-many .step-2 .block { height: 8vh; }
.gn-podium-wrap.is-many .step-3 .block { height: 6vh; }
.gn-podium-wrap.is-many .gn-runners { gap: .6vw; max-width: 94vw; }
.gn-runners .gn-panel { padding: .6em 1.2em; font-weight: 800; font-size: clamp(.9rem, 1.3vw, 1.4rem); }
.gn-podium-wrap.is-many .gn-runners .gn-panel { padding: .35em .8em; font-size: clamp(.75rem, 1vw, 1.1rem); }
@keyframes gn-rise { from { transform: scaleY(0); } }
@keyframes gn-drop { from { opacity: 0; transform: translateY(-60vh) rotate(-30deg); } to { opacity: 1; transform: none; } }

/* ================================================================ drawing */
.gn-pad { display: flex; flex-direction: column; gap: 10px; }
.gn-pad-canvas {
    width: 100%; aspect-ratio: 1; display: block; border-radius: 18px; background: #fff; touch-action: none;
    box-shadow: 0 6px 0 rgba(0,0,0,.25), var(--gn-shadow); cursor: crosshair;
}
.gn-pad.is-locked .gn-pad-canvas { filter: grayscale(.4) brightness(.85); cursor: not-allowed; }
.gn-pad-tools { display: flex; flex-direction: column; gap: 10px; }
.gn-pad-colors { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.gn-pad-colors .swatch {
    aspect-ratio: 1; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); background: var(--sw); cursor: pointer;
    transition: transform .15s var(--gn-ease-pop), border-color .15s;
}
.gn-pad-colors .swatch.is-on { border-color: var(--gn-accent); transform: scale(1.18); }
.gn-pad-row { display: flex; align-items: center; gap: 8px; }
.gn-pad-row .spacer { flex: 1; }
.gn-pad-row .brush {
    width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--gn-line); background: rgba(255,255,255,.9);
    display: grid; place-items: center; cursor: pointer;
}
.gn-pad-row .brush span { border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.gn-pad-row .brush.is-on { border-color: var(--gn-accent); box-shadow: 0 0 0 3px rgba(255,180,59,.4); }

.gn-drawing { display: block; width: 100%; height: auto; border-radius: 20px; filter: drop-shadow(0 10px 24px rgba(0,0,0,.35)); }
.gn-drawing.is-replay path { stroke-dasharray: 1 1.02; stroke-dashoffset: 1; animation-name: gn-draw-stroke; animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes gn-draw-stroke { to { stroke-dashoffset: 0; } }

/* ================================================================ bluff board (BluffBoard.razor) */
.gn-bluff { display: flex; flex-direction: column; gap: 1.6vh; }
.gn-bluff-options { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2vh 1.2vw; }
.gn-bluff-option { padding: .8em 1em; display: flex; flex-direction: column; gap: .5em; transition: transform .5s var(--gn-ease-pop), opacity .5s, box-shadow .5s, border-color .5s; }
.gn-bluff-option .text { font-weight: 900; font-size: clamp(1rem, 1.7vw, 1.9rem); line-height: 1.15; overflow-wrap: break-word; }
.gn-bluff-option.is-waiting { opacity: .55; }
.gn-bluff-option.is-lie { border-color: var(--gn-accent-2); }
.gn-bluff-option.is-truth { border-color: var(--gn-good); box-shadow: 0 0 0 4px var(--gn-good), 0 0 50px rgba(92,224,138,.45), var(--gn-shadow); }
.gn-bluff-option.is-active { transform: scale(1.05) rotate(-.6deg); z-index: 2; }
.gn-bluff-option.is-lie.is-active { box-shadow: 0 0 0 4px var(--gn-accent-2), 0 0 50px rgba(255,93,115,.45), var(--gn-shadow); }
.gn-bluff-option.is-unpicked { opacity: .5; }
.gn-bluff-option .verdict { display: flex; align-items: center; flex-wrap: wrap; gap: .5em; animation: gn-pop-in .45s var(--gn-ease-pop) both; }
.gn-bluff-option .verdict.faded { font-weight: 800; font-size: .9em; }
.gn-bluff-option .tag { font-family: var(--gn-font-display); font-size: clamp(.8rem, 1.2vw, 1.3rem); padding: .15em .6em; border-radius: 999px; animation: gn-stamp .5s var(--gn-ease-pop) both; }
.gn-bluff-option .tag.truth { background: var(--gn-good); color: #062b14; }
.gn-bluff-option .tag.lie { background: var(--gn-accent-2); color: #fff; }
.gn-bluff-option .pickers { display: flex; align-items: center; flex-wrap: wrap; gap: .4em; min-height: 34px; }
.gn-bluff-option .points {
    font-family: var(--gn-font-display); font-size: clamp(.75rem, 1.1vw, 1.2rem); color: var(--gn-good);
    padding: .1em .5em; border-radius: 999px; background: rgba(0,0,0,.3); border: 2px solid var(--c);
    animation: gn-pop-in .5s var(--gn-ease-pop) .8s both;
}
.gn-bluff-bar { display: flex; align-items: center; gap: 2vw; justify-content: center; }

/* ================================================================ end-of-game rating (PlayerShell) */
.gn-rate { padding: 14px 16px; text-align: center; }
.gn-rate-q { font-weight: 900; margin-bottom: 10px; }
.gn-rate-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gn-rate-btns button {
    font-size: 2rem; padding: 10px 0; border-radius: 16px; border: 2px solid var(--gn-line); background: var(--gn-panel-strong);
    cursor: pointer; touch-action: manipulation; transition: transform .12s var(--gn-ease-pop);
}
.gn-rate-btns button:active { transform: scale(.88); }
.gn-rate-thanks { font-weight: 900; font-size: 1.2rem; animation: gn-pop-in .4s var(--gn-ease-pop) both; }

/* The VIP's Skip intro button, or a note that the game is paused. Full-screen controllers move down to make room for it. */
.gn-skip-bar { display: grid; place-items: center; }
.gn-paused-note { padding: .4em 1.2em; border: 2px solid var(--gn-accent); border-radius: 999px; background: #1b0f3b; font-weight: 900; }
.gn-phone.has-skip { --gn-pad-top: 56px; }
:is(.gn-pad-open, .ca-driving) .gn-skip-bar { position: fixed; inset: 0 0 auto; z-index: 41; height: 56px; background: #1a1329; }

/* ================================================================ button controller (gamenight-pad.js) */
.gnp { display: none; }
.gnp.is-active {
    --ink: #1a1329; --deep: color-mix(in srgb, var(--me, #5ce08a) 55%, #1a1329);
    position: fixed; inset: var(--gn-pad-top, 0px) 0 0; z-index: 40; overflow: hidden; display: flex; flex-direction: column; gap: 8px;
    padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    background: #2b2545; color: #fff; font-family: "Press Start 2P", var(--gn-font-display);
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none;
}
.gnp, .gnp * { touch-action: none; user-select: none; -webkit-user-select: none; }
.gnp-bg {
    position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(rgba(255, 255, 255, .08) 1.5px, transparent 2px) 0 0 / 16px 16px,
        linear-gradient(180deg, color-mix(in srgb, var(--me, #5ce08a) 30%, #2b2545), #2b2545 70%);
}
.gnp-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; box-shadow: inset 0 0 0 10px var(--cue, #fff), inset 0 0 60px var(--cue, #fff); }
.gnp-top { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; min-height: 46px; flex: none; }
.gnp-me { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gnp-sprite { height: 42px; flex: none; image-rendering: pixelated; }
.gnp-name { font-size: .62rem; line-height: 1.6; color: color-mix(in srgb, var(--me, #fff) 60%, #fff); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gnp-title { font-size: .85rem; line-height: 1.4; text-align: center; color: #ffe14d; text-shadow: 2px 2px 0 var(--ink); }
.gnp-side { display: flex; align-items: center; justify-content: flex-end; gap: 10px; font-size: .55rem; line-height: 1.4; }
.gnp-link { display: inline-flex; align-items: center; gap: 6px; color: #d8d2ec; }
.gnp-link b { font-weight: 400; }
.gnp-link i { width: 10px; height: 10px; flex: none; background: #8c86a0; box-shadow: 0 0 0 2px var(--ink); }
.gnp-link[data-quality=good] i { background: #5ce08a; }
.gnp-link[data-quality=ok] i { background: #ffe14d; }
.gnp-link[data-quality=bad] i { background: #ff5d73; }
.gnp-full { width: 44px; height: 44px; flex: none; border: 3px solid var(--ink); border-radius: 6px; background: #4a4170; color: #fff; font-size: 1.1rem; }
.gnp-full[hidden] { display: none; }
.gnp-toast {
    position: absolute; z-index: 2; left: 50%; top: 64px; transform: translateX(-50%); opacity: 0; pointer-events: none; white-space: nowrap;
    padding: 10px 14px; font-size: .75rem; color: var(--ink); background: var(--cue, #fff); box-shadow: 0 0 0 3px var(--ink), 0 7px 0 var(--ink);
}
.gnp-btn {
    --face: color-mix(in srgb, var(--me, #5ce08a) 88%, #fff); --edge: color-mix(in srgb, var(--me, #5ce08a) 75%, #1a1329); --shade: var(--deep); --step: 6px;
    position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 6px 6px calc(var(--step) * 2 + 4px); color: var(--on-me, #1a1329); cursor: pointer;
    /* Stepped corners, like a giant pixel-art button */
    clip-path: polygon(0 calc(var(--step) * 2), var(--step) calc(var(--step) * 2), var(--step) var(--step), calc(var(--step) * 2) var(--step), calc(var(--step) * 2) 0,
        calc(100% - var(--step) * 2) 0, calc(100% - var(--step) * 2) var(--step), calc(100% - var(--step)) var(--step), calc(100% - var(--step)) calc(var(--step) * 2), 100% calc(var(--step) * 2),
        100% calc(100% - var(--step) * 2), calc(100% - var(--step)) calc(100% - var(--step) * 2), calc(100% - var(--step)) calc(100% - var(--step)), calc(100% - var(--step) * 2) calc(100% - var(--step)), calc(100% - var(--step) * 2) 100%,
        calc(var(--step) * 2) 100%, calc(var(--step) * 2) calc(100% - var(--step)), var(--step) calc(100% - var(--step)), var(--step) calc(100% - var(--step) * 2), 0 calc(100% - var(--step) * 2));
    background: linear-gradient(180deg, rgba(255, 255, 255, .7) 0 var(--step), transparent var(--step)), linear-gradient(0deg, var(--shade) 0 calc(var(--step) * 2.5), transparent calc(var(--step) * 2.5)),
        linear-gradient(90deg, var(--edge) 0 var(--step), var(--face) var(--step) calc(100% - var(--step)), var(--edge) calc(100% - var(--step)));
    /* Pressing is instant. Only letting go is eased. */
    transition: transform .1s ease-out, filter .1s ease-out;
}
.gnp-btn > * { pointer-events: none; }
.gnp-btn.is-down {
    transform: translateY(6px); filter: brightness(1.2) saturate(1.1); transition: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, .22) 0 var(--step), transparent var(--step)), linear-gradient(0deg, var(--shade) 0 var(--step), transparent var(--step)),
        linear-gradient(90deg, var(--edge) 0 var(--step), var(--face) var(--step) calc(100% - var(--step)), var(--edge) calc(100% - var(--step)));
}
.gnp-btn svg { width: min(52%, 64px); max-height: 70%; }
.gnp kbd { display: none; padding: 3px 8px; font: 900 .8rem var(--gn-font); color: #fff; background: rgba(26, 19, 41, .8); }
.gnp.has-keys kbd { display: block; }
