/* Imposter — card table design (see DESIGN.md) */

:root {
  --felt: #173B2E;
  --felt-deep: #0E2A21;
  --card: #F6F0E1;
  --ink: #22201C;
  --red: #C1362B;
  --red-deep: #9E2A21;
  --gold: #E0A96D;
  --radius: 14px;
  --shadow-card: 0 14px 30px rgba(4, 16, 11, .45), 0 2px 6px rgba(4, 16, 11, .35);
  --display: "Alfa Slab One", Rockwell, Georgia, serif;
  --text: "Schibsted Grotesk", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--card);
  background-color: var(--felt);
  background-image: radial-gradient(130% 95% at 50% 8%, #1E4C3B 0%, var(--felt) 46%, var(--felt-deep) 100%);
  background-attachment: fixed;
}

/* felt grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

main#app {
  position: relative;
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

h1, h2, h3 { margin: 0; font-weight: 400; }

.title {
  font-family: var(--display);
  font-size: clamp(2rem, 9vw, 3rem);
  line-height: 1.05;
  text-align: center;
  color: var(--card);
}

.subtitle {
  text-align: center;
  color: rgba(246, 240, 225, .82);
  margin: .5rem 0 0;
  font-size: 1rem;
}

.stack { display: grid; gap: 1rem; margin-top: 1.4rem; }
.stack.tight { gap: .6rem; }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
}

.card h2 {
  font-family: var(--text);
  font-weight: 700;
  font-size: 1.0625rem;
  margin-bottom: .75rem;
}

.eyebrow-note {
  margin: 0 0 .5rem;
  font-size: .9375rem;
  color: #6B6558;
}

/* ---------- buttons & inputs ---------- */
.btn {
  font-family: var(--text);
  font-size: 1.0625rem;
  font-weight: 700;
  min-height: 48px;
  padding: .6rem 1.2rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary { background: var(--red); color: var(--card); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn-primary:disabled { background: #8C5750; opacity: 1; }

.btn-ghost {
  background: transparent;
  color: var(--card);
  border: 2px solid rgba(246, 240, 225, .55);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--card); }

.btn-quiet {
  background: #E7DFCC;
  color: var(--ink);
  font-weight: 500;
  min-height: 44px;
}
.btn-quiet:hover:not(:disabled) { filter: brightness(.96); }
.btn-small { width: auto; min-height: 38px; margin-top: .6rem; font-size: .875rem; padding: .35rem .9rem; }

/* admin pool spoilers: each pair hidden until its own Show button */
.what { transition: filter .18s ease; }
.what.blurred { filter: blur(8px); user-select: none; }
.spoiler-actions { display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }
.spoiler-actions .btn-small { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .what { transition: none; } }

.btn-row { display: grid; gap: .7rem; }

input[type="text"], input[type="password"], textarea {
  font-family: var(--text);
  font-size: 1.0625rem;
  width: 100%;
  color: var(--ink);
  background: #FFFDF6;
  border: 2px solid #D8D0BC;
  border-radius: 10px;
  padding: .65rem .8rem;
}
textarea { resize: vertical; min-height: 5.5rem; line-height: 1.45; }
input:focus-visible, textarea:focus-visible, button:focus-visible, [role="button"]:focus-visible, a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
label { display: block; font-weight: 500; font-size: .9375rem; margin-bottom: .35rem; color: #4A463D; }
.field + .field { margin-top: .9rem; }

.code-input { letter-spacing: .35em; text-transform: uppercase; font-family: var(--display); font-size: 1.5rem; text-align: center; }

/* ---------- room code ticket ---------- */
.ticket {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1rem 1.15rem;
  transform: rotate(-1.2deg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.ticket-label { font-size: .875rem; color: #6B6558; margin: 0; }
.ticket-code {
  font-family: var(--display);
  font-size: clamp(1.9rem, 9vw, 2.6rem);
  letter-spacing: .12em;
  line-height: 1.1;
  margin: .1rem 0 0;
}
.ticket-copy {
  border: 2px dashed #C9C0A9;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: .9375rem;
  border-radius: 8px;
  min-height: 44px;
  padding: .4rem .8rem;
  cursor: pointer;
  white-space: nowrap;
}
.ticket-copy:hover { background: #EFE8D6; }

/* ---------- player chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.chip {
  background: rgba(246, 240, 225, .12);
  border: 1.5px solid rgba(246, 240, 225, .35);
  color: var(--card);
  border-radius: 999px;
  padding: .35rem .8rem;
  font-size: .9375rem;
  display: inline-flex;
  gap: .4rem;
  align-items: center;
}
.chip .host-tag { color: var(--gold); font-weight: 700; font-size: .8125rem; }
.chip.away { opacity: .45; }
.chip .away-tag { font-size: .8125rem; opacity: .8; }
/* chips inside cream cards need ink-on-cream colors */
.card .chip { background: #EFE8D6; border-color: #D5CCB6; color: var(--ink); }
.card .chip .host-tag { color: #8A6A2F; }
.card .chip .away-tag { color: #6B6558; opacity: 1; }

.status-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .9rem; }
.status-chip {
  font-size: .875rem;
  border-radius: 999px;
  padding: .3rem .7rem;
  border: 1.5px solid #CFC7B2;
  color: #6B6558;
  background: #FFFDF6;
}
.status-chip.done { background: var(--ink); border-color: var(--ink); color: var(--card); font-weight: 500; }
.status-chip.skipped { border-style: dashed; color: #9A9484; }

.waiting-line { text-align: center; color: rgba(246, 240, 225, .85); margin: .2rem 0 0; }
.vote-prompt { font-weight: 700; }
.gap-top { margin-top: .8rem; }
.notice.ok { background: var(--gold); color: #3A2C10; }

.round-tag {
  text-align: center;
  font-size: .9375rem;
  color: var(--gold);
  font-weight: 700;
  margin: 0 0 .6rem;
}

/* ---------- question card ---------- */
.question-card { text-align: center; padding: 1.6rem 1.25rem; }
.question-card .q-label { margin: 0 0 .6rem; color: #6B6558; font-size: .9375rem; }
.question-text {
  font-family: var(--display);
  font-size: clamp(1.3rem, 5.2vw, 1.75rem);
  line-height: 1.3;
  margin: 0;
}

/* ---------- voting ---------- */
.real-q-card { padding: 1rem 1.15rem; margin-bottom: 1rem; }
.real-q-card .q-label { margin: 0 0 .35rem; color: #6B6558; font-size: .875rem; }
.real-q-card .question-text { font-size: clamp(1.15rem, 4.4vw, 1.45rem); }

.answers { display: grid; gap: .7rem; }
.answer-card {
  background: var(--card);
  color: var(--ink);
  border: 3px solid transparent;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: .85rem 1rem;
  text-align: left;
  cursor: pointer;
  font-family: var(--text);
  display: block;
  width: 100%;
  position: relative;
}
.answer-card .who { font-weight: 700; font-size: .9375rem; margin: 0 0 .2rem; color: #4A463D; }
.answer-card .what { margin: 0; font-size: 1.0625rem; }
.answer-card.mine { cursor: default; }
.answer-card.mine .who::after { content: " · you"; font-weight: 500; color: #8A8474; }
.answer-card.selected { border-color: var(--red); }
.answer-card.selected::after {
  content: "your pick";
  position: absolute;
  top: -.75rem;
  right: .8rem;
  background: var(--red);
  color: var(--card);
  font-size: .75rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: 999px;
}

.vote-result-row { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; font-size: 1rem; }
.vote-result-row + .vote-result-row { border-top: 1px solid #E3DBC7; }
.vote-result-row .count { font-family: var(--display); color: var(--red); }

/* ---------- reveal / results ---------- */
.flip { perspective: 1200px; }
.flip-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .75s cubic-bezier(.4, .1, .2, 1);
}
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
}
.face-front { min-height: 11rem; }

.card-back {
  background:
    repeating-linear-gradient(45deg, var(--red) 0 12px, var(--red-deep) 12px 24px);
  border: 6px solid var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  display: grid;
  place-items: center;
  min-height: 11rem;
}
.card-back span {
  font-family: var(--display);
  font-size: 3.5rem;
  color: var(--card);
  text-shadow: 0 3px 0 rgba(0, 0, 0, .25);
}

.verdict { text-align: center; }
.verdict .verdict-head {
  font-family: var(--display);
  font-size: clamp(1.35rem, 5.5vw, 1.7rem);
  line-height: 1.25;
  margin: 0 0 .8rem;
}
.liar-stamp {
  display: inline-block;
  font-family: var(--display);
  color: var(--red);
  border: 3px solid var(--red);
  border-radius: 8px;
  padding: .1rem .6rem;
  transform: rotate(-4deg);
  font-size: 1.1rem;
  margin-left: .4rem;
}
.reveal-q { text-align: left; margin-top: .9rem; padding-top: .9rem; border-top: 2px dashed #D8D0BC; }
.reveal-q p { margin: .3rem 0; font-size: 1rem; }
.reveal-q .q-what { font-weight: 700; }

.scores-table { margin-top: 1rem; text-align: left; }
.score-row { display: flex; justify-content: space-between; align-items: baseline; padding: .4rem 0; gap: 1rem; }
.score-row + .score-row { border-top: 1px solid #E3DBC7; }
.score-row .delta { color: var(--red); font-weight: 700; font-size: .9375rem; }
.score-row .name { font-size: 1.0625rem; }
.score-row .pts { font-family: var(--display); color: #8A6A2F; font-size: 1.3rem; }
.score-row.leader .name { font-weight: 700; }

/* ---------- leaderboard ---------- */
.board { display: grid; gap: .6rem; }
.board-row {
  background: var(--card);
  color: var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 1.1rem;
  gap: 1rem;
}
.board-row .place { font-family: var(--display); color: var(--red); width: 2ch; }
.board-row .who { flex: 1; font-weight: 500; }
.board-row .pts { font-family: var(--display); font-size: 1.5rem; color: #8A6A2F; }
.board-row.top { background: var(--gold); color: #3A2C10; }
.board-row.top .place, .board-row.top .pts { color: #3A2C10; }

/* ---------- banners & notices ---------- */
.banner {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--gold);
  color: #3A2C10;
  font-weight: 700;
  text-align: center;
  padding: .55rem 1rem;
  font-size: .9375rem;
}
.notice {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%);
  z-index: 30;
  background: var(--red);
  color: var(--card);
  font-weight: 500;
  padding: .7rem 1.1rem;
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  max-width: min(92vw, 26rem);
  text-align: center;
  font-size: .9375rem;
}

.howto { color: rgba(246, 240, 225, .85); font-size: .9375rem; }
.howto summary { cursor: pointer; text-align: center; color: var(--card); font-weight: 500; padding: .4rem; }
.howto ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.howto li { margin: .25rem 0; }

.divider-word {
  text-align: center;
  color: rgba(246, 240, 225, .6);
  font-size: .9375rem;
  margin: .2rem 0;
}

.footer-link { text-align: center; margin-top: 1.6rem; }
.footer-link a { color: rgba(246, 240, 225, .55); font-size: .8125rem; text-decoration: none; }
.footer-link a:hover { color: var(--card); }

@media (prefers-reduced-motion: reduce) {
  .flip-inner { transition: none; }
  .flip .flip-inner { transform: rotateY(180deg); }
  .btn { transition: none; }
}
