:root {
  --bg: #0a0a0f;
  --surface: #13131a;
  --surface2: #1c1c27;
  --accent: #e63946;
  --accent2: #f4a261;
  --text: #f0edf6;
  --muted: #6b6880;
  --success: #2ec4b6;
  --warn: #f4a261;
  --border: rgba(255, 255, 255, 0.07);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 10%, rgba(230, 57, 70, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 80% 90%, rgba(46, 196, 182, 0.08) 0%, transparent 60%);
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  padding: 24px 16px 48px;
}

h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 10vw, 5rem);
  letter-spacing: 0.04em;
  line-height: 1;
  background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header {
  margin-bottom: 36px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.hidden {
  display: none !important;
}

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

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 16px;
}

/* Inputs */
.field {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

input[type='number'],
input[type='text'] {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: var(--accent);
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border-radius: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
}

.player-row input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.95rem;
}

.player-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  color: var(--accent);
  min-width: 22px;
}

/* Timer config */
.timer-options {
  display: flex;
  gap: 8px;
}

.timer-opt {
  flex: 1;
  padding: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}

.timer-opt:hover {
  color: var(--text);
}

.timer-opt.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(230, 57, 70, 0.08);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 24px;
  transition: all 0.18s;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: #c1121f;
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-success {
  background: var(--success);
  color: #000;
}

.btn-success:hover {
  filter: brightness(1.1);
}

.btn-warn {
  background: var(--warn);
  color: #000;
  width: 100%;
}

.btn-warn:hover {
  filter: brightness(1.1);
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn-row .btn {
  flex: 1;
}

/* Reveal */
.pass-screen {
  text-align: center;
  padding: 48px 24px;
}

.pass-who {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.8rem, 12vw, 5rem);
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 12px;
}

.pass-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 40px;
}

.word-reveal-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
  margin-bottom: 20px;
}

.word-reveal-box.impostor-box {
  border-color: rgba(230, 57, 70, 0.4);
  background: rgba(230, 57, 70, 0.06);
}

.word-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 10px;
}

.word-big {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.5rem, 10vw, 4rem);
  letter-spacing: 0.05em;
  line-height: 1;
  color: var(--success);
}

.word-big.hidden-word {
  color: var(--accent);
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  line-height: 1.3;
}

.impostor-tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Progress / turn */
.progress-bar {
  height: 3px;
  background: var(--surface2);
  border-radius: 2px;
  margin-bottom: 20px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.player-turn-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2);
  border-radius: 12px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.player-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.player-name-label {
  font-weight: 600;
  font-size: 1rem;
}

.player-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Countdown timer */
.timer-wrap {
  margin-bottom: 16px;
}

.timer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.timer-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.timer-digits {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  color: var(--success);
  transition: color 0.3s;
}

.timer-digits.warning {
  color: var(--warn);
}

.timer-digits.danger {
  color: var(--accent);
}

.timer-bar-track {
  height: 5px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}

.timer-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--success);
  transition: width 0.1s linear, background 0.3s;
}

.timer-bar-fill.warning {
  background: var(--warn);
}

.timer-bar-fill.danger {
  background: var(--accent);
}

/* Synonym log */
.synonym-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.synonym-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border-radius: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  animation: fadeIn 0.25s ease;
}

.syn-player {
  font-size: 0.85rem;
  color: var(--muted);
}

.syn-word {
  font-weight: 600;
  font-size: 0.95rem;
}

.syn-word.timeout {
  color: var(--accent);
  font-style: italic;
  opacity: 0.7;
}

/* Synonym input */
.synonym-input-wrap {
  position: relative;
  margin-bottom: 12px;
}

.synonym-input-wrap input {
  padding-right: 100px;
}

.confirm-inline {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  border: none;
  border-radius: 7px;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 7px 14px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: background 0.15s;
}

.confirm-inline:hover {
  background: #c1121f;
}

/* Voting */
.vote-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vote-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  width: 100%;
}

.vote-btn:hover {
  border-color: var(--accent);
  background: rgba(230, 57, 70, 0.08);
}

.vote-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.vote-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.vote-syn {
  font-size: 0.8rem;
  color: var(--muted);
}

.vote-syn.timeout-label {
  color: var(--accent);
  font-style: italic;
}

/* Tie box */
.tie-box {
  background: rgba(244, 162, 97, 0.08);
  border: 1px solid rgba(244, 162, 97, 0.3);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
}

.tie-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.tie-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: var(--warn);
  margin-bottom: 6px;
}

/* Result */
.result-big {
  text-align: center;
  padding: 32px 20px;
}

.result-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.result-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 8vw, 3.5rem);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.result-title.success {
  color: var(--success);
}

.result-title.danger {
  color: var(--accent);
}

.result-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.result-reveal {
  background: var(--surface2);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.reveal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.reveal-row:last-child {
  margin-bottom: 0;
}

.reveal-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.reveal-value {
  font-weight: 600;
}

.reveal-value.danger {
  color: var(--accent);
}

.reveal-value.safe {
  color: var(--success);
}

/* History */
.history-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  cursor: pointer;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  transition: border-color 0.15s;
  margin-bottom: 0;
}

.history-toggle:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.history-toggle .chevron {
  transition: transform 0.2s;
  font-size: 0.7rem;
  color: var(--muted);
}

.history-toggle.open {
  border-radius: 12px 12px 0 0;
}

.history-toggle.open .chevron {
  transform: rotate(180deg);
}

.history-body {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 0 20px 16px;
  margin-bottom: 16px;
}

.history-body.open {
  display: block;
}

.round-history-card {
  border-left: 2px solid var(--border);
  padding-left: 14px;
  margin-top: 16px;
}

.round-hist-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
}

/* Misc */
.step-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.round-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(244, 162, 97, 0.1);
  border: 1px solid rgba(244, 162, 97, 0.25);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  color: var(--warn);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.info-text {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.info-text.spaced {
  margin-bottom: 16px;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(230, 57, 70, 0);
  }
}

.pulse {
  animation: pulse 1.5s infinite;
}

@keyframes flashRed {
  0%,
  100% {
    background: var(--surface);
  }
  50% {
    background: rgba(230, 57, 70, 0.15);
  }
}

.timeout-flash {
  animation: flashRed 0.4s ease 2;
}
