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

:root {
  --primary: #6c5ce7;
  --primary-dark: #5a4bd1;
  --secondary: #a29bfe;
  --success: #00b894;
  --danger: #e17055;
  --warning: #fdcb6e;
  --bg: #0a0a1a;
  --bg-card: #1a1a2e;
  --bg-input: #16213e;
  --text: #ffffff;
  --text-muted: #a0a0b8;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow: hidden;
}

#app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
}

/* Screens */
.screen {
  display: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
}

.screen.active {
  display: flex;
}

.screen-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 24px;
  min-height: 100dvh;
}

/* Home Screen */
.title {
  font-size: 3.5rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--primary), var(--secondary), var(--warning));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  text-align: center;
}

/* Buttons */
.btn {
  border: none;
  border-radius: var(--radius);
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.96);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-large {
  width: 100%;
  padding: 16px 32px;
  font-size: 1.15rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 2px solid var(--secondary);
}

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

.btn-topic,
.btn-timer {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 2px solid transparent;
}

.btn-topic.active,
.btn-timer.active {
  border-color: var(--primary);
  color: var(--text);
  background: var(--bg-input);
}

/* Setup Screen */
#screen-setup .screen-content {
  justify-content: flex-start;
  padding-top: 48px;
}

#screen-setup h2 {
  font-size: 1.8rem;
}

.section {
  width: 100%;
}

.section label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.player-input-row input {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 2px solid var(--bg-card);
  background: var(--bg-input);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.player-input-row input:focus {
  border-color: var(--primary);
}

.player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  min-height: 0;
}

.player-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--secondary);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.9rem;
}

.player-tag .remove-player {
  cursor: pointer;
  color: var(--danger);
  font-weight: bold;
  font-size: 1.1rem;
  line-height: 1;
}

.topic-options,
.timer-options {
  display: flex;
  gap: 8px;
}

.timer-options .btn {
  flex: 1;
}

/* Ready Screen */
.turn-info {
  text-align: center;
  width: 100%;
}

.round-label {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.current-player {
  margin: 16px 0;
}

.current-player p {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.current-player h3 {
  font-size: 2.5rem;
  color: var(--warning);
}

.instruction {
  color: var(--danger);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Acting Screen */
.acting-warning {
  color: var(--danger);
  font-weight: 600;
  font-size: 0.9rem;
}

.movie-card {
  width: 100%;
  background: var(--bg-card);
  border: 2px solid var(--secondary);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
}

.movie-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.movie-title {
  font-size: 2rem;
  color: var(--warning);
  line-height: 1.3;
}

.acting-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Timer Screen */
.timer-display {
  display: flex;
  justify-content: center;
  padding: 16px 0;
}

.timer-circle {
  position: relative;
  width: 180px;
  height: 180px;
}

.timer-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: var(--bg-card);
  stroke-width: 8;
}

.timer-ring {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.timer-ring.warning {
  stroke: var(--warning);
}

.timer-ring.danger {
  stroke: var(--danger);
}

.timer-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
}

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

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

.guess-prompt {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Reveal Screen */
.reveal-result {
  text-align: center;
}

.reveal-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 8px;
}

#reveal-status {
  font-size: 1.4rem;
  font-weight: 700;
}

.reveal-result.success #reveal-status {
  color: var(--success);
}

.reveal-result.fail #reveal-status {
  color: var(--danger);
}

/* Scoreboard */
.scoreboard {
  width: 100%;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
}

.scoreboard h3 {
  text-align: center;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-input);
}

.score-row.current {
  border: 1px solid var(--primary);
}

.score-name {
  font-weight: 600;
}

.score-value {
  font-weight: 700;
  color: var(--warning);
  font-size: 1.2rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen.active .screen-content {
  animation: fadeIn 0.3s ease-out;
}

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

.timer-text.danger {
  animation: pulse 0.5s ease-in-out infinite;
}
