/* Shared zero-build visual system. Loaded after each screen's functional CSS. */
:root {
  color-scheme: dark;
  --ink: #0b0e11;
  --surface: #12171c;
  --surface-2: #192028;
  --surface-3: #222b35;
  --line: #303b46;
  --text: #f7f4ed;
  --muted: #aab4be;
  --gold: #f8c537;
  --cyan: #7dd3dc;
  --red: #d9363e;
  --blue: #2878d0;
  --yellow: #d49a12;
  --green: #238b57;
  --radius: 6px;
  font-family: "Arial Narrow", "Roboto Condensed", "Segoe UI", Arial, sans-serif;
  background: var(--ink);
  color: var(--text);
}

html, body { background: var(--ink); color: var(--text); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, transform 140ms ease; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { font-family: "Arial Narrow", Impact, "Roboto Condensed", sans-serif; letter-spacing: -.025em; }
.eyebrow { color: var(--cyan); font-size: 12px; letter-spacing: .14em; }
button, .button-link, .primary-link, .secondary-link, .pin-form button { border-radius: var(--radius); box-shadow: none; }
button:not(.nav-tab):not(.text-btn):not(.kick-btn):hover, .button-link:hover, .primary-link:hover, .pin-form button:hover { background: #ffd55b; transform: translateY(-1px); }
.secondary-link:hover { background: var(--surface-3); border-color: #536171; }

/* Home */
.home-shell { background: var(--ink); }
.hero { min-height: auto; padding: 22px clamp(18px, 4vw, 56px) 72px; }
.hero-media {
  background-image: linear-gradient(90deg, rgba(11,14,17,.88) 0%, rgba(11,14,17,.62) 55%, rgba(11,14,17,.28) 100%), url('./assets/bk1.jpg');
  background-position: center;
  background-size: cover;
}
body[data-background='2'] .hero-media { background-image: linear-gradient(90deg, rgba(11,14,17,.88) 0%, rgba(11,14,17,.62) 55%, rgba(11,14,17,.28) 100%), url('./assets/bk2.png'); }
body[data-background='3'] .hero-media { background-image: linear-gradient(90deg, rgba(11,14,17,.88) 0%, rgba(11,14,17,.62) 55%, rgba(11,14,17,.28) 100%), url('./assets/bk3.png'); }
body[data-background='4'] .hero-media { background-image: linear-gradient(90deg, rgba(11,14,17,.88) 0%, rgba(11,14,17,.62) 55%, rgba(11,14,17,.28) 100%), url('./assets/bk4.jpg'); }
body[data-background='5'] .hero-media { background-image: linear-gradient(90deg, rgba(11,14,17,.88) 0%, rgba(11,14,17,.62) 55%, rgba(11,14,17,.28) 100%), url('./assets/bk5.jpg'); }
body[data-background='6'] .hero-media { background-image: linear-gradient(90deg, rgba(11,14,17,.88) 0%, rgba(11,14,17,.62) 55%, rgba(11,14,17,.28) 100%), url('./assets/bk6.jpg'); }
body[data-background='7'] .hero-media { background-image: linear-gradient(90deg, rgba(11,14,17,.88) 0%, rgba(11,14,17,.62) 55%, rgba(11,14,17,.28) 100%), url('./assets/bk7.jpg'); }
body[data-background='8'] .hero-media { background-image: linear-gradient(90deg, rgba(11,14,17,.88) 0%, rgba(11,14,17,.62) 55%, rgba(11,14,17,.28) 100%), url('./assets/bk8.jpg'); }
.home-nav { max-width: 1160px; }
.brand { color: var(--text); font-size: 18px; letter-spacing: -.02em; }
.brand img { background: transparent; border: 0; border-radius: 0; height: 46px; padding: 0; width: 46px; }
.nav-actions { align-items: center; gap: 4px; }
.nav-actions a { border: 0; border-radius: 4px; color: var(--muted); font-size: 14px; padding: 9px 12px; }
.nav-actions a:hover { background: var(--surface-2); color: var(--text); }
.nav-actions a:last-child { background: var(--gold); color: var(--ink); margin-left: 6px; }
.hero-content { gap: clamp(30px, 6vw, 80px); grid-template-columns: minmax(0,1fr) 330px; margin-top: clamp(70px,12vh,130px); max-width: 1160px; }
.hero-main { gap: 20px; }
.hero h1 { font-size: clamp(48px,7.6vw,98px); line-height: .88; max-width: 820px; text-wrap: balance; }
.hero-copy { color: var(--muted); font-size: clamp(17px,1.8vw,21px); font-weight: 500; line-height: 1.5; max-width: 590px; }
.hero-actions { gap: 8px; }
.primary-link, .secondary-link, .pin-form button { min-height: 48px; padding: 13px 18px; }
.primary-link, .pin-form button { background: var(--gold); }
.secondary-link { background: transparent; border-color: var(--line); }
.pin-form { border-top: 1px solid var(--line); margin-top: 12px; max-width: 500px; padding-top: 20px; }
.pin-form label { color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.pin-form input { background: var(--surface); border-color: var(--line); border-radius: var(--radius); font-variant-numeric: tabular-nums; letter-spacing: .14em; }
.explore-panel, .account-panel, .player-game-card { background: var(--surface); border-color: var(--line); border-radius: var(--radius); }
.explore-panel { padding: 16px; }
.explore-panel h2 { font-size: 24px; }
.featured-card { background: transparent; border-color: var(--line); border-radius: 4px; }
.quick-links { background: var(--line); gap: 1px; }
.link-panel { background: var(--surface); min-height: 142px; padding: clamp(24px,4vw,44px); }
.link-panel span { color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.link-panel strong { font-size: clamp(23px,2.8vw,36px); max-width: 390px; }
.host-panel, .play-panel, .register-panel { border-top-width: 3px; }
.account-section, .feature-band { max-width: 1160px; }
.account-copy h2, .feature-band h2 { font-size: clamp(36px,5vw,58px); }
.account-copy p, .feature-grid p { color: var(--muted); font-weight: 400; }
.account-panel { padding: clamp(16px,3vw,28px); }
.account-form input { background: var(--ink); border-color: var(--line); border-radius: var(--radius); }
.feature-grid { gap: 12px; }
.feature-grid article { background: transparent; border: 0; border-top: 2px solid var(--line); min-height: 170px; padding: 20px 4px; }

/* Host workspace */
body:has(.host-shell) { background: var(--ink); }
.host-shell { margin: 0 auto; max-width: 1320px; padding: 24px clamp(18px,4vw,52px) 64px; }
.user-bar { border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 0 0 10px; }
.host-nav { border-bottom: 1px solid var(--line); gap: 3px; margin-bottom: 48px; overflow-x: auto; }
.nav-home { border: 0; color: var(--muted); font-size: 14px; margin-right: 16px; padding: 10px 5px; }
.nav-tab { border-bottom-width: 2px; color: var(--muted); font-size: 14px; padding: 13px 16px; white-space: nowrap; }
.nav-tab.active { border-bottom-color: var(--gold); color: var(--text); }
.screen.active { gap: 24px; }
.host-shell h1 { font-size: clamp(44px,7vw,84px); line-height: .95; }
.host-shell h2 { font-size: 30px; }
.setup-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-width: 980px; padding: 18px; }
.host-shell select, .host-shell input, .host-shell textarea { background: var(--ink); border-color: var(--line); border-radius: var(--radius); }
.pin-panel { border: 1px solid var(--line); border-left: 5px solid var(--gold); padding: 24px 28px; }
.pin-panel p { font-size: 12px; letter-spacing: .14em; }
.pin-panel strong { font-size: clamp(72px,15vw,154px); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.player-chip, .leaderboard li, .quiz-list-item, .history-card, .history-scoreboard li, .scheduled-play-item, .question-card { background: var(--surface); border-color: var(--line); border-radius: var(--radius); }
.player-chip { border-left: 3px solid var(--cyan); font-size: 20px; padding: 14px; }
.leaderboard li { font-size: 22px; }
.timer-track { background: var(--surface-3); border-radius: 2px; height: 14px; }
.timer-bar { border-radius: 2px; }
.question-card { border-top: 3px solid var(--gold); padding: 22px; }
.answer-row { background: var(--ink); border-color: var(--line); border-radius: 4px; }
.answer-row:has(input:checked) { background: rgba(35,139,87,.12); border-color: #3ebc7c; }
.auth-screen { margin: 8vh auto; max-width: 460px; }
.auth-home-link { color: var(--muted); }
.auth-tabs { border-bottom: 1px solid var(--line); }
.auth-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px,5vw,38px); }
.auth-form h1 { font-size: 46px; }
.auth-form input { background: var(--ink); }

/* Player game controller */
body:has(.player-shell) { background: var(--ink); }
.player-shell { margin: 0 auto; max-width: 760px; min-height: 100vh; padding: 20px clamp(16px,4vw,32px) 40px; }
.player-nav { border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; margin-bottom: 8vh; padding-bottom: 14px; }
.player-nav a { color: var(--muted); }
.player-nav a:hover { color: var(--text); }
.player-shell .screen.active { gap: 18px; }
.player-shell h1 { font-size: clamp(42px,10vw,68px); line-height: .95; }
.join-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); gap: 10px; padding: 16px; }
.join-form input { background: var(--ink); border-color: var(--line); border-radius: var(--radius); min-height: 56px; }
.top-row { color: var(--muted); font-size: 14px; }
.question-bubble { background: transparent; border: 0; border-radius: 0; margin: 8px 0; padding: 12px 4px 20px; }
.question-bubble p { font-size: clamp(23px,5vw,34px); line-height: 1.25; }
.answer-grid { gap: 10px; }
.answer { border: 0; border-radius: var(--radius); box-shadow: inset 0 -3px rgba(0,0,0,.25); font-size: 20px; min-height: 86px; }
.answer:hover { filter: brightness(1.08); transform: translateY(-1px); }
.answer-a, .color-red { background: var(--red); }
.answer-b, .color-blue { background: var(--blue); }
.answer-c, .color-yellow { background: var(--yellow); }
.answer-d, .color-green { background: var(--green); }
.answer-true { background: var(--green); }
.answer-false { background: var(--red); }
.color-option { border: 0; border-radius: var(--radius); }
.answer-shape { background: var(--surface); border-color: var(--line); border-radius: var(--radius); }
.answer.selected, .answer-shape.selected { outline: 3px solid var(--text); outline-offset: 3px; }
.result-flash { border-radius: var(--radius); }
.countdown-overlay { background: rgba(11,14,17,.94); }
.countdown-number { color: var(--gold); text-shadow: none; }

/* Public host pages */
body:has(.page-shell) { background: var(--ink); }
.profile-hero { min-height: auto; padding-bottom: 72px; }
.hero-bg { background: linear-gradient(115deg,rgba(11,14,17,.98) 0 48%,rgba(11,14,17,.80)), var(--surface); }
.profile-nav { max-width: 1160px; }
.profile-nav .brand { color: var(--text); }
.profile-nav a:not(.brand) { border: 0; color: var(--muted); font-size: 13px; padding: 9px 10px; }
.profile-hero .hero-content { grid-template-columns: minmax(210px,270px) minmax(320px,430px) minmax(360px,500px); margin-top: 90px; }
.profile-main h1 { font-size: clamp(42px,5vw,66px); }
.profile-logo { border: 0; border-radius: var(--radius); }
.scheduled-play-card, .video-panel, .play-countdown, .quiz-card, .empty-state, .play-history-card, .play-scoreboard li { background: var(--surface); border-color: var(--line); border-radius: var(--radius); }
.profile-details { background: var(--line); }
.profile-details article { background: var(--surface); }
.quiz-section, .play-history-section { max-width: 1160px; }

@media (max-width: 820px) {
  .nav-actions a:nth-child(2), .nav-actions a:nth-child(3) { display: none; }
  .hero-content { grid-template-columns: 1fr; margin-top: 70px; }
  .hero h1 { font-size: clamp(48px,15vw,76px); }
  .quick-links, .feature-grid, .account-section, .player-auth-forms { grid-template-columns: 1fr; }
  .host-nav { margin-bottom: 32px; }
  .setup-row, .lobby-grid { grid-template-columns: 1fr; }
  .profile-hero .hero-content { grid-template-columns: 1fr; margin-top: 56px; }
}

@media (max-width: 520px) {
  .hero { padding-bottom: 48px; }
  .brand span { font-size: 16px; }
  .hero-actions > * { flex: 1; text-align: center; }
  .pin-form div { grid-template-columns: 1fr; }
  .link-panel { min-height: 120px; }
  .host-shell { padding-top: 14px; }
  .nav-home { display: none; }
  .nav-tab { padding-inline: 12px; }
  .player-shell { padding-inline: 14px; }
  .answer-grid, .answer-grid-shapes { gap: 8px; }
}

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