@font-face {
  font-family: "Yeseva One";
  src: url("/fonts/YesevaOne-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: Outfit;
  src: url("/fonts/Outfit.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --floor: #1a1016;
  --paper: #f4e7d2;
  --ink: #1c1214;
  --ink-soft: #6a5146;
  --wax: #9e342c;
  --wax-deep: #6e1e1a;
  --candle: #e4b15c;
  --moss: #2f6a45;
  --line: rgba(28, 18, 20, 0.14);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background:
    radial-gradient(1000px 480px at 50% -10%, #3a222a, transparent 62%),
    var(--floor);
  color: var(--paper);
  font-family: Outfit, sans-serif;
  font-size: 18px;
  line-height: 1.4;
}

button, input, textarea, select { font: inherit; }

button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--candle);
  outline-offset: 3px;
}

.display, .question, .brand {
  font-family: "Yeseva One", serif;
  font-weight: 400;
  line-height: 1.12;
  margin: 0;
}

.display { font-size: clamp(3.4rem, 9vw, 7rem); }

.question { font-size: clamp(1.7rem, 4vw, 3.2rem); }

.screen .question { font-size: clamp(2.1rem, 4.6vw, 4.2rem); }

.brand { font-size: 2.1rem; }

.eyebrow {
  margin: 0 0 0.35rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--candle);
}

.home, .gate, .host-page, .screen, .play {
  min-height: 100dvh;
  padding: clamp(1rem, 3vw, 2rem);
}

.home {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 0.8rem;
  max-width: 760px;
}

.gate {
  display: grid;
  place-items: center;
}

.lead { max-width: 36rem; margin: 0; }

.home-actions, .bar-actions, .q-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  font-weight: 600;
}

.btn-wax { background: var(--wax); color: var(--paper); }

.btn-quiet {
  background: transparent;
  color: var(--paper);
  border: 1px solid rgba(244, 231, 210, 0.35);
}

.login, .join {
  width: min(420px, 100%);
  display: grid;
  gap: 0.85rem;
}

.login > *, .join > * { min-width: 0; }

.login .display, .join .question {
  font-size: clamp(2.4rem, 7vw, 3.4rem);
}

.login .btn, .join .btn { width: 100%; }

.card {
  background: var(--paper);
  color: var(--ink);
  border-radius: 18px;
  padding: clamp(1.1rem, 3vw, 2.2rem);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
}

.prompter {
  margin: 0.75rem 0 1rem;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  color: var(--candle);
}

.notice { min-height: 1.3em; margin: 0.35rem 0; color: var(--candle); }

.host {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.editor {
  background: var(--paper);
  color: var(--ink);
  border-radius: 18px;
  padding: 1rem;
  max-height: calc(100dvh - 7rem);
  overflow: auto;
}

.editor-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.editor h2 {
  font-family: "Yeseva One", serif;
  font-size: 1.8rem;
  margin: 0;
}

.timer-label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.qr {
  width: min(280px, 68vw);
  height: auto;
  background: var(--paper);
  border-radius: 12px;
}

.qr-small { width: 128px; }

.lobby { text-align: center; }

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

.screen-top, .play-top, .bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.screen #stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen #stage > * { width: min(1100px, 100%); }

.join-url {
  margin: 0;
  opacity: 0.72;
  letter-spacing: 0.03em;
}

.count, .meta { margin: 0.35rem 0; color: var(--ink-soft); }

.quiet { color: var(--paper); opacity: 0.75; }

.card .quiet { color: var(--ink-soft); opacity: 1; }

.picks { color: var(--paper); }

.burn-track {
  height: 8px;
  margin: 1rem 0;
  background: rgba(28, 18, 20, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.burn {
  width: 100%;
  height: 100%;
  background: var(--candle);
  transform-origin: left center;
}

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.play .options { grid-template-columns: 1fr; }

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  background: #fffaf2;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  min-height: 4.6rem;
}

.option.right {
  border-color: var(--moss);
  padding-right: 4.4rem;
}

.option.dim { opacity: 0.42; }

.option.mine { box-shadow: inset 0 0 0 2px var(--wax); }

.option:disabled { cursor: default; }

.option-text { font-size: clamp(1.05rem, 2vw, 1.45rem); }

.letter {
  width: 1.9rem;
  height: 1.9rem;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--floor);
  color: var(--paper);
  font-size: 0.85rem;
}

.seal {
  position: absolute;
  top: -0.7rem;
  right: -0.2rem;
  width: 4.1rem;
  height: 4.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c4554c, var(--wax-deep) 70%);
  color: var(--paper);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(-8deg);
  box-shadow: 0 8px 16px rgba(80, 16, 16, 0.28);
}

.seal.stamp { animation: stamp 280ms ease-out; }

@keyframes stamp {
  from { transform: rotate(-16deg) scale(1.35); opacity: 0; }
  to { transform: rotate(-8deg) scale(1); opacity: 1; }
}

.names, .picks, .scores { list-style: none; padding: 0; margin: 0.8rem 0 0; }

.names {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.names li {
  background: rgba(244, 231, 210, 0.1);
  color: var(--paper);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
}

.card .names li {
  background: rgba(28, 18, 20, 0.06);
  color: var(--ink);
}

.picks li { padding: 0.2rem 0; }

.picks .hit { color: #d7e7c8; }

.scores li {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--line);
  font-size: clamp(1.2rem, 2vw, 1.7rem);
}

.scores .rank { color: var(--wax); }

.play { display: block; }

.play .card, .play .join { width: min(640px, 100%); margin: 0 auto; }

.q-edit { padding: 0.85rem 0; border-top: 1px solid var(--line); }

.q-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }

.choices { display: grid; gap: 0.45rem; margin-top: 0.55rem; }

.choice {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
}

textarea, select, .choice input[type="text"], .name, .login input, .theme-title, .answer {
  width: 100%;
  background: #fffaf2;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

input[type="radio"] { accent-color: var(--wax); width: auto; }

.text-btn {
  background: none;
  border: 0;
  color: var(--ink-soft);
  padding: 0.2rem 0.35rem;
}

.text-btn.danger { color: var(--wax); }

.hint { color: var(--ink-soft); font-size: 0.9rem; }

.media-row { display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; align-items: center; }

.file-btn { cursor: pointer; }

.file-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.thumb { display: block; max-width: 160px; max-height: 100px; object-fit: contain; border-radius: 8px; }

.thumb-video { display: block; width: min(280px, 100%); max-height: 160px; border-radius: 8px; }

.q-edit audio { width: min(320px, 100%); margin-top: 0.35rem; }

.clue-image {
  display: block;
  max-width: min(920px, 100%);
  max-height: 52vh;
  margin: 0.8rem auto;
  object-fit: contain;
  border-radius: 12px;
}

.clue-clip { display: block; width: min(920px, 100%); max-height: 52vh; margin: 0.8rem auto; }

.board-wrap { width: min(1100px, 100%); }

.turn {
  margin: 0 0 0.8rem;
  text-align: center;
  color: var(--candle);
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
}

.board {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
}

.theme-col {
  flex: 1 0 6.5rem;
  min-width: 6.5rem;
  display: grid;
  gap: 0.4rem;
  align-content: start;
}

.theme-name {
  min-height: 3.4rem;
  margin: 0;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: "Yeseva One", serif;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.15;
}

.screen .theme-name { font-size: clamp(1.15rem, 2vw, 1.7rem); }

.cell {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 3.1rem;
  border: 0;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  font-size: 1.15rem;
}

.screen .cell { min-height: 4.4rem; font-size: 1.55rem; }

.cell.played { visibility: hidden; }

.cell.openable { cursor: pointer; }

.tables {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  list-style: none;
  padding: 0.9rem 0 0;
  margin: 0;
}

.tables li {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(244, 231, 210, 0.1);
}

.tables .picker { outline: 2px solid var(--candle); }

.clue .key {
  position: relative;
  margin: 1.2rem 0 0;
  padding-right: 5rem;
  font-family: "Yeseva One", serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.15;
}

.spoken { font-size: 1.35rem; }

.buzz-wrap {
  min-height: 70dvh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1rem;
}

.buzz {
  width: min(280px, 72vw);
  height: min(280px, 72vw);
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c4554c, var(--wax-deep) 70%);
  color: var(--paper);
  font-size: 1.7rem;
  font-weight: 600;
  box-shadow: 0 16px 30px rgba(80, 16, 16, 0.35);
}

.theme-title { font-family: "Yeseva One", serif; font-size: 1.35rem; }

.price { width: 5.5rem; }

.theme-edit { padding: 0.4rem 0 0.8rem; }

.card .tables li { background: rgba(28, 18, 20, 0.06); color: var(--ink); }

@media (max-width: 960px) {
  .host, .options, .screen .options { grid-template-columns: 1fr; }
  .editor { max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
  .seal.stamp { animation: none; }
}
