/* Tema «retro»: todas las reglas se aplican sólo con :root[data-style='retro']. */
/* ════════════════════════════════════════════════════════════════════
   Pupito — tema «Píxel retro» (8-bit)
   Capa que se carga después de main.css: redefine los tokens y el aspecto
   de los componentes comunes. Quitar este archivo devuelve el estilo anterior.
   ════════════════════════════════════════════════════════════════════ */

:root[data-style='retro'] {
  --bg: #140c2c;
  --bg-2: #1e1240;
  --bg-3: #2a1a55;
  --surface: #241650;
  --surface-2: #2f1e62;
  --surface-3: #3d2a7a;
  --surface-solid: #241650;
  --surface-solid-2: #2f1e62;
  --border: #0b0620;
  --border-strong: #6b56d9;
  --text: #fff8e7;
  --text-2: #cdc3ff;
  --text-3: #9187cc;
  --text-on-accent: #0c2a1f;

  --accent: #2ee59d;
  --accent-2: #7ee0ff;
  --accent-soft: rgba(46, 229, 157, 0.18);
  --pink: #ff4d8d;
  --green: #2ee59d;
  --yellow: #ffd23f;
  --orange: #ff8a3d;
  --red: #ff5470;
  --blue: #4f8cff;
  --purple: #5b3fd6;

  --grad-accent: linear-gradient(#2ee59d, #2ee59d);
  --grad-warm: linear-gradient(#ff8a3d, #ff8a3d);

  --radius-xs: 0px;
  --radius-sm: 0px;
  --radius: 0px;
  --radius-lg: 0px;
  --radius-xl: 0px;

  --px-line: #0b0620;
  --px-drop: rgba(0, 0, 0, 0.55);
  --shadow-sm: 4px 4px 0 var(--px-drop);
  --shadow: 6px 6px 0 var(--px-drop);
  --shadow-lg: 8px 8px 0 var(--px-drop);
  --glow: 0 0 0 4px var(--px-line);

  /* Contorno pixelado (esquinas recortadas) + relieve, para botones */
  --px-outline: 0 -4px 0 0 var(--px-line), 0 4px 0 0 var(--px-line), -4px 0 0 0 var(--px-line), 4px 0 0 0 var(--px-line);
  --px-bevel: inset 0 -4px 0 rgba(0, 0, 0, 0.35), inset 0 4px 0 rgba(255, 255, 255, 0.16);
  --px-bevel-pressed: inset 0 4px 0 rgba(0, 0, 0, 0.35);

  --font: 'Pixelify Sans', 'Press Start 2P', ui-monospace, monospace;
  --font-display: 'Silkscreen', 'Pixelify Sans', monospace;
  --font-arcade: 'Press Start 2P', 'Silkscreen', monospace;
  --font-mono: 'VT323', 'Press Start 2P', ui-monospace, monospace;

  --board-bg: #1a0f3a;
  --board-cell: #2f1e62;
  --board-cell-hover: #3d2a7a;
  --board-line: rgba(255, 255, 255, 0.1);
}

:root[data-style='retro'][data-theme='light'] {
  --bg: #f7efd8;
  --bg-2: #efe3c2;
  --bg-3: #e6d6ab;
  --surface: #fffaf0;
  --surface-2: #f4e9cc;
  --surface-3: #eadbb2;
  --surface-solid: #fffaf0;
  --surface-solid-2: #f4e9cc;
  --border: #1b1035;
  --border-strong: #5b3fd6;
  --text: #1b1035;
  --text-2: #4b3e80;
  --text-3: #7b70aa;
  --px-line: #1b1035;
  --px-drop: rgba(27, 16, 53, 0.35);
  --accent-soft: rgba(46, 229, 157, 0.25);
  --board-bg: #e6d6ab;
  --board-cell: #fffaf0;
  --board-cell-hover: #f4e9cc;
  --board-line: rgba(27, 16, 53, 0.14);
}

/* ───────────────────────────── Base ───────────────────────────── */

:root[data-style='retro'] body {
  font-size: 17px;
  letter-spacing: 0.01em;
  image-rendering: pixelated;
}

:root[data-style='retro'] h1,
:root[data-style='retro'] h2,
:root[data-style='retro'] h3,
:root[data-style='retro'] h4 {
  letter-spacing: 0;
  line-height: 1.3;
}

:root[data-style='retro'] ::selection {
  background: var(--pink);
  color: #fff;
}

:root[data-style='retro'] :focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 3px;
}

/* Fondo: cielo nocturno de estrellas pixeladas + líneas de televisor */
:root[data-style='retro'] .bg-orbs {
  background:
    radial-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1.6px) 0 0 / 72px 72px,
    radial-gradient(rgba(126, 224, 255, 0.45) 1px, transparent 1.6px) 36px 52px / 118px 118px,
    radial-gradient(rgba(255, 210, 63, 0.4) 1px, transparent 1.6px) 90px 20px / 190px 190px,
    linear-gradient(180deg, #2a1a55 0%, #1a0f3a 38%, var(--bg) 100%);
}

:root[data-style='retro'] .bg-orbs span {
  display: none;
}

:root[data-style='retro'][data-theme='light'] .bg-orbs {
  background:
    radial-gradient(rgba(91, 63, 214, 0.28) 1px, transparent 1.6px) 0 0 / 72px 72px,
    radial-gradient(rgba(255, 77, 141, 0.22) 1px, transparent 1.6px) 36px 52px / 118px 118px,
    linear-gradient(180deg, #fff3cf 0%, var(--bg) 60%);
}

:root[data-style='retro'] body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.09) 0 2px, transparent 2px 4px);
}

:root[data-style='retro'][data-theme='light'] body::after {
  background: repeating-linear-gradient(0deg, rgba(27, 16, 53, 0.04) 0 2px, transparent 2px 4px);
}

/* Barras de desplazamiento pixeladas */
:root[data-style='retro'] ::-webkit-scrollbar, :root[data-style='retro']::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

:root[data-style='retro'] ::-webkit-scrollbar-track, :root[data-style='retro']::-webkit-scrollbar-track {
  background: var(--bg-2);
}

:root[data-style='retro'] ::-webkit-scrollbar-thumb, :root[data-style='retro']::-webkit-scrollbar-thumb {
  background: var(--purple);
  border: 3px solid var(--bg-2);
}

@keyframes px-blink {
  50% {
    opacity: 0;
  }
}

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

/* ───────────────────────────── Barra superior ───────────────────────────── */

:root[data-style='retro'] .topbar {
  background: #2a1a55;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 4px solid #0b0620;
  box-shadow: inset 0 -4px 0 #140b2b, 0 4px 0 rgba(0, 0, 0, 0.35);
}

:root[data-style='retro'] .brand {
  gap: 12px;
}

:root[data-style='retro'] .brand-logo {
  width: 32px;
  height: 32px;
  filter: drop-shadow(3px 3px 0 #0b0620);
  image-rendering: pixelated;
}

:root[data-style='retro'] .brand:hover .brand-logo {
  transform: translateY(-3px);
  transition: transform 0.1s steps(2);
}

:root[data-style='retro'] .brand-name {
  font-family: var(--font-arcade);
  font-size: 1rem;
  text-transform: uppercase;
  color: #ffd23f;
  text-shadow: 3px 3px 0 #c2410c;
}

:root[data-style='retro'] .brand-name span {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: #ffd23f;
}

:root[data-style='retro'] .nav {
  gap: 14px;
  margin-left: 18px;
}

:root[data-style='retro'] .nav a {
  padding: 10px 12px;
  border-radius: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: #fff;
  background: var(--purple);
  box-shadow: inset 0 -4px 0 #3b25a3, var(--px-outline);
  transition: transform 0.08s steps(2);
}

:root[data-style='retro'] .nav a:hover {
  color: #fff;
  background: #6b4ee6;
  transform: translateY(-2px);
}

:root[data-style='retro'] .nav a.active {
  color: #0c2a1f;
  background: var(--green);
  box-shadow: inset 0 -4px 0 #15a36b, var(--px-outline);
}

:root[data-style='retro'] .online-pill {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 6px 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #ffd23f;
}

:root[data-style='retro'] .dot {
  border-radius: 0;
  width: 8px;
  height: 8px;
  box-shadow: none;
  animation: px-blink 1.2s steps(1) infinite;
}

:root[data-style='retro'] .dot.off,
:root[data-style='retro'] .dot.warn {
  animation: none;
}

:root[data-style='retro'] .icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: var(--purple);
  box-shadow: inset 0 -4px 0 #3b25a3, var(--px-outline);
  transition: transform 0.08s steps(2);
}

:root[data-style='retro'] .icon-btn:hover {
  color: #fff;
  background: #6b4ee6;
  transform: translateY(-2px);
}

:root[data-style='retro'] .icon-btn:active {
  transform: translateY(2px);
  box-shadow: inset 0 4px 0 #3b25a3, var(--px-outline);
}

:root[data-style='retro'] .profile-chip {
  border: 0;
  border-radius: 0;
  padding: 4px 12px 4px 4px;
  background: #3b25a3;
  color: #fff;
  box-shadow: inset 0 -4px 0 #2a1a75, var(--px-outline);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
}

:root[data-style='retro'] .profile-chip:hover {
  background: #4a30c4;
  border-color: transparent;
}

:root[data-style='retro'] .profile-chip .name::before {
  content: 'P1 ';
  color: #7ee0ff;
}

/* ───────────────────────────── Avatares, chips y etiquetas ───────────────────────────── */

:root[data-style='retro'] .avatar {
  border-radius: 0;
  background: var(--c);
  box-shadow: 0 0 0 3px var(--px-line), inset 0 -3px 0 rgba(0, 0, 0, 0.3), inset 0 3px 0 rgba(255, 255, 255, 0.25);
}

:root[data-style='retro'] .chip {
  border-radius: 0;
  border: 2px solid var(--px-line);
  background: var(--surface-2);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.82rem;
  box-shadow: 2px 2px 0 var(--px-drop);
}

:root[data-style='retro'] .chip.accent {
  color: #fff;
  background: var(--purple);
  border-color: var(--px-line);
}

:root[data-style='retro'] .chip.cyan {
  color: #062a35;
  background: #7ee0ff;
  border-color: var(--px-line);
}

:root[data-style='retro'] .chip.pink {
  color: #fff;
  background: var(--pink);
  border-color: var(--px-line);
}

:root[data-style='retro'] .chip.green {
  color: #0c2a1f;
  background: var(--green);
  border-color: var(--px-line);
}

:root[data-style='retro'][data-theme='light'] .chip.accent,
:root[data-style='retro'][data-theme='light'] .chip.pink {
  color: #fff;
}

:root[data-style='retro'][data-theme='light'] .chip.cyan,
:root[data-style='retro'][data-theme='light'] .chip.green {
  color: #0c2a1f;
}

:root[data-style='retro'] .badge-glass {
  border-radius: 0;
  background: rgba(11, 6, 32, 0.75);
  border: 2px solid #0b0620;
  backdrop-filter: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

:root[data-style='retro'] .kbd {
  border-radius: 0;
  border: 2px solid var(--px-line);
  border-bottom-width: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.65rem;
  padding: 3px 6px;
  background: var(--surface-2);
}

:root[data-style='retro'] .label,
:root[data-style='retro'] .field > label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

/* ───────────────────────────── Botones ───────────────────────────── */

:root[data-style='retro'] .btn {
  --btn-bg: var(--surface-3);
  --btn-fg: #fff;
  --btn-shade: rgba(0, 0, 0, 0.35);
  border: 0;
  border-radius: 0;
  min-height: 40px;
  padding: 0 14px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.6;
  background: var(--btn-bg);
  color: var(--btn-fg);
  box-shadow: inset 0 -4px 0 var(--btn-shade), inset 0 4px 0 rgba(255, 255, 255, 0.16), var(--px-outline);
  transition: transform 0.08s steps(2), filter 0.1s steps(2);
}

:root[data-style='retro'] .btn:hover {
  background: var(--btn-bg);
  filter: brightness(1.15);
  transform: translateY(-2px);
  border-color: transparent;
}

:root[data-style='retro'] .btn:active {
  transform: translateY(2px);
  box-shadow: inset 0 4px 0 var(--btn-shade), var(--px-outline);
}

:root[data-style='retro'] .btn svg {
  width: 16px;
  height: 16px;
}

:root[data-style='retro'] .btn-primary,
:root[data-style='retro'] .btn-primary:hover {
  --btn-bg: var(--green);
  --btn-fg: #0c2a1f;
  --btn-shade: #15a36b;
  background: var(--btn-bg);
  background-size: auto;
  box-shadow: inset 0 -4px 0 var(--btn-shade), inset 0 4px 0 rgba(255, 255, 255, 0.3), var(--px-outline);
}

:root[data-style='retro'] .btn-primary:active {
  box-shadow: inset 0 4px 0 var(--btn-shade), var(--px-outline);
}

:root[data-style='retro'] .btn-warm,
:root[data-style='retro'] .btn-warm:hover {
  --btn-bg: var(--orange);
  --btn-fg: #2b1100;
  --btn-shade: #c2410c;
  background: var(--btn-bg);
}

:root[data-style='retro'] .btn-danger,
:root[data-style='retro'] .btn-danger:hover {
  --btn-bg: var(--red);
  --btn-fg: #fff;
  --btn-shade: #b3203d;
  background: var(--btn-bg);
  border: 0;
}

:root[data-style='retro'] .btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text-2);
  box-shadow: none;
}

:root[data-style='retro'] .btn-ghost:hover {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  filter: none;
  box-shadow: var(--px-outline);
}

:root[data-style='retro'] .btn-ghost:active {
  box-shadow: var(--px-outline);
}

:root[data-style='retro'] .btn-sm {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.55rem;
}

:root[data-style='retro'] .btn-lg {
  min-height: 52px;
  padding: 0 22px;
  font-size: 0.72rem;
}

:root[data-style='retro'] .btn:disabled,
:root[data-style='retro'] .btn[aria-disabled='true'] {
  opacity: 0.4;
  filter: grayscale(0.4);
}

/* Control segmentado */
:root[data-style='retro'] .seg {
  padding: 4px;
  gap: 4px;
  border-radius: 0;
  border: 4px solid var(--px-line);
  background: var(--bg-2);
}

:root[data-style='retro'] .seg button {
  border-radius: 0;
  padding: 8px 10px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

:root[data-style='retro'] .seg button.active,
:root[data-style='retro'][data-theme='light'] .seg button.active {
  color: #0c2a1f;
  background: var(--green);
  box-shadow: inset 0 -3px 0 #15a36b;
}

/* Campos de texto */
:root[data-style='retro'] .input {
  border-radius: 0;
  border: 4px solid var(--px-line);
  background: var(--bg-2);
  font-family: var(--font);
  font-size: 1rem;
  box-shadow: inset 4px 4px 0 rgba(0, 0, 0, 0.25);
}

:root[data-style='retro'] .input:focus {
  border-color: var(--yellow);
  box-shadow: inset 4px 4px 0 rgba(0, 0, 0, 0.25);
  background: var(--bg-2);
}

:root[data-style='retro'] .code-input {
  font-family: var(--font-arcade);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
}

/* ───────────────────────────── Superficies ───────────────────────────── */

:root[data-style='retro'] .panel,
:root[data-style='retro'] .feature,
:root[data-style='retro'] .room-row,
:root[data-style='retro'] .mode-card,
:root[data-style='retro'] .player-chip,
:root[data-style='retro'] .stat,
:root[data-style='retro'] .lobby-hero {
  border-radius: 0;
  border: 4px solid var(--px-line);
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 6px 6px 0 var(--px-drop);
}

:root[data-style='retro'] .panel-head {
  border-bottom: 4px solid var(--px-line);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  background: var(--surface-2);
}

:root[data-style='retro'] .empty-note {
  border-radius: 0;
  border: 4px dashed var(--border-strong);
  font-family: var(--font);
}

:root[data-style='retro'] .modal-backdrop {
  background: rgba(8, 4, 22, 0.75);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

:root[data-style='retro'] .modal {
  border-radius: 0;
  border: 4px solid var(--px-line);
  background: var(--surface);
  box-shadow: 10px 10px 0 var(--px-drop);
  animation: px-pop 0.18s steps(3) both;
}

@keyframes px-pop {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
}

:root[data-style='retro'] .modal-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.23rem;
  line-height: 1.5;
}

:root[data-style='retro'] .howto-list li::before {
  border-radius: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  color: #0c2a1f;
  background: var(--green);
  box-shadow: 2px 2px 0 var(--px-line);
}

:root[data-style='retro'] .toast {
  border-radius: 0;
  border: 4px solid var(--px-line);
  background: var(--surface-2);
  box-shadow: 6px 6px 0 var(--px-drop);
  font-family: var(--font);
}

:root[data-style='retro'] .spinner {
  border-radius: 0;
  border-width: 4px;
  animation-timing-function: steps(8);
}

:root[data-style='retro'] .end-card {
  backdrop-filter: none;
  background: rgba(8, 4, 22, 0.55);
}

:root[data-style='retro'] .end-card .inner {
  border-radius: 0;
  border: 4px solid var(--px-line);
  background: var(--surface);
  box-shadow: 8px 8px 0 var(--px-drop);
}

:root[data-style='retro'] .end-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.5;
}

/* ───────────────────────────── Portada ───────────────────────────── */

:root[data-style='retro'] .hero-kicker {
  border-radius: 0;
  border: 4px solid var(--px-line);
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--px-drop);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #ffd23f;
}

:root[data-style='retro'] .hero-kicker b {
  border-radius: 0;
  background: var(--pink);
  font-weight: 400;
  font-size: 0.55rem;
  animation: px-blink 1.4s steps(1) infinite;
}

:root[data-style='retro'] .hero-title {
  font-family: var(--font-arcade);
  font-size: clamp(1.5rem, 3.4vw, 3rem);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 var(--pink);
}

:root[data-style='retro'] .hero-title .grad {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: #ffd23f;
  text-shadow: 4px 4px 0 #c2410c;
  animation: none;
}

:root[data-style='retro'][data-theme='light'] .hero-title {
  color: #1b1035;
}

:root[data-style='retro'] .hero-sub {
  font-size: 1.2rem;
}

:root[data-style='retro'] .hero-stat b {
  font-family: var(--font-arcade);
  font-size: 1.2rem;
  font-weight: 400;
  color: #ffd23f;
  text-shadow: 3px 3px 0 #c2410c;
  margin-bottom: 6px;
}

:root[data-style='retro'] .hero-art .tile {
  border-radius: 0;
  border: 4px solid var(--px-line);
  box-shadow: 8px 8px 0 var(--px-drop), inset 0 -8px 0 rgba(0, 0, 0, 0.22), inset 0 8px 0 rgba(255, 255, 255, 0.2);
  animation: px-float 3.2s steps(6) infinite;
}

:root[data-style='retro'] .hero-art .tile svg {
  filter: drop-shadow(3px 3px 0 rgba(11, 6, 32, 0.55));
}

:root[data-style='retro'] .section-title {
  font-family: var(--font-arcade);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.5;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 var(--purple);
}

:root[data-style='retro'][data-theme='light'] .section-title {
  text-shadow: 3px 3px 0 #ffd23f;
}

:root[data-style='retro'] .search svg {
  color: var(--text-3);
}

/* Tarjetas de juego */
:root[data-style='retro'] .game-card {
  border-radius: 0;
  border: 4px solid var(--px-line);
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--px-drop);
  transition: transform 0.1s steps(2), box-shadow 0.1s steps(2);
}

:root[data-style='retro'] .game-card::before {
  display: none;
}

:root[data-style='retro'] .game-card:hover {
  transform: translate(-3px, -3px);
  border-color: var(--px-line);
  box-shadow: 10px 10px 0 var(--px-drop);
}

:root[data-style='retro'] .game-card-art {
  background: var(--g1);
  border-bottom: 4px solid var(--px-line);
}

:root[data-style='retro'] .game-card-art::after {
  background:
    conic-gradient(rgba(0, 0, 0, 0.14) 25%, transparent 0 50%, rgba(0, 0, 0, 0.14) 0 75%, transparent 0) 0 0 / 8px 8px,
    linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0 8px, transparent 8px);
}

:root[data-style='retro'] .game-card-art > svg {
  filter: drop-shadow(4px 4px 0 rgba(11, 6, 32, 0.55));
}

:root[data-style='retro'] .game-card:hover .game-card-art > svg {
  transform: translateY(-6px);
  transition: transform 0.12s steps(2);
}

:root[data-style='retro'] .game-card-body h3 {
  font-family: var(--font);
  font-weight: 700;
  font-size: 1.3rem;
}

:root[data-style='retro'] .game-card-stat {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
}

:root[data-style='retro'] .room-row .mini-icon,
:root[data-style='retro'] .feature-icon,
:root[data-style='retro'] .mode-card .mode-icon,
:root[data-style='retro'] .game-icon {
  border-radius: 0;
  border: 3px solid var(--px-line);
  box-shadow: 3px 3px 0 var(--px-drop);
}

:root[data-style='retro'] .mode-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.6;
  text-transform: uppercase;
}

:root[data-style='retro'] .mode-card.featured {
  background: var(--surface-2);
  border-color: var(--px-line);
  box-shadow: 6px 6px 0 var(--px-drop), inset 0 0 0 3px var(--green);
}

:root[data-style='retro'] .mode-card:hover {
  transform: translate(-2px, -2px);
  border-color: var(--px-line);
  box-shadow: 8px 8px 0 var(--px-drop);
}

:root[data-style='retro'] .feature b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.6;
  text-transform: uppercase;
}

:root[data-style='retro'] .footer {
  border-top: 4px solid var(--px-line);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.65rem;
  line-height: 1.8;
  text-transform: uppercase;
}

/* ───────────────────────────── Cabecera de juego y lobby ───────────────────────────── */

:root[data-style='retro'] .game-head h1,
:root[data-style='retro'] .lobby-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 var(--purple);
}

:root[data-style='retro'] .game-head h1 {
  font-size: 1.1rem;
}

:root[data-style='retro'] .lobby-hero h1 {
  font-size: clamp(1.4rem, 3.2vw, 2.4rem);
  line-height: 1.4;
}

:root[data-style='retro'][data-theme='light'] .game-head h1,
:root[data-style='retro'][data-theme='light'] .lobby-hero h1 {
  text-shadow: 3px 3px 0 #ffd23f;
}

:root[data-style='retro'] .lobby-hero::before {
  opacity: 0.55;
}

:root[data-style='retro'] .stat .k {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.56rem;
  letter-spacing: 0;
}

:root[data-style='retro'] .stat .v {
  font-family: var(--font);
  font-size: 1.3rem;
}

/* ───────────────────────────── Marco de partida ───────────────────────────── */

:root[data-style='retro'] .player-chip.active {
  border-color: var(--px-line);
  background: var(--surface-2);
  box-shadow: 6px 6px 0 var(--px-drop), inset 0 0 0 3px var(--yellow);
}

:root[data-style='retro'] .player-chip .pname {
  font-weight: 700;
}

:root[data-style='retro'] .turn-pill {
  border-radius: 0;
  border: 0;
  padding: 10px 14px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--surface-3);
  color: #fff;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.35), var(--px-outline);
}

:root[data-style='retro'] .turn-pill.mine {
  color: #0c2a1f;
  background: var(--green);
  box-shadow: inset 0 -4px 0 #15a36b, var(--px-outline);
  animation: px-blink 1.1s steps(1) infinite;
}

:root[data-style='retro'] .turn-pill.win {
  color: #2b1d00;
  background: var(--yellow);
  box-shadow: inset 0 -4px 0 #c99a00, var(--px-outline);
}

:root[data-style='retro'] .turn-pill.lose {
  background: var(--red);
  box-shadow: inset 0 -4px 0 #b3203d, var(--px-outline);
}

:root[data-style='retro'] .stage-overlay {
  border-radius: 0;
  background: rgba(8, 4, 22, 0.6);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

:root[data-style='retro'] .overlay-card {
  border-radius: 0;
  border: 4px solid var(--px-line);
  background: var(--surface);
  box-shadow: 8px 8px 0 var(--px-drop);
  animation: px-pop 0.2s steps(3) both;
}

:root[data-style='retro'] .overlay-card h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.5;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 var(--pink);
}

:root[data-style='retro'] .room-code span {
  border-radius: 0;
  border: 4px solid var(--px-line);
  background: var(--bg-2);
  font-family: var(--font-arcade);
  font-size: 1.1rem;
  color: #ffd23f;
  box-shadow: 4px 4px 0 var(--px-drop);
}

:root[data-style='retro'] .waiting-anim::before,
:root[data-style='retro'] .waiting-anim::after {
  border-radius: 0;
  border-width: 4px;
  animation-timing-function: steps(5);
}

:root[data-style='retro'] .chat-msg .bubble,
:root[data-style='retro'] .chat-msg.mine .bubble {
  border-radius: 0;
  border: 2px solid var(--px-line);
  box-shadow: 3px 3px 0 var(--px-drop);
}

:root[data-style='retro'] .chat-msg.mine .bubble {
  background: rgba(46, 229, 157, 0.2);
}

:root[data-style='retro'] .chat-msg.system .bubble {
  border: 0;
  box-shadow: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.65rem;
  line-height: 1.7;
  text-transform: uppercase;
}

:root[data-style='retro'] .chat-msg .who {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.65rem;
}

:root[data-style='retro'] .reactions button {
  border-radius: 0;
  border: 2px solid var(--px-line);
  box-shadow: 2px 2px 0 var(--px-drop);
}

:root[data-style='retro'] .chat-form {
  border-top: 4px solid var(--px-line);
}

:root[data-style='retro'] .swatch {
  border-radius: 0;
  border: 2px solid var(--px-line);
}

/* Perfil */
:root[data-style='retro'] .avatar-picker button,
:root[data-style='retro'] .color-picker button {
  border-radius: 0;
}

:root[data-style='retro'] .avatar-picker button.active {
  border-color: var(--green);
}

:root[data-style='retro'] .color-picker button.active {
  box-shadow: 0 0 0 3px var(--yellow);
}

/* Confeti: piezas cuadradas (ya lo son) — sin cambios. */

@media (max-width: 640px) {
  :root[data-style='retro'] .brand-name {
    font-size: 0.8rem;
  }

  :root[data-style='retro'] .hero-title {
    font-size: 1.35rem;
  }

  :root[data-style='retro'] .section-title {
    font-size: 0.85rem;
  }

  :root[data-style='retro'] .game-card-body h3 {
    font-size: 1.1rem;
  }

  :root[data-style='retro'] .game-head h1 {
    font-size: 0.85rem;
  }

  :root[data-style='retro'] .lobby-hero h1 {
    font-size: 1.05rem;
  }

  :root[data-style='retro'] .profile-chip .name::before {
    content: '';
  }
}

@media (prefers-reduced-motion: reduce) {
  :root[data-style='retro'] body::after {
    display: none;
  }
}

/* ───────────────────────────── Monedas ───────────────────────────── */

:root[data-style='retro'] .coin-ico {
  width: 20px;
  height: 20px;
  flex: none;
  image-rendering: pixelated;
}

:root[data-style='retro'] .coin-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px 0 10px;
  border: 0;
  background: #1a0f3a;
  color: #ffd23f;
  font-family: var(--font-arcade);
  font-size: 0.62rem;
  box-shadow: inset 0 -4px 0 #0b0620, var(--px-outline);
  transition: transform 0.08s steps(2);
}

:root[data-style='retro'] .coin-pill:hover {
  transform: translateY(-2px);
}

:root[data-style='retro'] .coin-pill.bump .coin-ico {
  animation: coin-spin 0.5s steps(4);
}

:root[data-style='retro'] .coin-pill.has-bonus::after {
  content: '!';
  position: absolute;
  top: -10px;
  right: -8px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font-size: 0.55rem;
  color: #fff;
  background: var(--pink);
  box-shadow: 0 0 0 2px var(--px-line);
  animation: px-blink 1s steps(1) infinite;
}

:root[data-style='retro'] .coin-pop {
  position: absolute;
  left: 50%;
  top: 100%;
  font-family: var(--font-arcade);
  font-size: 0.6rem;
  pointer-events: none;
  text-shadow: 2px 2px 0 var(--px-line);
  animation: coin-rise 1.2s steps(8) forwards;
}

:root[data-style='retro'] .coin-pop.up {
  color: var(--green);
}

:root[data-style='retro'] .coin-pop.down {
  color: var(--red);
}

@keyframes coin-spin {
  50% {
    transform: scaleX(0.2);
  }
}

@keyframes coin-rise {
  from {
    opacity: 1;
    transform: translate(-50%, 6px);
  }
  to {
    opacity: 0;
    transform: translate(-50%, 34px);
  }
}

:root[data-style='retro'] .wallet {
  display: grid;
  gap: 18px;
}

:root[data-style='retro'] .wallet-balance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  border: 4px solid var(--px-line);
  background: var(--bg-2);
  box-shadow: inset 4px 4px 0 rgba(0, 0, 0, 0.25);
}

:root[data-style='retro'] .wallet-balance .coin-ico {
  width: 40px;
  height: 40px;
}

:root[data-style='retro'] .wallet-balance b {
  font-family: var(--font-arcade);
  font-size: 1.6rem;
  color: #ffd23f;
  text-shadow: 3px 3px 0 #c2410c;
}

:root[data-style='retro'] .wallet-balance span {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-2);
}

:root[data-style='retro'] .wallet-ways {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--text-2);
}

:root[data-style='retro'] .wallet-ways b {
  color: var(--text);
}

:root[data-style='retro'] .wallet-history {
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
}

:root[data-style='retro'] .wallet-history .row {
  padding: 6px 8px;
  background: var(--surface-2);
  border: 2px solid var(--px-line);
}

:root[data-style='retro'] .wallet-history b {
  font-family: var(--font-arcade);
  font-size: 0.6rem;
}

:root[data-style='retro'] .wallet-history b.up {
  color: var(--green);
}

:root[data-style='retro'] .wallet-history b.down {
  color: var(--red);
}

:root[data-style='retro'] .badge-glass .coin-ico {
  width: 13px;
  height: 13px;
}

:root[data-style='retro'] .chip .coin-ico {
  width: 16px;
  height: 16px;
}

@media (max-width: 640px) {
  :root[data-style='retro'] .coin-pill {
    padding: 0 8px;
    gap: 6px;
    font-size: 0.55rem;
  }

  :root[data-style='retro'] .nav a[data-nav='casino'] {
    display: none;
  }
}

/* Ajustes tras la revisión: contraste en modo claro, cifras legibles y turno sin huecos */
:root[data-style='retro'][data-theme='light'] .btn {
  --btn-fg: var(--text);
}

:root[data-style='retro'] .stat .v {
  font-family: var(--font-arcade);
  font-size: 0.95rem;
  line-height: 1.6;
}

:root[data-style='retro'] .end-card .muted {
  font-family: var(--font-mono);
  font-size: 1.25rem;
}

:root[data-style='retro'] .turn-pill.mine {
  animation: retro-turn-pulse 1.1s steps(1) infinite;
}

@keyframes retro-turn-pulse {
  50% {
    background: #ffd23f;
    box-shadow: inset 0 -4px 0 #c99a00, var(--px-outline);
  }
}

/* Nombres de jugador legibles en retro (en Pixelify el 2 parece un 8 y el 5 una S) */
:root[data-style='retro'] .player-chip .pname,
:root[data-style='retro'] .chat-msg .who {
  font-family: var(--font-display);
  font-weight: 700;
}
