/* Impostor — mobile-first party game styling.
   Dark theme, big tap targets, single column. Designed for a phone in hand. */

:root {
  --bg: #0f1226;
  --bg-2: #171a35;
  --card: #1e2246;
  --card-2: #262b57;
  --line: #333a6b;
  --text: #eef0ff;
  --muted: #9aa0cf;
  --accent: #6c8cff;
  --accent-2: #8a6cff;
  --danger: #ff5d73;
  --good: #37d495;
  --warn: #ffcf5c;
  --radius: 18px;
  --tap: 56px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #22265280, transparent),
              var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: max(20px, env(safe-area-inset-top)) 20px
           max(20px, env(safe-area-inset-bottom)) 20px;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Deliberately tiny + low-contrast so it's hard to tap by accident. */
.tiny-reset {
  position: absolute; top: 6px; left: 6px; z-index: 5;
  width: 24px; height: 24px; min-height: 24px; padding: 0;
  font-size: 12px; line-height: 1; border-radius: 7px;
  background: transparent; border: 1px solid var(--line);
  color: var(--muted); opacity: 0.45;
}
.tiny-reset:active { opacity: 1; }

/* ---- Typography & layout helpers ---- */
h1 { font-size: 30px; margin: 0; letter-spacing: -0.5px; }
h2 { font-size: 20px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.grow { flex: 1; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.spread { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.small { font-size: 14px; }
.mono { font-variant-numeric: tabular-nums; }

.brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.brand .logo { font-size: 30px; }
.subtitle { color: var(--muted); margin: 2px 0 18px; }

.section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

/* ---- Buttons ---- */
button {
  font: inherit; color: inherit; cursor: pointer;
  border: none; border-radius: 14px;
  background: var(--card-2);
  padding: 14px 16px;
  min-height: var(--tap);
  transition: transform .05s ease, filter .15s ease, background .15s ease;
}
button:active { transform: scale(0.98); }
button:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white; font-weight: 700; font-size: 18px;
  width: 100%;
  box-shadow: 0 8px 24px #6c8cff33;
}
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-danger { background: #3a1f2c; color: var(--danger); }
.btn-block { width: 100%; }
.btn-big { min-height: 68px; font-size: 20px; font-weight: 700; }
.btn-good { background: linear-gradient(135deg, #2fb37e, #37d495); color: #04231a; font-weight: 800; }
.btn-bad { background: #3a1f2c; color: var(--danger); font-weight: 700; border: 1px solid #5a2c3c; }

/* ---- Chips (players / categories) ---- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line);
  min-height: 44px; font-size: 15px;
}
.chip.on { background: linear-gradient(135deg, #2b3a86, #3a2b86); border-color: #5b6ad6; }
.chip .x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 999px;
  background: #ffffff1a; font-size: 13px; margin-left: 2px;
}

/* ---- Inputs ---- */
input[type="text"] {
  font: inherit; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px; min-height: var(--tap);
  width: 100%; outline: none;
}
input[type="text"]:focus { border-color: var(--accent); }

/* Stepper */
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { width: 52px; height: 52px; padding: 0; font-size: 24px; border-radius: 14px; }
.stepper .val { font-size: 26px; font-weight: 700; min-width: 36px; text-align: center; }

/* Toggle */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch { position: relative; width: 56px; height: 32px; flex: none; }
.switch input { display: none; }
.switch .track {
  position: absolute; inset: 0; background: var(--line); border-radius: 999px;
  transition: background .15s ease;
}
.switch .thumb {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px;
  background: white; border-radius: 999px; transition: transform .15s ease;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track + .thumb { transform: translateX(24px); }

/* ---- Reveal cards ---- */
.pass-screen, .role-screen { flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 18px; }
.pass-name { font-size: 34px; font-weight: 800; letter-spacing: -0.5px; }
.tap-hint { color: var(--muted); }

.card-face {
  width: 100%;
  border-radius: 26px; padding: 40px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  border: 1px solid var(--line);
}
.card-word { background: linear-gradient(160deg, #1c2a5c, #221c5c); }
.card-impostor { background: linear-gradient(160deg, #4a1330, #2a1030); border-color: #7a2247; }
.eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 12px; color: var(--muted); }
.big-word { font-size: 40px; font-weight: 800; letter-spacing: -1px; text-align: center; }
.role-emoji { font-size: 56px; }
.hint-word {
  margin-top: 6px; padding: 8px 16px; border-radius: 999px;
  background: #ffffff14; border: 1px solid #ffffff2a;
  font-size: 18px; color: var(--warn);
}
.hint-word b { color: white; }
.db-toggle {
  margin-top: 12px; width: 100%;
  background: #ffffff14; border: 1px solid #ffffff2a; color: var(--text);
  border-radius: 12px; font-size: 15px; min-height: 48px;
}
.db-toggle.on { background: linear-gradient(135deg, #7a5a12, #6a4a12); border-color: var(--warn); color: #fff; }
.db-banner {
  background: linear-gradient(135deg, #7a5a12, #6a4a12); border: 1px solid var(--warn);
  color: #fff; border-radius: var(--radius); padding: 12px 16px; font-weight: 700;
  text-align: center; margin-bottom: 12px;
}
.desc-btn { margin-top: 8px; font-size: 15px; padding: 10px 14px; min-height: 44px; }
.desc {
  margin-top: 8px; padding: 12px 16px; border-radius: 14px;
  background: #ffffff12; border: 1px solid var(--line);
  font-size: 15px; line-height: 1.5; color: var(--text);
}

.progress-dots { display: flex; gap: 8px; justify-content: center; margin-top: 4px; }
.progress-dots i { width: 8px; height: 8px; border-radius: 999px; background: var(--line); }
.progress-dots i.done { background: var(--good); }
.progress-dots i.cur { background: var(--accent); }

/* Vote list */
.vote-list { display: flex; flex-direction: column; gap: 12px; }
.vote-list button { justify-content: flex-start; text-align: left; font-size: 18px; font-weight: 600; }

/* Result */
.verdict { font-size: 28px; font-weight: 800; }
.verdict.good { color: var(--good); }
.verdict.bad { color: var(--danger); }
.reveal-word { font-size: 30px; font-weight: 800; }

/* Scoreboard */
.scoreboard { display: flex; flex-direction: column; gap: 8px; }
.score-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--line); font-size: 17px;
}
.score-row.champ { background: linear-gradient(135deg, #3a3410, #2a2410); border-color: var(--warn); }
.gain { color: var(--good); font-size: 14px; margin-left: 6px; }
.score-open {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 14px; min-height: 40px; font-size: 16px; font-weight: 600;
}
.caret { color: var(--muted); font-size: 12px; }
.pen { font-size: 13px; font-weight: 400; opacity: .85; }

/* Score-adjust pop-up */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
}
.modal {
  width: 100%; max-width: 360px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
  box-shadow: 0 20px 60px #000a;
}
.adj-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 8px 0; }
.adj-grid button { min-height: 52px; padding: 0; font-size: 18px; font-weight: 800; }
.adj-neg { background: #3a1f2c; color: var(--danger); }
.adj-pos { background: #123a2c; color: var(--good); }

/* Paused stat-tracking banner */
.section.paused { border-color: var(--warn); background: #2c2810; }

/* Lifetime stats: badges + table */
.badges { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.badge-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, #2a2450, #26224a);
  border: 1px solid var(--line);
}
.badge-emoji { font-size: 30px; }
.badge-title { font-weight: 700; }
.badge-sub { color: var(--muted); font-size: 14px; }
.stat-row {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px;
  align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line);
}
.stat-row:last-child { border-bottom: none; }
.stat-row.head { color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); }
.stat-row span:not(.stat-name) { min-width: 52px; text-align: center; }
.stat-name { font-weight: 600; }

.footer-actions { margin-top: auto; padding-top: 18px; }
.hint { color: var(--muted); font-size: 14px; line-height: 1.5; }
.badge { display:inline-block; background: var(--bg-2); border:1px solid var(--line);
  border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--muted); }
