/* ==========================================================================
   TEMA: Game Boy (paleta DMG de 4 verdes), inspirado en Número Ascendente.
   Todo lo visual va aquí; base.css solo usa estas variables.
   El canvas del lago lee también estas variables (lake.js).
   ========================================================================== */

@font-face { font-family: "Press Start 2P"; font-display: swap; src: url("../fonts/press-start-2p-latin.woff2") format("woff2"); }
@font-face { font-family: "VT323"; font-display: swap; src: url("../fonts/vt323-latin.woff2") format("woff2"); }

:root {
    --page: #082008;            /* fondo fuera del rectángulo del juego (escritorio) */
    --bg: #0f380f;
    --surface: rgba(139, 172, 15, .08);
    --surface-hover: rgba(155, 188, 15, .2);
    --border: #306230;
    --text: #9bbc0f;
    --muted: #6f9712;
    --accent: #9bbc0f;
    --accent-2: #8bac0f;
    --on-accent: #0f380f;
    --backdrop: rgba(15, 56, 15, .88);
    --font-display: "Press Start 2P", "Courier New", monospace;
    --font-body: "VT323", "Courier New", monospace;
    /* lago */
    --water-near: #2c5c26;      /* el agua se oscurece a franjas con la distancia (más oscuro = más contaminado) */
    --water-far: #082408;
    --shore: #557a1c;
}

* { border-radius: 0 !important; }
body { -webkit-font-smoothing: none; text-rendering: optimizeSpeed; }
*, *::before, *::after { transition-timing-function: steps(3) !important; }

/* Marco del juego en escritorio */
.game { outline: 4px solid var(--border); box-shadow: 0 0 0 10px var(--page), 0 0 40px 10px rgba(0, 0, 0, .5); }

/* Rejilla LCD sobre el juego */
.game::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 0, 0, .16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, .16) 1px, transparent 1px);
    background-size: 3px 3px;
}

/* ---------- Indicadores ---------- */
.hud { border-bottom: 3px solid var(--border); background: var(--bg); }
.rad-icon { color: var(--text); filter: drop-shadow(2px 2px 0 var(--border)); }
.meter { border: 3px solid var(--border); background: var(--bg); }
.meter i { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.meter i.on { background: var(--accent); }

.rad.is-warn .meter i.on { animation: gb-blink .8s steps(1) infinite; }
.rad.is-crit { animation: gb-blink .4s steps(1) infinite; }
.rad-val { font-family: var(--font-display); font-size: .75em; text-shadow: 2px 2px 0 var(--border); }
.money { font-family: var(--font-display); font-size: .62em; text-shadow: 2px 2px 0 var(--border); }
.money-sign { color: var(--muted); }

.icon-btn, .chip-btn, .modal-x {
    border: 3px solid var(--border);
    box-shadow: 3px 3px 0 var(--border);
    background: var(--bg);
}
.chip-btn { font-family: var(--font-display); font-size: .55em; }
@media (hover: hover) { .icon-btn:hover, .chip-btn:hover, .modal-x:hover { background: var(--surface-hover); } }
.icon-btn:active, .chip-btn:active, .modal-x:active { transform: translate(3px, 3px); box-shadow: none; }
svg { shape-rendering: crispEdges; }

/* ---------- Lago ---------- */
.hint { font-family: var(--font-display); font-size: .45em; line-height: 1.6; color: var(--text); background: var(--bg); border: 2px solid var(--border); }
/* Ojo extra: nombre encima de cada pez */
.fish-label { font-family: var(--font-body); font-size: .75em; line-height: 1; color: var(--text); background: color-mix(in srgb, var(--bg) 85%, transparent); border: 2px solid var(--border); }
/* radiación de un lance, junto al pescador */
.float-num { font-family: var(--font-display); font-size: 1.1em; color: var(--text); text-shadow: 3px 3px 0 var(--bg); }
/* ☢ late más rápido cuanto más lejos está el anzuelo */
.rad[data-geiger="1"] .rad-icon { animation: gb-blink .9s steps(1) infinite; }
.rad[data-geiger="2"] .rad-icon { animation: gb-blink .4s steps(1) infinite; }
.rad[data-geiger="3"] .rad-icon { animation: gb-blink .18s steps(1) infinite; }
.money.bump { animation: gb-bump .4s steps(3); }
@keyframes gb-bump { 50% { transform: translateY(-3px); } }

/* ---------- Barra ---------- */
.power, .dock { background: var(--bg); }
.bag-head .modal-title { color: var(--text); text-shadow: 3px 3px 0 var(--bg), 0 0 6px var(--bg); }
.bag-head .icon-btn { background: none; border: 0; box-shadow: none; color: var(--text); filter: drop-shadow(2px 2px 0 var(--bg)); }
.bag-tab { border: 3px solid var(--border); border-bottom: 0; background: var(--bg); color: var(--muted); }
.bag-tab.is-on { color: var(--text); border-color: var(--text); height: calc(var(--u) * 10 + 3px); margin-top: calc(var(--u) * -1); margin-bottom: -3px; border-bottom: 0; position: relative; z-index: 2; }   /* acoplada al contenido: tapa su borde superior */
.bag-body { background: var(--bg); border: 3px solid var(--text); box-shadow: 8px 8px 0 var(--border); }
.gear-cell { background: var(--text); color: var(--bg); border: 2px solid var(--border); box-shadow: 2px 2px 0 var(--border); }
.gear-cell b { font-size: 1.2em; }
.gear-cell:active { transform: translate(2px, 2px); box-shadow: none; }
.bar { border: 3px solid var(--border); background: var(--bg); }
.bar i { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.bar i.on { background: var(--accent); }
/* parte bloqueada (más allá del tope del equipo): rayada */
.bar i.locked { background: repeating-linear-gradient(135deg, var(--border) 0 2px, transparent 2px 4px); }
.bar .cap { background: var(--text); box-shadow: 2px 0 0 var(--border); }
.bar[data-mode="tension"] i.danger { background: repeating-linear-gradient(135deg, var(--border) 0 2px, transparent 2px 4px); }
.bar[data-mode="tension"] i.danger.on { background: var(--text); animation: gb-blink .2s steps(1) infinite; }
/* zona buena de tensión: dos marcas en sus bordes; dentro, el borde de la barra se ilumina */
.bar .zone-mark { background: var(--text); box-shadow: 2px 0 0 var(--border); }
.bar.is-sweet { border-color: var(--text); }

/* ---------- Mochila y mutaciones ---------- */
.slot { border: 3px solid var(--border); box-shadow: 3px 3px 0 var(--border); background: var(--bg); }
.slot.is-empty { border-style: dashed; box-shadow: none; }
.slot-icon { color: var(--text); filter: drop-shadow(2px 2px 0 var(--border)); }
.slot-name { font-size: .8em; }
.slot.is-empty .slot-name { color: var(--muted); }

@media (hover: hover) { .slot:not(.is-empty):hover { border-color: var(--text); background: var(--surface-hover); } }

/* ---------- Aviso y ventanas ---------- */
.toast { border: 3px solid var(--text) !important; background: var(--bg); color: var(--text); box-shadow: 4px 4px 0 var(--border); font-family: var(--font-body); }
.toast.bad { border-style: dashed !important; }

.modal { border: 4px solid var(--text); background: var(--bg); box-shadow: 8px 8px 0 var(--border); }
.modal::backdrop { background: var(--backdrop); }
.modal[open] { animation-timing-function: steps(4); }
.modal-title { font-size: .8em; line-height: 1.5; text-shadow: 3px 3px 0 var(--border); }
.modal-text { font-size: 1.15em; line-height: 1.1; }
.muted, .version { color: var(--muted); }
.btn { font-size: .6em; border: 0; background: var(--text); color: var(--on-accent); box-shadow: 0 6px 0 var(--border); }
.btn[aria-pressed="false"] { background: var(--bg); color: var(--text); border: 3px solid var(--border); box-shadow: none; }
.btn:active { transform: translateY(6px); box-shadow: none; }

.list li { border: 3px solid var(--border); font-size: 1.1em; }
.list li.is-on { border-color: var(--text); background: var(--surface-hover); }
.list li .li-icon { color: var(--text); }
.list li .li-count { font-family: var(--font-display); font-size: .55em; }
.list li .li-name small { color: var(--muted); }
.mini-btn { background: var(--text); color: var(--on-accent); box-shadow: 0 3px 0 var(--border); }
.mini-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
.shop-money { font-size: 1.2em; }
.shop-tip { font-size: 1em; color: var(--muted); }
.first-tip { font-size: .9em; color: var(--text); border: 2px dashed var(--border); }
.shop-row { font-size: 1.15em; }
.shop-row .li-name small { font-size: .9em; }
.shop-cash { font-family: var(--font-display); font-size: .7em; text-shadow: 3px 3px 0 var(--bg); }
.cmp { display: block; margin-top: .2em; font-style: normal; font-size: .85em; color: var(--text); }
.shop-need { display: block; margin-top: .2em; font-size: .85em; color: var(--muted); }
.shop-row.is-lower { opacity: .55; }
.shop-own.is-on { color: var(--text); font-weight: 700; }
.shop-row .mini-btn { font-size: .5em; }
.shop-row.is-owned { border-style: dashed; }
.shop-own { font-size: .85em; color: var(--muted); }
.shop-money b { font-family: var(--font-display); font-weight: 400; font-size: .7em; }
.stats { font-size: 1.1em; }
.stats b { font-weight: 400; color: var(--text); text-align: right; }
.stats span { color: var(--muted); }
.list-head { font-size: .55em; color: var(--muted); }

.album-card { border: 3px dashed var(--border); color: var(--muted); }
.album-card .q { color: var(--border); }
.album-card.is-found { border-style: solid; border-color: var(--text); color: var(--text); background: var(--surface); }
.album-card .ac-icon { filter: drop-shadow(1px 1px 0 var(--border)); }

/* Tarjeta del pez (panel) */
.catch-head, .choice { background: color-mix(in srgb, var(--bg) 94%, transparent); border: 3px solid var(--border); box-shadow: 4px 4px 0 color-mix(in srgb, #000 35%, transparent); }
.catch-head { border-color: var(--text); }
.catch-icon { color: var(--text); filter: drop-shadow(4px 4px 0 var(--border)); animation: gb-bump .8s steps(2) infinite; }
.catch-name { font-family: var(--font-display); font-size: .7em; line-height: 1.4; text-shadow: 2px 2px 0 var(--border); }
.catch-sub { font-size: 1.2em; color: var(--muted); }
.catch-sub span:last-child { color: var(--text); }
.tag { border: 2px solid var(--text); font-family: var(--font-body); font-size: 1em; }
.choice { font-size: 1.2em; animation: choice-pulse 1.8s steps(4) infinite; }
/* borde que late muy suave: hay que decidir */
@keyframes choice-pulse { 50% { border-color: color-mix(in srgb, var(--text) 60%, var(--border)); } }
.catch-panel.is-locked .choice { animation: none; opacity: .75; }
.choice:active { transform: translate(4px, 4px); box-shadow: none; }
@media (hover: hover) { .choice:hover { border-color: var(--text); background: var(--surface-hover); } }
.choice-head b { font-family: var(--font-display); font-size: .7em; }
.choice-val { font-family: var(--font-display); font-size: .7em; }
.choice-text { color: var(--text); }
.choice-text .muted { color: var(--muted); }
.choice-text .is-bad { color: var(--muted); text-decoration: underline dotted; }
.choice-mut .li-icon { color: var(--text); }
.choice-rad { color: var(--text); border-top: 2px dashed var(--border); padding-top: .3em; }
.choice-rad b { font-weight: 400; padding: 0 .25em; background: var(--text); color: var(--on-accent); }
.choice-rad b.is-bad { animation: gb-blink .6s steps(1) infinite; }
.mut-q { font-family: var(--font-display); font-size: .6em; border: 2px solid var(--text); }
.mut-head { font-family: var(--font-display); font-size: .55em; }
.mut-line { font-size: 1em; }
.mut-line.is-good { color: var(--text); }
.mut-line.is-bad { color: var(--muted); text-decoration: underline dotted; }
.catch-panel[data-state="fosforito"] .catch-icon { filter: drop-shadow(0 0 5px var(--accent)) drop-shadow(4px 4px 0 var(--border)); }
.catch-panel[data-state="engendro"] .catch-icon { animation: gb-shake .3s steps(2) infinite; }
@keyframes gb-shake { 50% { transform: translateX(2px) rotate(-4deg); } }
.btn.ghost { background: var(--bg); color: var(--text); border: 3px solid var(--border); box-shadow: none; }
.btn.ghost:active { transform: translateY(2px); }
.mut-name { font-family: var(--font-display); font-size: .7em; }
.mut-icon, .death-icon { color: var(--text); filter: drop-shadow(3px 3px 0 var(--border)); }
.mut-icon[data-kind="bad"] { animation: gb-shake .3s steps(2) infinite; }
.death { border-style: dashed; }
.toggle { background: var(--bg); color: var(--muted); border: 3px solid var(--border); }
.toggle[aria-pressed="true"] { background: var(--text); color: var(--on-accent); border-color: var(--text); }
.range { accent-color: var(--text); }
.set-row { font-size: 1.15em; }
.set-row small { color: var(--muted); }
.help, .credits { font-size: 1.05em; color: var(--muted); }
.help b { color: var(--text); }
.rotate { background: var(--bg); color: var(--text); font-family: var(--font-display); font-size: 14px; line-height: 1.6; }
.rotate .start-icon { color: var(--text); }
.buy.is-confirm { background: var(--bg); color: var(--text); outline: 2px solid var(--text); animation: gb-blink .5s steps(1) infinite; }
.start { border-width: 4px; }
.start-icon { color: var(--text); filter: drop-shadow(4px 4px 0 var(--border)); }
.start .modal-title { font-size: .95em; }
.start .btn:disabled { opacity: .4; box-shadow: none; }
.bag-items li { font-size: 1.1em; }
.notice { border-width: 4px; }
.notice[data-kind="bad"] { border-style: dashed; }
.notice[data-kind="bad"] .start-icon { animation: gb-blink .6s steps(1) infinite; }
.notice .modal-text { font-size: 1.1em; }
.album-card.is-complete { border-style: double; border-width: 5px; }
.album-card .ac-star { color: var(--text); font-family: var(--font-display); font-size: .5em; }
.bag-items input { accent-color: var(--text); }
.game.fx-vista .lake::after { background: radial-gradient(ellipse at 50% 55%, transparent 45%, color-mix(in srgb, var(--bg) 85%, transparent) 100%); }
.death-icon { animation: gb-blink .6s steps(1) infinite; }
.death .modal-title { animation: gb-blink 1s steps(1) infinite; }
.slot[data-kind="bad"] { border-style: dashed; }
.slot-badge { font-family: var(--font-display); font-size: .45em; color: var(--text); }
.tag.is-new { background: var(--text); color: var(--on-accent); animation: gb-blink 1s steps(1) infinite; }

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