/* Editorial by HTML5 UP adaptation: html5up.net | CCA 3.0. */
:root {
  color-scheme: light;
  --parchment: #f3ebdd;
  --paper: #fffcf5;
  --ink: #24211d;
  --oxblood: #792f36;
  --brass: #b58a37;
  --forest: #345c45;
  --rust: #98472f;
  --muted: #655f56;
  --rule: #cbbfa9;
  --focus: #006b75;
  --shadow: 0 0.8rem 2rem rgb(36 33 29 / 10%);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--parchment);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--parchment); }
body { margin: 0; min-height: 100vh; background: var(--parchment); color: var(--ink); font-size: 1rem; line-height: 1.65; }
body, input, button, textarea, select { font: inherit; }
h1, h2, h3, h4 { margin: 0 0 0.65em; font-family: Georgia, "Times New Roman", serif; line-height: 1.18; color: var(--ink); }
h1 { font-size: clamp(2rem, 5vw, 4rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.25rem; }
a { color: var(--oxblood); text-decoration-thickness: 0.08em; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 0.16em; }
button, input, textarea, select, summary, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

button, .button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.2rem;
  border: 2px solid var(--oxblood);
  border-radius: 0.25rem;
  background: var(--oxblood);
  color: #fff;
  font-weight: 750;
  letter-spacing: 0.025em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}
button:hover, .button:hover { background: #64252c; }
button:active, .button:active { transform: translateY(1px); }
button.secondary, .button.secondary { background: transparent; color: var(--oxblood); }
button.secondary:hover, .button.secondary:hover { background: #f0dfd7; }
input, textarea, select {
  width: 100%; min-height: 48px; padding: 0.7rem 0.8rem; border: 2px solid #746d62; border-radius: 0.2rem; background: var(--paper); color: var(--ink);
}
label { font-weight: 750; }
.stack { display: grid; gap: 0.65rem; }
.stack button { margin-top: 0.75rem; }
.eyebrow { margin-bottom: 0.55rem; color: var(--oxblood); font-size: 0.78rem; font-weight: 850; letter-spacing: 0.14em; text-transform: uppercase; }
.lede { max-width: 48rem; color: var(--muted); font-size: 1.12rem; }
.quiet { color: var(--muted); font-size: 0.9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center; }

/* Editorial's main/sidebar shell, reduced to the application's needs. */
#wrapper { display: flex; min-height: 100vh; }
#main { min-width: 0; flex: 1; order: 2; }
#main > .inner { width: min(100%, 112rem); margin: 0 auto; padding: 0 4rem 4rem; }
#header { display: flex; min-height: 5.25rem; align-items: center; gap: 1rem; border-bottom: 5px solid var(--oxblood); }
#header .logo { flex: 1; border: 0; color: var(--muted); text-decoration: none; }
#header .logo strong { color: var(--ink); }
.host-badge { padding: 0.25rem 0.6rem; border: 1px solid var(--brass); background: #f6e7bc; color: var(--ink); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.sidebar-toggle { display: none; min-height: 44px; padding: 0.4rem 0.7rem; }
#sidebar { width: 20rem; flex: 0 0 20rem; order: 1; background: #e9decb; border-right: 1px solid var(--rule); }
.sidebar-inner { position: sticky; top: 0; display: flex; min-height: 100vh; flex-direction: column; gap: 2.25rem; padding: 2.7rem 2rem; }
.wordmark { display: flex; align-items: center; gap: 0.75rem; border: 0; color: var(--ink); font-family: Georgia, serif; font-size: 1.25rem; font-weight: 700; text-decoration: none; }
.wordmark span { display: grid; width: 2.7rem; height: 2.7rem; place-items: center; border: 2px solid var(--oxblood); color: var(--oxblood); font-family: system-ui, sans-serif; font-size: 0.8rem; letter-spacing: 0.08em; transform: rotate(-3deg); }
#menu ul { margin: 0; padding: 0; list-style: none; }
#menu li { border-top: 1px solid var(--rule); }
#menu li:last-child { border-bottom: 1px solid var(--rule); }
#menu a { display: flex; min-height: 48px; align-items: center; border: 0; color: var(--ink); font-weight: 650; text-decoration: none; }
#menu a.active { color: var(--oxblood); }
.major { margin-bottom: 1.7rem; }
.major h2 { display: inline-block; margin: 0; padding-bottom: 0.45rem; border-bottom: 4px solid var(--oxblood); }
.banner { display: flex; align-items: end; justify-content: space-between; gap: 3rem; padding: 4.5rem 0 3.2rem; border-bottom: 2px solid var(--rule); }
.banner.compact h1 { max-width: 13ch; }
section { padding: 3.2rem 0 0; }
.library-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.paper-panel { padding: 1.7rem; border: 1px solid var(--rule); border-top: 5px solid var(--brass); background: var(--paper); box-shadow: var(--shadow); }
.campaign-mark { color: var(--muted); font-size: 0.82rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
.metadata { display: flex; gap: 2rem; }
.metadata div { display: grid; }
.metadata dt { color: var(--muted); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; }
.metadata dd { margin: 0; font-weight: 750; }
.status { display: inline-flex; padding: 0.1rem 0.45rem; border-radius: 999px; font-size: 0.82rem; }
.status.success { background: #dbe9df; color: #183d2a; }
.choice-preview { display: grid; gap: 0.45rem; padding: 0; list-style: none; }
.choice-preview li { display: flex; gap: 0.65rem; align-items: center; padding: 0.6rem; border: 1px solid var(--rule); }
.choice-preview li > span { display: grid; width: 2rem; height: 2rem; flex: 0 0 2rem; place-items: center; border: 2px solid var(--ink); font-weight: 850; }
.choice-preview li strong { margin-left: auto; color: var(--forest); font-size: 0.78rem; text-transform: uppercase; }
.choice-preview li.correct { border-color: var(--forest); }
details { margin-top: 1.2rem; }
summary { min-height: 48px; padding: 0.65rem 0; color: var(--oxblood); font-weight: 750; cursor: pointer; }
.private-note { padding: 0.65rem; border-left: 4px solid var(--brass); background: #f5ead1; }
.error-message { padding: 0.8rem 1rem; border: 2px solid var(--rust); background: #f7e3db; color: #6c2517; font-weight: 700; }
.danger { border-color: var(--rust); background: var(--rust); }
.review-page { width: min(100% - 2rem, 72rem); margin: 0 auto; padding-bottom: 4rem; }
.review-list { display: grid; gap: 1.2rem; }
.review-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.host-lobby { display: flex; flex-wrap: wrap; gap: 2rem; align-items: center; }
.host-lobby > div { display: grid; justify-items: start; gap: 0.8rem; }
.host-lobby .quiet { margin: 0; }
.host-lobby a { overflow-wrap: anywhere; }
.host-lobby .room-code { color: var(--ink); font-size: clamp(2rem, 7vw, 4rem); }
.qr { width: 12rem; height: 12rem; image-rendering: pixelated; border: 0.75rem solid var(--paper); }
.player-chips form { display: inline-flex; margin-left: 0.25rem; }
.player-chips button { min-height: 48px; padding: 0.35rem 0.75rem; border-width: 1px; background: #f8eee8; }
textarea { resize: vertical; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.9rem; }
.credit { margin-top: auto; color: var(--muted); font-size: 0.78rem; }

/* Public player views intentionally omit the host sidebar. */
.play-layout { display: grid; min-height: 100vh; place-items: center; padding: 1rem; background-image: linear-gradient(90deg, transparent 49.8%, rgb(121 47 54 / 5%) 50%, transparent 50.2%); }
.play-card { width: min(100%, 32rem); padding: clamp(1.4rem, 5vw, 3rem); border-top: 7px solid var(--oxblood); background: var(--paper); box-shadow: var(--shadow); }
.play-layout > .credit { position: fixed; right: 0.75rem; bottom: 0.5rem; }
.question-page { display: block; padding: 0; }
.question-card { width: min(100%, 58rem); min-height: 100vh; margin: 0 auto; padding: clamp(1.1rem, 5vw, 3rem); background: var(--paper); }
.question-card h1 { max-width: 24ch; font-size: clamp(1.75rem, 5vw, 3.25rem); }
.question-header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 4px solid var(--oxblood); }
.question-number { margin: 0; color: var(--muted); font-weight: 700; }
.timer { display: grid; min-width: 5.2rem; place-items: center; padding: 0.5rem; border: 2px solid var(--brass); background: #f6e7bc; color: var(--ink); line-height: 1; }
.timer strong { font-family: Georgia, serif; font-size: 2rem; }
.timer span { margin-top: 0.25rem; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; }
.answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; margin-top: 1.5rem; }
.answer { min-height: 84px; justify-content: flex-start; gap: 1rem; border-width: 3px; background: var(--paper); color: var(--ink); text-align: left; }
.answer:hover { background: #f4ecde; }
.answer-label { display: grid; width: 2.6rem; height: 2.6rem; flex: 0 0 2.6rem; place-items: center; border: 3px solid currentColor; font-weight: 900; }
.answer-a { border-color: var(--oxblood); }
.answer-b { border-color: #7a5a17; }
.answer-c { border-color: var(--forest); }
.answer-d { border-color: var(--rust); }
.connection-status { display: flex; gap: 0.45rem; align-items: center; margin-top: 1.5rem; color: var(--muted); font-size: 0.85rem; }
.connection-status > span { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--forest); }

/* Shared display has no host controls or capabilities in its content. */
.display-layout { min-height: 100vh; padding: clamp(1.5rem, 5vw, 5rem); background: var(--ink); color: var(--paper); }
.display-card { width: min(100%, 90rem); margin: 0 auto; }
.display-layout h1, .display-layout h2 { color: var(--paper); }
.display-layout .eyebrow { color: #e0bd72; }
.display-lede { max-width: 45ch; font-family: Georgia, serif; font-size: clamp(1.3rem, 3vw, 2.3rem); }
.room-code { display: inline-block; padding: 0.25rem 1rem; border: 4px solid #d5ad58; color: #fff7e7; font-family: Georgia, serif; font-size: clamp(3rem, 10vw, 7rem); font-weight: 700; letter-spacing: 0.12em; line-height: 1.2; }
.player-chips { display: flex; flex-wrap: wrap; gap: 0.8rem; padding: 0; list-style: none; }
.player-chips li { display: flex; min-height: 58px; align-items: center; gap: 0.5rem; padding: 0.3rem 0.4rem 0.3rem 1rem; border: 1px solid var(--rule); border-left: 4px solid var(--brass); background: var(--paper); color: var(--ink); font-size: 1.05rem; font-weight: 700; box-shadow: 0 0.3rem 0.8rem rgb(36 33 29 / 8%); }
.display-layout .player-chips li { padding: 0.55rem 1rem; border: 1px solid #8b8172; background: #302c26; color: var(--paper); box-shadow: none; font-size: 1.2rem; }
.reveal-answer { display: flex; gap: 1.5rem; align-items: center; max-width: 55rem; padding: 1.3rem; border: 3px solid #d5ad58; background: #fff7e7; color: var(--ink); }
.reveal-answer .answer-label { color: var(--forest); }
.reveal-answer div { display: grid; }
.reveal-answer small { font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.reveal-answer strong { font-family: Georgia, serif; font-size: clamp(1.15rem, 3vw, 2rem); }
.podium { display: grid; gap: 0.7rem; max-width: 50rem; padding: 0; list-style: none; }
.podium li { display: grid; grid-template-columns: 3rem 1fr auto; gap: 1rem; align-items: center; min-height: 64px; padding: 0.7rem 1.1rem; border-bottom: 1px solid #8b8172; background: #302c26; }
.podium .rank { color: #e0bd72; font-family: Georgia, serif; font-size: 1.8rem; }
.display-layout > .credit { position: fixed; right: 1rem; bottom: 0.7rem; }
.display-layout > .credit a { color: #e0bd72; }

@media (max-width: 900px) {
  #main > .inner { padding: 0 1.5rem 3rem; }
  #sidebar { position: fixed; z-index: 10; inset: 0 auto 0 0; width: min(20rem, 88vw); transform: translateX(-105%); box-shadow: var(--shadow); transition: transform 180ms ease; }
  body.sidebar-open #sidebar { transform: translateX(0); }
  .sidebar-toggle { display: inline-flex; }
  .library-grid { grid-template-columns: 1fr; }
  .banner { align-items: start; flex-direction: column; }
}

@media (max-width: 600px) {
  .play-layout { padding: 0; place-items: start center; }
  .play-card { min-height: 100vh; box-shadow: none; }
  .play-layout > .credit { position: static; padding: 1rem; background: var(--paper); }
  .question-header { align-items: center; }
  .answers { grid-template-columns: 1fr; }
  .answer { width: 100%; min-height: 64px; }
  .display-layout > .credit { position: static; margin-top: 2rem; }
}

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