:root {
  --bg: #14122b;
  --bg-2: #1e1b3d;
  --card: #fbf7ee;
  --ink: #1d1a33;
  --muted: #6b6785;
  --text: #f4f1ff;
  --text-dim: #b3aed6;
  --gold: #ffc94a;
  --p1: #ff6b8b;
  --p2: #4cc9f0;
  --p3: #9be36b;
  --ok: #2bb673;
  --radius: 18px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255, 107, 139, 0.18), transparent 60%),
    radial-gradient(1000px 600px at 110% 10%, rgba(76, 201, 240, 0.16), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, select, input { font: inherit; }

[hidden] { display: none !important; }

button { cursor: pointer; }

kbd {
  font-family: inherit;
  font-size: 0.7em;
  padding: 0.1em 0.45em;
  margin-left: 0.4em;
  border-radius: 6px;
  border: 1px solid currentColor;
  opacity: 0.6;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 16px 8px;
}

.logo {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-weight: 800;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
}
.logo span { color: var(--gold); }

.brand { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rules-btn {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 0.9rem;
}
.rules-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- House rules popup ---------- */
.rules {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: none;
  border-radius: calc(var(--radius) + 6px);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.rules::backdrop { background: rgba(10, 8, 30, 0.7); }
.rules form { padding: clamp(20px, 4vw, 36px); }
.rules h2 {
  margin: 0 0 8px;
  font-family: Fraunces, Georgia, serif;
  font-weight: 800;
  font-size: 1.9rem;
}
.rules h2:focus { outline: none; }
.rules-intro { margin: 0 0 18px; color: var(--muted); line-height: 1.45; }
.rules-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rule;
  display: grid;
  gap: 14px;
}
.rules-list li {
  counter-increment: rule;
  position: relative;
  padding-left: 46px;
}
.rules-list li::before {
  content: counter(rule);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold);
  font-family: Fraunces, Georgia, serif;
  font-weight: 800;
}
.rules-list h3 { margin: 4px 0 4px; font-size: 1.05rem; }
.rules-list p { margin: 0; line-height: 1.45; }
.rules-list .rules-aside {
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f1eadb;
  font-size: 0.92rem;
  color: var(--ink);
}
.rules-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 24px;
}
.rules-check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.92rem; cursor: pointer; }
.rules-check input { accent-color: var(--ink); width: 18px; height: 18px; }
.rules-footer .primary {
  flex: 0 1 auto;
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-weight: 600;
  font-size: 1rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.filters select {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 8px 10px;
  max-width: 220px;
  text-transform: none;
  letter-spacing: 0;
}
.filters .toggle {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  cursor: pointer;
}
.filters .toggle input { accent-color: var(--gold); width: 18px; height: 18px; }

/* ---------- Layout ---------- */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 8px 16px 32px;
}

/* ---------- Scoreboard ---------- */
.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin: 16px 0 24px;
}

.vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: Fraunces, Georgia, serif;
  font-style: italic;
  font-size: 1.4rem;
  color: var(--text-dim);
}

.reset-scores {
  font-family: Inter, system-ui, sans-serif;
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 6px 12px;
}
.reset-scores:hover { color: var(--text); border-color: var(--gold); }

/* 2 players / 3 players switch */
.player-count {
  display: flex;
  font-family: Inter, system-ui, sans-serif;
  font-style: normal;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
}
.player-count button {
  background: transparent;
  color: var(--text-dim);
  border: none;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.player-count button:hover { color: var(--text); }
.player-count button[aria-pressed="true"] { background: var(--gold); color: var(--ink); }

/* With 3 players, the cards sit side by side and the controls go underneath. */
.scoreboard.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scoreboard.three .vs {
  grid-column: 1 / -1;
  order: 1;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}
.scoreboard.three .vs-word { display: none; }

/* ---------- Category checklist ---------- */
.multi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.multi-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.multi-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 170px;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
}
.multi-button[aria-expanded="true"] { border-color: var(--gold); }
.multi-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 10;
  width: min(340px, calc(100vw - 32px));
  background: var(--bg-2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px;
}
.multi-actions {
  display: flex;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.multi-actions button {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85rem;
}
.multi-actions button:hover { color: var(--text); border-color: var(--gold); }
.multi-list {
  max-height: min(360px, 60vh);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.multi-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 6px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}
.multi-list label:hover { background: rgba(255, 255, 255, 0.05); }
.multi-list input { accent-color: var(--gold); width: 16px; height: 16px; flex: none; }

.player {
  --accent: var(--p1);
  position: relative;
  background: var(--bg-2);
  border: 2px solid color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.player[data-player="1"] { --accent: var(--p2); }
.player[data-player="2"] { --accent: var(--p3); }

.player.leading { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }

.player.bump { animation: bump 0.45s ease; }
@keyframes bump {
  30% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.name {
  min-width: 0;
  width: 100%;
  max-width: 220px;
  background: transparent;
  border: none;
  border-bottom: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 6px 6px 0 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
  padding: 4px 6px;
  cursor: text;
}
.name:hover { background: rgba(255, 255, 255, 0.05); }
.name:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-bottom-style: solid;
  border-bottom-color: var(--accent);
}

.edit-name {
  flex: none;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  line-height: 1;
  padding: 6px;
  border-radius: 8px;
}
.name-status {
  margin-top: 4px;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--text-dim);
}

.edit-name:hover { color: var(--accent); background: rgba(255, 255, 255, 0.06); }

.score {
  font-family: Fraunces, Georgia, serif;
  font-weight: 800;
  font-size: clamp(3rem, 10vw, 5rem);
  line-height: 1.05;
}

.adjust { display: flex; justify-content: center; gap: 8px; }
.adjust button {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 4px 14px;
}
.adjust button:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Question card ---------- */
.card {
  background: var(--card);
  color: var(--ink);
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(20px, 4vw, 40px);
  box-shadow: var(--shadow);
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.meta-left { display: inline-flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; min-width: 0; }
.q-source { font-size: 0.7rem; opacity: 0.75; }
.q-source:empty { display: none; }
.meta-right { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tools { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tools[hidden] { display: none; }
.tool {
  background: transparent;
  border: 1.5px solid #e5dcc6;
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.tool:hover:not(:disabled) { color: var(--ink); border-color: var(--ink); }
.tool:disabled { opacity: 0.5; cursor: progress; }
.tool.danger:hover:not(:disabled) { color: #a3203f; border-color: #a3203f; }
.link-inline {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.tool.on { color: var(--ink); border-color: var(--ink); }

/* Sound panel: hear or re-record each clip of the question */
.sound-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1.5px dashed #e5dcc6;
  border-radius: 12px;
}
.sound-panel[hidden] { display: none; }
.sound-row { display: inline-flex; align-items: center; gap: 6px; }
.sound-row > span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 4.5em;
}
.sound-panel .none { font-size: 0.9rem; color: var(--muted); }

.tool-status {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.tool-status[hidden] { display: none; }
.tool-status.error { color: #a3203f; }

/* Editing a question: the form takes the card's place */
.card.editing > :not(.meta):not(.edit-form):not(.tool-status):not(.sound-panel) { display: none !important; }
.edit-form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.edit-form[hidden] { display: none; }
.edit-form label { display: flex; flex-direction: column; gap: 6px; }
.edit-form label > span {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.edit-form textarea,
.edit-form input {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 2px solid #e5dcc6;
  border-radius: 12px;
  padding: 10px 12px;
  width: 100%;
  box-sizing: border-box;
}
.edit-form textarea {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.3;
  resize: vertical;
}
.edit-form textarea:focus,
.edit-form input:focus,
.edit-form select:focus { outline: none; border-color: var(--ink); }
.edit-form select {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 2px solid #e5dcc6;
  border-radius: 12px;
  padding: 10px 12px;
}

/* + Add question */
.add-title {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.3rem;
  color: var(--ink);
}
.add-row { display: flex; flex-wrap: wrap; gap: 14px; }
.add-row .add-category { flex: 1 1 240px; }
.edit-form label.add-check { flex-direction: row; align-items: center; gap: 8px; }
.edit-form label.add-check > span {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.edit-form label.add-check input { width: auto; }
/* "Read aloud as": smaller, under the field it's for */
.edit-form label.edit-say { margin-top: -6px; }
.edit-form label.edit-say > span { font-size: 0.7rem; letter-spacing: 0.06em; }
.edit-form label.edit-say input { font-size: 0.95rem; padding: 8px 12px; border-style: dashed; }
.edit-form label.edit-say input:not(:placeholder-shown) { border-style: solid; }
.edit-note { margin: 0; font-size: 0.85rem; color: var(--muted); }
.edit-note:empty { display: none; }
.edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.edit-actions button {
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 1rem;
}
.edit-actions .primary { flex: 0 1 auto; min-width: 120px; }
.edit-actions .primary:disabled { opacity: 0.6; cursor: progress; }
.link-dark {
  background: none !important;
  padding: 0 !important;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-left: auto;
}
.link-dark:hover { color: var(--ink); }

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: #eee6d3;
}
.badge:empty { display: none; }
.badge.easy { background: #d6f5e3; color: #17734a; }
.badge.medium { background: #fff0c7; color: #8a6200; }
.badge.hard { background: #ffdbe2; color: #a3203f; }
.badge.edited { background: #e4e0f7; color: #4b3f99; cursor: help; }

/* Play-question button: small in normal mode, the centrepiece in listen mode */
.play {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  background: transparent;
  color: var(--ink);
  border: 2px solid #e5dcc6;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
}
.play:hover { border-color: var(--ink); }
.play-icon { font-size: 0.85em; }

.card.listening .play {
  align-self: center;
  flex-direction: column;
  gap: 10px;
  margin: 28px 0;
  border: none;
  padding: 0;
}
.card.listening .play-icon {
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold);
  font-size: 2.6rem;
  padding-left: 8px; /* optically centre the triangle */
  box-shadow: 0 10px 30px rgba(29, 26, 51, 0.25);
  transition: transform 0.15s;
}
.card.listening .play:hover .play-icon { transform: scale(1.05); }
.card.listening .play-label { color: var(--muted); }

.question {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.4rem, 3.4vw, 2.1rem);
  line-height: 1.25;
  margin: 20px 0;
  overflow-wrap: anywhere;
}

.choices {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.choices li {
  border: 2px solid #e5dcc6;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 500;
  transition: opacity 0.3s, border-color 0.3s, background 0.3s;
}
.choices li::before {
  content: attr(data-letter);
  font-weight: 700;
  color: var(--muted);
  margin-right: 8px;
}
.choices.revealed li { opacity: 0.35; }
.choices.revealed li.correct {
  opacity: 1;
  border-color: var(--ok);
  background: #e3f7ec;
}

/* Answer timer */
.timer {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  padding: 8px 18px;
  border-radius: 999px;
  background: #f1eadb;
  color: var(--ink);
  font-family: Fraunces, Georgia, serif;
  font-weight: 800;
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
}
.timer-icon { font-size: 0.8em; }
.timer.waiting {
  font-family: Inter, system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--muted);
}
.timer.stopped { background: transparent; border: 2px solid #e5dcc6; }
.card.listening .timer { align-self: center; }

.answer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--ink);
  color: var(--gold);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
  animation: pop 0.35s ease;
}
.answer-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
#qAnswerText {
  font-family: Fraunces, Georgia, serif;
  font-weight: 800;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  overflow-wrap: anywhere;
}
@keyframes pop {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.actions[hidden], .answer[hidden], .empty[hidden] { display: none; }

.actions button, .empty button {
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.1s, filter 0.15s;
}
.actions button:active { transform: translateY(1px); }
.actions button:hover { filter: brightness(1.05); }

.primary { background: var(--ink); color: var(--card); flex: 1; }
.ghost { background: transparent; color: var(--muted); border: 2px solid #e5dcc6 !important; }
.award { flex: 1; color: #fff; }
.award.p1 { background: var(--p1); }
.award.p2 { background: var(--p2); color: var(--ink); }
.award.p3 { background: var(--p3); color: var(--ink); }
.award .pname { font-weight: 800; }

.empty { margin: auto 0; text-align: center; }
.empty p { font-size: 1.2rem; color: var(--muted); }

/* ---------- Footer ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.footer-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.link {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link:hover:not(:disabled) { color: var(--text); }
.link:disabled { opacity: 0.4; cursor: default; }

.credit {
  margin-top: 24px;
  font-size: 0.75rem;
  color: var(--text-dim);
  opacity: 0.7;
  text-align: center;
}
.credit a { color: inherit; }

/* ---------- Online room: host side ---------- */
.presence {
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.presence.online { color: var(--ok); }

.get-ready {
  margin: auto 0;
  text-align: center;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.6rem;
  color: var(--muted);
}

.room-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f1ead8;
}
.room-invite { margin: 0; font-size: 0.9rem; color: var(--muted); overflow-wrap: anywhere; }

/* Start screen and waiting room */
.lobby { min-height: 0; max-width: 560px; width: 100%; margin: 24px auto 0; }
.lobby-step { display: flex; flex-direction: column; gap: 16px; }
.lobby h2 { margin: 0; font-family: Fraunces, Georgia, serif; font-size: clamp(1.6rem, 4vw, 2.1rem); }
.lobby .actions { margin-top: 4px; }
.lobby-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.lobby-field input, .lobby-link input {
  border: 2px solid #e5dcc6;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1.05rem;
  color: var(--ink);
  background: #fff;
  min-width: 0;
}
.lobby-field input:focus, .lobby-link input:focus { outline: none; border-color: var(--ink); }
.lobby-continue {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lobby-continue:hover { color: var(--ink); }
.lobby-note { margin: 0; padding: 10px 14px; border-radius: 12px; background: #fdecc8; color: var(--ink); font-size: 0.95rem; }
.lobby-hint { margin: 0; color: var(--muted); font-size: 0.95rem; }
.lobby-hint:empty { display: none; }
.lobby-link { display: flex; gap: 8px; }
.lobby-link input { flex: 1; font-size: 0.95rem; }
.lobby-link .ghost { border-radius: 10px; padding: 8px 16px; font-weight: 600; }
.lobby-link .ghost.copied { color: var(--ok); border-color: var(--ok) !important; }
.lobby-players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lobby-players li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f1ead8;
  font-weight: 600;
}
.lobby-players .tag { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.lobby-players .joined .tag { color: var(--ok); }
.lobby-players .waiting { background: transparent; border: 2px dashed #e5dcc6; color: var(--muted); font-weight: 500; }

/* ---------- Player page (play.html) ---------- */
.play-page main { max-width: 640px; }
.me { color: var(--text-dim); font-size: 0.9rem; display: flex; gap: 10px; align-items: baseline; }
.me b { color: var(--text); }

.join { min-height: 0; gap: 14px; margin-top: 16px; }
.join h2 { margin: 0; font-family: Fraunces, Georgia, serif; }
.no-link { margin: 0; font-size: 1.05rem; color: var(--muted); }
.join form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.join label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 200px; font-size: 0.85rem; color: var(--muted); }
.join input {
  border: 2px solid #e5dcc6;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1.05rem;
  color: var(--ink);
  background: #fff;
}
.join .primary { flex: 0 0 auto; border: none; border-radius: 12px; padding: 12px 22px; font-weight: 600; }
.form-error { margin: 0; color: #b3263f; font-weight: 600; }
.host-login { color: var(--muted); font-size: 0.9rem; }
.host-login summary { cursor: pointer; }
.host-login form { margin-top: 10px; }
.host-login .ghost { border-radius: 10px; padding: 10px 16px; font-weight: 600; }

.board { display: flex; gap: 8px; margin: 16px 0; }
.board-player {
  --accent: var(--p1);
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  padding: 10px 6px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 2px solid color-mix(in srgb, var(--accent) 50%, transparent);
}
.board-player[data-player="1"] { --accent: var(--p2); }
.board-player[data-player="2"] { --accent: var(--p3); }
.board-player.leading { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.board-player.is-me { border-color: var(--accent); }
.board-player.offline { opacity: 0.55; }
.board-name { color: var(--accent); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-score { font-family: Fraunces, Georgia, serif; font-weight: 800; font-size: 2.4rem; line-height: 1.1; }
.board-tag { font-size: 0.75rem; color: var(--text-dim); min-height: 1em; }

.sound-nudge {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
  text-align: center;
}

.play-card { min-height: 0; gap: 12px; }
.play-card .get-ready { margin: 24px 0; }
.play-card .question { margin: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  .scoreboard { gap: 8px; }
  .vs { font-size: 1rem; }
  .player { padding: 12px 8px; }
  .filters { width: 100%; }
  .filters label:not(.toggle) { flex: 1; }
  .filters select { max-width: none; width: 100%; }
  .multi { flex: 1 1 100%; }
  .multi-button { width: 100%; }
  .reset-scores { white-space: normal; padding: 6px 8px; font-size: 0.75rem; }
  .player-count button { padding: 5px 8px; }
  .scoreboard.three .player { padding: 10px 4px; }
  .scoreboard.three .name { font-size: 0.95rem; padding: 4px 2px; }
  .scoreboard.three .edit-name { display: none; }
  .scoreboard.three .adjust { gap: 4px; }
  .scoreboard.three .adjust button { padding: 4px 8px; }
  kbd { display: none; }
}
