* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark: #1a1a2e;
  --bg-card: #16213e;
  --bg-input: #0f3460;
  --accent: #e94560;
  --accent-hover: #ff6b6b;
  --text: #eaeaea;
  --text-muted: #a0a0b0;
  --success: #2ecc71;
  --warning: #f39c12;
  --night: #0d1b2a;
  --day: #2c3e50;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

.screen {
  display: none;
  padding: 20px;
  min-height: 100vh;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Logo */
.logo {
  text-align: center;
  padding: 40px 0 30px;
}

.logo-emoji {
  font-size: 64px;
  display: block;
  margin-bottom: 10px;
}

.logo h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 5px;
}

.subtitle {
  color: var(--accent);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Forms */
.form-group {
  margin-bottom: 15px;
}

input[type="text"] {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--bg-input);
  border-radius: 12px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  border-color: var(--accent);
}

input[type="text"]::placeholder {
  color: var(--text-muted);
}

/* Buttons */
.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 10px;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
}

.btn-secondary:hover {
  background: #1a4a80;
}

.btn-small {
  padding: 10px 16px;
  font-size: 14px;
  width: auto;
  display: inline-block;
  margin: 4px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-group {
  margin-top: 10px;
}

.hidden {
  display: none !important;
}

/* Lobby */
.lobby-header {
  text-align: center;
  padding: 20px 0;
}

.lobby-header h2 {
  font-size: 22px;
  margin-bottom: 10px;
}

.lobby-code {
  background: var(--bg-input);
  padding: 10px 20px;
  border-radius: 10px;
  display: inline-block;
  font-size: 18px;
}

.lobby-code span {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 3px;
}

.player-list {
  flex: 1;
  margin: 20px 0;
}

.player-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: 10px;
  margin-bottom: 8px;
}

.player-item .player-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 18px;
}

.player-item .player-name {
  flex: 1;
  font-weight: 500;
}

.player-item .host-badge {
  background: var(--accent);
  color: white;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.info-text {
  text-align: center;
  color: var(--text-muted);
  padding: 10px;
}

/* Game */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--bg-input);
  margin-bottom: 15px;
}

.phase-indicator {
  font-size: 16px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--night);
}

.phase-indicator.day {
  background: var(--day);
}

.role-badge {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
}

.game-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

.game-actions {
  padding: 15px 0;
}

/* Vote cards */
.vote-card {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.vote-card:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.vote-card.selected {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.15);
}

.vote-card.dead {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

.vote-card .vote-emoji {
  font-size: 24px;
  margin-right: 12px;
}

.vote-card .vote-name {
  flex: 1;
  font-weight: 500;
}

.vote-card .vote-count {
  background: var(--accent);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

/* Messages */
.game-message {
  text-align: center;
  padding: 20px;
  margin: 10px 0;
  border-radius: 12px;
  background: var(--bg-card);
}

.game-message.death {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.game-message.info {
  background: rgba(52, 152, 219, 0.15);
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.game-message.success {
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.game-message.love {
  background: rgba(233, 30, 99, 0.15);
  border: 1px solid rgba(233, 30, 99, 0.3);
}

.game-message h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.game-message p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Role reveal */
.role-reveal {
  text-align: center;
  padding: 30px 20px;
}

.role-reveal .role-emoji {
  font-size: 64px;
  margin-bottom: 15px;
}

.role-reveal .role-name {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
}

.role-reveal .role-desc {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Game Over */
#screen-gameover {
  justify-content: center;
  align-items: center;
  text-align: center;
}

#gameover-content {
  margin-bottom: 30px;
}

.gameover-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
}

.gameover-players {
  text-align: left;
  max-width: 300px;
  margin: 0 auto;
}

.gameover-player {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: var(--bg-card);
  font-size: 14px;
}

.gameover-player.dead {
  opacity: 0.5;
}

.gameover-player .gp-emoji {
  margin-right: 8px;
}

.gameover-player .gp-name {
  flex: 1;
}

.gameover-player .gp-role {
  color: var(--text-muted);
  font-size: 12px;
}

/* Timer */
.timer {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin: 10px 0;
  padding: 8px;
  border-radius: 12px;
  background: var(--bg-card);
  transition: all 0.3s;
}

.timer.urgent {
  color: var(--accent);
  background: rgba(233, 69, 96, 0.15);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Warning text */
.warning-text {
  color: var(--warning);
  font-weight: 600;
  margin-top: 8px;
}

/* Toast */
#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: 90%;
  max-width: 380px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--bg-input);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
  animation: slideDown 0.3s ease;
  font-size: 14px;
}

.toast.error {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.15);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sorciere potions */
.potion-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-potion {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-potion.life {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
  border: 1px solid #2ecc71;
}

.btn-potion.death {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  border: 1px solid #e74c3c;
}

.btn-potion.skip {
  background: rgba(160, 160, 176, 0.2);
  color: var(--text-muted);
  border: 1px solid var(--text-muted);
}

.btn-potion:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Responsive */
@media (max-height: 600px) {
  .logo { padding: 20px 0 15px; }
  .logo-emoji { font-size: 48px; }
  .logo h1 { font-size: 22px; }
}
