/* ==========================================================================
   Fijate Tools - Juego de sobremesa navideña para un solo móvil
   Tema oscuro por defecto en :root / [data-theme="dark"] y claro en [data-theme="light"]
   ========================================================================== */

:root,
[data-theme="dark"] {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bg-page: #090d16;
  --bg-card: #111827;
  --bg-card-subtle: #182235;
  --bg-input: #0f172a;
  --border-color: #273549;
  --border-focus: #38bdf8;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --primary-color: #38bdf8;
  --primary-light: rgba(56, 189, 248, 0.14);
  --primary-border: rgba(56, 189, 248, 0.35);

  --festive-gold: #f59e0b;
  --festive-gold-bg: rgba(245, 158, 11, 0.14);
  --festive-gold-border: rgba(245, 158, 11, 0.4);
  --festive-gold-text: #fcd34d;

  --festive-crimson: #ef4444;
  --festive-crimson-bg: rgba(239, 68, 68, 0.14);
  --festive-crimson-border: rgba(239, 68, 68, 0.4);
  --festive-crimson-text: #fca5a5;

  --festive-emerald: #10b981;
  --festive-emerald-bg: rgba(16, 185, 129, 0.14);
  --festive-emerald-border: rgba(16, 185, 129, 0.4);
  --festive-emerald-text: #6ee7b7;

  --success: #10b981;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 12px 30px -6px rgba(0, 0, 0, 0.42);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  --bg-input: #ffffff;
  --border-color: #cbd5e1;
  --border-focus: #0284c7;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-color: #0284c7;
  --primary-light: #e0f2fe;
  --primary-border: #7dd3fc;

  --festive-gold: #d97706;
  --festive-gold-bg: #fffbeb;
  --festive-gold-border: #fcd34d;
  --festive-gold-text: #92400e;

  --festive-crimson: #dc2626;
  --festive-crimson-bg: #fef2f2;
  --festive-crimson-border: #fca5a5;
  --festive-crimson-text: #991b1b;

  --festive-emerald: #059669;
  --festive-emerald-bg: #ecfdf5;
  --festive-emerald-border: #6ee7b7;
  --festive-emerald-text: #065f46;

  --success: #059669;
  --shadow-card: 0 6px 20px -4px rgba(15, 23, 42, 0.08);
  color-scheme: light;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.55;
  margin: 0;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

body.sobremesa-fs-lock {
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6,
.brand-title,
.stage-title {
  font-family: var(--font-heading);
}

.mono,
code {
  font-family: var(--font-mono);
}

/* Layout principal canónico */
.tool-layout {
  max-width: 1200px;
  width: 100%;
  margin: 1.25rem auto 3rem;
  padding: 0 1rem;
  flex: 1 0 auto;
  box-sizing: border-box;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* ==========================================================================
   TARJETA PRINCIPAL DEL JUEGO (#game-stage-card)
   ========================================================================== */
.card-main {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  width: 100%;
  min-width: 0;
}

.card-main.is-expanded-stage {
  position: fixed;
  inset: 0;
  z-index: 1100;
  border-radius: 0;
  border: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
}

.card-main.is-expanded-stage .game-workspace {
  flex: 1 0 auto;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

/* Barra superior de modos y utilidades */
.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.9rem 1.15rem;
  background: var(--bg-card-subtle);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.mode-tabs-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.3rem;
  flex: 1 1 auto;
  min-width: 0;
}

.mode-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
  min-width: 0;
}

.mode-tab-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .mode-tab-btn:hover {
  background: rgba(15, 23, 42, 0.04);
}

.mode-tab-btn.active {
  background: var(--primary);
  color: #06121e;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

[data-theme="light"] .mode-tab-btn.active {
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.22);
}

.game-utility-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.btn-stage-util {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 44px;
  height: 44px;
  padding: 0 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-stage-util:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-stage-util[aria-pressed="false"]#btn-sound-toggle {
  color: var(--text-subtle);
  opacity: 0.8;
}

/* Espacio de juego */
.game-workspace {
  padding: clamp(1.1rem, 2.5vw, 1.85rem);
  min-width: 0;
}

.mode-intro-banner {
  margin-bottom: 1.35rem;
}

.mode-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.game-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.72rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.pill-crimson {
  background: var(--festive-crimson-bg);
  color: var(--festive-crimson-text);
  border-color: var(--festive-crimson-border);
}

.pill-emerald {
  background: var(--festive-emerald-bg);
  color: var(--festive-emerald-text);
  border-color: var(--festive-emerald-border);
}

.pill-gold {
  background: var(--festive-gold-bg);
  color: var(--festive-gold-text);
  border-color: var(--festive-gold-border);
}

.pill-muted {
  background: var(--bg-input);
  color: var(--text-muted);
  border-color: var(--border-color);
}

.stage-title {
  margin: 0 0 0.35rem 0;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.stage-desc {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-muted);
  max-width: 72ch;
}

/* Rejilla de configuración */
.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.setup-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.setup-card-wide {
  grid-column: 1 / -1;
}

.field-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
}

.field-help {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Stepper táctil */
.stepper-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.3rem;
}

.btn-stepper {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-stepper:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

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

.stepper-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Choice pills */
.choice-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.choice-pill {
  flex: 1 1 auto;
  min-height: 42px;
  padding: 0.45rem 0.75rem;
  border-radius: 9px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: center;
}

.choice-pill:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--text-main);
}

.choice-pill.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

.choice-pill:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Select accesible */
.form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.55rem 40px 0.55rem 0.85rem;
  border-radius: 9px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.form-select option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* Switch toggle */
.toggle-row-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.switch-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--border-color);
  position: relative;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s ease;
}

.switch-label input:checked + .switch-track {
  background: var(--festive-emerald);
}

.switch-label input:checked + .switch-track::after {
  transform: translateX(20px);
}

.switch-text {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.switch-text strong {
  color: var(--text-main);
}

/* Roster de jugadores / equipos */
.players-roster-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.roster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.roster-header h3 {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-link-subtle {
  background: transparent;
  border: none;
  padding: 0.35rem 0.5rem;
  color: var(--primary);
  font-family: var(--font-main);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.players-input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.6rem;
}

.player-input-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  padding: 0.25rem 0.55rem 0.25rem 0.35rem;
  min-width: 0;
}

.player-num-badge {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--primary-light);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.player-name-input,
.team-name-input {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  min-height: 38px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 500;
}

.player-name-input:focus,
.team-name-input:focus {
  outline: none;
}

.player-mini-score {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--festive-gold-text);
  background: var(--festive-gold-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Botones CTA principales */
.stage-cta-bar {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.stage-cta-bar.dual-cta > button {
  flex: 1 1 220px;
}

.btn-cta-primary,
.btn-cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  border: 1px solid transparent;
}

.btn-cta-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px -4px rgba(234, 88, 12, 0.45);
  width: 100%;
  max-width: 420px;
}

.btn-cta-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -4px rgba(234, 88, 12, 0.55);
}

.btn-cta-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-cta-secondary {
  background: var(--bg-input);
  color: var(--text-main);
  border-color: var(--border-color);
  width: 100%;
  max-width: 420px;
}

.btn-cta-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-secondary-pill {
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.btn-secondary-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ==========================================================================
   MODO 1: PANTALLAS DE PASE SECRETO, DEBATE, VOTACIÓN Y RESULTADO
   ========================================================================== */
.pass-phone-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.progress-pill {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.secret-shield-card,
.secret-role-card {
  width: 100%;
  max-width: 540px;
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 18px;
  padding: clamp(1.35rem, 4vw, 2.25rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.secret-role-card.is-impostor {
  border-color: var(--festive-crimson-border);
  background: radial-gradient(circle at top, rgba(239, 68, 68, 0.14), var(--bg-card-subtle) 65%);
}

.secret-role-card.is-crew {
  border-color: var(--festive-emerald-border);
  background: radial-gradient(circle at top, rgba(16, 185, 129, 0.14), var(--bg-card-subtle) 65%);
}

.player-avatar-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pass-instruction {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.pass-player-name {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 800;
  color: var(--text-main);
}

.pass-privacy-note {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 40ch;
}

.role-badge {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.badge-impostor {
  background: var(--festive-crimson-bg);
  color: var(--festive-crimson-text);
  border: 1px solid var(--festive-crimson-border);
}

.badge-crew {
  background: var(--festive-emerald-bg);
  color: var(--festive-emerald-text);
  border: 1px solid var(--festive-emerald-border);
}

.secret-word-caption {
  margin: 0.25rem 0 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.secret-word-display {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.secret-word-display.impostor-word {
  color: var(--festive-crimson-text);
}

.hint-callout {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  color: var(--text-main);
  width: 100%;
}

.role-tip {
  margin: 0 0 0.4rem 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  max-width: 44ch;
}

/* Debate */
.debate-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.starter-banner {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.2rem;
  width: 100%;
  max-width: 620px;
}

.starter-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--festive-gold-text);
  background: var(--festive-gold-bg);
  border: 1px solid var(--festive-gold-border);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.starter-banner h2 {
  margin: 0 0 0.4rem 0;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
}

.highlight-name {
  color: var(--primary);
}

.starter-banner p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.debate-clock-box {
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: 18px;
  padding: 1.35rem 2rem;
  min-width: min(100%, 340px);
}

.big-clock {
  font-size: clamp(2.5rem, 8vw, 3.6rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}

.big-clock.is-urgent,
.tabu-clock-pill.is-urgent,
.mim-timer-badge.is-urgent {
  color: var(--festive-crimson);
  animation: pulseUrgent 0.8s ease-in-out infinite alternate;
}

@keyframes pulseUrgent {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.clock-status-text {
  margin: 0.35rem 0 0.85rem 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.clock-controls-row {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Votación */
.vote-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
}

.vote-stage h2 {
  margin: 0;
  font-size: 1.4rem;
}

.vote-mode-switch {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 520px;
}

.vote-subtitle {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.65rem;
  width: 100%;
  margin-top: 0.25rem;
}

.vote-player-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.9rem 0.6rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.16s ease;
  min-height: 104px;
}

.vote-player-btn:hover {
  border-color: var(--primary);
}

.vote-player-btn.selected {
  border-color: var(--festive-crimson);
  background: var(--festive-crimson-bg);
}

.vote-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-family: var(--font-heading);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vote-name {
  font-weight: 700;
  font-size: 0.92rem;
  word-break: break-word;
}

.vote-check {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.vote-player-btn.selected .vote-check {
  color: var(--festive-crimson-text);
}

/* Resultados y marcador */
.result-stage {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.result-hero {
  text-align: center;
  padding: 1.4rem 1.2rem;
  border-radius: 16px;
  border: 1.5px solid var(--border-color);
}

.result-hero.is-crew-win {
  background: var(--festive-emerald-bg);
  border-color: var(--festive-emerald-border);
}

.result-hero.is-partial-win {
  background: var(--festive-gold-bg);
  border-color: var(--festive-gold-border);
}

.result-hero.is-impostor-win {
  background: var(--festive-crimson-bg);
  border-color: var(--festive-crimson-border);
}

.result-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  opacity: 0.85;
  margin-bottom: 0.3rem;
}

.result-hero h2 {
  margin: 0 0 0.35rem 0;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  color: var(--text-main);
}

.result-hero p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.reveal-facts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.fact-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.fact-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.fact-value {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--text-main);
}

.text-crimson {
  color: var(--festive-crimson-text);
}

.text-emerald {
  color: var(--festive-emerald-text);
}

.tally-box,
.scoreboard-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
}

.tally-box h4,
.scoreboard-box h3 {
  margin: 0 0 0.75rem 0;
  font-size: 0.96rem;
}

.tally-grid,
.scoreboard-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}

.tally-chip,
.scoreboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  padding: 0.55rem 0.75rem;
  font-size: 0.86rem;
}

.sb-rank {
  color: var(--text-subtle);
  font-weight: 700;
}

.sb-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.sb-pts {
  color: var(--festive-gold-text);
  font-weight: 700;
}

/* ==========================================================================
   MODO 2: PALABRAS PROHIBIDAS (ESTILO TABÚ)
   ========================================================================== */
.teams-scoreboard-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.team-score-card {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.team-score-card.is-active-team {
  border-color: var(--primary);
  background: var(--primary-light);
}

.team-name {
  font-weight: 700;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-points {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}

.tabu-playing-stage {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.tabu-hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.tabu-team-pill {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
}

.tabu-delta-pill {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  font-size: 0.86rem;
  font-weight: 700;
}

.tabu-clock-pill {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 800;
}

.timer-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: 999px;
  overflow: hidden;
}

.timer-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--festive-emerald), var(--primary));
  transition: width 0.4s linear;
}

.timer-progress-fill.is-urgent {
  background: var(--festive-crimson);
}

.tabu-card {
  background: var(--bg-card-subtle);
  border: 2px solid var(--border-color);
  border-radius: 18px;
  padding: clamp(1.25rem, 3.5vw, 1.9rem);
  text-align: center;
}

.tabu-theme-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

.tabu-target-word {
  margin: 0 0 1rem 0;
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.15;
}

.tabu-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--festive-crimson-text);
}

.tabu-forbidden-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0.55rem;
}

.tabu-forbidden-list li {
  background: var(--festive-crimson-bg);
  border: 1px solid var(--festive-crimson-border);
  color: var(--festive-crimson-text);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font-weight: 700;
  font-size: 0.96rem;
}

.tabu-action-buttons {
  display: grid;
  grid-template-columns: 1fr 0.9fr 1.3fr;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.btn-tabu-foul,
.btn-tabu-pass,
.btn-tabu-ok {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 76px;
  padding: 0.75rem 0.5rem;
  border-radius: 14px;
  font-family: var(--font-heading);
  font-size: 0.96rem;
  font-weight: 800;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.btn-tabu-foul:active,
.btn-tabu-pass:active,
.btn-tabu-ok:active {
  transform: scale(0.97);
}

.btn-tabu-foul {
  background: var(--festive-crimson-bg);
  border-color: var(--festive-crimson-border);
  color: var(--festive-crimson-text);
}

.btn-tabu-pass {
  background: var(--bg-card-subtle);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-tabu-ok {
  background: var(--festive-emerald);
  color: #ffffff;
  box-shadow: 0 8px 18px -4px rgba(16, 185, 129, 0.45);
}

/* Resumen de turno */
.summary-stage {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.summary-header-box {
  text-align: center;
}

.summary-header-box h2 {
  margin: 0.5rem 0 0.25rem 0;
  font-size: 1.45rem;
}

.summary-header-box p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.empty-log-note {
  text-align: center;
  color: var(--text-muted);
  padding: 1rem;
  background: var(--bg-card-subtle);
  border-radius: 12px;
}

.turn-log-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.turn-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  flex-wrap: wrap;
}

.log-word {
  font-weight: 700;
  font-size: 0.94rem;
}

.log-outcome-switch {
  display: flex;
  gap: 0.35rem;
}

.mini-tag-btn {
  min-width: 44px;
  min-height: 36px;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.mini-tag-btn.tag-ok.active {
  background: var(--festive-emerald-bg);
  border-color: var(--festive-emerald-border);
  color: var(--festive-emerald-text);
}

.mini-tag-btn.tag-pass.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.mini-tag-btn.tag-foul.active {
  background: var(--festive-crimson-bg);
  border-color: var(--festive-crimson-border);
  color: var(--festive-crimson-text);
}

/* ==========================================================================
   MODO 3: MÍMICA Y ¿QUIÉN DE LA MESA...?
   ========================================================================== */
.intensity-cards-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.intensity-option {
  text-align: left;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: all 0.16s ease;
}

.intensity-option strong {
  font-family: var(--font-heading);
  font-size: 0.98rem;
}

.intensity-option span {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.intensity-option.active {
  border-color: var(--festive-gold);
  background: var(--festive-gold-bg);
}

.mimica-top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.mimica-quick-toggles {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.mini-pill-toggle {
  min-height: 36px;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.mini-pill-toggle.active {
  background: var(--festive-gold-bg);
  border-color: var(--festive-gold-border);
  color: var(--festive-gold-text);
}

.mimica-card {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 18px;
  padding: clamp(1.35rem, 4vw, 2.25rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.mimica-prompt-text {
  margin: 0;
  font-size: clamp(1.35rem, 3.6vw, 1.95rem);
  font-weight: 800;
  line-height: 1.28;
  color: var(--text-main);
  max-width: 28ch;
}

.mimica-tip-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 52ch;
}

.mimica-tip-box strong {
  color: var(--text-main);
}

.mimica-timer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.mim-timer-badge {
  font-size: 1.4rem;
  font-weight: 800;
  padding: 0.35rem 0.95rem;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--primary);
}

/* ==========================================================================
   MODALES ACCESIBLES Y TOAST
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1250;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-main);
  border-color: var(--primary);
}

.modal-body {
  padding: 1.15rem 1.25rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  overflow-y: auto;
}

.modal-body h4 {
  margin: 0.9rem 0 0.35rem 0;
  font-size: 0.98rem;
  color: var(--text-main);
}

.modal-body h4:first-child {
  margin-top: 0;
}

.modal-body p {
  margin: 0 0 0.65rem 0;
}

.modal-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.btn-modal-primary,
.btn-modal-cancel {
  min-height: 42px;
  padding: 0.5rem 1.1rem;
  border-radius: 9px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-modal-primary {
  background: var(--primary);
  color: #06121e;
  border: none;
}

[data-theme="light"] .btn-modal-primary {
  color: #ffffff;
}

.btn-modal-cancel {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.toast-banner {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  left: auto;
  max-width: calc(100vw - 2.5rem);
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  z-index: 1300;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-banner.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   ADAPTACIÓN MÓVIL (<= 768px y 375px)
   ========================================================================== */
@media (max-width: 768px) {
  .game-topbar {
    padding: 0.75rem;
    gap: 0.6rem;
  }

  .setup-grid,
  .intensity-cards-row,
  .reveal-facts-grid {
    grid-template-columns: 1fr;
  }

  .mode-tabs-segmented {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mode-tab-btn {
    padding: 0.4rem 0.35rem;
    font-size: 0.78rem;
    line-height: 1.15;
  }

  .mode-tab-btn svg {
    display: none;
  }

  .mode-tab-btn span {
    white-space: normal;
    text-overflow: clip;
  }

  .game-utility-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .tabu-action-buttons {
    grid-template-columns: 1fr 1fr;
  }

  .btn-tabu-ok {
    grid-column: 1 / -1;
    min-height: 68px;
  }
}
