:root {
  --bg1: #ff5e7e;
  --bg2: #6a4cff;
  --accent: #ffd23f;
  --pass: #2ecc71;
  --fail: #ff4d4d;
  --card: #ffffff;
  --text-dark: #1c1c2e;
  --text-light: #ffffff;
  --radius: 24px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: 'Rubik', sans-serif;
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  color: var(--text-light);
  overflow-x: hidden;
}

#app {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.screen {
  display: none;
  width: 100%;
  max-width: 720px;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeIn 0.25s ease;
}

.screen.active { display: flex; }

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

/* HOME */
.logo {
  font-size: 64px;
  font-weight: 900;
  text-align: center;
  text-shadow: 0 4px 0 rgba(0,0,0,0.15);
  margin-bottom: 8px;
}
.logo span {
  display: block;
  font-size: 18px;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 4px;
}
.rules-hint { opacity: 0.85; text-align: center; max-width: 480px; font-size: 15px; }

/* BUTTONS */
.btn {
  border: none;
  border-radius: 999px;
  padding: 16px 32px;
  font-family: inherit;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--text-dark); box-shadow: 0 6px 0 #c99e1e; }
.btn-primary:active:not(:disabled) { box-shadow: 0 2px 0 #c99e1e; }
.btn-big { width: 100%; max-width: 360px; font-size: 22px; padding: 20px 32px; }
.btn-ghost { background: transparent; color: var(--text-light); text-decoration: underline; box-shadow: none; }
.btn-pass { background: var(--pass); color: white; box-shadow: 0 6px 0 #1f9c53; flex: 1; padding: 24px; font-size: 22px; }
.btn-fail { background: var(--fail); color: white; box-shadow: 0 6px 0 #c73333; flex: 1; padding: 24px; font-size: 22px; }
.btn-pass:active, .btn-fail:active { box-shadow: 0 2px 0 rgba(0,0,0,0.3); }

/* SETUP */
#screen-setup h2 { margin: 4px 0; font-size: 20px; }
.player-add-row { display: flex; gap: 8px; width: 100%; max-width: 420px; }
.player-add-row input {
  flex: 1; padding: 14px 16px; border-radius: 14px; border: none; font-size: 16px; font-family: inherit;
}
.player-list { list-style: none; padding: 0; margin: 0; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 8px; }
.player-list li {
  background: rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}
.player-list li button {
  background: none; border: none; color: white; font-size: 18px; cursor: pointer; opacity: 0.7;
}
.hint { opacity: 0.8; font-size: 14px; }
.chip-row { display: flex; gap: 10px; }
.chip {
  background: rgba(255,255,255,0.15);
  border: 2px solid transparent;
  color: white;
  border-radius: 14px;
  padding: 12px 20px;
  font-family: inherit;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
}
.chip.selected { background: var(--accent); color: var(--text-dark); border-color: white; }

/* ROUND INTRO */
.round-counter { font-size: 16px; opacity: 0.85; }
.role-card {
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 20px 32px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.role-card-accent { background: var(--accent); color: var(--text-dark); }
.role-label { font-size: 14px; opacity: 0.8; text-transform: uppercase; letter-spacing: 1px; }
.role-name { font-size: 32px; font-weight: 900; margin-top: 4px; }

/* GAME */
.top-bar { display: flex; align-items: center; gap: 12px; width: 100%; }
.round-badge { font-weight: 700; white-space: nowrap; }
.round-timer-track { flex: 1; height: 14px; background: rgba(255,255,255,0.25); border-radius: 999px; overflow: hidden; }
.round-timer-fill { height: 100%; width: 100%; background: var(--accent); transition: width 1s linear; }
.round-score { font-weight: 900; font-size: 22px; min-width: 32px; text-align: right; }
.roles-mini { opacity: 0.85; font-size: 15px; }

.question-zone { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; }
.q-timer-ring { width: 90px; height: 90px; margin-bottom: -45px; z-index: 2; }
.q-timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.25); stroke-width: 8; }
.ring-fg {
  fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 283; stroke-dashoffset: 0; transition: stroke-dashoffset 0.1s linear;
}
.question-card {
  background: var(--card);
  color: var(--text-dark);
  border-radius: var(--radius);
  padding: 56px 28px 28px;
  width: 100%;
  text-align: center;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.question-text { font-size: 26px; font-weight: 700; margin: 0; }
.hidden { display: none !important; }

.verdict-buttons { display: flex; gap: 16px; width: 100%; }

/* ROUND RESULT / FINAL */
.round-result-name { font-size: 24px; font-weight: 700; }
.round-result-score { font-size: 18px; opacity: 0.9; }
.final-title { font-size: 28px; }
.winner-banner {
  background: var(--accent);
  color: var(--text-dark);
  border-radius: var(--radius);
  padding: 20px 32px;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}
.final-scoreboard { list-style: none; padding: 0; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 8px; }
.final-scoreboard li {
  background: rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}
.final-scoreboard li.is-winner { background: var(--accent); color: var(--text-dark); }

/* HISTORY */
.history-list { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.history-list .row {
  background: rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

@media (max-width: 480px) {
  .logo { font-size: 44px; }
  .question-text { font-size: 21px; }
}
