@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #07080a;
  --bg-2: #101218;
  --ink: #f4f5f7;
  --muted: #9aa3ad;
  --line: rgba(255, 255, 255, 0.1);
  --red: #ff2d4a;
  --red-2: #c81e3a;
  --gold: #f0c14b;
  --ok: #3dd68c;
  --bad: #ff6b6b;
  --focus: #ff2d4a;
  --radius: 16px;
  --header-h: 56px;
  --bottom-h: 92px;
  --max: 1080px;
  --gutter: 16px;
  --sans: "Archivo", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { scroll-behavior: smooth; color-scheme: dark; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: #fff; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

h1, h2, h3 { margin: 0 0 0.4rem; line-height: 1.12; letter-spacing: -0.03em; }
h1 { font-size: 1.7rem; font-weight: 700; }
h2 { font-size: 0.95rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
h3 { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
img { max-width: 100%; display: block; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 40;
  padding: 8px 12px;
  background: #fff;
  color: #111;
  border-radius: 8px;
  font-weight: 700;
}
.skip-link:focus { top: 10px; }
#main:focus,
#admin-main:focus { outline: none; }

.lede { color: var(--muted); margin: 0 0 1rem; max-width: 36rem; }
.muted { color: var(--muted); }
.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 45, 74, 0.28);
}
.btn:hover { background: var(--red-2); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-play { gap: 8px; padding-left: 16px; }
.btn-play svg {
  width: 15px;
  height: 15px;
  margin-left: 1px;
  flex-shrink: 0;
}
.form.is-busy { opacity: 0.72; pointer-events: none; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 1rem 0 0;
}
.hero-actions form { margin: 0; }

.flash {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(61, 214, 140, 0.12);
  color: var(--ok);
  font-weight: 600;
  font-size: 0.9rem;
}
.flash-error { background: rgba(255, 45, 74, 0.14); color: var(--bad); }
.flash-ok { background: rgba(61, 214, 140, 0.12); color: var(--ok); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 8, 10, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: env(safe-area-inset-top);
}
.site-header-inner,
.site-main,
.site-footer-inner {
  width: min(var(--max), calc(100% - (var(--gutter) * 2)));
  margin: 0 auto;
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
}
.brand:hover { color: #fff; }
.brand-logo {
  display: block;
  height: 32px;
  width: auto;
}
.desktop-nav { display: none; gap: 6px; align-items: center; }
.desktop-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  color: var(--muted);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 999px;
}
.desktop-nav a:hover,
.desktop-nav a.active { color: #fff; background: rgba(255, 255, 255, 0.06); }
.desktop-nav .nav-cta {
  min-height: 38px;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(180deg, #ff5a70 0%, var(--red) 55%, var(--red-2) 100%);
  box-shadow: 0 8px 18px rgba(255, 45, 74, 0.38);
}
.desktop-nav .nav-cta:hover,
.desktop-nav .nav-cta.active {
  color: #fff;
  background: var(--red-2);
  box-shadow: 0 8px 18px rgba(255, 45, 74, 0.48);
}

.site-main { padding: 12px 0 24px; }
.site-footer {
  padding: 8px 0 calc(var(--bottom-h) + env(safe-area-inset-bottom) + 16px);
  color: var(--muted);
  font-size: 0.75rem;
}
.site-footer p { margin: 0; }
.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
}

.bottom-nav {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  min-height: 58px;
  padding: 6px 4px 8px;
  overflow: visible;
  background: rgba(16, 18, 24, 0.88);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  min-height: 46px;
  padding: 4px 2px 2px;
  color: var(--muted);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 18px;
}
.bottom-nav a span {
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
}
.bottom-nav svg { width: 18px; height: 18px; }
.bottom-nav a.active { color: #fff; }
.bottom-nav a:hover { color: #fff; }
.bottom-nav .nav-play {
  color: #fff;
  background: transparent;
  justify-content: flex-end;
  gap: 4px;
  min-height: 0;
  padding-bottom: 2px;
}
.bottom-nav .nav-play.active,
.bottom-nav .nav-play:hover {
  background: transparent;
  color: #fff;
}
.nav-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-top: -32px;
  color: #fff;
  background: linear-gradient(180deg, #ff5a70 0%, var(--red) 52%, var(--red-2) 100%);
  border: 3px solid #101218;
  border-radius: 50%;
  box-shadow: 0 12px 28px rgba(255, 45, 74, 0.58);
}
.nav-play-btn svg {
  width: 36px;
  height: 36px;
}
.bottom-nav .nav-play.active .nav-play-btn {
  box-shadow: 0 0 0 2px #fff, 0 12px 28px rgba(255, 45, 74, 0.68);
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
}
.live-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(255, 45, 74, 0.7);
  animation: pulse 1.6s ease-out infinite;
}
.live-dot.is-pause::before { background: var(--gold); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 45, 74, 0.55); }
  100% { box-shadow: 0 0 0 8px rgba(255, 45, 74, 0); }
}

.page-home .site-main,
.page-quiz .site-main {
  width: 100%;
  padding: 0;
}
.page-quiz .site-footer { display: none; }

.night {
  position: relative;
  min-height: 320px;
  display: grid;
  align-items: end;
  padding: 28px 0 32px;
  overflow: hidden;
}
.night-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.night-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: saturate(0.85) brightness(0.55);
}
.night-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(120% 70% at 50% 100%, rgba(255, 45, 74, 0.28), transparent 55%),
    linear-gradient(180deg, rgba(7, 8, 10, 0.2) 0%, rgba(7, 8, 10, 0.55) 48%, #07080a 100%);
}
.night-shell,
.home-body {
  position: relative;
  z-index: 2;
  width: min(var(--max), calc(100% - (var(--gutter) * 2)));
  margin: 0 auto;
}
.night-shell {
  display: grid;
  gap: 18px;
  align-items: end;
}
.night-core {
  display: grid;
  justify-items: start;
  padding: 8px 0 4px;
  min-width: 0;
}
.night-core h1 {
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  margin-bottom: 0.6rem;
}
.night-core .lede {
  color: #d5d9de;
  font-size: 0.98rem;
  margin-bottom: 0;
}
.night-core .hero-actions { margin-top: 1.1rem; }
.night-core .btn-ghost {
  background: rgba(7, 8, 10, 0.35);
  border-color: rgba(255, 255, 255, 0.22);
}
.night-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 0;
  color: #d7dbe0;
  font-weight: 600;
  font-size: 0.88rem;
}
.night-meta .avatar-initial {
  background: var(--red);
  color: #fff;
}
.hero-board {
  width: 100%;
  padding: 14px;
  background: rgba(10, 12, 16, 0.78);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(16px);
  color: #fff;
}
.hero-board-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
}
.hero-board-hook {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
}
.hero-board-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.hero-board-row {
  display: grid;
  grid-template-columns: 28px 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 4px;
  border-radius: 10px;
}
.hero-board-rank {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.hero-board-row.is-top1 .hero-board-rank { color: var(--gold); }
.hero-board-row.is-top2 .hero-board-rank { color: #d9dee6; }
.hero-board-row.is-top3 .hero-board-rank { color: #d4a574; }
.hero-board-row.is-you { background: rgba(255, 45, 74, 0.12); }
.hero-board-who { min-width: 0; display: grid; }
.hero-board-who strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}
.hero-board-who em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.72rem;
}
.hero-board-empty {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
}
.hero-board-link {
  display: inline-flex;
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}
.hero-board-link:hover { color: #fff; border-bottom-color: var(--red); }

.home-body {
  padding: 22px 0 28px;
}
.home-body h2 { margin-bottom: 10px; }
.page-home .flash {
  width: min(var(--max), calc(100% - (var(--gutter) * 2)));
  margin: 12px auto;
}
.how-grid {
  display: grid;
  gap: 10px;
}
.how-grid article {
  padding: 14px 14px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.how-grid strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
}
.how-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.home-body .hero-actions { margin-top: 14px; }

.guide { padding: 8px 0 20px; }
.guide-hero { margin-bottom: 22px; }
.guide-hero h1 {
  margin: 0 0 8px;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}
.guide h2 {
  margin: 22px 0 10px;
}
.guide-steps {
  display: grid;
  gap: 10px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.guide-steps li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 4px 12px;
  align-items: start;
  margin: 0;
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.guide-steps li::before {
  counter-increment: step;
  content: counter(step);
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}
.guide-steps strong,
.guide-steps p { grid-column: 2; }
.guide-steps strong {
  display: block;
  margin: 6px 0 0;
  font-size: 0.95rem;
}
.guide-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.arena {
  width: min(1080px, calc(100% - (var(--gutter) * 2)));
  margin: 0 auto;
  padding: 16px 0 calc(var(--bottom-h) + 16px);
}
.quiz-card {
  position: relative;
  padding: 18px 16px 20px;
  background: #0e1016;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}
.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.quiz-progress {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.quiz-progress strong {
  color: #fff;
  font-size: 0.86rem;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.hud,
.profile-hud,
.compact-hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0 0 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.hud > div,
.profile-hud > div,
.compact-hud > div {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}
.hud > div:last-child,
.profile-hud > div:last-child,
.compact-hud > div:last-child { border-right: 0; }
.stat-label {
  display: block;
  margin: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.hud strong,
.profile-hud strong,
.compact-hud strong {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.quiz-hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 20px;
}
.quiz-hud > div {
  padding: 10px 12px;
  background: #0a0c11;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.quiz-hud strong {
  display: block;
  margin-top: 2px;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.quiz-question {
  font-size: clamp(1.2rem, 3.4vw, 1.7rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  max-width: 38rem;
  text-wrap: pretty;
}
.quiz-answers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
}
.answer-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0a0c11;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.answer-key {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(255, 45, 74, 0.12);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--red);
}
.answer-text {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 600;
}
.answer-btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.28);
  background: #141821;
}
.answer-btn:disabled { cursor: default; }
.answer-btn.is-picked { border-color: rgba(255, 255, 255, 0.42); }
.answer-btn.is-right {
  border-color: rgba(61, 214, 140, 0.55);
  background: rgba(61, 214, 140, 0.1);
  color: #fff;
}
.answer-btn.is-right .answer-key {
  background: var(--ok);
  color: #04140c;
}
.answer-btn.is-wrong {
  border-color: rgba(255, 45, 74, 0.5);
  background: rgba(255, 45, 74, 0.1);
  color: #fff;
}
.answer-btn.is-wrong .answer-key {
  background: var(--red);
  color: #fff;
}
.answer-skel {
  display: block;
  min-height: 58px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}
.quiz-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -6px 0 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
}
.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.quiz-result {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.quiz-next { width: 100%; }
.quiz-feedback {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
}
.quiz-feedback.is-right {
  background: rgba(61, 214, 140, 0.1);
  border-color: rgba(61, 214, 140, 0.28);
  color: var(--ok);
}
.quiz-feedback.is-wrong {
  background: rgba(255, 45, 74, 0.1);
  border-color: rgba(255, 45, 74, 0.28);
  color: var(--bad);
}
.quiz-verdict {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.quiz-feedback p {
  margin: 0.35rem 0 0;
  font-weight: 500;
  color: var(--ink);
  font-size: 0.88rem;
}
.quiz-feedback .quiz-explain {
  color: var(--muted);
  font-weight: 400;
}
.quiz-side { display: none; }
.quiz-side-hero {
  display: grid;
  gap: 4px;
  margin: 0 0 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.quiz-side-hero strong {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.quiz-side-hero span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.quiz-side-stats {
  display: grid;
  margin: 0;
}
.quiz-side-stats > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.quiz-side-stats > div:last-child { border-bottom: 0; padding-bottom: 0; }
.quiz-side-stats dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.quiz-side-stats dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.quiz-card.is-loading .quiz-answers { opacity: 0.65; }
.quiz-card.has-ad { overflow: hidden; }

.quiz-ad {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow: hidden;
  border-radius: inherit;
  background: #24186e;
  color: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.985);
  transform-origin: center center;
  transition: opacity 0.42s ease, transform 0.42s ease, visibility 0.42s ease;
}
.quiz-ad.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}
.quiz-ad-media {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 36px 10px 52px;
}
.quiz-ad-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.quiz-ad.is-open .quiz-ad-image {
  opacity: 1;
}
.quiz-ad-progress {
  position: relative;
  z-index: 2;
  height: 3px;
  background: rgba(255, 255, 255, 0.16);
}
.quiz-ad-progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: #f0c14b;
}
.quiz-ad-progress-bar.is-running {
  transform: scaleX(1);
  transition: transform 5s linear;
}
.quiz-ad-chrome {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 0;
}
.quiz-ad-badge {
  margin: 0;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
}
.quiz-ad-more {
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}
.quiz-ad-more:hover { color: #f0c14b; }
.quiz-ad-skip {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 14px;
  min-height: 40px;
  min-width: 108px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: default;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease 0.12s, transform 0.35s ease 0.12s, background 0.2s ease, color 0.2s ease;
}
.quiz-ad.is-open .quiz-ad-skip {
  opacity: 1;
  transform: translateY(0);
}
.quiz-ad-skip:not(:disabled) {
  background: #fff;
  color: #0b1220;
  cursor: pointer;
}
.quiz-ad-skip:not(:disabled):hover { background: #e9eef6; }

.sponsor-slot { margin: 0 0 16px; }
.home-body .sponsor-slot { margin: 0 0 22px; }
.guide .sponsor-slot { margin: 8px 0 22px; }
.scoreboard .sponsor-slot { margin: 0 0 14px; }
.quiz-side .sponsor-slot { margin: 16px 0 0; }
.sponsor-slot-rail { margin: 12px 0 0; }
.sponsor-link {
  position: relative;
  display: block;
  overflow: hidden;
  color: inherit;
  background: #1c1468;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
}
.sponsor-link:hover { color: inherit; }
.sponsor-kicker {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 8px;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.48);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
}
.sponsor-slot img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center;
}
.sponsor-slot-poster img {
  height: 168px;
  object-fit: cover;
}
.hero-partner {
  margin: 12px 0 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
}
.hero-partner a {
  color: #f0c14b;
  letter-spacing: 0.14em;
}
.hero-partner a:hover { color: #fff; }
.footer-partner {
  margin: 6px 0 0;
  color: var(--muted);
}
.footer-partner a {
  color: #f0c14b;
  font-weight: 700;
}
.footer-partner a:hover { color: #fff; }

.gate {
  min-height: calc(100dvh - var(--header-h) - var(--bottom-h));
  display: grid;
  place-items: center;
  padding: 20px 0 40px;
}
.gate:has(.gate-auth) {
  align-items: start;
  padding-top: 16px;
}
.gate-card {
  width: min(26rem, 100%);
  padding: 22px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.gate-card.gate-auth {
  width: min(40rem, 100%);
}
.gate-card .btn { width: 100%; }
.page-auth .form .btn,
.auth-split .form .btn,
.auth-google .btn { width: 100%; }
.auth-google { margin: 0 0 4px; }
.btn-google {
  gap: 10px;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid var(--line);
  box-shadow: none;
  letter-spacing: 0;
}
.btn-google:hover {
  background: #f2f2f2;
  color: #1f1f1f;
}
.btn-google svg { flex-shrink: 0; }
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 12px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-switch { position: absolute; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  background: #0c0e13;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.auth-tab {
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}
#auth-view-login:checked ~ .auth-tabs label[for="auth-view-login"],
#auth-view-register:checked ~ .auth-tabs label[for="auth-view-register"] {
  background: var(--red);
  color: #fff;
}
.auth-panes { display: grid; }
.auth-pane h2 { margin-bottom: 0.35rem; }
.auth-pane .lede { margin-bottom: 1rem; }
#auth-view-login:checked ~ .auth-panes .auth-pane-register,
#auth-view-register:checked ~ .auth-panes .auth-pane-login {
  display: none;
}
@media (max-width: 767px) {
  .auth-split:not(.is-login-only) .auth-pane h2 { display: none; }
}

.form { display: grid; gap: 14px; }
.form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.form input,
.form select,
.form textarea,
.period-bar select,
.filter-bar input,
.filter-bar select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: #0c0e13;
  color: var(--ink);
}
.form textarea { min-height: 88px; padding: 10px 12px; resize: vertical; }
.form .hint { margin: 0; font-weight: 400; font-size: 0.78rem; color: var(--muted); letter-spacing: 0; }
.auth-pair {
  display: grid;
  gap: 14px;
}
.form .check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.form .check input { width: 16px; height: 16px; min-height: 16px; }

.scoreboard { padding-bottom: 8px; }
.scoreboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 16px;
}
.scoreboard-head h1 {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
}
.board-period {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
}
.seg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  background: var(--bg-2);
  border-radius: 999px;
  border: 1px solid var(--line);
}
.seg-item {
  display: grid;
  place-items: center;
  min-height: 36px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.seg-item.active {
  background: var(--red);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 45, 74, 0.3);
}
.seg-item:hover { color: #fff; }

.period-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin: 0 0 12px;
}
.period-bar label {
  display: grid;
  gap: 4px;
  flex: 1 1 200px;
  font-weight: 700;
  font-size: 0.78rem;
}
.board-list,
.history-list,
.activity-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-2);
}
.board-row {
  display: grid;
  grid-template-columns: 40px 32px minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.board-score { text-align: right; min-width: 5.5rem; }
.board-row:last-child { border-bottom: 0; }
.board-rank { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.board-who { min-width: 0; }
.board-who strong,
.board-score strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}
.board-who strong {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.board-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-who > span,
.board-score span { display: block; color: var(--muted); font-size: 0.75rem; }
@media (max-width: 639px) { .board-score span { display: none; } }
.avatar-initial {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-weight: 800;
  flex: 0 0 auto;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.board-row.is-top1 { background: rgba(240, 193, 75, 0.08); }
.board-row.is-top1 .board-rank { color: var(--gold); }
.board-row.is-top2 { background: rgba(255, 255, 255, 0.03); }
.board-row.is-top3 { background: rgba(212, 165, 116, 0.08); }
.board-row.is-you { box-shadow: inset 3px 0 0 var(--red); }
.board-row.is-pinned {
  margin-top: 8px;
  border: 1px solid var(--red);
  border-radius: 16px;
  background: var(--bg-2);
}
.you-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: 0 7px;
  min-height: 18px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}
.board-split { margin: 6px 0; text-align: center; color: var(--muted); letter-spacing: 0.25em; }

.jersey {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: center;
  padding: 18px;
  margin-bottom: 14px;
  border-radius: 22px;
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(255, 45, 74, 0.45), transparent 50%),
    var(--bg-2);
  border: 1px solid var(--line);
}
.jersey-num {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  color: #fff;
}
.jersey-body h1 { margin-bottom: 0.2rem; }
.jersey-body .lede { margin: 0; }
.jersey-body .hero-actions { margin-top: 10px; }

.profile-hud { grid-template-columns: repeat(4, 1fr); }
.compact-hud { grid-template-columns: repeat(3, 1fr); margin: 10px 0 0; }
.compact-hud em { display: block; color: var(--muted); font-style: normal; font-size: 0.72rem; }
.rank-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 14px;
}
.rank-strip a {
  display: grid;
  gap: 2px;
  padding: 10px 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
  color: inherit;
}
.rank-strip span { color: var(--muted); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.rank-strip strong { font-size: 1.05rem; }
.strip-note { margin: -6px 0 14px; font-size: 0.78rem; }
.sheet { margin: 0 0 16px; }
.sheet h2 { margin-bottom: 8px; }
.page-profile .hero-actions { margin-bottom: 18px; }

.activity-list li {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.activity-list li:last-child { border-bottom: 0; }
.activity-list time { color: var(--muted); font-size: 0.75rem; font-weight: 500; }
.activity-list .is-correct { color: var(--ok); }
.activity-list .is-wrong { color: var(--bad); }
.history-heading { margin: 14px 0 6px; }
.history-list li + li { border-top: 1px solid var(--line); }
.history-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  align-items: center;
  min-height: 52px;
  padding: 10px 14px;
  color: inherit;
}
.history-meta { grid-column: 1; color: var(--muted); font-size: 0.78rem; }
.history-rank { grid-row: 1 / span 2; }
.empty-state { padding: 8px 0; }
.empty-state .btn { margin-top: 10px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.85rem;
}
.pager a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
  font-weight: 700;
}

.admin-body { background: var(--bg); color: var(--ink); }
.admin-shell { min-height: 100vh; display: grid; }
.admin-side { background: #050608; color: var(--muted); padding: 18px 16px; }
.admin-side a { color: var(--muted); }
.admin-side .brand,
.brand-side { color: #fff; margin-bottom: 16px; }
.admin-nav { display: grid; gap: 2px; }
.admin-nav a {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
}
.admin-nav a.active,
.admin-nav a:hover { background: rgba(255, 45, 74, 0.16); color: #fff; }
.admin-side-foot { margin-top: 18px; font-size: 0.82rem; }
.admin-main { padding: 16px; }
.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.filter-bar { display: grid; gap: 8px; margin-bottom: 12px; }
.table-wrap {
  overflow-x: auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.admin-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.9rem;
}
.admin-table th { font-size: 0.72rem; color: var(--muted); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form { display: inline; margin: 0; }
button.linkish {
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 40px;
  padding: 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-published,
.badge-active { background: rgba(61, 214, 140, 0.16); color: var(--ok); }
.badge-draft { background: rgba(240, 193, 75, 0.16); color: var(--gold); }
.badge-inactive,
.badge-suspended { background: rgba(255, 45, 74, 0.16); color: var(--bad); }
.badge-flagged { background: rgba(240, 193, 75, 0.16); color: var(--gold); }
.admin-stats { display: grid; gap: 10px; }
.panel,
.stat-card,
.board-card,
.rank-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.panel-narrow { max-width: 36rem; }
.panel-narrow .form h2 {
  margin: 14px 0 0;
  font-size: 1.05rem;
}
.prompt-panel { margin-top: 16px; }
.prompt-panel .page-head { margin-bottom: 12px; align-items: flex-start; }
.prompt-panel h2 { margin: 0 0 6px; }
.prompt-box {
  display: block;
  width: 100%;
  min-height: 280px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c0e13;
  color: var(--ink);
  font: 0.82rem/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  resize: vertical;
  white-space: pre;
}
.stat-value { margin: 0; font-size: 1.4rem; font-weight: 800; }
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px 16px;
  background: var(--bg);
}
.auth-card {
  width: min(24rem, 100%);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .spinner, .live-dot::before { animation: none; }
  .quiz-ad,
  .quiz-ad-image,
  .quiz-ad-skip {
    transition: none;
  }
  .quiz-ad-progress-bar.is-running { transition: none; transform: scaleX(1); }
  html { scroll-behavior: auto; }
}

@media (max-width: 359px) {
  :root { --gutter: 12px; }
  .profile-hud,
  .rank-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 640px) {
  .board-row { grid-template-columns: 48px 32px minmax(0, 1fr) minmax(160px, auto); }
}

@media (min-width: 768px) {
  :root { --header-h: 60px; --gutter: 28px; }
  .quiz-card { padding: 22px 24px 24px; }
  .quiz-answers { grid-template-columns: 1fr 1fr; }
  .answer-btn { min-height: 64px; }
  .night { min-height: 420px; padding: 40px 0 40px; }
  .night-shell { grid-template-columns: minmax(0, 1.2fr) minmax(260px, 300px); align-items: center; }
  .hero-board { align-self: center; }
  .how-grid { grid-template-columns: repeat(3, 1fr); }
  .sponsor-slot-poster img { height: 200px; }
  .guide-hero h1 { font-size: 2rem; }
  .guide-steps {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
  .guide-steps li {
    grid-template-columns: 1fr;
    min-height: 100%;
  }
  .guide-steps li::before {
    grid-column: 1;
    grid-row: auto;
  }
  .guide-steps strong,
  .guide-steps p { grid-column: 1; }
  .guide-steps strong { margin-top: 8px; }
  .gate-card.gate-auth { width: min(58rem, 100%); }
  .auth-split:not(.is-login-only) .auth-tabs { display: none; }
  .auth-split:not(.is-login-only) .auth-panes {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 0 28px;
    align-items: stretch;
  }
  .auth-split:not(.is-login-only) .auth-pane {
    display: flex;
    flex-direction: column;
  }
  .auth-split:not(.is-login-only) .auth-pane .form {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  .auth-split:not(.is-login-only) .auth-pane .form .btn {
    margin-top: auto;
  }
  .auth-split:not(.is-login-only) .auth-pair {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .auth-split:not(.is-login-only) .auth-pair label { min-width: 0; }
  .auth-split:not(.is-login-only) .auth-pane-login {
    padding-right: 28px;
    border-right: 1px solid var(--line);
  }
  .auth-split:not(.is-login-only) #auth-view-login:checked ~ .auth-panes .auth-pane-register,
  .auth-split:not(.is-login-only) #auth-view-register:checked ~ .auth-panes .auth-pane-login {
    display: block;
  }
  .filter-bar {
    grid-template-columns: 1.4fr 1fr 1fr 1fr auto;
    align-items: end;
  }
  .admin-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .desktop-nav { display: flex; }
  .bottom-nav { display: none; }
  .site-footer { padding-bottom: 28px; }
  .arena {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 20px;
    align-items: start;
    width: min(1080px, calc(100% - 56px));
    padding-top: 28px;
    padding-bottom: 48px;
  }
  .quiz-card { padding: 24px 26px 26px; }
  .quiz-answers { grid-template-columns: 1fr 1fr; }
  .answer-btn { min-height: 64px; padding: 14px 16px; }
  .quiz-side {
    display: block;
    padding: 22px 20px;
    background: #0e1016;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    height: fit-content;
  }
  .sponsor-slot-rail { display: none; }
  .admin-shell { grid-template-columns: 210px 1fr; }
  .admin-main { padding: 22px 28px; }
  .page-home .night { padding-bottom: 28px; }
}
