/* ========================================
   CIDADE DORME — Premium Dark Theme
   ======================================== */

:root {
  /* Colors */
  --bg-primary: #070b16;
  --bg-secondary: #0d1225;
  --bg-tertiary: #131a32;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --surface-active: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.15);

  --text-primary: #f0f0f5;
  --text-secondary: rgba(240, 240, 245, 0.65);
  --text-muted: rgba(240, 240, 245, 0.4);

  --accent: #8b5cf6;
  --accent-light: #a78bfa;
  --accent-glow: rgba(139, 92, 246, 0.35);
  --accent-gradient: linear-gradient(135deg, #8b5cf6, #6366f1);

  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --success: #22c55e;
  --success-glow: rgba(34, 197, 94, 0.3);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.3);

  --day-bg: #1a1520;
  --day-accent: #f59e0b;
  --day-warm: #ff8c00;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.6);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ========================================
   RESET & BASE
   ======================================== */

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ========================================
   STARS BACKGROUND
   ======================================== */

#stars-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: white;
  animation: twinkle var(--dur) ease-in-out infinite alternate;
  opacity: 0;
}

@keyframes twinkle {
  0% { opacity: 0.1; transform: scale(0.8); }
  100% { opacity: var(--max-opacity, 0.8); transform: scale(1.2); }
}

/* ========================================
   LAYOUT
   ======================================== */

#app {
  position: relative;
  z-index: 1;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 24px;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.5s ease;
}

.screen.active {
  display: flex;
}

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
  50% { box-shadow: 0 0 40px var(--accent-glow), 0 0 60px rgba(139, 92, 246, 0.15); }
}

/* ========================================
   GLASS CARD
   ======================================== */

.glass-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.15), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--surface-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--surface-active);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 4px 20px var(--danger-glow);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--danger-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--text-primary);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.05rem;
  border-radius: var(--radius);
  width: 100%;
}

.btn-icon-only {
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-primary);
  font-size: 1rem;
}

.btn-icon-only:hover {
  background: var(--surface-hover);
}

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

/* ========================================
   INPUTS
   ======================================== */

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.input-group input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  transition: all 0.25s;
  outline: none;
}

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-group input::placeholder {
  color: var(--text-muted);
}

/* ========================================
   HOME SCREEN
   ======================================== */

.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  max-width: 420px;
  width: 100%;
}

.logo-section {
  text-align: center;
  animation: slideUp 0.8s ease;
}

.moon-icon {
  font-size: 4.5rem;
  margin-bottom: 8px;
  animation: float 4s ease-in-out infinite;
}

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

.game-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.05;
  background: linear-gradient(135deg, #e0d4ff, #8b5cf6, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.game-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 8px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
}

.home-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideUp 0.8s ease 0.15s both;
}

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  animation: slideUp 0.8s ease 0.3s both;
}

/* ========================================
   LOBBY SCREEN
   ======================================== */

.lobby-container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.5s ease;
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.lobby-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.room-code-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.room-code-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
}

.room-code-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--accent-light);
}

.lobby-status {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
}

.lobby-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* ========================================
   PLAYER GRID & CARDS
   ======================================== */

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  width: 100%;
}

.player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
  position: relative;
  animation: scaleIn 0.4s ease backwards;
}

.player-card:hover {
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.player-card.selectable {
  cursor: pointer;
}

.player-card.selectable:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.player-card.selected {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.15);
  box-shadow: 0 0 25px var(--accent-glow);
}

.player-card.taken {
  border-color: var(--danger);
  background: rgba(220, 38, 38, 0.12);
  opacity: 0.7;
  cursor: not-allowed;
}

.player-card .teammate-pick {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.player-card.dead {
  opacity: 0.4;
  filter: grayscale(0.8);
}

.player-card.dead .player-avatar::after {
  content: '💀';
  position: absolute;
  font-size: 1.2rem;
  bottom: -4px;
  right: -4px;
}

.player-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  position: relative;
  text-transform: uppercase;
}

.player-name {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  word-break: break-word;
}

.player-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-host {
  background: var(--warning);
  color: #000;
}

.badge-you {
  background: var(--accent);
  color: white;
}

.kick-btn {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.player-card:hover .kick-btn {
  opacity: 1;
}

.player-card .vote-count {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   ROLE REVEAL SCREEN
   ======================================== */

.role-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 400px;
  width: 100%;
  animation: scaleIn 0.6s ease;
}

.role-title {
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-secondary);
}

.role-card {
  text-align: center;
  padding: 48px 32px;
  animation: glow 3s ease-in-out infinite;
  width: 100%;
}

.role-emoji {
  font-size: 5rem;
  margin-bottom: 16px;
  animation: pulse 2s ease-in-out infinite;
}

.role-name {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.role-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.role-team {
  margin-top: 16px;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-block;
}

.role-team.team-good {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.role-team.team-evil {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.role-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  animation: pulse 2s ease-in-out infinite;
}

/* ========================================
   NIGHT SCREEN
   ======================================== */

.night-container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.night-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 12px;
}

.phase-badge {
  padding: 8px 20px;
  border-radius: 24px;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.night-badge {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.day-badge {
  background: rgba(245, 158, 11, 0.15);
  color: var(--day-accent);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.vote-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.timer-display {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 60px;
  text-align: center;
}

.timer-display.timer-warning {
  color: var(--warning);
  animation: pulse 0.8s ease-in-out infinite;
}

.timer-display.timer-danger {
  color: var(--danger);
  animation: pulse 0.5s ease-in-out infinite;
}

.night-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px;
}

.sleeping-animation {
  display: flex;
  gap: 8px;
  font-size: 3rem;
  color: var(--accent-light);
}

.zzz {
  animation: zFloat 2s ease-in-out infinite;
  opacity: 0.6;
}

.zzz:nth-child(1) { animation-delay: 0s; font-size: 2rem; }
.zzz:nth-child(2) { animation-delay: 0.3s; font-size: 2.5rem; }
.zzz:nth-child(3) { animation-delay: 0.6s; font-size: 3rem; }

@keyframes zFloat {
  0%, 100% { transform: translateY(0) rotate(-5deg); opacity: 0.3; }
  50% { transform: translateY(-20px) rotate(5deg); opacity: 0.8; }
}

.sleeping-text {
  font-size: 1.4rem;
  color: var(--text-secondary);
  font-style: italic;
}

.night-action-area {
  width: 100%;
  text-align: center;
  animation: slideUp 0.5s ease;
}

.night-action-area h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.night-action-area p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.night-result {
  margin-top: 20px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 1.2rem;
  font-weight: 600;
  animation: scaleIn 0.4s ease;
}

/* ========================================
   DAY SCREENS
   ======================================== */

.day-theme {
  background: radial-gradient(ellipse at top, rgba(245, 158, 11, 0.08) 0%, transparent 60%);
}

.day-container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 12px;
}

.day-reveal-content {
  text-align: center;
  padding: 48px 24px;
  animation: slideUp 0.8s ease;
}

.day-reveal-content .death-icon {
  font-size: 5rem;
  margin-bottom: 16px;
}

.day-reveal-content .death-name {
  font-size: 2rem;
  font-weight: 800;
  color: var(--danger);
  margin-bottom: 8px;
}

.day-reveal-content .death-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.day-reveal-content .safe-icon {
  font-size: 5rem;
  margin-bottom: 16px;
}

.day-reveal-content .safe-text {
  font-size: 1.4rem;
  color: var(--success);
  font-weight: 700;
}

.discuss-hint, .vote-hint {
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-align: center;
}

.vote-info {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  min-height: 40px;
}

.vote-result-content {
  text-align: center;
  padding: 48px 24px;
  animation: slideUp 0.6s ease;
}

/* ========================================
   GAME OVER SCREEN
   ======================================== */

.gameover-container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: fadeIn 0.8s ease;
}

.gameover-banner {
  font-size: 6rem;
  animation: pulse 2s ease-in-out infinite;
}

.gameover-container h2 {
  font-size: 1.4rem;
  text-align: center;
  color: var(--text-secondary);
  max-width: 500px;
}

.reveal-grid .player-card {
  cursor: default;
}

.reveal-grid .player-card .role-reveal {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.reveal-grid .player-card .role-reveal-emoji {
  font-size: 1.5rem;
  margin-top: 4px;
}

/* ========================================
   TOAST
   ======================================== */

#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 14px 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.4s ease, toastOut 0.4s ease 3s forwards;
  pointer-events: auto;
  max-width: 340px;
  backdrop-filter: blur(12px);
}

.toast.toast-error {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.toast.toast-success {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(60px); }
}

/* ========================================
   DAY/NIGHT BODY THEME TRANSITION
   ======================================== */

body {
  transition: background 1.2s ease;
}

body.phase-night {
  background: var(--bg-primary);
}

body.phase-day {
  background: #15121e;
}

body.phase-day #stars-container {
  opacity: 0.12;
  transition: opacity 1.2s ease;
}

body.phase-night #stars-container {
  opacity: 1;
  transition: opacity 1.2s ease;
}

/* ========================================
   VOTE LOG
   ======================================== */

.vote-log {
  width: 100%;
  max-height: 180px;
  overflow-y: auto;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vote-log:empty {
  display: none;
}

.vote-log-entry {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  animation: fadeIn 0.3s ease;
}

.vote-log-entry:last-child {
  border-bottom: none;
}

.vote-log-entry .voter-name {
  color: var(--text-primary);
  font-weight: 600;
}

.vote-log-entry .vote-arrow {
  color: var(--text-muted);
  margin: 0 6px;
}

.vote-log-entry .target-name {
  color: var(--accent-light);
  font-weight: 600;
}

/* ========================================
   SKIP BUTTON (night)
   ======================================== */

.btn-skip-night {
  margin-top: 16px;
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border-light);
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.25s;
}

.btn-skip-night:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background: var(--surface);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 600px) {
  .screen { padding: 16px; }
  .game-title { font-size: 2.6rem; }
  .glass-card { padding: 24px 20px; }
  .player-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .player-card { padding: 12px 8px; }
  .lobby-header { flex-direction: column; align-items: flex-start; }
  .room-code-value { font-size: 1.1rem; }
  .night-status { padding: 32px 16px; }
  .timer-display { font-size: 1.4rem; }
}

/* ========================================
   ROLE HUD (canto fixo)
   ======================================== */

#role-hud {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}

.role-hud-pill {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  cursor: pointer;
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  z-index: 1;
}

#role-hud:hover .role-hud-pill {
  transform: scale(1.12);
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(139, 92, 246, 0.4), 0 0 0 1px rgba(255,255,255,0.08);
}

.role-hud-card {
  position: absolute;
  bottom: 60px;
  right: 0;
  width: 230px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px 16px 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.04);
  backdrop-filter: blur(24px);
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-align: center;
}

#role-hud:hover .role-hud-card {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.role-hud-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.role-hud-card-emoji {
  font-size: 2.6rem;
  margin-bottom: 6px;
  line-height: 1;
}

.role-hud-card-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.role-hud-card-team {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-hud-card-team.team-evil {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.role-hud-card-team.team-good {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.role-hud-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 2px;
}

/* Estado morto */
#role-hud.hud-dead .role-hud-pill {
  border-color: rgba(239, 68, 68, 0.4);
  opacity: 0.55;
  filter: grayscale(0.6);
}

/* ========================================
   ACTION RESULT BANNER
   ======================================== */

#action-banner {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  cursor: pointer;
  animation: fadeIn 0.25s ease;
}

.action-banner-content {
  text-align: center;
  max-width: 440px;
  width: 90%;
  padding: 44px 32px 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
  cursor: default;
  animation: bannerPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

@keyframes bannerPop {
  from { opacity: 0; transform: scale(0.8) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.action-banner-content::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.06;
  pointer-events: none;
  border-radius: 24px;
}

/* Tipos de banner */
#action-banner.banner-evil .action-banner-content {
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 32px 80px rgba(239, 68, 68, 0.25), 0 0 0 1px rgba(239,68,68,0.1);
}
#action-banner.banner-evil .action-banner-content::before {
  background: var(--danger);
}
#action-banner.banner-evil .action-banner-title { color: var(--danger); }

#action-banner.banner-good .action-banner-content {
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 32px 80px rgba(34, 197, 94, 0.2), 0 0 0 1px rgba(34,197,94,0.08);
}
#action-banner.banner-good .action-banner-content::before {
  background: var(--success);
}
#action-banner.banner-good .action-banner-title { color: var(--success); }

#action-banner.banner-role .action-banner-content {
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 32px 80px rgba(139, 92, 246, 0.25), 0 0 0 1px rgba(139,92,246,0.1);
}
#action-banner.banner-role .action-banner-content::before {
  background: var(--accent);
}
#action-banner.banner-role .action-banner-title { color: var(--accent-light); }

.action-banner-icon {
  font-size: 4.5rem;
  margin-bottom: 16px;
  animation: pulse 1.4s ease-in-out infinite;
  line-height: 1;
}

.action-banner-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.action-banner-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.action-banner-dismiss-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
}

.action-banner-progress {
  height: 3px;
  background: var(--surface-active);
  border-radius: 2px;
  overflow: hidden;
}

.action-banner-bar {
  height: 100%;
  width: 100%;
  border-radius: 2px;
  background: var(--border-light);
  transform-origin: left;
  animation: shrink linear forwards;
}

@keyframes shrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ========================================
   SETTINGS MODAL
   ======================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.25s ease;
}

.modal-content {
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 4px;
}

.modal-footer .btn {
  width: auto;
  padding: 10px 24px;
}

/* Toggle switch */
.settings-mode-toggle {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toggle-label-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.switch input { display: none; }

.slider {
  position: absolute;
  inset: 0;
  background: var(--surface-active);
  border-radius: 26px;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.25s;
}

.slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border-radius: 50%;
  transition: transform 0.25s;
}

.switch input:checked + .slider {
  background: var(--accent);
  border-color: var(--accent);
}

.switch input:checked + .slider::before {
  transform: translateY(-50%) translateX(20px);
}

.settings-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Role rows */
.settings-roles {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

.settings-role-row.row-active {
  border-color: var(--border-light);
}

.settings-role-row.evil-row {
  border-left: 3px solid rgba(239, 68, 68, 0.5);
}

.settings-role-row.good-row {
  border-left: 3px solid rgba(34, 197, 94, 0.25);
}

.role-info-sm {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.role-emoji-sm { font-size: 1.3rem; }

.role-name-sm {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.role-team-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-team-tag.evil {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.role-team-tag.good {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.role-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.switch-sm {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.switch-sm input { display: none; }

.slider-sm {
  position: absolute;
  inset: 0;
  background: var(--surface-active);
  border-radius: 22px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.25s;
}

.slider-sm::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border-radius: 50%;
  transition: transform 0.25s;
}

.switch-sm input:checked + .slider-sm {
  background: var(--accent);
  border-color: var(--accent);
}

.switch-sm input:checked + .slider-sm::before {
  transform: translateY(-50%) translateX(16px);
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quantity-control.qty-disabled {
  opacity: 0.3;
  pointer-events: none;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: var(--surface-hover);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: var(--font);
}

.qty-btn:hover {
  background: var(--surface-active);
  border-color: var(--accent);
}

.qty-value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
  color: var(--accent-light);
}

/* Lobby settings mode label */
.lobby-settings-mode {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* ========================================
   SCROLLBAR
   ======================================== */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-active); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

