:root {
  color-scheme: light;
  --bg: #f7f0e3;
  --paper: #fffcf5;
  --ink: #142844;
  --muted: #505b6c;
  --line: #d9cfbf;
  --blue: #284970;
  --red: #a82735;
  --red-hover: #8b1e2c;
  --pale-blue: #e8eef5;
  --pale-red: #f8e7e3;
  --gold: #e6bb73;
  --display: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
button:disabled { cursor: default; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
p, h1, h2, ol, ul, blockquote { margin: 0; }
.shell { width: min(1100px, calc(100% - 64px)); margin-inline: auto; }
.site-header { background: var(--ink); color: var(--paper); border-bottom: 4px solid var(--red); }
.site-header a:focus-visible { outline-color: var(--gold); }
.top { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--paper); font: 800 23px/1 var(--display); letter-spacing: -.03em; }
.brand span { color: var(--gold); margin-left: -9px; }
.top-tag, .eyebrow, .section-label, .micro, .pill, .chips, .footer, .players small {
  font: 750 12px/1.4 var(--mono); letter-spacing: .065em;
}
.top-tag { display: flex; gap: 8px; align-items: center; color: var(--paper); border: 1px solid #687b95; border-radius: 4px; padding: 7px 12px; }
.top-tag span { color: var(--gold); }
.waiting i { display: inline-block; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--red); }
main { flex: 1 0 auto; }
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding: 23px 0 19px; }
.eyebrow { display: inline-flex; gap: 9px; align-items: center; color: var(--red); }
.dash { width: 26px; height: 4px; border-block: 1px solid currentColor; }
h1, h2 { line-height: 1.03; letter-spacing: -.055em; font-weight: 850; }
.hero h1 { margin: 14px 0 16px; font-family: var(--display); font-size: clamp(48px, 7.1vw, 95px); line-height: .94; letter-spacing: -.07em; }
.hero em { color: var(--red); font-style: italic; white-space: nowrap; }
.hero p { max-width: 410px; color: var(--muted); font-size: 18px; }
.hero-art { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 6px 16px #14284425; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin-top: 19px; }
.chips li { padding: 5px 8px 5px 5px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; white-space: nowrap; }
.chips span { color: var(--blue); background: var(--pale-blue); padding: 0 4px; border-radius: 2px; }
.chips li:first-child span { color: var(--red); background: var(--pale-red); }
.section-label { display: flex; align-items: center; gap: 9px; color: var(--blue); margin: 0 0 12px; }
.section-label span { border-radius: 3px; background: var(--red); color: var(--paper); padding: 2px 6px; }
.section-label::after { content: ""; flex: 1; height: 4px; border-block: 1px solid var(--line); }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 22px; min-width: 0; }
.entry-grid .panel { display: grid; gap: 12px; border-top: 3px solid var(--ink); }
.entry-grid .host-panel { border-top-color: var(--red); }
.form-heading { display: flex; align-items: center; gap: 13px; }
.form-heading h2, .side-heading h2 { font-size: 25px; }
.form-heading p { margin-top: 3px; color: var(--muted); font-size: 14px; }
.form-icon { display: grid; place-items: center; flex: 0 0 41px; height: 41px; border-radius: 10px; background: var(--ink); color: white; font: 24px var(--mono); }
.host-panel .form-icon { background: var(--red); }
label { display: grid; gap: 4px; min-width: 0; font-size: 14px; font-weight: 700; }
.fields { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(105px, 1fr); gap: 10px; }
input, select { border: 1px solid #c5bdaf; border-radius: 8px; background: var(--paper); min-height: 44px; width: 100%; padding: 7px 10px; font-size: 16px; font-weight: 500; }
input::placeholder { color: var(--muted); opacity: 1; }
.code-input { font-family: var(--mono); letter-spacing: .14em; }
.btn { min-height: 46px; border-radius: 9px; border: 1px solid transparent; padding: 9px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 800; text-align: left; }
.btn span { font-size: 18px; }
.primary { background: var(--red); color: #fff; }
.primary:hover { background: var(--red-hover); }
.outline { background: var(--paper); border-color: #9da9b9; }
.outline:hover { background: var(--pale-blue); }
.dark { background: var(--ink); color: #fff; }
.dark:hover { background: var(--blue); }
.wide { width: 100%; }
.text-btn { border: 0; background: none; color: var(--blue); padding: 8px 0; min-height: 44px; font-weight: 750; }
.text-btn:hover { text-decoration: underline; }
.resume { margin: 8px 0 0; }
.footer { flex-shrink: 0; display: flex; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; margin-top: 34px; padding: 17px 0 24px; border-top: 1px solid var(--line); color: var(--muted); }
.footer b { color: var(--red); margin: 0 4px; }
.notice { position: fixed; z-index: 2; right: 16px; bottom: 14px; max-width: min(480px, calc(100% - 32px)); margin: 0; padding: 12px 18px; color: white; background: var(--ink); border-radius: 10px; box-shadow: 0 3px 12px #14284440; overflow-wrap: anywhere; }
.room-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0 12px; }
.pill { border-radius: 4px; padding: 6px 9px; color: var(--blue); background: var(--pale-blue); letter-spacing: .035em; }
.room-grid { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(230px, 1fr); align-items: start; gap: 16px; }
.room-invite, .final-panel { padding: clamp(20px, 4vw, 40px); }
.room-invite h1, .final-panel h1 { font-family: var(--display); font-size: clamp(38px, 6vw, 68px); margin: 14px 0; overflow-wrap: anywhere; }
.room-invite p, .final-panel p { color: var(--muted); }
.invite-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 17px; margin: 24px 0 16px; background: var(--pale-blue); border: 1px solid #c7d2df; border-radius: 8px; }
.micro { color: var(--blue); display: block; }
.room-code { display: block; font: 850 clamp(30px, 5vw, 43px)/1.1 var(--mono); letter-spacing: .15em; }
.lobby-settings { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.lobby-settings > span { grid-column: 1/-1; }
.waiting { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; color: var(--muted); font-weight: 650; }
.side-heading, .game-meta, .resolution-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.side-heading .pill { white-space: nowrap; }
.players { list-style: none; padding: 0; margin-top: 11px; }
.players li { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.players li:last-child { border: 0; }
.avatar { display: grid; place-items: center; min-width: 30px; height: 30px; border-radius: 6px; background: var(--pale-blue); color: var(--blue); font: 750 14px var(--mono); }
.player-name { flex: 1; overflow-wrap: anywhere; font-weight: 650; }
.players small { color: var(--muted); font-size: 10px; }
.players strong, .timer { font-variant-numeric: tabular-nums; }
.result-mark { display: grid; place-items: center; min-width: 23px; height: 23px; color: var(--red); background: var(--pale-red); border-radius: 6px; }
.result-mark.good { background: var(--pale-blue); color: var(--blue); }
.timer { min-width: 56px; text-align: center; }
.timer.urgent { background: var(--pale-red); color: var(--red); }
progress { display: block; appearance: none; width: 100%; height: 5px; border: 0; border-radius: 99px; background: var(--pale-blue); margin-top: 9px; }
progress::-webkit-progress-bar { background: var(--pale-blue); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--red); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--red); border-radius: 99px; }
.quote-card { background: var(--ink); color: var(--paper); border-top: 4px solid var(--red); border-radius: 8px; margin: 12px 0; padding: 16px clamp(14px, 3vw, 28px) 17px; }
.quote-mark { display: block; color: var(--gold); font: 800 58px/.7 var(--display); margin-top: 8px; height: 30px; }
blockquote { font: 700 clamp(24px, 3.5vw, 39px)/1.17 var(--display); letter-spacing: -.025em; overflow-wrap: anywhere; }
.translation { margin-top: 9px; color: #dce5f1; }
.translation summary:focus-visible { outline-color: var(--gold); }
.translation summary { font-size: 14px; cursor: pointer; min-height: 30px; padding: 4px 0; }
.translation p { font-size: 15px; }
.answers { display: grid; gap: 8px; }
.answer { text-align: left; display: flex; align-items: center; gap: 11px; min-height: 49px; padding: 7px 12px 7px 8px; background: var(--paper); border: 1px solid #b9c4d1; border-radius: 8px; font-weight: 750; line-height: 1.2; }
.answer:hover:not(:disabled), .answer.picked { background: var(--pale-blue); border-color: var(--blue); }
.answer:disabled:not(.picked) { color: var(--muted); }
.answer-letter { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 4px; background: var(--pale-blue); color: var(--blue); font: 750 15px var(--mono); }
.answer.picked .answer-letter { background: var(--blue); color: white; }
.answer-arrow { margin-left: auto; }
.vote-status { margin-top: 8px; color: var(--muted); font-size: 14px; }
.resolution { border: 1px solid var(--line); padding: 14px; margin-bottom: 12px; border-radius: 11px; }
.resolution-heading { flex-wrap: wrap; font-size: 14px; }
.resolution h2 { margin-top: 10px; font-size: 30px; }
.resolution p { margin: 6px 0; color: var(--muted); }
.resolution a { overflow-wrap: anywhere; font-size: 14px; }
.final-panel .wide { margin-top: 20px; }
.winner-star { background: var(--ink); color: var(--gold); width: 65px; height: 65px; display: grid; place-items: center; border-radius: 12px; font-size: 44px; margin: 16px 0; }

@media (prefers-reduced-motion: no-preference) {
  .quote-card.play-motion { animation: quote-arrives 280ms ease-out; }
  .answer-arrow.play-motion { animation: vote-stamp 250ms ease-out; }
  .resolution.play-motion { animation: reveal-answer 420ms ease-out; }
  .winner-star.play-motion { animation: winner-star 540ms ease-out; }
}

@keyframes quote-arrives {
  from { opacity: .72; transform: translateY(7px); }
}

@keyframes vote-stamp {
  0% { opacity: .6; transform: scale(.78); }
  65% { transform: scale(1.16); }
}

@keyframes reveal-answer {
  from { opacity: .8; transform: translateY(6px); box-shadow: inset 0 0 0 2px var(--gold); }
  to { opacity: 1; transform: translateY(0); box-shadow: inset 0 0 0 2px transparent; }
}

@keyframes winner-star {
  0% { transform: scale(.82) rotate(-8deg); }
  65% { transform: scale(1.08) rotate(3deg); }
}

@media (max-width: 820px) {
  .shell { width: calc(100% - 36px); }
  .hero { gap: 20px; }
  .panel { padding: 17px; }
}
@media (max-width: 630px) {
  .shell { width: calc(100% - 28px); }
  .top { min-height: 60px; gap: 8px; }
  .brand { font-size: 20px; }
  .top-tag { font-size: 10px; padding: 5px 7px; white-space: nowrap; }
  .hero { grid-template-columns: 1fr; padding: 26px 0 22px; gap: 18px; }
  .hero h1 { font-size: clamp(46px, 12vw, 78px); }
  .hero p { font-size: 16px; }
  .hero-art { max-width: 440px; justify-self: center; }
  .entry-grid, .room-grid { grid-template-columns: 1fr; gap: 11px; }
  .room-bar { margin-top: 8px; margin-bottom: 6px; }
  .footer { font-size: 10px; }
}
