/* Quiz Challenge — shared Games palette */
:root {
  --bg: #f6f0e8;
  --ink: #1b1530;
  --muted: #655d73;
  --violet: #1b1530;
  --violet-dark: #120e22;
  --gold: #f27b62;
  --coral: #f27b62;
  --rose: #f8cfc6;
  --surface: #fffdf9;
  --peach: #fde4d4;
  --lilac: #e7e0f8;
  --butter: #fff3c4;
  --mint: #dcf3df;
  --sky: #d7eefc;
  --line: 2.5px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--coral);
  --radius: 18px;
  --font: Outfit, "Segoe UI", sans-serif;
  --display: Fraunces, Georgia, serif;
  --mono: "Space Mono", ui-monospace, monospace;
  --correct-color: #1e7a46;
  --incorrect-color: #c4372a;
  --timeout-color: #8a5a00;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; color-scheme: light; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(27, 21, 48, 0.16) 1.1px, transparent 1.2px),
    linear-gradient(115deg, rgba(246, 240, 232, 0.2), rgba(214, 228, 244, 0.85));
  background-size: 22px 22px, 100% 100%;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(rgba(44, 36, 22, 0.13) 1.2px, transparent 1.2px);
  background-size: 18px 18px;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
}

h1 { font-size: 1.2rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; }

p { margin-bottom: 0.85rem; }
a { color: inherit; text-decoration: none; }

header, main, footer { position: relative; z-index: 1; }

header { padding: 1rem 0 0.4rem; }

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 { margin: 0; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--violet);
  color: #fff;
  border: var(--line);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 1.05rem;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 800; font-size: 1.2rem; }
.brand-sub { margin-top: 0.12rem; font-size: 0.78rem; font-weight: 700; color: var(--muted); }

header nav ul { list-style: none; }

header nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  line-height: 1;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--gold);
}

header nav a .arrow {
  display: block;
  width: 1em;
  line-height: 1;
  text-align: center;
}

header nav a:hover { color: #fff; }

.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.3rem 1.25rem 1.4rem;
  background: var(--surface);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.legal-page h2 {
  margin-bottom: 0.45rem;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.legal-lead {
  margin-bottom: 1.2rem;
  color: var(--muted);
  font-weight: 700;
}

.legal-page section { margin-top: 1.15rem; }

.legal-page h3 { margin-bottom: 0.35rem; font-size: 1.2rem; }

.legal-page p { font-weight: 700; }

.legal-page ul {
  margin: 0.35rem 0 0.2rem 1.15rem;
  font-weight: 700;
}

.legal-page li { margin-bottom: 0.3rem; }

main { flex: 1; padding: 1.3rem 0 2.6rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.72rem 1.1rem;
  border: var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  color: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.7; cursor: default; transform: none; }

.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { color: #fff; }
.btn-success { background: var(--ink); color: #fff; }
.btn-success:hover { color: #fff; }
.btn-danger { background: #fff; color: var(--incorrect-color); }
.btn-danger:hover { color: var(--incorrect-color); }
.btn-secondary { background: var(--butter); }
.btn-lg { padding: 0.85rem 1.15rem; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.85rem; }

.form-group { margin-bottom: 0.85rem; }

.form-group label {
  display: block;
  margin-bottom: 0.32rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
}

.form-group input,
.form-select {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 3px 3px 0 rgba(27, 21, 48, 0.12);
}

.form-group input:focus,
.form-select:focus {
  outline: none;
  box-shadow: 3px 3px 0 var(--coral);
}

.card,
.players-section,
.game-area,
.game-header,
.leaderboard-content,
.how-to-play {
  background: var(--surface);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.text-center { text-align: center; }
.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }

.home-container { max-width: 1000px; margin: 0 auto; }

.welcome-section {
  margin-bottom: 1.25rem;
  padding: 0.2rem 0 0;
  background: none;
  border: 0;
  box-shadow: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: #fff;
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.live-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #22c55e;
}

.welcome-section h2 {
  max-width: 12ch;
  margin-bottom: 0.45rem;
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.welcome-section .hero-copy > p {
  max-width: 36rem;
  margin: 0 0 1rem;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--muted);
}

.rules {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.rules li {
  display: block;
  padding: 0.9rem 0.95rem 0.85rem;
  border: var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.rules li:nth-child(1) { background: var(--peach); }
.rules li:nth-child(2) { background: var(--lilac); }
.rules li:nth-child(3) { background: var(--butter); }

.rules strong { display: block; font-size: 1.15rem; margin-top: 0.15rem; }
.rules p { margin: 0.2rem 0 0; font-size: 0.9rem; font-weight: 700; color: var(--muted); }

.rule-index {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--violet);
}

.join-create-section {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 0.9rem;
  margin: 1rem 0;
  align-items: start;
}

.join-create-section .card { padding: 1.2rem 1.15rem 1.1rem; }
.join-create-section .card:last-child { background: var(--sky); }

.join-create-section h3 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.join-create-section .btn { width: 100%; margin-top: 0.15rem; }

.how-to-play { padding: 1.1rem 1.1rem 1rem; }

.section-head { margin-bottom: 0.8rem; }
.section-head h3 { margin-bottom: 0.15rem; }
.section-head p { margin: 0; color: var(--muted); font-weight: 700; }

.how-to-play ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.55rem;
  counter-reset: play;
}

.how-to-play li {
  margin: 0;
  padding: 0.75rem 0.7rem;
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.how-to-play li::before {
  counter-increment: play;
  content: counter(play, decimal-leading-zero);
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink);
}

.how-to-play li:nth-child(1) { background: var(--peach); }
.how-to-play li:nth-child(2) { background: var(--sky); }
.how-to-play li:nth-child(3) { background: var(--butter); }
.how-to-play li:nth-child(4) { background: var(--mint); }
.how-to-play li:nth-child(5) { background: var(--lilac); }

.game-container { max-width: 1080px; margin: 0 auto; }

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding: 0.95rem 1.05rem;
}

.room-info h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.1rem;
  font-size: 1.35rem;
}

.room-info p { margin: 0 0 0.4rem; color: var(--muted); font-weight: 700; }

.room-code {
  display: inline-flex;
  padding: 0.05rem 0.4rem;
  border-radius: 8px;
  border: 2px solid var(--ink);
  background: var(--gold);
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}

.game-controls { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.game-settings { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.setting-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--lilac);
  font-size: 0.78rem;
  font-weight: 800;
}

.game-content {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 0.85rem;
  align-items: start;
}

.players-section {
  position: sticky;
  top: 1rem;
  padding: 0.9rem 0.8rem 0.6rem;
}

.players-section h3 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--ink);
  font-size: 1.05rem;
}

.players-list { list-style: none; }

.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.2rem;
  border-bottom: 1.5px dashed rgba(44, 36, 22, 0.25);
}

.player-item:last-child { border-bottom: 0; }
.player-item.current-player { background: var(--butter); border-radius: 10px; padding-inline: 0.4rem; }
.player-name { display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem; font-weight: 800; }

.host-badge {
  background: var(--ink);
  color: var(--gold);
  font-size: 0.62rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.player-score {
  min-width: 2rem;
  text-align: center;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--mint);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.game-area {
  min-height: 480px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
}

.game-screen { flex: 1; display: flex; flex-direction: column; }

.game-screen:not(.hidden) {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.waiting-screen-content,
.loading-screen-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.3rem 0.4rem;
}

.waiting-animation, .loading-animation { margin-bottom: 0.85rem; }

.pulse, .spinner {
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  border: var(--line);
  background: var(--gold);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 1.5rem;
}

.pulse { animation: bob 1.6s ease-in-out infinite; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.waiting-screen-content h3,
.loading-screen-content h3 { margin-bottom: 0.25rem; font-size: 1.8rem; }

.waiting-screen-content p,
.loading-screen-content p { color: var(--muted); font-weight: 700; max-width: 26rem; margin: 0 auto 0.9rem; }

.share-code {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.7rem 1.1rem;
  border-radius: 14px;
  border: 2px dashed var(--ink);
  background: var(--butter);
}

.share-code p {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.share-code .room-code {
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  background: transparent;
  border: 0;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.question-info { display: flex; flex-direction: column; gap: 0.1rem; }

.question-number {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--violet);
}

.question-category { color: var(--muted); font-size: 0.88rem; font-weight: 700; }

.timer-container {
  width: 132px;
  height: 34px;
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: #fff;
  flex-shrink: 0;
}

.timer-bar {
  height: 100%;
  width: 100%;
  background: var(--gold);
  transition: width 0.5s linear;
}

.timer-bar.critical { background: var(--rose); }

#timer-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink);
}

.question-text {
  margin-bottom: 0.85rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 2px solid var(--ink);
  background: var(--peach);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.options-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.8rem 0.85rem;
  text-align: left;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.option-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
  background: var(--sky);
}

.option-btn.selected { background: var(--lilac); }
.option-btn.correct,
.option-btn.correct-answer { background: var(--mint); }
.option-btn.incorrect { background: #ffd6dc; }
.option-btn:disabled { cursor: default; transform: none; }

.option-letter {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 2px solid var(--ink);
  background: var(--butter);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.option-btn.correct .option-letter,
.option-btn.correct-answer .option-letter { background: #7dcea0; }
.option-btn.incorrect .option-letter { background: var(--rose); }

.option-btn.correct-answer::after {
  content: "Correct";
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
}

.answer-feedback {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.8rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 2px solid var(--ink);
  font-weight: 800;
}

.answer-feedback.correct { background: var(--mint); color: var(--correct-color); }
.answer-feedback.incorrect { background: #ffd6dc; color: var(--incorrect-color); }
.answer-feedback.timeout { background: var(--butter); color: var(--timeout-color); }

.feedback-icon { font-size: 1.2rem; }
.feedback-content { flex: 1; }
.correct-answer-text { margin-top: 0.15rem; font-weight: 700; }

.results-screen { text-align: center; }
.results-screen h3 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
  font-size: 2rem;
}
.final-results { margin: 0.85rem 0; }
.final-results h4 { margin-bottom: 0.6rem; color: var(--muted); }

.scores-list { list-style: none; max-width: 620px; margin: 0 auto; }

.score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
}

.score-item:nth-child(1) { background: var(--gold); }
.score-item:nth-child(2) { background: var(--sky); }
.score-item:nth-child(3) { background: var(--peach); }
.score-item.current-player { outline: 3px solid var(--violet); }

.player-rank { font-family: var(--mono); font-size: 0.8rem; min-width: 2.6rem; }
.player-correct { color: var(--muted); font-size: 0.86rem; font-weight: 700; }

.game-actions,
.error-actions,
.leaderboard-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.error-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.3rem 0.4rem;
}

.error-icon {
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  margin-bottom: 0.6rem;
  border-radius: 14px;
  border: var(--line);
  background: #ffd6dc;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 1.2rem;
}

#error-message {
  margin-bottom: 0.3rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: #fff0f3;
}

.leaderboard-container { max-width: 800px; margin: 0 auto; }

.leaderboard-container h2 {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
}

.leaderboard-content { padding: 1rem; }
.leaderboard-table { width: 100%; border-collapse: collapse; }

.leaderboard-table th,
.leaderboard-table td {
  padding: 0.7rem 0.5rem;
  text-align: left;
  border-bottom: 2px solid rgba(44, 36, 22, 0.12);
}

.leaderboard-table th {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.leaderboard-table tr:last-child td { border-bottom: 0; }

.leave-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(44, 36, 22, 0.45);
}

.leave-modal-card {
  width: min(400px, 100%);
  padding: 1.25rem 1.15rem 1.1rem;
  text-align: center;
  background: #fff;
  border: var(--line);
  border-radius: 18px;
  box-shadow: 7px 7px 0 var(--ink);
}

.leave-modal-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.65rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: var(--line);
  background: #ffd6dc;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 1.1rem;
}

.leave-modal-card h3 { margin-bottom: 0.25rem; font-size: 1.6rem; }
.leave-modal-card p { margin: 0 0 0.95rem; color: var(--muted); font-weight: 700; }

.leave-modal-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(44, 36, 22, 0.15);
  border-top-color: var(--violet);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.25s ease-out both; }
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }

@media (max-width: 900px) {
  .rules,
  .how-to-play ol,
  .join-create-section,
  .game-content,
  .options-container { grid-template-columns: 1fr; }

  .welcome-section h2 { max-width: none; }
  .players-section { position: static; }
  .game-header { flex-direction: column; align-items: flex-start; }
  .game-controls { width: 100%; }
  .score-item { flex-wrap: wrap; }
  .player-correct { width: 100%; }
}

@media (max-width: 560px) {
  .brand-sub { display: none; }
  .game-area { padding: 0.85rem; min-height: 400px; }
}

.game-controls { flex-wrap: wrap; }

.home-notice {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  border: var(--line);
  border-radius: 14px;
  background: var(--butter);
  box-shadow: var(--shadow-sm);
  font-weight: 800;
}

.share-code .btn { margin-top: 0.45rem; }

#ready-btn { margin-top: 0.9rem; }
#ready-btn.is-ready { background: var(--mint); }

.ready-badge,
.away-badge {
  font-size: 0.62rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ready-badge { background: var(--mint); }
.away-badge { background: #fff; color: var(--muted); }
.player-away { opacity: 0.65; }

.kick-btn {
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  box-shadow: 2px 2px 0 var(--ink);
}

.reveal-results {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  text-align: left;
}

.reveal-results li {
  margin: 0.15rem 0;
  font-weight: 800;
}

.reveal-results .got-it { color: var(--correct-color, #1f7a4d); }
.reveal-results .missed-it { color: var(--muted); }

.rejoin-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.rejoin-form label { font-weight: 800; }
.rejoin-form input {
  padding: 0.45rem 0.6rem;
  border: var(--line);
  border-radius: 10px;
  font: inherit;
}
