/* ===================== THEME ===================== */
:root {
  --bg-0: #0d0a06;
  --bg-1: #1a130a;
  --bg-2: #241a0d;
  --gold: #ffb627;
  --amber: #ff7b00;
  --rust: #a8430f;
  --brown: #5c3a1e;
  --ink: #f5e9d4;
  --ink-dim: #b9a585;
  --good: #4ccf7a;
  --bad: #e85b4a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

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

html, body { height: 100%; }

body {
  font-family: "Roboto", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, #3a2810 0%, transparent 60%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-0) 70%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===================== PROGRESS BAR ===================== */
.progress-track {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  z-index: 50;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--rust), var(--gold));
  transition: width 0.5s ease;
}

/* ===================== STAGE / SCREENS ===================== */
.stage {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 48px;
}

.screen { display: none; width: 100%; }
.screen.active { display: block; animation: fadeUp 0.5s ease; }

.screen-inner {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}
.screen-inner.center { text-align: center; }

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

/* ===================== TYPOGRAPHY ===================== */
.kicker {
  font-family: "Oswald", sans-serif;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gold);
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.title-main {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: clamp(2.6rem, 11vw, 5rem);
  line-height: 0.98;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff4dc 0%, var(--gold) 55%, var(--amber) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 6px 30px rgba(255, 123, 0, 0.25);
}
.title-main.small { font-size: clamp(2.2rem, 9vw, 4rem); }

.subtitle {
  font-family: "Oswald", sans-serif;
  color: var(--ink-dim);
  font-size: clamp(1rem, 4vw, 1.4rem);
  margin: 16px 0 34px;
  letter-spacing: 1px;
}
.hint { color: var(--ink-dim); font-size: 0.9rem; margin-top: 22px; }

.step-label {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--amber);
  font-size: 0.8rem;
  margin-bottom: 10px;
}
.screen-title {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  line-height: 1.05;
  margin-bottom: 8px;
}
.screen-text { color: var(--ink-dim); margin-bottom: 26px; font-size: 1.05rem; }

/* ===================== BUTTONS ===================== */
.btn {
  font-family: "Oswald", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #1a1003;
  background: linear-gradient(180deg, var(--gold), var(--amber));
  border: none;
  border-radius: 14px;
  padding: 16px 30px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, filter 0.15s ease;
  margin-top: 10px;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn:active { transform: translateY(0); }
.btn-big { font-size: 1.35rem; padding: 20px 44px; margin-top: 24px; }

/* ===================== NICKNAME BOX ===================== */
.nick-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}
.nick-box label {
  font-family: "Oswald", sans-serif;
  letter-spacing: 1px;
  color: var(--ink-dim);
  font-size: 1.05rem;
}
#nickInput {
  width: min(360px, 86vw);
  font-family: "Oswald", sans-serif;
  font-size: 1.25rem;
  text-align: center;
  color: var(--ink);
  background: #160f07;
  border: 2px solid var(--brown);
  border-radius: 12px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.15s ease;
}
#nickInput:focus { border-color: var(--gold); }
#nickInput::placeholder { color: #6b5a40; }
#startBtn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.3); }
.nick-warn { color: var(--bad); font-size: 0.9rem; }

/* ===================== DETECTIVE BADGE ===================== */
.badge {
  position: fixed;
  top: 14px; right: 14px;
  z-index: 40;
  font-family: "Oswald", sans-serif;
  background: #160f07;
  border: 1px solid var(--brown);
  border-radius: 30px;
  padding: 6px 14px;
  font-size: 0.9rem;
  color: var(--gold);
  box-shadow: var(--shadow);
}

/* ===================== LIVE RESULTS ===================== */
.results {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--brown);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
}
.results-title {
  font-family: "Oswald", sans-serif;
  font-size: 1.15rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.results-total { color: var(--ink-dim); font-size: 0.9rem; margin-left: auto; }
.live-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(76, 207, 122, 0.6);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(76, 207, 122, 0.6); }
  70%  { box-shadow: 0 0 0 9px rgba(76, 207, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 207, 122, 0); }
}

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 64px;
  align-items: center;
  gap: 10px;
}
.bar-name { font-family: "Oswald", sans-serif; font-size: 0.95rem; white-space: nowrap; }
.bar-track {
  height: 16px;
  background: #0e0a05;
  border-radius: 8px;
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--rust), var(--gold));
  border-radius: 8px;
  transition: width 0.6s ease;
  min-width: 2px;
}
.bar-num { font-size: 0.85rem; color: var(--ink-dim); text-align: right; white-space: nowrap; }
.bar-row.mine .bar-name { color: var(--gold); }
.bar-row.mine .bar-fill { background: linear-gradient(90deg, var(--amber), #fff4dc); }

.feed-title {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.72rem;
  color: var(--ink-dim);
  margin: 18px 0 10px;
}
.feed { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 0.85rem;
  background: #160f07;
  border: 1px solid var(--brown);
  border-radius: 20px;
  padding: 5px 12px;
  color: var(--ink);
}
.chip.me { border-color: var(--gold); color: var(--gold); }
.chip.muted { color: var(--ink-dim); border-style: dashed; }

/* ===================== SUSPECT VOTE ===================== */
.suspect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}
.suspect {
  font-family: "Oswald", sans-serif;
  font-size: 1.15rem;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-2), #160f07);
  border: 2px solid var(--brown);
  border-radius: 16px;
  padding: 24px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.suspect-emoji { font-size: 2.1rem; }
.suspect:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: var(--shadow); }
.suspect.chosen { border-color: var(--gold); background: linear-gradient(180deg, #3a2810, #241a0d); }
.suspect.dim { opacity: 0.4; }

/* ===================== REVEAL CARDS ===================== */
.reveal { margin-top: 30px; animation: fadeUp 0.5s ease; }
.reveal-pick { color: var(--ink-dim); margin-bottom: 14px; }
.reveal-pick strong { color: var(--gold); }

.verdict-card {
  background: linear-gradient(180deg, rgba(255, 182, 39, 0.12), rgba(168, 67, 15, 0.12));
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 18px;
}
.verdict-head {
  font-family: "Oswald", sans-serif;
  font-size: 1.35rem;
  color: var(--gold);
  margin-bottom: 6px;
}
.verdict-body { font-size: 1.05rem; line-height: 1.5; }

/* ===================== SIMULATOR ===================== */
.sim-layout {
  display: flex;
  gap: 30px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.beaker-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }

.beaker {
  position: relative;
  width: 150px;
  height: 200px;
  border: 4px solid rgba(245, 233, 212, 0.5);
  border-top: none;
  border-radius: 0 0 26px 26px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}
.water {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 72%;
  background: #6fb8d6;
  transition: background 0.7s ease, height 0.7s ease;
}
.water::before {
  content: "";
  position: absolute;
  top: -10px; left: 0; right: 0;
  height: 14px;
  background: inherit;
  border-radius: 50%;
  filter: brightness(1.15);
}
.beaker-shine {
  position: absolute;
  top: 0; left: 14px;
  width: 16px; height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0.18), transparent);
}

.readouts { display: flex; gap: 14px; }
.readout {
  background: #160f07;
  border: 1px solid var(--brown);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: center;
  min-width: 92px;
}
.readout-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-dim);
  margin-bottom: 4px;
}
.readout-value {
  font-family: "Oswald", sans-serif;
  font-size: 1.5rem;
  color: var(--gold);
  transition: color 0.4s ease;
}

.controls { display: flex; flex-direction: column; gap: 12px; min-width: 220px; }
.btn-add {
  font-family: "Oswald", sans-serif;
  font-size: 1.05rem;
  text-align: left;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-2), #160f07);
  border: 2px solid var(--brown);
  border-radius: 12px;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.btn-add:hover { transform: translateX(4px); border-color: var(--gold); }
.btn-add.used { opacity: 0.45; border-color: var(--good); cursor: default; }
.btn-add.used::after { content: " ✓"; color: var(--good); }
.btn-reset {
  font-family: "Oswald", sans-serif;
  font-size: 0.95rem;
  color: var(--ink-dim);
  background: transparent;
  border: 1px dashed var(--brown);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  margin-top: 4px;
}
.btn-reset:hover { color: var(--ink); border-color: var(--ink-dim); }

.sim-status {
  text-align: center;
  margin-top: 26px;
  font-size: 1.05rem;
  color: var(--ink-dim);
  min-height: 1.5em;
}

/* ===================== REACTION ===================== */
.equation {
  font-family: "Oswald", sans-serif;
  font-size: clamp(1.1rem, 4.6vw, 2rem);
  background: #120c06;
  border: 2px solid var(--brown);
  border-radius: 14px;
  padding: 26px 18px;
  margin: 24px 0;
  line-height: 1.6;
  color: var(--gold);
  letter-spacing: 1px;
}
.equation sub, .equation sup { color: var(--ink); font-size: 0.65em; }
.explain-card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 10px;
}
.explain-card p { font-size: 1.1rem; line-height: 1.6; margin: 6px 0; }
.explain-card strong { color: var(--gold); }

/* ===================== TREATMENT GAME ===================== */
.answers { display: flex; flex-direction: column; gap: 14px; }
.answer {
  font-family: "Roboto", sans-serif;
  font-size: 1.1rem;
  text-align: left;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-2), #160f07);
  border: 2px solid var(--brown);
  border-radius: 14px;
  padding: 18px 20px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.answer:hover { transform: translateX(4px); border-color: var(--gold); }
.answer.correct { border-color: var(--good); background: linear-gradient(180deg, rgba(76,207,122,0.18), #160f07); }
.answer.wrong { border-color: var(--bad); background: linear-gradient(180deg, rgba(232,91,74,0.18), #160f07); }
.answer .why { display: block; margin-top: 8px; font-size: 0.9rem; color: var(--ink-dim); }

.treat-mark {
  font-family: "Oswald", sans-serif;
  font-size: 1.6rem;
  color: var(--good);
  margin-bottom: 14px;
}

/* ===================== ENDING ===================== */
.end-text { font-size: 1.2rem; line-height: 1.6; margin: 18px auto 26px; max-width: 560px; }
.end-text strong { color: var(--gold); }
.suspect-lineup {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}
.suspect-lineup span {
  font-family: "Oswald", sans-serif;
  background: #160f07;
  border: 1px solid var(--brown);
  border-radius: 30px;
  padding: 8px 16px;
  font-size: 0.95rem;
}

/* ===================== MOBILE ===================== */
@media (max-width: 520px) {
  .stage { padding: 24px 16px 40px; }
  .controls { width: 100%; }
  .sim-layout { gap: 20px; }
}
