/* ═══════════════════════════════════════════════════════════════════════
   Head Kings — base visual de la interfaz: fuentes, tokens, fondo, tipografía con contorno, botones
   de dos tonos, paneles de pizarra, barras y animaciones comunes. Mismo lenguaje que el KIT DE
   INTERFAZ (theme.css, tema «foco y pizarra»): las clases de siempre (.btn, .panel, .bar…) se pintan
   como sus equivalentes del kit (.hk-btn, .hk-panel, .hk-bar…).
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Fuentes locales ── */
@font-face { font-family: 'Lilita One'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/lilita-one-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Lilita One'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/lilita-one-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/baloo-2-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/baloo-2-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/baloo-2-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/baloo-2-latin-800-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/baloo-2-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+1E00-1E9F, U+2020, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/baloo-2-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+1E00-1E9F, U+2020, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/baloo-2-latin-ext-800-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+1E00-1E9F, U+2020, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF; }

/* ── Tokens ──
   Los de siempre (las pantallas los usan), ahora con los valores del kit «foco y pizarra»
   (client/css/theme.css): contorno casi negro y cálido, pizarra translúcida, turquesa y dorado. */
:root {
  color-scheme: dark;
  --font-title: 'Lilita One', 'Baloo 2', system-ui, sans-serif;
  --font-body: 'Baloo 2', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --ink: #120a05;          /* contorno oscuro de todo (cálido, nunca azul marino) */
  --ink-2: #2a1a10;
  --bg-0: #10202b;
  --bg-1: #1a3147;
  --bg-2: #1e383f;
  --bg-3: #1a4252;
  --text: #ffffff;
  --text-dim: #c9d9e2;
  --text-mute: #8fa8b6;
  --title: #ffab00;        /* títulos grandes (amarillo-naranja con contorno marrón) */
  --title-ink: #2c1300;
  --accent: #ffc81a;
  --cyan: #58e1ff;

  --panel-top: rgba(34, 28, 25, .74);
  --panel-bot: rgba(18, 15, 14, .8);
  --panel-ring: rgba(255, 255, 255, .2);
  --panel-deep: #15110f;
  --well: rgba(8, 7, 8, .66);
  --slate: rgba(22, 18, 17, .62);
  --slate-solid: rgba(22, 19, 18, .93);
  --card-top: #1c6071;     /* tarjetas turquesa-azuladas (tira de la plantilla) */
  --card-bot: #164e5f;
  --teal: #10abd0;

  --gold: #ffc81a; --gold-2: #ffe24a; --gold-d: #b86b00;
  --gem: #b334ec;  --gem-2: #e785ff;  --gem-d: #5d1a93;
  --green: #63dc05; --green-2: #b6f23a; --green-d: #2f7a05;
  --red: #ef3b2f;  --blue: #1a8df2;  --orange: #ff8a1f;

  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 24px;
  --top-h: 64px; --nav-h: 76px;
  --gutter: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  font-size: clamp(13px, min(1.25vw, 2.25vh), 19px);
}
@media (max-height: 500px) and (orientation: landscape) {
  :root { --top-h: 46px; --nav-h: 52px; --gutter: 12px; font-size: 13px; }
}
@media (orientation: portrait) {
  :root { --top-h: 58px; --nav-h: 66px; --gutter: 12px; font-size: clamp(13px, 3.6vw, 17px); }
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-1);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
input, textarea { -webkit-user-select: text; user-select: text; font: inherit; }
img, canvas, svg { display: block; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 3px solid #fff6a8; outline-offset: 3px; }

/* ── Fondo: el foco y la pizarra del kit (<div class="bg hk-bg hk-bg--menu hk-bg--fixed">, theme.css).
   La variante cambia con la pantalla (main.js → setBackdrop): tienda turquesa, derrota fría… ── */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ── Tipografía con contorno (Lilita One) ──
   Contorno con -webkit-text-stroke + paint-order (el trazo queda por DEBAJO del relleno: la letra no
   adelgaza) y la caída de abajo con text-shadow, como en el kit. --sc = color del contorno. */
.t-title, .num, .stroke {
  font-family: var(--font-title); font-weight: 400; letter-spacing: .015em; color: #fff;
  --sc: var(--ink); --sw: .17em; --sd: .075em;
  -webkit-text-stroke: var(--sw) var(--sc); paint-order: stroke fill;
  text-shadow: 0 var(--sd) 0 var(--sc);
}
.num { font-variant-numeric: tabular-nums; }
.stroke-lg { --sw: .19em; --sd: .09em; text-shadow: 0 var(--sd) 0 var(--sc), 0 calc(var(--sd) + .06em) .12em rgba(0, 0, 0, .3); }
.stroke-sm { --sw: .2em; --sd: .06em; }
/* Título amarillo-naranja con contorno marrón (nombres, títulos de pantalla y de ventana) */
.t-hero { color: var(--title); --sc: var(--title-ink); --sw: .2em; --sd: .09em; }
.t-dim { color: var(--text-dim); text-shadow: 0 1px 0 rgba(0, 0, 0, .55); }
.t-gold { color: var(--gold-2); }
.t-green { color: var(--green-2); }
.t-red { color: #ff8a80; }

/* ── Botones de dos tonos (kit: .hk-btn) ──
   Mitad de arriba clara y de abajo más oscura, contorno oscuro, canto abajo, grosor y un punto de
   brillo. Las variantes solo cambian --hi (arriba), --lo (abajo), --lip (canto) y --bink (contorno
   del texto). */
.btn {
  --hi: #52c4ff; --lo: #1a8df2; --lip: #0b5fc0; --bink: #06224d;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: 44px; min-width: 44px; padding: .42em 1.1em .5em;
  font-family: var(--font-title); font-size: 1.12rem; line-height: 1.05; color: #fff; letter-spacing: .02em;
  text-align: center; white-space: nowrap;
  --sc: var(--bink);
  -webkit-text-stroke: .18em var(--sc); paint-order: stroke fill;
  text-shadow: 0 .07em 0 var(--sc);
  background: linear-gradient(180deg, var(--hi) 0%, var(--hi) 49%, var(--lo) 51%, var(--lo) 100%);
  border: 2.5px solid var(--ink); border-radius: .62em;
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, .7),
    inset 0 -.2em 0 var(--lip),
    0 .2em 0 var(--ink),
    0 .35em .6em rgba(0, 0, 0, .28);
  margin-bottom: .22em;
  transform: translateY(0);
  transition: transform .06s ease-out, box-shadow .06s ease-out, filter .15s;
  isolation: isolate;
}
.btn::before {  /* punto de brillo arriba a la derecha */
  content: ''; position: absolute; z-index: 1; right: .42em; top: .26em; width: .5em; height: .3em;
  border-radius: 50%; background: rgba(255, 255, 255, .9); transform: rotate(32deg); pointer-events: none;
}
.btn > * { position: relative; z-index: 2; }
.btn:hover { filter: brightness(1.06); }
.btn:active, .btn.is-pressed {
  transform: translateY(.2em);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .55), inset 0 -.08em 0 var(--lip), 0 0 0 var(--ink), 0 .1em .25em rgba(0, 0, 0, .3);
}
.btn[disabled], .btn.is-disabled {
  --hi: #c4ccd3; --lo: #8796a1; --lip: #5f6d77; --bink: #1c252b;
  cursor: default; filter: none;
}
.btn[disabled]:active { transform: none; box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .7), inset 0 -.2em 0 var(--lip), 0 .2em 0 var(--ink), 0 .35em .6em rgba(0, 0, 0, .28); }

.btn-green  { --hi: #c3fb0e; --lo: #63dc05; --lip: #3aa000; --bink: #173f00; }
.btn-blue   { --hi: #52c4ff; --lo: #1a8df2; --lip: #0b5fc0; --bink: #06224d; }
.btn-yellow { --hi: #ffe24a; --lo: #ffae0a; --lip: #cc7400; --bink: #4d2400; }
.btn-orange { --hi: #ffb14a; --lo: #ff7417; --lip: #c24a06; --bink: #4f1700; }
.btn-red    { --hi: #ff7666; --lo: #ef3b2f; --lip: #b01d14; --bink: #4a0603; }
.btn-purple { --hi: #e785ff; --lo: #b334ec; --lip: #7a16b4; --bink: #2e0550; }
.btn-gray   { --hi: #d5dde3; --lo: #93a3ae; --lip: #66757f; --bink: #1c252b; }
/* Secundario turquesa tipo pestaña (el antiguo «oscuro»): cuerpo turquesa y píldora de cristal */
.btn-dark, .btn-teal {
  --hi: #19b9da; --lo: #0a86ab; --lip: #055f7e; --bink: #05303f;
  background: linear-gradient(180deg, #1ac4e4 0%, #0e9fc4 55%, #0a82a6 100%);
  box-shadow: inset 0 2px 0 #7cf1ff, inset 0 -.2em 0 var(--lip), 0 .2em 0 var(--ink), 0 .35em .6em rgba(0, 0, 0, .28);
}
.btn-dark::after, .btn-teal::after {
  content: ''; position: absolute; z-index: 0; left: .28em; right: .28em; top: .2em; height: 44%;
  border-radius: 999px; background: rgba(210, 248, 255, .38); pointer-events: none;
}
.btn-dark:active, .btn-teal:active { box-shadow: inset 0 2px 0 #7cf1ff, inset 0 -.08em 0 var(--lip), 0 0 0 var(--ink); }

.btn-sm { min-height: 44px; padding: .3em .8em .38em; font-size: .95rem; border-radius: .55em; }
.btn-lg { padding: .45em 1.45em .55em; font-size: 1.45rem; }
.btn-xl { padding: .3em 1.4em .38em; font-size: 2.4rem; border-radius: .42em; -webkit-text-stroke-width: .14em; }
.btn-xl::before { width: .34em; height: .2em; right: .3em; top: .2em; }
.btn-block { display: flex; width: 100%; }
.btn-round { border-radius: 50%; padding: 0; width: 48px; height: 48px; }
.btn .sub { display: block; font-family: var(--font-body); font-weight: 800; font-size: .62em; letter-spacing: 0; -webkit-text-stroke-width: .22em; }
.btn-col { flex-direction: column; gap: .02em; }
.btn .ico { width: 1.3em; height: 1.3em; flex: none; }

/* Brillo que barre un botón o una carta (clase añadida a elementos destacados). La franja es un
   degradado dentro de una capa del ancho del elemento que se desplaza con transform (compuesto en
   la GPU): animar `left` obligaba a recalcular la maquetación en cada fotograma. */
.shine { overflow: hidden; }
.shine::after {
  content: ''; position: absolute; z-index: 2; top: -20%; bottom: -20%; left: 0; width: 100%;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-110%) skewX(-18deg); animation: shine-sweep 3.2s ease-in-out infinite; pointer-events: none;
}
@keyframes shine-sweep { 0%, 55% { transform: translateX(-110%) skewX(-18deg); } 85%, 100% { transform: translateX(110%) skewX(-18deg); } }

/* Botón redondo tipo ficha (cerrar, volver, ajustes…) con un glifo oscuro (kit: .hk-round).
   Colores: azul por defecto · .red · .green · .dark (turquesa) · .gold · .purple */
.icon-btn {
  --hi: #52b8ff; --lo: #1f8ff5; --lip: #0f5fcc; --rim: #082a6b; --gl: #072765;
  position: relative; display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0;
  border-radius: 50%; border: 2px solid var(--rim);
  background: radial-gradient(ellipse 72% 58% at 50% 32%, var(--hi) 0%, var(--hi) 42%, var(--lo) 100%);
  box-shadow: inset 0 -4px 0 var(--lip), inset 0 2px 1px rgba(255, 255, 255, .5), 0 2px 0 var(--rim), 0 4px 7px rgba(0, 0, 0, .32);
  color: var(--gl);
  transition: transform .06s ease-out, box-shadow .06s ease-out; margin-bottom: 3px;
}
.icon-btn::after { content: ''; position: absolute; right: 15%; top: 10%; width: 20%; height: 12%; border-radius: 50%; background: rgba(255, 255, 255, .9); transform: rotate(40deg); pointer-events: none; }
.icon-btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 var(--lip), inset 0 2px 1px rgba(255, 255, 255, .4), 0 0 0 var(--rim), 0 2px 3px rgba(0, 0, 0, .3); }
.icon-btn[disabled] { filter: grayscale(.9) brightness(.8); cursor: default; }
.icon-btn svg { width: 60%; height: 60%; margin-top: -4%; }
.icon-btn.red { --hi: #ff7a6e; --lo: #f0453a; --lip: #b8231b; --rim: #5c0806; --gl: #4a0605; }
.icon-btn.green { --hi: #c2f73e; --lo: #6fd51a; --lip: #3c9a08; --rim: #174a00; --gl: #0f3a00; }
.icon-btn.dark, .icon-btn.teal { --hi: #74e8f7; --lo: #17b3d6; --lip: #0a7fa3; --rim: #043546; --gl: #04303f; }
.icon-btn.gold { --hi: #ffe45c; --lo: #ffb41a; --lip: #cc7a00; --rim: #5a2c00; --gl: #4a2400; }
.icon-btn.purple { --hi: #e88fff; --lo: #b43cee; --lip: #7a18b6; --rim: #300858; --gl: #2c0450; }

/* ── Paneles de pizarra (kit: .hk-panel) ──
   Pizarra oscura translúcida (sobre el foco sale cálida; en los lados, azulada), contorno oscuro y
   un filo claro por dentro. .panel-dark: más opaco. */
.panel {
  position: relative;
  background: var(--slate);
  border: 1.5px solid var(--ink); border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1.5px var(--panel-ring), 0 .3rem .7rem rgba(0, 0, 0, .3);
}
.panel-dark { background: rgba(16, 13, 12, .8); }
.well {  /* hueco hundido dentro de un panel */
  background: var(--well); border-radius: var(--r-md);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .6), inset 0 -1px 0 rgba(255, 255, 255, .1);
}

/* Título de sección o de ventana (antes, una cinta): letra amarilla con contorno marrón grueso, como
   el nombre del personaje. Los colores de cinta de siempre se quedan como tono del título. */
.ribbon {
  position: relative; display: inline-block; padding: 0 .15em .08em; z-index: 1; margin: 0;
  font-family: var(--font-title); font-weight: 400; font-size: 1.5rem; line-height: 1.05; letter-spacing: .015em;
  color: var(--title); --sc: var(--title-ink);
  -webkit-text-stroke: .2em var(--sc); paint-order: stroke fill;
  text-shadow: 0 .09em 0 var(--sc), 0 .15em .14em rgba(0, 0, 0, .3);
}
/* Los tonos de las cintas de antes (blue, green, red, purple, gray) ya no cambian el color: todos los
   títulos son amarillos, como en el kit. Solo el del resultado usa el suyo (match-flow.css). */

/* ── Insignias ── */
.badge-new {  /* «¡NUEVO!»: sello amarillo inclinado */
  display: inline-block; padding: .1em .45em .14em; border-radius: .35em; transform: rotate(-8deg);
  font-family: var(--font-title); font-size: max(11px, .8rem); color: #fff; letter-spacing: .02em;
  -webkit-text-stroke: .22em #5a1b00; paint-order: stroke fill;
  background: linear-gradient(180deg, #ffd84a 0 50%, #ff9a0a 50% 100%); border: 1.5px solid var(--ink);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .6), 0 .1rem 0 var(--ink);
}
.dot-alert {  /* notificación: etiqueta roja con pico y el número (o «!») */
  position: absolute; top: -9px; right: -7px; z-index: 3; min-width: 23px; height: 24px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 6px;
  font-family: var(--font-title); font-size: .88rem; line-height: 1; color: #fff;
  -webkit-text-stroke: .2em #4a0406; paint-order: stroke fill;
  background: linear-gradient(180deg, #ff5a55 0 50%, #e0172a 50% 100%);
  border: 1.5px solid var(--ink); box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .5), 0 1.5px 0 var(--ink);
  animation: dot-bob 1.5s ease-in-out infinite; pointer-events: none;
}
.dot-alert::after {  /* pico hacia abajo a la izquierda */
  content: ''; position: absolute; left: 3px; bottom: -7px; width: 8px; height: 7px;
  background: #e0172a; border: 1.5px solid var(--ink); border-top: 0; border-right: 0;
  clip-path: polygon(0 0, 100% 0, 0 100%); transform: skewY(-8deg);
}
.dot-alert:empty { min-width: 16px; width: 16px; height: 16px; padding: 0; border-radius: 50%; }
.dot-alert:empty::after { display: none; }
@keyframes dot-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

.level-badge {  /* estrella azul de seis puntas con el nivel (kit: .hk-lvl) */
  position: relative; display: grid; place-items: center; width: 2.9rem; height: 2.9rem; flex: none;
}
.level-badge svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.level-badge b { position: relative; margin-top: .06em; font-family: var(--font-title); font-weight: 400; font-size: 1.15rem; line-height: 1; color: #fff;
  -webkit-text-stroke: .22em #062347; paint-order: stroke fill; }

/* ── Barras de progreso (kit: .hk-bar) ──
   Carril oscuro con franja de cristal y punto de brillo; relleno de dos tonos. Por defecto azul (XP);
   .green lista para mejorar, .gold, .purple. */
.bar {
  --f-hi: #8ee6ff; --f-lo: #1ea4e8; --p: 0;
  position: relative; display: block; height: 1.15rem; border-radius: 999px; overflow: hidden;
  background: #1d1b1d; border: 1.5px solid var(--ink);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .45);
}
.bar::before {  /* franja clara del carril (cristal) */
  content: ''; position: absolute; left: .35rem; right: .35rem; top: 12%; height: 34%; border-radius: 999px; background: rgba(255, 255, 255, .18);
}
.bar > i {
  position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%);
  background: linear-gradient(180deg, var(--f-hi) 0 50%, var(--f-lo) 50% 100%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18), 1.5px 0 0 var(--ink);
  border-radius: 999px 0 0 999px; transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.bar > span {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center;
  font-family: var(--font-title); font-size: max(11px, .8rem); line-height: 1; color: #fff;
  -webkit-text-stroke: .2em var(--ink); paint-order: stroke fill; text-shadow: 0 .06em 0 var(--ink);
}
.bar.green { --f-hi: #c3fb0e; --f-lo: #5fd906; }
.bar.gold { --f-hi: #ffe45a; --f-lo: #ffab0a; }
.bar.purple { --f-hi: #f2a6ff; --f-lo: #b63cf0; }
.bar.full > i { animation: bar-glow 1.1s ease-in-out infinite alternate; }
@keyframes bar-glow { from { filter: brightness(1); } to { filter: brightness(1.25); } }
.bar .up-arrow { position: absolute; left: 3px; top: 50%; width: 1rem; height: 1rem; transform: translateY(-50%); z-index: 3; }

/* ── Iconos SVG inline ── */
.ico { display: inline-block; width: 1.2em; height: 1.2em; vertical-align: middle; flex: none; overflow: visible; }

/* Cantidad con icono: "[moneda] 120" */
.amount { display: inline-flex; align-items: center; gap: .3em; font-family: var(--font-title); white-space: nowrap; }
.amount .ico { width: 1.25em; height: 1.25em; }

/* ── Controles de formulario ── */
.input {
  width: 100%; min-height: 48px; padding: .4em .8em; border-radius: var(--r-md);
  font-family: var(--font-title); font-size: 1.3rem; color: #fff; letter-spacing: .04em;
  background: var(--well); border: 2px solid var(--ink);
  box-shadow: inset 0 3px 7px rgba(0,0,0,.55), 0 0 0 1.5px rgba(255, 255, 255, .22);
}
.input::placeholder { color: rgba(201, 217, 226, .45); }
.input:focus { box-shadow: inset 0 3px 7px rgba(0,0,0,.55), 0 0 0 3px #ffd84a; }

.toggle { position: relative; width: 70px; height: 38px; flex: none; border-radius: 999px; border: 2.5px solid var(--ink); padding: 0;
  background: #3a3432; box-shadow: inset 0 3px 6px rgba(0,0,0,.5); transition: background .2s; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(ellipse 72% 58% at 50% 30%, #fff 0 45%, #cfd6db 100%); border: 2px solid var(--ink); box-shadow: inset 0 -3px 0 #9aa6ae; transition: transform .2s cubic-bezier(.3,1.6,.5,1); }
.toggle[aria-checked="true"] { background: linear-gradient(180deg, #c3fb0e 0 50%, #63dc05 50% 100%); }
.toggle[aria-checked="true"]::after { transform: translateX(32px); }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; touch-action: pan-y; }
.range::-webkit-slider-runnable-track { height: 14px; border-radius: 999px; border: 2px solid var(--ink);
  background: linear-gradient(90deg, #7fe01a 0 var(--v, 50%), #1d1b1d var(--v, 50%)); box-shadow: inset 0 -2px 0 rgba(0,0,0,.35); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -10px; border-radius: 50%;
  background: radial-gradient(ellipse 72% 58% at 50% 30%, #fff 0 45%, #cfd6db 100%); border: 2.5px solid var(--ink); box-shadow: inset 0 -3px 0 #9aa6ae, 0 2px 0 var(--ink); }
.range::-moz-range-track { height: 14px; border-radius: 999px; border: 2px solid var(--ink); background: #1d1b1d; }
.range::-moz-range-progress { height: 14px; border-radius: 999px; background: #7fe01a; }
.range::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink); }

/* ── Scroll ── */
.scroll-y { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(120, 220, 240, .5) transparent; }
.scroll-y::-webkit-scrollbar { width: 8px; }
.scroll-y::-webkit-scrollbar-thumb { background: rgba(120, 220, 240, .45); border-radius: 8px; }

/* ── Animaciones comunes ── */
@keyframes pop-in { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 80% { transform: scale(.97); } 100% { transform: scale(1); } }
@keyframes rise-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
/* Giro para elementos centrados con translate(-50%, -50%) (rayos de luz) */
@keyframes spin-c { from { transform: translate(-50%, -50%) rotate(0); } to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-7deg); } 40% { transform: rotate(6deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(3deg); } }
@keyframes glow-pulse { 0%, 100% { filter: drop-shadow(0 0 4px var(--glow, #fff3a0)); } 50% { filter: drop-shadow(0 0 14px var(--glow, #fff3a0)); } }
.anim-pop { animation: pop-in .45s cubic-bezier(.2,1.4,.4,1) both; }
.anim-rise { animation: rise-in .4s cubic-bezier(.2,.9,.3,1.1) both; }

/* Reposo (<html data-idle> tras 20 s sin tocar nada): main.js pausa SOLO las animaciones
   infinitas de los menús con la API de animaciones. Aquí no hay regla a propósito: pausar todo
   con animation-play-state congelaría también las animaciones de entrada (fill-mode both) de una
   pantalla que aparece en reposo, y se quedaría invisible hasta el siguiente toque. */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
