/*
  Estilo "Game Boy Color".
  Todos los colores están aquí arriba como variables: si quieres otra paleta,
  solo cambias estas líneas.
*/
@font-face {
  font-family: "PressStart";
  src: url("../fonts/PressStart2P-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --carcasa: #d42a2f;        /* rojo Pokédex (antes morado: #6a3fa0) */
  --carcasa-sombra: #8f161b;
  --fondo: #1f1f28;
  --pantalla: #f8f8e8;       /* blanco roto de la pantalla */
  --tinta: #202028;
  --tinta-suave: #686878;
  --acento: #e03838;
  --marco: #3a3a48;
  --boton: #f8f8e8;
  --pixel: 4px;              /* tamaño de un "píxel" de la interfaz */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--fondo);
  color: var(--tinta);
  font-family: "PressStart", monospace;
  font-size: 11px;
  line-height: 1.6;
  /* Evita que el móvil haga zoom con doble toque mientras juegas */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  /* En el iPhone, tocar seguido (acariciar) seleccionaba texto o sacaba el menú de la imagen */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input { -webkit-user-select: text; user-select: text; }

/*
  La página entera nunca se desplaza: la consola mide justo lo que la pantalla del móvil
  y solo se desplaza, si hace falta, el contenido de dentro de la pantalla.
  (dvh = alto real visible, descontando las barras del navegador; vh por si no lo entiende)
*/
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  display: flex;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
}

/* La "consola": la carcasa roja que rodea la pantalla */
.consola {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 900px;      /* en el PC no se estira hasta el infinito */
  width: 100%;
  max-width: 420px;
  background: var(--carcasa);
  border-radius: 12px 12px 48px 12px;
  padding: 20px 20px 16px;
  box-shadow: inset -6px -6px 0 var(--carcasa-sombra);
}

.pantalla {
  background: var(--pantalla);
  border: var(--pixel) solid var(--marco);
  border-radius: 4px;
  outline: 12px solid var(--marco);
  outline-offset: 0;
  margin: 12px;
  /* Ocupa todo el alto que deja la consola (el mismo en todas las pantallas).
     Si algo no cabe, se desplaza por dentro. */
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Nada se aplasta para caber: si no hay sitio, la pantalla se desplaza por dentro */
.pantalla > * { flex-shrink: 0; }

.marca {
  text-align: center;
  color: #fff4f0;
  font-size: 10px;
  margin: 18px 0 0;
  letter-spacing: 1px;
}
.marca span { color: #ffd84a; }
/* El pie de la carcasa: el nombre en el centro y la tuerca del menú a la derecha */
.pie-consola { position: relative; }
.tuerca {
  position: absolute;
  right: 4px;
  bottom: -6px;
  background: none;
  border: none;
  padding: 6px;
  color: #fff4f0;
  cursor: pointer;
}
.tuerca:active { transform: translateY(1px); color: #ffd84a; }
.tuerca[hidden] { display: none; }
/* El sobre del BUZÓN: a la izquierda, haciendo pareja con la tuerca. El globo rojo cuenta lo que hay sin mirar. */
.sobre {
  position: absolute;
  left: 4px;
  bottom: -4px;
  background: none;
  border: none;
  padding: 6px;
  color: #fff4f0;
  cursor: pointer;
}
.sobre:active { transform: translateY(1px); color: #ffd84a; }
.sobre[hidden], .sobre .globo[hidden] { display: none; }
.sobre .globo {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 22px;
  padding: 4px 4px 3px;
  background: var(--acento);
  color: #fff;
  border: 2px solid var(--tinta);
  font-family: inherit;
  font-size: 11px;
  line-height: 1;
  text-align: center;
  animation: respira 0.8s steps(2) infinite;
}

h1, h2 { font-size: 12px; margin: 0; text-align: center; font-weight: normal; }
p { margin: 0; }
.cargando { margin: auto; }
.suave { color: var(--tinta-suave); }
.centro { text-align: center; }

/* Los sprites son diminutos (56x56). "pixelated" los amplía sin difuminarlos. */
.sprite {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

/* --- Pantalla de elegir inicial --- */
.iniciales {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.inicial {
  font: inherit;
  font-size: 8px;
  color: var(--tinta);
  background: none;
  border: var(--pixel) solid transparent;
  padding: 4px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.inicial .sprite { width: 108px; max-width: 100%; aspect-ratio: 1; } /* 36 px x3 */
.inicial[aria-pressed="true"] { border-color: var(--tinta); }
/* El huevo sorpresa ocupa su propia fila */
.inicial.sorpresa { grid-column: 1 / -1; justify-self: center; padding: 4px 24px 8px; }
.inicial.sorpresa .huevo { width: 72px; height: 84px; image-rendering: pixelated; }

/* Botoncitos para activar regiones */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chip {
  font: inherit;
  font-size: 8px;
  color: var(--tinta);
  background: none;
  border: 3px solid var(--tinta);
  padding: 6px 8px;
  cursor: pointer;
  opacity: 0.45;
}
.chip.activo { background: var(--tinta); color: var(--pantalla); opacity: 1; }

/* Caja de texto como la de los juegos */
.dialogo {
  border: var(--pixel) double var(--tinta);
  border-width: 6px;
  padding: 10px;
  min-height: 72px;
}

/* --- Pantalla principal --- */
.cabecera { display: flex; justify-content: space-between; font-size: 9px; }
.escenario {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
/* El canvas mide 64x64 "píxeles de consola"; aquí lo ampliamos x4 */
.escenario .sprite { width: 256px; max-width: 100%; aspect-ratio: 1; }

/* Reacciones extra con CSS. steps() hace que vayan "a saltos", como en una consola antigua */
.escenario .sprite.niega { animation: niega 0.4s steps(4) 2; }
.escenario .sprite.evoluciona { animation: evoluciona 0.25s steps(2) 8; }

@keyframes niega {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(calc(var(--pixel) * -2)); }
  75% { transform: translateX(calc(var(--pixel) * 2)); }
}
/* Parpadeo en blanco, como la animación de evolución de los juegos */
@keyframes evoluciona {
  from { filter: brightness(1); }
  to { filter: brightness(0) invert(1); }
}

.zzz {
  position: absolute;
  top: 16px;
  right: 24px;
  font-size: 10px;
  color: var(--tinta-suave);
  animation: respira 1.2s steps(2) infinite;
}

/* Caja de texto con el retrato a la izquierda, como en Mundo Misterioso */
.dialogo.con-retrato { display: flex; gap: 10px; align-items: flex-start; }
.retrato {
  width: 80px;
  height: 80px;
  flex: none;
  image-rendering: pixelated;
  border: 2px solid var(--tinta);
}

.creditos { display: flex; flex-direction: column; gap: 12px; font-size: 9px; overflow-wrap: anywhere; }

/* Barras de COMIDA, ÁNIMO e HIGIENE, al estilo de la barra de PS */
.barras { display: flex; flex-direction: column; gap: 6px; font-size: 8px; }
.fila-barra { display: grid; grid-template-columns: 9ch 1fr; align-items: center; gap: 8px; }
.barra {
  height: 10px;
  border: 2px solid var(--tinta);
  background: #fff;
  padding: 1px;
}
.relleno { height: 100%; transition: width 0.4s steps(6); }
.relleno.verde { background: #38b848; }
.relleno.amarilla { background: #f8c030; }
.relleno.roja { background: #e03838; }

.pruebas {
  border: 2px dashed var(--tinta-suave);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 8px;
}

/* Animación muy simple: sube y baja 1 "píxel", a saltos, como en Game Boy */
@keyframes respira {
  from { transform: translateY(0); }
  to   { transform: translateY(calc(var(--pixel) * -1)); }
}
@media (prefers-reduced-motion: reduce) {
  .escenario .sprite.niega, .escenario .sprite.evoluciona, .zzz { animation: none; }
}

/* --- Botones --- */
.botones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.boton {
  font: inherit;
  font-size: 9px;
  color: var(--tinta);
  background: var(--boton);
  border: var(--pixel) solid var(--tinta);
  box-shadow: var(--pixel) var(--pixel) 0 var(--tinta);
  padding: 10px 4px;
  cursor: pointer;
}
.boton:active:not(:disabled) { transform: translate(var(--pixel), var(--pixel)); box-shadow: none; }
.boton:disabled { color: var(--tinta-suave); border-color: var(--tinta-suave); box-shadow: none; cursor: default; }
.boton.principal { background: var(--acento); color: #fff; }
.boton.ancho { grid-column: 1 / -1; }

input[type="text"], textarea {
  font: inherit;
  width: 100%;
  padding: 8px;
  border: var(--pixel) solid var(--tinta);
  background: #fff;
  color: var(--tinta);
}

.pie { display: flex; justify-content: space-between; }
.enlace {
  font: inherit; font-size: 8px; background: none; border: none;
  color: var(--tinta-suave); text-decoration: underline; cursor: pointer; padding: 4px;
}

/* ---------- Paso 3: huevos, guardería y Pokédex ---------- */
.huevo { image-rendering: pixelated; width: 48px; height: 56px; display: block; }
.huevo.grande { width: 72px; height: 84px; }
.huevo.mece { animation: mece 2s steps(1) infinite; transform-origin: 50% 90%; }
.huevo.tiembla { animation: tiembla 0.6s steps(1) infinite; transform-origin: 50% 90%; }
@keyframes mece {
  0%, 70%, 100% { transform: rotate(0); }
  80% { transform: rotate(-10deg); }
  90% { transform: rotate(10deg); }
}
@keyframes tiembla {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-12deg); }
  75% { transform: rotate(12deg); }
}
.boton-huevo {
  position: absolute;
  right: 4px;
  bottom: 8px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
}

/* El huevo se encoge si el escenario es pequeño (así caben dos sin tapar al Pokémon) */
.boton-huevo { width: min(56px, 22%); }
.boton-huevo .huevo { width: 100%; height: auto; }
.boton-huevo.segundo { right: auto; left: 4px; } /* el segundo huevo, al otro lado del Pokémon */

.botones.dos { grid-template-columns: 1fr 1fr; }
.boton { position: relative; }
.aviso {
  position: absolute;
  top: -10px;
  right: -6px;
  background: var(--acento);
  color: #fff;
  border: 2px solid var(--tinta);
  padding: 2px 5px;
  font-size: 9px;
  animation: respira 0.8s steps(2) infinite;
}

.oferta { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.oferta .boton { width: 100%; }

.fichas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ficha {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--tinta);
  padding: 6px;
  font-size: 9px;
}
.ficha-texto { flex: 1; min-width: 0; }
.retrato.mini { width: 40px; height: 40px; border-width: 2px; }
.boton.pequeno { font-size: 8px; padding: 8px 6px; }

.rejilla {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.casilla {
  font: inherit;
  font-size: 6px;
  color: var(--tinta);
  background: #fff;
  border: 2px solid var(--tinta);
  padding: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}
.casilla img { width: 100%; height: auto; image-rendering: pixelated; aspect-ratio: 1; }
.casilla.activa { outline: 3px solid var(--acento); }
.casilla.vacia { background: transparent; border-style: dashed; border-color: var(--tinta-suave); color: var(--tinta-suave); cursor: default; }
.interrogante { font-size: 14px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; width: 100%; }
.creditos-mini { font-size: 7px; overflow-wrap: anywhere; }

/* ---------- Fondos de bioma ---------- */
/* El escenario es un cuadrado con el dibujo del bioma (64x64) ampliado sin difuminar */
.escenario.bioma {
  width: 256px;
  max-width: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
  flex: none;
  background-size: 100% 100%;
  image-rendering: pixelated;
  border: var(--pixel) solid var(--tinta);
  overflow: hidden;
}
.escenario.bioma .sprite { width: 100%; }
/* De noche: un velo azul oscuro por encima del fondo, pero por debajo del Pokémon */
.escenario.bioma::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #101840;
  opacity: 0;
  pointer-events: none;
}
.escenario.bioma.noche::before { opacity: 0.55; }
.escenario.bioma > * { position: relative; }
.escenario.bioma > .boton-huevo, .escenario.bioma > .zzz,
.escenario.bioma > .caca, .escenario.bioma > .corazon-flota,
.escenario.bioma > .mancha, .escenario.bioma > .mosca { position: absolute; }
.escenario.bioma .zzz { color: #e8e8f8; }

/* ---------- Cacas, bayas, caricias y variocolores ---------- */
.caca {
  position: absolute;
  width: 10%;
  height: auto;
  image-rendering: pixelated;
  pointer-events: none;
}
.escenario .sprite[role="button"] { cursor: pointer; }
.corazon-flota {
  position: absolute;
  left: 46%;
  top: 30%;
  width: 28px;
  height: auto;
  image-rendering: pixelated;
  pointer-events: none;
  animation: flota 1.2s steps(6) forwards;
}
@keyframes flota {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-48px); opacity: 0; }
}
.vinculo { display: flex; align-items: center; gap: 4px; font-size: 8px; }
.vinculo span { width: 9ch; margin-right: 4px; }
.vinculo img { width: 14px; height: 12px; image-rendering: pixelated; }

.botones.bayas { grid-template-columns: 1fr 1fr 1fr auto; }
.boton.baya { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 8px; padding: 6px 2px; }
.boton.baya img { width: 20px; height: 18px; image-rendering: pixelated; }
.boton.baya .fav { position: absolute; top: 3px; right: 3px; width: 10px; height: 9px; }
.boton.cerrar { padding: 6px 10px; }

.estrella { color: #e8a800; }
.casilla { position: relative; }
.estrella.esquina { position: absolute; top: 1px; right: 2px; font-size: 7px; }
.retratos-ficha { display: flex; flex-direction: column; gap: 4px; }
@media (prefers-reduced-motion: reduce) { .corazon-flota { animation: none; opacity: 0; } }

/* Aviso de descarga de los sprites, debajo de la pantalla */
.descarga {
  margin: 16px 12px 0;
  font-size: 8px;
  color: #fff4f0;
  text-align: center;
}

/* ---------- Minijuego: Salta obstáculos ---------- */
.marcador { text-align: center; font-size: 9px; }
.escenario.bioma.juego {
  background-repeat: repeat-x;
  cursor: pointer;
  touch-action: none;   /* que tocar no haga scroll ni zoom */
  user-select: none;
}
.escenario.bioma.juego > .corredor { position: absolute; inset: 0; width: 100%; }
.escenario.bioma.juego > .obstaculo {
  position: absolute;
  width: 18.75%;        /* 12 píxeles de 64 */
  transform: translateX(-50%);
  image-rendering: pixelated;
  pointer-events: none;
}
.escenario.bioma.juego > .baya-juego { width: 15.6%; } /* 10 de 64 */
.escenario.bioma.juego > .aviso-juego {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--pantalla);
  border: 3px solid var(--tinta);
  padding: 6px 10px;
  font-size: 10px;
}
.tiembla-juego { animation: niega 0.3s steps(4) 2; }

/* Suciedad: manchas sobre el Pokémon y moscas revoloteando */
.mancha { width: 11%; height: auto; image-rendering: pixelated; pointer-events: none; }
.mosca { width: 4.7%; height: auto; image-rendering: pixelated; pointer-events: none; animation: zumba 0.9s steps(4) infinite; }
.mosca.m1 { animation-delay: -0.45s; }
@keyframes zumba {
  0% { transform: translate(0, 0); }
  25% { transform: translate(8px, -6px); }
  50% { transform: translate(14px, 2px); }
  75% { transform: translate(4px, 6px); }
  100% { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) { .mosca { animation: none; } }

/* El último elemento de cada pantalla (VOLVER, el pie…) se queda abajo del todo */
.pantalla > :last-child { margin-top: auto; }

/* Botón grande de saltar en el minijuego: ocupa el hueco libre */
.boton.saltar {
  flex: 1;
  min-height: 96px;
  font-size: 14px;
  touch-action: none;
  user-select: none;
}

/* ---------- Racha, rarezas y evolución confirmada ---------- */
.fila-barra.racha span:last-child { font-size: 8px; }
.huevo.legendario { filter: drop-shadow(0 0 3px #f8d860) drop-shadow(0 0 6px #f8d860); }
.huevo.raro { filter: drop-shadow(0 0 3px #78a8f8); }
/* Mientras decides si evoluciona, parpadea despacio (blanco ↔ normal) */
.escenario .sprite.evolucionando { animation: evoluciona 0.5s steps(2) infinite; }
/* En la pantalla de elegir, la rejilla de tu Pokédex va justo debajo (no pegada al fondo) */
.pantalla[data-vista="elegir"] > :last-child { margin-top: 0; }
/* Pantallas que acaban en una lista (el VOLVER va arriba): la lista no se pega al fondo */
.pantalla:is([data-vista="buzon"], [data-vista="guarderia"], [data-vista="pokedex"], [data-vista="mercado"], [data-vista="tienda-elegir"]) > :last-child { margin-top: 0; }
.rejilla .casilla span { overflow-wrap: anywhere; }

/* ---------- Menú de minijuegos ---------- */
.lista-juegos { display: flex; flex-direction: column; gap: 12px; }
.boton.juego-opcion { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; text-align: left; }
.juego-nombre { font-size: 11px; }

/* ---------- Tres carriles y Sube a las nubes ---------- */
/* El camino: hierba a los lados y tres carriles de tierra en medio (colores según el bioma) */
.escenario.bioma.juego.carriles {
  background: linear-gradient(to right, var(--hierba) 0 4%, var(--camino) 4% 96%, var(--hierba) 96%);
}
.raya-carril {
  position: absolute !important;
  top: 0; bottom: 0;
  width: 2%;
  transform: translateX(-50%);
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.7) 0 8%, transparent 8% 16%);
  background-size: 100% 50%;
  pointer-events: none;
}
.escenario.bioma.juego > .corredor-carril {
  position: absolute;
  bottom: 0;
  width: 70%;
  transform: translateX(-50%);
  transition: left 0.1s steps(2);
  pointer-events: none;
}
.escenario.bioma.juego > .cosa-carril {
  position: absolute;
  width: 18.75%;
  transform: translateX(-50%);
  image-rendering: pixelated;
  pointer-events: none;
}
.escenario.bioma.juego > .cosa-carril.baya-juego { width: 15.6%; }
/* Los dos botones grandes ◀ ▶ ocupan el hueco libre */
.controles-carril { display: flex; gap: 12px; flex: 1; }
.boton.mover { flex: 1; min-height: 96px; font-size: 22px; touch-action: none; user-select: none; }

/* Sube a las nubes: el dibujo del bioma abajo y el cielo encima (el color lo pone el JS) */
.escenario.bioma.juego.nubes { background-repeat: no-repeat; }
.escenario.bioma.juego > .saltarin {
  position: absolute;
  width: 40%;
  transform: translateX(-50%);
  pointer-events: none;
}
.escenario.bioma.juego > .nube,
.escenario.bioma.juego > .baya-nube {
  position: absolute;
  width: 24%;
  transform: translateX(-50%);
  image-rendering: pixelated;
  pointer-events: none;
}
.escenario.bioma.juego > .baya-nube { width: 12%; }
/* Muy arriba, salen estrellas (reutilizamos la capa de la noche) */
.escenario.bioma.nubes.estrellas::before {
  opacity: 1;
  background:
    radial-gradient(circle, #fff 0 1px, transparent 1.5px) 0 0 / 37px 41px,
    radial-gradient(circle, #ffe 0 1px, transparent 1.5px) 13px 19px / 53px 47px;
}

/* Pokédex: los que solo has visto (aún no criados) salen en gris */
.casilla.visto img { filter: grayscale(1); opacity: 0.6; }

/*
  Móviles bajitos: apretamos un poco la pantalla principal para que quepa sin desplazarse
  (el escenario, además, se encoge solo: mira ajustarEscenario en main.js).
*/
@media (max-height: 720px) {
  body { padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .consola { padding: 14px 14px 10px; }
  .marca { margin-top: 10px; }
  .pantalla[data-vista="principal"] { gap: 10px; padding: 10px; }
  .pantalla[data-vista="principal"] .dialogo { min-height: 0; padding: 6px 8px; }
  .pantalla[data-vista="principal"] .boton { padding: 7px 4px; }
  .pantalla[data-vista="principal"] .fila-barra { line-height: 1.3; }
}

/*
  Pantalla principal con medidas fijas: los botones de cuidado y el menú de bayas
  ocupan lo mismo, y la caja de texto siempre mide igual (si un texto es muy largo,
  se desplaza dentro de la caja). Así el escenario no cambia de tamaño al tocar nada.
*/
.pantalla[data-vista="principal"] > .botones:not(.dos) { height: 56px; }
.pantalla[data-vista="principal"] > .botones > .boton { height: 100%; }
.pantalla[data-vista="principal"] > .dialogo { height: 124px; overflow-y: auto; }
@media (max-height: 720px) {
  .pantalla[data-vista="principal"] > .botones:not(.dos) { height: 50px; }
  .pantalla[data-vista="principal"] > .dialogo { height: 104px; }
}

/* Menú de la tuerca */
.menu { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.menu .boton { padding: 14px 4px; }

/* ---------- Intercambio ---------- */
.ficha.activa { outline: var(--pixel) solid var(--acento); outline-offset: 2px; }
.codigo-grande { text-align: center; font-size: 24px; letter-spacing: 6px; user-select: all; -webkit-user-select: all; }
.cambio { display: flex; align-items: center; justify-content: center; gap: 8px; }
.cambio .flechas { font-size: 20px; }
.tarjeta {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: var(--pixel) solid var(--tinta);
  padding: 8px 4px;
  text-align: center;
  min-height: 150px;
  justify-content: center;
}
.tarjeta.vacia { border-style: dashed; font-size: 24px; }
.tarjeta .retrato { width: 72px; height: 72px; }

/* Diario */
.diario h2 { margin-top: 12px; }
.ficha.recuerdo { opacity: 0.85; }
.retrato.mini.vacio { display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }

/* Pregunta del día y tienda */
.monedas { text-align: center; color: #b8860b; }
.quiz-silueta { display: flex; justify-content: center; }
.quiz-sprite { width: 256px; max-width: 80%; aspect-ratio: 1; margin: -24px 0 -16px; }
.quiz-sprite.silueta { filter: brightness(0); }
.quiz-opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quiz-opciones .boton { padding: 12px 4px; overflow-wrap: anywhere; }
.quiz-opciones .boton:disabled { opacity: 0.55; }
.quiz-opciones .boton.correcta { background: #48a848; color: #fff; opacity: 1; }
.quiz-opciones .boton.fallada { background: var(--acento); color: #fff; opacity: 1; }
.huevo.mini { width: 34px; height: 40px; flex: none; }
.boton.pequeno:disabled { opacity: 0.45; }

/* La descripción de la Pokédex, como en los juegos */
.texto-pokedex { margin: 6px 0; line-height: 1.5; }
.ficha-pokedex .con-retrato { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 6px; }
.ficha-pokedex > p + p { margin-top: 2px; }

/* ---------- Ranking de los minijuegos ---------- */
.ranking { list-style: none; margin: 0; padding: 0; }
.fila-ranking { display: flex; gap: 8px; padding: 6px 4px; border-bottom: 2px dashed var(--suave, #888); font-size: 10px; }
.fila-ranking .puesto { width: 3em; flex: none; }
.fila-ranking .apodo-ranking { flex: 1; overflow-wrap: anywhere; }
.fila-ranking.yo { background: #f8d860; }
.fila-ranking.separa { justify-content: center; border: none; }
#apodo-ranking { font: inherit; font-size: 12px; padding: 10px; border: 3px solid currentColor; background: #fff; width: 100%; box-sizing: border-box; }
.aviso-error { color: #d42a2f; min-height: 1.2em; font-size: 10px; }
.aviso-apodo { font-size: 10px; line-height: 1.6; color: #d42a2f; margin: 4px 0; }
.codigo-rescate { font-size: 16px; letter-spacing: 2px; text-align: center; margin: 10px 0; user-select: all; -webkit-user-select: all; }
#codigo-rescate { font: inherit; font-size: 14px; letter-spacing: 2px; text-transform: uppercase; padding: 10px; border: 3px solid currentColor; background: #fff; width: 100%; box-sizing: border-box; }
.estrella-quiz { color: #e0a800; }
.fila-ranking.yo .estrella-quiz { color: #b04000; }

/* ---------- Equipos Oak / Rocket (equipo.js) ---------- */
/* La consola cambia de colores según tu equipo (data-tema en <html>) */
:root[data-tema="oak"] { --carcasa: #ece6d6; --carcasa-sombra: #b9ae94; --marco: #4a5a48; --acento: #3f9a4a; --fondo: #cfe3ef; }
:root[data-tema="oak"] body {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' shape-rendering='crispEdges'%3E%3Cg opacity='0.18'%3E%3Cpath fill='%23e03838' d='M8 4h4v1h2v1h1v2h1v4H4V8h1V6h1V5h2z'/%3E%3Cpath fill='%23ffffff' d='M4 12h12v2h-1v2h-1v1h-2v1H8v-1H6v-1H5v-2H4z'/%3E%3Cpath fill='%23000' d='M9 11h2v2H9z'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 40px 40px, #cfe3ef;
}
:root[data-tema="oak"] .marca { color: #3a3a48; }
:root[data-tema="oak"] .marca span { color: #2f8f3f; }
:root[data-tema="oak"] .tuerca, :root[data-tema="oak"] .sobre { color: #4a5a48; }
:root[data-tema="oak"] .escenario.bioma { box-shadow: 0 0 0 3px #3f9a4a; }

:root[data-tema="rocket"] { --carcasa: #2c2332; --carcasa-sombra: #140e18; --marco: #0e0b10; --acento: #c8202c; --fondo: #0d0a10; --pantalla: #ece6ee; --boton: #ece6ee; }
:root[data-tema="rocket"] body { background: repeating-linear-gradient(135deg, #120d16 0 14px, #1c1320 14px 28px); }
:root[data-tema="rocket"] .marca { color: #e8dcef; }
:root[data-tema="rocket"] .marca span { color: #ff3b47; }
:root[data-tema="rocket"] .tuerca, :root[data-tema="rocket"] .sobre { color: #e8dcef; }
:root[data-tema="rocket"] .consola { box-shadow: inset -6px -6px 0 var(--carcasa-sombra), 0 0 0 2px #c8202c; }
:root[data-tema="rocket"] .escenario.bioma { box-shadow: 0 0 0 3px #c8202c; }

.consola { position: relative; }
.emblema { position: absolute; top: 4px; left: 14px; margin: 0; font-size: 8px; letter-spacing: 1px; }
.emblema b { display: inline-block; width: 14px; height: 14px; line-height: 15px; text-align: center; border-radius: 50%; margin-right: 4px; font-size: 8px; }
:root[data-tema="oak"] .emblema { color: #2f8f3f; }
:root[data-tema="oak"] .emblema b { background: #2f8f3f; color: #fff; }
:root[data-tema="rocket"] .emblema { color: #ff3b47; }
:root[data-tema="rocket"] .emblema b { background: #c8202c; color: #fff; }

/* Las dos cartas */
.cartas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.carta { border: 4px solid; border-radius: 6px; padding: 10px 6px; text-align: center; }
.carta-oak { background: #ece6d6; border-color: #3f9a4a; color: #202028; }
.carta-rocket { background: #2c2332; border-color: #c8202c; color: #ece6ee; }
.carta-titulo { margin: 0 0 8px; font-size: 9px; }
.carta-oak .carta-titulo { color: #2f8f3f; }
.carta-rocket .carta-titulo { color: #ff3b47; }
.carta-pokemon { display: flex; justify-content: center; gap: 2px; }
.carta-pokemon img { width: 36px; height: 36px; image-rendering: pixelated; border: 2px solid #3a3a48; }
.carta-frase { font-size: 8px; margin: 8px 0 0; line-height: 1.6; }
.campana { font-size: 18px; vertical-align: -3px; margin-right: 6px; }
.aviso-equipo { margin: 0; font-size: 8px; line-height: 1.8; color: #b04000; }
.aviso-final { color: #fff; padding: 10px; border: 4px solid #0e0b10; font-size: 9px; line-height: 1.7; text-align: center; }
.aviso-oak { background: #3f9a4a; }
.aviso-rocket { background: #c8202c; }
.boton.boton-oak { background: #3f9a4a; color: #fff; }
.boton.boton-rocket { background: #c8202c; color: #fff; }

/* Ranking de equipos */
.marcador-equipos { display: flex; flex-direction: column; gap: 8px; }
.titulo-marcador { font-size: 8px; text-align: center; margin: 0 0 6px; }
.barra-equipo { display: flex; align-items: center; gap: 8px; font-size: 9px; }
.barra-equipo .nombre { width: 7.5em; flex: none; }
.barra-equipo .relleno { height: 14px; border: 2px solid var(--tinta); flex: none; }
.barra-equipo.oak .relleno { background: #3f9a4a; }
.barra-equipo.rocket .relleno { background: #c8202c; }
.insignia { display: inline-block; width: 8px; height: 8px; margin-left: 6px; vertical-align: 1px; }
.insignia.oak { background: #3f9a4a; }
.insignia.rocket { background: #c8202c; }

/* ---------- Combate salvaje (beta) ---------- */
.etiqueta-beta { font-size: 7px; background: var(--acento); color: #fff; padding: 2px 4px; vertical-align: middle; }
/*
  Como en los juegos originales: el tuyo abajo a la izquierda (grande, cerca) y el salvaje
  arriba a la derecha (más pequeño, lejos). Cada uno sobre su "plataforma" (una sombra ovalada).
*/
.escenario.bioma.combate > .luchador { position: absolute; }
.escenario.bioma.combate > .luchador.jugador { left: -8%; bottom: -6%; width: 66%; }
.escenario.bioma.combate > .luchador.rival { right: -2%; top: 18%; width: 50%; }
.escenario.bioma.combate > .plataforma {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  pointer-events: none;
}
.escenario.bioma.combate > .plataforma.jugador { left: 6%; bottom: 3%; width: 38%; height: 9%; }
.escenario.bioma.combate > .plataforma.rival { right: 9%; top: 55%; width: 30%; height: 7%; }
/* Al atacar, se lanza en diagonal hacia el otro y vuelve */
.escenario.bioma.combate > .luchador.jugador.embiste { animation: embiste-arriba 0.5s steps(5); }
.escenario.bioma.combate > .luchador.rival.embiste { animation: embiste-abajo 0.5s steps(5); }
@keyframes embiste-arriba { 50% { transform: translate(22%, -22%); } }
@keyframes embiste-abajo { 50% { transform: translate(-28%, 28%); } }
@media (prefers-reduced-motion: reduce) { .escenario.bioma.combate > .luchador.embiste { animation: none; } }
/* Las cajas de vida: la del salvaje arriba a la izquierda y la tuya abajo a la derecha */
.caja-vida { width: 74%; max-width: 230px; border: 3px solid var(--tinta); padding: 4px 6px; font-size: 8px; display: flex; flex-direction: column; gap: 4px; }
.caja-vida.jugador { align-self: flex-end; }
.caja-vida.rival { align-self: flex-start; }
.caja-vida-nombre { display: flex; justify-content: space-between; align-items: center; gap: 4px; flex-wrap: wrap; }
.estrella-shiny { color: #e0a800; }
/* Combate salvaje: Poké Ball pequeña al lado del nombre si ya lo tienes (gris: aún no criado) */
.icono-pokeball.marca-pokedex { width: 9px; height: 9px; border-width: 1.5px; margin: 0 0 0 5px; vertical-align: 0; }
.icono-pokeball.marca-pokedex.gris { background: linear-gradient(#9a9a9a 0 42%, #555 42% 58%, #e8e8e8 58%); border-color: #555; }
.caja-vida .tipos { display: flex; gap: 3px; }
.fila-ps { display: flex; align-items: center; gap: 6px; }
.fila-ps .barra { flex: 1; }
.fila-ps .relleno { transition: width 0.6s steps(12); }
.ps-numeros { text-align: right; }
/* Los 4 ataques, en dos filas de dos */
.botones.ataques { grid-template-columns: 1fr 1fr; }
.botones[hidden] { visibility: hidden; } /* "hidden" a secas no basta: .botones lleva display: grid. Así no salta nada de sitio */
.boton.ataque { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 2px; font-size: 8px; }
/* Etiquetas de tipo, con los colores de siempre */
.tipo { font-size: 6px; color: #fff; padding: 2px 4px; background: #9a9a78; text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35); }
.tipo[data-tipo="Fuego"] { background: #e8742c; }
.tipo[data-tipo="Agua"] { background: #5a86e0; }
.tipo[data-tipo="Planta"] { background: #62b846; }
.tipo[data-tipo="Eléctrico"] { background: #e2b818; }
.tipo[data-tipo="Hielo"] { background: #6cc2c2; }
.tipo[data-tipo="Lucha"] { background: #b02c24; }
.tipo[data-tipo="Veneno"] { background: #96429a; }
.tipo[data-tipo="Tierra"] { background: #c8a650; }
.tipo[data-tipo="Volador"] { background: #9a88e6; }
.tipo[data-tipo="Psíquico"] { background: #ea4c7c; }
.tipo[data-tipo="Bicho"] { background: #9aac20; }
.tipo[data-tipo="Roca"] { background: #b09a3a; }
.tipo[data-tipo="Fantasma"] { background: #6a5490; }
.tipo[data-tipo="Dragón"] { background: #6a3ef0; }
.tipo[data-tipo="Siniestro"] { background: #6a5446; }
.tipo[data-tipo="Acero"] { background: #a8a8c4; }
.tipo[data-tipo="Hada"] { background: #e08aa8; }
.botones.uno { grid-template-columns: 1fr; }
/* El combate tiene muchas cosas: lo apretamos un poco para que quepa sin desplazarse */
.pantalla[data-vista="combate"] { gap: 8px; }
.pantalla[data-vista="combate"] .escenario.bioma { width: 224px; }
.pantalla[data-vista="combate"] .dialogo { min-height: 0; padding: 6px 8px; }
.pantalla[data-vista="combate"] .dialogo .retrato { width: 32px; height: 32px; }
/* El que se debilita se hunde y desaparece, como en los juegos */
.escenario.bioma.combate > .luchador.debilitado { animation: debilitado 0.8s steps(8) 0.3s forwards; }
@keyframes debilitado { to { transform: translateY(40%); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .escenario.bioma.combate > .luchador.debilitado { animation: none; opacity: 0; } }

/* Combates con amigos: retratos en fila (MI EQUIPO, presentación) y el botón de rendirse */
.fila-retratos { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.equipo-rival { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.versus { font-size: 20px; }
.pantalla[data-vista="combate"] .boton.rendirse { align-self: center; width: auto; padding: 6px 10px; font-size: 8px; }

/* Poké Balls (la divisa de los equipos) y la corona del campeón de la semana */
.icono-pokeball { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border-radius: 50%; border: 2px solid #222;
  background: linear-gradient(#e3262f 0 42%, #222 42% 58%, #fff 58%); box-sizing: border-box; }
.pokeballs { font-size: 10px; }
/* Capturar en el combate salvaje: el botón ocupa toda la fila y la bola tiembla en el sitio del salvaje */
/* Piedras evolutivas (una gema) y objetos de intercambio (una bolsita), del color de cada uno */
.icono-objeto { width: 28px; height: 28px; margin: 6px; flex-shrink: 0; background: var(--color); border: 3px solid #222; }
.icono-objeto.piedra { clip-path: polygon(50% 0, 100% 40%, 80% 100%, 20% 100%, 0 40%); border: none;
  box-shadow: inset -6px -6px 0 rgba(0,0,0,0.25), inset 5px 5px 0 rgba(255,255,255,0.45); }
.icono-objeto.tabla { width: 26px; height: 32px; border-width: 2px; border-radius: 3px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.35), inset -4px -4px 0 rgba(0,0,0,0.2); }
.icono-objeto.intercambio { border-radius: 40% 40% 8px 8px; box-shadow: inset -5px -5px 0 rgba(0,0,0,0.2); }
.bola-tienda { width: 32px; height: 32px; margin: 4px; border-width: 3px; flex-shrink: 0; }
.boton.bola { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 2px; padding: 8px 4px; }
.boton.bola[hidden] { display: none; }
.escenario > .bola-captura { position: absolute; z-index: 1; width: 22px; height: 22px; border-width: 3px; margin: 0; transform: translate(-50%, -50%);
  animation: tiembla-bola 0.6s ease-in-out 0.3s 3; }
@keyframes tiembla-bola {
  0%, 100% { transform: translate(-50%, -50%) rotate(0); }
  25% { transform: translate(-50%, -50%) rotate(-20deg); }
  75% { transform: translate(-50%, -50%) rotate(20deg); }
}
.emblema .corona { font-size: 9px; }

/* ---------- Carcasas de la tienda y de temporada (carcasas.js) ---------- */
:root[data-tema="pikachu"] { --carcasa: #f6d23a; --carcasa-sombra: #c9a210; --marco: #3a2c12; --acento: #e2412f; --fondo: #fff3b0; }
:root[data-tema="pikachu"] body { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' shape-rendering='crispEdges'%3E%3Cpath opacity='0.35' fill='%23e8b400' d='M20 4h8l-4 10h6L16 30l4-12h-6z'/%3E%3C/svg%3E") 0 0 / 48px 48px, #fff3b0; }
:root[data-tema="pikachu"] .marca, :root[data-tema="pikachu"] .tuerca, :root[data-tema="pikachu"] .sobre { color: #3a2c12; }
:root[data-tema="pikachu"] .marca span { color: #e2412f; }
:root[data-tema="pikachu"] .escenario.bioma { box-shadow: 0 0 0 3px #3a2c12; }
:root[data-tema="pikachu"] .emblema { color: #3a2c12; } :root[data-tema="pikachu"] .emblema b { background: #3a2c12; color: #f6d23a; }

:root[data-tema="gengar"] { --carcasa: #5d3d92; --carcasa-sombra: #2f1d52; --marco: #1a1028; --acento: #ff5a7a; --fondo: #1b1230; --pantalla: #efe8f7; --boton: #efe8f7; }
:root[data-tema="gengar"] body { background: radial-gradient(circle at 20% 30%, #ffffff22 0 1px, transparent 2px) 0 0 / 34px 34px, radial-gradient(circle at 70% 80%, #ffffff18 0 1px, transparent 2px) 0 0 / 52px 52px, #1b1230; }
:root[data-tema="gengar"] .marca, :root[data-tema="gengar"] .tuerca, :root[data-tema="gengar"] .sobre { color: #efe8f7; }
:root[data-tema="gengar"] .marca span { color: #ff5a7a; }
:root[data-tema="gengar"] .escenario.bioma { box-shadow: 0 0 0 3px #ff5a7a; }
:root[data-tema="gengar"] .emblema { color: #ff8aa2; } :root[data-tema="gengar"] .emblema b { background: #ff5a7a; color: #fff; }

:root[data-tema="lapras"] { --carcasa: #5fb6e4; --carcasa-sombra: #2a7cb0; --marco: #1d3c5a; --acento: #2a7cb0; --fondo: #d9f1fb; }
:root[data-tema="lapras"] body { background: repeating-linear-gradient(0deg, #d9f1fb 0 18px, #c3e6f6 18px 22px, #d9f1fb 22px 40px); }
:root[data-tema="lapras"] .marca, :root[data-tema="lapras"] .tuerca, :root[data-tema="lapras"] .sobre { color: #1d3c5a; }
:root[data-tema="lapras"] .marca span { color: #f2f6f8; text-shadow: 0 0 2px #1d3c5a; }
:root[data-tema="lapras"] .consola { box-shadow: inset -6px -6px 0 var(--carcasa-sombra), 0 0 0 2px #e9f6fc; }
:root[data-tema="lapras"] .escenario.bioma { box-shadow: 0 0 0 3px #1d3c5a; }
:root[data-tema="lapras"] .emblema { color: #1d3c5a; } :root[data-tema="lapras"] .emblema b { background: #f2f6f8; color: #2a7cb0; }

/* --- Inauguración: dorada, confeti y cinta roja cortada --- */
:root[data-tema="inauguracion"] { --carcasa: #e9b934; --carcasa-sombra: #a8780e; --marco: #3a2a10; --fondo: #1d1830; }
:root[data-tema="inauguracion"] body { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' shape-rendering='crispEdges'%3E%3Cpath fill='%23ff4d6d' d='M6 8h4v4H6z'/%3E%3Cpath fill='%2346c2ff' d='M34 4h3v6h-3z'/%3E%3Cpath fill='%23ffd23f' d='M48 26h5v3h-5z'/%3E%3Cpath fill='%237bd85b' d='M18 36h4v4h-4z'/%3E%3Cpath fill='%23c77dff' d='M40 48h3v5h-3z'/%3E%3Cpath fill='%23ffffff' d='M4 50h2v2H4z'/%3E%3C/svg%3E") 0 0 / 60px 60px, #1d1830; }
:root[data-tema="inauguracion"] .consola { background: linear-gradient(135deg, #f6d66a 0 20%, #e9b934 20% 70%, #d9a422 70%); }
:root[data-tema="inauguracion"] .consola::after { content: ""; position: absolute; top: 28px; left: 0; right: 0; height: 10px; pointer-events: none; background: #d42a2f; box-shadow: 0 2px 0 #8f161b; }
:root[data-tema="inauguracion"] .consola::before { content: ""; position: absolute; top: 20px; left: 50%; width: 44px; height: 28px; margin-left: -22px; z-index: 1; pointer-events: none; image-rendering: pixelated; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' shape-rendering='crispEdges'%3E%3Cpath fill='%238f161b' d='M0 0h3v1h2v1h2v1h2V2h2V1h2V0h3v10h-3V9h-2V8h-2V7H7v1H5v1H3v1H0z'/%3E%3Cpath fill='%23e3262f' d='M1 1h2v1h2v1h2v4H5v1H3v1H1zM13 1h2v8h-2V8h-2V7H9V3h2V2h2z'/%3E%3Cpath fill='%23ff8a8f' d='M2 2h1v2H2zM13 2h1v2h-1z'/%3E%3Cpath fill='%238f161b' d='M7 3h2v4H7z'/%3E%3Cpath fill='%23b0151b' d='M6 8h1v2H5V9h1zM9 8h1v1h1v1H9z'/%3E%3C/svg%3E") center / 44px 28px no-repeat; }
:root[data-tema="inauguracion"] .marca, :root[data-tema="inauguracion"] .tuerca, :root[data-tema="inauguracion"] .sobre { color: #3a2a10; }
:root[data-tema="inauguracion"] .marca span { color: #b0151b; }
:root[data-tema="inauguracion"] .escenario.bioma { box-shadow: 0 0 0 3px #e9b934; }
:root[data-tema="inauguracion"] .emblema { color: #3a2a10; } :root[data-tema="inauguracion"] .emblema b { background: #b0151b; color: #ffd23f; }

/* --- Navidad: roja con nieve encima, luces de colores y copos --- */
:root[data-tema="navidad"] { --carcasa: #c8202c; --carcasa-sombra: #7c0f17; --marco: #1d2a20; --fondo: #0f1d3a; }
:root[data-tema="navidad"] body { background: radial-gradient(circle, #ffffffcc 0 1.5px, transparent 2px) 0 0 / 38px 38px, radial-gradient(circle, #ffffff88 0 1px, transparent 1.5px) 19px 13px / 26px 26px, #0f1d3a; }
:root[data-tema="navidad"] .consola::before { content: ""; position: absolute; top: -6px; left: 0; right: 0; height: 22px; pointer-events: none; border-radius: 12px 12px 0 0;
  background: radial-gradient(circle at 10px 6px, #fff 0 10px, transparent 11px) 0 0 / 22px 22px repeat-x; }
:root[data-tema="navidad"] .consola::after { content: ""; position: absolute; top: 60px; bottom: 60px; left: 4px; width: 8px; pointer-events: none;
  background: radial-gradient(circle, #ffd23f 0 3px, transparent 4px) 0 0 / 8px 40px, radial-gradient(circle, #46e07a 0 3px, transparent 4px) 0 13px / 8px 40px, radial-gradient(circle, #46c2ff 0 3px, transparent 4px) 0 26px / 8px 40px;
  box-shadow: none; }
:root[data-tema="navidad"] .marca, :root[data-tema="navidad"] .tuerca, :root[data-tema="navidad"] .sobre { color: #fff; }
:root[data-tema="navidad"] .marca span { color: #7dffa0; }
:root[data-tema="navidad"] .escenario.bioma { box-shadow: 0 0 0 3px #2e8b4a; }
:root[data-tema="navidad"] .emblema { color: #fff; top: 18px; } :root[data-tema="navidad"] .emblema b { background: #2e8b4a; color: #fff; }
/* --- Tramposos: la que pone el Admin a quien hace trampas (una semana, no se puede quitar).
   Rayas de presidiario, antifaz de ladrón y sacos de botín con huellas --- */
:root[data-tema="tramposos"] { --carcasa: #3a3a40; --carcasa-sombra: #16161a; --marco: #0c0c0e; --acento: #ffd23f; --fondo: #1e1e24; --pantalla: #ecebe6; --boton: #ecebe6; }
:root[data-tema="tramposos"] body { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' shape-rendering='crispEdges'%3E%3Cpath fill='%238a6a3a' d='M12 10h8v2h-8zM10 12h12v2H10zM9 16h14v2H9zM7 18h18v10H7zM8 28h16v2H8z'/%3E%3Cpath fill='%235a4220' d='M11 14h10v2H11z'/%3E%3Cpath fill='%23ffd23f' d='M15 19h3v1h-3zM14 20h2v2h-2zM15 22h3v1h-3zM17 23h2v2h-2zM14 25h4v1h-4zM16 18h1v9h-1z'/%3E%3Cpath fill='%23ffffff' fill-opacity='0.18' d='M46 44h3v4h-3zM51 42h3v4h-3zM48 50h4v3h-4zM56 56h3v4h-3zM61 54h3v4h-3zM58 62h4v3h-4z'/%3E%3C/svg%3E") 0 0 / 72px 72px, #1e1e24; }
:root[data-tema="tramposos"] .consola { background: repeating-linear-gradient(0deg, #2a2a30 0 12px, #d8d6cf 12px 24px); }
:root[data-tema="tramposos"] .consola::before { content: ""; position: absolute; top: 3px; right: 14px; width: 55px; height: 20px; z-index: 1; pointer-events: none; image-rendering: pixelated; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='8' shape-rendering='crispEdges'%3E%3Cpath fill='%23111' d='M0 2h22v4H0zM1 1h8v1H1zM13 1h8v1h-8zM2 6h6v1H2zM14 6h6v1h-6z'/%3E%3Cpath fill='%23fff' d='M3 3h3v2H3zM16 3h3v2h-3z'/%3E%3Cpath fill='%23111' d='M0 3h-0z'/%3E%3C/svg%3E") center / 55px 20px no-repeat; }
:root[data-tema="tramposos"] .marca, :root[data-tema="tramposos"] .tuerca, :root[data-tema="tramposos"] .sobre { color: #ffd23f; text-shadow: 1px 1px 0 #0c0c0e; }
:root[data-tema="tramposos"] .marca span { color: #ff4d4d; }
:root[data-tema="tramposos"] .escenario.bioma { box-shadow: 0 0 0 3px #ffd23f; }
:root[data-tema="tramposos"] .emblema { color: #ffd23f; background: #0c0c0e; padding: 2px 6px 2px 2px; border-radius: 9px; z-index: 2; }
:root[data-tema="tramposos"] .emblema b { background: #ffd23f; color: #0c0c0e; }
/* La tienda de carcasas (Opciones → ASPECTO) */
.lista-carcasas { display: flex; flex-direction: column; gap: 8px; }
.fila-carcasa { display: flex; align-items: center; gap: 8px; }
.texto-carcasa { flex: 1; font-size: 9px; display: flex; flex-direction: column; gap: 3px; }
.texto-carcasa small { font-size: 8px; color: var(--tinta-suave); line-height: 1.5; }
.texto-carcasa small.aviso-error { color: #d42a2f; }
.muestra-carcasa { width: 28px; height: 36px; border-radius: 4px 4px 10px 4px; border: 3px solid var(--marco); flex: none; }
.muestra-pikachu { background: #f6d23a; box-shadow: inset 0 0 0 3px #3a2c12; }
.muestra-gengar { background: #5d3d92; box-shadow: inset 0 0 0 3px #ff5a7a; }
.muestra-lapras { background: #5fb6e4; box-shadow: inset 0 0 0 3px #e9f6fc; }
.muestra-inauguracion { background: linear-gradient(transparent 0 25%, #d42a2f 25% 38%, transparent 38%), linear-gradient(135deg, #f6d66a, #e9b934 50%, #d9a422); }
.muestra-navidad { background: radial-gradient(circle at 50% 0, #fff 0 6px, transparent 7px), #c8202c; }
.boton.boton-precio { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.boton-precio .icono-pokeball { width: 18px; height: 18px; margin: 0; border-width: 3px; }
.boton.boton-comprar { display: flex; justify-content: center; align-items: center; gap: 8px; }
.boton-comprar .icono-pokeball { width: 16px; height: 16px; margin: 0; }

/* ---------- Guía del juego (js/guia.js) ---------- */
.lista-guia { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lista-guia .boton { text-align: left; padding: 10px 8px; }
.guia-texto p { margin: 0 0 8px; line-height: 1.6; }
.guia-texto p:last-child { margin-bottom: 0; }
.guia-texto b { color: var(--acento); font-weight: normal; }

/* ---------- Preguntas "¿Seguro?" con la pinta del juego (preguntar() en js/ui.js) ---------- */
.velo-pregunta {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.45); border-radius: inherit; padding: 24px;
}
.pregunta { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 10px; }
.pregunta .dialogo { background: var(--pantalla); }
.pregunta .dialogo p { margin: 0 0 6px; line-height: 1.6; }
.pregunta .dialogo p:last-child { margin-bottom: 0; }

textarea { resize: vertical; line-height: 1.5; }

/* Mercado de intercambios */
.con-retrato { display: flex; align-items: center; gap: 8px; }
.con-retrato p { flex: 1; margin: 0; }
.ficha.hecha { opacity: 0.6; }

/* ---------- Cartera: monedas y Poké Balls (arriba en la pantalla principal y en la tienda) ---------- */
.icono-moneda { display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: -1px; border-radius: 50%;
  border: 2px solid #7a5a00; background: #f2c230; box-sizing: border-box; box-shadow: inset -2px -2px 0 #c99a12; }
.cartera { display: flex; align-items: center; gap: 10px; margin: 0; font: inherit; color: inherit; background: none; border: none; padding: 0; }
button.cartera { cursor: pointer; }
.cartera .dinero { display: inline-flex; align-items: center; }
.cartera .icono-pokeball { margin-right: 5px; }
.cartera.grande { justify-content: center; gap: 24px; font-size: 12px; }
.cartera.grande .icono-moneda, .cartera.grande .icono-pokeball { width: 16px; height: 16px; }
/* Vínculo, día y racha en una sola línea, debajo de las barras */
.fila-mini { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 8px; }
/* Precio con moneda en la tienda */
.boton-precio .icono-moneda { width: 16px; height: 16px; margin: 0; }
.boton.boton-precio { font-size: 12px; }
.pestanas .boton { padding: 10px 2px; font-size: 9px; }

/* ---------- Buzón ---------- */
.cartas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.carta { border: 2px solid var(--tinta); padding: 8px; font-size: 9px; line-height: 1.6; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.carta.nueva { border-color: var(--acento); border-width: 3px; }
.carta.destacada { border: var(--pixel) double var(--tinta); border-width: 6px; }
.carta.con-dibujo { flex-direction: row; align-items: center; }
.carta.con-dibujo > div { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.carta .remitente { font-size: 8px; color: var(--tinta-suave); display: flex; align-items: center; gap: 6px; }
.carta .remitente .fecha { margin-left: auto; }
.punto { display: inline-block; width: 8px; height: 8px; background: var(--acento); border: 1px solid var(--tinta); }

/* Botones que llevan a otra pantalla (en OPCIONES): texto a la izquierda y flecha a la derecha */
.boton.boton-ir { display: flex; justify-content: space-between; text-align: left; padding-left: 10px; padding-right: 10px; }
.pequeno { font-size: 8px; }
/* INTERCAMBIAR: dos opciones grandes con su explicación */
.boton.opcion-grande { display: flex; flex-direction: column; gap: 8px; padding: 14px 10px; }
.boton.opcion-grande small { font-size: 8px; line-height: 1.5; opacity: 0.9; }

/*
  Móviles estrechos (320 px): que las tres columnas de botones quepan aunque
  "GUARDERÍA" sea largo (sin min-width: 0, una columna empuja a las otras fuera). Cada columna mide según su texto.
*/
@media (max-width: 360px) {
  .pantalla[data-vista="principal"] .botones:not(.bayas) { grid-template-columns: repeat(3, auto); gap: 6px; }
  .pantalla[data-vista="principal"] .botones .boton { font-size: 7px; padding-left: 2px; padding-right: 2px; }
}

/* Guardería: CAMBIAR y LIBERAR, uno encima del otro */
.botones-ficha { display: flex; flex-direction: column; gap: 6px; flex: none; }
.boton.peligro { color: #b02020; }
/* Mercado: elegir el tipo que pides */
.botones.tipos-mercado .boton { font-size: 8px; padding-left: 2px; padding-right: 2px; }

/* ---------- Guardería en rejilla (1.16): un icono por Pokémon, al tocar se abre su ficha ---------- */
.rejilla-guarderia { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.icono-guarderia { position: relative; aspect-ratio: 1; padding: 0; background: none; cursor: pointer;
  border: 2px solid var(--tinta); display: flex; align-items: center; justify-content: center; }
.icono-guarderia:active { background: var(--tinta); }
.icono-guarderia img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.icono-guarderia .marca-shiny { position: absolute; top: 1px; right: 2px; font-size: 10px; color: #d8a800; text-shadow: 1px 1px 0 var(--tinta); }
.icono-guarderia .marca-evoluciona { position: absolute; bottom: 1px; right: 2px; font-size: 10px; color: var(--acento); text-shadow: 1px 1px 0 var(--pantalla); }
.ficha-pokemon { display: flex; flex-direction: column; align-items: center; text-align: center; }
.ficha-pokemon .retrato { width: 80px; height: 80px; image-rendering: pixelated; margin-bottom: 6px; }
.ficha-pokemon .nombre-ficha { font-size: 12px; }
.icono-guarderia .marca-eterna { position: absolute; bottom: 1px; left: 2px; font-size: 9px; color: #6a5c48; text-shadow: 1px 1px 0 var(--pantalla); }
.icono-objeto.eterna { clip-path: polygon(50% 0, 100% 40%, 80% 100%, 20% 100%, 0 40%); border: none;
  box-shadow: inset -6px -6px 0 rgba(0,0,0,0.3), inset 5px 5px 0 rgba(255,255,255,0.35); }

/* ---------- Carcasa TRÉBOL DE LA SUERTE: solo sale en la Ruleta de la Suerte (js/ruleta.js). Verde con bombillas de feria y tréboles abajo --- */
:root[data-tema="suerte"] { --carcasa: #2f9e4f; --carcasa-sombra: #1a6532; --marco: #163a20; --acento: #e0457b; --fondo: #0f2a18; }
:root[data-tema="suerte"] body { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' shape-rendering='crispEdges'%3E%3Cpath fill='%235fd47a' opacity='0.55' d='M8 8h2v2h-2zM10 8h2v2h-2zM14 8h2v2h-2zM16 8h2v2h-2zM6 10h2v2h-2zM8 10h2v2h-2zM10 10h2v2h-2zM12 10h2v2h-2zM14 10h2v2h-2zM16 10h2v2h-2zM18 10h2v2h-2zM6 12h2v2h-2zM8 12h2v2h-2zM10 12h2v2h-2zM12 12h2v2h-2zM14 12h2v2h-2zM16 12h2v2h-2zM18 12h2v2h-2zM8 14h2v2h-2zM10 14h2v2h-2zM12 14h2v2h-2zM14 14h2v2h-2zM16 14h2v2h-2zM6 16h2v2h-2zM8 16h2v2h-2zM10 16h2v2h-2zM12 16h2v2h-2zM14 16h2v2h-2zM16 16h2v2h-2zM18 16h2v2h-2zM6 18h2v2h-2zM8 18h2v2h-2zM10 18h2v2h-2zM14 18h2v2h-2zM16 18h2v2h-2zM18 18h2v2h-2zM8 20h2v2h-2zM12 20h2v2h-2zM16 20h2v2h-2zM12 22h2v2h-2zM12 24h2v2h-2zM14 24h2v2h-2z'/%3E%3Cpath fill='%23ffd84a' opacity='0.7' d='M62 14h2v2h-2zM62 16h2v2h-2zM58 18h2v2h-2zM60 18h2v2h-2zM62 18h2v2h-2zM64 18h2v2h-2zM66 18h2v2h-2zM60 20h2v2h-2zM62 20h2v2h-2zM64 20h2v2h-2zM58 22h2v2h-2zM60 22h2v2h-2zM64 22h2v2h-2zM66 22h2v2h-2z'/%3E%3Cpath fill='%23ffd84a' opacity='0.5' d='M30 58h2v2h-2zM32 58h2v2h-2zM38 58h2v2h-2zM40 58h2v2h-2zM30 60h2v2h-2zM32 60h2v2h-2zM38 60h2v2h-2zM40 60h2v2h-2zM30 62h2v2h-2zM32 62h2v2h-2zM38 62h2v2h-2zM40 62h2v2h-2zM30 64h2v2h-2zM32 64h2v2h-2zM38 64h2v2h-2zM40 64h2v2h-2zM32 66h2v2h-2zM34 66h2v2h-2zM36 66h2v2h-2zM38 66h2v2h-2zM34 68h2v2h-2zM36 68h2v2h-2z'/%3E%3Cpath fill='%235fd47a' opacity='0.45' d='M73 62h1v1h-1zM74 62h1v1h-1zM76 62h1v1h-1zM77 62h1v1h-1zM72 63h1v1h-1zM73 63h1v1h-1zM74 63h1v1h-1zM75 63h1v1h-1zM76 63h1v1h-1zM77 63h1v1h-1zM78 63h1v1h-1zM72 64h1v1h-1zM73 64h1v1h-1zM74 64h1v1h-1zM75 64h1v1h-1zM76 64h1v1h-1zM77 64h1v1h-1zM78 64h1v1h-1zM73 65h1v1h-1zM74 65h1v1h-1zM75 65h1v1h-1zM76 65h1v1h-1zM77 65h1v1h-1zM72 66h1v1h-1zM73 66h1v1h-1zM74 66h1v1h-1zM75 66h1v1h-1zM76 66h1v1h-1zM77 66h1v1h-1zM78 66h1v1h-1zM72 67h1v1h-1zM73 67h1v1h-1zM74 67h1v1h-1zM76 67h1v1h-1zM77 67h1v1h-1zM78 67h1v1h-1zM73 68h1v1h-1zM75 68h1v1h-1zM77 68h1v1h-1zM75 69h1v1h-1zM75 70h1v1h-1zM76 70h1v1h-1z'/%3E%3Cpath fill='%23ffffff' opacity='0.5' d='M12 74h1v1h-1zM12 75h1v1h-1zM10 76h1v1h-1zM11 76h1v1h-1zM12 76h1v1h-1zM13 76h1v1h-1zM14 76h1v1h-1zM11 77h1v1h-1zM12 77h1v1h-1zM13 77h1v1h-1zM10 78h1v1h-1zM11 78h1v1h-1zM13 78h1v1h-1zM14 78h1v1h-1z'/%3E%3C/svg%3E") 0 0 / 96px 96px, #0f2a18; }
:root[data-tema="suerte"] .consola { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='40' shape-rendering='crispEdges'%3E%3Cpath fill='%2313562a' opacity='0.85' d='M9 4h3v3h-3zM12 4h3v3h-3zM18 4h3v3h-3zM21 4h3v3h-3zM6 7h3v3h-3zM9 7h3v3h-3zM12 7h3v3h-3zM15 7h3v3h-3zM18 7h3v3h-3zM21 7h3v3h-3zM24 7h3v3h-3zM6 10h3v3h-3zM9 10h3v3h-3zM12 10h3v3h-3zM15 10h3v3h-3zM18 10h3v3h-3zM21 10h3v3h-3zM24 10h3v3h-3zM9 13h3v3h-3zM12 13h3v3h-3zM15 13h3v3h-3zM18 13h3v3h-3zM21 13h3v3h-3zM6 16h3v3h-3zM9 16h3v3h-3zM12 16h3v3h-3zM15 16h3v3h-3zM18 16h3v3h-3zM21 16h3v3h-3zM24 16h3v3h-3zM6 19h3v3h-3zM9 19h3v3h-3zM12 19h3v3h-3zM18 19h3v3h-3zM21 19h3v3h-3zM24 19h3v3h-3zM9 22h3v3h-3zM15 22h3v3h-3zM21 22h3v3h-3zM15 25h3v3h-3zM15 28h3v3h-3zM18 28h3v3h-3z'/%3E%3Cpath fill='%238be89c' opacity='0.7' d='M38 18h2v2h-2zM40 18h2v2h-2zM44 18h2v2h-2zM46 18h2v2h-2zM36 20h2v2h-2zM38 20h2v2h-2zM40 20h2v2h-2zM42 20h2v2h-2zM44 20h2v2h-2zM46 20h2v2h-2zM48 20h2v2h-2zM36 22h2v2h-2zM38 22h2v2h-2zM40 22h2v2h-2zM42 22h2v2h-2zM44 22h2v2h-2zM46 22h2v2h-2zM48 22h2v2h-2zM38 24h2v2h-2zM40 24h2v2h-2zM42 24h2v2h-2zM44 24h2v2h-2zM46 24h2v2h-2zM36 26h2v2h-2zM38 26h2v2h-2zM40 26h2v2h-2zM42 26h2v2h-2zM44 26h2v2h-2zM46 26h2v2h-2zM48 26h2v2h-2zM36 28h2v2h-2zM38 28h2v2h-2zM40 28h2v2h-2zM44 28h2v2h-2zM46 28h2v2h-2zM48 28h2v2h-2zM38 30h2v2h-2zM42 30h2v2h-2zM46 30h2v2h-2zM42 32h2v2h-2zM42 34h2v2h-2zM44 34h2v2h-2z'/%3E%3Cpath fill='%23ffe066' opacity='0.9' d='M46 2h1v1h-1zM46 3h1v1h-1zM44 4h1v1h-1zM45 4h1v1h-1zM46 4h1v1h-1zM47 4h1v1h-1zM48 4h1v1h-1zM45 5h1v1h-1zM46 5h1v1h-1zM47 5h1v1h-1zM44 6h1v1h-1zM45 6h1v1h-1zM47 6h1v1h-1zM48 6h1v1h-1z'/%3E%3C/svg%3E") left 0 bottom 6px / 56px 40px repeat-x, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='40' shape-rendering='crispEdges'%3E%3Cpath fill='%2313562a' opacity='0.85' d='M9 4h3v3h-3zM12 4h3v3h-3zM18 4h3v3h-3zM21 4h3v3h-3zM6 7h3v3h-3zM9 7h3v3h-3zM12 7h3v3h-3zM15 7h3v3h-3zM18 7h3v3h-3zM21 7h3v3h-3zM24 7h3v3h-3zM6 10h3v3h-3zM9 10h3v3h-3zM12 10h3v3h-3zM15 10h3v3h-3zM18 10h3v3h-3zM21 10h3v3h-3zM24 10h3v3h-3zM9 13h3v3h-3zM12 13h3v3h-3zM15 13h3v3h-3zM18 13h3v3h-3zM21 13h3v3h-3zM6 16h3v3h-3zM9 16h3v3h-3zM12 16h3v3h-3zM15 16h3v3h-3zM18 16h3v3h-3zM21 16h3v3h-3zM24 16h3v3h-3zM6 19h3v3h-3zM9 19h3v3h-3zM12 19h3v3h-3zM18 19h3v3h-3zM21 19h3v3h-3zM24 19h3v3h-3zM9 22h3v3h-3zM15 22h3v3h-3zM21 22h3v3h-3zM15 25h3v3h-3zM15 28h3v3h-3zM18 28h3v3h-3z'/%3E%3Cpath fill='%238be89c' opacity='0.7' d='M38 18h2v2h-2zM40 18h2v2h-2zM44 18h2v2h-2zM46 18h2v2h-2zM36 20h2v2h-2zM38 20h2v2h-2zM40 20h2v2h-2zM42 20h2v2h-2zM44 20h2v2h-2zM46 20h2v2h-2zM48 20h2v2h-2zM36 22h2v2h-2zM38 22h2v2h-2zM40 22h2v2h-2zM42 22h2v2h-2zM44 22h2v2h-2zM46 22h2v2h-2zM48 22h2v2h-2zM38 24h2v2h-2zM40 24h2v2h-2zM42 24h2v2h-2zM44 24h2v2h-2zM46 24h2v2h-2zM36 26h2v2h-2zM38 26h2v2h-2zM40 26h2v2h-2zM42 26h2v2h-2zM44 26h2v2h-2zM46 26h2v2h-2zM48 26h2v2h-2zM36 28h2v2h-2zM38 28h2v2h-2zM40 28h2v2h-2zM44 28h2v2h-2zM46 28h2v2h-2zM48 28h2v2h-2zM38 30h2v2h-2zM42 30h2v2h-2zM46 30h2v2h-2zM42 32h2v2h-2zM42 34h2v2h-2zM44 34h2v2h-2z'/%3E%3Cpath fill='%23ffe066' opacity='0.9' d='M46 2h1v1h-1zM46 3h1v1h-1zM44 4h1v1h-1zM45 4h1v1h-1zM46 4h1v1h-1zM47 4h1v1h-1zM48 4h1v1h-1zM45 5h1v1h-1zM46 5h1v1h-1zM47 5h1v1h-1zM44 6h1v1h-1zM45 6h1v1h-1zM47 6h1v1h-1zM48 6h1v1h-1z'/%3E%3C/svg%3E") left 28px bottom 46px / 56px 40px repeat-x, linear-gradient(160deg, #46b964 0 30%, #2f9e4f 30% 75%, #26874a 75%); }
:root[data-tema="suerte"] .consola::after { content: ""; position: absolute; inset: 5px; border-radius: 9px 9px 44px 9px; pointer-events: none; border: 5px dotted #ffe066; filter: drop-shadow(0 0 3px #ffe066); animation: bombillas 0.8s steps(2) infinite; }
@keyframes bombillas { 50% { border-color: #fff6c0; } }
:root[data-tema="suerte"] .marca, :root[data-tema="suerte"] .tuerca, :root[data-tema="suerte"] .sobre { color: #fff6d8; }
:root[data-tema="suerte"] .marca span { color: #ffe066; text-shadow: 2px 2px 0 #1a6532; }
:root[data-tema="suerte"] .escenario.bioma { box-shadow: 0 0 0 3px #ffe066; }
:root[data-tema="suerte"] .emblema { color: #fff6d8; top: 12px; left: 18px; } :root[data-tema="suerte"] .emblema b { background: #ffe066; color: #1a6532; }

:root[data-tema="suerte"] .marca { position: relative; text-shadow: 0 0 4px #1a6532, 0 0 4px #1a6532; }

/* ---------- RULETA DE LA SUERTE (pantalla-ruleta.js) ---------- */
.ticket { display: inline-block; position: relative; width: 30px; height: 18px; vertical-align: middle; background: #ffd84a; border: 2px solid #7a5a00; box-shadow: inset -2px -2px 0 #e0a800; }
.ticket::before, .ticket::after { content: ""; position: absolute; top: 4px; width: 6px; height: 6px; background: var(--pantalla); border: 2px solid #7a5a00; border-radius: 50%; }
.ticket::before { left: -5px; } .ticket::after { right: -5px; }
.ticket b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: normal; color: #7a5a00; }
.boton-ruleta { display: flex; align-items: center; justify-content: center; gap: 10px; }
.tickets-ruleta { text-align: center; font-size: 10px; margin: 0; }
.rueda { position: relative; width: min(270px, 100%); aspect-ratio: 1; margin: 6px auto 0; flex-shrink: 0; }
.rueda-giro { width: 100%; height: 100%; }
.rueda-giro svg { width: 100%; height: 100%; display: block; }
.flecha-rueda { position: absolute; left: 50%; top: -8px; z-index: 2; transform: translateX(-50%); width: 0; height: 0;
  border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 24px solid var(--tinta); }
.flecha-rueda::after { content: ""; position: absolute; left: -8px; top: -21px; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 14px solid #e03838; }
.boton-girar { font-size: 12px; padding: 12px; }
.premio-ruleta { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.premio-ruleta.raro { border-color: #d4a017; }
.premio-nombre { font-size: 13px; }
.icono-moneda.premio-icono, .icono-pokeball.premio-icono { width: 40px; height: 40px; margin: 0; border-width: 4px; }
.icono-objeto.premio-icono { width: 40px; height: 40px; margin: 0; }
.premio-carcasa { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; font-size: 26px; background: #2f9e4f; color: #ffe066; border: 4px dotted #ffe066; border-radius: 8px; }
.brillo-premio { display: flex; align-items: center; justify-content: center; width: 120px; height: 120px; border: 3px solid var(--tinta);
  background: repeating-conic-gradient(#ffe68a 0 15deg, #fff6c8 15deg 30deg); }
.brillo-premio canvas { image-rendering: pixelated; width: 96px; height: auto; }
.tabla-premios { width: 100%; border-collapse: collapse; font-size: 8px; }
.tabla-premios td { padding: 6px 4px; border-bottom: 2px dashed #c8c8b8; vertical-align: top; }
.tabla-premios td:last-child { text-align: right; white-space: nowrap; }
.tabla-premios tr.raro td { color: #a06a00; }
.tabla-premios small { display: block; margin: 2px 0 0 20px; color: var(--tinta-suave); font-size: 7px; }
.chip-premio { display: inline-block; width: 12px; height: 12px; border: 2px solid #222; vertical-align: -2px; margin-right: 6px; }
.chip-premio.arcoiris { background: linear-gradient(90deg, #ff6b6b, #ffd84a, #6bd86b, #6bb0ff) !important; }

/* ---------- MÁQUINA DE GANCHO (pantalla-gancho.js) ---------- */
/* Por dentro mide 280 × 290 (como en gancho.js) y se escala al ancho de la pantalla */
.urna { position: relative; width: 100%; height: 290px; overflow: hidden; flex-shrink: 0;
  border: 4px solid var(--tinta); box-shadow: inset 0 0 0 4px #fff; background: linear-gradient(#cfeaf7, #e9f6fb); }
.urna-dentro { position: absolute; left: 0; top: 0; width: 280px; height: 290px; transform-origin: 0 0; }
.urna-rail { position: absolute; left: 0; right: 0; top: 10px; height: 6px; background: #686878; }
.urna-brillo { position: absolute; top: 30px; left: 14px; width: 10px; height: 140px; background: rgba(255, 255, 255, 0.7); transform: skewX(-12deg); }
.urna-suelo { position: absolute; left: 62px; right: 0; bottom: 0; height: 44px; background: #f6d9a8; border-top: 4px solid var(--tinta); }
.urna-salida { position: absolute; left: 0; bottom: 0; width: 62px; height: 70px; z-index: 4; background: #3a3a48;
  border-right: 4px solid var(--tinta); border-top: 4px solid var(--tinta); color: #ffd84a; font-size: 6px;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; }
.capsula { position: absolute; z-index: 1; border-radius: 50%; border: 3px solid var(--tinta); overflow: hidden;
  display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.capsula::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 50%; background: rgba(255, 255, 255, 0.5); border-bottom: 3px solid var(--tinta); }
.capsula > * { position: relative; z-index: 1; }
.capsula .icono-moneda, .capsula .icono-pokeball { width: 55%; height: 55%; margin: 0; }
.capsula .icono-objeto { width: 60%; height: 60%; margin: 0; }
.capsula .huevo { width: 55%; height: auto; image-rendering: pixelated; }
.capsula.arcoiris { background: linear-gradient(90deg, #ff6b6b, #ffd84a, #6bd86b, #6bb0ff) !important; }
.estrella-capsula { color: #a06a00; font-size: 12px; line-height: 1; text-shadow: 0 0 2px #fff; }
.gancho { position: absolute; left: 0; top: 12px; width: 44px; z-index: 2; pointer-events: none; }
.gancho .cable { width: 4px; margin: 0 auto; background: var(--tinta); }
.gancho .pinza { display: block; margin: 0 auto; }
.bocadillo-gancho { position: absolute; z-index: 5; background: #fff; border: 3px solid var(--tinta); padding: 3px 6px; font-size: 8px; }
.fila-gancho { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 8px; }
.fuerza-gancho { display: flex; align-items: center; gap: 8px; }
.barras-fuerza { display: flex; gap: 3px; }
.barras-fuerza i { width: 16px; height: 12px; border: 2px solid var(--tinta); background: #e6e6d6; }
.barras-fuerza i.on { background: #5aa0e8; }
.boton-gancho { font-size: 12px; padding: 12px; }
.aviso-variocolor { margin: 0; text-align: center; font-size: 9px; color: #a06a00; }
img.huevo.premio-icono { width: 40px; height: auto; image-rendering: pixelated; }
.tabla-premios th { font-size: 7px; font-weight: normal; color: var(--tinta-suave); text-align: left; padding: 0 4px 4px; border-bottom: 2px solid var(--tinta); }
.tabla-premios th:last-child { text-align: right; }
.aviso-gancho { margin: 0; min-height: 26px; font-size: 8px; line-height: 1.6; text-align: center; }
.pantalla[data-vista="gancho"] { gap: 12px; }
