/* ===== NUESTRO RINCONCITO · interfaz estilo J.A.R.V.I.S. ===== */
:root {
  --bg: #050810;
  --panel: rgba(10, 18, 38, .68);
  --cyan: #3be7ff;
  --cyan-d: #1aa8d6;
  --gold: #ffc24a;
  --red: #ff3b4e;
  --rose: #ff6fa5;
  --mint: #35f0b2;
  --violet: #9b6bff;
  --blue: #3b8bff;
  --yellow: #ffd23f;
  --text: #e8f6ff;
  --muted: #8aa3c2;
  --line: 1px solid rgba(59, 231, 255, .38);
  --glow: 0 0 16px rgba(59, 231, 255, .28);
  --f-hud: "Orbitron", system-ui, sans-serif;
  --f-body: "Rajdhani", system-ui, sans-serif;
  --f-fun: "Fredoka", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }

body {
  margin: 0;
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1.38;
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(900px 520px at 50% -8%, #16306e 0%, transparent 62%),
    radial-gradient(700px 480px at 105% 105%, #3b1a80 0%, transparent 58%),
    var(--bg);
  background-attachment: fixed;
}
body::before { /* cuadrícula holográfica */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(59, 231, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(59, 231, 255, .06) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0, transparent 75%);
  mask-image: radial-gradient(circle at 50% 30%, #000 0, transparent 75%);
}
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 1; box-shadow: inset 0 0 140px rgba(0, 0, 0, .65); }

#app, #gate { position: relative; z-index: 2; }
#app { max-width: 640px; margin: 0 auto; padding: 54px 16px calc(112px + env(safe-area-inset-bottom)); }

/* ---------- barra superior ---------- */
.hudbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: 34px;
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  font-family: var(--f-hud); font-size: .6rem; letter-spacing: .16em; color: var(--cyan);
  background: linear-gradient(180deg, rgba(5, 8, 16, .96), rgba(5, 8, 16, .7));
  border-bottom: var(--line);
}
.hudbar .sp { flex: 1; }
.hudbar .arc { color: var(--gold); }
.hudbar .live { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); animation: pulse 1.6s infinite; }

/* ---------- tipografía ---------- */
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.12; }
h1 { font-family: var(--f-hud); font-weight: 900; font-size: clamp(1.55rem, 7vw, 2.2rem); letter-spacing: .02em; text-shadow: 0 0 20px rgba(59, 231, 255, .35); }
h1 em { font-style: normal; background: linear-gradient(90deg, var(--violet), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
h2 { font-family: var(--f-hud); font-weight: 700; font-size: .95rem; letter-spacing: .1em; text-transform: uppercase; margin-top: 1.6em; color: var(--cyan); }
h3 { font-family: var(--f-body); font-weight: 700; font-size: 1.25rem; }
h2.sec { display: flex; align-items: center; gap: 10px; }
h2.sec::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(59, 231, 255, .5), transparent); }
p { margin: 0 0 .6em; }
a { color: inherit; }
small { color: var(--muted); }
.hero { margin-bottom: 18px; }
.hello { color: #c7b2ff; font-weight: 700; font-size: 1.15rem; margin-bottom: .2em; min-height: 1.4em; }
.lead { color: var(--muted); font-size: 1.12rem; }
.tag { font-family: var(--f-hud); font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); opacity: .85; margin: 0 0 8px; }
.eyebrow { font-family: var(--f-hud); font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); margin: 0; }
.msg { font-weight: 600; min-height: 1.5em; margin-top: .8em; }
.stack { display: grid; gap: 14px; }

/* ---------- paneles HUD ---------- */
.card {
  position: relative;
  background: var(--panel);
  border: var(--line);
  border-radius: 4px;
  padding: 16px;
  box-shadow: var(--glow), inset 0 0 34px rgba(59, 231, 255, .05);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.card::before { /* esquinas tipo mira */
  content: ""; position: absolute; inset: -1px; pointer-events: none; border-radius: inherit; --c: var(--cyan);
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / 16px 2px, linear-gradient(var(--c), var(--c)) 0 0 / 2px 16px,
    linear-gradient(var(--c), var(--c)) 100% 0 / 16px 2px, linear-gradient(var(--c), var(--c)) 100% 0 / 2px 16px,
    linear-gradient(var(--c), var(--c)) 0 100% / 16px 2px, linear-gradient(var(--c), var(--c)) 0 100% / 2px 16px,
    linear-gradient(var(--c), var(--c)) 100% 100% / 16px 2px, linear-gradient(var(--c), var(--c)) 100% 100% / 2px 16px;
  background-repeat: no-repeat;
}
.card.link { display: flex; gap: 14px; align-items: center; text-decoration: none; transition: transform .12s, box-shadow .2s; }
.card.link:active { transform: scale(.985); }
.card.link .ico { font-size: 2.1rem; filter: drop-shadow(0 0 8px rgba(255, 255, 255, .35)); }
.card.link b { display: block; font-size: 1.15rem; }
.card.link small { color: var(--muted); font-size: 1rem; }
.card.pink { border-color: rgba(255, 111, 165, .6); box-shadow: 0 0 18px rgba(255, 111, 165, .22), inset 0 0 34px rgba(255, 111, 165, .06); }
.card.pink::before { --c: var(--rose); }
.card.sun { border-color: rgba(155, 107, 255, .65); box-shadow: 0 0 18px rgba(155, 107, 255, .26), inset 0 0 34px rgba(155, 107, 255, .07); }
.card.sun::before { --c: var(--violet); }
.card.mint { border-color: rgba(59, 139, 255, .65); box-shadow: 0 0 18px rgba(59, 139, 255, .26), inset 0 0 34px rgba(59, 139, 255, .07); }
.card.mint::before { --c: var(--blue); }

/* ---------- botones ---------- */
.btn {
  font-family: var(--f-hud); font-weight: 700; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: #031018; background: linear-gradient(180deg, #8ff5ff, #1fb7e0);
  border: 1px solid #b8f8ff; border-radius: 4px; padding: 11px 20px; cursor: pointer; text-decoration: none; display: inline-block;
  box-shadow: 0 0 16px rgba(59, 231, 255, .5); transition: transform .1s, filter .15s;
}
.btn:active { transform: scale(.96); filter: brightness(1.2); }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--cyan); box-shadow: none; border-color: rgba(59, 231, 255, .4); font-size: .68rem; padding: 7px 14px; }
.btn.mint { background: linear-gradient(180deg, #cdb6ff, #7a45e6); border-color: #e2d4ff; box-shadow: 0 0 16px rgba(155, 107, 255, .55); color: #10052a; }
.btn.coral { background: linear-gradient(180deg, #ffd27a, #ff4a5c); border-color: #ffe0a8; box-shadow: 0 0 18px rgba(255, 90, 80, .5); color: #1a0508; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- reactor arc ---------- */
.reactor { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 10px rgba(59, 231, 255, .75)); }
.rx-ring { fill: none; stroke: var(--cyan); stroke-width: 1; opacity: .6; }
.rx-dash { fill: none; stroke: var(--cyan); stroke-width: 1.3; stroke-dasharray: 2 4.2; transform-origin: 50px 50px; animation: spin calc(20s - var(--charge, 0) * 16s) linear infinite; }
.rx-seg { fill: none; stroke: var(--cyan); stroke-width: 7; stroke-dasharray: 8 2; opacity: .85; transform-origin: 50px 50px; animation: spin-rev calc(32s - var(--charge, 0) * 28s) linear infinite; }
.rx-inner { fill: rgba(59, 231, 255, .1); stroke: var(--cyan); stroke-width: 1.5; }
.rx-tri { fill: none; stroke: #d6fbff; stroke-width: 1.2; transform-origin: 50px 50px; animation: spin calc(14s - var(--charge, 0) * 11s) linear infinite; }
.rx-core { transform-origin: 50px 50px; animation: corepulse 2.4s ease-in-out infinite; }
.reactor.soft .rx-core, .reactor.soft .rx-tri { opacity: .22; }

.reactor-btn {
  --charge: 0; display: block; position: relative; width: min(60vw, 230px); aspect-ratio: 1; margin: 6px auto 10px;
  background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 0 calc(6px + var(--charge) * 36px) rgba(59, 231, 255, .85));
  transition: filter .3s;
}
.reactor-btn.shake { animation: shake .4s; }
.reactor-btn.supernova { filter: hue-rotate(-150deg) saturate(1.5) drop-shadow(0 0 40px rgba(255, 194, 74, .9)); }
.reactor-btn.supernova .rx-core { animation-duration: .6s; }
.locked-reactor { filter: hue-rotate(170deg) saturate(1.3) brightness(.75) drop-shadow(0 0 14px rgba(255, 59, 78, .7)); animation: bob 3.2s ease-in-out infinite; }
.locked-reactor .lock-ico { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.4rem; filter: none; }

/* ---------- contador ---------- */
.counter { text-align: center; overflow: hidden; }
.reactor-wrap { position: relative; width: min(74vw, 290px); aspect-ratio: 1; margin: 4px auto 6px; }
.reactor-bg { position: absolute; inset: 0; }
.big { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; }
.big span { font-family: var(--f-hud); font-weight: 900; font-size: clamp(3rem, 16vw, 4.4rem); line-height: 1; color: #fff; text-shadow: 0 0 16px var(--cyan), 0 0 44px rgba(59, 231, 255, .65); font-variant-numeric: tabular-nums; }
.big small { font-family: var(--f-hud); letter-spacing: .4em; font-size: .65rem; color: var(--cyan); margin-top: 4px; padding-left: .4em; }
.counter .sub { font-weight: 700; font-size: 1.2rem; margin: 2px 0 8px; color: var(--gold); }
.clock { font-variant-numeric: tabular-nums; font-weight: 600; margin: 0; }
.clock span { font-family: var(--f-hud); font-size: .95rem; background: rgba(0, 0, 0, .4); border: var(--line); padding: 2px 8px; border-radius: 3px; color: var(--cyan); }
.clock i { font-style: normal; margin: 0 6px 0 2px; color: var(--muted); }
.clock em { font-style: normal; color: var(--muted); margin-left: 4px; }

/* ---------- artículo científico (La hipótesis del amor) ---------- */
.paper { border-color: rgba(255, 111, 165, .55); box-shadow: 0 0 18px rgba(255, 111, 165, .2), inset 0 0 40px rgba(255, 255, 255, .03); margin-top: 18px; }
.paper::before { --c: var(--rose); }
.paper .tag { color: var(--rose); }
.paper h2 { font-size: 1.05rem; margin: 0 0 4px; color: #fff; text-transform: none; letter-spacing: .02em; }
.paper .authors { font-style: italic; color: var(--muted); font-size: 1rem; margin-bottom: 10px; }
.paper dl { margin: 0 0 10px; display: grid; gap: 6px; }
.paper dl > div { display: grid; grid-template-columns: 70px 1fr; gap: 10px; }
.paper dt { font-family: var(--f-hud); font-size: .65rem; letter-spacing: .1em; color: var(--rose); padding-top: 5px; text-transform: uppercase; }
.paper dd { margin: 0; }
.paper figure { margin: 10px 0; padding: 10px 10px 6px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 111, 165, .3); border-radius: 4px; }
.paper figcaption { font-size: .95rem; color: var(--muted); margin-top: 4px; }
.spark { width: 100%; height: auto; display: block; overflow: visible; }
.spark .grid { stroke: rgba(138, 163, 194, .22); stroke-width: .6; }
.spark .area { fill: url(#sparkfill); }
.spark .line { fill: none; stroke: var(--rose); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.6s .3s ease-out forwards; filter: drop-shadow(0 0 4px var(--rose)); }
.spark .end { fill: #fff; stroke: var(--rose); stroke-width: 2; opacity: 0; animation: fadein .4s 2.7s forwards, pulse 1.6s 2.7s infinite; transform-box: fill-box; transform-origin: center; }
.spark text { font-family: var(--f-body); font-size: 8px; fill: var(--muted); }
.paper .concl { margin: 8px 0 12px; }
.verdict { display: inline-block; font-family: var(--f-hud); font-weight: 700; font-size: .68rem; letter-spacing: .12em; color: var(--mint); border: 2px solid var(--mint); border-radius: 4px; padding: 5px 10px; transform: rotate(-3deg); text-shadow: 0 0 8px rgba(53, 240, 178, .6); box-shadow: 0 0 12px rgba(53, 240, 178, .3); }

/* ---------- ficha (abogada) ---------- */
.profile { margin-top: 18px; border-color: rgba(255, 194, 74, .5); }
.profile::before { --c: var(--gold); }
.profile h2 { margin: 0 0 8px; font-size: .9rem; color: var(--gold); }
.profile dl { margin: 0; }
.profile dl > div { display: grid; grid-template-columns: 118px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px dashed rgba(138, 163, 194, .3); }
.profile dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.profile dt { font-weight: 700; }
.profile dd { margin: 0; color: var(--muted); }

/* ---------- galería (marco amarillo de Friends) ---------- */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.tile {
  position: relative; margin: 0; padding: 0; aspect-ratio: 1; overflow: hidden; cursor: pointer;
  border: 3px solid var(--yellow); border-radius: 14px; font: inherit; color: var(--text);
  background: linear-gradient(150deg, #20124a, #0b1a3a);
  box-shadow: 0 0 0 2px rgba(91, 58, 153, .9), 0 0 18px rgba(255, 210, 63, .25);
}
.tile:nth-child(odd) { transform: rotate(-1.4deg); }
.tile:nth-child(even) { transform: rotate(1.1deg); }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 8px 6px; font-size: .95rem; font-weight: 600; text-align: center; background: linear-gradient(transparent, rgba(5, 8, 16, .92) 65%); }
.tile .ph { display: grid; place-items: center; height: 100%; padding: 12px 10px 38px; text-align: center; font-weight: 600; }
.tile .ph b { display: block; font-size: 2.4rem; }
.tile .play { position: absolute; top: 8px; right: 8px; font-size: 1.3rem; }
.tile .tag { position: absolute; top: 8px; left: 8px; z-index: 2; margin: 0; background: rgba(5, 8, 16, .85); border: 1px solid var(--yellow); color: var(--yellow); border-radius: 3px; padding: 2px 7px; font-size: .55rem; opacity: 1; }

dialog#lightbox { border: var(--line); border-radius: 6px; background: #070d1c; color: var(--text); padding: 12px; max-width: min(92vw, 560px); width: 100%; box-shadow: 0 0 40px rgba(59, 231, 255, .25); }
dialog#lightbox::backdrop { background: rgba(2, 4, 10, .82); }
#lightbox-body img, #lightbox-body video { width: 100%; max-height: 75vh; object-fit: contain; border-radius: 6px; display: block; }
#lightbox-body p { text-align: center; margin: 8px 0 0; font-weight: 600; }
dialog .close { position: absolute; top: 8px; right: 8px; z-index: 2; width: 34px; height: 34px; border-radius: 4px; border: var(--line); background: rgba(5, 8, 16, .9); color: var(--cyan); font: inherit; font-weight: 700; cursor: pointer; }

/* ---------- barra inferior ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; gap: 2px;
  background: linear-gradient(0deg, rgba(5, 8, 16, .98), rgba(5, 8, 16, .82));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: var(--line); box-shadow: 0 -6px 24px rgba(59, 231, 255, .12);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.tabs a {
  position: relative; flex: 1; max-width: 112px; display: flex; flex-direction: column; align-items: center;
  text-decoration: none; font-family: var(--f-hud); font-size: .52rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--muted);
  padding: 5px 2px 4px; border-radius: 4px;
}
.tabs a span { font-size: 1.4rem; line-height: 1.25; filter: grayscale(1) brightness(.8); transition: transform .2s, filter .2s; }
.tabs a[aria-current="page"] { color: var(--cyan); background: rgba(59, 231, 255, .1); box-shadow: inset 0 2px 0 var(--cyan), 0 0 14px rgba(59, 231, 255, .18); }
.tabs a[aria-current="page"] span { filter: none; transform: translateY(-2px) scale(1.12); }
.tabs .dot { position: absolute; top: 3px; right: 24%; width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); animation: pulse 1.2s infinite; }

/* ---------- cumpleaños ---------- */
.locked-stage { text-align: center; padding-top: 10px; }
.countdown { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.countdown div { min-width: 70px; padding: 10px 6px; background: rgba(0, 0, 0, .4); border: var(--line); border-radius: 4px; box-shadow: var(--glow); }
.countdown b { display: block; font-family: var(--f-hud); font-size: 1.6rem; font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 0 12px var(--cyan); }
.countdown span { font-family: var(--f-hud); font-size: .55rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.levels { display: grid; gap: 16px; }
.level { position: relative; background: var(--panel); border: var(--line); border-radius: 4px; box-shadow: var(--glow); overflow: hidden; }
.level { scroll-margin-top: 48px; }
.level[data-state="locked"] { opacity: .5; box-shadow: none; }
.lv-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: linear-gradient(90deg, rgba(59, 231, 255, .2), transparent); border-bottom: var(--line); }
.level[data-state="done"] .lv-head { background: linear-gradient(90deg, rgba(53, 240, 178, .25), transparent); }
.level[data-state="locked"] .lv-head { background: none; border-bottom-width: 0; }
.level[data-state="done"] .lv-head { border-bottom-width: 0; }
.level[data-state="done"] .lv-body:not([hidden]) { border-top: var(--line); }
.lv-num { font-size: 2rem; }
.lv-head small { display: block; font-family: var(--f-hud); letter-spacing: .14em; text-transform: uppercase; font-size: .58rem; color: var(--cyan); }
.lv-head h3 { margin: 0; }
.lv-state { margin-left: auto; font-size: 1.4rem; font-weight: 700; color: var(--mint); }
.lv-body { padding: 18px 16px; text-align: center; }

.prog { height: 12px; border: var(--line); border-radius: 2px; background: rgba(0, 0, 0, .45); overflow: hidden; max-width: 260px; margin: 8px auto 0; }
.prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--gold), var(--red)); box-shadow: 0 0 12px var(--gold); transition: width .25s; }
.boom { display: inline-block; font-family: var(--f-hud); font-weight: 900; font-size: clamp(1.25rem, 6.4vw, 1.9rem); line-height: 1.15; background: linear-gradient(90deg, var(--gold), var(--red)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 14px rgba(255, 194, 74, .6)); animation: pop .6s cubic-bezier(.2, 1.6, .4, 1); }

.quiz-q { font-size: 1.3rem; font-weight: 700; margin-bottom: 14px; }
.quiz-count { font-family: var(--f-hud); letter-spacing: .12em; font-size: .6rem; color: var(--cyan); text-transform: uppercase; }
.opts { display: grid; gap: 10px; margin-bottom: 12px; }
.opt { font: inherit; font-weight: 600; font-size: 1.1rem; color: var(--text); background: rgba(59, 231, 255, .06); border: var(--line); border-radius: 4px; padding: 11px 14px; cursor: pointer; text-align: left; transition: background .15s, transform .1s; }
.opt:active { transform: scale(.985); background: rgba(59, 231, 255, .18); }
.opt.right { background: rgba(53, 240, 178, .22); border-color: var(--mint); box-shadow: 0 0 14px rgba(53, 240, 178, .35); }
.opt.wrong { background: rgba(255, 59, 78, .16); border-color: var(--red); animation: shake .4s; text-decoration: line-through; color: var(--muted); }
.opt:disabled { cursor: default; }

.scratch-wrap { position: relative; border: 1px solid rgba(255, 194, 74, .6); border-radius: 4px; overflow: hidden; background: rgba(5, 8, 16, .7); }
.scratch-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; transition: opacity .5s; }
.scratch-wrap canvas.gone { opacity: 0; pointer-events: none; }
.gift-reveal { padding: 18px; text-align: center; }
.gift-reveal img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 4px; border: var(--line); margin-bottom: 10px; }
.gift-reveal h3 { font-family: var(--f-hud); font-size: 1.1rem; color: var(--gold); }

.letter { text-align: left; background: rgba(255, 194, 74, .05); border: 1px dashed rgba(255, 194, 74, .6); border-radius: 4px; padding: 16px; margin-bottom: 14px; font-size: 1.15rem; }
.letter p { margin-bottom: .8em; }
.letter .sig { font-weight: 700; margin: 0; color: var(--gold); }
.letter video { width: 100%; border-radius: 4px; margin-top: 8px; }
.end-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.final3000 { font-family: var(--f-hud); font-weight: 900; font-size: clamp(1.4rem, 7vw, 2.1rem); margin: 6px 0 6px; background: linear-gradient(90deg, var(--gold), #fff, var(--gold)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 16px rgba(255, 194, 74, .7)); animation: shine 3s linear infinite; }

/* ---------- Los 14 · episodios (Friends) ---------- */
.plan {
  background: linear-gradient(160deg, #4b2e86, #281552);
  border: 2px solid var(--yellow); border-radius: 16px; overflow: hidden;
  box-shadow: 0 0 0 3px rgba(255, 210, 63, .12), 0 10px 26px rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.plan::before { display: none; }
.plan::after { /* puntitos del logo */
  content: ""; position: absolute; top: 12px; right: 14px; width: 68px; height: 12px;
  background:
    radial-gradient(circle at 6px 6px, #ff4d5a 5px, transparent 6px),
    radial-gradient(circle at 34px 6px, #ffd23f 5px, transparent 6px),
    radial-gradient(circle at 62px 6px, #3b8bff 5px, transparent 6px);
}
.plan .when { display: flex; flex-direction: column; gap: 2px; font-family: var(--f-hud); font-size: .56rem; letter-spacing: .13em; text-transform: uppercase; color: var(--yellow); margin-bottom: 8px; padding-right: 80px; }
.plan .when span:last-child { color: #fff; opacity: .85; }
.plan .title { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.plan .title .em { font-size: 2rem; }
.plan .title h3 { font-family: var(--f-fun); font-weight: 700; font-size: 1.3rem; margin: 0; }
.plan.next { box-shadow: 0 0 0 3px rgba(255, 210, 63, .2), 0 0 30px rgba(255, 210, 63, .3), 0 10px 26px rgba(0, 0, 0, .45); }
.plan.done { background: linear-gradient(160deg, #1d6a55, #0f3a33); border-color: var(--mint); }
.plan .check { display: flex; gap: 8px; align-items: center; font-weight: 700; margin-top: 10px; cursor: pointer; }
.plan .check input { width: 22px; height: 22px; accent-color: var(--mint); }
.group-title { font-family: var(--f-hud); font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; margin: 14px 0 -4px; }
.field { width: 100%; font: inherit; font-weight: 600; font-size: 1.1rem; color: var(--text); background: rgba(0, 0, 0, .35); border: 1px solid rgba(59, 231, 255, .45); border-radius: 4px; padding: 10px 12px; margin-top: 2px; }
.field::placeholder { color: var(--muted); }
.plan .field { border-color: rgba(255, 210, 63, .55); }
.field:focus { outline: none; box-shadow: 0 0 14px rgba(59, 231, 255, .4); }
.roulette { margin-top: 10px; text-align: center; border-color: rgba(255, 194, 74, .6); }
.roulette::before { --c: var(--gold); }
.roulette h2 { margin: 0 0 4px; font-size: .9rem; color: var(--gold); }
.roulette-out { background: rgba(0, 0, 0, .4); border: var(--line); border-radius: 4px; padding: 16px 12px; margin: 10px 0 14px; font-weight: 700; font-size: 1.15rem; min-height: 4.4em; display: grid; place-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0 4px; }
.chip { font: inherit; font-size: .95rem; font-weight: 700; color: var(--text); background: rgba(59, 231, 255, .06); border: 1px solid rgba(59, 231, 255, .4); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.chip[aria-pressed="true"] { background: rgba(255, 194, 74, .2); border-color: var(--gold); color: var(--gold); box-shadow: 0 0 12px rgba(255, 194, 74, .3); }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.log { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.log li { background: rgba(75, 46, 134, .35); border: 1px solid rgba(255, 210, 63, .45); border-radius: 8px; padding: 8px 12px; }

/* ---------- cupones ---------- */
.vouchers { display: grid; gap: 14px; }
.ticket { position: relative; display: grid; grid-template-columns: 84px 1fr; overflow: hidden; background: var(--panel); border: var(--line); border-radius: 4px; box-shadow: var(--glow); }
.ticket .stub { display: grid; place-items: center; font-size: 2.5rem; background: radial-gradient(circle, rgba(59, 231, 255, .28), transparent 70%); border-right: 2px dashed rgba(59, 231, 255, .5); }
.ticket:nth-child(3n+2) .stub { background: radial-gradient(circle, rgba(255, 194, 74, .28), transparent 70%); }
.ticket:nth-child(3n) .stub { background: radial-gradient(circle, rgba(255, 111, 165, .28), transparent 70%); }
.ticket .main { padding: 12px 14px; }
.ticket .main h3 { font-family: var(--f-hud); font-size: .92rem; letter-spacing: .04em; margin-bottom: 3px; }
.ticket .main p { color: var(--muted); font-size: 1.02rem; margin-bottom: 10px; }
.ticket.used .main, .ticket.used .stub { opacity: .4; }
.ticket.used .main { padding-right: 140px; }
.stamp { position: absolute; right: 12px; top: 50%; transform: translateY(-50%) rotate(-12deg); border: 3px solid var(--red); color: var(--red); font-family: var(--f-hud); font-weight: 900; font-size: .85rem; letter-spacing: .1em; padding: 4px 10px; border-radius: 4px; background: rgba(5, 8, 16, .8); box-shadow: 0 0 14px rgba(255, 59, 78, .45); animation: pop .4s cubic-bezier(.2, 1.6, .4, 1); text-align: center; line-height: 1.15; }
.stamp small { display: block; font-family: var(--f-body); font-weight: 700; font-size: .75rem; color: var(--red); letter-spacing: 0; }

/* ---------- fechas ---------- */
.date-row { display: flex; gap: 14px; align-items: center; }
.date-row .em { font-size: 2.1rem; }
.date-row .info { flex: 1; min-width: 0; }
.date-row .info b { display: block; font-size: 1.15rem; }
.date-row .info small { display: block; font-size: 1rem; }
.date-row .left { text-align: center; min-width: 76px; padding: 6px 8px; background: rgba(59, 231, 255, .08); border: var(--line); border-radius: 4px; font-family: var(--f-hud); font-weight: 700; font-size: 1.15rem; line-height: 1.1; }
.date-row .left small { display: block; font-family: var(--f-body); color: var(--muted); font-weight: 600; font-size: .8rem; }
.date-row.soon .left { background: rgba(255, 59, 78, .2); border-color: var(--red); color: #fff; box-shadow: 0 0 14px rgba(255, 59, 78, .4); animation: glow 1.8s infinite; }

/* ---------- confeti y efectos de pantalla ---------- */
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
.ripple { position: fixed; z-index: 60; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid var(--cyan); box-shadow: 0 0 14px var(--cyan), inset 0 0 8px var(--cyan); pointer-events: none; animation: rip .65s ease-out forwards; }
.flash { position: fixed; inset: 0; z-index: 70; pointer-events: none; background: radial-gradient(circle at 50% 45%, #fff 0, rgba(255, 214, 120, .9) 18%, rgba(59, 231, 255, .5) 45%, transparent 75%); animation: flash .7s ease-out forwards; }
.wipe { position: fixed; left: 0; right: 0; top: 0; height: 100%; z-index: 40; pointer-events: none; background: linear-gradient(180deg, transparent 0, rgba(59, 231, 255, .0) 45%, rgba(59, 231, 255, .28) 50%, transparent 55%); animation: wipe .55s ease-in-out forwards; }

/* ---------- candado ---------- */
body.locked #app, body.locked .tabs { display: none; }
#gate { max-width: 480px; margin: 0 auto; padding: 56px 16px 28px; min-height: 100dvh; display: grid; align-content: center; }
.gate-loading { text-align: center; font-weight: 700; font-family: var(--f-hud); font-size: .8rem; letter-spacing: .14em; }
.gate-card { text-align: center; padding: 20px 16px 18px; }
.gate-top { position: relative; width: 178px; height: 178px; margin: 0 auto 8px; }
.gate-cells { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.gate-cells circle { fill: none; stroke: rgba(138, 163, 194, .3); stroke-width: 3.2; transition: stroke .3s, filter .3s; }
.gate-cells circle.ok { stroke: var(--cyan); filter: drop-shadow(0 0 5px var(--cyan)); }
.gate-cells circle.ko { stroke: var(--red); filter: drop-shadow(0 0 5px var(--red)); }
.gate-reactor { position: absolute; inset: 17%; filter: saturate(.5) brightness(.7); transition: filter .6s; }
.gate-card.some .gate-reactor { filter: saturate(.9) brightness(.95); }
.gate-card.powerup .gate-reactor { filter: saturate(1.4) brightness(1.4); animation: powerup .9s ease-out; }
.gate-card h1 { font-size: 1.35rem; margin-bottom: .2em; }
.gate-status { font-family: var(--f-hud); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); min-height: 1.4em; margin: 0; }
.gate-status.bad { color: var(--red); }
.gate-status.good { color: var(--mint); }
.gate-card form { text-align: left; margin-top: 12px; display: grid; gap: 14px; }
.gq label { display: block; font-weight: 700; margin-bottom: 5px; }
.gq input[type="text"] { width: 100%; font: inherit; font-weight: 600; font-size: 1.1rem; color: var(--text); background: rgba(0, 0, 0, .4); border: 1px solid rgba(59, 231, 255, .45); border-radius: 4px; padding: 10px 12px; }
.gq input[type="text"]:focus { outline: none; box-shadow: 0 0 14px rgba(59, 231, 255, .45); }
.gq .fb { display: block; min-height: 1.1em; font-weight: 700; margin-top: 4px; color: var(--red); }
.gq.ok input { border-color: var(--mint); background: rgba(53, 240, 178, .1); }
.gq.ok .fb { color: var(--mint); }
.gq.ko input { border-color: var(--red); background: rgba(255, 59, 78, .1); animation: shake .4s; }
.hintbtn { font: inherit; font-size: .95rem; font-weight: 700; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; color: var(--muted); }
.hint { display: block; background: rgba(255, 194, 74, .15); border: 1px solid var(--gold); border-radius: 4px; padding: 6px 10px; color: var(--gold); font-weight: 600; }
.remember { display: flex; gap: 8px; align-items: center; font-size: 1rem; color: var(--muted); font-weight: 600; }
.remember input { width: 20px; height: 20px; accent-color: var(--cyan); }
.gate-card .btn { width: 100%; text-align: center; }
.gate-card .msg { text-align: center; margin: 0; }

/* ---------- arranque tipo consola ---------- */
#boot { position: fixed; inset: 0; z-index: 100; background: #02040a; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 24px; transition: opacity .45s; }
#boot.out { opacity: 0; }
.boot-reactor { width: 120px; height: 120px; }
.boot-log { margin: 0; width: min(92vw, 420px); min-height: 7.4em; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .85rem; line-height: 1.55; color: var(--cyan); white-space: pre-wrap; text-shadow: 0 0 8px rgba(59, 231, 255, .6); }
.boot-bar { width: min(92vw, 420px); height: 4px; background: rgba(59, 231, 255, .15); border-radius: 2px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--gold)); box-shadow: 0 0 10px var(--cyan); transition: width .3s; }
.boot-skip { margin: 0; font-size: .8rem; color: var(--muted); }

/* ---------- animaciones ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-rev { to { transform: rotate(-360deg); } }
@keyframes corepulse { 0%, 100% { opacity: .75; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 8px rgba(255, 59, 78, .3); } 50% { box-shadow: 0 0 20px rgba(255, 59, 78, .7); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }
@keyframes shine { to { background-position: -200% 0; } }
@keyframes rip { to { transform: scale(9); opacity: 0; } }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes wipe { from { transform: translateY(-100%); } to { transform: translateY(100%); } }
@keyframes powerup { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes hudin { from { opacity: 0; transform: translateY(10px); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
.view:not([hidden]) { animation: hudin .35s ease-out; }
.stack > *, .vouchers > *, .profile dl > div { animation: hudin .5s ease-out backwards; }
.stack > *:nth-child(2), .vouchers > *:nth-child(2) { animation-delay: .06s; }
.stack > *:nth-child(3), .vouchers > *:nth-child(3) { animation-delay: .12s; }
.stack > *:nth-child(4), .vouchers > *:nth-child(4) { animation-delay: .18s; }
.stack > *:nth-child(n+5), .vouchers > *:nth-child(n+5) { animation-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .spark .line { stroke-dashoffset: 0; }
  .spark .end { opacity: 1; }
}
