:root {
  --navy: #0b1728;
  --navy-2: #11243b;
  --ink: #172b42;
  --muted: #6f8195;
  --paper: #f7f8fb;
  --white: #ffffff;
  --line: #dfe6ef;
  --gold: #f4b942;
  --gold-soft: #fff5d6;
  --green: #26a269;
  --red: #f04d4d;
  --blue: #3b82f6;
  --shadow: 0 18px 48px rgba(23, 43, 66, .12);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--paper); }
button, select { font: inherit; }
button { cursor: pointer; }

.screen-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 76px; padding: 16px clamp(18px, 3vw, 48px); background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--gold); color: var(--navy); font-weight: 900; font-size: 21px; transform: rotate(-5deg); }
.brand-title { font-weight: 800; letter-spacing: -.02em; }
.brand-subtitle { color: #afc3d9; font-size: 12px; margin-top: 2px; }
.topbar-meta { display: flex; align-items: center; gap: 10px; color: #d9e5f0; font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; background: rgba(255,255,255,.1); color: #eef6ff; font-size: 12px; font-weight: 700; }
.main { width: min(1380px, 100%); margin: 0 auto; padding: clamp(20px, 4vw, 54px); flex: 1; }
.center-card { min-height: calc(100vh - 160px); display: grid; place-items: center; }
.hero-card { width: min(940px, 100%); padding: clamp(28px, 6vw, 70px); background: var(--white); border: 1px solid var(--line); border-radius: 30px; box-shadow: var(--shadow); text-align: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .15em; color: #a17400; font-size: 12px; font-weight: 900; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(40px, 7vw, 84px); line-height: .95; letter-spacing: -.06em; margin: 18px 0; color: var(--navy); }
h2 { font-size: clamp(28px, 4vw, 48px); letter-spacing: -.045em; margin-bottom: 10px; color: var(--navy); }
h3 { font-size: 22px; margin-bottom: 9px; }
.lede { color: var(--muted); font-size: clamp(16px, 2vw, 21px); line-height: 1.55; max-width: 700px; margin: 0 auto 28px; }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 30px auto 0; max-width: 1000px; }
.category-card { text-align: left; padding: 25px; border: 2px solid var(--line); background: #fff; border-radius: 20px; transition: transform .2s, border-color .2s, box-shadow .2s; }
.category-card:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 12px 28px rgba(23,43,66,.1); }
.category-number { display: flex; justify-content: space-between; align-items: center; color: #a17400; font-weight: 900; font-size: 13px; }
.category-card h3 { color: var(--navy); font-size: 24px; margin: 20px 0 7px; }
.category-card p { color: var(--muted); margin-bottom: 18px; }
.btn { border: 0; border-radius: 13px; padding: 13px 18px; font-weight: 800; transition: transform .15s, filter .15s, background .15s; }
.btn:hover { filter: brightness(.98); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { color: var(--navy); background: var(--gold); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-quiet { background: #eef2f7; color: var(--ink); }
.btn-outline { background: #fff; color: var(--navy); border: 2px solid var(--line); }
.btn-danger { background: #ffe7e4; color: #a62929; }
.btn-large { padding: 17px 28px; font-size: 18px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.button-row.center { justify-content: center; }
.section-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(22px, 3vw, 38px); }
.rules-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 22px; align-items: start; }
.rules-list { display: grid; gap: 12px; margin: 24px 0; }
.rule-item { display: grid; grid-template-columns: 40px 1fr; gap: 13px; align-items: start; }
.rule-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: var(--gold-soft); color: #a17400; font-weight: 900; }
.rule-item strong { display: block; margin-bottom: 4px; }
.rule-item span { color: var(--muted); line-height: 1.45; }
.score-card { background: var(--navy); color: #fff; border-radius: 20px; padding: 23px; }
.score-card h3 { color: #fff; }
.score-number { font-size: 54px; line-height: 1; font-weight: 900; color: var(--gold); letter-spacing: -.06em; }
.score-card small { color: #afc3d9; display: block; margin-top: 7px; }
.progress-strip { display: flex; gap: 7px; margin-top: 24px; }
.progress-dot { height: 7px; flex: 1; border-radius: 99px; background: #e5eaf1; }
.progress-dot.done { background: var(--green); }
.progress-dot.current { background: var(--gold); }
.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 20px; align-items: start; }
.live-main { min-width: 0; }
.live-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.round-kicker { display: flex; align-items: center; gap: 10px; color: #a17400; font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.round-kicker::before { content: ""; width: 28px; height: 4px; border-radius: 9px; background: var(--gold); }
.live-header h2 { margin: 8px 0 0; }
.question-card { padding: clamp(24px, 4vw, 48px); min-height: 450px; display: flex; flex-direction: column; justify-content: space-between; }
.question-top { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; }
.question-number { color: var(--navy); font-weight: 900; }
.house-ribbon { display: inline-flex; align-items: center; gap: 9px; padding: 9px 13px; border-radius: 999px; font-weight: 900; background: var(--house-soft, #f1f4f8); color: var(--house-color, var(--navy)); }
.house-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.prompt-area { display: grid; place-items: center; text-align: center; flex: 1; padding: 25px 0; }
.prompt-label { color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .14em; font-weight: 900; }
.prompt-word { font-size: clamp(42px, 8vw, 90px); line-height: .94; font-weight: 900; letter-spacing: -.065em; color: var(--navy); margin: 15px 0 10px; }
.prompt-definition { max-width: 700px; color: var(--muted); font-size: clamp(16px, 2vw, 21px); line-height: 1.45; }
.prompt-definition.hidden-answer { filter: blur(6px); user-select: none; }
.pronunciation { color: #a17400; font-weight: 800; font-size: 14px; }
.visual-stage { width: min(680px, 100%); margin: 0 auto 10px; position: relative; }
.visual-stage img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 20px; border: 1px solid var(--line); box-shadow: 0 12px 26px rgba(23,43,66,.11); }
.visual-hidden { filter: none; }
.visual-answer { margin: 10px 0 4px; }
.timer-area { margin-top: 22px; }
.timer-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 9px; }
.timer-big { font-size: clamp(34px, 5vw, 58px); font-weight: 900; letter-spacing: -.06em; color: var(--navy); }
.timer-big.warn { color: #c47a00; }
.timer-big.danger { color: var(--red); }
.timer-track { height: 12px; background: #e9eef3; border-radius: 99px; overflow: hidden; }
.timer-fill { height: 100%; width: 100%; border-radius: inherit; background: var(--green); transition: width .2s linear, background .2s; }
.timer-fill.warn { background: var(--gold); }
.timer-fill.danger { background: var(--red); }
.control-panel { display: grid; gap: 14px; }
.control-group { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.control-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .11em; color: var(--muted); margin-bottom: 13px; }
.control-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.control-buttons .btn { min-height: 48px; }
.btn-play { background: var(--navy); color: #fff; grid-column: 1 / -1; }
.btn-correct { background: #dff7e9; color: #147544; }
.btn-incorrect { background: #ffe4e1; color: #ae2d2d; }
.btn-reveal { background: var(--gold-soft); color: #986d00; }
.status-line { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 12px 0 0; }
.keyboard-hint { border-top: 1px solid var(--line); padding-top: 13px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.standings-table { width: 100%; border-collapse: collapse; margin: 20px 0 28px; }
.standings-table th, .standings-table td { text-align: left; padding: 16px 12px; border-bottom: 1px solid var(--line); }
.standings-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.standings-table td:last-child, .standings-table th:last-child { text-align: right; }
.house-cell { display: flex; align-items: center; gap: 10px; font-weight: 850; }
.house-cell .house-dot { background: var(--house-color); }
.standings-score { font-weight: 900; font-size: 25px; color: var(--navy); }
.result-hero { text-align: center; padding: 38px 18px 24px; }
.winner-crown { font-size: 54px; }
.result-hero h2 { margin-top: 12px; }
.result-note { color: var(--muted); max-width: 600px; margin: 0 auto 24px; line-height: 1.5; }
.score-cards { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.mini-score { border: 1px solid var(--line); border-top: 6px solid var(--house-color); border-radius: 16px; padding: 16px; background: #fff; }
.mini-score strong { display: block; }
.mini-score span { display: block; font-size: 32px; font-weight: 900; margin-top: 10px; color: var(--navy); }
.intro-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; align-items: stretch; }
.round-card { display: flex; flex-direction: column; justify-content: space-between; min-height: 430px; }
.round-big { font-size: clamp(52px, 10vw, 120px); line-height: .86; letter-spacing: -.08em; color: var(--navy); font-weight: 950; margin: 28px 0 18px; }
.round-copy { color: var(--muted); font-size: 18px; line-height: 1.5; max-width: 680px; }
.round-facts { display: grid; gap: 12px; }
.fact { padding: 18px; border-radius: 16px; background: #f3f6fa; }
.fact strong { display: block; font-size: 25px; color: var(--navy); }
.fact span { color: var(--muted); font-size: 13px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(11,23,40,.72); }
.modal { width: min(560px, 100%); border-radius: 24px; padding: 28px; background: #fff; box-shadow: 0 28px 80px rgba(0,0,0,.25); }
.modal h2 { font-size: 32px; }
.modal p { color: var(--muted); line-height: 1.5; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 30; transform: translateX(-50%); padding: 12px 17px; border-radius: 999px; background: var(--navy); color: #fff; box-shadow: var(--shadow); font-weight: 700; font-size: 13px; }
.empty-state { padding: 20px 0; color: var(--muted); }
@media (max-height: 800px) and (min-width: 981px) {
  .topbar { min-height: 60px; padding: 9px 32px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 18px; }
  .main { padding: 18px 34px; }
  .live-header { margin-bottom: 10px; }
  .live-header h2 { margin-top: 4px; font-size: 36px; }
  .question-card { min-height: 0; padding: 18px 28px; }
  .prompt-area { padding: 10px 0; }
  .visual-stage { width: min(520px, 100%); margin-bottom: 6px; }
  .timer-area { margin-top: 10px; }
  .timer-big { font-size: 36px; }
  .timer-track { height: 8px; }
  .control-group { padding: 14px; }
  .control-group h3 { margin-bottom: 10px; }
  .control-buttons .btn { min-height: 42px; padding: 10px 14px; }
  .status-line { margin-top: 9px; }
}
@media (max-width: 980px) {
  .live-grid, .rules-grid, .intro-layout { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr; }
  .control-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .keyboard-hint { grid-column: 1 / -1; }
}
@media (max-width: 650px) {
  .topbar { align-items: flex-start; }
  .topbar-meta { display: none; }
  .main { padding: 18px; }
  .category-grid, .score-cards { grid-template-columns: 1fr; }
  .control-panel { grid-template-columns: 1fr; }
  .question-card { min-height: 540px; }
  .live-header { flex-direction: column; }
  .round-big { font-size: 72px; }
}
@media (max-height: 600px) and (min-width: 760px) {
  .topbar { min-height: 48px; padding: 6px 18px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; font-size: 16px; }
  .brand-subtitle { display: none; }
  .main { padding: 8px 18px; }
  .live-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; }
  .live-header { margin-bottom: 5px; align-items: center; }
  .live-header h2 { margin-top: 1px; font-size: 26px; }
  .question-card { min-height: 0; padding: 9px 16px; }
  .question-top { font-size: 11px; }
  .prompt-area { padding: 3px 0; }
  .prompt-label, .pronunciation { font-size: 11px; }
  .prompt-word { font-size: 38px; margin: 5px 0 3px; }
  .prompt-definition { font-size: 13px; }
  .visual-stage { width: min(330px, 100%); margin-bottom: 2px; }
  .visual-stage img { border-radius: 11px; }
  .timer-area { margin-top: 3px; }
  .timer-line { margin-bottom: 3px; }
  .timer-big { font-size: 28px; }
  .timer-track { height: 6px; }
  .control-panel { grid-template-columns: 1fr; gap: 6px; }
  .control-group { padding: 8px; border-radius: 12px; }
  .control-group h3 { margin-bottom: 5px; }
  .control-buttons { gap: 5px; }
  .control-buttons .btn { min-height: 34px; padding: 6px 8px; font-size: 12px; }
  .status-line { margin-top: 5px; font-size: 10px; }
  .control-group:nth-child(2) { padding: 6px 8px; }
  .control-group:nth-child(2) h3, .control-group:nth-child(2) .progress-strip, .keyboard-hint { display: none; }
  .control-group:nth-child(2) .status-line { margin: 0; }
}
@media print { .topbar, .control-panel, .button-row { display: none !important; } .main { padding: 0; } .section-card, .hero-card { box-shadow: none; } }
