/* ¿Qué PC eres? — vintage legible: fuente pixel solo en títulos y botones, texto normal para leer cómodo,
   bordes duros con sombra desplazada (nada de degradados ni esquinas redondas), ficha en pantalla azul de BIOS
   y barras de bloques. Una sola columna, botones grandes para el pulgar. */

@font-face { font-family: "Press Start 2P"; src: url("/static/fonts/PressStart2P-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "VT323"; src: url("/static/fonts/VT323-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #0a0d14;
  --panel: #121826;
  --line: #2f3a5c;
  --text: #eef1ff;
  --muted: #9aa3c7;

  --green: #3dff7a;   /* fósforo de monitor: el color de la casa */
  --amber: #ffb000;
  --cyan: #4de2ff;
  --pink: #ff4fa3;
  --purple: #a259ff;
  --blue: #4da3ff;
  --orange: #ff9a3d;
  --yellow: #ffd23f;
  --red: #ff4d4d;
  --bios: #0000aa;

  --accent: var(--green); /* cada reto cambia este color desde play.js */
  --shadow: color-mix(in srgb, var(--accent) 38%, #000);
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --mono: "VT323", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--font); font-size: 18px; line-height: 1.5; min-height: 100vh; }
a { color: var(--green); }
h1, h2 { margin: 0; }
button { font-family: inherit; }
[hidden] { display: none !important; }   /* lo que lleva `hidden` no se ve, aunque su clase defina otro display */

.app { position: relative; max-width: 600px; margin: 0 auto; padding: 0 16px; min-height: 100vh; display: flex; flex-direction: column; }
/* Líneas de barrido muy tenues, como un monitor antiguo */
.app::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px); }
@media (prefers-contrast: more) { .app::after { display: none; } }

/* ----- Barra superior ----- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 0; }
.topbar__home { display: flex; align-items: center; gap: 10px; font-family: var(--pixel); font-size: 11px; color: var(--text); text-decoration: none; }
.topbar__logo { width: 24px; height: 24px; background: var(--green); box-shadow: 3px 3px 0 #000; position: relative; }
.topbar__logo::after { content: ""; position: absolute; inset: 7px; background: var(--bg); }
.topbar__tools { display: flex; gap: 6px; align-items: center; }
.pill {
  font: inherit; font-family: var(--pixel); font-size: 11px; color: var(--text); background: var(--panel);
  border: 2px solid var(--line); border-radius: 0; min-width: 42px; min-height: 42px; padding: 0 10px;
  text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.pill:hover, .pill:focus-visible { border-color: var(--green); outline: none; }
.pill[aria-current] { background: var(--green); border-color: var(--green); color: #07100a; }

.screen { flex: 1; padding: 8px 0 28px; }
.footer { font-size: 14px; color: var(--muted); padding: 18px 0 28px; border-top: 2px dashed var(--line); }
.footer a { color: var(--muted); }

/* ----- Tipografía ----- */
.title { font-family: var(--pixel); font-size: 22px; line-height: 1.55; font-weight: normal; margin: 16px 0; }
.title em { font-style: normal; color: var(--green); }
.title--small { font-size: 16px; }
.tagline { font-size: 19px; color: var(--muted); margin: 0 0 22px; }
.cursor { color: var(--green); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.bios-line { font-family: var(--mono); font-size: 21px; line-height: 1.2; color: var(--green); margin: 0; opacity: 0.85; }
.warning { font-size: 14px; color: var(--muted); }
.notice { border: 3px solid var(--red); color: var(--red); padding: 10px 14px; font-size: 15px; }
.prose p { max-width: 62ch; }

/* ----- Botones: borde duro y sombra desplazada, como un botón de consola ----- */
.btn {
  display: block; width: 100%; min-height: 56px; margin: 14px 0; padding: 14px 18px;
  font-family: var(--pixel); font-size: 13px; line-height: 1.4; text-align: center; text-decoration: none; cursor: pointer;
  color: var(--text); background: var(--panel); border: 3px solid var(--accent); border-radius: 0;
  box-shadow: 5px 5px 0 var(--shadow);
}
.btn:hover, .btn:focus-visible { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); outline: none; }
.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--shadow); }
.btn--primary { background: var(--accent); color: #07100a; }
.btn--primary:hover, .btn--primary:focus-visible { background: color-mix(in srgb, var(--accent) 80%, #fff); }
.btn[hidden] { display: none; }

/* ----- Landing ----- */
.hero { padding: 6px 0 8px; }
.hero__badge { display: inline-block; font-family: var(--pixel); font-size: 10px; color: #000; background: var(--yellow); padding: 6px 10px; margin-top: 14px; box-shadow: 3px 3px 0 #000; }
.hero__mascot { display: block; width: min(62%, 230px); height: auto; margin: 0 auto 6px; image-rendering: pixelated; }
.friend { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 10px 14px 10px 10px; color: var(--text); text-decoration: none;
  background: var(--panel); border: 3px solid var(--vendor); box-shadow: 5px 5px 0 color-mix(in srgb, var(--vendor) 40%, #000); }
.friend img { flex: none; image-rendering: pixelated; }
.friend span { font-size: 16px; line-height: 1.35; }

/* ----- Contenido de texto (guías, preguntas frecuentes) ----- */
.about-site { margin-top: 28px; }
.tips { padding-left: 22px; }
.tips li { margin: 10px 0; }
.plain-list { padding-left: 20px; }
.plain-list li { margin: 8px 0; }
.faq { margin: 10px 0; padding: 10px 14px; background: var(--panel); border: 3px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 10px 0 2px; color: var(--muted); }
.cpu-about { margin: 22px 0; }

/* ----- Cuentas y progreso ----- */
.callout { margin: 20px 0; padding: 14px 16px; background: var(--panel); border: 3px solid var(--line); box-shadow: 5px 5px 0 #000; }
.callout__text { margin: 0 0 4px; font-weight: 700; }
.callout__sub { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.subtitle { font-family: var(--pixel); font-size: 13px; line-height: 1.6; margin: 26px 0 10px; }
.form { margin: 10px 0; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0; line-height: 1.4; }
.check input { flex: none; width: 24px; height: 24px; margin-top: 2px; accent-color: var(--green); }
.notice--ok { border-color: var(--green); color: var(--green); }
.btn--danger { border-color: var(--red); box-shadow: 5px 5px 0 color-mix(in srgb, var(--red) 40%, #000); }
.history-item { display: grid; gap: 2px; margin: 10px 0; padding: 10px 14px; color: var(--text); text-decoration: none; background: var(--panel); border: 3px solid var(--line); box-shadow: 4px 4px 0 #000; }
.history-item:hover, .history-item:focus-visible { border-color: var(--green); outline: none; }
.history-item span { color: var(--muted); font-size: 16px; }
.history-item small { color: var(--yellow); font-family: var(--mono); font-size: 18px; }
.collection { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; text-align: center; background: var(--panel); border: 3px solid var(--line); font-size: 14px; line-height: 1.2; }
.tile img { image-rendering: pixelated; }
.tile--text { min-height: 56px; justify-content: center; }
.tile--locked { opacity: 0.45; }
.tile--locked img { filter: brightness(0); }

/* ----- Entrenamiento ----- */
.train-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.train-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; text-align: center; color: var(--text); text-decoration: none;
  background: var(--panel); border: 3px solid var(--line); box-shadow: 5px 5px 0 #000; }
.train-card:hover, .train-card:focus-visible { border-color: var(--green); outline: none; }
.train-card:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 #000; }
.train-card img { width: 96px; height: 96px; image-rendering: pixelated; }
.train-card__name { font-family: var(--pixel); font-size: 12px; }
.train-card__blurb { font-size: 15px; color: var(--muted); line-height: 1.3; }
.train-card__best { font-family: var(--mono); font-size: 20px; color: var(--yellow); }

/* ----- Juego ----- */
.game { min-height: 420px; display: flex; flex-direction: column; gap: 14px; }
.hud { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hud__name { font-family: var(--pixel); font-size: 13px; color: var(--accent); margin-right: auto; white-space: nowrap; }
.chip { white-space: nowrap; font-family: var(--pixel); font-size: 10px; border: 2px solid var(--accent); color: var(--accent); padding: 7px 8px; min-width: 56px; text-align: center; background: var(--panel); }
.restart { font-size: 18px; padding: 0; width: 42px; }
.steps { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.steps span { height: 10px; background: var(--line); }
.steps span.on { background: var(--accent); }
.instruction { font-size: 20px; text-align: center; margin: 2px 0; min-height: 30px; }
.stage { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; min-height: 300px; }
.level-flash { animation: flash 0.45s steps(4); }
@keyframes flash { from { background: var(--accent); color: #07100a; } }

.explain { width: 100%; background: var(--panel); border: 3px solid var(--line); box-shadow: 5px 5px 0 #000; padding: 6px 18px; }
.explain p { font-size: 18px; text-align: left; margin: 12px 0; }
.explain p:last-child { color: var(--muted); font-size: 16px; }

.reflex-pad { width: 100%; min-height: 300px; display: flex; user-select: none; touch-action: manipulation; border: 3px solid var(--line); box-shadow: 5px 5px 0 #000; }
.reflex-pad > span { flex: 1; background: #1a2033; }
.dot-slot { min-height: 90px; display: flex; align-items: center; justify-content: center; }

.equation { font-family: var(--mono); font-size: 52px; line-height: 1.1; text-align: center; font-variant-numeric: tabular-nums; }
.answers { display: flex; gap: 14px; width: 100%; }
.answers .btn { margin: 0; font-family: var(--font); font-size: 34px; font-weight: 800; color: #07100a; border-color: #000; box-shadow: 5px 5px 0 #000; }
.answers .answer--yes, .answers .answer--yes:hover { background: var(--green); }   /* sin esto, al pasar el ratón pierde el color */
.answers .answer--no, .answers .answer--no:hover { background: var(--pink); }
.answers .btn:hover, .answers .btn:focus-visible { filter: brightness(1.12); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.pane { background: var(--panel); border: 3px solid var(--line); box-shadow: 5px 5px 0 #000; min-height: 270px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 10px; }
.dot { width: 84px; height: 84px; border-radius: 50%; border: 4px solid #000; }
.dot--blue { background: var(--blue); }
.dot--red { background: var(--red); }
.rule { font-family: var(--pixel); font-size: 10px; min-height: 30px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--accent); text-align: center; line-height: 1.4; }
.rule--flash { animation: flash 0.5s steps(4) 3; }
.dot--mini { width: 20px; height: 20px; border-width: 3px; display: inline-block; }
.digit { font-family: var(--mono); font-size: 68px; line-height: 1; min-height: 64px; font-variant-numeric: tabular-nums; }
.pane .btn { margin: 0; min-height: 52px; font-size: 11px; }

.memory-number { font-family: var(--mono); font-size: 64px; letter-spacing: 6px; line-height: 1.1; word-break: break-all; text-align: center; }
.memory-input { font-family: var(--mono); font-size: 44px; width: 100%; text-align: center; padding: 8px; color: var(--text); background: #000; border: 3px solid var(--accent); border-radius: 0; }

.canvas-wrap { width: 100%; max-width: 420px; aspect-ratio: 1; background: var(--panel); border: 3px solid var(--line); box-shadow: 5px 5px 0 #000; touch-action: manipulation; }
.canvas-wrap canvas { width: 100%; height: 100%; display: block; }

.grid { display: grid; gap: 4px; width: 100%; max-width: 420px; aspect-ratio: 1; }
.grid button { padding: 0; border: 0; border-radius: 0; background: var(--panel); display: flex; align-items: center; justify-content: center; cursor: pointer; min-width: 0; min-height: 0; }
.grid svg { width: 82%; height: 82%; }

.icon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.icon-grid button, .icon-grid div { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 3px solid var(--line); border-radius: 0; background: var(--panel); font-size: 44px; cursor: pointer; padding: 0; box-shadow: 4px 4px 0 #000; }
.icon-grid [aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 24%, var(--panel)); }
.icon-grid.is-12 { grid-template-columns: repeat(4, 1fr); }
.icon-grid.is-12 button { font-size: 34px; }

.timebar { width: 100%; height: 12px; background: var(--line); border: 2px solid #000; }
.timebar span { display: block; height: 100%; background: var(--accent); }
.timebar[hidden] { display: none; }
.icon-grid.is-many { grid-template-columns: repeat(6, 1fr); gap: 6px; }
.icon-grid.is-many button { font-size: 26px; box-shadow: 3px 3px 0 #000; }
.icon-grid [data-correct="true"] { border-color: var(--green); background: color-mix(in srgb, var(--green) 28%, var(--panel)); }

.loading { text-align: center; }
.loading p { color: var(--muted); font-family: var(--mono); font-size: 24px; margin: 6px 0; }

/* ----- Resultado ----- */
/* Cabecera: radar a la izquierda, nombre de la CPU y PC a la derecha; debajo, el texto de "qué PC eres" */
.result-top, .verdict { background: color-mix(in srgb, var(--vendor) 12%, var(--panel)); border: 4px solid var(--vendor);
  box-shadow: 7px 7px 0 color-mix(in srgb, var(--vendor) 38%, #000); }
.result-top { display: grid; grid-template-columns: 1.3fr 1fr; gap: 6px; align-items: center; margin-top: 8px; padding: 10px 12px 12px; }
.result-top--single { grid-template-columns: 1fr; justify-items: center; text-align: center; }
.result-id { text-align: right; }
.result-top--single .result-id { text-align: center; }
.verdict { margin: 18px 0; padding: 14px 14px 16px; text-align: center; }
.radar { width: 100%; height: auto; overflow: visible; }
.radar__ring { fill: none; stroke: var(--line); stroke-width: 1.5; }
.radar__ring:last-of-type { stroke: #44527e; }
.radar__axis { stroke: var(--line); stroke-width: 1.5; }
.radar__shape { fill: color-mix(in srgb, var(--green) 30%, transparent); stroke: var(--green); stroke-width: 3; stroke-linejoin: miter; }
.radar__dot { fill: var(--green); }
.radar__name { font-family: var(--mono); font-size: 23px; fill: var(--muted); }
.radar__value { font-family: var(--mono); font-size: 30px; fill: var(--text); }
.radar__name[data-metric="clock"], .radar__value[data-metric="clock"] { fill: var(--orange); }
.radar__name[data-metric="single"], .radar__value[data-metric="single"] { fill: var(--pink); }
.radar__name[data-metric="multi"], .radar__value[data-metric="multi"] { fill: var(--blue); }
.radar__name[data-metric="cache"], .radar__value[data-metric="cache"] { fill: var(--purple); }
.radar__name[data-metric="gpu"], .radar__value[data-metric="gpu"] { fill: var(--cyan); }
.radar__name[data-metric="ram"], .radar__value[data-metric="ram"] { fill: var(--yellow); }
.radar__name[data-metric="storage"], .radar__value[data-metric="storage"] { fill: var(--green); }

.persona__kicker { margin: 0; color: var(--muted); font-family: var(--pixel); font-size: 10px; }
.persona__title { font-family: var(--pixel); font-size: 13px; line-height: 1.6; font-weight: normal; text-transform: uppercase; margin: 6px 0 8px; }
.persona__img { display: block; width: min(100%, 180px); height: auto; margin: 0 0 0 auto; image-rendering: pixelated; }
.result-top--single .persona__img { width: min(100%, 260px); margin: 0 auto; }
.persona__trait { display: inline-block; margin: 8px 0 4px; padding: 7px 10px; font-family: var(--pixel); font-size: 10px; color: #000; background: var(--vendor); box-shadow: 3px 3px 0 #000; }
.persona__desc { font-size: 20px; margin: 10px 0 12px; }
.persona__label { display: inline-block; font-size: 17px; font-weight: 700; margin: 0; padding: 10px 14px; background: #000; border-left: 5px solid var(--vendor); text-align: left; }

/* Ficha: pantalla azul de BIOS */
.sheet { background: var(--bios); color: #fff; border: 4px double #fff; padding: 8px 14px; margin: 18px 0; font-family: var(--mono); font-size: 22px; line-height: 1.2; }
.sheet__row { display: grid; grid-template-columns: 138px 1fr; gap: 10px; padding: 8px 0; border-bottom: 2px dotted rgba(255, 255, 255, 0.4); }
.sheet__row:last-child { border-bottom: 0; }
.sheet__row > span:first-child { color: #ffff55; }

.result__social { font-size: 18px; text-align: center; color: var(--yellow); font-weight: 700; }
.result__rarity { text-align: center; font-weight: 700; margin: 16px 0 6px; }
.also { text-align: center; color: var(--muted); font-size: 16px; margin: 0 0 6px; }

/* ----- Menú de compartir: un solo botón que abre todas las opciones ----- */
.share-dialog { width: min(100% - 24px, 560px); max-height: 92vh; overflow: auto; padding: 14px 16px 8px; color: var(--text);
  background: var(--panel); border: 4px solid var(--green); box-shadow: 8px 8px 0 #000; }
.share-dialog::backdrop { background: rgba(0, 0, 0, 0.75); }
.share-dialog__close { float: right; }
.share-dialog .share { margin-top: 4px; clear: both; }

/* ----- Botones de compartir (marcas estándar, fáciles de reconocer) ----- */
.share { margin: 20px 0 8px; }
.share__title { font-family: var(--pixel); font-size: 11px; margin: 0 0 12px; }
.share__buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.share-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 8px 14px;
  font: inherit; font-size: 16px; font-weight: 700; color: #fff; text-decoration: none; cursor: pointer;
  border: 3px solid #000; border-radius: 0; box-shadow: 4px 4px 0 #000;
}
.share-btn:hover, .share-btn:focus-visible { filter: brightness(1.12); outline: 2px solid #fff; outline-offset: 2px; }
.share-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #000; }
.share-btn[hidden] { display: none; }
.share-btn--whatsapp { background: #25d366; color: #06280f; }
.share-btn--telegram { background: #229ed9; }
.share-btn--x { background: #000; border-color: #555; }
.share-btn--facebook { background: #1877f2; }
.share-btn--copy { background: var(--panel); border-color: var(--line); }
.share-btn--native { background: var(--purple); }
.share-btn--image { background: var(--green); color: #07100a; }
.share-btn--download { background: var(--yellow); color: #000; }
.share__hint { color: var(--muted); font-size: 15px; margin: -4px 0 12px; }
.share__image { display: grid; gap: 12px; margin-bottom: 14px; }
.share-icon { width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }

/* ----- Anuncios: marco claramente rotulado, espacio reservado (sin saltos de layout) ----- */
.ad { margin: 22px 0; border: 3px dashed var(--line); padding: 8px; }
.ad__label { display: block; font-family: var(--pixel); font-size: 8px; color: var(--muted); text-align: center; }
.ad__slot { min-height: 250px; }

/* ----- Pantallazo azul (404) ----- */
.bsod { background: var(--bios); color: #fff; padding: 26px; min-height: 55vh; font-family: var(--mono); font-size: 24px; }
.bsod__title { font-family: var(--pixel); font-size: 16px; background: #fff; color: var(--bios); display: inline-block; padding: 6px 10px; font-weight: normal; }
.bsod .btn { color: #fff; border-color: #fff; background: transparent; box-shadow: none; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* Comentario por componente en el resultado */
.traits { margin: 18px 0; text-align: left; }
.trait { margin: 8px 0; line-height: 1.5; border-left: 4px solid var(--vendor, var(--accent)); padding-left: 10px; }

/* Panel de estadísticas (/admin/stats) */
.stats { max-width: 1000px; margin: 0 auto; text-align: left; }
.stats__periods { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.stats__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stats__cards div { border: 2px solid var(--accent); padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.stats__cards strong { font-family: var(--pixel); font-size: 18px; }
.stats__cards span { font-size: 14px; opacity: 0.85; }
.stats__table { width: 100%; border-collapse: collapse; margin: 8px 0 18px; }
.stats__table td, .stats__table th { padding: 5px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); text-align: left; }
.stats__bar { display: inline-block; width: 120px; height: 10px; background: rgba(255, 255, 255, 0.1); vertical-align: middle; margin-right: 6px; }
.stats__bar span { display: block; height: 100%; background: var(--accent); }
.stats__login { display: flex; flex-direction: column; gap: 12px; max-width: 320px; }
.stats__h3 { font-size: 16px; margin: 14px 0 6px; }
.stats__histogram { display: inline-flex; align-items: flex-end; gap: 2px; height: 60px; }
.stats__histogram span { width: 8px; background: var(--accent); min-height: 2px; }
.stats__verdict--easy { color: #ffd24d; }
.stats__verdict--hard { color: #ff8a1f; }
.stats__verdict--ok { color: #33ff66; }
.stats__verdict--few { opacity: 0.6; }
.stats__table td, .stats__table th { white-space: nowrap; }
.stats { overflow-x: auto; }

/* Compartir siempre a la vista en el resultado: pegado al borde inferior mientras su sitio queda por debajo de la pantalla. */
.share-bar { position: sticky; bottom: 12px; z-index: 5; margin: 12px 0; }
.share-bar .btn { margin: 0; box-shadow: 0 0 0 4px var(--bg, #0a0d14), 4px 4px 0 4px #000; }

/* Móviles bajos (iPhone SE, Android pequeños): el botón "Empezar" debe verse sin desplazarse. */
@media (max-height: 800px) {
  .hero { display: flex; flex-direction: column; }
  .hero .bios-line { display: none; }
  .hero__badge { align-self: flex-start; margin-top: 8px; }
  .hero__mascot { width: min(42%, 150px); margin-bottom: 10px; }
  .hero .warning { order: 1; }                                     /* el aviso de destellos sigue justo bajo los botones */
  .hero .tagline { order: 2; margin: 6px 0 14px; }                 /* el texto largo pasa debajo */
  .hero > :not(.bios-line, .hero__badge, h1, .hero__mascot, .tagline, .btn, .warning) { order: 3; }
}

/* Invitaciones a guardar el progreso (inicio de sesión opcional) */
.pill--login { padding-inline: 10px; white-space: nowrap; font-weight: 700; }
.login-chip { display: block; margin: 14px 0 4px; padding: 10px 12px; text-align: center; font-size: 15px; color: var(--text, #e8ecff);
  border: 2px dashed var(--green, #3dff7a); text-decoration: none; }
.login-chip strong { color: var(--green, #3dff7a); }
.login-chip:hover, .login-chip:focus-visible { background: color-mix(in srgb, var(--green, #3dff7a) 14%, transparent); }
.save-card { margin: 12px 0; padding: 12px 14px; background: var(--panel); border: 3px solid var(--green, #3dff7a); box-shadow: 4px 4px 0 #000; text-align: center; }
.save-card__title { margin: 0 0 4px; font-family: var(--pixel); font-size: 12px; color: var(--green, #3dff7a); }
.save-card__text { margin: 0 0 10px; font-size: 15px; color: var(--muted); }
.save-card .btn { margin: 0; }
@media (max-height: 800px) { .hero .login-chip { order: 1; } .hero .warning { order: 2; } .hero .tagline { order: 3; } }

/* Móviles estrechos: la barra de arriba cabe en una línea aunque ahora lleve el texto "Entrar". */
.topbar__home { white-space: nowrap; flex-shrink: 1; min-width: 0; }
.topbar__tools { flex-shrink: 0; }
@media (max-width: 420px) {
  .topbar { gap: 6px; }
  .topbar__home { font-size: 0; gap: 0; }                 /* solo el logo: el nombre no cabe junto a los botones */
  .topbar__logo { width: 26px; height: 26px; flex: none; }
  .topbar__logo::after { inset: 8px; }
  .topbar__tools { gap: 4px; }
  .topbar__tools .pill { padding-inline: 7px; font-size: 12px; }
  .pill--login { font-size: 12px; }
}

/* Pantalla de carga con contenido: líneas que aparecen y barra que se rellena */
.loading__lines { min-height: 120px; text-align: left; max-width: 420px; margin: 14px auto; }
.loading__line { margin: 4px 0; color: var(--green); }
.loading__bar { max-width: 420px; height: 14px; margin: 0 auto; border: 3px solid var(--line); background: var(--panel); }
.loading__bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.1s linear; }

/* Premio: tema Windows 95 (se desbloquea viendo un anuncio) */
.reward { margin: 10px 0; }
.reward .btn { margin: 6px 0; }
html[data-theme="win95"] {
  --bg: #008080; --panel: #c0c0c0; --line: #808080; --text: #000; --muted: #303030;
  --green: #000080; --accent: #000080; --yellow: #ffff66;
  --font: Tahoma, "MS Sans Serif", Geneva, Verdana, sans-serif;
}
html[data-theme="win95"] body { background: var(--bg); }
html[data-theme="win95"] .topbar__home, html[data-theme="win95"] .footer, html[data-theme="win95"] .footer a { color: #fff; }
html[data-theme="win95"] a { color: #000080; }
html[data-theme="win95"] .btn, html[data-theme="win95"] .pill, html[data-theme="win95"] .callout, html[data-theme="win95"] .save-card,
html[data-theme="win95"] .verdict, html[data-theme="win95"] .result-top, html[data-theme="win95"] .login-chip {
  background: #c0c0c0; color: #000; border: 2px outset #fff; box-shadow: none; border-radius: 0;
}
html[data-theme="win95"] .btn--primary, html[data-theme="win95"] .pill[aria-current] { background: #000080; color: #fff; }
html[data-theme="win95"] .save-card__title, html[data-theme="win95"] .login-chip strong { color: #000080; }
html[data-theme="win95"] .title, html[data-theme="win95"] .subtitle { color: #fff; text-shadow: 2px 2px 0 #000; }
html[data-theme="win95"] .persona__title { color: #000; }
html[data-theme="win95"] .persona__label { background: #fff; color: #000; border-left-color: #000080; }
html[data-theme="win95"] .radar__name[data-metric] { filter: brightness(0.55); }
