/* El Infiltrado v6.01 — App Styles */
:root {
  --ink: #0f0f14;
  --ink-soft: #3a3a4a;
  --ink-muted: #7a7a9a;
  --page: #f7f5f0;
  --warm: #edeae2;
  --accent: #e8341c;
  --accent-pale: #fdf0ee;
  --accent-dark: #a8220f;
  --blue: #1a4fa8;
  --blue-pale: #eef2fc;
  --gold: #c49a0a;
  --gold-pale: #fdf8e8;
  --green: #1a7a4a;
  --green-pale: #eaf5ef;
  --green-dark: #0d3320;
  --purple: #6d28d9;
  --purple-pale: #f5f3ff;
  --border: rgba(15, 15, 20, 0.12);
  --dark: #1e1e30;
  --dark2: #252538;
  --dark3: #13132a;
  --red-dark: #2e1210;

  --radius: 12px;
  --radius-sm: 8px;
  --transition: 220ms ease;
}

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

html,
body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--dark);
  color: var(--page);
  font-size: 16px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* iOS Safari fix: height:100% puede incluir el área detrás de la barra de URL,
   haciendo que el contenido quede oculto. -webkit-fill-available usa solo el
   espacio visible real, evitando que los elementos fixed solapen el contenido. */
html {
  height: -webkit-fill-available;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* ── SCREEN SYSTEM ─────────────────────────────────────── */
.screen {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  /* Ocultar barra de scroll vertical manteniendo el comportamiento del scroll */
  scrollbar-width: none; /* Firefox */
}

.screen::-webkit-scrollbar {
  width: 0;
  height: 0;
  background: transparent; /* Chrome, Safari, Edge */
}

.screen.active {
  display: flex;
  opacity: 1;
}

/* Screen transition fade */
.screen.fade-out {
  opacity: 0;
}

/* ── TYPOGRAPHY ────────────────────────────────────────── */
.bebas {
  font-family: 'Bebas Neue', 'Arial Black', sans-serif;
  letter-spacing: 0.04em;
}

.mono {
  font-family: 'DM Mono', 'Courier New', monospace;
  letter-spacing: 0.05em;
}

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.875rem 1.5rem;
  cursor: pointer;
  transition: transform var(--transition), opacity var(--transition), box-shadow var(--transition);
  width: 100%;
  line-height: 1;
  -webkit-appearance: none;
  position: relative;
  overflow: hidden;
}

/* Ripple effect for buttons */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: rippleEffect 0.6s ease-out;
  pointer-events: none;
}

@keyframes rippleEffect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

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

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

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

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

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

.btn-green:hover:not(:disabled) {
  background: #155e38;
}

.btn-outline {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-ghost:hover:not(:disabled) {
  color: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
}

/* ── INPUTS ─────────────────────────────────────────────── */
.input {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 1rem;
  padding: 0.875rem 1rem;
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
}

.input:focus {
  border-color: var(--accent);
}

.input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.input-code {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 1.8rem;
  text-align: center;
  font-weight: 700;
}

/* ── LABEL ──────────────────────────────────────────────── */
.label {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.4rem;
  display: block;
}

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--dark2);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

/* ── TAGS / PILLS ───────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.tag-red {
  background: rgba(232, 52, 28, 0.2);
  color: #ff8070;
  border: 1px solid rgba(232, 52, 28, 0.3);
}

.tag-green {
  background: rgba(26, 122, 74, 0.2);
  color: #4ade80;
  border: 1px solid rgba(26, 122, 74, 0.3);
}

.tag-blue {
  background: rgba(26, 79, 168, 0.2);
  color: #7eb8f7;
  border: 1px solid rgba(26, 79, 168, 0.3);
}

.tag-gold {
  background: rgba(196, 154, 10, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(196, 154, 10, 0.3);
}

/* ── TIMER BAR ──────────────────────────────────────────── */
.timer-bar-wrap {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.timer-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 1s linear, background-color 0.5s;
}

.timer-bar.green {
  background: var(--green);
}

.timer-bar.gold {
  background: var(--gold);
}

.timer-number {
  font-size: 1.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: white;
  /* Asegurar que el timer no se solape visualmente con elementos fixed */
  flex-shrink: 0;
}

.timer-number.urgent {
  color: var(--accent);
}

/* Timer pressure pulse - last 5 seconds */
.timer-number.pulse-pressure {
  animation: timerPressurePulse 0.5s ease-in-out infinite;
}

@keyframes timerPressurePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

/* Screen shake for pressure */
.screen.timer-pressure-shake {
  animation: screenPressureShake 0.3s ease-in-out;
}

@keyframes screenPressureShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ── DIVIDER ────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 1rem 0;
}

/* ── TOAST ──────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  pointer-events: none;
  width: 90%;
  max-width: 420px;
}

.toast {
  background: var(--dark2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.25s ease forwards;
  text-align: center;
  max-width: 100%;
}

.toast.success {
  background: #0d2e1a;
  border-color: rgba(26, 122, 74, 0.4);
  color: #4ade80;
}

.toast.error {
  background: #2e1510;
  border-color: rgba(232, 52, 28, 0.4);
  color: #ff8070;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ══════════════════════════════════════════════════════════
   SCREENS
══════════════════════════════════════════════════════════ */

/* ── SCREEN: HOME ───────────────────────────────────────── */
#screen-home {
  align-items: center;
  padding: 2rem 1.5rem;
  background: var(--dark);
  gap: 2rem;
}

/* Centrado vertical que no clipa en overflow: las auto-margins colapsan a 0
   cuando el contenido excede el alto del container, permitiendo scroll. */
#screen-home > .home-logo {
  margin-top: auto;
}

#screen-home > .home-pills {
  margin-bottom: auto;
}

.home-logo {
  text-align: center;
  width: 100%;
}

.home-logo .eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.home-logo h1 {
  font-size: clamp(2.5rem, 12vw, 4.5rem);
  line-height: 1;
  color: white;
  white-space: nowrap;
}

.home-logo .sub {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.5rem;
  letter-spacing: 0.15em;
}

/* Viewport corto (desktop con chrome + OS bars): compactar para evitar overflow */
@media (max-height: 760px) {
  #screen-home {
    padding: 1rem 1.5rem;
    gap: 1rem;
  }
}

.home-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.home-or {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.home-pill {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 3px 10px;
}

.home-pill-btn {
  background: none;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(232, 52, 28, 0.35);
  transition: all 0.15s ease;
}

.home-pill-btn:hover,
.home-pill-btn:focus {
  color: var(--page);
  border-color: var(--accent);
  background: rgba(232, 52, 28, 0.1);
  outline: none;
}

.home-pill-icon {
  font-size: 0.9rem;
  line-height: 1;
  color: var(--accent);
}

/* ── RULES SCREEN ────────────────────────────────────────
   Las reglas son una screen del SPA (no un modal) para evitar el
   clipping del chrome de iOS Safari. El sistema `.screen` ya usa el
   alto correcto vía `html { height: -webkit-fill-available }`. */
#screen-rules {
  padding: 0;
  gap: 0;
  background: var(--dark);
}

.rules-screen-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--dark2);
}

.rules-screen-back {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.rules-screen-back:hover,
.rules-screen-back:focus {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  outline: none;
}

.rules-screen-header-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rules-screen-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.rules-screen-title {
  font-size: 1.8rem;
  color: var(--accent);
  line-height: 1;
  margin-top: 0.2rem;
}

.rules-screen-body {
  padding: 1rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rules-pitch {
  background: linear-gradient(135deg, rgba(232, 52, 28, 0.18), rgba(232, 52, 28, 0.06));
  border: 1px solid rgba(232, 52, 28, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--page);
}

.rules-pitch strong {
  color: var(--accent);
}

.rules-objectives {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.rules-obj {
  background: var(--dark3);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.75rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.rules-obj-town {
  border-color: rgba(74, 222, 128, 0.25);
}

.rules-obj-spy {
  border-color: rgba(232, 52, 28, 0.35);
}

.rules-obj-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.rules-obj-role {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.35rem;
  color: rgba(255, 255, 255, 0.5);
}

.rules-obj-town .rules-obj-role {
  color: #4ade80;
}

.rules-obj-spy .rules-obj-role {
  color: var(--accent);
}

.rules-obj-goal {
  font-size: 0.82rem;
  margin-top: 0.35rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.35;
}

.rules-section-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.35rem;
}

.rules-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  counter-reset: step;
}

.rules-steps li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--dark3);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.rules-step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rules-step-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--page);
}

.rules-step-desc {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
  margin-top: 0.15rem;
}

.rules-step-desc strong {
  color: var(--accent);
}

.rules-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rules-option {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--dark3);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.rules-option-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.rules-option-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--page);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rules-option-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  background: rgba(232, 52, 28, 0.18);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 400;
}

.rules-option-desc {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
  margin-top: 0.2rem;
}

.rules-infcount {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.rules-infcount-row {
  display: grid;
  grid-template-columns: 50px 20px 1fr;
  align-items: center;
  gap: 0.6rem;
  background: var(--dark3);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.rules-infcount-row-accent {
  border-color: rgba(232, 52, 28, 0.4);
  background: linear-gradient(90deg, rgba(232, 52, 28, 0.12), var(--dark3));
}

.rules-infcount-players {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  color: var(--page);
  text-align: center;
  line-height: 1;
}

.rules-infcount-arrow {
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
}

.rules-infcount-result {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

.rules-infcount-row-accent .rules-infcount-result strong {
  color: var(--accent);
}

.rules-scores {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.rules-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--dark3);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  border-left: 3px solid transparent;
}

.rules-score-pos {
  border-left-color: #4ade80;
}

.rules-score-neg {
  border-left-color: var(--accent);
}

.rules-score-name {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

.rules-score-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.rules-score-pos .rules-score-val {
  color: #4ade80;
}

.rules-score-neg .rules-score-val {
  color: var(--accent);
}

.rules-scores-note {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.45;
  padding: 0 0.25rem;
}

.rules-tips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.rules-tips li {
  background: var(--dark3);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.rules-tips li strong {
  color: var(--page);
}

.rules-screen-cta {
  margin-top: 0.5rem;
}

@media (max-width: 480px) {
  .rules-screen-title {
    font-size: 1.6rem;
  }

  .rules-objectives {
    grid-template-columns: 1fr;
  }
}

/* ── SCREEN: JOIN ───────────────────────────────────────── */
#screen-join {
  padding: 2rem 1.5rem;
  gap: 1.5rem;
  justify-content: center;
}

.join-back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.join-back:hover {
  color: white;
}

/* ── SCREEN: LOBBY ──────────────────────────────────────── */
#screen-lobby {
  padding: 1.5rem;
  gap: 1rem;
}

.lobby-code-wrap {
  text-align: center;
  background: var(--dark2);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.lobby-code {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  color: var(--accent);
  line-height: 1;
}

.lobby-code-hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 0.4rem;
  letter-spacing: 0.08em;
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--dark2);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color var(--transition);
  position: relative;
}

.player-item.disconnected {
  opacity: 0.45;
}

.kick-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  margin-left: auto;
}

.kick-btn:hover {
  color: var(--accent);
  background: rgba(232, 52, 28, 0.1);
}

.player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  font-weight: 700;
  color: white;
}

.player-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}

.player-score {
  font-size: 1.2rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  min-width: 2rem;
  text-align: right;
}

.host-badge {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  border: 1px solid rgba(196, 154, 10, 0.4);
  border-radius: 3px;
  padding: 1px 6px;
}

/* ── PAUSE NOTICE ───────────────────────────────────────── */
.pause-notice {
  background: rgba(26, 79, 168, 0.15);
  border: 1px solid rgba(26, 79, 168, 0.3);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
  margin-bottom: 1rem;
  animation: pausePulse 3s ease-in-out infinite;
}

@keyframes pausePulse {

  0%,
  100% {
    background: rgba(26, 79, 168, 0.15);
  }

  50% {
    background: rgba(26, 79, 168, 0.25);
  }
}

.pause-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  animation: pauseBounce 2s ease-in-out infinite;
}

@keyframes pauseBounce {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.pause-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  color: var(--blue);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.pause-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

.pause-disconnected {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── SCREEN: CATEGORY VOTE ──────────────────────────────── */
#screen-catVote {
  padding: 1.5rem;
  gap: 1.25rem;
  /* Padding superior para evitar solapamiento con room-code-chip y scoreboard */
  padding-top: 3.5rem;
}

.phase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  /* Ajuste: evitar solapamiento con scoreboard-btn (fixed top-right) */
  padding-right: 0;
}

/* En mobile, mover el timer abajo del label para no competir con scoreboard */
@media (max-width: 480px) {
  .phase-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .timer-number {
    align-self: flex-end;
  }
}

.phase-label {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.cat-vote-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.cat-option {
  background: var(--dark2);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  min-height: 72px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform 0.15s ease;
  text-align: left;
  touch-action: manipulation;
}

.cat-option:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.cat-option.selected {
  border-color: var(--accent);
  background: rgba(232, 52, 28, 0.08);
}

.cat-option.winner {
  border-color: var(--green);
  background: rgba(26, 122, 74, 0.08);
}

.cat-option-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
}

.cat-option-type {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
}

.cat-option-type.normal {
  color: var(--blue);
}

.cat-option-type.gracioso {
  color: var(--accent);
}

.vote-progress {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

/* ── SCREEN: ROLE REVEAL ────────────────────────────────── */
#screen-roleReveal {
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  gap: 2rem;
  /* Padding superior para evitar solapamiento con elementos fixed */
  padding-top: 4rem;
}

.role-reveal-card {
  width: 100%;
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
}

.role-reveal-card.iniciado {
  background: var(--green-dark);
  border: 2px solid rgba(26, 122, 74, 0.4);
}

.role-reveal-card.infiltrado {
  background: var(--red-dark);
  border: 2px solid rgba(232, 52, 28, 0.4);
}

.role-reveal-card.spectator {
  background: rgba(100, 100, 100, 0.15);
  border: 2px solid rgba(150, 150, 150, 0.3);
}

.role-reveal-tag {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.iniciado .role-reveal-tag {
  color: #4ade80;
}

.infiltrado .role-reveal-tag {
  color: var(--accent);
}

.role-reveal-name {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 1rem;
}

.iniciado .role-reveal-name {
  color: white;
}

.infiltrado .role-reveal-name {
  color: var(--accent);
}

.role-reveal-word {
  font-size: 3.5rem;
  font-weight: 900;
  color: white;
  line-height: 1;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  letter-spacing: 0.05em;
}

.role-reveal-hint {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
}

.role-reveal-cat {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

/* ── SCREEN: WORD TURNS ─────────────────────────────────── */
#screen-wordTurns {
  padding: 1.25rem;
  gap: 1rem;
  /* Padding superior aumentado para evitar solapamiento con room-code-chip y scoreboard-btn */
  padding-top: 4.5rem;
  /* Scroll en toda la pantalla — permitir que todo el contenido sea desplazable */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.word-turn-role-bar {
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  gap: 0.75rem;
  /* Margen superior explícito para garantizar separación de los pills fijos */
  margin-top: 8px;
}

.word-turn-role-bar.iniciado {
  background: rgba(26, 122, 74, 0.2);
  border: 1px solid rgba(26, 122, 74, 0.3);
}

.word-turn-role-bar.infiltrado {
  background: rgba(232, 52, 28, 0.15);
  border: 1px solid rgba(232, 52, 28, 0.3);
}

.word-turn-role-bar.spectator {
  background: rgba(100, 100, 100, 0.12);
  border: 1px solid rgba(150, 150, 150, 0.25);
}

.role-bar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.role-bar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.iniciado .role-bar-dot {
  background: var(--green);
}

.infiltrado .role-bar-dot {
  background: var(--accent);
}

.role-bar-label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.role-bar-word {
  font-size: 0.88rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Ajuste: dejar más espacio para el label del rol */
  max-width: 50%;
  flex-shrink: 0;
}

/* Responsive: ajustar font-size y ancho máximo en pantallas pequeñas */
@media (max-width: 360px) {
  .role-bar-word {
    font-size: 0.75rem;
    max-width: 45%;
  }
}

/* Fix para timer en screen-wordTurns — evitar solapamiento con scoreboard en mobile */
#screen-wordTurns>.flex.items-center.justify-between {
  padding-right: 0;
}

@media (max-width: 480px) {
  #screen-wordTurns>.flex.items-center.justify-between {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  #screen-wordTurns>.flex.items-center.justify-between .timer-number {
    align-self: flex-end;
  }
}

.current-player-card {
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.current-player-card.is-me {
  background: var(--dark2);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.current-player-card.is-other {
  background: var(--dark2);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.current-player-label {
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.4rem;
}

.current-player-name {
  font-size: 1.5rem;
  font-weight: 700;
}

.mic-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.mic-btn {
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  transition: transform var(--transition), background var(--transition);
  box-shadow: 0 4px 20px rgba(232, 52, 28, 0.4);
  touch-action: manipulation;
}

.mic-btn:hover {
  transform: scale(1.05);
}

.mic-btn.recording {
  background: #ff2200;
  animation: pulse 1s infinite;
}

.mic-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  cursor: not-allowed;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 4px 20px rgba(232, 52, 28, 0.4);
  }

  50% {
    box-shadow: 0 4px 40px rgba(232, 52, 28, 0.7);
  }
}

.mic-status {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.word-preview {
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  width: 100%;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.text-input-wrap {
  width: 100%;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.text-input-wrap .input {
  flex: 1;
  min-width: 0;
}

/* ── HERO INPUT (escribir la pista — diseño centralizado v6.25) ──
   Reemplaza al micrófono como el método principal de entrada.
   Pensado para ser visualmente prominente, fácil de localizar y
   con un campo grande tipo "este es el lugar donde escribís". */
.text-input-hero {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.75rem 1.25rem;
  background: linear-gradient(180deg, rgba(232, 52, 28, 0.08), rgba(232, 52, 28, 0.02));
  border: 1px solid rgba(232, 52, 28, 0.25);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(232, 52, 28, 0.12);
}

.text-input-hero-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
}

.text-input-hero-row {
  width: 100%;
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.text-input-hero-field {
  flex: 1;
  min-width: 0;
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.02em;
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(232, 52, 28, 0.4);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.text-input-hero-field::placeholder {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.02em;
}

.text-input-hero-field:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(232, 52, 28, 0.18);
}

.text-input-hero-submit {
  width: auto;
  min-width: 64px;
  padding: 0 1.25rem;
  font-size: 1.4rem;
  font-weight: 700;
  flex-shrink: 0;
}

.word-history {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  /* No internal scroll — el screen entero scrollea */
  overflow: visible;
  min-height: 0;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.2s ease;
}

/* Highlight last active word with pulsing border */
.history-item.last-active {
  border: 2px solid var(--accent);
  animation: lastWordPulse 1.5s ease-in-out infinite;
}

@keyframes lastWordPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 52, 28, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(232, 52, 28, 0); }
}

.history-who {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.45);
  min-width: 60px;
  flex-shrink: 0;
}

.history-word {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  flex: 1;
}

.history-audio-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1rem;
  padding: 0.2rem;
  flex-shrink: 0;
}

.history-audio-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

.bet-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.875rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  letter-spacing: 0.05em;
  transition: background var(--transition), transform var(--transition);
}

.bet-btn:hover {
  background: var(--accent-dark);
}

.bet-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
}

.bet-btn:active {
  transform: scale(0.98);
}

.panic-bet-btn {
  background: var(--red-dark);
  border: 2px solid var(--accent);
  color: var(--accent);
  box-shadow: 0 0 15px rgba(232, 52, 28, 0.4);
  animation: panicPulse 2s infinite;
  flex-shrink: 0;
}

#bet-float-btn {
  margin-top: auto;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  position: relative;
}

.panic-bet-btn:hover {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 25px rgba(232, 52, 28, 0.6);
}

@keyframes panicPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(232, 52, 28, 0.4); }
  50% { box-shadow: 0 0 25px rgba(232, 52, 28, 0.8); }
}

@keyframes shake-red {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-4px) rotate(-3deg); }
  40% { transform: translateX(4px) rotate(3deg); }
  60% { transform: translateX(-4px) rotate(-3deg); }
  80% { transform: translateX(4px) rotate(3deg); }
}

.shake-red {
  animation: shake-red 0.3s cubic-bezier(.36,.07,.19,.97) both;
  border-color: var(--accent) !important;
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 10px rgba(232, 52, 28, 0.5) !important;
}

.flash-red-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(232, 52, 28, 0.15);
  pointer-events: none;
  z-index: 99999;
  animation: flashRedFade 0.3s ease-out forwards;
}

@keyframes flashRedFade {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ── SCREEN: REPLY ROUND ────────────────────────────────── */
#screen-replyRound {
  padding: 1.25rem;
  gap: 1rem;
  /* Padding superior para evitar solapamiento con elementos fixed */
  padding-top: 3.5rem;
}

.reply-players {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  overflow-y: auto;
}

.reply-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--dark2);
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255, 255, 255, 0.06);
  cursor: default;
  transition: border-color var(--transition), opacity var(--transition);
}

.reply-player.can-accuse:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.reply-player.accused {
  border-color: var(--accent);
  background: rgba(232, 52, 28, 0.08);
  cursor: default;
}

.reply-player.my-accused {
  border-color: var(--accent);
  background: rgba(232, 52, 28, 0.12);
  cursor: pointer;
}

.reply-player.my-accused:hover {
  background: rgba(232, 52, 28, 0.2);
  border-color: var(--accent);
}

.reply-player.self {
  opacity: 0.5;
  cursor: default;
}

.reply-player:not(.can-accuse):not(.accused):not(.my-accused):not(.self) {
  opacity: 0.45;
  cursor: default;
}

.reply-change-hint {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.25rem;
  font-style: italic;
}

.reply-player-name {
  flex: 1;
  font-weight: 600;
}

.reply-player-word {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.reply-player-action {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.justify-input-wrap {
  background: rgba(232, 52, 28, 0.08);
  border: 1px solid rgba(232, 52, 28, 0.3);
  border-radius: var(--radius);
  padding: 1rem;
  display: none;
}

.justify-input-wrap.visible {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.justify-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: white;
  padding: 0.75rem;
  font-size: 0.95rem;
  width: 100%;
  resize: none;
  outline: none;
}

/* ── SCREEN: VOTING ─────────────────────────────────────── */
#screen-voting {
  padding: 1.25rem;
  gap: 1rem;
  /* Padding superior para evitar solapamiento con elementos fixed */
  padding-top: 3.5rem;
}

/* Puente: resumen de acusaciones antes de votar */
.voting-bridge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
}

.bridge-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 0.5rem;
  display: block;
  text-align: center;
}

.bridge-accusation {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0;
  font-size: 0.82rem;
}

.bridge-who {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.bridge-arrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.bridge-target {
  font-weight: 600;
  color: var(--accent);
}

.voting-players {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  overflow-y: auto;
}

.vote-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  min-height: 64px;
  background: var(--dark2);
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform 0.15s ease;
  touch-action: manipulation;
}

.vote-player:hover:not(.self):not(.voted) {
  border-color: rgba(232, 52, 28, 0.5);
}

.vote-player.voted {
  border-color: var(--accent);
  background: rgba(232, 52, 28, 0.1);
  cursor: default;
}

.vote-player.self {
  opacity: 0.4;
  cursor: default;
}

.vote-player.accused-in-voting {
  border: 2px solid rgba(255, 200, 50, 0.4);
  background: rgba(255, 200, 50, 0.06);
}

.vote-player-name {
  flex: 1;
  font-weight: 600;
}

.vote-accused-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 200, 50, 0.8);
  background: rgba(255, 200, 50, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  white-space: nowrap;
}

.vote-player-count {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 2rem;
  text-align: right;
  display: none;
}

.vote-player.revealing .vote-player-count {
  display: block;
}

.vote-check {
  color: var(--accent);
  font-size: 1.2rem;
}

/* ── VOTING URGENCY WINDOW ───────────────────────────────── */
.voting-urgency {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: rgba(109, 40, 217, 0.15);
  border: 2px solid rgba(109, 40, 217, 0.4);
  border-radius: var(--radius-sm);
  animation: urgencyShake 0.5s ease-in-out infinite;
  margin-bottom: 0.5rem;
}

.voting-urgency.urgency-critical {
  background: rgba(232, 52, 28, 0.2);
  border-color: rgba(232, 52, 28, 0.6);
  animation: urgencyShake 0.25s ease-in-out infinite;
}

.urgency-flash {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  color: var(--purple);
  letter-spacing: 0.1em;
  animation: urgencyFlash 0.6s ease-in-out infinite;
}

.urgency-critical .urgency-flash {
  color: var(--accent);
}

.urgency-timer {
  font-family: 'DM Mono', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  min-width: 2.5rem;
  text-align: center;
}

.urgency-hint {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@keyframes urgencyShake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-3px);
  }

  75% {
    transform: translateX(3px);
  }
}

@keyframes urgencyFlash {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* ── DRAMATIC REVEAL OVERLAY ────────────────────────────── */
.dramatic-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: dramaticFadeIn 0.5s ease;
}

.dramatic-reveal-overlay.hidden {
  display: none;
}

@keyframes dramaticFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.dramatic-reveal-box {
  text-align: center;
  padding: 2rem;
  max-width: 90%;
}

.dramatic-step {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: white;
  letter-spacing: 0.08em;
  animation: dramaticStepIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dramaticStepIn {
  from {
    opacity: 0;
    transform: scale(0.6) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.dramatic-step.reveal-vote {
  font-size: 1.4rem;
  color: rgba(255, 255, 255, 0.7);
}

.dramatic-step.reveal-vote .vote-target {
  display: block;
  font-size: 2.5rem;
  color: var(--accent);
  margin-top: 0.5rem;
}

.dramatic-step.reveal-result {
  font-size: 2.8rem;
  animation: dramaticResult 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dramatic-step.reveal-result.caught {
  color: var(--green);
}

.dramatic-step.reveal-result.survived {
  color: var(--accent);
}

.dramatic-step.reveal-result.tie-nobody {
  color: var(--gold);
}

.dramatic-step.reveal-result.tie-both {
  color: #ff6b6b;
}

@keyframes dramaticResult {
  from {
    opacity: 0;
    transform: scale(0.3);
  }

  50% {
    transform: scale(1.2);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── SCREEN: INFILTRADO BET ─────────────────────────────── */
#screen-infiltradoBet {
  padding: 1.5rem;
  gap: 1.25rem;
  padding-top: 4rem;
}

.infiltrado-bet-status {
  background: rgba(232, 52, 28, 0.08);
  border: 2px solid rgba(232, 52, 28, 0.25);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
}

.bet-status-think {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.bet-status-odds {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.odds-win {
  font-size: 1rem;
  color: #fcd34d;
  background: rgba(252, 211, 77, 0.1);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
}

.odds-lose {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
}

.odds-abstain {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.bet-status-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0;
}

.bet-waiting-icon {
  font-size: 3rem;
  animation: betIconPulse 2s ease-in-out infinite;
}

.bet-waiting-icon.pulse {
  animation: betIconUrgent 0.4s ease-in-out infinite;
}

@keyframes betIconPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

@keyframes betIconUrgent {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }
}

.bet-waiting-text {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}

.bet-waiting-text strong {
  color: var(--accent);
}

.bet-waiting-urgency {
  font-family: 'DM Mono', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(232, 52, 28, 0.15);
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  animation: urgencyFlash 0.6s ease-in-out infinite;
}

.bet-prompt-label {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.5rem;
  display: block;
  text-align: center;
}

.bet-word-input {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.timer-bar.red {
  background: var(--accent);
}

/* ── SCREEN: BET ────────────────────────────────────────── */
#screen-bet {
  padding: 1.5rem;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
  background: var(--red-dark);
}

.bet-title {
  font-size: 2rem;
  font-weight: 900;
  text-align: center;
  color: var(--accent);
}

.bet-subtitle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  line-height: 1.5;
}

.bet-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bet-mic-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

/* ── SCREEN: GAME OVER ──────────────────────────────────── */
#screen-gameOver {
  padding-top: 3rem;
}

/* ── SCREEN: REVEAL ─────────────────────────────────────── */
#screen-reveal {
  padding: 1.5rem;
  padding-top: 3.5rem;
  padding-bottom: 6rem; /* Espacio extra para que el botón rojo sea visible al hacer scroll */
  gap: 1.25rem;
  overflow-y: auto;
}

.reveal-header {
  text-align: center;
}

.reveal-outcome {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.reveal-outcome.caught {
  color: var(--green);
}

.reveal-outcome.survived {
  color: var(--accent);
}

.reveal-outcome.tie-nobody {
  color: var(--gold);
}

.reveal-outcome.tie-both {
  color: #ff6b6b;
}

.reveal-outcome.bet-win {
  color: var(--gold);
}

.reveal-outcome.bet-lose {
  color: var(--green);
}

.reveal-infiltrado-card {
  background: var(--red-dark);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  border: 1px solid rgba(232, 52, 28, 0.4);
}

.reveal-word-card {
  background: var(--green-dark);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  border: 1px solid rgba(26, 122, 74, 0.4);
}

/* ── BLUNDER CARD (cuando alguien dice la palabra secreta) ── */
.reveal-blunder-card {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.15) 0%, rgba(232, 52, 28, 0.2) 100%);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  border: 1px solid rgba(255, 152, 0, 0.5);
  animation: blunderAppear 0.5s ease-out;
  position: relative;
}

.reveal-blunder-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 152, 0, 0.05) 10px,
    rgba(255, 152, 0, 0.05) 20px
  );
  pointer-events: none;
}

.blunder-icon {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
  animation: blunderBounce 1s ease-in-out infinite;
}

.blunder-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.3rem;
  color: #ff9800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.blunder-name {
  font-size: 1.8rem;
  font-weight: 900;
  color: white;
  margin: 0.25rem 0;
}

.blunder-subtitle {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.3;
  font-style: italic;
}

@keyframes blunderAppear {
  0% { opacity: 0; transform: scale(0.8) rotate(-2deg); }
  50% { transform: scale(1.03) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

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

.reveal-word-label {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.5rem;
}

.reveal-word {
  font-size: 3rem;
  font-weight: 900;
  color: white;
  line-height: 1;
}

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

.score-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--dark2);
  border-radius: var(--radius-sm);
}

.score-rank {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  min-width: 1.4rem;
}

.score-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
}

.score-role {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.35);
  margin-left: 0.3rem;
}

.score-pts {
  font-size: 1rem;
  font-weight: 700;
  text-align: right;
}

.score-pts.pos {
  color: #4ade80;
}

.score-pts.zero {
  color: rgba(255, 255, 255, 0.3);
}

.score-pts.neg {
  color: var(--accent);
}

.score-total {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: right;
  white-space: nowrap;
}

.audio-replay-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.audio-replay-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
}

.audio-play-btn {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.9rem;
  color: white;
  transition: background var(--transition);
}

.audio-play-btn:hover {
  background: var(--accent-dark);
}

.audio-play-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
}

/* ── CONSENT MODAL ──────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 8000;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-box {
  background: var(--dark2);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 2rem 1.5rem;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-text {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
}

.modal-actions .btn {
  flex: 1;
}

/* ── BET MODAL ──────────────────────────────────────────── */
.bet-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 7000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.bet-modal.hidden {
  display: none;
}

.bet-modal-box {
  background: var(--red-dark);
  border: 1px solid rgba(232, 52, 28, 0.4);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── LOADING ────────────────────────────────────────────── */
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── UTILITY ────────────────────────────────────────────── */
.text-center {
  text-align: center;
}

.text-sm {
  font-size: 0.85rem;
}

.text-xs {
  font-size: 0.72rem;
}

.text-muted {
  color: rgba(255, 255, 255, 0.45);
}

.text-accent {
  color: var(--accent);
}

.text-green {
  color: #4ade80;
}

.text-gold {
  color: #fcd34d;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm {
  gap: 0.5rem;
}

.gap-md {
  gap: 1rem;
}

.gap-lg {
  gap: 1.5rem;
}

.p-md {
  padding: 1rem;
}

.mt-auto {
  margin-top: auto;
}

.hidden {
  display: none !important;
}

.fw-bold {
  font-weight: 700;
}

/* ── ANIMATIONS ─────────────────────────────────────────── */
.fade-in {
  animation: fadeIn 0.3s ease;
}

.slide-up {
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (min-width: 481px) {
  #app {
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.5);
  }
}

/* ── ROUND SELECTOR ─────────────────────────────────────── */
.rounds-btn, .laps-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.6rem 0;
  cursor: pointer;
  transition: all 180ms ease;
}

.rounds-btn:hover, .laps-btn:hover {
  background: rgba(232, 52, 28, 0.15);
  border-color: rgba(232, 52, 28, 0.4);
  color: var(--page);
}

.rounds-btn.selected, .laps-btn.selected {
  background: rgba(232, 52, 28, 0.25);
  border-color: var(--accent);
  color: var(--page);
  box-shadow: 0 0 8px rgba(232, 52, 28, 0.3);
}

/* ── GAME OVER SCORES ───────────────────────────────────── */
.gameover-score-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gameover-score-item.first-place {
  background: rgba(196, 154, 10, 0.15);
  border-color: rgba(196, 154, 10, 0.4);
}

.gameover-rank {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  color: rgba(255, 255, 255, 0.3);
  min-width: 1.8rem;
}

.gameover-rank.top {
  color: var(--gold);
}

.gameover-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}

.gameover-pts {
  font-family: 'DM Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

/* ── SCOREBOARD FLOTANTE ─────────────────────────────────── */
#scoreboard-btn {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 200;
  background: rgba(30, 30, 48, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 0.35rem 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 0.3rem;
  backdrop-filter: blur(8px);
  transition: background 0.2s;
  /* Asegurar área mínima de toque en mobile */
  min-height: 32px;
}

#scoreboard-btn:hover {
  background: rgba(50, 50, 70, 0.95);
}

#scoreboard-btn.open {
  background: rgba(60, 60, 90, 0.98);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Ajuste mobile para scoreboard — moverlo ligeramente si es necesario */
@media (max-width: 480px) {
  #scoreboard-btn {
    top: 10px;
    right: 10px;
    font-size: 0.72rem;
    padding: 0.3rem 0.65rem;
  }
}

#scoreboard-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 190;
  display: none;
  align-items: flex-end;
}

#scoreboard-panel.open {
  display: flex;
}

#scoreboard-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

#scoreboard-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  background: var(--dark2);
  border-radius: 16px 16px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 1.25rem 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.scoreboard-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.scoreboard-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.4rem;
  background: rgba(255, 255, 255, 0.04);
}

.scoreboard-item.me {
  background: rgba(232, 52, 28, 0.12);
  border: 1px solid rgba(232, 52, 28, 0.3);
}

.scoreboard-item.leader {
  background: rgba(196, 154, 10, 0.12);
  border: 1px solid rgba(196, 154, 10, 0.3);
}

.scoreboard-rank {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  min-width: 1.4rem;
}

.scoreboard-rank.gold {
  color: var(--gold);
  font-weight: 700;
}

.scoreboard-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
}

.scoreboard-pts {
  font-family: 'DM Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

.scoreboard-delta {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  margin-left: 0.25rem;
}

.scoreboard-delta.pos {
  color: #4ade80;
}

.scoreboard-delta.neg {
  color: var(--accent);
}

.accused-state-note {
  font-size: 0.78rem;
  color: rgba(255, 200, 50, 0.85);
  text-align: center;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 200, 50, 0.08);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(255, 200, 50, 0.2);
}

/* ── ROOM CODE CHIP ─────────────────────────────────────── */
#room-code-chip {
  position: fixed;
  top: 14px;
  left: 12px;
  background: rgba(30, 30, 50, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 0.25rem 0.7rem;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.3);
  font-family: 'DM Mono', monospace;
  pointer-events: all;
  cursor: pointer;
  z-index: 150;
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  user-select: none;
}

#room-code-chip:hover {
  background: rgba(37, 211, 102, 0.15);
  border-color: rgba(37, 211, 102, 0.4);
  color: rgba(255, 255, 255, 0.6);
}

#room-code-chip:active {
  transform: scale(0.97);
}

#room-code-chip strong {
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.1em;
}

.room-code-chip-share-icon {
  font-size: 0.8rem;
  opacity: 0.5;
  transition: opacity 0.2s;
}

#room-code-chip:hover .room-code-chip-share-icon {
  opacity: 1;
}

/* Ajuste mobile para room-code-chip */
@media (max-width: 480px) {
  #room-code-chip {
    top: 10px;
    left: 10px;
    font-size: 0.6rem;
    padding: 0.2rem 0.6rem;
  }
}

/* ── WHATSAPP SHARE BUTTON (Lobby) ──────────────────────── */
.btn-whatsapp-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.3);
  border-radius: 12px;
  color: rgba(37, 211, 102, 0.9);
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  cursor: pointer;
  width: 100%;
  margin-top: 0.75rem;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  letter-spacing: 0.02em;
}

.btn-whatsapp-share:hover {
  background: rgba(37, 211, 102, 0.22);
  border-color: rgba(37, 211, 102, 0.55);
}

.btn-whatsapp-share:active {
  transform: scale(0.98);
}


/* ── VOTING ACCUSED NOTE ────────────────────────────────── */
#voting-accused-note {
  font-size: 0.78rem;
  color: rgba(255, 200, 50, 0.85);
  text-align: center;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 200, 50, 0.07);
  border-radius: 6px;
  border: 1px solid rgba(255, 200, 50, 0.18);
}

/* ── CHAT FLOTANTE ──────────────────────────────────────── */
#chat-toggle-btn {
  position: fixed;
  bottom: 20px;
  right: 16px;
  z-index: 200;
  background: rgba(30, 30, 48, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.chat-open #chat-toggle-btn,
body.chat-open #sfx-toggle-btn {
  display: none !important;
}

#chat-toggle-btn:hover {
  background: rgba(50, 50, 70, 0.98);
  transform: scale(1.05);
}

#chat-toggle-btn:active {
  transform: scale(0.95);
}

#chat-toggle-btn.chat-pulse {
  animation: chatPulse 0.3s ease;
}

@keyframes chatPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

#chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  border: 2px solid var(--dark);
}

#chat-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 195;
  display: none;
  align-items: flex-end;
}

#chat-panel.open {
  display: flex;
}

#chat-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

#chat-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--dark2);
  border-radius: 16px 16px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  height: 60vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.chat-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.9);
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 85%;
  align-self: flex-start;
}

.chat-msg-me {
  align-self: flex-end;
}

.chat-msg-header {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0 0.5rem;
}

.chat-msg-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'DM Mono', monospace;
}

.chat-msg-time {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.25);
  font-family: 'DM Mono', monospace;
}

.chat-msg-text {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.85);
  word-wrap: break-word;
}

.chat-msg-me .chat-msg-text {
  background: rgba(232, 52, 28, 0.15);
  border-color: rgba(232, 52, 28, 0.25);
}

.chat-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.85rem;
  padding: 2rem 1rem;
  font-style: italic;
}

.chat-input-wrap {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 0.5rem;
  background: var(--dark3);
}

.chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  color: white;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: var(--accent);
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.chat-send-btn {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: var(--accent-dark);
}

.chat-send-btn:active {
  transform: scale(0.95);
}

/* ── DISCONNECTED/AWAY/REMOVED PLAYERS ───────────────────────────────── */
.player-item.disconnected {
  opacity: 0.5;
}

.player-item.disconnected .player-avatar {
  filter: grayscale(100%);
}

.player-item.away {
  opacity: 0.7;
}

.player-item.away .player-avatar {
  filter: grayscale(50%) sepia(30%) hue-rotate(200deg);
  animation: pulse-away 2s infinite;
}

.player-item.removed {
  opacity: 0.3;
  filter: grayscale(100%);
}

.player-item.removed .player-avatar {
  filter: grayscale(100%) brightness(50%);
}

@keyframes pulse-away {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── GAMIFICATION AWARDS ────────────────────────────────── */
.gamification-card {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(196, 154, 10, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  gap: 1rem;
}

.gamification-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.gamification-info {
  display: flex;
  flex-direction: column;
}

.gamification-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.15rem;
}

.gamification-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}
/* ── SCROLL HINT ───────────────────────────────────────── */
.scroll-hint {
  position: fixed;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  text-align: center;
  padding: 2.5rem 0 1rem 0;
  background: linear-gradient(to bottom, rgba(30,30,48,0), rgba(30,30,48,1) 50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.scroll-hint.visible {
  opacity: 1;
}

.scroll-hint-text {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.scroll-hint-arrow {
  font-size: 1rem;
  color: var(--accent);
  margin-top: 0.2rem;
  animation: bounceDown 1.5s infinite;
}

@keyframes bounceDown {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-2px);
  }
}

.round-progress-dot.completed { background: var(--green); }

.round-progress-text {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  min-width: 60px;
  text-align: right;
}

/* ── SCROLL LOCK ──────────────────────────────────────── */
/* Solo bloquear scroll, NO usar position:fixed que rompe focus en inputs */
body.scroll-locked {
  overflow: hidden;
  /* En mobile, usar touch-action para prevenir scroll sin romper layout */
  touch-action: none;
}

/* Solo en iOS Safari que no respeta overflow:hidden en body */
@supports (-webkit-touch-callout: none) {
  body.scroll-locked {
    position: relative;
    overflow: hidden;
  }
}

/* ── PRESSURE PULSE SCREEN ────────────────────────────── */
@keyframes screenPulsePressure {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(232, 52, 28, 0); }
  50% { box-shadow: inset 0 0 30px 10px rgba(232, 52, 28, 0.3); }
}

.screen.pressure-pulse {
  animation: screenPulsePressure 0.5s ease-in-out infinite;
}

/* ── YOUR-TURN PULSE (cuando arranca tu turno) ────────────
   Variante corta del pressure-pulse: dos latidos suaves
   para indicar "es tu turno" sin alarmar como el de bajo tiempo. */
@keyframes screenPulseYourTurn {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(232, 52, 28, 0); }
  50% { box-shadow: inset 0 0 40px 12px rgba(232, 52, 28, 0.35); }
}

.screen.your-turn-pulse {
  animation: screenPulseYourTurn 0.6s ease-in-out 2;
}

/* ── ALMOST THERE MESSAGE ─────────────────────────────── */
.almost-there-card {
  background: linear-gradient(135deg, rgba(232, 52, 28, 0.15), rgba(232, 52, 28, 0.05));
  border: 2px solid rgba(232, 52, 28, 0.4);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  margin: 1rem 0;
  animation: almostTherePulse 2s ease-in-out infinite;
}

.almost-there-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.almost-there-percent {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0.5rem 0;
}

.almost-there-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
}

@keyframes almostTherePulse {
  0%, 100% { border-color: rgba(232, 52, 28, 0.4); }
  50% { border-color: rgba(232, 52, 28, 0.7); }
}

/* ── CRITICAL TOUCH BUTTONS (48x48px minimum) ─────────── */
.critical-touch, .mic-btn, .vote-player, .cat-option, .btn-lg {
  min-width: 48px;
  min-height: 48px;
  touch-action: manipulation;
}

/* ── NOTIFICATION PERMISSION BANNER ───────────────────── */
.notification-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 48, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: calc(100% - 2rem);
  z-index: 9998;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  animation: slideUpFade 0.3s ease forwards;
}

.notification-banner-icon { font-size: 1.5rem; }

.notification-banner-text {
  flex: 1;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

.notification-banner-btn {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.notification-banner-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── BOTONES DE COMPARTIR EN REDES SOCIALES ───────────── */
.btn-share {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.btn-share:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}

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

#share-twitter-btn:hover {
  background: #000;
  border-color: #fff;
}

#share-facebook-btn:hover {
  background: #1877F2;
  border-color: #1877F2;
}

#share-whatsapp-btn:hover {
  background: #25D366;
  border-color: #25D366;
}

#share-copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}
