* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  height: 100%;
  font-family: 'Heebo', -apple-system, 'Segoe UI', sans-serif;
}

body {
  background: linear-gradient(135deg, #0f0f1e 0%, #1a0f2e 50%, #2e0f2e 100%);
  color: #fff;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
}

.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 20px;
  animation: fadeIn 0.3s ease;
}

.screen.active { display: block; }

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

/* ============ HEADER ============ */
.header {
  text-align: center;
  padding: 20px 0 30px;
}

.logo {
  font-size: 64px;
  margin-bottom: 8px;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.header h1 {
  font-size: 40px;
  font-weight: 900;
  background: linear-gradient(135deg, #ff6b9d 0%, #c44dff 50%, #7b5cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.subtitle {
  color: #a0a0c0;
  font-size: 15px;
}

/* ============ SECTIONS ============ */
.section {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
}

.section h2 {
  font-size: 18px;
  margin-bottom: 14px;
  color: #ff6b9d;
  font-weight: 700;
}

/* ============ PLAYERS ============ */
#players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.player-chip {
  background: linear-gradient(135deg, rgba(255,107,157,0.15), rgba(196,77,255,0.15));
  border: 1px solid rgba(255,107,157,0.3);
  padding: 12px 16px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 500;
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.player-remove {
  background: rgba(255,80,80,0.2);
  border: none;
  color: #ff6b6b;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.player-remove:active { transform: scale(0.9); }

.add-row {
  display: flex;
  gap: 8px;
}

.add-row input {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border 0.2s ease;
}

.add-row input:focus { border-color: #ff6b9d; }

.btn-add {
  background: linear-gradient(135deg, #ff6b9d, #c44dff);
  border: none;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.btn-add:active { transform: scale(0.92); }

.hint {
  color: #808098;
  font-size: 13px;
  margin-top: 10px;
}

/* ============ CATEGORIES ============ */
.categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.category {
  background: rgba(0,0,0,0.3);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 14px 10px;
  cursor: pointer;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s ease;
  color: #fff;
}

.category.selected {
  border-color: #ff6b9d;
  background: linear-gradient(135deg, rgba(255,107,157,0.25), rgba(196,77,255,0.25));
  transform: scale(1.02);
}

.category-emoji {
  font-size: 24px;
  display: block;
  margin-bottom: 4px;
}

/* ============ RADIO ============ */
.radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 15px;
}

.radio-row input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: #ff6b9d;
}

#custom-word {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  margin-top: 8px;
}

#custom-word:focus { border-color: #ff6b9d; }

/* ============ TOGGLES (Difficulty) ============ */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  gap: 12px;
}

.toggle-row:last-of-type {
  border-bottom: none;
}

.toggle-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 3px;
}

.toggle-desc {
  font-size: 12px;
  color: #a0a0c0;
}

.toggle-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 46px;
  height: 26px;
  border-radius: 26px;
  background: rgba(255,255,255,0.1);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.toggle-row input[type="checkbox"]::before {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.toggle-row input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #ff6b9d, #c44dff);
}

.toggle-row input[type="checkbox"]:checked::before {
  transform: translateX(-20px);
}

/* ============ TIMER SELECT ============ */
.timer-row {
  padding: 14px 0 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 4px;
}

.timer-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.timer-btn {
  background: rgba(0,0,0,0.3);
  border: 2px solid rgba(255,255,255,0.1);
  color: #fff;
  padding: 10px 4px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.timer-btn.selected {
  border-color: #ff6b9d;
  background: linear-gradient(135deg, rgba(255,107,157,0.25), rgba(196,77,255,0.25));
}

/* ============ BUTTONS ============ */
.btn-primary, .btn-secondary {
  border: none;
  color: #fff;
  padding: 16px 24px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  margin-top: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, #ff6b9d, #c44dff);
  box-shadow: 0 8px 24px rgba(196,77,255,0.35);
}

.btn-secondary {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
}

.btn-primary:active, .btn-secondary:active {
  transform: scale(0.97);
  box-shadow: 0 4px 12px rgba(196,77,255,0.25);
}

.btn-big {
  padding: 20px 24px;
  font-size: 19px;
  margin-top: 16px;
}

/* ============ PASS SCREEN ============ */
.pass-container, .reveal-container, .discuss-container, .result-container, .vote-container {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  gap: 16px;
}

.pass-emoji {
  font-size: 100px;
  animation: shake 2s ease-in-out infinite;
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}

.pass-hint {
  color: #a0a0c0;
  font-size: 18px;
}

#pass-name {
  font-size: 44px;
  font-weight: 900;
  background: linear-gradient(135deg, #ff6b9d, #c44dff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding: 0 20px;
  word-break: break-word;
}

.progress {
  color: #808098;
  font-size: 14px;
  margin-top: 12px;
}

/* ============ REVEAL SCREEN ============ */
.tap-emoji {
  font-size: 100px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.tap-hint {
  color: #a0a0c0;
  font-size: 20px;
  margin-bottom: 20px;
}

.warning {
  color: #ffb84d;
  font-size: 14px;
  margin-top: 12px;
  background: rgba(255,184,77,0.1);
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,184,77,0.3);
}

#reveal-word-box, #reveal-impostor-box {
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,107,157,0.4);
  padding: 40px 30px;
  border-radius: 24px;
  animation: reveal 0.4s ease;
  min-width: 260px;
}

@keyframes reveal {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.reveal-label {
  color: #a0a0c0;
  font-size: 16px;
  margin-bottom: 12px;
}

#reveal-word {
  font-size: 44px;
  font-weight: 900;
  background: linear-gradient(135deg, #4dff9d, #4dc4ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  word-break: break-word;
}

.impostor-emoji {
  font-size: 80px;
  margin-bottom: 12px;
}

#reveal-impostor-box {
  border-color: rgba(255,80,80,0.5);
  background: linear-gradient(135deg, rgba(255,80,80,0.15), rgba(196,77,255,0.15));
}

.impostor-text {
  font-size: 36px;
  font-weight: 900;
  color: #ff6b6b;
  margin-bottom: 8px;
}

.impostor-hint {
  color: #ffd0d0;
  font-size: 15px;
  margin-bottom: 14px;
}

.hint-badge {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 15px;
  margin-top: 12px;
}

.hint-label {
  color: #a0a0c0;
  font-weight: 600;
}

#impostor-category {
  color: #4dc4ff;
  font-weight: 700;
}

/* ============ TASK BOX ============ */
.task-box {
  background: linear-gradient(135deg, rgba(255,184,77,0.15), rgba(255,140,50,0.15));
  border: 2px solid rgba(255,184,77,0.4);
  padding: 20px;
  border-radius: 20px;
  margin-top: 16px;
  animation: reveal 0.4s ease 0.2s both;
  min-width: 260px;
}

.task-label {
  color: #ffb84d;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

#task-text {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
}

/* ============ DISCUSS + RESULT ============ */
.discuss-emoji {
  font-size: 90px;
  margin-bottom: 8px;
}

.discuss-container h1 {
  font-size: 32px;
  font-weight: 900;
}

.discuss-hint {
  color: #a0a0c0;
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ============ TIMER (in discussion) ============ */
.timer-box {
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,107,157,0.4);
  border-radius: 24px;
  padding: 24px 32px;
  margin: 12px 0;
  min-width: 240px;
}

#timer-display {
  font-size: 56px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #4dff9d, #4dc4ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
  transition: color 0.2s ease;
}

#timer-display.warning {
  background: linear-gradient(135deg, #ffb84d, #ff6b6b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pulse 0.5s ease-in-out infinite;
}

#timer-display.danger {
  background: linear-gradient(135deg, #ff6b6b, #ff4d6b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pulse 0.3s ease-in-out infinite;
}

.timer-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.btn-timer {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
  font-family: inherit;
}

.btn-timer:active { transform: scale(0.92); }

/* ============ VOTE ============ */
.vote-header {
  margin-bottom: 20px;
}

.vote-emoji {
  font-size: 80px;
  margin-bottom: 8px;
}

#vote-title {
  font-size: 32px;
  font-weight: 900;
  background: linear-gradient(135deg, #ff6b9d, #c44dff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
  word-break: break-word;
}

.vote-subtitle {
  color: #a0a0c0;
  font-size: 15px;
}

#vote-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 380px;
  margin: 16px 0;
}

.vote-option {
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.12);
  padding: 18px 20px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.vote-option:active {
  transform: scale(0.98);
  border-color: #ff6b9d;
  background: linear-gradient(135deg, rgba(255,107,157,0.25), rgba(196,77,255,0.25));
}

.vote-option:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============ RESULT ============ */
.result-emoji {
  font-size: 90px;
  margin-bottom: 8px;
}

.result-headline {
  font-size: 32px;
  font-weight: 900;
  padding: 0 10px;
}

.result-headline.win {
  background: linear-gradient(135deg, #4dff9d, #4dc4ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.result-headline.lose {
  background: linear-gradient(135deg, #ff6b6b, #ff4d6b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.result-headline.tie {
  background: linear-gradient(135deg, #ffb84d, #ff8c32);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.result-details {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 20px;
  margin: 8px 0;
  width: 100%;
  max-width: 380px;
  font-size: 16px;
  line-height: 1.7;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.detail-label {
  color: #a0a0c0;
}

.detail-value {
  font-weight: 700;
  color: #fff;
}

.detail-value.word {
  background: linear-gradient(135deg, #4dff9d, #4dc4ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.detail-value.imp {
  background: linear-gradient(135deg, #ff6b9d, #c44dff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============ SCOREBOARD ============ */
.scoreboard {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 20px;
  margin-top: 8px;
  width: 100%;
  max-width: 380px;
}

.scoreboard h3 {
  font-size: 18px;
  color: #ff6b9d;
  margin-bottom: 12px;
}

#scoreboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,0,0.25);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 15px;
}

.score-row.leader {
  background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,180,50,0.15));
  border: 1px solid rgba(255,215,0,0.3);
}

.score-name { font-weight: 600; }
.score-value {
  font-weight: 900;
  font-size: 20px;
  color: #ffb84d;
  min-width: 40px;
  text-align: left;
}

/* ============ RESPONSIVE ============ */
@media (min-width: 500px) {
  .screen { max-width: 500px; margin: 0 auto; }
}

/* ============ BOT / STARS / TASK RESULTS ============ */
.btn-bot {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  background: linear-gradient(135deg, #4a3d8f, #6a5db8);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s;
}
.btn-bot:active { transform: scale(0.97); }

.player-chip.is-bot {
  background: linear-gradient(135deg, rgba(120,80,200,0.25), rgba(80,60,180,0.25));
  border: 1px solid rgba(150,120,255,0.4);
}

.bot-clues {
  margin: 16px 0;
  padding: 14px;
  background: rgba(80,60,180,0.15);
  border: 1px solid rgba(150,120,255,0.3);
  border-radius: 12px;
  text-align: right;
}
.bot-clues-title {
  font-weight: 700;
  margin-bottom: 8px;
  color: #b8a8ff;
}
.bot-clue-item {
  padding: 6px 0;
  font-size: 16px;
}
.bot-clue-item .bot-name {
  color: #b8a8ff;
  font-weight: 600;
}

.task-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}
.task-result-row .tr-name { font-weight: 600; font-size: 16px; }
.task-result-row .tr-task { font-size: 13px; color: #aaa; margin-top: 4px; }
.task-result-btns { display: flex; gap: 8px; }
.tr-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 2px solid transparent;
  font-size: 20px;
  cursor: pointer;
  background: rgba(255,255,255,0.06);
  min-width: 50px;
}
.tr-btn.yes.selected { background: rgba(80,220,120,0.25); border-color: #50dc78; }
.tr-btn.no.selected { background: rgba(220,80,80,0.25); border-color: #dc5050; }

.score-badges {
  display: inline-flex;
  gap: 3px;
  margin-right: 6px;
  font-size: 14px;
}
.score-stars {
  display: inline-block;
  margin-right: 4px;
  color: #ffb84d;
  font-size: 14px;
}
