/* ============================================================
   POKÉ PALETTE · HOJA DE ESTILOS
   Estructura: variables/base → componentes históricos estables →
   ajustes consolidados → Game Boy (última sección).
   Las animaciones @keyframes están SOLO en animations.css.
   Importante: los componentes de la v22 preservan su prioridad de
   cascada para no recuperar distribuciones obsoletas.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;500;600;700&family=Silkscreen:wght@400;700&family=VT323&display=swap");

:root {
  color-scheme: light;
  --page-bg: #10294b;
  --panel-bg: #fafeff;
  --ink: #182b43;
  --accent: #e85b3f;
  --accent-dark: #a83a2b;
  --blue: #3476a5;
  --border: #183c6b;
  --muted: #617187;
  --pixel-shadow: 5px 5px 0 rgba(9, 25, 48, .28);
}
body[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #101522;
  --panel-bg: #252d40;
  --ink: #edf2ff;
  --accent: #8a83ed;
  --accent-dark: #5952ad;
  --blue: #536e9c;
  --border: #a4b4d5;
  --muted: #b0bdd3;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; padding: 28px 16px; display: grid; place-items: center;
  color: var(--ink); background-color: var(--page-bg);
  background-image: linear-gradient(45deg, rgba(255,255,255,.035) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.035) 75%),
                    linear-gradient(45deg, rgba(255,255,255,.035) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.035) 75%);
  background-position: 0 0, 8px 8px; background-size: 16px 16px;
  font-family: "Pixelify Sans", monospace; transition: background-color .2s, color .2s;
}
button, input { font: inherit; }
.game-shell { width: min(100%, 720px); }
.topbar { display:flex; align-items:center; justify-content:space-between; color:#fff; margin:0 0 12px; letter-spacing:1px; font-size:15px; }
.brand { display:flex; align-items:center; gap:10px; font-weight:700; }
.brand-mark { display:grid; place-items:center; width:34px; height:34px; color:#fff; background:var(--accent); border:3px solid #fff; box-shadow:3px 3px 0 #071a32; font-size:14px; }
.theme-switch-wrap { display:flex; align-items:center; gap:9px; }
.theme-label { font-size:11px; }
.theme-switch { width:54px; height:42px; display:grid; place-items:center; padding:2px; border:2px solid #fff; border-radius:0; background:#183c6b; cursor:pointer; box-shadow:3px 3px 0 #071a32; }
.theme-switch img { width:44px; height:36px; object-fit:contain; image-rendering:pixelated; }
.round-strip { display:flex; align-items:center; justify-content:center; gap:clamp(7px, 2vw, 16px); margin:0 auto 10px; padding:9px 12px; width:max-content; max-width:100%; border:2px solid #8ca8c5; background:#183c6b; color:#fff; box-shadow:4px 4px 0 rgba(0,0,0,.2); }
.round-dot { min-width:22px; text-align:center; font-size:17px; font-weight:700; }
.round-dot img { display:block; width:35px; height:35px; object-fit:contain; image-rendering:pixelated; }
.round-separator { color:#9db8d6; font-size:14px; }
.round-counter { width:max-content; margin:0 auto 14px; padding:7px 12px; border:2px solid #8ca8c5; background:#183c6b; color:#fff; font-size:13px; }
.panel { background:var(--panel-bg); border:4px solid var(--border); box-shadow:8px 8px 0 rgba(0,0,0,.25); padding:clamp(22px,5vw,42px); }
.intro-panel,.result-panel { text-align:center; }
.eyebrow { color:var(--accent); font-size:13px; font-weight:700; letter-spacing:2px; margin:0 0 12px; }
h1 { font-size:clamp(29px,7vw,48px); line-height:1.05; margin:0 0 20px; }
h2 { font-size:clamp(23px,5vw,32px); margin:0; }
.intro-copy { max-width:490px; margin:0 auto 25px; color:var(--muted); line-height:1.6; font-size:17px; }
.field-label { display:block; text-align:left; font-size:14px; margin:0 0 8px; font-weight:700; }
.intro-panel .field-label { max-width:390px; margin:0 auto 8px; }
.pixel-input { width:100%; min-width:0; border:3px solid var(--border); border-radius:0; background:var(--panel-bg); color:var(--ink); padding:13px 12px; outline:none; box-shadow:inset 3px 3px 0 rgba(0,0,0,.08); font-size:16px; }
.pixel-input:focus { border-color:var(--accent); }
.intro-panel .pixel-input { max-width:390px; margin-bottom:18px; }
.pixel-button { border:3px solid var(--border); border-radius:0; padding:12px 17px; cursor:pointer; text-transform:uppercase; font-weight:700; font-size:15px; box-shadow:4px 4px 0 rgba(9,25,48,.28); transition:transform .08s,box-shadow .08s; }
.pixel-button:active { transform:translate(3px,3px); box-shadow:1px 1px 0 rgba(9,25,48,.28); }
.pixel-button:disabled { opacity:.5; cursor:not-allowed; }
.primary { color:white; background:var(--accent); border-color:var(--accent-dark); }
.secondary { color:white; background:var(--blue); border-color:var(--border); }
.intro-panel .pixel-button,.result-panel .pixel-button { display:block; margin:0 auto; }
.tiny-note { color:var(--muted); font-size:13px; margin:22px 0 0; line-height:1.5; }
.centered-note { text-align:center; }
.hidden { display:none !important; }
.game-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:25px; }
.score-chip { border:2px solid var(--border); padding:8px 12px; white-space:nowrap; font-size:13px; }
.score-chip strong { color:var(--accent); font-size:21px; margin-left:5px; }
.palette-frame { padding:7px; border:3px solid var(--border); background:#d7d1bb; box-shadow:inset 3px 3px 0 rgba(0,0,0,.12); }
.palette { height:clamp(145px,30vw,220px); display:flex; overflow:hidden; background:#ddd; }
.palette-swatch { flex:0 0 auto; min-width:0; width:100%; transition:width .78s cubic-bezier(.22,1,.36,1); }
.palette-swatch.swatch-enter { animation:swatch-push-in .78s cubic-bezier(.22,1,.36,1) both; transform-origin:right center; }


.guess-row.shake { animation:answer-shake .34s cubic-bezier(.36,.07,.19,.97) both; }


.clue-status { text-align:center; margin:13px 0 18px; color:var(--muted); font-size:14px; letter-spacing:.5px; }
.revealed-pokemon { display:flex; flex-direction:column; align-items:center; gap:5px; margin:0 auto 17px; min-height:130px; }
.revealed-pokemon img { width:116px; height:116px; object-fit:contain; image-rendering:pixelated; }
.reveal-message { text-align:center; font-size:19px; line-height:1.45; font-weight:700; }
.reveal-message .pokemon-answer { display:block; font-style:italic; }
.reveal-message .points-line { display:block; font-size:29px; margin-top:2px; }
.perfect-rainbow {
  display:inline-block; background:linear-gradient(to right,#ffb3ba,#ffdeb8,#ffffb8,#b8ffbc,#b8e0ff,#d7b8ff,#ffb3ba);
  background-size:200% 100%; background-clip:text; -webkit-background-clip:text; color:transparent;
}
.guess-row { display:flex; gap:10px; }
.guess-row .pixel-button { flex:0 0 auto; }
.feedback { min-height:28px; margin:15px 0 0; font-size:16px; font-weight:600; text-align:center; }
.feedback.good { color:#267044; }
.feedback.bad { color:#c44a3b; }
.game-actions { min-height:48px; margin-top:10px; text-align:center; }
.round-dot img.missed { filter:brightness(0) saturate(100%) opacity(.55); }
.round-dot img.solved { filter:none; }
.final-score { display:grid; justify-items:center; gap:4px; margin:26px auto; padding:22px; max-width:300px; border:3px solid var(--border); background:var(--panel-bg); }
.final-score span { font-size:14px; }
.final-score strong { font-size:64px; line-height:1; color:var(--accent); }
.final-score small { color:var(--muted); font-size:13px; }
.footer { display:flex; justify-content:space-between; color:#b8c9dc; font-size:11px; letter-spacing:1px; padding:17px 2px 0; }
@media(max-width:520px) {
  body { padding:16px 10px; } .topbar { font-size:12px; } .panel { padding:22px 17px; }
  .guess-row { flex-direction:column; } .guess-row .pixel-button { width:100%; }
  .game-heading { align-items:flex-start; } .round-dot img { width:28px; height:28px; }
}


/* Opciones de partida */
.game-options { max-width:490px; margin:0 auto 22px; padding:16px; border:3px solid var(--border); background:rgba(127,145,165,.09); text-align:left; }
.option-row { display:flex; align-items:center; gap:14px; padding-bottom:15px; }
.option-description,.option-heading { display:flex; flex-direction:column; gap:3px; }
.option-description strong,.option-heading strong { font-size:15px; }
.option-description span,.option-heading span { color:var(--muted); font-size:12px; line-height:1.4; }
.toggle { position:relative; display:inline-flex; flex:0 0 auto; width:48px; height:27px; cursor:pointer; }
.toggle input { position:absolute; opacity:0; width:1px; height:1px; }
.toggle-track { width:48px; height:27px; border:2px solid var(--border); background:#8994a5; transition:background .2s; }
.toggle-track::after { content:""; display:block; width:17px; height:17px; margin:3px; background:#fff; box-shadow:2px 2px 0 rgba(0,0,0,.2); transition:transform .2s; }
.toggle input:checked + .toggle-track { background:var(--accent); }
.toggle input:checked + .toggle-track::after { transform:translateX(19px); }
.toggle input:focus-visible + .toggle-track { outline:3px solid var(--blue); outline-offset:3px; }
.generation-option { border-top:2px dashed rgba(100,120,145,.45); padding-top:13px; }
.generation-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; margin-top:12px; }
.generation-choice { position:relative; cursor:pointer; }
.generation-choice input { position:absolute; opacity:0; }
.generation-choice span { display:grid; place-items:center; min-height:37px; padding:5px; border:2px solid var(--border); color:var(--muted); font-size:13px; background:transparent; transition:background .18s,color .18s,transform .18s; }
.generation-choice input:checked + span { color:#fff; background:var(--blue); }
.generation-choice input:focus-visible + span { outline:3px solid var(--accent); outline-offset:2px; }
.pixel-button { transition:transform .14s ease,box-shadow .14s ease,filter .14s ease; }
.pixel-button:not(:disabled):hover { transform:translate(-2px,-2px); box-shadow:6px 6px 0 rgba(9,25,48,.3); filter:brightness(1.08); }
.pixel-button:not(:disabled):active { transform:translate(3px,3px) scale(.98); box-shadow:1px 1px 0 rgba(9,25,48,.28); filter:brightness(.96); }
.theme-switch { width:98px; height:82px; overflow:visible; transition:transform .14s ease,box-shadow .14s ease; }
.theme-switch:hover { transform:translateY(-2px); box-shadow:3px 5px 0 #071a32; }
.theme-switch:active { transform:translate(2px,2px); box-shadow:1px 1px 0 #071a32; }
.theme-switch img { width:88px; height:72px; max-width:none; }
.palette-swatch { position:relative; display:flex; align-items:flex-end; justify-content:center; }
.swatch-hex { display:block; margin:0 0 8px; padding:4px 6px; color:#fff; background:rgba(0,0,0,.58); font:600 12px/1.2 monospace; letter-spacing:.3px; opacity:0; animation:hex-fade-in .55s ease .2s forwards; }


.palette-swatch.swatch-enter .swatch-hex { animation-delay:.35s; }
@media(max-width:520px) { .generation-grid { gap:5px; } .generation-choice span { font-size:12px; } }

/* Tipografía y escala general */
body { font-family:"Silkscreen", monospace; font-size:15px; }
h1,h2,.brand,.eyebrow,.round-counter,.field-label,.pixel-button,.theme-label { font-family:"Pixelify Sans", monospace; }
.game-shell { width:min(100%, 900px); }
.panel { padding:clamp(26px,5vw,48px); }
.intro-copy { font-size:18px; }
.pixel-input { font-size:17px; padding:15px 14px; }
.pixel-button { font-size:17px; padding:14px 19px; }
.tiny-note { font-size:14px; }
.option-description strong,.option-heading strong { font-size:17px; }
.option-description span,.option-heading span { font-size:14px; }
.generation-choice span { min-height:42px; font-size:15px; }
.round-dot img { width:43px; height:43px; }
.palette { height:clamp(165px,32vw,250px); }
/* Autocompletado estilo Pokédex */
.autocomplete-wrap { position:relative; flex:1 1 auto; min-width:0; }
.autocomplete-wrap .pixel-input { display:block; }
.suggestions { position:absolute; z-index:20; top:calc(100% + 5px); left:0; right:0; max-height:310px; overflow-y:auto; border:3px solid var(--border); background:var(--panel-bg); box-shadow:5px 5px 0 rgba(0,0,0,.25); }
.suggestion-item { display:grid; grid-template-columns:54px 76px 1fr; align-items:center; gap:10px; width:100%; min-height:58px; padding:5px 12px; border:0; border-bottom:1px solid rgba(100,120,145,.3); background:transparent; color:var(--ink); text-align:left; cursor:pointer; font:14px "Silkscreen",monospace; }
.suggestion-item:hover,.suggestion-item.active { background:rgba(80,130,180,.2); }
.suggestion-item img { width:52px; height:48px; object-fit:contain; image-rendering:pixelated; }
.suggestion-number { color:var(--muted); font-size:12px; }
.suggestion-name { text-transform:capitalize; }
.shiny-charm { width:48px; height:48px; object-fit:contain; image-rendering:pixelated; }
/* Mejor contraste del arcoíris en tema claro; el tema oscuro conserva su paleta */
body:not([data-theme="dark"]) .perfect-rainbow { background-image:linear-gradient(to right,#c62828,#b45309,#927000,#18743b,#145da0,#6336a5,#c62828); }
@media(max-width:520px) {
  .suggestion-item { grid-template-columns:46px 65px 1fr; gap:6px; font-size:12px; }
  .suggestion-item img { width:44px; height:42px; }
  .shiny-charm { width:40px; height:40px; }
}


/* v5: portada, herramientas y feedback */
.brand-mark-image { width:38px; height:38px; object-fit:cover; border:2px solid #fff; box-shadow:3px 3px 0 #071a32; image-rendering:auto; }
.intro-panel { position:relative; overflow:visible; opacity:1; transform:scale(1); transition:padding .45s cubic-bezier(.22,1,.36,1), min-height .45s,opacity .22s ease,transform .22s ease; }
.intro-panel.intro-leaving { opacity:0; transform:scale(.97); }
.intro-tools { position:absolute; top:12px; right:12px; display:flex; gap:7px; z-index:3; }
.tool-button,.modal-close { display:grid; place-items:center; width:39px; height:39px; border:2px solid var(--border); border-radius:0; color:var(--ink); background:var(--panel-bg); box-shadow:3px 3px 0 rgba(9,25,48,.25); cursor:pointer; font:700 22px "Pixelify Sans",monospace; transition:transform .16s,filter .16s,box-shadow .16s; }
.tool-button:hover,.modal-close:hover { transform:translateY(-2px) scale(1.06); filter:brightness(1.08); box-shadow:5px 5px 0 rgba(9,25,48,.25); }
.tool-button:active,.modal-close:active { transform:translate(2px,2px) scale(.97); box-shadow:1px 1px 0 rgba(9,25,48,.25); }
.intro-brandline { margin-top:14px; margin-bottom:0; font-size:clamp(27px,6vw,43px); color:var(--ink); letter-spacing:1px; }
.intro-subtitle { margin:3px 0 20px; color:var(--accent); font-size:16px; }
.intro-panel h1 { font-size:clamp(27px,5.6vw,43px); }
.trainer-label { max-width:490px!important; text-align:center!important; margin:0 auto 9px!important; }
.trainer-input { max-width:490px!important; min-height:59px; text-align:center; margin-bottom:18px!important; font-size:20px!important; }
.game-options { display:flex; flex-direction:column; gap:0; max-width:560px; padding:0; overflow:visible; }
.generation-option { border:0; padding:16px; }
.generation-grid { margin-top:13px; gap:10px; }
.generation-choice { position:relative; z-index:1; }
.generation-choice span { border-width:2px; color:#fff; font-weight:700; text-shadow:1px 1px 0 rgba(0,0,0,.45); box-shadow:3px 3px 0 rgba(0,0,0,.2); }
.generation-choice:hover { z-index:8; }
.generation-choice:hover span { transform:scale(1.07); filter:brightness(1.12); box-shadow:5px 5px 0 rgba(0,0,0,.22); }
.generation-tooltip { position:absolute; left:50%; bottom:calc(100% + 10px); transform:translate(-50%,6px); width:154px; padding:9px 7px; border:2px solid #172c45; background:#fff5d7; color:#172c45; text-align:center; font:700 12px/1.5 "Pixelify Sans",monospace; box-shadow:3px 3px 0 rgba(0,0,0,.22); opacity:0; visibility:hidden; pointer-events:none; transition:opacity .14s,transform .14s; }
.generation-tooltip::after { content:""; position:absolute; top:100%; left:calc(50% - 7px); border:7px solid transparent; border-top-color:#172c45; }
.generation-choice:hover .generation-tooltip { opacity:1; visibility:visible; transform:translate(-50%,0); }
.gen-kanto span { background:linear-gradient(115deg,#d83b35 0 34%,#2875ce 34% 67%,#e5bd35 67%); border-color:#9b302c; }
.gen-johto span { background:linear-gradient(115deg,#d4ad35 0 50%,#aeb8c5 50%); border-color:#8d762c; }
.gen-hoenn span { background:linear-gradient(115deg,#183e77 0 33%,#c83d38 33% 66%,#31945c 66%); border-color:#17365f; }
.gen-sinnoh span { background:linear-gradient(115deg,#4c91d4 0 33%,#d98db5 33% 66%,#737d8d 66%); border-color:#536c8d; }
.gen-unova span { background:linear-gradient(115deg,#30343b 0 50%,#f1f1eb 50%); color:#222!important; text-shadow:none!important; border-color:#777; }
.gen-kalos span { background:linear-gradient(115deg,#167fce 0 50%,#d64a55 50%); border-color:#315d91; }
.gen-alola span { background:linear-gradient(115deg,#ed9b35 0 50%,#7545a4 50%); border-color:#9a642a; }
.gen-galar span { background:linear-gradient(115deg,#df7c88 0 50%,#77b6df 50%); border-color:#6489a6; }
.gen-paldea span { background:linear-gradient(115deg,#c64a43 0 50%,#7650a8 50%); border-color:#764c7f; }
.generation-choice input:not(:checked)+span { filter:grayscale(.75) brightness(.78); opacity:.72; }
.shiny-option-row { border-top:2px dashed rgba(100,120,145,.45); padding:15px 16px 16px; }
.restart-game { display:block; margin:12px auto 0; }
.game-panel { animation:game-panel-in .48s cubic-bezier(.22,1,.36,1) both; }


.round-strip:not(.hidden),.round-counter:not(.hidden) { animation:round-ui-in .4s ease both; }


.modal-backdrop { position:fixed; inset:0; z-index:100; display:grid; place-items:start center; padding:7vh 16px 24px; overflow:auto; background:rgba(5,13,27,.72);  }
.modal-backdrop.hidden { display:none!important; }
.modal-card { position:relative; width:min(100%,650px); max-height:86vh; overflow:auto; padding:clamp(22px,4vw,36px); border:4px solid var(--border); background:var(--panel-bg); color:var(--ink); box-shadow:8px 8px 0 rgba(0,0,0,.35);  }
.modal-card h2 { margin:0 0 16px; }
.modal-card p,.modal-card li { font-size:15px; line-height:1.65; color:var(--muted); }
.modal-card ul { padding-left:22px; margin-bottom:22px; }
.modal-close { position:absolute; top:10px; right:10px; font-size:25px; }




.modal-backdrop.closing { animation:backdrop-out .18s ease both; }
.modal-backdrop.closing .modal-card {  }




.tool-search-row { display:flex; gap:9px; margin:18px 0 8px; }
.tool-search-row .pixel-input { flex:1; min-width:0; }
.tool-search-row .pixel-button { flex:0 0 auto; }
.tool-status { min-height:22px; margin:8px 0 12px!important; font-size:13px!important; }
.tool-pokemon { display:flex; align-items:center; justify-content:center; gap:12px; margin:10px auto; text-transform:capitalize; font-size:18px; }
.tool-pokemon img { width:72px; height:72px; object-fit:contain; image-rendering:pixelated; }
.tool-palette { height:115px; }
.tool-palette-frame { margin:10px 0 18px; }
.debug-source-wrap { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:15px; margin:15px 0; }
.debug-source-wrap>div { min-width:0; font-size:12px; }
.debug-source-wrap img { display:block; width:100%; height:175px; margin-top:7px; object-fit:contain; background:rgba(128,145,165,.12); border:2px solid var(--border); }
.debug-quality-label { display:flex; justify-content:space-between; margin:15px 0 5px; font-size:14px; }











@media(max-width:560px) {
  .intro-tools { top:8px; right:8px; }
  .intro-brandline { margin-top:34px; }
  .tool-search-row { flex-direction:column; }
  .tool-search-row .pixel-button { width:100%; }
  .debug-source-wrap { grid-template-columns:1fr; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; transition-duration:.01ms!important; }
}


/* Poké Palette v6 refinements */
.brand-mark-image {
  width:42px; height:42px; object-fit:contain; border:0; border-radius:0;
  background:transparent; box-shadow:none; image-rendering:auto;
}
.gen-unova span { color:#fff!important; text-shadow:1px 1px 0 rgba(0,0,0,.5)!important; }
.generation-choice:focus-within .generation-tooltip { opacity:0; visibility:hidden; }
.generation-choice:hover .generation-tooltip { opacity:1; visibility:visible; }
.restart-game {
  display:block; width:auto; margin:5px auto 0; padding:8px 12px;
  font-size:12px; color:#fff; background:#c83232; border-color:#8f2020;
  box-shadow:3px 3px 0 rgba(80,0,0,.28);
}
.restart-game:hover { background:#e04444; }
.game-actions { margin-top:8px; min-height:42px; }
.free-pokedex-list {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px;
  max-height:38vh; overflow-y:auto; padding:5px; margin:8px 0 14px;
  border:2px solid var(--border); background:rgba(100,120,145,.09);
}
.free-pokemon-item {
  display:grid; grid-template-columns:52px 68px minmax(0,1fr); align-items:center;
  gap:7px; min-height:56px; padding:4px 7px; border:1px solid rgba(100,120,145,.25);
  background:var(--panel-bg); color:var(--ink); text-align:left; cursor:pointer;
  font:13px "Silkscreen",monospace; text-transform:capitalize;
}
.free-pokemon-item:hover,.free-pokemon-item:focus-visible { background:rgba(80,130,180,.2); outline:2px solid var(--accent); }
.free-pokemon-item img { width:50px; height:48px; object-fit:contain; image-rendering:pixelated; }
.debug-card { width:min(100%,760px); }



@media(max-width:560px) {
  .free-pokedex-list { grid-template-columns:1fr; max-height:34vh; }
  .free-pokemon-item { grid-template-columns:48px 65px 1fr; }
  .brand-mark-image { width:42px; height:42px; }
}


/* Ajustes de interfaz y nuevas opciones v7 */
.brand { font-size:1.06em; gap:11px; }
.brand-mark-image { width:44px; height:44px; }
.theme-switch-wrap { margin-left:auto; justify-content:flex-end; gap:7px; }
.theme-label { font-size:12px; }
.theme-switch { border-width:1px; box-shadow:2px 2px 0 #071a32; }
.intro-panel h1 { font-size:clamp(29px,5.85vw,46px); }
.generation-choice input:checked + span { background-color:transparent; }
.gen-kanto input:checked + span { background:linear-gradient(115deg,#d83b35 0 34%,#2875ce 34% 67%,#e5bd35 67%); }
.gen-johto input:checked + span { background:linear-gradient(115deg,#d4ad35 0 50%,#aeb8c5 50%); }
.gen-hoenn input:checked + span { background:linear-gradient(115deg,#183e77 0 33%,#c83d38 33% 66%,#31945c 66%); }
.gen-sinnoh input:checked + span { background:linear-gradient(115deg,#4c91d4 0 33%,#d98db5 33% 66%,#737d8d 66%); }
.gen-unova input:checked + span { background:linear-gradient(115deg,#30343b 0 50%,#f1f1eb 50%); }
.gen-kalos input:checked + span { background:linear-gradient(115deg,#167fce 0 50%,#d64a55 50%); }
.gen-alola input:checked + span { background:linear-gradient(115deg,#ed9b35 0 50%,#7545a4 50%); }
.gen-galar input:checked + span { background:linear-gradient(115deg,#df7c88 0 50%,#77b6df 50%); }
.gen-paldea input:checked + span { background:linear-gradient(115deg,#c64a43 0 50%,#7650a8 50%); }
.generation-choice input:checked + span { filter:none; opacity:1; outline:2px solid var(--accent); outline-offset:1px; }
.revealed-pokemon.legacy-sprite img { width:176px; height:176px; image-rendering:pixelated; }
.perfect-result { margin:2px 0 4px; text-align:center; }
.perfect-result-title { font-size:clamp(27px,6vw,38px); font-weight:700; letter-spacing:2px; }
.perfect-result-extras { text-align:center; margin:-12px auto 20px; }
.ditto-row { display:flex; justify-content:center; align-items:center; gap:10px; margin:8px 0 5px; }
.ditto-row img { width:32px; height:32px; object-fit:contain; image-rendering:auto; }
.perfect-result-extras p { margin:5px 0; color:var(--muted); font-size:13px; }
.perfect-result-extras p em { font-size:12px; }
.debug-card { width:min(100%,700px); }
.change-palette-button { display:block; width:100%; margin:14px 0 0; }
.palette-editor { margin:15px 0 4px; padding:14px; border:2px dashed var(--muted); }
.palette-editor > p { margin:0 0 12px; }
.hex-editor-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:14px; }
.hex-editor-grid label { display:grid; gap:5px; font-size:12px; font-weight:700; }
.hex-editor-grid .pixel-input { padding:9px; font-family:monospace; text-transform:uppercase; }
.palette-editor .pixel-button { display:block; width:100%; }
.language-settings { border-top:2px dashed rgba(100,120,145,.45); margin-top:22px; padding-top:16px; }
.language-settings h3 { margin:0 0 6px; font-size:18px; }
.language-settings p { margin:0 0 10px; }
.language-settings label { display:block; margin-bottom:6px; font-size:13px; }
.language-settings select { appearance:auto; font-size:15px; }
@media(max-width:560px) {
  .brand-mark-image { width:44px; height:44px; }
  .hex-editor-grid { grid-template-columns:1fr; }
  .ditto-row { gap:7px; }
}



/* Ajustes solicitados: escala de portada, botones de generación y ciclos de color */
.game-shell { width:min(100%, 760px); }
body { min-height:100svh; padding:10px 14px; }
.topbar { margin-bottom:8px; }
.intro-panel { padding:clamp(14px, 2.2vw, 24px); }
.intro-tools { top:9px; right:9px; gap:6px; }
.tool-button { width:33px; height:33px; font-size:19px; }
.intro-brandline {
  margin-top:3px; margin-bottom:0; font-size:clamp(23px,4.3vw,35px);
  color:transparent;
  background-image:linear-gradient(90deg,#DC52C0 0%,#23A0DC 33.333%,#E59A3D 66.666%,#DC52C0 100%);
  background-size:200% 100%; background-position:0% 50%;
  -webkit-background-clip:text; background-clip:text;
  animation:brand-color-cycle 8s linear infinite;
}


.intro-subtitle { margin:1px 0 9px; font-size:13px; }
.intro-panel h1 { font-size:clamp(22px,4.2vw,33px); line-height:1.04; margin:0 0 9px; }
.intro-panel .intro-copy { max-width:540px; margin:0 auto 11px; font-size:14px; line-height:1.38; }
.trainer-label { margin:0 auto 5px!important; font-size:12px; }
.trainer-input { min-height:42px; padding:8px 11px; margin-bottom:10px!important; font-size:16px!important; }
.game-options { max-width:520px; margin:0 auto 11px; }
.generation-option { padding:9px 12px; }
.option-heading strong { font-size:15px; }
.option-heading span { font-size:11px; }
.generation-grid { gap:6px; margin-top:8px; }
.generation-choice span {
  min-height:31px; padding:3px 5px; border:0!important; border-radius:0;
  box-shadow:none!important; font-size:13px; transform:none!important;
}
.generation-choice:hover span { filter:brightness(1.1); box-shadow:none!important; }
.generation-choice input:checked + span { outline:0!important; border:0!important; }
.generation-choice input:focus-visible + span { outline:2px solid #fff!important; outline-offset:2px; }
.gen-kanto span,.gen-johto span,.gen-hoenn span,.gen-sinnoh span,
.gen-kalos span,.gen-alola span,.gen-galar span,.gen-paldea span { border:0!important; }
.gen-unova span,
.gen-unova input:checked + span { background:linear-gradient(110deg,#0c0c0d 0 25%,#24ccff 25% 50%,#fc5832 50% 75%,#fafcfc 75% 100%)!important; color:#fff!important; text-shadow:1px 1px 2px #000,0 0 3px #000!important; }
.shiny-option-row { padding:8px 12px 9px; }
.shiny-charm { width:36px; height:36px; }
.option-description strong { font-size:14px; }
.option-description span { font-size:11px; }
.toggle,.toggle-track { width:42px; height:24px; }
.toggle-track::after { width:14px; height:14px; margin:3px; }
.toggle input:checked + .toggle-track::after { transform:translateX(15px); }
.intro-panel > #startButton { padding:9px 16px; font-size:14px; }
.intro-panel .tiny-note { margin-top:8px; font-size:11px; }
.perfect-rainbow {
  background-size:200% 100%; background-position:0% 50%;
  animation:rainbow-scroll 8s linear infinite;
}


.hex-input-controls { display:grid; grid-template-columns:minmax(0,1fr) 42px 42px; gap:6px; align-items:stretch; }
.hex-input-controls .palette-hex-input { min-width:0; }
.palette-native-picker { width:42px; height:42px; padding:3px; border:2px solid var(--border); border-radius:0; background:var(--panel-bg); cursor:pointer; }
.palette-eyedropper { width:42px; min-width:42px; border:2px solid var(--border); border-radius:0; background:var(--blue); color:#fff; font-size:23px; cursor:pointer; }
.palette-eyedropper:hover { filter:brightness(1.12); }
@media(max-height:760px) {
  body { padding-top:6px; padding-bottom:6px; }
  .topbar { margin-bottom:5px; }
  .intro-panel { padding:12px 20px; }
  .intro-brandline { font-size:clamp(21px,3.8vw,30px); }
  .intro-panel h1 { font-size:clamp(21px,3.7vw,29px); margin-bottom:6px; }
  .intro-panel .intro-copy { font-size:13px; margin-bottom:8px; }
  .trainer-input { min-height:38px; margin-bottom:7px!important; }
  .generation-option { padding:7px 10px; }
  .generation-choice span { min-height:28px; }
  .shiny-option-row { padding:6px 10px; }
  .intro-panel .tiny-note { margin-top:5px; }
}
@media(max-width:560px) {
  .intro-panel { padding:48px 13px 15px; }
  .intro-brandline { margin-top:0; }
  .hex-input-controls { grid-template-columns:minmax(0,1fr) 38px 38px; }
  .palette-native-picker,.palette-eyedropper { width:38px; min-width:38px; height:38px; }
}
@media(prefers-reduced-motion:reduce) {
  .intro-brandline,.perfect-rainbow { animation:none!important; background-position:50% 50%; }
}

/* Efectos de interacción: salto del icono de tema y sprites retro estáticos. */
.theme-switch img.theme-sprite-hop { animation:theme-sprite-hop .42s cubic-bezier(.34,1.56,.64,1); }


.revealed-pokemon img.legacy-idle-hop {transform-origin:center bottom;}


@media(prefers-reduced-motion:reduce) {
  .theme-switch img.theme-sprite-hop,
  .revealed-pokemon img.legacy-idle-hop { animation:none!important; }
}


/* v10: reorganización de recursos, ajustes en partida y animaciones */
.pixel-language-select,.pixel-language-select option { font-family:"Pixelify Sans",monospace!important; font-size:16px!important; }
.game-panel { position:relative; padding-top:64px; }
.game-settings-button { position:absolute; top:13px; right:14px; z-index:5; }
.game-settings-modal { max-width:420px; }
.generation-clue { margin:0 auto 5px; text-align:center; color:var(--accent); font-size:13px; letter-spacing:.25px; }
.generation-clue:not(.hidden) { animation:clue-fade-in .35s ease both; }


.guess-form,.feedback { max-height:190px; opacity:1; transform:translateY(0); overflow:hidden; transition:max-height .65s cubic-bezier(.65,0,.35,1),opacity .45s ease,transform .65s cubic-bezier(.65,0,.35,1),margin .65s cubic-bezier(.65,0,.35,1); }
.round-finished .guess-form { max-height:0; opacity:0; transform:translateY(-14px); margin-top:0!important; margin-bottom:0!important; pointer-events:none; }
.round-finished .feedback { max-height:0; min-height:0; opacity:0; transform:translateY(-10px); margin:0; }
.game-actions { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:12px; min-height:48px; margin-top:10px; transition:transform .65s cubic-bezier(.65,0,.35,1),gap .65s cubic-bezier(.65,0,.35,1); }
.round-finished .game-actions { transform:translateY(-9px) scale(1.04); gap:16px; }
.game-actions .pixel-button { transition:transform .65s cubic-bezier(.65,0,.35,1),padding .65s cubic-bezier(.65,0,.35,1),font-size .65s cubic-bezier(.65,0,.35,1),opacity .25s ease; }
.round-finished .game-actions .pixel-button { padding:16px 23px; font-size:18px; }
#restartGameButton { margin:0; }
.revealed-pokemon img.sprite-pop-in { animation:sprite-pop-in .48s cubic-bezier(.2,1.45,.45,1) both; }


.reveal-message .no-more-title { display:block; color:#d33b36; font-size:21px; line-height:1.35; }
.reveal-message .no-more-caption { display:block; margin-top:3px; color:var(--muted); font-size:13px; font-weight:400; }
.reveal-message .pokemon-answer { margin-top:2px; font-size:25px; font-style:normal; color:var(--ink); }
.score-chip { padding:10px 15px; font-size:14px; }
.final-score { max-width:330px; padding:26px; }
.final-score strong { font-size:70px; }
.score-chip strong { font-size:24px; }
.score-seven-hop { display:inline-block; animation:legacy-pokemon-idle-hop 1.8s ease-in-out infinite; }
.result-heading { white-space:nowrap; font-size:clamp(20px,4vw,34px)!important; }
#replayButton:not(:disabled):hover { background:linear-gradient(90deg,#d84c4c,#d88b36,#d4c34a,#48a56a,#438dcc,#9562c4,#d84c4c); background-size:200% 100%; animation:rainbow-scroll 8s linear infinite; color:#fff; text-shadow:1px 1px 2px rgba(0,0,0,.6); }
@media(max-width:520px) { .game-panel { padding-top:58px; } .game-settings-button { top:9px; right:9px; } .round-finished .game-actions .pixel-button { padding:13px 14px; font-size:14px; } .result-heading { white-space:normal; } }
@media(prefers-reduced-motion:reduce) { .guess-form,.feedback,.game-actions,.game-actions .pixel-button { transition:none!important; } .revealed-pokemon img.sprite-pop-in,#replayButton:not(:disabled):hover { animation:none!important; } .score-seven-hop { animation:none!important; } }

/* V12 · portada de dos columnas y Poké-pantoneras */
body { display:block; padding:28px clamp(16px,3vw,52px); }
.game-shell { position:relative; width:min(100%,1500px); margin:0 auto; min-height:calc(100vh - 56px); padding-right:0; }
.topbar { position:relative; z-index:4; width:100%; margin-bottom:12px; }
.brand-home { border:3px solid var(--accent); background:var(--panel-bg); color:var(--ink); padding:12px 17px; cursor:pointer; box-shadow:4px 4px 0 rgba(0,0,0,.2); }
.brand-home:hover { transform:translateY(-2px); }
.theme-switch-wrap { position:fixed; top:22px; right:clamp(16px,3vw,52px); z-index:12; padding:7px 10px; background:#112a4c; border:3px solid #f05461; }
.theme-switch { width:72px; height:64px; border:3px solid #f05461; }
.theme-switch img { width:62px; height:56px; }
.game-shell > .panel, .game-shell > .round-strip, .game-shell > .round-counter { width:min(100%,560px); margin-left:0; margin-right:0; }
.intro-panel { border:6px solid #f14e5b; }
.pantone-gallery { position:absolute; top:115px; left:calc(min(100%,560px) + 35px); right:0; height:min(730px,calc(100vh - 155px)); min-height:480px; perspective:950px; pointer-events:none; }
.pantone-card { position:absolute; width:clamp(140px,17vw,220px); aspect-ratio:0.72; transform-style:preserve-3d; animation:pantone-drift 7s ease-in-out infinite alternate; animation-delay:var(--float-delay); filter:drop-shadow(9px 14px 6px rgba(0,0,0,.13)); }
.pantone-card:nth-child(1){left:9%;top:17%;--card-tilt:-9deg}
.pantone-card:nth-child(2){left:49%;top:0%;--card-tilt:11deg;width:clamp(125px,14vw,185px)}
.pantone-card:nth-child(3){right:2%;top:22%;--card-tilt:-7deg}
.pantone-card:nth-child(4){left:32%;bottom:0%;--card-tilt:8deg}
.pantone-card:nth-child(5){right:0%;bottom:4%;--card-tilt:13deg;width:clamp(120px,14vw,175px)}
.pantone-rotator { position:relative; width:100%;height:100%;transform-style:preserve-3d;animation:pantone-turn 16s ease-in-out infinite;animation-delay:var(--float-delay); }
.pantone-face { position:absolute;inset:0;backface-visibility:hidden;background:#fff;border:6px solid #5548ff;overflow:hidden;display:flex;flex-direction:column; }
.pantone-back { transform:rotateY(180deg);background:#fff; }
.pantone-swatch { flex:1;min-height:0;display:grid;place-items:center;padding:8px; }
.pantone-swatch img { width:90%;height:90%;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(2px 3px 0 rgba(0,0,0,.14)); }
.pantone-info { background:white;color:#111;min-height:32%;padding:7px 9px;display:flex;flex-direction:column;line-height:1.04;font-family:"Pixelify Sans",sans-serif; }
.pantone-info strong { font-family:Arial,sans-serif;font-weight:900;letter-spacing:-.8px;font-size:clamp(14px,1.45vw,22px); }
.pantone-info span { font-size:clamp(14px,1.4vw,21px); }
.pantone-pokemon-name { font-style:italic; }




.flag-picker { display:flex;gap:10px;justify-content:center;margin:10px auto; }
.flag-button { width:57px;height:44px;cursor:pointer;background:var(--panel-bg);border:3px solid var(--border);box-shadow:3px 3px 0 rgba(0,0,0,.2);font-size:27px;line-height:1;image-rendering:pixelated; }
.flag-button.selected { border-color:var(--accent);transform:translateY(-3px); }
/* La lista de autocompletado debe poder desbordar el formulario mientras se escribe. */
.guess-form { overflow:visible;position:relative;z-index:8; }
.round-finished .guess-form { overflow:hidden; }
.game-actions { flex-direction:column;align-items:center; }
#nextButton { order:0;min-width:210px; }
#restartGameButton { order:1; font-size:12px;padding:7px 12px; }
.round-finished .game-actions #restartGameButton { font-size:12px;padding:7px 12px;transform:none; }
/* Incremento ligero para los sprites de Showdown (no para los retro). */
#revealedSprite[src*="showdown"] { transform:scale(1.14); }
@media(max-width:1050px) {
 .game-shell > .panel,.game-shell > .round-strip,.game-shell > .round-counter {width:min(100%,520px)}
 .pantone-gallery {left:calc(min(100%,520px) + 15px)}
 .pantone-card {width:clamp(115px,16vw,175px)}
}
@media(max-width:760px) {
 body {padding:18px 12px}
 .game-shell > .panel,.game-shell > .round-strip,.game-shell > .round-counter {width:100%;max-width:560px;margin-left:auto;margin-right:auto}
 .topbar {padding-right:90px}
 .brand-home {padding:8px;font-size:12px}
 .theme-switch-wrap {top:15px;right:12px;padding:4px}
 .theme-switch {width:46px;height:42px}
 .theme-switch img {width:38px;height:36px}
 .pantone-gallery {position:relative;left:auto;right:auto;top:auto;height:340px;min-height:0;margin:28px auto 0;max-width:560px;overflow:hidden}
 .pantone-card,.pantone-card:nth-child(2),.pantone-card:nth-child(5) {width:130px}
 .pantone-card:nth-child(1){left:4%;top:15%}.pantone-card:nth-child(2){left:40%;top:1%}.pantone-card:nth-child(3){right:0%;top:20%}.pantone-card:nth-child(4){left:20%;bottom:-25%}.pantone-card:nth-child(5){right:13%;bottom:-28%}
 .pantone-info strong{font-size:13px}.pantone-info span{font-size:13px}
}
@media(prefers-reduced-motion:reduce){.pantone-card,.pantone-rotator{animation:none!important}}

/* V13 · ajustes solicitados sin alterar la lógica del juego */
.brand-home { background:transparent!important; border:0!important; box-shadow:none!important; padding:5px 10px!important; }
.topbar { display:flex; justify-content:center; align-items:center; }
.brand-home { margin:0 auto; }
.theme-switch-wrap { border:0!important; }
.intro-panel { border:4px solid var(--border)!important; box-shadow:10px 13px 17px rgba(0,0,0,.28)!important; }
.intro-subtitle { font-size:clamp(17px,2.1vw,24px)!important; font-weight:700; letter-spacing:.5px; margin:10px 0 13px!important; color:var(--accent); }
.palette-title-rainbow { display:inline-block; font-size:1.16em; color:transparent; background-image:linear-gradient(90deg,#dc52c0 0%,#23a0dc 33.333%,#e59a3d 66.666%,#dc52c0 100%);background-size:200% 100%; -webkit-background-clip:text; background-clip:text; animation:brand-color-cycle 8s linear infinite; }
.menu-dropdown { border:0!important; padding:0!important; }
.menu-dropdown + .menu-dropdown { margin-top:9px; }
.dropdown-summary { cursor:pointer; padding:9px 13px; border:2px solid var(--border); background:var(--panel-bg); color:var(--ink); font:700 15px "Pixelify Sans",monospace; list-style:none; display:flex; justify-content:space-between; align-items:center; }
.dropdown-summary::-webkit-details-marker { display:none; }
.dropdown-arrow { transition:transform .25s ease; }
.menu-dropdown[open] .dropdown-arrow { transform:rotate(180deg); }
.menu-dropdown .generation-grid { padding:10px 2px 4px; }
.menu-dropdown .shiny-option-row { margin:9px 0 0; }
/* Fondo de generaciones: ciclo continuo, no cambios de color mediante JS */
.generation-choice:hover span { transform:scale(1.065)!important; transition:transform .2s ease,filter .2s ease!important; background-size:200% 100%!important; animation:generation-color-loop 5s linear infinite; }


.gen-kanto span,.gen-johto span,.gen-hoenn span,.gen-sinnoh span,.gen-unova span,.gen-kalos span,.gen-alola span,.gen-galar span,.gen-paldea span { background-size:200% 100%!important; }
.intro-start-area { width:min(100%,560px); text-align:center; padding:22px 0 10px; }
.intro-start-area #startButton { font-size:clamp(17px,2vw,22px); padding:14px 30px; }
.intro-start-area .tiny-note { color:#b8c9dc; margin:13px auto 0; }
.pantone-card { filter:drop-shadow(12px 17px 9px rgba(0,0,0,.30))!important; }
.pantone-face { border:0!important; background:#fff; box-shadow:inset 0 0 0 1px rgba(0,0,0,.08); }
.pantone-back { display:grid;place-items:center; }
.pantone-back-logo { width:70%;height:70%;object-fit:contain; }
body[data-theme="dark"] .pantone-info,body[data-theme="dark"] .pantone-back { background:#141414; color:#fff; }
body[data-theme="dark"] .pantone-back-logo { filter:drop-shadow(0 0 4px rgba(255,255,255,.14)); }
/* Giro completo y continuo; el frente permanece visible la mayor parte del ciclo. */
.pantone-rotator { animation:pantone-brief-turn 14s linear infinite!important; }


.pantone-card:nth-child(1){--card-tilt:-12deg}
.pantone-card:nth-child(2){--card-tilt:15deg}
.pantone-card:nth-child(3){--card-tilt:-16deg}
.pantone-card:nth-child(4){--card-tilt:10deg}
.pantone-card:nth-child(5){--card-tilt:19deg}
/* En partida, el bloque de paleta queda a la derecha, junto a su pista. */
@media(min-width:900px) {
 .game-shell:has(#gamePanel:not(.hidden)) { padding-right:calc(100% - min(100%,560px)); }
 .game-shell:has(#gamePanel:not(.hidden)) .game-panel { position:relative; }
 .game-shell:has(#gamePanel:not(.hidden)) #gamePanel > .palette-frame { position:absolute; left:calc(100% + 55px); top:75px; width:clamp(360px,calc(100vw - 690px),820px); padding:0; box-shadow:11px 14px 12px rgba(0,0,0,.28); }
 .game-shell:has(#gamePanel:not(.hidden)) #gamePanel > .palette-frame .palette { height:clamp(310px,34vw,480px); }
 .game-shell:has(#gamePanel:not(.hidden)) #generationClue { position:absolute; left:calc(100% + 55px); top:calc(75px + clamp(310px,34vw,480px) + 22px); width:clamp(360px,calc(100vw - 690px),820px); text-align:center; color:#fff; font:700 clamp(17px,2vw,25px) "Pixelify Sans",monospace; }
}
@media(max-width:899px) { #gamePanel > .palette-frame { box-shadow:10px 12px 11px rgba(0,0,0,.28); } }
.footer { justify-content:center!important; text-align:center; }
.footer-separator { margin:0 9px; }
@media(max-width:760px) { .intro-start-area {margin:0 auto;} .topbar {padding-right:0;} .brand-home {margin:0 auto;} }
@media(prefers-reduced-motion:reduce) { .pantone-rotator,.generation-choice:hover span,.palette-title-rainbow {animation:none!important;} }

/* Mantener el texto localizado del título de portada y el botón fuera del panel */
.intro-subtitle {text-transform:uppercase;}

/* V14 · reparación de la distribución del menú y de la partida */
.game-shell { width:min(100%,1480px); margin:0 auto; padding:0!important; min-height:calc(100vh - 56px); }
.topbar { margin-bottom:18px; }
/* Iconos fuera del panel, en la esquina superior derecha de la columna izquierda. */
.intro-tools { position:relative!important; inset:auto!important; display:flex; justify-content:flex-end; width:min(100%,560px); margin:0 0 8px; padding:0 4px; z-index:5; }
.game-shell > .intro-panel { width:min(100%,560px)!important; max-width:none!important; margin:0!important; padding:22px 24px 23px!important; min-height:0; }
.intro-subtitle { margin:2px 0 17px!important; line-height:1.25; }
.intro-panel h1 { margin:0 0 15px; }
.intro-panel .game-options { width:100%; max-width:none; margin:13px auto 0; padding:12px 13px; }
.intro-panel .generation-option { padding:0; border:0; }
.intro-panel .option-heading { margin-bottom:7px; }
.intro-panel .generation-grid { margin:7px 0 12px; padding:0; }
.intro-panel .shiny-dropdown { border-top:2px dashed rgba(100,120,145,.4); padding:11px 0 0; }
.intro-panel .shiny-option-row { margin:0; padding:0; }
.intro-start-area { width:min(100%,560px); margin:0!important; padding:20px 0 10px; }
.intro-start-area #startButton { display:inline-block; max-width:100%; }
/* El menú no debe dejar restos de controles desplegables. */
.dropdown-summary { display:none!important; }
/* La cabecera de progreso se centra sobre toda la página, independientemente de la columna izquierda. */
.game-shell > .round-strip:not(.hidden) { width:max-content!important; max-width:min(90%,540px)!important; margin:8px auto 8px!important; }
.game-shell > .round-counter:not(.hidden) { width:max-content!important; max-width:90%!important; margin:0 auto 24px!important; }
/* Panel de juego a tamaño normal, y paleta a la derecha sin alterar el flujo del resto. */
.game-shell:has(#gamePanel:not(.hidden)) { padding-right:0!important; }
.game-shell > #gamePanel:not(.hidden) { width:100%!important; max-width:none!important; margin:0!important; padding:24px!important; min-height:610px; position:relative; background:transparent; border:0; box-shadow:none; }
#gamePanel:not(.hidden) > :not(.palette-frame):not(.generation-clue) { width:min(100%,500px); }
#gamePanel:not(.hidden) > .game-heading,
#gamePanel:not(.hidden) > .clue-status,
#gamePanel:not(.hidden) > .revealed-pokemon,
#gamePanel:not(.hidden) > .guess-form,
#gamePanel:not(.hidden) > .feedback,
#gamePanel:not(.hidden) > .game-actions,
#gamePanel:not(.hidden) > .centered-note { position:relative; z-index:2; }
#gamePanel:not(.hidden)::before { content:""; position:absolute; top:0; bottom:0; left:0; width:min(100%,548px); background:var(--panel-bg); border:4px solid var(--border); box-shadow:9px 12px 0 rgba(0,0,0,.23); pointer-events:none; }
@media(min-width:900px) {
 .game-shell:has(#gamePanel:not(.hidden)) #gamePanel > .palette-frame { position:absolute!important; left:calc(min(100%,548px) + 48px)!important; top:66px!important; width:calc(100% - min(100%,548px) - 72px)!important; max-width:none!important; min-width:0; padding:0; box-shadow:11px 14px 12px rgba(0,0,0,.28); }
 .game-shell:has(#gamePanel:not(.hidden)) #gamePanel > .palette-frame .palette { height:clamp(290px,34vw,480px); }
 .game-shell:has(#gamePanel:not(.hidden)) #generationClue { position:absolute!important; left:calc(min(100%,548px) + 48px)!important; top:calc(66px + clamp(290px,34vw,480px) + 18px)!important; width:calc(100% - min(100%,548px) - 72px)!important; text-align:center; color:#fff; }
}
@media(max-width:899px) {
 .game-shell > #gamePanel:not(.hidden) { width:min(100%,560px)!important; margin:0 auto!important; padding:22px!important; background:var(--panel-bg); border:4px solid var(--border); box-shadow:8px 8px 0 rgba(0,0,0,.25); min-height:0; }
 #gamePanel:not(.hidden)::before { display:none; }
 #gamePanel:not(.hidden) > :not(.palette-frame):not(.generation-clue) { width:100%; }
 #gamePanel:not(.hidden) > .palette-frame, #gamePanel:not(.hidden) > #generationClue { position:static!important; width:100%!important; }
 #gamePanel:not(.hidden) > #generationClue { color:var(--accent); margin-top:12px; }
}
@media(max-width:760px) {
 .game-shell > .intro-panel { margin:0 auto!important; padding:20px 15px!important; }
 .intro-tools { margin:0 auto 8px; }
 .intro-start-area { margin:0 auto!important; }
 .game-shell > .round-strip:not(.hidden) { margin:8px auto!important; }
}
/* Las herramientas de portada no aparecen durante la partida o resultados. */
.game-shell:has(#introPanel.hidden) > .intro-tools { display:none!important; }


/* v15: ajustes puntuales sobre v14; mantener intactos los listeners de autocompletado. */
.topbar { justify-content:flex-start!important; margin-bottom:10px!important; }
.brand-home { margin:0!important; color:#fff!important; }
.brand-home span { color:#fff!important; }
.theme-switch-wrap { border:0!important; background:transparent!important; }
.theme-label { font-size:17px!important; font-weight:700; color:#fff; }
.theme-switch { border:3px solid transparent!important; box-shadow:none!important; }
.theme-switch:hover,.theme-switch:focus-visible { border-image:linear-gradient(110deg,#ffca65,#e34cbb,#25a5df,#ffca65) 1!important; }
.intro-panel .game-options { background:transparent!important; border:0!important; box-shadow:none!important; padding:0!important; }
.intro-panel .generation-option { border:0!important; }
.intro-panel .option-heading { text-align:center; align-items:center; }
.intro-panel .shiny-dropdown { border-top:2px dashed rgba(100,120,145,.4)!important; margin-top:6px; }
.intro-panel .generation-grid { margin-bottom:7px!important; }
.generation-choice span { box-shadow:3px 4px 5px rgba(0,0,0,.23)!important; }
.generation-choice:hover span { box-shadow:5px 7px 7px rgba(0,0,0,.26)!important; }
/* Dos colores por generación: el corte diagonal pasa por el centro del botón. */
.gen-kanto span,.gen-kanto input:checked+span { --gen-a:#e13d36;--gen-b:#2b78c7; }
.gen-johto span,.gen-johto input:checked+span { --gen-a:#e1b733;--gen-b:#aeb9c6; }
.gen-hoenn span,.gen-hoenn input:checked+span { --gen-a:#163c77;--gen-b:#d44642; }
.gen-sinnoh span,.gen-sinnoh input:checked+span { --gen-a:#5095d6;--gen-b:#d98fb4; }
.gen-unova span,.gen-unova input:checked+span { --gen-a:#111318;--gen-b:#27c9f1; }
.gen-kalos span,.gen-kalos input:checked+span { --gen-a:#1685d2;--gen-b:#d64a55; }
.gen-alola span,.gen-alola input:checked+span { --gen-a:#ef9d37;--gen-b:#7746a7; }
.gen-galar span,.gen-galar input:checked+span { --gen-a:#df7d8a;--gen-b:#74b7dd; }
.gen-paldea span,.gen-paldea input:checked+span { --gen-a:#c74943;--gen-b:#7750a5; }
.generation-choice span,.generation-choice input:checked+span { background:linear-gradient(112deg,var(--gen-a) 0 50%,var(--gen-b) 50% 100%)!important; background-size:100% 100%!important; }
/* El patrón se desplaza por un ciclo completo y vuelve al mismo punto. */
.generation-choice:hover span { background:repeating-linear-gradient(112deg,var(--gen-a) 0 25%,var(--gen-b) 25% 50%)!important; background-size:200% 100%!important; animation:gen-seamless 5s linear infinite!important; transform:scale(1.055)!important; }


.intro-start-area #startButton:hover { background:linear-gradient(90deg,#dc52c0,#23a0dc,#e59a3d,#dc52c0)!important; background-size:200% 100%!important; animation:brand-color-cycle 8s linear infinite; color:white; }
.pantone-card { animation-duration:var(--float-duration,8s)!important; animation-delay:var(--float-delay,0s)!important; }
.pantone-rotator { animation-duration:var(--turn-duration,19s)!important; animation-delay:var(--turn-delay,0s)!important; }
.pantone-card:nth-child(n) { right:auto;bottom:auto; }
.pantone-info strong { font-size:clamp(13px,1.3vw,20px); letter-spacing:-.7px; overflow-wrap:anywhere; }
.pantone-info { min-height:34%; padding:8px 9px; }
/* El botón de empezar y la nota pertenecen exclusivamente al menú. */
.game-shell:has(#introPanel.hidden) > .intro-start-area { display:none!important; }
.game-shell:has(#gamePanel:not(.hidden)) > .topbar { margin-bottom:2px!important; }
.game-shell:has(#gamePanel:not(.hidden)) > .round-strip:not(.hidden) { margin:0 auto 4px!important; }
.game-shell:has(#gamePanel:not(.hidden)) > .round-counter:not(.hidden) { margin:0 auto 8px!important; }
/* Juego: cuadrícula de dos columnas con el contenido de juego contenido en la izquierda. */
@media(min-width:900px) {
 body:has(#gamePanel:not(.hidden)) { padding-top:10px; padding-bottom:8px; display:block; }
 #gamePanel:not(.hidden) { display:grid!important; grid-template-columns:minmax(0,500px) minmax(0,1fr); grid-template-rows:auto auto minmax(90px,1fr) auto auto auto auto; column-gap:clamp(26px,4vw,65px); row-gap:8px; padding:10px 12px!important; min-height:0!important; align-items:start; }
 #gamePanel:not(.hidden)::before { width:calc(min(100%,500px) + 24px)!important; }
 #gamePanel:not(.hidden) > .game-heading { grid-column:1;grid-row:1; }
 #gamePanel:not(.hidden) > .clue-status { grid-column:1;grid-row:2; }
 #gamePanel:not(.hidden) > .revealed-pokemon { grid-column:1;grid-row:3; align-self:center; margin:0 auto!important; }
 #gamePanel:not(.hidden) > .guess-form { grid-column:1;grid-row:4; }
 #gamePanel:not(.hidden) > .feedback { grid-column:1;grid-row:5; }
 #gamePanel:not(.hidden) > .game-actions { grid-column:1;grid-row:6; }
 #gamePanel:not(.hidden) > .centered-note { grid-column:1;grid-row:7; }
 .game-shell:has(#gamePanel:not(.hidden)) #gamePanel > .palette-frame { position:relative!important;grid-column:2;grid-row:1 / 6;left:auto!important;top:auto!important;width:100%!important;align-self:center; }
 .game-shell:has(#gamePanel:not(.hidden)) #gamePanel > .palette-frame .palette { height:clamp(260px,33vw,450px)!important; }
 .game-shell:has(#gamePanel:not(.hidden)) #generationClue { position:relative!important;grid-column:2;grid-row:6 / 8;left:auto!important;top:auto!important;width:100%!important; }
 #gamePanel:not(.hidden) > :not(.palette-frame):not(.generation-clue) { width:100%!important; max-width:100%!important; }
 #gamePanel:not(.hidden) .revealed-pokemon img { max-height:clamp(95px,15vh,165px); object-fit:contain; }
 #gamePanel:not(.hidden) .revealed-pokemon { min-height:0; }
 #gamePanel:not(.hidden) .reveal-message { max-width:100%; }
 #gamePanel:not(.hidden) .game-actions { margin:0; }
 #gamePanel:not(.hidden) .centered-note { margin:0; }
}
@media(max-width:899px) { .pantone-card:nth-child(n) { left:auto;top:auto; } .pantone-card:nth-child(1){left:3%;top:10%}.pantone-card:nth-child(2){left:40%;top:0}.pantone-card:nth-child(3){right:0;top:12%}.pantone-card:nth-child(4){left:19%;top:52%}.pantone-card:nth-child(5){right:8%;top:56%} }
@media(prefers-reduced-motion:reduce) { .generation-choice:hover span { animation:none!important; } }


/* v16: interfaz localizada, distribución de partida y capas del autocompletado */
/* Solo un separador entre generaciones y modo shiny. */
.intro-panel .shiny-dropdown { border-top:0!important; margin-top:0!important; padding-top:0!important; }
.intro-panel .shiny-option-row { border-top:2px dashed rgba(100,120,145,.4)!important; padding-top:11px!important; }
/* Teselia: Blanco y Negro, incluso con la casilla marcada. */
.gen-unova span,.gen-unova input:checked+span { --gen-a:#101010!important; --gen-b:#f7f7f4!important; }
/* El patrón diagonal se repite cada 50%: un desplazamiento de 50% del ancho de la imagen
   recorre un periodo entero. No depende de fotogramas JS. */
.generation-choice span,.generation-choice input:checked+span {
  background:linear-gradient(112deg,var(--gen-a) 0 50%,var(--gen-b) 50% 100%)!important;
  background-size:100% 100%!important;
}
.generation-choice:hover span,.generation-choice:focus-within span {
  background:repeating-linear-gradient(112deg,var(--gen-a) 0px 25px,var(--gen-b) 25px 50px,var(--gen-a) 50px 75px,var(--gen-b) 75px 100px)!important;
  background-size:200% 100%!important;
  animation:gen-scroll-v16 3.6s linear infinite!important;
}


/* Un periodo exacto en píxeles evita un salto de la raya diagonal. */
.generation-choice:hover span { background-size:100px 100%!important; animation:gen-pixels-v16 3.5s linear infinite!important; }


/* El formulario debe permanecer por encima del panel, la paleta y el feedback. */
#gamePanel:not(.hidden) { isolation:isolate; overflow:visible!important; }
#gamePanel:not(.hidden) > .guess-form { z-index:80!important; overflow:visible!important; }
#gamePanel:not(.hidden) .guess-row,#gamePanel:not(.hidden) .autocomplete-wrap { position:relative; z-index:81!important; overflow:visible!important; }
#gamePanel:not(.hidden) #suggestions { z-index:1000!important; }
#gamePanel:not(.hidden) > .feedback,#gamePanel:not(.hidden) > .game-actions { z-index:1!important; }
#gamePanel.round-finished > .guess-form { overflow:hidden!important; }
.swatch-hex { font-family:"Silkscreen",monospace!important; font-size:clamp(9px,.9vw,13px)!important; }
.score-chip { border:0!important; box-shadow:none!important; }
.round-counter { font-size:clamp(19px,2.5vw,32px)!important; padding:7px 20px!important; }
/* Evitar que el formulario quede tan abajo durante las primeras pistas. */
@media(min-width:900px) {
 #gamePanel:not(.hidden) { grid-template-rows:auto auto minmax(12px,1fr) auto auto auto!important; row-gap:7px!important; }
 #gamePanel:not(.hidden) > .game-heading { margin-bottom:4px!important; }
 #gamePanel:not(.hidden) > .clue-status { margin:2px 0!important; }
 #gamePanel:not(.hidden) > .revealed-pokemon { grid-row:3!important; }
 #gamePanel:not(.hidden) > .guess-form { grid-row:4!important; align-self:start!important; }
 #gamePanel:not(.hidden) > .feedback { grid-row:5!important; }
 #gamePanel:not(.hidden) > .game-actions { grid-row:6!important; }
 #gamePanel:not(.hidden) > .palette-frame { grid-row:1 / 6!important; }
 #gamePanel:not(.hidden) > #generationClue { grid-row:6!important; }
}
/* Giro de pantoneras: easeInOutBack en la vuelta; oscilación easeInOutCubic. */
.pantone-card { animation-timing-function:cubic-bezier(.645,.045,.355,1)!important; }
.pantone-rotator { animation-name:pantone-back-v16!important; animation-timing-function:linear!important; }


@media(prefers-reduced-motion:reduce){.generation-choice:hover span,.pantone-card,.pantone-rotator{animation:none!important}}

/* v17: composición del panel de juego según el boceto, sin alterar el autocompletado. */
#gamePanel:not(.hidden) > .game-heading { display:flex!important; align-items:center!important; justify-content:space-between!important; gap:10px; margin:0!important; }
#gamePanel:not(.hidden) .game-heading .eyebrow { margin:0!important; font-size:clamp(11px,1.2vw,15px); letter-spacing:1px; }
#gamePanel:not(.hidden) .game-heading .score-chip { border:0!important; padding:0!important; font-size:clamp(12px,1.1vw,16px); }
#gamePanel:not(.hidden) > #gamePrompt { text-align:center; font-size:clamp(24px,2.5vw,36px); line-height:1.12; margin:8px 0 4px!important; }
#gamePanel:not(.hidden) > .clue-status { text-align:center; margin:3px 0 8px!important; color:var(--ink); }
#gamePanel:not(.hidden) .clue-label { font-size:clamp(18px,1.9vw,26px); font-weight:700; line-height:1.1; }
#gamePanel:not(.hidden) .clue-count { display:flex; justify-content:center; align-items:baseline; gap:14px; line-height:1.08; margin:4px 0; }
#gamePanel:not(.hidden) .clue-count strong { font-family:"Pixelify Sans",monospace; font-size:clamp(52px,7vw,94px); font-weight:700; }
#gamePanel:not(.hidden) .clue-count span { font-size:clamp(22px,2.4vw,34px); font-weight:700; }
#gamePanel:not(.hidden) .clue-value { color:var(--muted); font-family:"Silkscreen",monospace; font-size:clamp(10px,1vw,13px); letter-spacing:1px; }
#gamePanel:not(.hidden) .guess-form .field-label { text-align:center; }
#gamePanel:not(.hidden) .guess-form .guess-row { display:flex; flex-direction:column; align-items:stretch; gap:12px; }
#gamePanel:not(.hidden) .guess-form .autocomplete-wrap { width:100%; }
#gamePanel:not(.hidden) .guess-form #guessButton { display:block; align-self:center; width:min(100%,240px); min-height:64px; padding:12px 26px; font-size:clamp(19px,2vw,26px); }
#gamePanel:not(.hidden) .guess-form { position:relative; z-index:80!important; }
#gamePanel:not(.hidden) .suggestions { z-index:1000!important; }
#gamePanel:not(.hidden) .feedback { margin:4px 0!important; min-height:18px; }
#gamePanel:not(.hidden) .game-actions { margin:2px 0!important; }
@media(min-width:900px) {
 #gamePanel:not(.hidden) { grid-template-rows:auto auto auto minmax(0,1fr) auto auto auto!important; row-gap:5px!important; }
 #gamePanel:not(.hidden) > .game-heading { grid-column:1; grid-row:1!important; }
 #gamePanel:not(.hidden) > #gamePrompt { grid-column:1; grid-row:2!important; }
 #gamePanel:not(.hidden) > .clue-status { grid-column:1; grid-row:3!important; }
 #gamePanel:not(.hidden) > .revealed-pokemon { grid-column:1; grid-row:4!important; }
 #gamePanel:not(.hidden) > .guess-form { grid-column:1; grid-row:5!important; }
 #gamePanel:not(.hidden) > .feedback { grid-column:1; grid-row:6!important; }
 #gamePanel:not(.hidden) > .game-actions { grid-column:1; grid-row:7!important; }
 #gamePanel:not(.hidden) > .palette-frame { grid-column:2; grid-row:1 / 7!important; }
 #gamePanel:not(.hidden) > #generationClue { grid-column:2; grid-row:7!important; }
}
@media(max-width:899px) { #gamePanel:not(.hidden) > #gamePrompt { margin:14px 0 8px!important; } }
@media(max-height:800px) and (min-width:900px) { #gamePanel:not(.hidden) .clue-count strong {font-size:clamp(48px,6vh,70px)} #gamePanel:not(.hidden) .guess-form #guessButton {min-height:52px} }

/* v18: mejoras visuales y de rendimiento */
.brand-home:hover {transform:scale(1.055)!important;}
.brand-home {font-size:clamp(20px,2.2vw,31px)!important;}
.game-shell:has(#introPanel:not(.hidden)) .topbar {justify-content:center!important;}
.game-shell:has(#gamePanel:not(.hidden)) .topbar,.game-shell:has(#resultPanel:not(.hidden)) .topbar {justify-content:flex-start!important;}
.gen-special {grid-column:1/-1;--gen-a:#a5e8a1;--gen-b:#73c9a2;}
.gen-special span {background:linear-gradient(110deg,#a5e8a1 50%,#73c9a2 50%)!important;color:#143d25!important;text-shadow:none!important;}
.suffering-row {margin-top:12px;}
.performance-settings {padding:16px 0;border-top:1px dashed #9da6a3;display:grid;gap:12px;}
.performance-toggle {display:flex;align-items:center;gap:12px;cursor:pointer;}
.performance-toggle input {width:21px;height:21px;accent-color:#e95a4a;}
.flag-button {position:relative;}
.flag-pokemon {width:22px;height:22px;object-fit:contain;image-rendering:pixelated;position:absolute;bottom:calc(100% + 3px);left:50%;transform:translateX(-50%);opacity:0;pointer-events:none;}
.flag-button:hover .flag-pokemon {opacity:1;}
#debugPalette .swatch,#debugPalette .palette-swatch {font-family:Arial,sans-serif!important;font-size:13px!important;writing-mode:vertical-rl;}
.palette-hex-input,.palette .swatch-code,.palette .hex-label,.palette .hex-code {font-family:Arial,monospace!important;letter-spacing:0!important;}
.palette-check-help {font-size:12px;line-height:1.6;}
#freePokemonList {max-height:190px!important;overflow-y:auto!important;}
.theme-switch:hover {border-image:none!important;border-color:transparent!important;position:relative;}
.theme-switch:hover:after {content:"";position:absolute;inset:-5px;border:4px solid transparent;border-image:linear-gradient(110deg,#ffca65,#e34cbb,#25a5df,#ffca65) 1;animation:theme-hue 5s linear infinite;pointer-events:none;}


#shinyCharm:hover {animation:theme-sprite-hop .42s cubic-bezier(.34,1.56,.64,1);}
.pantone-gallery {isolation:isolate;}
.pantone-card {animation-name:pantone-orbit-v18!important;animation-timing-function:ease-in-out!important;}
.pantone-mini {width:clamp(75px,9vw,112px)!important;}
.pantone-mini .pantone-info {padding:4px!important;min-height:32%;}
.pantone-mini .pantone-info strong {font-size:9px!important;letter-spacing:-.4px!important;}
.pantone-mini .pantone-info span {font-size:9px!important;}
.pantone-rotator {animation-name:pantone-full-flip-v18!important;animation-timing-function:linear!important;}




.pantone-card {animation-fill-mode:both;}
.pantone-card .pantone-rotator {animation-delay:var(--turn-delay)!important;}
.pantone-card {animation-delay:var(--float-delay)!important;}
.pantone-card .pantone-face {backface-visibility:hidden;}
body.no-animations *,body.no-animations *::before,body.no-animations *::after {animation:none!important;transition:none!important;}
body.no-fancy .pantone-card,body.no-fancy .panel,body.no-fancy .pixel-button,body.no-fancy .palette-frame,body.no-fancy .generation-choice span {box-shadow:none!important;filter:none!important;text-shadow:none!important;}


.guide-carousel {text-align:center;}
.guide-illustration {position:relative;height:180px;display:grid;place-items:center;overflow:hidden;}
.guide-palette {display:flex;position:absolute;inset:15px 10px 15px 10px;}
.guide-palette span {flex:1;}
.guide-illustration img {position:relative;width:110px;height:110px;object-fit:contain;image-rendering:pixelated;animation:legacy-pokemon-idle-hop 1.8s ease-in-out infinite;}
.guide-silhouette {filter:brightness(0)!important;}
.guide-question {position:absolute;z-index:2;font-size:80px;color:#fff;text-shadow:2px 2px #111;}
.guide-controls {display:flex;justify-content:center;align-items:center;gap:18px;margin:12px 0;}
.guide-controls button {min-width:55px;}
.result-panel {position:relative;}
.result-showcase {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;justify-items:center;background:#10294b;padding:25px 18px;max-width:850px;margin:18px auto;}
.result-creature {position:relative;width:100%;max-width:210px;height:160px;display:grid;place-items:center;}
.result-colors {display:flex;position:absolute;inset:8px 0 35px;box-shadow:5px 7px 10px rgba(0,0,0,.3);}
.result-colors span {flex:1;}
.result-floor {position:absolute;bottom:7px;width:66%;height:23px;background:#f4edc6;border-radius:50%;}
.result-creature img {position:relative;z-index:1;width:90px;height:90px;object-fit:contain;image-rendering:pixelated;align-self:end;margin-bottom:15px;}
.result-creature.won img {transform-origin:center bottom;}
.result-creature.lost img {filter:grayscale(1) brightness(.28);animation:none;}
.result-creature.lost .result-floor {background:#72747c;}
@media(min-width:1050px){.game-shell:has(#resultPanel:not(.hidden)) .result-panel {width:95%!important;max-width:1450px!important;display:grid;grid-template-columns:35% 65%;align-content:center;}.game-shell:has(#resultPanel:not(.hidden)) .result-showcase {grid-column:2;grid-row:1/8;width:100%;}.game-shell:has(#resultPanel:not(.hidden)) .result-panel>*:not(.result-showcase){grid-column:1;}}
@media(max-width:900px){.result-creature{height:120px}.result-creature img{width:70px;height:70px}.pantone-mini{width:85px!important}}

/* Entrada escalonada de cada tarjeta, sin interferir con el movimiento continuo */
.pantone-card {opacity:0;animation:pantone-orbit-v18 var(--float-duration,8s) ease-in-out infinite var(--float-delay,0s), pantone-pop-v18 .6s cubic-bezier(.34,1.56,.64,1) both var(--pop-delay,0s)!important;}


body.no-animations .pantone-card {opacity:1!important;scale:1!important;}
/* El modo Game Boy utiliza verdes apagados en toda la página. */




/* v19: layout, independent cards and performance-friendly background scroll */
.game-shell:has(#introPanel:not(.hidden)) > .intro-tools {width:min(100%,560px);margin:13px 0 0!important;justify-content:center!important;display:flex!important;gap:12px;position:relative;z-index:8;}
.game-shell:has(#introPanel:not(.hidden)) > .intro-start-area {padding-top:10px!important;}
.special-region-pair {grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:3px;}
.gen-hisui {--gen-a:#b8e8a8;--gen-b:#77c6a2;}
.gen-home {--gen-a:#f3a0a0;--gen-b:#e47c82;}
.special-region-pair .generation-choice span {color:#173747;text-shadow:none;}
.suffering-row .option-description em {display:block;font-family:Arial,sans-serif;font-size:11px;line-height:1.35;margin-top:5px;font-weight:normal;}
.shiny-charm.mode-icon-active {animation:legacy-pokemon-idle-hop 1.8s ease-in-out infinite!important;}
/* Every card has an independent, continuous orbit. The small ones stay in the distance. */
.pantone-gallery {isolation:isolate;overflow:visible;}
.pantone-card.pantone-mini {z-index:1!important;opacity:.78;filter:drop-shadow(4px 7px 7px rgba(0,0,0,.13)) saturate(.64) hue-rotate(12deg)!important;}
.pantone-card:not(.pantone-mini) {z-index:3!important;}
.pantone-mini .pantone-swatch {position:relative;}
.pantone-mini .pantone-swatch::after {content:"";position:absolute;inset:0;background:rgba(103,160,207,.23);pointer-events:none;}
.pantone-card {animation:pantone-orbit-v19 var(--float-duration,8s) ease-in-out infinite var(--float-delay,0s),pantone-pop-v18 .6s cubic-bezier(.34,1.56,.64,1) both var(--pop-delay,0s)!important;}


/* Narrow view: cards behind the info panel, not compressed into a strip above it. */
@media(max-width:899px){
 .game-shell:has(#introPanel:not(.hidden)) {position:relative;isolation:isolate;}
 .game-shell:has(#introPanel:not(.hidden)) > .pantone-gallery {position:absolute!important;top:145px!important;left:0!important;right:0!important;height:740px!important;max-width:none!important;margin:0!important;overflow:hidden!important;z-index:0!important;pointer-events:none;}
 .game-shell:has(#introPanel:not(.hidden)) > #introPanel {position:relative;z-index:3;}
 .game-shell:has(#introPanel:not(.hidden)) > .intro-tools,.game-shell:has(#introPanel:not(.hidden)) > .intro-start-area {position:relative;z-index:4;}
 .pantone-card:nth-child(n){right:auto!important;bottom:auto!important;}
 .pantone-card.pantone-mini {opacity:.65;}
}
/* A consistent split with exactly one seamless horizontal period; no striped hover texture. */
.generation-choice span,.generation-choice input:checked+span {background:linear-gradient(115deg,var(--gen-a) 0 49.8%,var(--gen-b) 50.2% 100%)!important;}
.generation-choice:hover span {background:repeating-linear-gradient(115deg,var(--gen-a) 0 42px,var(--gen-b) 42px 84px)!important;background-size:calc(84px / .9063) 100%!important;animation:region-pan-v19 2.6s linear infinite!important;}


/* Game Boy Classic is monochrome-green throughout the theme, including cards and theme selector. */







/* Switching the performance setting should not replay the options dialog entrance. */
body.no-animations .modal-card,body.no-animations .modal,body.no-animations .modal-backdrop {animation:none!important;transition:none!important;}


/* v20: targeted visual corrections; preserve autocomplete and game logic. */
/* Flat diagonal game-colour fields. No repeated striped textures on hover. */
.generation-choice span,
.generation-choice input:checked + span,
.generation-choice:hover span,
.generation-choice:focus-within span {
  background-image:linear-gradient(115deg,var(--gen-a) 0 49.8%,var(--gen-b) 50.2% 100%)!important;
  background-size:100% 100%!important;
  background-position:center!important;
  animation:none!important;
}
.gen-kanto span,.gen-kanto input:checked+span {--gen-a:#d83b35;--gen-b:#2875ce;}
.gen-hoenn span,.gen-hoenn input:checked+span {--gen-a:#183e77;--gen-b:#31945c;}
.gen-sinnoh span,.gen-sinnoh input:checked+span {--gen-a:#4c91d4;--gen-b:#d6d8db;}
/* Three-game colours restored with a clean diagonal partition. */
.gen-kanto span,.gen-kanto input:checked+span,.gen-kanto:hover span,
.gen-hoenn span,.gen-hoenn input:checked+span,.gen-hoenn:hover span,
.gen-sinnoh span,.gen-sinnoh input:checked+span,.gen-sinnoh:hover span {
 background-image:linear-gradient(115deg,var(--gen-a) 0 33.1%,var(--gen-middle) 33.3% 66.5%,var(--gen-b) 66.7% 100%)!important;
}
.gen-kanto span {--gen-middle:#2875ce;--gen-a:#d83b35;--gen-b:#e5bd35;}
.gen-hoenn span {--gen-middle:#c83d38;--gen-a:#183e77;--gen-b:#31945c;}
.gen-sinnoh span {--gen-middle:#d98db5;--gen-a:#4c91d4;--gen-b:#d6d8db;}
/* Keep the palette variables on the span for both checkbox states. */
.gen-kanto input:checked+span,.gen-kanto:hover span {--gen-middle:#2875ce;--gen-a:#d83b35;--gen-b:#e5bd35;}
.gen-hoenn input:checked+span,.gen-hoenn:hover span {--gen-middle:#c83d38;--gen-a:#183e77;--gen-b:#31945c;}
.gen-sinnoh input:checked+span,.gen-sinnoh:hover span {--gen-middle:#d98db5;--gen-a:#4c91d4;--gen-b:#d6d8db;}
/* Preserve the region labels even when previous styles hide unchecked choices. */
.special-region-pair .generation-choice span {opacity:1!important;visibility:visible!important;}
.suffering-row .option-description em {font-family:"Silkscreen",monospace!important;font-size:10px!important;letter-spacing:.2px;line-height:1.65;}
/* Atmospheric perspective: visibly blue, distant and behind the main cards. */
.pantone-card.pantone-mini {filter:drop-shadow(3px 5px 6px rgba(0,0,0,.12)) saturate(.42) hue-rotate(18deg)!important;}
.pantone-mini .pantone-swatch::after {background:rgba(77,143,207,.43)!important;}
.pantone-mini .pantone-front {box-shadow:inset 0 0 0 999px rgba(78,140,206,.15);}
/* Restore the original results panel layout; only the decorative lineup is transparent. */
.game-shell:has(#resultPanel:not(.hidden)) .result-panel {
  display:block!important;width:initial!important;max-width:initial!important;
  grid-template-columns:none!important;
}
.game-shell:has(#resultPanel:not(.hidden)) .result-panel > * {grid-column:auto!important;grid-row:auto!important;}
.result-showcase {background:transparent!important;box-shadow:none!important;border:0!important;
 display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;
 gap:8px 10px!important;max-width:850px!important;width:100%!important;
 padding:14px 6px!important;margin:16px auto!important;}
.result-showcase .result-creature {grid-column:span 2;max-width:210px;width:100%;}
.result-showcase .result-creature:nth-child(4) {grid-column:2/span 2;}
.result-showcase .result-creature:nth-child(5) {grid-column:4/span 2;}
/* Larger sprites for Kanto (first-generation artwork), without affecting autocomplete. */
#revealedSprite[src*="generation-i/"] {width:205px!important;height:205px!important;max-width:none!important;max-height:clamp(120px,22vh,205px)!important;}
.result-creature img[src*="generation-i/"] {width:116px!important;height:116px!important;}
/* Game Boy text should be dark readable green, not washed-out grey. */


@media(max-width:650px){.result-showcase{gap:4px!important}.result-creature{height:105px!important}.result-creature img{max-width:75px!important;max-height:75px!important}}

/* ============================================================
   v21 · Componentes: opciones especiales y modo libre
   ============================================================ */
.special-options-open{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;margin-top:10px;background:var(--blue);color:white}
.special-options-open img{width:28px;height:28px;object-fit:contain;image-rendering:pixelated}
.special-options-modal{width:min(720px,95vw)}
.special-options-grid{display:grid;gap:12px;margin-top:18px}
.special-option{display:grid;grid-template-columns:minmax(170px,36%) 1fr;gap:18px;align-items:center;border-bottom:1px dashed var(--muted);padding:12px 0;font-size:13px;line-height:1.65;cursor:pointer}
.special-switch{display:flex;align-items:center;gap:12px}
.special-switch input{width:21px;height:21px;accent-color:var(--accent)}
.free-filters{display:flex;flex-wrap:wrap;align-items:end;gap:15px;margin:10px 0 16px;font-size:12px}
.free-filters label{display:flex;align-items:center;gap:9px}
.free-filters .pixel-input{width:auto;max-width:200px;padding:8px;font-size:12px}
@media(max-width:600px){.special-option{grid-template-columns:1fr;gap:4px}}
/* ============================================================
   v21 · Modo juego y resultados
   ============================================================ */

.game-shell:has(#gamePanel:not(.hidden)) #gamePanel{max-width:490px}
body:not([data-theme="dark"]) .result-floor{background:#193e6b!important}
.result-creature img{filter:drop-shadow(3px 5px 2px rgba(0,0,0,.3))}
.result-creature.lost img{filter:brightness(0) drop-shadow(2px 3px 2px rgba(0,0,0,.35))}
/* ============================================================
   v21 · Game Boy (mantener todas las nuevas reglas de este tema al final)
   ============================================================ */







/* v21 · Animaciones WAAPI: las vueltas de tarjetas y saltos de tema/guía
   se controlan desde game.js (tiempo real, sin @keyframes). */
.pantone-rotator{animation:none!important}
.theme-switch img.theme-sprite-hop,.guide-silhouette,.guide-bulbasaur{animation:none!important}
@media(prefers-reduced-motion:reduce){
  body:not(.no-animations) .pantone-card{animation:pantone-orbit-v19 var(--float-duration,8s) ease-in-out infinite var(--float-delay,0s),pantone-pop-v18 .6s cubic-bezier(.34,1.56,.64,1) both var(--pop-delay,0s)!important}
  body:not(.no-animations) .palette-title-rainbow{animation:rainbow-scroll 8s linear infinite!important}
}

/* v21 · El arcoíris se mueve por Web Animations API (game.js). */
.palette-title-rainbow,.perfect-rainbow{animation:none!important}


/* ============================================================
   v22 · Galería, filtros, pop-in y sprites (cambios visuales)
   ============================================================ */
.special-options-open {grid-column:1/-1!important;width:100%!important;min-height:35px!important;max-height:44px!important;padding:5px 12px!important;margin-top:8px!important;font-size:12px!important;}
.pantone-card,.pantone-face,.pantone-rotator {transform-style:preserve-3d;}
.pantone-card .pantone-face {image-rendering:auto!important;}
.pantone-card .pantone-face img {image-rendering:auto!important;}
.pantone-rotator {--hover-x:0deg;--hover-y:0deg;transition:rotate .22s ease-out;}
.pantone-card .pantone-rotator {transition:rotate .22s ease-out;}
.free-filters,.free-filters label,.free-filters select,.free-filters span{font-family:"Silkscreen",monospace!important;}
.free-pokemon-item img{animation:free-sprite-pop-v22 .36s cubic-bezier(.2,1.25,.3,1) both;}
.free-pokedex-list{max-height:min(220px,29vh)!important;}
#freeModal .modal-card{max-height:calc(100dvh - 24px)!important;overflow:hidden!important;display:flex;flex-direction:column;}
#freeModal .free-pokedex-list{min-height:0;overflow-y:auto;}
#freeModal .tool-pokemon,#freeModal .tool-palette-frame{flex-shrink:0;}
#revealedSprite{min-width:155px;min-height:155px;object-fit:contain;image-rendering:pixelated;}
.result-creature img{min-width:95px;min-height:95px;object-fit:contain;}
#gamePanel .revealed-pokemon img,#resultShowcase img{animation-duration:1.6s;}
.pantone-mini .pantone-swatch::after{background:rgba(55,124,200,.48)!important;}





@media (prefers-reduced-motion:reduce){body.no-animations .free-pokemon-item img{animation:none!important;}}

/* v22 · Diferenciar el suavizado de la tarjeta 3D del píxel del sprite */
.pantone-face{image-rendering:auto!important;backface-visibility:hidden;outline:0;}
.pantone-swatch img{image-rendering:pixelated!important;}
#freeModal .modal-card{width:min(92vw,900px)!important;max-height:calc(100dvh - 12px)!important;padding:clamp(12px,2vh,26px)!important;}
#freeModal .free-pokedex-list{max-height:min(220px,26vh)!important;}
.free-filters label,.free-filters select{font-family:"Silkscreen",monospace!important;}
#gamePanel #revealedSprite{width:clamp(155px,17vw,205px)!important;height:clamp(155px,17vw,205px)!important;max-height:min(23vh,205px)!important;}
.round-strip img{width:34px!important;height:34px!important;object-fit:contain;image-rendering:pixelated;}
body.no-animations .free-pokemon-item img{animation:none!important;}
/* v22 · Saltitos de los iconos acertados en el indicador de rondas */
.round-strip img.solved { transform-origin:center bottom; }
body.no-animations .round-strip img.solved {animation:none!important;}


/* ============================================================
   v24 · Base visual v22 conservada: ajustes solicitados únicamente
   ============================================================ */
/* Blanco azulado en modo claro; tema oscuro y Game Boy mantienen sus variables. */
:root { --panel-bg: #fafeff; }

/* Recuperar el borde ARCOÍRIS móvil del tema (sin gris ni monocromo).
   Se enmascara el centro, conservando únicamente el marco de color. */
body:not(.gameboy-theme) .theme-switch:hover::after,
body:not(.gameboy-theme) .theme-switch:focus-visible::after {
  content: "";
  position: absolute;
  inset: -5px;
  padding: 4px;
  border: 0!important;
  background-image: linear-gradient(90deg, #dc52c0, #23a0dc, #e59a3d, #dc52c0, #23a0dc, #e59a3d, #dc52c0)!important;
  background-size: 200% 100%!important;
  background-position: 0 50%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box exclude, linear-gradient(#fff 0 0);
  animation: v24-theme-rainbow-pan 4s linear infinite!important;
  pointer-events: none;
}

body.no-animations .theme-switch::after {animation:none!important;}

/* Mantener tal cual los botones y la rejilla de "Otras opciones" de v22. */
.special-options-open {grid-column:1/-1!important;width:100%!important;}

/* Tipografía y distribución mejoradas de v23 sin volver a definir los componentes de v22. */
.score-chip,.score-chip strong,#liveScore,#puntuacionTotal,
.clue-value,.points-line,.final-score small {
  font-family:"Silkscreen",monospace!important;
  font-variant-numeric:tabular-nums;
}
.suggestion-item img {width:52px!important;height:52px!important;min-width:52px!important;object-fit:contain;image-rendering:pixelated;}
.suggestion-item {min-height:62px!important;}
.round-strip img {width:43px!important;height:43px!important;}
#roundStrip .round-slot {min-width:51px;min-height:50px;}
.intro-start-area #startButton:hover {
 background:linear-gradient(90deg,#dc52c0,#23a0dc,#e59a3d,#dc52c0)!important;
 background-size:200% 100%!important;
 animation:rainbow-scroll 4.5s linear infinite!important;
}
.result-creature img {margin-bottom:2px!important;}
.result-creature .result-floor {bottom:5px!important;}

/* Una única zona de pistas a la derecha, sin tocar el autocompletado. */
.extra-clues {display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;}
.extra-clues .generation-clue {position:static!important;margin:0!important;text-align:center;}
@media (min-width:900px) {
  #gamePanel:not(.hidden) > #extraClues {
    grid-column:2;grid-row:6/8;align-self:start;justify-self:stretch;
  }
  #gamePanel:not(.hidden) > .guess-form {justify-self:center;width:min(100%,470px)!important;}
}

/* ============================================================
   POKÉ PALETTE · COMPONENTES CONSOLIDADOS (v25)
   Tipografía, layout y animaciones tienen una única definición final.
   No redefine la paleta ni los controles de la v22.
   ============================================================ */
.score-chip, .score-chip strong, #liveScore, #puntuacionTotal,
.clue-value, .points-line, .final-score small {
  font-family:"Pixelify Sans",monospace!important;
  font-weight:700;
  font-variant-numeric:tabular-nums;
}
.score-chip strong {font-size:clamp(21px,2vw,29px)!important;}
.suggestion-item img {width:56px!important;height:56px!important;min-width:56px!important;image-rendering:pixelated;object-fit:contain;}
.suggestion-item {min-height:65px!important;}
.round-strip img {width:44px!important;height:44px!important;image-rendering:pixelated;}
#roundStrip .round-dot {min-width:48px;}
#gamePanel:not(.hidden) .guess-form{margin-left:auto!important;margin-right:auto!important;}
#gamePanel .palette-frame{box-shadow:4px 7px 18px rgba(0,0,0,.24)!important;}
#gamePanel:not(.hidden)~.footer{margin-top:12px;}
.result-creature img{filter:drop-shadow(3px 6px 3px rgba(0,0,0,.35));}
.result-creature.lost img{filter:brightness(0) drop-shadow(3px 5px 3px rgba(0,0,0,.35));}
body:not([data-theme="dark"]) .result-floor{background:#193e6b!important;}
/* Juego: paleta y pistas adicionales pertenecen al MISMO bloque.
   Esto elimina el solapamiento causado por filas de grid independientes. */
#gamePanel .palette-area{min-width:0;display:flex;flex-direction:column;gap:12px;align-items:stretch;}
#gamePanel .palette-area .palette-frame{position:relative!important;inset:auto!important;width:100%!important;align-self:auto!important;}
#gamePanel .palette-area .extra-clues{position:relative!important;inset:auto!important;width:100%;margin:0!important;display:flex;flex-direction:column;gap:7px;align-items:center;}
#gamePanel .palette-area .extra-clues .generation-clue{position:relative!important;inset:auto!important;line-height:1.3;text-align:center;}
@media (min-width:900px) {
 #gamePanel:not(.hidden) > .palette-area {grid-column:2!important;grid-row:1 / 8!important;align-self:center;justify-self:stretch;}
 #gamePanel:not(.hidden) .palette-area .palette{height:clamp(260px,31vw,440px)!important;}
}
@media (max-width:899px) {
 #gamePanel:not(.hidden) > .palette-area {width:100%;}
 #gamePanel .palette-area .palette{height:clamp(160px,28vw,250px)!important;}
}
/* Aplicación retro: el fondo cuadriculado del juego permanece en ambos temas. */





/* ============================================================
   GAME BOY · ALL THEME-SPECIFIC RULES (v25 consolidation)
   Always last: overrides regular themes without affecting them.
   ============================================================ */
body.gameboy-theme {--panel-bg:#b9c78b!important;--ink:#1d3728!important;--border:#344d2f!important;background:#718b58!important;filter:sepia(.15);}
body.gameboy-theme .pantone-swatch {filter:grayscale(1) sepia(.9) hue-rotate(45deg) saturate(.7);}
body.gameboy-theme .panel,body.gameboy-theme .modal-card {background:#b5c58a!important;color:#263e2a!important;}
body.gameboy-theme .pantone-info {background:#d0dba6!important;color:#263e2a!important;}
body.gameboy-theme .pantone-swatch {background:#809965!important;}
body.gameboy-theme {--gb-dark:#263c26;--gb-mid:#597c42;--gb-light:#a4b779;--gb-pale:#d3dfad;}
body.gameboy-theme .pantone-back,body.gameboy-theme .pantone-face {background:var(--gb-dark)!important;}
body.gameboy-theme .pantone-info {background:var(--gb-dark)!important;color:var(--gb-pale)!important;}
body.gameboy-theme .theme-switch,body.gameboy-theme .theme-switch-wrap {background:var(--gb-mid)!important;color:var(--gb-dark)!important;border-color:var(--gb-dark)!important;}
body.gameboy-theme .pixel-button,body.gameboy-theme .tool-button {background:var(--gb-dark)!important;color:var(--gb-pale)!important;border-color:var(--gb-mid)!important;}
body.gameboy-theme .intro-subtitle {color:var(--gb-dark)!important;}
body.gameboy-theme .palette-title-rainbow,body.gameboy-theme .perfect-rainbow {background:linear-gradient(90deg,#263c26,#597c42,#a4b779,#d3dfad,#263c26)!important;background-size:200% 100%!important;color:transparent!important;background-clip:text!important;-webkit-background-clip:text!important;}
body.gameboy-theme {--muted:#45633c!important;}
body.gameboy-theme .intro-copy,body.gameboy-theme .tiny-note,
body.gameboy-theme .option-heading span,body.gameboy-theme .option-description span,
body.gameboy-theme .clue-status,body.gameboy-theme .clue-value,
body.gameboy-theme .suggestion-number,body.gameboy-theme .field-label,
body.gameboy-theme .modal-card p,body.gameboy-theme .modal-card li {color:#45633c!important;}
body.gameboy-theme{background-color:var(--gb-mid)!important;background-image:repeating-conic-gradient(rgba(24,48,24,.12) 0 25%,transparent 0 50%)!important;background-size:20px 20px!important}
body.gameboy-theme[data-theme="dark"]{--panel-bg:#263c26!important;--ink:#d3dfad!important;--muted:#afc69a!important;--border:#a4b779!important;--accent:#a4b779!important;--blue:#597c42!important}
body.gameboy-theme[data-theme="dark"] .panel,body.gameboy-theme[data-theme="dark"] .modal-card{background:#263c26!important;color:#d3dfad!important}
body.gameboy-theme .generation-choice span{filter:grayscale(1) sepia(1) hue-rotate(38deg) saturate(.7)!important}
body.gameboy-theme .brand,body.gameboy-theme .theme-label{color:var(--gb-pale)!important}
body.gameboy-theme[data-theme="dark"] .pixel-input{background:#344d2f!important;color:#d3dfad!important}
body.gameboy-theme .pantone-mini .pantone-swatch::after{background:rgba(58,123,58,.44)!important;}
body.gameboy-theme .pantone-card.pantone-mini{filter:saturate(.32) sepia(.7) hue-rotate(35deg)!important;}
body.gameboy-theme .theme-switch:hover:after{border-image:linear-gradient(110deg,#d9f8b4,#8cac60,#3e672b,#d9f8b4) 1!important;}
body.gameboy-theme .brand-home span{color:#d9f8b4!important;}
body.gameboy-theme {
 background-color:var(--gb-mid)!important;
 background-image:linear-gradient(45deg,rgba(10,47,15,.12) 25%,transparent 25%,transparent 75%,rgba(10,47,15,.12) 75%),linear-gradient(45deg,rgba(10,47,15,.12) 25%,transparent 25%,transparent 75%,rgba(10,47,15,.12) 75%)!important;
 background-size:16px 16px!important;background-position:0 0,8px 8px!important;
}
body.gameboy-theme .brand-home span,body.gameboy-theme .theme-label{color:#d9f8b4!important;}
body.gameboy-theme[data-theme="dark"] .panel,body.gameboy-theme[data-theme="dark"] .modal-card{background:#263c26!important;color:#d3dfad!important;}
body.gameboy-theme .generation-choice span{filter:grayscale(1) sepia(1) hue-rotate(38deg) saturate(.7)!important;}

/* v26 · Iconos retro de la lista de autocompletado.
   Se amplía la celda sin modificar orden, búsqueda ni eventos. */
.suggestions .suggestion-item {
  grid-template-columns: 72px 76px minmax(0,1fr) !important;
  min-height: 79px !important;
  padding-block: 5px;
}
.suggestions .suggestion-item img {
  width: 70px !important; height: 70px !important; min-width: 70px !important;
  object-fit: contain; image-rendering: pixelated;
}
@media (max-width:520px) {
  .suggestions .suggestion-item {grid-template-columns:60px 60px minmax(0,1fr) !important; min-height:68px !important;}
  .suggestions .suggestion-item img {width:59px !important;height:59px !important;min-width:59px !important;}
}


/* v27 · ajustes de UI, Poké-pantoneras y modales */
:root {
  --panel-bg: #e6f7ff;
}
body:not(.gameboy-theme):not([data-theme="dark"]) .panel,
body:not(.gameboy-theme):not([data-theme="dark"]) .modal-card,
body:not(.gameboy-theme):not([data-theme="dark"]) .pixel-input,
body:not(.gameboy-theme):not([data-theme="dark"]) .tool-button,
body:not(.gameboy-theme):not([data-theme="dark"]) .dropdown-summary,
body:not(.gameboy-theme):not([data-theme="dark"]) .palette-native-picker,
body:not(.gameboy-theme):not([data-theme="dark"]) .flag-button,
body:not(.gameboy-theme):not([data-theme="dark"]) .theme-switch,
body:not(.gameboy-theme):not([data-theme="dark"]) .suggestions {
  background: #e6f7ff !important;
}
.tool-button-image img { width: 24px; height: 24px; image-rendering: pixelated; }
.pantone-card { pointer-events: auto; }
.pantone-face { border-radius: 10px !important; overflow: hidden; }
.pantone-front, .pantone-back { border-radius: 10px !important; }
.pantone-swatch img,
.pantone-card .pantone-face img,
.pantone-face img {
  image-rendering: pixelated !important;
  -ms-interpolation-mode: nearest-neighbor;
}
.pantone-swatch img { filter: drop-shadow(2px 3px 0 rgba(0,0,0,.14)); }
.pantone-rotator, .pantone-card { will-change: transform, translate; }
.pantone-card { transition: translate .18s ease-out; }
.pantone-card:hover { z-index: 5 !important; }
.region-toggle-all {
  grid-column: 2;
  min-height: 42px;
  width: 100%;
  margin-top: 6px;
  font-size: 11px !important;
  line-height: 1.05;
}
.special-options-open {
  grid-column: 1 / -1 !important;
  min-height: 42px !important;
  font-size: 15px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap: 12px !important;
}
.special-options-open img {
  width: 32px !important;
  height: 32px !important;
  align-self: center !important;
}
.special-options-open span { display:inline-flex; align-items:center; line-height:1; }
.intro-tools { display:flex; gap:10px; flex-wrap:wrap; }
.free-filters, .free-filters label, .free-filters span, .free-filters select { font-family: "Silkscreen", monospace !important; }
.hidden-guide-color { opacity: 0; transform: scaleX(0); transform-origin: left center; }
.guide-palette { display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; width:min(100%,280px); margin:0 auto 16px; }
.guide-palette span { display:block; height:68px; border:3px solid var(--border); transform-origin:left center; }
#freePokemonList .free-pokemon-item img.free-item-sprite { width: 54px; height: 54px; image-rendering: pixelated; }
#freePokemonList .free-pokemon-item { min-height: 70px; }
.palette-check-modal { width:min(100%, 760px) !important; }
.debug-card .performance-settings,
.debug-card .language-settings { margin-top: 10px; }
.modal-card { scrollbar-width: thin; }

/* v27.1 · ajustes extra */
.suggestions .suggestion-item { grid-template-columns: 68px 72px minmax(0,1fr) !important; min-height: 74px !important; }
.suggestions .suggestion-item img { width: 66px !important; height: 66px !important; min-width: 66px !important; }
#freeModal .modal-card { width:min(100%, 720px) !important; max-height:min(92vh, 780px) !important; }
#freeModal .free-pokedex-list { max-height:min(205px, 25vh) !important; }

/* v28 · tema inicial oscuro, bordes limpios y capa de giro independiente */
body[data-theme="dark"]:not(.gameboy-theme) .panel,
body[data-theme="dark"]:not(.gameboy-theme) .modal-card,
body[data-theme="dark"]:not(.gameboy-theme) .pixel-input,
body[data-theme="dark"]:not(.gameboy-theme) .tool-button,
body[data-theme="dark"]:not(.gameboy-theme) .dropdown-summary,
body[data-theme="dark"]:not(.gameboy-theme) .palette-native-picker,
body[data-theme="dark"]:not(.gameboy-theme) .flag-button,
body[data-theme="dark"]:not(.gameboy-theme) .suggestions { background: var(--panel-bg) !important; color:var(--ink); }
/* El color de la caja del interruptor permanece oscuro en modo noche. */
body[data-theme="dark"]:not(.gameboy-theme) .theme-switch { background: #183c6b !important; }
body[data-theme="dark"] .pantone-face,
body[data-theme="dark"] .pantone-front,
body[data-theme="dark"] .pantone-back { outline:none !important; border:0 !important; box-shadow:none !important; }
.pantone-click-layer { position:absolute;inset:0; transform-style:preserve-3d; backface-visibility:hidden; }
.pantone-click-layer .pantone-face { border-radius:10px; }
/* Evitar composiciones 3D extra cuando no son necesarias. */
.pantone-click-layer { will-change:auto; }
.theme-switch { position:relative; }
.theme-mode-emblem { position:absolute;left:-10px;bottom:-9px;width:17px!important;height:17px!important;object-fit:contain;image-rendering:pixelated;pointer-events:none;filter:drop-shadow(1px 1px 0 rgba(0,0,0,.25)); }
/* v28 ajuste: las flechas eran marcas del boceto, no elementos de interfaz. */
.region-toggle-controls {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  margin: 6px 0 2px;
}
.region-toggle-controls .region-toggle-all {
  display: block;
  width: 100% !important;
  height: 38px;
  min-height: 38px;
  margin: 0 !important;
  padding: 4px 12px !important;
  font-size: 11px !important;
  line-height: 1.1;
}

/* ============================================================
   v29 | optimización, pantalla completa y accesibilidad
   ============================================================ */
/* Contador y pistas legibles: Silkscreen con dígitos claramente separados. */
.round-counter,.round-counter *,#clueNumber,#clueTotal,#clueConnector,
.clue-label,.clue-value,#gamePanel .clue-count strong,
#gamePanel .clue-count span {font-family:"Silkscreen",monospace!important;font-variant-numeric:tabular-nums;}
#gamePanel .clue-count strong {letter-spacing:.015em;}
body.in-game-screen .game-shell {width:min(100%,1640px);}
body.in-game-screen .footer{margin-top:clamp(20px,3.4vh,50px)!important;}
body:has(#gamePanel:not(.hidden)),body:has(#resultPanel:not(.hidden)) {min-height:100dvh;align-content:stretch;}
body:has(#gamePanel:not(.hidden)) .game-shell,
body:has(#resultPanel:not(.hidden)) .game-shell {min-height:calc(100dvh - 42px);display:flex;flex-direction:column;justify-content:center;}
body:has(#gamePanel:not(.hidden)) .footer,
body:has(#resultPanel:not(.hidden)) .footer {margin-top:auto!important;padding-top:16px;}
/* Los paneles usan todo el espacio útil, sin invadir los modales. */
@media (min-width:1050px) and (min-height:850px){
 body:has(#gamePanel:not(.hidden)) #gamePanel{min-height:min(690px,72dvh);align-content:space-around;}
 body:has(#gamePanel:not(.hidden)) .palette-area .palette {height:clamp(350px,45dvh,590px)!important;}
}
/* Animaciones temporales para cada expansión de paleta (Web Animations API). */
#gamePanel .palette.waapi-palette .palette-swatch {transition:none!important;animation:none!important;}
#gamePanel .palette.waapi-palette .palette-swatch.swatch-enter{animation:none!important;}
/* El listado de fallos queda dentro del panel y el reinicio fuera. */
.failed-attempts {margin:12px auto 4px;text-align:center;font:700 11px "Silkscreen",monospace;max-width:100%;}
.failed-attempts-strip {display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;flex-wrap:wrap;margin-top:6px;}
.failed-attempts-strip img {width:clamp(36px,4vw,48px);height:clamp(36px,4vw,48px);object-fit:contain;image-rendering:pixelated;}
#gamePanel .skip-round {font-size:12px;min-height:38px;padding:7px 12px;max-width:190px;margin:auto;background:var(--blue);color:white;}
#gamePanel.round-finished #skipRoundButton {display:none!important;}
.outside-restart{width:min(100%,490px);margin:10px 0 14px;display:flex;justify-content:center;}
.outside-restart .restart-game{font-size:12px;padding:9px 18px;}
.outside-restart.hidden {display:none!important;}
/* Búsqueda de la comprobación de paletas con z-index propio. */
.palette-search-row{position:relative;overflow:visible;align-items:flex-start;}
.palette-search-row .autocomplete-wrap{flex:1;min-width:0;position:relative;z-index:120;}
.palette-search-row .suggestions {position:absolute;z-index:9999!important;top:calc(100% + 4px);left:0;right:0;max-height:280px;}
.palette-search-row .suggestion-item img{width:54px;min-width:54px;height:54px;object-fit:contain;image-rendering:pixelated;}
/* Tarjetas: el píxel sólo se interpola en el sprite, no en el contenedor 3D. */
.pantone-card.pantone-loading .pantone-front{visibility:hidden;}
.pantone-card,.pantone-face,.pantone-click-layer{outline:0!important;}
.pantone-face{border:0!important;backface-visibility:hidden;-webkit-backface-visibility:hidden;box-shadow:none!important;}
.pantone-front,.pantone-back{transform:translateZ(.5px);-webkit-transform:translateZ(.5px);}
.pantone-back{transform:rotateY(180deg) translateZ(.5px);-webkit-transform:rotateY(180deg) translateZ(.5px);}
.pantone-click-layer{backface-visibility:visible;}
.pantone-card .pantone-swatch img {image-rendering:pixelated!important;}
body.no-pantone-hover .pantone-card{transition:none!important;}
body.no-pantone-hover .pantone-rotator{transition:none!important;}
/* Guía: sin bordes, con profundidad visual. */
.guide-palette span {border:0!important;box-shadow:3px 5px 7px rgba(0,0,0,.25)!important;}
/* Hover arcoíris: capa translúcida gradual, sin sustituir los fondos existentes. */
.primary,.special-options-open,.pixel-button {transition:background-color .28s ease,filter .28s ease,box-shadow .28s ease,transform .18s ease!important;}
@media(max-width:899px){
 body.in-game-screen .game-shell {width:100%;}
 .outside-restart{width:100%;max-width:560px;margin-left:auto;margin-right:auto;}
}

/* v30: degradado intacto con entrada/salida por opacidad (sin reescalar la textura). */
#startButton,#replayButton{position:relative;isolation:isolate;background:var(--accent)!important;overflow:hidden;}
#startButton::before,#replayButton::before{content:"";position:absolute;inset:0;z-index:-1;opacity:0;pointer-events:none;
 background:linear-gradient(90deg,#dc52c0,#23a0dc,#e59a3d,#dc52c0);background-size:200% 100%;
 animation:rainbow-scroll 8s linear infinite;transition:opacity .35s ease;}
#startButton:hover::before,#replayButton:hover::before,#startButton:focus-visible::before,#replayButton:focus-visible::before{opacity:1;}
body.gameboy-theme #startButton::before,body.gameboy-theme #replayButton::before{background:linear-gradient(90deg,#0F380F,#306230,#8BAC0F,#9BBC0F,#0F380F);background-size:200% 100%;}
body.no-animations #startButton::before,body.no-animations #replayButton::before{animation:none!important;}
body[data-theme="dark"] .pantone-front {background:#141414!important;}
body[data-theme="dark"] .pantone-click-layer{background:transparent!important;}
/* Los intentos fallidos no deben entrar en el emplazamiento automático del grid. */
@media(min-width:900px){
 #gamePanel:not(.hidden)>.failed-attempts {grid-column:1!important;grid-row:7!important;align-self:end;}
 #gamePanel:not(.hidden)>.game-actions {grid-column:1!important;grid-row:8!important;}
 #gamePanel:not(.hidden)>.palette-area{grid-column:2!important;grid-row:1 / 9!important;}
}
@media(max-width:899px){
 #gamePanel:not(.hidden)>.failed-attempts {grid-row:auto!important;grid-column:auto!important;}
}


/* v30 — Game Boy DMG: cuatro colores exactos, variante clara/oscura. */
body.gameboy-theme{--gb-black:#0F380F;--gb-dark:#306230;--gb-light:#8BAC0F;--gb-white:#9BBC0F;
 --panel-bg:#9BBC0F!important;--ink:#0F380F!important;--border:#306230!important;--muted:#306230!important;
 background-color:#8BAC0F!important;background-image:repeating-conic-gradient(#9BBC0F 0 25%,#8BAC0F 0 50%)!important;background-size:20px 20px!important;filter:none!important;}
body.gameboy-theme[data-theme="dark"]{--panel-bg:#0F380F!important;--ink:#9BBC0F!important;--border:#8BAC0F!important;--muted:#8BAC0F!important;
 background-color:#0F380F!important;background-image:repeating-conic-gradient(#306230 0 25%,#0F380F 0 50%)!important;}
body.gameboy-theme .panel,body.gameboy-theme .modal-card,body.gameboy-theme .pixel-input,body.gameboy-theme .suggestions{background:var(--panel-bg)!important;color:var(--ink)!important;border-color:var(--border)!important;}
body.gameboy-theme .intro-subtitle,body.gameboy-theme .intro-copy,body.gameboy-theme .tiny-note,body.gameboy-theme .option-heading span,body.gameboy-theme .option-description span,body.gameboy-theme .clue-status,body.gameboy-theme .clue-value,body.gameboy-theme .suggestion-number,body.gameboy-theme .field-label,body.gameboy-theme .modal-card p,body.gameboy-theme .modal-card li{color:var(--ink)!important;}
body.gameboy-theme[data-theme="dark"] .intro-subtitle{color:#9BBC0F!important;}
body.gameboy-theme .brand-home span,body.gameboy-theme .theme-label{color:#9BBC0F!important;}
body.gameboy-theme .pixel-button,body.gameboy-theme .tool-button,body.gameboy-theme .theme-switch,body.gameboy-theme .theme-switch-wrap{background:#306230!important;color:#9BBC0F!important;border-color:#8BAC0F!important;}
body.gameboy-theme .pantone-swatch{filter:grayscale(1) contrast(1.2)!important;}
body.gameboy-theme .pantone-info,body.gameboy-theme .pantone-back{background:#0F380F!important;color:#9BBC0F!important;}
body.gameboy-theme .palette-title-rainbow,body.gameboy-theme .perfect-rainbow{background:linear-gradient(90deg,#9BBC0F,#8BAC0F,#306230,#9BBC0F)!important;background-size:200% 100%!important;color:transparent!important;background-clip:text!important;-webkit-background-clip:text!important;}
body.gameboy-theme .generation-choice span{filter:grayscale(1) sepia(1) hue-rotate(35deg) saturate(.4) contrast(1.6)!important;}
body.gameboy-theme .pantone-mini .pantone-swatch::after{background:rgba(15,56,15,.38)!important;}
body.gameboy-theme .pantone-mini{filter:grayscale(1) sepia(.7) hue-rotate(33deg)!important;}
body.gameboy-theme .theme-switch:hover::after{border-image:none!important;border-color:#9BBC0F!important;}
.theme-switch,.theme-switch-wrap{border-radius:12px!important;}
.theme-switch:hover::after,.theme-switch:focus-visible::after{border-radius:12px!important;}
/* Pantone dark: elimina la costura clara del borde y pequeñas fugas del reverso. */
body[data-theme="dark"] .pantone-face{outline:0!important;border:0!important;box-shadow:none!important;backface-visibility:hidden!important;-webkit-backface-visibility:hidden!important;}
body[data-theme="dark"] .pantone-front,body[data-theme="dark"] .pantone-back{background:#141414!important;}
body.gameboy-theme[data-theme="dark"] .pantone-front,body.gameboy-theme[data-theme="dark"] .pantone-back{background:#0F380F!important;}
.pantone-front,.pantone-back{background-clip:padding-box;transform-style:flat;}
/* Espacio de comprobación y sugerencias: evitar recorte del popup. */
.palette-check-modal{overflow:visible!important;max-height:min(92vh,880px)!important;}
#paletteModal .palette-search-row{position:relative;z-index:20;}
#paletteModal .autocomplete-wrap{z-index:25;}
#paletteModal #debugSuggestions{z-index:9999!important;max-height:240px;}
.palette-empty-hint{text-align:center;font:16px 'Silkscreen',monospace;line-height:1.7;min-height:130px;display:grid;place-items:center;margin:18px 0;color:var(--muted);}
.palette-check-shiny{display:flex;align-items:center;gap:10px;justify-content:center;font:13px 'Silkscreen',monospace;margin:12px auto;}
@media(max-height:760px){.palette-check-modal{max-height:95vh!important;overflow-y:auto!important;}#paletteModal #debugSuggestions{max-height:160px;}}

/* DMG sprites: quantize painted pixels to the four specified greens. */
body.gameboy-theme .pantone-swatch img,body.gameboy-theme .result-creature img,body.gameboy-theme .brand-mark-image,body.gameboy-theme .pantone-back-logo,body.gameboy-theme .tool-button-image img,body.gameboy-theme #themeSprite{filter:url(#ppDmgFilter)!important;}
body.gameboy-theme .generation-choice span{background:linear-gradient(115deg,#306230 0 48%,#8BAC0F 48% 100%)!important;background-size:200% 100%!important;}


/* ============================================================
   v31 · Ajustes de maquetación solicitados
   No modificar la animación de arcoíris ni el autocompletado.
   ============================================================ */
/* Fuente bitmap alternativa con dígitos 2, 4, 5 y 8 legibles. */
#gamePanel .clue-count strong, #gamePanel #clueNumber,
#gamePanel #clueTotal, #gamePanel #clueConnector {
  font-family: "VT323", "Silkscreen", monospace !important;
  font-variant-numeric: lining-nums tabular-nums;
  font-weight: 400 !important;
}
#gamePanel .clue-count strong {
  font-size: clamp(78px, 7.7vw, 110px) !important;
  line-height: .92 !important;
  letter-spacing: 0 !important;
}
#gamePanel .clue-count span {
  font-size: clamp(32px, 3.6vw, 48px) !important;
  letter-spacing: .06em;
}
#gamePanel .clue-count { align-items: center !important; gap: clamp(9px, 2vw, 20px) !important; }

/* Los cinco Pokémon acertados son el indicador principal; la ronda, secundario. */
.game-shell > .round-strip:not(.hidden),
.game-shell:has(#gamePanel:not(.hidden)) > .round-strip:not(.hidden) {
  width: min(100%, 510px) !important;
  min-height: 54px;
  padding: 8px 18px !important;
  gap: clamp(10px, 2vw, 19px);
  justify-content: space-evenly;
  margin-left:auto !important;
  margin-right:auto !important;
}
.game-shell > .round-counter:not(.hidden),
.game-shell:has(#gamePanel:not(.hidden)) > .round-counter:not(.hidden) {
  width: max-content !important;
  min-width: 0 !important;
  font-size: clamp(14px, 1.5vw, 19px) !important;
  padding: 4px 13px !important;
  line-height: 1.2 !important;
  margin-left:auto !important;
  margin-right:auto !important;
}

/* Contenido del cajetín izquierdo: títulos, pista y acciones en un mismo eje central. */
#gamePanel:not(.hidden) > .game-heading,
#gamePanel:not(.hidden) > #gamePrompt,
#gamePanel:not(.hidden) > .clue-status,
#gamePanel:not(.hidden) > .guess-form,
#gamePanel:not(.hidden) > .feedback,
#gamePanel:not(.hidden) > .game-actions,
#gamePanel:not(.hidden) > .failed-attempts {
  box-sizing:border-box;
  justify-self:stretch;
  margin-left:0 !important;
  margin-right:0 !important;
}
#gamePanel:not(.hidden) > #gamePrompt,
#gamePanel:not(.hidden) > .clue-status { text-align:center !important; }
#gamePanel:not(.hidden) .guess-form .field-label { text-align:center !important; }
#gamePanel:not(.hidden) .guess-form .autocomplete-wrap { max-width:100%; margin-inline:auto; }
#gamePanel:not(.hidden) .guess-form #guessButton { margin-inline:auto !important; }
#gamePanel:not(.hidden) .game-actions { text-align:center !important; }
#gamePanel:not(.hidden) #skipRoundButton { display:block; margin-inline:auto !important; }
#gamePanel.round-finished #skipRoundButton { display:none !important; }

/* La ventana de comprobación completa se desplaza por dentro,
   no puede crecer por debajo de la pantalla. */
#paletteModal.modal-backdrop {
  box-sizing:border-box;
  inset:0;
  padding: max(12px, 3dvh) 12px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
}
#paletteModal .palette-check-modal {
  position:relative;
  display:block;
  flex:0 0 auto;
  width:min(760px,100%) !important;
  max-width:100% !important;
  max-height:calc(100dvh - max(24px, 6dvh)) !important;
  min-height:0;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  padding:clamp(14px,2.4vw,28px);
  overscroll-behavior:contain;
  scrollbar-width:thin;
}
#paletteModal .debug-source-wrap,
#paletteModal .palette-editor,
#paletteModal .hex-editor-grid {
  max-width:100%;
  min-width:0;
}
#paletteModal .palette-editor .hex-input-controls,
#paletteModal .palette-editor .hex-editor-field { min-width:0; }
#paletteModal .palette-editor .palette-hex-input { min-width:0; }
#paletteModal .palette-editor .pixel-button { max-width:100%; }
#paletteModal #paletteEditStatus { overflow-wrap:anywhere; }
/* Dar sitio a las sugerencias sin hacer que la ventana sobrepase la altura. */
#paletteModal #debugSuggestions {
  max-height:min(240px,35dvh);
  overflow-y:auto;
  overscroll-behavior:contain;
  z-index:9999 !important;
}
@media(max-width:660px) {
  #paletteModal .debug-source-wrap {grid-template-columns:minmax(0,1fr) !important;}
  #paletteModal .hex-editor-grid {grid-template-columns:minmax(0,1fr) !important;}
  #paletteModal .palette-check-modal {max-height:calc(100dvh - 20px) !important;}
  .game-shell > .round-strip:not(.hidden) {max-width:calc(100vw - 30px) !important;}
  #gamePanel .clue-count strong {font-size:clamp(67px,15vw,95px) !important;}
}


/* v32 · Modos de juego. El rediseño completo del menú queda deliberadamente pendiente. */
.mode-picker { margin:14px auto 10px; width:min(100%,520px); text-align:center; }
.mode-picker-buttons {display:grid;grid-template-columns:1fr 1fr;gap:8px;}
.mode-choice {min-width:0; font-size:clamp(11px,1.3vw,15px);border:2px solid var(--border, #204b75);}
.mode-choice.is-selected, .leaderboard-tabs .is-selected {background:#4f87ba;color:white;box-shadow:3px 3px 0 rgba(0,0,0,.22)}
.mode-description {margin:9px auto 0;font-size:12px;line-height:1.6;max-width:45ch;}
.timed-mode-controls {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;margin:12px auto 0;}
.timed-mode-controls .field-label {grid-column:1/-1;text-align:center;}
.timed-mode-controls select{width:100%;min-width:0;}
.timed-mode-controls button{font-size:12px;}
.timer-readout {width:max-content;min-width:120px;margin:3px auto 12px;padding:5px 12px;background:#183c6b;color:white;border:2px solid #8ca8c5;text-align:center;font-family:'Silkscreen',monospace;font-size:clamp(17px,2vw,25px);}
.round-strip.timed-strip {width:min(100%,650px)!important;max-width:100%!important;gap:5px!important;flex-wrap:wrap;padding:8px!important;}
.round-strip.timed-strip .round-dot {min-width:27px!important;}
.round-strip.timed-strip img {width:30px!important;height:30px!important;}
.round-strip.timed-strip .round-separator {font-size:11px;}
.timed-result-summary{text-align:center;font-family:'Silkscreen',monospace;font-size:15px;margin:16px auto;}
.timed-submit-status{text-align:center;font-size:12px;}
.leaderboard-modal{width:min(92vw,780px);max-height:88dvh;overflow:auto;}
.leaderboard-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:16px 0;}
.leaderboard-tabs button{font-size:12px;padding:9px 5px;}
.leaderboard-scroll{max-width:100%;overflow-x:auto;}
.leaderboard-table{border-collapse:collapse;width:100%;min-width:450px;font-size:12px;}
.leaderboard-table th,.leaderboard-table td{padding:8px 5px;text-align:center;border-bottom:1px solid rgba(100,135,175,.4)}
.leaderboard-table td:nth-child(2){text-align:left;}
.leaderboard-medal{width:25px;height:25px;image-rendering:pixelated;vertical-align:middle;}
body:not(.in-game-screen) #timerReadout{display:none;}
@media(max-width:600px){.timed-mode-controls{grid-template-columns:1fr}.leaderboard-tabs{gap:2px}.leaderboard-tabs button{font-size:10px}}

/* Contrarreloj tiene todas las regiones y formas especiales activadas: no se muestran ajustes bloqueados. */
body.time-attack-active #introPanel .game-options {display:none!important;}
body.time-attack-active .mode-picker {margin-bottom:12px;}
body.time-attack-active #introPanel {min-height:unset;}


/* v33 · Entrada en dos etapas (selección / configuración); sin rehacer los estilos existentes. */
body.menu-landing #introPanel .trainer-label,
body.menu-landing #introPanel #playerName,
body.menu-landing #introPanel .game-options,
body.menu-landing #introPanel .timed-mode-controls,
body.menu-landing #introPanel .casual-bottom-actions,
body.menu-landing .intro-start-area { display:none !important; }
body.menu-landing #introPanel .mode-picker { margin:20px auto 8px; }
body.menu-landing #introPanel { padding-top:46px!important; padding-bottom:48px!important; }
body.menu-landing #introPanel .intro-copy { margin-bottom:14px; }
body.menu-landing #introPanel .mode-picker-buttons { gap:clamp(12px,4vw,42px); padding:0 clamp(6px,5vw,38px); }
body.menu-landing #introPanel .mode-choice { min-height:54px; font-size:clamp(12px,1.6vw,16px); }
body.menu-setup #introPanel .mode-picker {display:none!important;}
body.menu-setup #introPanel .casual-bottom-actions {display:flex;justify-content:center;margin:14px auto 0;}
body.menu-setup #introPanel .casual-bottom-actions button {min-width:185px;}
body.menu-setup.time-attack-active #introPanel .casual-bottom-actions {display:none!important;}
body.menu-setup #introPanel .timed-mode-controls.hidden {display:none!important;}
body.menu-setup #introPanel .timed-mode-controls {
  display:flex!important; flex-direction:column; width:100%; margin:15px auto 4px; gap:9px; align-items:stretch;
}
body.menu-setup #introPanel .timed-mode-controls #timedVariant {position:absolute; width:1px; height:1px; opacity:0; pointer-events:none;}
body.menu-setup #introPanel .timed-difficulty-heading {font-family:'Silkscreen',monospace; font-size:clamp(12px,2vw,17px); margin:0 auto;text-align:center;}
body.menu-setup #introPanel .timed-rules-note {font-family:'Silkscreen',monospace;font-size:10px;line-height:1.5;text-align:center;margin:0 auto;max-width:48ch;}
body.menu-setup #introPanel .timed-difficulty-options {display:grid;grid-template-columns:1fr;gap:8px;padding:10px 0;border-top:1px dotted var(--border);border-bottom:1px dotted var(--border);}
body.menu-setup #introPanel .timed-difficulty-option {display:grid;grid-template-columns:32px 22px minmax(0,1fr);column-gap:8px;row-gap:2px;align-items:center;min-height:54px; padding:6px 9px; text-align:left; background:transparent;border:0; color:inherit;cursor:pointer;font-family:'Silkscreen',monospace;}
body.menu-setup #introPanel .timed-difficulty-option img {width:28px;height:28px;grid-row:1/3;image-rendering:pixelated;object-fit:contain;}
body.menu-setup #introPanel .timed-difficulty-option::before {content:'';grid-row:1/3;width:18px;height:18px;border:2px solid var(--border);background:var(--panel-bg,#e6f7ff);box-shadow:2px 2px 0 rgba(0,0,0,.25);}
body.menu-setup #introPanel .timed-difficulty-option.is-selected::before {background:var(--accent,#8b83e8);box-shadow:inset 0 0 0 3px var(--panel-bg,#e6f7ff),2px 2px 0 rgba(0,0,0,.25);}
body.menu-setup #introPanel .timed-difficulty-option span {font-size:12px;line-height:1.35;}
body.menu-setup #introPanel .timed-difficulty-option small {font-size:9px;opacity:.8;line-height:1.45;grid-column:3;}
body.menu-setup #introPanel .timed-difficulty-option:hover {background:rgba(115,155,215,.14);}
body.menu-setup #introPanel .timed-bottom-actions {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;margin-top:9px;align-items:stretch;}
body.menu-setup #introPanel .timed-bottom-actions button {width:100%;min-width:0;min-height:43px;padding:7px 8px;font-size:clamp(10px,1.6vw,13px);font-family:'Silkscreen',monospace;}
body.menu-setup #introPanel .trainer-label {margin-top:10px;}
body.menu-setup.time-attack-active #introPanel .game-options {display:none!important;}
body.menu-setup #introPanel .mode-description {display:none!important;}
@media(max-width:480px){body.menu-setup #introPanel .timed-bottom-actions{gap:7px}body.menu-landing #introPanel .mode-picker-buttons{gap:8px;padding:0}}


/* ===============================================================
   v34 · PORTADA / selector de modos
   Diseño vertical de la pantalla inicial (no modifica el juego).
   =============================================================== */
body:has(#introPanel:not(.hidden)) .game-shell {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  min-height:calc(100dvh - 56px);
}
/* El footer se reserva al pie, sin mezclarse con las Poké-pantoneras. */
body:has(#introPanel:not(.hidden)) .footer {
  position:relative;
  z-index:10;
  width:100%;
  margin-top:auto !important;
  padding:28px 12px 5px;
  flex-wrap:wrap;
  justify-content:center !important;
  align-items:center;
  gap:4px 0;
  font-family:'Silkscreen',monospace;
  font-size:clamp(9px,.82vw,12px);
  line-height:1.55;
  overflow-wrap:anywhere;
  text-shadow:0 2px 4px #060e1c;
}
body.menu-landing #introPanel {
  display:flex;
  flex-direction:column;
  align-items:stretch;
  width:min(100%,560px) !important;
  min-height:clamp(510px,74dvh,650px) !important;
  padding:clamp(32px,5dvh,53px) clamp(20px,3vw,32px) clamp(28px,4dvh,40px) !important;
}
body.menu-landing #introPanel > .intro-subtitle {
  margin:0 auto clamp(20px,3dvh,30px);
}
body.menu-landing #introPanel > h1 {
  font-size:clamp(23px,2.8vw,33px);
  line-height:1.16;
  margin:0 auto clamp(21px,3dvh,35px);
}
body.menu-landing #introPanel > .intro-copy {
  max-width:46ch;
  font-size:clamp(11px,1.15vw,14px);
  line-height:1.65;
  margin:0 auto clamp(18px,3dvh,28px);
}
body.menu-landing #introPanel .mode-picker {
  box-sizing:border-box;
  width:100%;
  max-width:none;
  border-top:2px solid var(--border);
  padding-top:clamp(20px,5dvh,55px);
  margin:auto 0 0 !important;
}
body.menu-landing #introPanel .mode-picker-prompt {
  font-family:'Silkscreen',monospace;
  font-size:clamp(10px,1.1vw,13px);
  line-height:1.5;
  margin:0 auto clamp(16px,3dvh,25px);
  text-align:center;
}
body.menu-landing #introPanel .mode-picker-buttons {
  gap:clamp(16px,2.5vw,34px);
  padding:0 clamp(6px,3vw,22px);
}
body.menu-landing #introPanel .mode-choice {
  min-height:clamp(56px,8dvh,72px);
  font-family:'Silkscreen',monospace;
  font-size:clamp(12px,1.4vw,17px);
  padding:10px 6px;
}
body.menu-landing #introPanel .mode-description {
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:4.8em;
  max-width:46ch;
  margin:clamp(12px,2.7dvh,23px) auto 0;
  font-family:'Silkscreen',monospace;
  font-size:clamp(10px,1vw,12px);
  line-height:1.6;
  color:var(--muted);
  text-align:center;
}
/* Pantalla de contrarreloj: mejorar lectura sin desalinear las acciones. */
body.menu-setup.time-attack-active #introPanel .timed-difficulty-heading {
  font-size:clamp(15px,1.8vw,20px);
}
body.menu-setup.time-attack-active #introPanel .timed-rules-note {
  font-size:clamp(11px,1.15vw,14px);
  max-width:52ch;
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-option {
  min-height:clamp(65px,9dvh,83px);
  grid-template-columns:36px 23px minmax(0,1fr);
  column-gap:10px;
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-option img {
  width:34px;
  height:34px;
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-option span {
  font-size:clamp(13px,1.35vw,16px);
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-option small {
  font-size:clamp(10px,1.05vw,12px);
  line-height:1.6;
}
body.menu-setup.time-attack-active #introPanel .timed-bottom-actions button {
  font-size:clamp(11px,1.2vw,14px);
  min-height:48px;
}
@media(max-width:680px) {
  body:has(#introPanel:not(.hidden)) .game-shell {min-height:calc(100dvh - 35px);}
  body.menu-landing #introPanel {min-height:clamp(455px,72dvh,625px)!important;}
  body.menu-landing #introPanel .mode-picker-buttons {gap:12px;padding:0;}
  body.menu-landing #introPanel .mode-description {min-height:5.7em;}
  body:has(#introPanel:not(.hidden)) .footer {padding-top:24px;}
}
@media(max-height:620px) and (min-width:681px) {
  body.menu-landing #introPanel {min-height:490px !important;}
}


/* v35 · correcciones acotadas: ritmo, centrado y adaptación al viewport. */
/* Evita la animación acelerada de un selector antiguo: el degradado real
   permanece en ::before, con el mismo ciclo de 8 segundos que el resto. */
.intro-start-area #startButton:hover,
.intro-start-area #startButton:focus-visible {
  animation:none !important;
  background:var(--accent) !important;
}
#startButton::before { animation-duration:8s !important; animation-timing-function:linear !important; }
body.no-animations #startButton::before {animation:none !important;}
/* Mantener centrado el pie del panel y el botón que está fuera de él. */
body.in-game-screen .outside-restart:not(.hidden) {
  width:min(100%, 548px) !important;
  max-width:548px !important;
  align-self:flex-start;
  margin-left:0 !important;
  margin-right:0 !important;
  display:flex;
  justify-content:center;
}
#gamePanel:not(.hidden) > .game-heading,
#gamePanel:not(.hidden) > #gamePrompt,
#gamePanel:not(.hidden) > .clue-status,
#gamePanel:not(.hidden) > .guess-form,
#gamePanel:not(.hidden) > .feedback,
#gamePanel:not(.hidden) > .game-actions,
#gamePanel:not(.hidden) > .failed-attempts {
  justify-self:center !important;
  width:100%;
  max-width:548px;
  text-align:center;
}
/* Distribuir mejor el alto del panel de juego en pantalla grande/F11. */
@media (min-width:1000px) and (min-height:820px) {
  body.in-game-screen .game-shell {min-height:calc(100dvh - 35px);}
  #gamePanel:not(.hidden) {min-height:clamp(625px,79dvh,1050px) !important;}
  #gamePanel:not(.hidden) > .palette-area .palette {min-height:clamp(335px,45dvh,620px);}
}
/* Contrarreloj: diez resultados en dos filas equilibradas de cinco. */
body.time-attack-active #resultShowcase {
  display:grid !important;
  grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  gap:clamp(5px,1vw,15px) !important;
  max-width:100%;
  padding:clamp(8px,1.5vw,20px) !important;
}
body.time-attack-active #resultShowcase .result-creature {min-width:0;max-width:100%;height:clamp(95px,11vw,140px);}
body.time-attack-active #resultShowcase .result-creature img {width:clamp(45px,5.7vw,78px);height:clamp(45px,5.7vw,78px);}
@media(max-width:600px){body.time-attack-active #resultShowcase {gap:3px!important;padding:6px!important;}
 body.time-attack-active #resultShowcase .result-creature{height:95px;}}

@media (max-width:899px) {
 body.in-game-screen .outside-restart:not(.hidden) {
   align-self:center;
   width:100% !important;
   max-width:560px !important;
   margin-inline:auto !important;
 }
}
/* Anula exclusivamente la colocación olímpica de cinco resultados durante Contrarreloj. */
body.time-attack-active #resultShowcase .result-creature,
body.time-attack-active #resultShowcase .result-creature:nth-child(4),
body.time-attack-active #resultShowcase .result-creature:nth-child(5) {
  grid-column:auto !important;
  grid-row:auto !important;
}


/* v36 · SVG originales de interfaz (Klink/Poké Ball monocromos) */
#debugOpen img.monochrome-ui-icon,
#paletteOpen img.monochrome-ui-icon {
  display: block; width: 25px; height: 25px; object-fit: contain;
  image-rendering: auto;
  filter: brightness(0) saturate(100%) invert(16%) sepia(22%) saturate(1147%) hue-rotate(173deg) brightness(85%) contrast(92%) !important;
}
body[data-theme="dark"]:not(.gameboy-theme) #debugOpen img.monochrome-ui-icon,
body[data-theme="dark"]:not(.gameboy-theme) #paletteOpen img.monochrome-ui-icon {
  filter: brightness(0) invert(1) !important;
}
body.gameboy-theme #debugOpen img.monochrome-ui-icon,
body.gameboy-theme #paletteOpen img.monochrome-ui-icon {
  filter: brightness(0) saturate(100%) invert(57%) sepia(23%) saturate(1402%) hue-rotate(31deg) brightness(102%) contrast(95%) !important;
}
#shinyCharm, #masterBallCharm { object-fit: contain; image-rendering: auto; }

/* El icono solicitado también identifica el acceso al modo libre. */
#freeOpen img.monochrome-ui-icon {
  display:block;width:25px;height:25px;object-fit:contain;image-rendering:auto;
  filter:brightness(0) saturate(100%) invert(16%) sepia(22%) saturate(1147%) hue-rotate(173deg) brightness(85%) contrast(92%) !important;
}
body[data-theme="dark"]:not(.gameboy-theme) #freeOpen img.monochrome-ui-icon {filter:brightness(0) invert(1)!important;}
body.gameboy-theme #freeOpen img.monochrome-ui-icon {filter:brightness(0) saturate(100%) invert(57%) sepia(23%) saturate(1402%) hue-rotate(31deg) brightness(102%) contrast(95%)!important;}


/* v37 · Ajustes puntuales solicitados: portada, contrarreloj, iconos y sustituto */
body.menu-landing #introPanel {
  width:min(100%,620px) !important;
  min-height:clamp(560px,78dvh,720px) !important;
  padding:clamp(34px,5dvh,56px) clamp(22px,3vw,34px) clamp(32px,4dvh,44px) !important;
}
body:has(#introPanel:not(.hidden)) .game-shell {
  min-height:calc(100dvh - 30px) !important;
  justify-content:flex-start;
}
body.menu-landing #introPanel .mode-choice {
  background:#111319 !important;
  color:#fff !important;
  border-color:var(--border) !important;
}
body.menu-landing #introPanel .mode-choice:hover,
body.menu-landing #introPanel .mode-choice:focus-visible {
  background:var(--blue) !important;
  color:#fff !important;
}
body.menu-landing #introPanel .mode-choice.is-selected {
  background:#111319 !important;
  color:#fff !important;
}
body.menu-landing #introPanel .mode-description {
  min-height:5.4em;
  margin-top:16px;
}
body.menu-setup.time-attack-active #introPanel .timed-mode-controls {
  width:100%;
  max-width:none;
  grid-template-columns:1fr;
  gap:12px;
  justify-items:stretch;
  margin-top:10px;
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-heading {
  font-size:clamp(18px,2vw,24px);
  letter-spacing:1px;
}
body.menu-setup.time-attack-active #introPanel .timed-rules-note {
  font-size:clamp(13px,1.35vw,16px);
  line-height:1.55;
  text-align:center;
  margin:0 auto 2px;
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-options {
  gap:12px;
  padding:14px 0;
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-option {
  min-height:74px;
  grid-template-columns:34px 28px minmax(0,1fr);
  align-items:center;
  padding:8px 10px;
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-option img {
  width:30px;
  height:30px;
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-option span {
  font-size:clamp(15px,1.5vw,18px);
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-option small {
  font-size:clamp(11px,1.15vw,13px);
  line-height:1.55;
  opacity:1;
}
body.menu-setup.time-attack-active #introPanel .timed-bottom-actions {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  align-items:stretch;
}
body.menu-setup.time-attack-active #introPanel .timed-bottom-actions .pixel-button {
  width:100%;
  min-height:56px;
  margin:0;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}
#freeOpen img.monochrome-ui-icon {
  width:24px;
  height:24px;
}
#gamePanel:not(.hidden) > .game-heading,
#gamePanel:not(.hidden) > #gamePrompt,
#gamePanel:not(.hidden) > .clue-status,
#gamePanel:not(.hidden) > .revealed-pokemon,
#gamePanel:not(.hidden) > .guess-form,
#gamePanel:not(.hidden) > .feedback,
#gamePanel:not(.hidden) > .game-actions,
#gamePanel:not(.hidden) > .failed-attempts {
  max-width:446px !important;
  margin-left:auto !important;
  margin-right:auto !important;
}
#gamePanel:not(.hidden) > .clue-status {
  margin:2px auto 10px !important;
}
#gamePanel:not(.hidden) .guess-form {
  width:min(100%,446px) !important;
}
#gamePanel:not(.hidden) .guess-row {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
}
#gamePanel:not(.hidden) .guess-row .autocomplete-wrap {
  width:100%;
}
#gamePanel:not(.hidden) .guess-row .pixel-button {
  width:min(100%,216px);
}
#gamePanel:not(.hidden) .feedback {
  text-align:center;
}
#gamePanel:not(.hidden) .revealed-pokemon {
  position:relative;
  min-height:190px;
  justify-content:flex-end;
}
#gamePanel:not(.hidden) .revealed-pokemon.is-placeholder::after {
  content:'';
  position:absolute;
  left:50%;
  bottom:18px;
  width:68%;
  height:26px;
  transform:translateX(-50%);
  border-radius:50%;
  background:rgba(6,16,38,.52);
}
#gamePanel:not(.hidden) .revealed-pokemon.is-placeholder img {
  width:132px;
  height:132px;
  position:relative;
  z-index:1;
  animation:substitute-bounce 1.8s ease-in-out infinite;
}
body.no-animations #gamePanel:not(.hidden) .revealed-pokemon.is-placeholder img,
body.no-animations #gamePanel:not(.hidden) .revealed-pokemon.is-placeholder::after {
  animation:none !important;
}
#gamePanel:not(.hidden) .revealed-pokemon.is-placeholder .reveal-message {
  min-height:1em;
}
@keyframes substitute-bounce {
  0%, 100% { transform:translateY(0); }
  50% { transform:translateY(-11px); }
}
#gamePanel:not(.hidden) .game-actions {
  justify-content:center;
}
.theme-switch {
  width:78px !important;
  height:70px !important;
}
.theme-switch img {
  width:70px !important;
  height:64px !important;
}
body:has(#introPanel:not(.hidden)) .footer {
  padding-top:30px !important;
  padding-bottom:8px !important;
}


/* ============================================================
   v38 · Segunda revisión exclusivamente visual del diseño v37.
   Sin cambios en la lógica, búsqueda, paletas ni animaciones.
   ============================================================ */

/* Pantalla de selección: distribución vertical más equilibrada. */
body.menu-landing #introPanel {
  justify-content:flex-start;
  gap:0;
  max-width:620px;
}
body.menu-landing #introPanel > .intro-subtitle { margin-bottom:clamp(16px,2.4dvh,24px) !important; }
body.menu-landing #introPanel > h1 {margin-bottom:clamp(16px,2.7dvh,25px) !important;}
body.menu-landing #introPanel > .intro-copy {margin-bottom:clamp(18px,3.5dvh,30px) !important;}
body.menu-landing #introPanel .mode-picker {
  padding-top:clamp(20px,4dvh,36px);
}
body.menu-landing #introPanel .mode-picker-buttons {
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:stretch;
}
body.menu-landing #introPanel .mode-picker-buttons .mode-choice {
  width:100%;
  height:100%;
  min-width:0;
  text-align:center;
}

/* Contrarreloj: indicación de 10 rondas inmediatamente bajo la pregunta;
   todos los controles quedan en el mismo eje central del recuadro. */
#introPanel > .timed-rules-note {display:none;}
body.menu-setup.time-attack-active #introPanel > .timed-rules-note {
  display:block;
  width:100%;
  font-family:'Silkscreen',monospace;
  font-size:clamp(11px,1.05vw,13px);
  line-height:1.45;
  margin:0 auto clamp(14px,2.8dvh,22px) !important;
  text-align:center;
}
body.menu-setup.time-attack-active #introPanel > .intro-copy {display:none;}
body.menu-setup.time-attack-active #introPanel {
  padding:clamp(20px,3vw,32px) clamp(20px,2.8vw,32px) clamp(22px,3vw,32px) !important;
}
body.menu-setup.time-attack-active #introPanel > .trainer-label,
body.menu-setup.time-attack-active #introPanel > #playerName {
  width:100%;
  max-width:100%;
  text-align:center;
}
body.menu-setup.time-attack-active #introPanel > #playerName {margin-bottom:14px;}
body.menu-setup.time-attack-active #introPanel .timed-mode-controls {
  gap:8px;
  margin-top:8px;
  width:100%;
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-heading {
  width:100%;
  margin:0;
  padding:12px 0 10px;
  border-top:2px dashed var(--border);
  font-size:clamp(15px,1.6vw,20px);
  line-height:1.35;
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-options {
  width:100%;
  padding:12px 0 15px;
  margin:0;
  border-top:0;
  border-bottom:2px dashed var(--border);
  gap:8px;
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-option {
  width:100%;
  box-sizing:border-box;
  min-height:clamp(63px,7.5dvh,74px);
  padding:7px 8px;
  grid-template-columns:24px 36px minmax(0,1fr);
  column-gap:10px;
  row-gap:3px;
  align-items:center;
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-option::before {
  width:18px;
  height:18px;
  align-self:center;
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-option img {
  width:34px;
  height:34px;
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-option span {
  font-size:clamp(13px,1.25vw,16px);
  line-height:1.2;
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-option small {
  width:100%;
  font-size:clamp(10px,.95vw,12px);
  line-height:1.5;
}
body.menu-setup.time-attack-active #introPanel .timed-bottom-actions {
  width:100%;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:stretch;
  margin-top:5px;
  gap:10px;
}
body.menu-setup.time-attack-active #introPanel .timed-bottom-actions > button {
  width:100%;
  min-height:53px;
  padding:9px;
  line-height:1.25;
  text-align:center;
}

/* Juego: misma línea central para pista, Sustituto, respuesta y acciones.
   Respetar el grid del modo juego y la columna de paleta a la derecha. */
#gamePanel:not(.hidden) > .clue-status,
#gamePanel:not(.hidden) > .revealed-pokemon,
#gamePanel:not(.hidden) > .guess-form,
#gamePanel:not(.hidden) > .feedback,
#gamePanel:not(.hidden) > .game-actions,
#gamePanel:not(.hidden) > .failed-attempts {
  box-sizing:border-box;
  width:min(100%,446px) !important;
  max-width:446px !important;
  justify-self:center !important;
  margin-left:auto !important;
  margin-right:auto !important;
  text-align:center;
}
#gamePanel:not(.hidden) .guess-form .field-label {
  width:100%;
  text-align:center !important;
}
#gamePanel:not(.hidden) .guess-row,
#gamePanel:not(.hidden) .guess-row .autocomplete-wrap,
#gamePanel:not(.hidden) #guessInput {
  box-sizing:border-box;
  width:100%;
  min-width:0;
}
#gamePanel:not(.hidden) .guess-row {
  align-items:stretch;
}
#gamePanel:not(.hidden) .guess-form #guessButton {
  align-self:center;
  justify-self:center;
  margin-inline:auto !important;
}
#gamePanel:not(.hidden) .revealed-pokemon.is-placeholder {
  width:min(100%,446px) !important;
  min-height:clamp(160px,21dvh,192px);
  padding-bottom:18px;
  display:flex;
  align-items:center;
  justify-content:flex-end;
}
#gamePanel:not(.hidden) .revealed-pokemon.is-placeholder img {
  flex:none;
  width:clamp(112px,14dvh,145px);
  height:clamp(112px,14dvh,145px);
  object-fit:contain;
  image-rendering:pixelated;
}
#gamePanel:not(.hidden) .revealed-pokemon.is-placeholder::after {
  width:min(74%,280px);
  height:24px;
  bottom:20px;
}
#gamePanel:not(.hidden) > .game-actions {
  display:flex;
  justify-content:center;
  align-items:center;
}
#gamePanel:not(.hidden) .game-actions > button {margin-inline:auto;}

/* El reinicio queda centrado con respecto a la misma columna izquierda,
   no con respecto al ancho total de la pantalla. */
@media (min-width:900px) {
  body.in-game-screen .outside-restart:not(.hidden) {
    width:min(100%,548px) !important;
    max-width:548px !important;
    margin:8px 0 12px !important;
    align-self:flex-start;
    justify-content:center;
  }
}

/* Ventanas bajas / móvil: evitar que texto largo en contrarreloj
   rompa la fila y permitir lectura sin cortar iconos ni descripciones. */
@media (max-width:680px) {
  body.menu-setup.time-attack-active #introPanel .timed-difficulty-option {
    grid-template-columns:22px 32px minmax(0,1fr);
    column-gap:8px;
  }
  body.menu-setup.time-attack-active #introPanel .timed-bottom-actions {gap:9px;}
  body.menu-setup.time-attack-active #introPanel .timed-bottom-actions > button {
    font-size:clamp(10px,2.5vw,13px);
    min-height:50px;
  }
}
@media (max-height:740px) and (min-width:900px) {
  #gamePanel:not(.hidden) .revealed-pokemon.is-placeholder {min-height:155px;}
  #gamePanel:not(.hidden) .revealed-pokemon.is-placeholder img {width:112px;height:112px;}
}

/* v38 · Precedencia explícita frente al ancho de componentes de v16-v18. */
#gamePanel#gamePanel:not(.hidden) > .guess-form,
#gamePanel#gamePanel:not(.hidden) > .clue-status,
#gamePanel#gamePanel:not(.hidden) > .feedback,
#gamePanel#gamePanel:not(.hidden) > .game-actions,
#gamePanel#gamePanel:not(.hidden) > .failed-attempts {
  width:min(100%,446px) !important;
  max-width:446px !important;
  justify-self:center !important;
  margin-left:auto !important;
  margin-right:auto !important;
}
@media (min-width:900px) {
  .game-shell > #gamePanel:not(.hidden) {
    min-height:clamp(620px,72dvh,695px) !important;
  }
  #gamePanel:not(.hidden) > .revealed-pokemon.is-placeholder {
    min-height:155px;
    max-height:196px;
    align-self:center;
  }
}
@media (min-width:900px) and (max-height:960px) {
  #gamePanel:not(.hidden):has(> .revealed-pokemon.is-placeholder) {
    grid-template-rows:auto auto auto minmax(150px,178px) auto auto auto !important;
    row-gap:4px !important;
  }
}


/* v39 — retoques del menú y accesibilidad de modales (sin cambios de lógica) */
/* Portada: acercar la introducción a la línea separadora del selector. */
body.menu-landing #introPanel > .intro-copy {
  margin-bottom:clamp(8px,1.4dvh,16px) !important;
}
body.menu-landing #introPanel .mode-picker {
  margin-top:clamp(8px,1.4dvh,15px) !important;
  padding-top:clamp(10px,2dvh,22px) !important;
}
/* Las herramientas son cuatro cuadrados iguales, con iconografía centrada. */
.game-shell:has(#introPanel:not(.hidden)) > .intro-tools {
  display:flex !important;
  justify-content:center !important;
  align-items:center !important;
  gap:clamp(9px,1.2vw,15px) !important;
  width:min(100%,560px);
}
.intro-tools .tool-button {
  box-sizing:border-box;
  display:flex !important;
  align-items:center;
  justify-content:center;
  flex:0 0 43px;
  width:43px !important;
  height:43px !important;
  padding:6px !important;
  line-height:1;
}
.intro-tools .tool-button img {
  display:block;
  width:27px !important;
  height:27px !important;
  margin:0 !important;
  position:static !important;
  object-fit:contain;
  flex-shrink:0;
}
/* Entradas de modal: icono pequeño en el mismo tono del subtítulo. */
.modal-eyebrow { display:flex;align-items:center;gap:9px;line-height:1.25; }
.modal-eyebrow-icon {display:inline-block;width:18px;height:18px;object-fit:contain;flex-shrink:0;}
.modal-eyebrow-icon.monochrome-ui-icon {
  filter:brightness(0) saturate(100%) invert(70%) sepia(16%) saturate(470%) hue-rotate(173deg) brightness(91%);
}
body:not([data-theme="dark"]):not(.gameboy-theme) .modal-eyebrow-icon.monochrome-ui-icon {
  filter:brightness(0) saturate(100%) invert(32%) sepia(17%) saturate(950%) hue-rotate(172deg);
}
body.gameboy-theme .modal-eyebrow-icon.monochrome-ui-icon {
  filter:brightness(0) saturate(100%) invert(61%) sepia(44%) saturate(695%) hue-rotate(26deg);
}
.help-symbol {display:inline-flex;align-items:center;justify-content:center;font-family:'Silkscreen',monospace;font-weight:bold;color:inherit;}
.modal-heading-with-icon {display:flex;align-items:center;gap:10px;}
/* Modo libre: un poco más de espacio y lista de dos filas completas. */
#freeModal .modal-card {width:min(95vw,820px) !important;max-height:min(94dvh,900px) !important;}
#freeModal .free-pokedex-list {
  max-height:none !important;
  height:clamp(144px,23dvh,190px) !important;
  min-height:144px !important;
  align-content:start;
  overflow-y:auto;
  grid-auto-rows:minmax(68px,auto);
}
#freeModal .free-pokemon-item {min-height:68px;}
#freeModal .free-filters select,
#freeModal .free-filters select option {
  font-family:'Silkscreen',monospace !important;
  font-size:12px !important;
}
/* Modos con amuleto y pokéball: sombra sobre el icono, no el contenedor. */
#shinyCharm, #masterBallCharm,
.timed-difficulty-option img,
.timed-bottom-actions .leaderboard-launch img {
  filter:drop-shadow(2px 3px 1px rgba(0,0,0,.48));
}
/* Contrarreloj, siguiendo mockup: división bajo el título y botones 50/50. */
body.menu-setup.time-attack-active #introPanel .timed-difficulty-heading {
  border-top:2px dashed var(--border) !important;
  border-bottom:2px dashed var(--border) !important;
  padding:14px 0 !important;
}
body.menu-setup.time-attack-active #introPanel .timed-difficulty-options {
  border-top:0 !important;
  border-bottom:2px dashed var(--border) !important;
  padding-top:12px !important;
  padding-bottom:18px !important;
}
body.menu-setup.time-attack-active #introPanel .timed-bottom-actions {
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  align-items:stretch !important;
  gap:10px !important;
}
body.menu-setup.time-attack-active #introPanel .timed-bottom-actions > button {
  display:flex !important;align-items:center !important;justify-content:center !important;
  min-width:0 !important;min-height:55px !important;margin:0 !important;
  padding:8px 12px !important;gap:9px;
}
.timed-bottom-actions .leaderboard-launch img {width:32px;height:32px;object-fit:contain;image-rendering:pixelated;flex-shrink:0;}
/* Casual: iniciar a la derecha de Contrarreloj, dentro del panel amarillo/azul. */
body.menu-setup:not(.time-attack-active) #introPanel .casual-bottom-actions {
  display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  align-items:stretch;gap:10px;width:100%;margin:16px auto 0 !important;
}
body.menu-setup:not(.time-attack-active) #introPanel .casual-bottom-actions button {
  width:100%;min-width:0;min-height:52px;margin:0 !important;padding:9px 10px;
  display:flex;align-items:center;justify-content:center;
}
body.menu-landing #casualStartButton,
body.menu-setup.time-attack-active #casualStartButton {display:none !important;}
body.menu-setup:not(.time-attack-active) > .game-shell > .intro-start-area {display:none !important;}
/* Mantener el fade y ciclo del botón original, también en su acceso casual. */
#casualStartButton {position:relative;isolation:isolate;background:var(--accent)!important;overflow:hidden;}
#casualStartButton::before {
  content:"";position:absolute;inset:0;z-index:-1;opacity:0;pointer-events:none;
  background:linear-gradient(90deg,#dc52c0,#23a0dc,#e59a3d,#dc52c0);
  background-size:200% 100%;transition:opacity .36s ease;
  animation:rainbow-scroll 8s linear infinite;
}
#casualStartButton:hover::before,#casualStartButton:focus-visible::before {opacity:1;}
body.no-animations #casualStartButton::before {animation:none !important;}
body.gameboy-theme #casualStartButton::before {
  background:linear-gradient(90deg,#0F380F,#306230,#8BAC0F,#9BBC0F,#0F380F);background-size:200% 100%;
}
/* Pistas adicionales: tipografía pixelada legible. */
#gamePanel .extra-clues .generation-clue,
#gamePanel #generationClue,
#gamePanel #megaClue,
#gamePanel #shinyClue,
#gamePanel #typeClue {font-family:'Silkscreen',monospace !important;font-size:clamp(12px,1.15vw,17px) !important;line-height:1.55 !important;}
/* Sustituto: la animación ahora se controla por Web Animations API. */
#gamePanel:not(.hidden) .revealed-pokemon.is-placeholder img {animation:none !important;}

.trophy-heading-icon {width:22px;height:22px;image-rendering:pixelated;}


/* ============================================================
   v40 · Refinamiento solicitado. Conserva la lógica y gráficos de v39.
   ============================================================ */
:root{
  --pp-rainbow-duration:8s;
  --pp-rainbow-gradient:linear-gradient(90deg,#dc52c0,#23a0dc,#e59a3d,#dc52c0);
}
/* Un solo degradado y una misma duración para los botones con arcoíris. */
body:not(.gameboy-theme) #casualStartButton::before,
body:not(.gameboy-theme) #startButton::before,
body:not(.gameboy-theme) #replayButton::before{
  background-image:var(--pp-rainbow-gradient)!important;
  background-size:200% 100%!important;
  animation:rainbow-scroll var(--pp-rainbow-duration) linear infinite!important;
}
#casualStartButton{animation:none!important;position:relative;isolation:isolate;overflow:hidden;}
#casualStartButton::before{z-index:0!important;pointer-events:none;transition:opacity .36s ease!important;}
#casualStartButton > span{position:relative;z-index:1;}
#casualStartButton:hover,#casualStartButton:focus-visible{animation:none!important;background:var(--accent)!important;}
body.no-animations #casualStartButton::before,
body.no-animations #startButton::before,
body.no-animations #replayButton::before{animation:none!important;}
body.gameboy-theme #casualStartButton::before,
body.gameboy-theme #startButton::before,
body.gameboy-theme #replayButton::before{background-image:linear-gradient(90deg,#0F380F,#306230,#8BAC0F,#9BBC0F,#0F380F)!important;}
/* El área del selector queda agrupada verticalmente, sin vacíos exagerados. */
body.menu-landing #introPanel{padding-block:clamp(26px,4dvh,44px)!important;}
body.menu-landing #introPanel>.intro-subtitle{margin-bottom:clamp(12px,2.1dvh,19px)!important;}
body.menu-landing #introPanel>h1{margin-bottom:clamp(12px,2dvh,20px)!important;}
body.menu-landing #introPanel>.intro-copy{margin-bottom:clamp(16px,3dvh,25px)!important;}
body.menu-landing #introPanel .mode-picker{margin:clamp(12px,2.2dvh,25px) 0 0!important;padding-top:clamp(15px,2.6dvh,27px)!important;}
body.menu-landing #introPanel .mode-picker-prompt{margin-bottom:clamp(10px,1.8dvh,18px)!important;}
body.menu-landing #introPanel .mode-description{margin-top:clamp(9px,1.5dvh,16px)!important;min-height:3.5em;}
/* Iconos: Unown utiliza el SVG blanco en oscuro y el original en claro. */
#helpOpen .unown-help-icon,.modal-eyebrow .unown-help-icon{content:url('assets/graphics/ui/unown_guide_negative.svg');filter:none!important;}
body:not([data-theme='dark']):not(.gameboy-theme) #helpOpen .unown-help-icon,
body:not([data-theme='dark']):not(.gameboy-theme) .modal-eyebrow .unown-help-icon{
  content:url('assets/graphics/ui/unown_guide.svg');filter:none!important;
}
body.gameboy-theme #helpOpen .unown-help-icon,
body.gameboy-theme .modal-eyebrow .unown-help-icon{filter:url(#ppDmgFilter)!important;}
/* El encabezado de Opciones usa el Klink real, sin desaparecer por el filtro de color. */
#settingsEyebrow .modal-eyebrow-icon,
#gameSettingsEyebrow .modal-eyebrow-icon{width:20px;height:20px;min-width:20px;display:block;visibility:visible;opacity:1;}
.trophy-heading-icon{width:51px!important;height:51px!important;min-width:51px;image-rendering:pixelated;}
.leaderboard-tabs button{display:flex;align-items:center;justify-content:center;gap:7px;}
.leaderboard-tabs button img{display:block;width:24px;height:24px;flex:none;object-fit:contain;image-rendering:pixelated;}
.leaderboard-tabs button span{font-family:'Silkscreen',monospace;}
/* Iconos seleccionables contrarreloj: animaciones WAAPI (no keyframes CSS). */
.timed-difficulty-option img{animation:none!important;transform-origin:center bottom;}
/* Ajustes de casillas y tooltips. */
body.menu-setup:not(.time-attack-active) #introPanel .region-toggle-controls{
  width:clamp(190px,68%,310px)!important;max-width:100%!important;margin-inline:auto!important;
  grid-column:1/-1!important;
}
body.menu-setup:not(.time-attack-active) #introPanel .region-toggle-all{
  font-size:clamp(11px,1.25vw,14px)!important;letter-spacing:.1px;
}
.generation-choice .generation-tooltip{font-family:'Silkscreen',monospace!important;font-size:clamp(12px,1.2vw,14px)!important;line-height:1.65!important;}
.generation-tooltip .dex-numbers{display:block;font-family:'Silkscreen',monospace;font-size:1.2em!important;font-weight:bold;line-height:1.6;}
/* Tema: mayor sprite sin tocar la animación de cambio. */
.theme-switch img#themeSprite{width:74px!important;height:68px!important;max-width:100%;object-fit:contain;filter:drop-shadow(3px 5px 3px rgba(0,0,0,.40));}
body.gameboy-theme .theme-switch img#themeSprite{filter:url(#ppDmgFilter)!important;}
/* Sustituto y Pokémon revelados: una única elipse animada con cada sprite. */
#gamePanel:not(.hidden) .revealed-pokemon::after{display:none!important;}
#gamePanel:not(.hidden) .revealed-pokemon{
  position:relative;display:flex;flex-direction:column;align-items:center;
  justify-content:flex-end;padding-bottom:clamp(10px,1.6dvh,18px)!important;
}
#gamePanel:not(.hidden) .revealed-pokemon .reveal-floor{
  display:block;position:absolute;z-index:0;
  left:50%;bottom:clamp(7px,1.1dvh,13px);
  width:min(69%,275px);height:clamp(17px,2.6dvh,25px);
  border-radius:50%;background:rgba(7,16,35,.68);
  transform:translateX(-50%);transform-origin:center center;pointer-events:none;
}
#gamePanel:not(.hidden) .revealed-pokemon img{
  z-index:1;position:relative;object-fit:contain;image-rendering:pixelated;
  transform-origin:center bottom;
}
#gamePanel:not(.hidden) .revealed-pokemon.is-placeholder img{
  width:clamp(110px,14dvh,145px);height:clamp(110px,14dvh,145px);
  margin-bottom:0!important;animation:none!important;
}
#gamePanel:not(.hidden) .revealed-pokemon:not(.is-placeholder) img{animation-duration:.5s;}
body.no-animations .reveal-floor,body.no-animations .guide-floor,body.no-animations .result-floor{animation:none!important;}
/* Guía: paleta detrás y sombra bajo el Pokémon. */
.guide-illustration{position:relative;overflow:hidden;}
.guide-illustration .guide-floor{
  position:absolute;left:50%;bottom:17px;z-index:1;
  width:125px;height:19px;border-radius:50%;background:rgba(8,20,37,.58);
  transform:translateX(-50%);pointer-events:none;
}
.guide-illustration > img.guide-silhouette,
.guide-illustration > img.guide-bulbasaur{
  position:absolute;left:50%;bottom:25px;margin-left:-55px;
  width:110px;height:110px;z-index:2;
  animation:none!important;image-rendering:pixelated;transform-origin:center bottom;
}
.guide-illustration .guide-palette{z-index:0;}
/* Resultados: centrar y animar la sombra de los ganadores sin tocar los perdidos. */
.result-creature .result-floor{
  left:50%!important;transform:translateX(-50%);transform-origin:center center;
}
.result-creature.won img{animation:none!important;}
.result-creature.won .result-floor{will-change:transform,opacity;}
@media(max-width:620px){
  .trophy-heading-icon{width:42px!important;height:42px!important;min-width:42px;}
  .leaderboard-tabs button{gap:3px;font-size:10px;padding:7px 4px;}
  .leaderboard-tabs button img{width:20px;height:20px;}
  body.menu-landing #introPanel{min-height:clamp(480px,68dvh,625px)!important;}
}

/* v40 · última compactación de la portada según el mockup, sin mover paneles de otros modos. */
@media(min-width:680px){
  body.menu-landing #introPanel{min-height:clamp(505px,70dvh,650px)!important;}
  body.menu-landing #introPanel .mode-picker{margin-top:clamp(18px,3dvh,32px)!important;}
}


/* v41 · iconos actualizados para herramientas y menú de otras opciones */
.special-options-open .special-open-icon,
#specialOptionsTitle .special-modal-icon,
.special-option-icon,
.timed-difficulty-option img,
#freeOpen .monochrome-ui-icon,
#shinyCharm {
  filter: drop-shadow(0 3px 0 rgba(0,0,0,.28));
}
.special-options-open .special-open-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  image-rendering: auto;
}
#specialOptionsTitle .special-modal-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.special-switch {
  display: flex;
  align-items: center;
  gap: 10px;
}
.special-option-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: auto;
  flex: 0 0 auto;
}
.wooper-option-icon {
  width: 39px;
  height: 39px;
}
.pokestop-option-icon {
  width: 31px;
  height: 31px;
}
.mega-option-icon {
  width: 32px;
  height: 32px;
}
body.no-animations .special-option-icon,
body.no-animations .special-options-open .special-open-icon,
body.no-animations #specialOptionsTitle .special-modal-icon {
  animation: none !important;
}


/* v42 · visibilidad de iconos de encabezado en modales */
#helpEyebrow, #settingsEyebrow {
  display:flex;
  align-items:center;
  gap:10px;
}
#helpEyebrow .modal-eyebrow-icon,
#settingsEyebrow .modal-eyebrow-icon {
  width:22px;
  height:22px;
  min-width:22px;
  display:block;
  visibility:visible;
  opacity:1;
}
#helpEyebrow .unown-help-icon {
  filter:none !important;
}

/* v42 · ajuste vertical guía / sustituto */
.guide-illustration .guide-floor{
  bottom:14px;
}
.guide-illustration > img.guide-silhouette,
.guide-illustration > img.guide-bulbasaur{
  bottom:14px;
}
#gamePanel:not(.hidden) .revealed-pokemon .reveal-floor{
  bottom:clamp(6px,1dvh,10px);
}
#gamePanel:not(.hidden) .revealed-pokemon.is-placeholder img{
  margin-bottom:-8px !important;
}

.pantone-card.pantone-spawning{
  opacity:0;
  transform:scale(.15);
  pointer-events:none;
}


/* v43 · correcciones finas de layout e iconografía */
body.menu-landing #introPanel .mode-picker{display:flex;flex-direction:column;align-items:center;width:100%;}
body.menu-landing #introPanel .mode-picker-buttons{width:min(100%,500px);margin-inline:auto;justify-content:center;}
body.menu-landing #introPanel .mode-choice{justify-self:center;}
body.menu-landing #introPanel .mode-choice:hover,
body.menu-landing #introPanel .mode-choice:focus-visible,
body.menu-landing #introPanel .mode-choice.is-selected:hover,
body.menu-landing #introPanel .mode-choice.is-selected:focus-visible{
  background:var(--blue)!important;
  color:#fff!important;
}

#helpEyebrow,#settingsEyebrow,#gameSettingsEyebrow{display:flex;align-items:center;gap:10px;}
#helpEyebrow .modal-eyebrow-icon,#settingsEyebrow .modal-eyebrow-icon,#gameSettingsEyebrow .modal-eyebrow-icon{
  width:22px;height:22px;min-width:22px;display:inline-block!important;visibility:visible!important;opacity:1!important;
}
#settingsEyebrow span,#helpEyebrow span,#gameSettingsEyebrow span{display:inline-block;}

.wooper-option-icon{width:44px;height:44px;}
.pokestop-option-icon{width:34px;height:34px;}
.mega-option-icon{width:33px;height:33px;}

.pantone-card.pantone-spawning{opacity:0!important;visibility:hidden!important;transform:scale(.15)!important;pointer-events:none;}

.guide-illustration .guide-floor{bottom:10px!important;}
.guide-illustration > img.guide-silhouette,
.guide-illustration > img.guide-bulbasaur{bottom:8px!important;}

#gamePanel:not(.hidden) .revealed-pokemon .reveal-floor{z-index:0;}
#gamePanel:not(.hidden) .revealed-pokemon .reveal-message{position:relative;z-index:2;}
#gamePanel:not(.hidden) .revealed-pokemon.is-placeholder .reveal-floor{bottom:2px!important;}
#gamePanel:not(.hidden) .revealed-pokemon.is-placeholder img{margin-bottom:-14px!important;}
#gamePanel:not(.hidden) .revealed-pokemon:not(.is-placeholder){padding-bottom:clamp(6px,1dvh,12px)!important;}
#gamePanel:not(.hidden) .revealed-pokemon:not(.is-placeholder) .reveal-floor{bottom:clamp(44px,5.5dvh,64px)!important;}
#gamePanel:not(.hidden) .revealed-pokemon:not(.is-placeholder) img{margin-bottom:24px;}


/* v44 · Modo daltónico / ayuda HSL */
.color-inspectable{position:relative;cursor:help;}
.color-assist-tooltip{position:fixed;z-index:1600;width:min(260px,calc(100vw - 20px));padding:12px 12px 10px;border:3px solid var(--border);background:#0b1220;color:#fff;box-shadow:6px 6px 0 rgba(0,0,0,.28);pointer-events:none;}
.color-assist-tooltip::after{content:"";position:absolute;left:calc(50% - 8px);top:100%;border:8px solid transparent;border-top-color:#0b1220;}
.color-assist-preview{width:100%;height:54px;border:2px solid rgba(255,255,255,.18);margin-bottom:8px;}
.color-assist-hex{margin:0 0 10px;text-align:center;font-family:'Silkscreen',monospace;font-size:12px;line-height:1.2;color:#f6f7fb;}
.color-assist-sliders{display:grid;gap:6px;}
.color-assist-row{display:grid;grid-template-columns:16px 1fr 34px;align-items:center;gap:8px;}
.color-assist-label,.color-assist-value{font-family:'Silkscreen',monospace;font-size:11px;line-height:1;color:#fff;}
.color-assist-value{text-align:right;color:#d8deed;}
.color-assist-range{appearance:none;-webkit-appearance:none;width:100%;height:10px;border-radius:999px;background:#7b8395;outline:none;opacity:1;}
.color-assist-range::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:12px;height:12px;border-radius:50%;background:#fff;border:2px solid #0b1220;box-shadow:0 0 0 2px rgba(255,255,255,.16);}
.color-assist-range::-moz-range-thumb{width:12px;height:12px;border-radius:50%;background:#fff;border:2px solid #0b1220;box-shadow:0 0 0 2px rgba(255,255,255,.16);}
.color-assist-range::-webkit-slider-runnable-track{height:10px;border-radius:999px;}
.color-assist-range::-moz-range-track{height:10px;border-radius:999px;background:#7b8395;}
.color-assist-range.hue{background:linear-gradient(90deg,#ff3b3b 0%,#ffd23f 17%,#76d74b 33%,#23c8b1 50%,#3384ff 67%,#8a4dff 83%,#ff3bbd 100%);}
.color-assist-range.sat{background:linear-gradient(90deg,#b7b7b7 0%,#ea5de0 100%);}
.color-assist-range.light{background:linear-gradient(90deg,#232327 0%,#f0f2f7 100%);}
.color-assist-name{margin:10px 0 0;text-align:center;font-family:'Silkscreen',monospace;font-size:15px;line-height:1.2;color:#ffda3a;}
body.gameboy-theme .color-assist-tooltip{background:#0F380F;border-color:#9BBC0F;color:#9BBC0F;}
body.gameboy-theme .color-assist-tooltip::after{border-top-color:#0F380F;}
body.gameboy-theme .color-assist-name{color:#9BBC0F;}
body.colorblind-mode .palette-swatch,
body.colorblind-mode .guide-palette span{outline:2px solid rgba(255,255,255,.12);outline-offset:-2px;}

/* v45 · inspector HSL: capa de primer plano fuera de contenedores con overflow */
body > #colorAssistTooltip {
  position:fixed;
  z-index:2147483000;
  pointer-events:none;
  opacity:1;
  visibility:visible;
}
body > #colorAssistTooltip.hidden { display:none !important; }
body > #colorAssistTooltip.below::after { display:none; }
body > #colorAssistTooltip.below::before {
  content:"";
  position:absolute;
  left:calc(50% - 8px);
  bottom:100%;
  border:8px solid transparent;
  border-bottom-color:#0b1220;
}

/* v47 · Inspector daltónico con dos ruedas (assets proporcionados) */
.color-vision-options{border:1px solid var(--border);margin:12px 0;padding:10px 12px;display:grid;gap:8px;min-width:0;}
.color-vision-options legend{padding:0 6px;font-family:'Silkscreen',monospace;font-size:12px;color:var(--ink);}
.color-vision-options .performance-toggle{margin:0;}
body > #colorAssistTooltip.color-vision-popup{width:min(560px,calc(100vw - 16px));max-height:calc(100dvh - 16px);overflow:auto;overscroll-behavior:contain;padding:16px 16px 14px;background:#0e1423;color:#f7f7ff;border:2px solid #a4b4d5;box-shadow:6px 7px 0 rgba(0,0,0,.35);pointer-events:none;}
.color-vision-title{display:flex;align-items:baseline;justify-content:center;gap:12px;flex-wrap:wrap;min-height:32px;}
.color-vision-title .color-assist-name{margin:0;font:700 clamp(20px,3vw,28px)/1.3 'Silkscreen',monospace;text-shadow:1px 2px 0 #000, -1px -1px 0 #000;}
.color-vision-title .color-assist-hex{margin:0;font:700 12px 'Silkscreen',monospace;color:#e6e7ef;}
.color-wheel-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:12px auto 2px;align-items:start;}
.color-wheel-panel{min-width:0;text-align:center;}
.color-wheel-panel small{display:block;font:700 10px/1.4 'Silkscreen',monospace;margin-top:7px;color:#eff3fc;}
.color-wheel-frame{width:100%;max-width:240px;aspect-ratio:1;position:relative;margin:0 auto;}
.color-wheel-image{width:100%;height:100%;object-fit:contain;display:block;image-rendering:auto;}
.color-wheel-pointer{position:absolute;inset:0;transform-origin:center;pointer-events:none;}
.color-wheel-pointer span{position:absolute;top:17%;left:50%;transform:translateX(-50%);width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:14px solid #fff;filter:drop-shadow(0px 1px 1px #000) drop-shadow(0px -1px 1px #000);}
.color-vision-equivalent{font:700 11px/1.4 'Silkscreen',monospace;text-align:center;margin:10px 0 13px;color:#f7f7ff;}
.color-vision-sliders{display:grid;gap:11px;}
.color-vision-slider{display:grid;grid-template-columns:130px minmax(0,1fr) 55px;gap:10px;align-items:center;font:700 11px/1.2 'Silkscreen',monospace;}
.color-vision-slider output{text-align:right;font-variant-numeric:tabular-nums;color:#f7f7ff;}
.color-vision-slider .color-assist-range:disabled{opacity:1;cursor:default;}
body.gameboy-theme .color-vision-popup .color-wheel-image{filter:none!important;}
@media (max-width:480px){
 .color-wheel-pair{gap:7px;margin:8px auto 0;}
 .color-vision-slider{grid-template-columns:84px minmax(0,1fr) 48px;gap:6px;font-size:9px;}
 body > #colorAssistTooltip.color-vision-popup{padding:10px;}
 .color-wheel-pointer span{border-left-width:5px;border-right-width:5px;border-top-width:9px;}
}


/* v48 · Ruedas daltónicas originales con indicadores por tono. */
body > #colorAssistTooltip.color-vision-popup {
  width:min(650px,calc(100vw - 20px));padding:15px 16px 17px;
  background:#0e1320;border:2px solid #9eadc8;border-radius:0;
  box-shadow:7px 8px 0 rgba(0,0,0,.32);
}
body > #colorAssistTooltip.color-vision-popup::after{border-top-color:#0e1320;}
body > #colorAssistTooltip.color-vision-popup.below::before{border-bottom-color:#0e1320;}
.color-vision-title{min-height:38px;gap:10px;margin-bottom:8px;}
.color-vision-title .color-assist-name {
 font-size:clamp(17px,2.4vw,26px);line-height:1.3;
 max-width:100%;overflow-wrap:anywhere;text-align:center;
 text-shadow:1px 1px #080c15,-1px -1px #080c15,1px -1px #080c15,-1px 1px #080c15;
}
.color-vision-title .color-assist-name.color-vision-dark-name{filter:brightness(1.7);}
.color-vision-title .color-assist-hex{font-size:11px;color:#b7c5d9;}
.color-wheel-pair{gap:12px;margin:0 auto 4px;}
.color-wheel-frame{max-width:270px;}
.color-wheel-panel small{font-size:10px;margin-top:5px;}
.color-wheel-pointer span {top:15%;border-left:9px solid transparent;border-right:9px solid transparent;border-top:16px solid #fff;filter:drop-shadow(0 0 1px #081224) drop-shadow(0 0 1px #081224);}
.color-vision-equivalent{margin:6px 0 12px;}
.color-vision-slider{font-size:11px;}
@media(max-width:520px){
 body > #colorAssistTooltip.color-vision-popup{padding:9px 9px 12px;}
 .color-wheel-pair{gap:7px;}
 .color-wheel-panel small{font-size:8px;}
 .color-wheel-pointer span{border-left-width:6px;border-right-width:6px;border-top-width:11px;}
 .color-vision-title .color-assist-name{font-size:clamp(13px,4vw,19px);}
}


/* v49 · Inspector daltónico de DOS ruedas (reemplaza visualmente v44/v46) */
body > #colorAssistTooltip.color-vision-popup{
  width:min(650px,calc(100vw - 20px)) !important;
  min-width:min(410px,calc(100vw - 20px));
  padding:14px !important;
  max-height:calc(100dvh - 16px);
  overflow-y:auto;
  background:#0e1320;
}
body > #colorAssistTooltip.color-vision-popup .color-wheel-pair{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
  gap:12px !important;
  width:100% !important;
  margin:8px 0 4px !important;
  visibility:visible !important;
  opacity:1 !important;
}
body > #colorAssistTooltip.color-vision-popup .color-wheel-panel,
body > #colorAssistTooltip.color-vision-popup .color-wheel-frame{
  display:block !important;
  min-width:0 !important;
  width:100% !important;
  visibility:visible !important;
  opacity:1 !important;
}
body > #colorAssistTooltip.color-vision-popup .color-wheel-frame{aspect-ratio:1;position:relative;max-width:270px !important;}
body > #colorAssistTooltip.color-vision-popup .color-wheel-image{
  display:block !important;
  width:100% !important;
  height:100% !important;
  object-fit:contain !important;
  visibility:visible !important;
  opacity:1 !important;
}
body > #colorAssistTooltip.color-vision-popup .color-vision-sliders{
  display:grid !important;
  gap:11px !important;
  width:100%;
}
body > #colorAssistTooltip.color-vision-popup .color-vision-slider .color-assist-range{
  display:block !important;
  appearance:none !important;
  -webkit-appearance:none !important;
  width:100% !important;
  height:15px !important;
  border-radius:999px !important;
  border:1px solid rgba(255,255,255,.18);
  background:var(--assist-gradient,linear-gradient(90deg,#ffd800,#fff)) !important;
  opacity:1 !important;
  accent-color:#fff;
}
body > #colorAssistTooltip.color-vision-popup .color-vision-slider .color-assist-range::-webkit-slider-runnable-track{
  background:transparent !important;
  height:15px !important;
}
body > #colorAssistTooltip.color-vision-popup .color-vision-slider .color-assist-range::-moz-range-track{
  background:transparent !important;
  height:15px !important;
}
body > #colorAssistTooltip.color-vision-popup .color-vision-slider .color-assist-range::-webkit-slider-thumb{
  appearance:none !important;
  width:16px !important;height:21px !important;
  margin-top:-3px;
  border:3px solid #fff !important;
  border-radius:5px;
  background:#637492 !important;
  box-shadow:1px 2px 0 #060c18;
}
body > #colorAssistTooltip.color-vision-popup .color-vision-slider .color-assist-range::-moz-range-thumb{
  width:13px !important;height:18px !important;
  border:3px solid #fff !important;
  border-radius:5px;
  background:#637492 !important;
}
@media(max-width:520px){
  body > #colorAssistTooltip.color-vision-popup{padding:9px !important;}
  body > #colorAssistTooltip.color-vision-popup .color-wheel-pair{gap:6px !important;}
  body > #colorAssistTooltip.color-vision-popup .color-vision-slider{grid-template-columns:78px minmax(0,1fr) 40px;gap:5px;font-size:9px;}
}

/* v50 · diagnóstico de versión en Opciones */
.build-indicator{font:700 10px/1.6 'Silkscreen',monospace;color:var(--muted);margin:9px 0 0;text-align:center;}
.build-indicator.build-error{color:#ff6b6b;background:rgba(100,0,0,.2);padding:6px;}
.color-vision-options{border:1px solid var(--border);padding:12px;}

/* v52 · icono regional (Wooper) un 50 % mayor que en la v51. */
#specialOptionsModal .wooper-option-icon { width:66px; height:66px; flex:0 0 66px; object-fit:contain; }
#specialOptionsModal .special-switch { min-height:66px; }


/* v53 · las tarjetas repuestas orbitan de inmediato; el pop-in afecta
   exclusivamente a la capa interior y no bloquea la órbita exterior. */
body:not(.no-animations) .pantone-card.pantone-respawn {
  animation: pantone-orbit-v19 var(--float-duration,8s) ease-in-out infinite var(--float-delay,0s) !important;
  opacity: 1 !important;
}
.pantone-card.pantone-respawn.pantone-mini { opacity: .78 !important; }
.pantone-card.pantone-respawn:not(.pantone-respawn-ready) { pointer-events:none; }

/* Pokémon GO: +30% y tonalidad morada si se activa la opción. */
#specialOptionsModal .pokestop-option-icon {
  width:44px;
  height:44px;
  flex:0 0 44px;
  object-fit:contain;
  transition:filter .2s ease;
}
#specialOptionsModal #homePokemon:checked ~ .pokestop-option-icon {
  filter:hue-rotate(92deg) saturate(1.6) drop-shadow(0 3px 0 rgba(0,0,0,.28));
}


/* v54 · modo Game Boy exclusivo, secreto en el rincón inferior derecho de Opciones */
#debugModal .debug-card{position:relative;padding-bottom:72px!important;}
#gameboyModeButton{
  position:absolute;bottom:15px;right:17px;
  display:grid;place-items:center;
  width:44px;height:44px;padding:4px;
  border:2px solid transparent;border-radius:6px;
  background:transparent;cursor:pointer;
  opacity:.75;transition:opacity .15s,transform .15s,background-color .15s;
  z-index:2;
}
#gameboyModeButton img{width:32px;height:32px;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(2px 3px 1px rgba(0,0,0,.4));}
#gameboyModeButton:hover,#gameboyModeButton:focus-visible{opacity:1;transform:scale(1.09);outline:2px solid var(--border);outline-offset:1px;}
#gameboyModeButton[aria-pressed="true"]{opacity:1;background:rgba(139,172,15,.20);border-color:#8BAC0F;}
body.gameboy-kanto-only #generationGrid .generation-choice:not(.gen-kanto),
body.gameboy-kanto-only #generationGrid .region-toggle-controls,
body.gameboy-kanto-only #generationGrid .special-options-open,
body.gameboy-kanto-only #introPanel .shiny-dropdown .suffering-row,
body.gameboy-kanto-only #freeModal .free-filters{display:none!important;}
body.gameboy-kanto-only #generationGrid {grid-template-columns:minmax(0,1fr)!important;max-width:250px;margin-inline:auto;}
body.gameboy-kanto-only #generationGrid .gen-kanto{cursor:default;}
body.gameboy-kanto-only #generationGrid .gen-kanto input{pointer-events:none;}
body.gameboy-kanto-only #introPanel .generation-option .option-heading span{display:none;}

.gameboy-kanto-note{display:none;margin:8px 0;font-family:"Silkscreen",monospace;font-size:12px;color:var(--ink);text-align:center;}
body.gameboy-kanto-only .gameboy-kanto-note{display:block;}


/* ==============================================================
   v55 · MÓVIL EXCLUSIVAMENTE (< 761 px)
   1. Tema dentro de la portada; oculto al jugar.
   2. Galería alta y distribuida por todo el recorrido de scroll.
   3. Pista y Sustituto en dos columnas; revelación centrada.
   No se cambian reglas de escritorio ni las animaciones compartidas.
   ============================================================== */
@media (max-width:760px) {
  body { display:block; min-height:100dvh; padding:10px 12px 20px; overflow-x:hidden; }
  .game-shell { position:relative; isolation:isolate; width:100%; min-width:0; max-width:560px; margin-inline:auto; }
  .topbar { padding-right:0!important; justify-content:center; min-height:42px; margin-bottom:9px; }
  .brand-home { margin-inline:auto!important; }

  /* El mismo botón y su arcoíris existente, sin crear otro duplicado. */
  body.mobile-theme-in-panel #introPanel {
    position:relative!important;
    padding-bottom:clamp(94px,12svh,118px)!important;
  }
  body.mobile-theme-in-panel #introPanel > .theme-switch-wrap {
    position:absolute!important;
    top:auto!important; bottom:18px!important; right:clamp(16px,5vw,25px)!important;
    display:flex!important; align-items:center!important; gap:9px!important;
    width:auto!important; height:auto!important; margin:0!important;
    padding:0!important; background:transparent!important; border:0!important;
    box-shadow:none!important; z-index:12!important;
  }
  body.mobile-theme-in-panel #introPanel > .theme-switch-wrap .theme-label {
    display:block; color:var(--ink); font-size:clamp(13px,3.8vw,16px)!important;
  }
  body.mobile-theme-in-panel #introPanel > .theme-switch-wrap .theme-switch {
    width:clamp(64px,18vw,82px)!important; height:clamp(64px,18vw,82px)!important;
    border:3px solid #A3B6D6!important;
    border-radius:12px!important;
    background:#183c6b!important;
    display:grid;place-items:center;
    overflow:visible;
  }
  body.mobile-theme-in-panel #introPanel > .theme-switch-wrap #themeSprite {
    width:clamp(56px,17vw,75px)!important;
    height:clamp(56px,17vw,75px)!important;
    object-fit:contain!important; max-width:none!important;
  }
  body.mobile-theme-in-panel.gameboy-theme #introPanel > .theme-switch-wrap .theme-switch {
    background:var(--gb-mid,#306230)!important;
    border-color:var(--gb-dark,#0F380F)!important;
  }
  body.in-game-screen .theme-switch-wrap,
  body:has(#resultPanel:not(.hidden)) .theme-switch-wrap { display:none!important; }

  /* La pantalla principal deja una sección para navegar entre las tarjetas. */
  body:has(#introPanel:not(.hidden)) .game-shell {
    padding-bottom:clamp(780px,128svh,1240px)!important;
  }
  body:has(#introPanel:not(.hidden)) .game-shell > .pantone-gallery {
    position:absolute!important;
    left:0!important; right:0!important;
    top:clamp(420px,69svh,690px)!important;
    width:100%!important; max-width:none!important;
    height:clamp(900px,136svh,1300px)!important;
    min-height:0!important;
    margin:0!important; padding:0!important;
    overflow:visible!important;
    z-index:1!important; pointer-events:none!important;
  }
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card {
    pointer-events:auto!important;
    width:clamp(118px,35vw,166px)!important;
    right:auto!important;bottom:auto!important;
    touch-action:manipulation;
  }
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card.pantone-mini {
    width:clamp(77px,24vw,107px)!important;
  }
  /* Las ocho posiciones cubren toda la galería; no forman una pila inferior. */
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card:nth-child(1){left:4%!important;top:3%!important;}
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card:nth-child(2){left:53%!important;top:13%!important;}
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card:nth-child(3){left:8%!important;top:31%!important;}
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card:nth-child(4){left:54%!important;top:48%!important;}
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card:nth-child(5){left:11%!important;top:67%!important;}
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card:nth-child(6){left:56%!important;top:27%!important;}
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card:nth-child(7){left:38%!important;top:60%!important;}
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card:nth-child(8){left:58%!important;top:82%!important;}
  body:has(#introPanel:not(.hidden)) #introPanel {
    z-index:4!important;
    transform-origin:top center;
    transition:transform .28s cubic-bezier(.22,1,.36,1), padding .28s ease!important;
  }
  body.mobile-gallery-scrolled:has(#introPanel:not(.hidden)) #introPanel {
    transform:translateY(-20px) scale(.93)!important;
  }
  body:has(#introPanel:not(.hidden)) .intro-tools,
  body:has(#introPanel:not(.hidden)) .intro-start-area { z-index:5!important; }
  body:has(#introPanel:not(.hidden)) .footer {
    position:relative;z-index:5;
  }

  /* Antes de revelar: paleta y título en todo el ancho, pista a la
     izquierda y Sustituto a la derecha (misma fila). */
  .game-shell > #gamePanel:not(.hidden) {
    display:grid!important;
    grid-template-columns:minmax(0, .95fr) minmax(0,1.05fr)!important;
    grid-auto-rows:min-content!important;
    column-gap:4px!important; row-gap:6px!important;
    align-content:start!important;
    padding:clamp(12px,3.3vw,20px)!important;
    min-height:0!important;
    max-width:100%!important;
  }
  #gamePanel:not(.hidden) > .game-heading,
  #gamePanel:not(.hidden) > #gamePrompt,
  #gamePanel:not(.hidden) > .palette-area,
  #gamePanel:not(.hidden) > .guess-form,
  #gamePanel:not(.hidden) > .feedback,
  #gamePanel:not(.hidden) > .failed-attempts,
  #gamePanel:not(.hidden) > .game-actions {
    grid-column:1/-1!important;
    width:100%!important; min-width:0!important;
    justify-self:stretch!important;
    margin-left:0!important; margin-right:0!important;
  }
  #gamePanel:not(.hidden) > .game-heading { grid-row:1!important; }
  #gamePanel:not(.hidden) > #gamePrompt { grid-row:2!important; margin:2px 0!important; }
  #gamePanel:not(.hidden) > .palette-area { grid-row:3!important; }
  #gamePanel:not(.hidden) .palette-area .palette {
    height:clamp(145px,26svh,215px)!important;
    min-height:0!important;
  }
  #gamePanel:not(.hidden) > .clue-status {
    grid-column:1!important; grid-row:4!important;
    width:100%!important;min-width:0!important;
    margin:4px 0!important;
    display:flex;flex-direction:column;justify-content:center;align-items:center;
    align-self:center;
  }
  #gamePanel:not(.hidden) .clue-label {font-size:clamp(16px,5vw,23px)!important;}
  #gamePanel:not(.hidden) .clue-count {gap:5px!important;white-space:nowrap;}
  #gamePanel:not(.hidden) .clue-count strong {font-size:clamp(43px,13vw,68px)!important;}
  #gamePanel:not(.hidden) .clue-count span {font-size:clamp(16px,4vw,25px)!important;}
  #gamePanel:not(.hidden) .clue-value {font-size:clamp(9px,2.4vw,11px)!important;}
  #gamePanel:not(.hidden) > .revealed-pokemon.is-placeholder {
    grid-column:2!important;grid-row:4!important;
    width:100%!important;max-width:100%!important;
    min-width:0!important;min-height:clamp(142px,28svh,195px)!important;
    align-self:center!important;justify-self:center!important;
    margin:0!important;padding:0 0 12px!important;
    display:flex;justify-content:end;align-items:center;
  }
  #gamePanel:not(.hidden) > .revealed-pokemon.is-placeholder #revealedSprite {
    min-width:0!important;min-height:0!important;
    width:clamp(108px,33vw,163px)!important;
    height:clamp(108px,33vw,163px)!important;
    max-width:100%!important;max-height:none!important;
    margin:0 0 -7px!important;
  }
  #gamePanel:not(.hidden) > .revealed-pokemon.is-placeholder .reveal-floor {
    width:85%!important;height:17px!important;
    bottom:7px!important;
  }
  #gamePanel:not(.hidden) > .guess-form { grid-row:5!important;margin:0!important; }
  #gamePanel:not(.hidden) > .feedback { grid-row:6!important; }
  #gamePanel:not(.hidden) > .failed-attempts { grid-row:7!important; }
  #gamePanel:not(.hidden) > .game-actions { grid-row:8!important; }
  #gamePanel:not(.hidden) .guess-form #guessButton {
    min-height:48px!important;padding:8px 18px!important;
  }
  #gamePanel:not(.hidden) > .revealed-pokemon:not(.is-placeholder) {
    grid-column:1/-1!important;grid-row:4!important;
    justify-self:center!important;align-self:center!important;
    width:100%!important;max-width:100%!important;
    margin:4px auto!important;
    display:flex;align-items:center;justify-content:center;
  }
  #gamePanel.round-finished > .clue-status {display:none!important;}
}


/* ===========================================================
   v56 — Correcciones únicamente para móvil
   - El botón de tema vuelve a flotar pero queda plegado en ⋮
   - Galería extendida sin una pantalla entera de espacio vacío
   - Herramientas se desplazan junto al panel al reducirlo
   - El layout de pistas/revelación del v55 permanece intacto
   =========================================================== */
.mobile-theme-dots {display:none;}
@media (max-width:760px) {
  /* El menú de tres puntos es el único botón de tema visible inicialmente. */
  body.mobile-theme-available .mobile-theme-dots {
    position:fixed;top:10px;right:9px;z-index:51;
    width:42px;height:48px;display:grid;place-items:center;
    margin:0;padding:0;border:0;background:transparent;
    color:#b5c2d6;cursor:pointer;
    font:700 40px/1 system-ui,sans-serif;
    text-shadow:0 2px 3px rgba(0,0,0,.5);
  }
  body.mobile-theme-available:not([data-theme="dark"]) .mobile-theme-dots {
    color:#3e5069;
  }
  .mobile-theme-dots span {display:block;transform:translateY(-3px);}
  body.mobile-theme-available .mobile-theme-dots:focus-visible {
    outline:2px solid #A3B6D6;outline-offset:1px;
  }
  body.mobile-theme-available .theme-switch-wrap {
    position:fixed!important;top:55px!important;right:10px!important;
    bottom:auto!important;left:auto!important;z-index:50!important;
    display:flex!important;width:auto!important;margin:0!important;
    padding:4px 6px!important;background:transparent!important;
    border:0!important;box-shadow:none!important;
    opacity:0!important;visibility:hidden!important;pointer-events:none!important;
    transition:opacity .16s ease,visibility .16s!important;
  }
  body.mobile-theme-open.mobile-theme-available .theme-switch-wrap {
    opacity:1!important;visibility:visible!important;pointer-events:auto!important;
  }
  body.mobile-theme-available .theme-switch-wrap .theme-switch {
    width:68px!important;height:65px!important;
    border:3px solid #A3B6D6!important;border-radius:12px!important;
    background:#183c6b!important;
  }
  body.mobile-theme-available .theme-switch-wrap #themeSprite {
    width:59px!important;height:57px!important;max-width:none!important;
  }
  /* El degradado original sigue aplicado al mismo #themeSwitch. */
  body.in-game-screen .mobile-theme-dots,
  body:has(#resultPanel:not(.hidden)) .mobile-theme-dots,
  body.in-game-screen .theme-switch-wrap,
  body:has(#resultPanel:not(.hidden)) .theme-switch-wrap {
    display:none!important;
  }

  /* No acumular tarjetas al fondo ni reservar una franja excesiva vacía. */
  body:has(#introPanel:not(.hidden)) .game-shell {
    padding-bottom:clamp(395px,66svh,630px)!important;
  }
  body:has(#introPanel:not(.hidden)) .game-shell > .pantone-gallery {
    position:absolute!important;
    top:64px!important;bottom:40px!important;
    height:auto!important;min-height:0!important;
    left:0!important;right:0!important;
    width:100%!important;max-width:none!important;
    overflow:visible!important;pointer-events:none!important;
    margin:0!important;padding:0!important;
  }
  /* Se distribuyen desde arriba hasta la zona de scroll inferior. */
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card:nth-child(1){left:-3%!important;top:2%!important;}
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card:nth-child(2){left:63%!important;top:12%!important;}
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card:nth-child(3){left:9%!important;top:27%!important;}
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card:nth-child(4){left:55%!important;top:46%!important;}
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card:nth-child(5){left:4%!important;top:62%!important;}
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card:nth-child(6){left:63%!important;top:32%!important;}
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card:nth-child(7){left:47%!important;top:74%!important;}
  body:has(#introPanel:not(.hidden)) .pantone-gallery .pantone-card:nth-child(8){left:10%!important;top:84%!important;}

  body.mobile-gallery-scrolled:has(#introPanel:not(.hidden)) #introPanel {
    transform:translateY(-20px) scale(.93)!important;
  }
  body.mobile-gallery-scrolled:has(#introPanel:not(.hidden)) .game-shell > .intro-tools,
  body.mobile-gallery-scrolled:has(#introPanel:not(.hidden)) .game-shell > .intro-start-area {
    transform-origin:top center;
    transform:translateY(calc(-20px - var(--mobile-panel-collapse, 0px))) scale(.93)!important;
    transition:transform .28s cubic-bezier(.22,1,.36,1)!important;
  }
  body:has(#introPanel:not(.hidden)) .game-shell > .intro-tools,
  body:has(#introPanel:not(.hidden)) .game-shell > .intro-start-area {
    transform-origin:top center;
    transition:transform .28s cubic-bezier(.22,1,.36,1)!important;
  }
}


/* ==============================================================
   v57 — MÓVIL: capas y contracción fluida, sin salto al terminar
   un gesto de scroll. Mantiene intacto el modo juego de v55.
   ============================================================== */
@media (max-width:760px) {
  /* La barra superior crea su propia capa; antes tenía z-index:4
     y atrapaba al tema (fixed) detrás del panel, también con z-index:4. */
  body:has(#introPanel:not(.hidden)) .game-shell > .topbar {
    position:relative;
    z-index:75!important;
  }
  body.mobile-theme-available .mobile-theme-dots {
    z-index:90!important;
  }
  body.mobile-theme-available .theme-switch-wrap {
    z-index:89!important;
  }

  /* Escala con progreso continuo 0..1. No se animan transformaciones
     con transition para evitar el rebote al invertir o soltar el dedo. */
  body:has(#introPanel:not(.hidden)) .game-shell > #introPanel {
    transform-origin:top center;
    transform:translate3d(0,var(--mobile-panel-lift,0px),0)
              scale(var(--mobile-panel-scale,1))!important;
    transition:none!important;
  }
  body:has(#introPanel:not(.hidden)) .game-shell > .intro-tools {
    transform-origin:top center;
    transform:translate3d(0,var(--mobile-tools-lift,0px),0)
              scale(var(--mobile-panel-scale,1))!important;
    transition:none!important;
  }
  body:has(#introPanel:not(.hidden)) .game-shell > .intro-start-area {
    transform-origin:top center;
    transform:translate3d(0,var(--mobile-start-lift,0px),0)
              scale(var(--mobile-panel-scale,1))!important;
    transition:none!important;
  }
  body:has(#introPanel:not(.hidden)) .game-shell > .footer {
    transform-origin:top center;
    transform:translate3d(0,var(--mobile-footer-lift,0px),0)
              scale(var(--mobile-panel-scale,1))!important;
    transition:none!important;
  }

  /* Modo Game Boy: nunca superponer el botón a Idioma y banderas.
     En móvil ocupa su propia fila, debajo de los controles. */
  #debugModal .debug-card {
    padding-bottom:clamp(16px,4vw,25px)!important;
  }
  #debugModal #gameboyModeButton {
    position:relative!important;
    inset:auto!important;
    display:grid!important;
    width:44px!important;
    height:44px!important;
    margin:14px 0 0 auto!important;
    flex:none;
  }
}
