/* Playground · tema cyberpunk
   Base casi negra con tinte azul, un acento de acción (lima), cian para líneas y magenta para peligro.
   Tipos: Chakra Petch (titulares y etiquetas), Barlow (texto), JetBrains Mono (números y códigos). */
:root {
  --bg: #06070d; --bg-2: #0a0c17; --panel: #0e1120; --panel-2: #151a31; --panel-3: #1d2442;
  --line: #243155; --ink: #e8ecff; --muted: #9aa6cf;
  --lime: #c8ff2e; --on-lime: #101800; --cyan: #27f3ff; --magenta: #ff2e93; --amber: #ffc83d;
  --font-head: 'Chakra Petch', system-ui, sans-serif; --font-body: 'Barlow', system-ui, sans-serif; --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --cut: 14px; --gutter: 16px;
  --shape: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  --shape-in: polygon(0 0, calc(100% - var(--cut) + 1px) 0, 100% calc(var(--cut) - 1px), 100% 100%, calc(var(--cut) - 1px) 100%, 0 calc(100% - var(--cut) + 1px));
  --z-grid: 0; --z-content: 1; --z-nav: 20; --z-toast: 40; --z-fx: 50;
  --glow-cyan: 0 0 10px rgba(39, 243, 255, .55); --glow-lime: 0 0 12px rgba(200, 255, 46, .5); --glow-mag: 0 0 12px rgba(255, 46, 147, .55);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5; }
body { min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); position: relative; overflow-x: hidden;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(255, 46, 147, .14), transparent 60%),
    radial-gradient(800px 500px at 0% 0%, rgba(39, 243, 255, .12), transparent 60%),
    var(--bg); }
body.in-room { padding-bottom: calc(24px + env(safe-area-inset-bottom)); overscroll-behavior-y: contain; }
body { -webkit-tap-highlight-color: transparent; }
button, .btn, .option, a, label, summary { touch-action: manipulation; }
/* Rejilla y scanlines: puramente decorativas */
body::before { content: ''; position: fixed; inset: 0; z-index: var(--z-grid); pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(39, 243, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(39, 243, 255, .06) 1px, transparent 1px);
  background-size: 48px 48px; -webkit-mask-image: linear-gradient(to bottom, #000 0, transparent 70%); mask-image: linear-gradient(to bottom, #000 0, transparent 70%); }
body::after { content: ''; position: fixed; inset: 0; z-index: var(--z-fx); pointer-events: none; opacity: .5; mix-blend-mode: overlay;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .35) 0 1px, transparent 1px 3px); }
#topbar, main, #tabbar, #roombar { position: relative; z-index: var(--z-content); }

h1, h2, h3 { font-family: var(--font-head); margin: 0 0 .45em; line-height: 1.05; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 8vw, 4rem); font-weight: 700; letter-spacing: -.02em; text-transform: uppercase; }
h2 { font-size: 1.3rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 .8em; text-wrap: pretty; max-width: 68ch; }
a { color: var(--cyan); }
.muted { color: var(--muted); }
.small, .eyebrow { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); font-weight: 500; }
.small::before { content: '// '; color: var(--magenta); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--lime); color: var(--on-lime); padding: 8px 14px; font-family: var(--font-head); font-weight: 700; }
.skip:focus { top: 8px; }

/* Barra superior */
#topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) var(--gutter) 12px; max-width: 1040px; margin: 0 auto; }
.brand { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); text-decoration: none; background: none; border: 0; padding: 0; position: relative; }
.brand b { color: var(--lime); text-shadow: var(--glow-lime); }
.brand:hover { animation: glitch .45s steps(2) 1; }
.topnav { display: flex; align-items: center; gap: 2px; }
.topnav a.link { font-family: var(--font-head); font-weight: 600; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-decoration: none; padding: 8px 12px; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.topnav a.link:hover { color: var(--ink); }
.topnav a.link[aria-current='page'] { color: var(--lime); border-color: var(--lime); text-shadow: var(--glow-lime); }
.music { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.music input[type=range] { width: 72px; margin: 0; min-height: 0; padding: 0; }
@media (max-width: 720px) { .topnav a.link { display: none; } .music input[type=range] { width: 56px; } }

/* Barra inferior (móvil) */
#tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav); display: none; background: rgba(6, 7, 13, .92); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
#tabbar a { overflow: hidden; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px 8px; color: var(--muted); text-decoration: none; font-family: var(--font-head); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; min-height: 56px; position: relative; }
#tabbar a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#tabbar a[aria-current='page'] { color: var(--lime); }
#tabbar a[aria-current='page']::before { content: ''; position: absolute; top: -1px; left: 25%; right: 25%; height: 2px; background: var(--lime); box-shadow: var(--glow-lime); }
@media (max-width: 720px) { #tabbar { display: flex; } body.in-room #tabbar { display: none; } }

/* Barra de sala (durante la partida) */
#roombar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px; max-width: 1040px; margin: 0 auto; }
.chip { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .14em; padding: 5px 10px; border: 1px solid var(--cyan); color: var(--cyan); text-shadow: var(--glow-cyan); }
.chip b { color: var(--lime); }

main { max-width: 1040px; margin: 0 auto; padding: 8px max(var(--gutter), env(safe-area-inset-right)) 40px max(var(--gutter), env(safe-area-inset-left)); }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); background: none; padding: 6px 0; min-height: 36px; font-family: var(--font-head); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; clip-path: none; }
.back:hover { color: var(--cyan); background: none; filter: none; }

/* Botones */
button, .btn { overflow: hidden; font: inherit; font-family: var(--font-head); font-weight: 700; font-size: .92rem; letter-spacing: .08em; text-transform: uppercase; border: 0; padding: 12px 20px; cursor: pointer; background: var(--lime); color: var(--on-lime); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); transition: transform .12s, filter .15s, background .15s, color .15s; position: relative; }
button:hover, .btn:hover { filter: brightness(1.12) saturate(1.1); transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(1px) scale(.98); }
button:disabled { opacity: .4; cursor: not-allowed; transform: none; filter: grayscale(.4); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
button.ghost:hover, .btn.ghost:hover { color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }
button.alt, .btn.alt { background: var(--panel-3); color: var(--ink); }
button.violet, .btn.violet { background: var(--cyan); color: #00262a; }
button.danger, .btn.danger { background: transparent; color: var(--magenta); box-shadow: inset 0 0 0 1px var(--magenta); }
button.danger:hover { background: rgba(255, 46, 147, .12); }
button.small-btn, .btn.small-btn { padding: 6px 12px; min-height: 36px; font-size: .78rem; }
.btn.wide, button.wide { width: 100%; }

/* Campos */
input, textarea, select { width: 100%; font: inherit; color: var(--ink); background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--cyan); padding: 11px 12px; margin: 4px 0 14px; min-height: 46px; border-radius: 0; transition: border-color .2s, box-shadow .2s; }
input:hover, select:hover { border-color: #34457a; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: var(--glow-cyan); outline: none; }
input::placeholder { color: #5f6c96; }
input[type=range] { padding: 0; min-height: 28px; border: 0; accent-color: var(--lime); background: transparent; }
label { font-family: var(--font-mono); font-weight: 500; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.err { color: var(--magenta); min-height: 1.3em; font-family: var(--font-mono); font-size: .85rem; }
.field-error { border-left-color: var(--magenta); }

/* Paneles: esquinas cortadas con borde en degradado */
.card, .game-card, .qedit { --cut: 14px; position: relative; isolation: isolate; padding: 20px; margin: 16px 0; background: transparent; clip-path: var(--shape); }
.card::before, .game-card::before, .qedit::before { content: ''; position: absolute; inset: 0; z-index: -2; background: linear-gradient(135deg, var(--cyan), var(--line) 30%, var(--line) 70%, var(--magenta)); clip-path: var(--shape); }
.card::after, .game-card::after, .qedit::after { content: ''; position: absolute; inset: 1px; z-index: -1; background: linear-gradient(180deg, var(--panel), var(--bg-2)); clip-path: var(--shape-in); }
.card h2:first-child { margin-top: 0; }
.game-card.quiz::before { background: linear-gradient(135deg, var(--lime), var(--line) 35%); }
.game-card.draw::before { background: linear-gradient(135deg, var(--magenta), var(--line) 35%); }
.game-card { display: flex; flex-direction: column; gap: 10px; }
.qcard { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.qcard .row:last-child { margin-top: auto; }
.qcard .meta { color: var(--muted); font-size: .9rem; }
.qedit { padding: 14px; margin: 0 0 12px; --cut: 10px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; } .row.center { justify-content: center; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid > .card, .grid > .game-card { margin: 0; }
.stack > * + * { margin-top: 12px; }
.pill { display: inline-block; padding: 2px 9px; background: transparent; border: 1px solid var(--line); font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pill.hot { border-color: var(--magenta); color: var(--magenta); }

/* Portada */
.hero { padding: 36px 0 12px; max-width: 760px; }
.hero.center { text-align: center; margin: 0 auto; }
.hero h1 span { color: var(--cyan); text-shadow: var(--glow-cyan); }
.hero h1 { text-shadow: 2px 0 rgba(255, 46, 147, .5), -2px 0 rgba(39, 243, 255, .35); }
.hero p { color: var(--muted); font-size: 1.1rem; }
.hero .row { margin-top: 18px; }
.hero.center p { margin-left: auto; margin-right: auto; } .hero.center .row { justify-content: center; }
.split { display: grid; gap: 14px; grid-template-columns: 1.05fr .95fr; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: baseline; color: var(--muted); }
.steps li::before { content: '0' counter(s); font-family: var(--font-mono); color: var(--magenta); font-weight: 700; }
.steps b { color: var(--ink); }

/* Sala */
.code { font-family: var(--font-mono); font-weight: 700; font-size: clamp(2.6rem, 13vw, 5rem); letter-spacing: .2em; color: var(--lime); text-shadow: var(--glow-lime); text-align: center; padding: 6px 0 6px .2em; user-select: all; }
.players { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.player { background: var(--panel-2); padding: 10px 6px; text-align: center; position: relative; font-weight: 600; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%); animation: rise .35s both; }
.player .name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-head); font-size: .9rem; margin-top: 4px; }
.player.off { opacity: .4; filter: grayscale(.8); } .player .crown { position: absolute; top: 4px; right: 12px; }

/* Robots */
.bot { width: 72px; height: 72px; display: block; margin: 0 auto; overflow: visible; filter: drop-shadow(0 0 8px rgba(39, 243, 255, .28)); }
.bot.lg { width: 140px; height: 140px; } .bot.sm { width: 40px; height: 40px; filter: none; }
.bot .float { animation: bob 3s ease-in-out infinite; transform-origin: 50% 80%; transform-box: fill-box; }
.bot .tip { animation: wobble 2.4s ease-in-out infinite; transform-origin: 50% 100%; transform-box: fill-box; }
.bot .lid { animation: blink 4.2s infinite; transform-origin: center; transform-box: fill-box; }
.bot .arm-l { animation: wave 2.8s ease-in-out infinite; transform-origin: 100% 0; transform-box: fill-box; }
.bot.happy .float { animation: hop .6s ease-in-out infinite; }
.bot.sad .float { animation: none; transform: translateY(2px) rotate(-3deg); }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes hop { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-10px); } }
@keyframes wobble { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes blink { 0%,92%,100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes wave { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-14deg); } }

/* Personalizador */
.picker { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.picker .lbl { flex: 1; font-family: var(--font-head); font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; }
.picker button { min-height: 38px; padding: 4px 14px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; padding: 0; min-height: 34px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); box-shadow: none; }
.swatch.on { outline: 2px solid var(--ink); outline-offset: 1px; }

/* Juego */
.hud { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 6px 0 12px; }
.timer { font-family: var(--font-mono); font-weight: 700; font-size: 2.4rem; color: var(--lime); text-shadow: var(--glow-lime); min-width: 2.4ch; text-align: right; font-variant-numeric: tabular-nums; }
.timer.low { color: var(--magenta); text-shadow: var(--glow-mag); animation: pulse .6s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.bar { height: 6px; background: var(--panel-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--lime)); box-shadow: var(--glow-cyan); transition: width .2s linear; }
.question { font-size: clamp(1.4rem, 5vw, 2.1rem); text-transform: none; letter-spacing: -.01em; }
.options { display: grid; gap: 10px; margin-top: 14px; }
@media (min-width: 640px) { .options { grid-template-columns: 1fr 1fr; } }
.option { overflow: hidden; background: var(--panel-2); color: var(--ink); text-align: left; justify-content: flex-start; padding: 16px; font-family: var(--font-body); font-weight: 600; font-size: 1.05rem; letter-spacing: 0; text-transform: none; min-height: 56px; box-shadow: inset 3px 0 0 var(--cyan); }
.option b { color: var(--cyan); font-family: var(--font-mono); }
.option:hover:not(:disabled) { background: var(--panel-3); }
.option.picked { box-shadow: inset 0 0 0 2px var(--lime), var(--glow-lime); }
.option.right { background: rgba(200, 255, 46, .14); box-shadow: inset 0 0 0 2px var(--lime); }
.option.wrong { background: rgba(255, 46, 147, .14); box-shadow: inset 0 0 0 2px var(--magenta); }
.qimg { display: block; max-height: 260px; max-width: 100%; margin: 0 auto 14px; object-fit: contain; background: var(--bg); border: 1px solid var(--line); }
.powers { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.powers button { background: var(--panel-3); color: var(--ink); font-size: .8rem; }
.powers button:not(:disabled):hover { color: var(--amber); }
.board { list-style: none; margin: 0; padding: 0; }
.board li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--panel-2); margin-bottom: 6px; animation: rise .35s both; }
.board li:first-child { background: rgba(200, 255, 46, .12); box-shadow: inset 3px 0 0 var(--lime); }
.board .pos { font-family: var(--font-mono); font-weight: 700; width: 2ch; color: var(--lime); }
.board .nm { flex: 1; font-weight: 600; min-width: 0; }
.board .pts { font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; }
.board .delta { color: var(--lime); font-family: var(--font-mono); font-size: .85rem; }
.announce { background: rgba(255, 46, 147, .14); border-left: 3px solid var(--magenta); padding: 10px 14px; margin: 10px 0; font-weight: 600; animation: rise .3s both; }

/* Dibujo */
.canvas-wrap { position: relative; background: #fff; overflow: hidden; touch-action: none; aspect-ratio: 4 / 3; width: 100%; max-height: 62vh; box-shadow: 0 0 0 1px var(--cyan), 0 0 24px rgba(39, 243, 255, .25); }
.canvas-wrap canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.canvas-wrap.locked canvas { cursor: default; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.tools .swatch { width: 30px; height: 30px; min-height: 30px; }
.tools input[type=range] { width: 110px; margin: 0; }
.mask { font-family: var(--font-mono); font-weight: 700; font-size: clamp(1.4rem, 6vw, 2.2rem); letter-spacing: .25em; text-align: center; color: var(--cyan); text-shadow: var(--glow-cyan); margin-bottom: 8px; }
.secret { font-family: var(--font-head); font-weight: 700; font-size: 2rem; text-transform: uppercase; color: var(--lime); text-shadow: var(--glow-lime); text-align: center; margin-bottom: 8px; }
.chat { max-height: 180px; overflow: auto; background: var(--bg); padding: 8px 10px; margin: 10px 0; font-size: .95rem; border: 1px solid var(--line); }
.chat .ok { color: var(--lime); font-weight: 700; } .chat .who { color: var(--cyan); font-weight: 600; font-family: var(--font-mono); font-size: .85rem; }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 18px 0; }
.podium > div { text-align: center; background: var(--panel-2); padding: 10px 10px 8px; width: 30%; max-width: 160px; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); animation: rise .5s both; }
.podium .p1 { min-height: 190px; background: rgba(200, 255, 46, .14); box-shadow: inset 0 3px 0 var(--lime); } .podium .p2 { min-height: 160px; box-shadow: inset 0 3px 0 var(--cyan); } .podium .p3 { min-height: 140px; box-shadow: inset 0 3px 0 var(--magenta); }
.podium b { font-family: var(--font-head); }
.tbl { width: 100%; border-collapse: collapse; } .tbl td, .tbl th { padding: 9px 6px; text-align: left; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--cyan); font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 500; }
.tbl td:nth-child(n+3) { font-family: var(--font-mono); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.tabs button, .tabs .btn { background: var(--panel-2); color: var(--muted); font-size: .8rem; }
.tabs button.on { background: var(--lime); color: var(--on-lime); }
.qedit .opt { display: flex; gap: 8px; align-items: center; } .qedit .opt input[type=text] { margin: 4px 0; } .qedit .opt input[type=radio] { width: 22px; min-height: 22px; margin: 0; accent-color: var(--lime); }

/* Estados: carga, vacío, error */
.skeleton { background: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-3) 50%, var(--panel-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; min-height: 110px; clip-path: var(--shape); }
.skeleton.line { min-height: 16px; clip-path: none; margin: 8px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty .big { font-family: var(--font-mono); color: var(--magenta); font-size: 2.4rem; display: block; }
.confirm-row { display: flex; gap: 6px; align-items: center; }

#toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--panel-3); border-left: 3px solid var(--cyan); padding: 11px 18px; opacity: 0; pointer-events: none; transition: .25s; z-index: var(--z-toast); max-width: 90vw; font-weight: 600; }
body.in-room #toast { bottom: 24px; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { border-left-color: var(--magenta); }

/* Entrada escalonada */
main > *, #app > * { animation: rise .4s both; }
main > *:nth-child(2) { animation-delay: .06s; } main > *:nth-child(3) { animation-delay: .12s; } main > *:nth-child(4) { animation-delay: .18s; }
.grid > *:nth-child(2) { animation-delay: .06s; } .grid > *:nth-child(3) { animation-delay: .12s; } .grid > *:nth-child(4) { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes glitch { 0% { transform: translate(0); } 25% { transform: translate(-2px, 1px); text-shadow: 2px 0 var(--magenta); } 50% { transform: translate(2px, -1px); text-shadow: -2px 0 var(--cyan); } 100% { transform: translate(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Cuenta atrás entre rondas */
.countdown { text-align: center; padding: 36px 20px; }
.cd-num { font-family: var(--font-mono); font-weight: 700; font-size: clamp(6rem, 28vw, 11rem); line-height: 1; color: var(--lime); text-shadow: var(--glow-lime), 0 0 40px rgba(200, 255, 46, .35); font-variant-numeric: tabular-nums; animation: beat 1s infinite; }
.cd-num.low { color: var(--magenta); text-shadow: var(--glow-mag); }
@keyframes beat { 0% { transform: scale(1.08); } 30% { transform: scale(1); } }

/* Marcador lateral */
.game-layout.with-side { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) 270px; align-items: start; }
.game-layout .side { position: sticky; top: 12px; margin: 16px 0; padding: 16px; }
.side h2 { font-size: 1rem; margin-bottom: 6px; }
.leader { margin: 0 0 10px; font-size: .9rem; color: var(--amber); }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.side-list li { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--panel-2); overflow: hidden; }
.side-list li.me { box-shadow: inset 0 0 0 1px var(--cyan); }
.side-list li.lead { background: rgba(200, 255, 46, .12); box-shadow: inset 3px 0 0 var(--lime); }
.side-list li.off { opacity: .4; }
.side-list .pos { font-family: var(--font-mono); font-weight: 700; color: var(--lime); width: 1.6ch; }
.side-list .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .92rem; }
.side-list .pts { font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; }
.side-list .mark { font-size: .85rem; } .side-list .mark.ok { color: var(--lime); }
.side-list .fill { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--cyan); box-shadow: var(--glow-cyan); transition: width .5s; }
.side-gap { margin: 10px 0 0; }
@media (max-width: 860px) {
  .game-layout.with-side { grid-template-columns: 1fr; }
  .game-layout .side { position: static; order: -1; margin: 8px 0 0; padding: 10px; }
  .side h2, .side .side-gap { display: none; }
  .leader { margin-bottom: 8px; }
  .side-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .side-list li { flex: 0 0 auto; min-width: 120px; }
}

/* ===================== Móvil ===================== */
.game-layout, .game-layout > * { min-width: 0; }
.game-layout.with-side { grid-template-columns: minmax(0, 1fr) 270px; }
@media (max-width: 860px) {
  .game-layout.with-side { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .game-layout .side { padding: 8px; }
  .side h2, .side .leader, .side .side-gap { display: none; }
  .side-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .side-list::-webkit-scrollbar { display: none; }
  .side-list li { flex: 0 0 auto; min-width: 0; padding: 5px 9px 7px; scroll-snap-align: start; }
  .side-list .nm { max-width: 9ch; font-size: .85rem; }
  .side-list .pos { display: none; }
  .side-list li.lead .nm::before { content: '👑 '; }
}
@media (max-width: 720px) {
  #roombar { flex-wrap: nowrap; gap: 6px; }
  #roombar .vol { display: none; }
  #roombar .small { display: none; }
  .chip { font-size: .78rem; padding: 4px 8px; white-space: nowrap; }
  h1 { letter-spacing: -.01em; }
  .hero { padding-top: 22px; }
  .card, .game-card { padding: 16px; margin: 12px 0; }
  .timer { font-size: 2rem; }
  .hud { margin-top: 0; }
  .question { font-size: 1.35rem; }
  .option { padding: 15px 14px; }
  .powers { display: grid; grid-template-columns: repeat(3, 1fr); }
  .powers button { padding: 10px 6px; font-size: .7rem; letter-spacing: .04em; min-height: 48px; flex-direction: column; gap: 2px; }
  .podium > div { padding: 8px 6px; }
  .canvas-wrap { max-height: 52dvh; }
  .tools { gap: 6px; }
  .tools input[type=range] { flex: 1; min-width: 90px; }
  .players { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .row.sticky-actions { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 5; justify-content: center; padding: 10px; background: linear-gradient(180deg, rgba(6, 7, 13, 0), rgba(6, 7, 13, .96) 30%); backdrop-filter: blur(6px); margin: 0 calc(var(--gutter) * -1); }
  .row.sticky-actions .ghost[data-act=leave] { display: none; }
  .row.sticky-actions .btn, .row.sticky-actions button { flex: 1 1 auto; }
}
@media (pointer: coarse) {
  button.small-btn, .btn.small-btn { min-height: 44px; padding: 8px 14px; }
  .picker button { min-height: 44px; min-width: 48px; }
  .swatch { width: 40px; height: 40px; min-height: 40px; }
  .tools .swatch { width: 38px; height: 38px; min-height: 38px; }
  .tabs button, .tabs .btn { min-height: 44px; }
  .topnav a.link { padding: 12px; }
  .qedit .opt input[type=radio] { width: 28px; min-height: 28px; }
  input, select, textarea { font-size: 16px; }
}
input[type=range] { -webkit-appearance: none; appearance: none; height: 32px; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; background: var(--panel-3); border-radius: 0; box-shadow: inset 0 0 0 1px var(--line); }
input[type=range]::-moz-range-track { height: 6px; background: var(--panel-3); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; background: var(--lime); border: 2px solid var(--bg); box-shadow: var(--glow-lime); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; background: var(--lime); border: 2px solid var(--bg); border-radius: 0; }

/* ===================== Fondo vivo ===================== */
.orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orbs i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(80px); opacity: .22; will-change: transform; }
.orbs i:nth-child(1) { background: var(--cyan); left: -25vmax; top: -30vmax; animation: drift1 28s ease-in-out infinite alternate; }
.orbs i:nth-child(2) { background: var(--magenta); right: -30vmax; bottom: -35vmax; animation: drift2 34s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(18vmax, 14vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-16vmax, -12vmax) scale(1.1); } }

/* ===================== Efectos de interacción ===================== */
.rip { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: rgba(255, 255, 255, .55); pointer-events: none; animation: ripple .6s ease-out forwards; }
@keyframes ripple { to { transform: scale(26); opacity: 0; } }
button, .btn, .option { position: relative; }
.card { --mx: 50%; --my: 0%; }
@media (hover: hover) and (pointer: fine) {
  .card::after { background: radial-gradient(260px circle at var(--mx) var(--my), rgba(39, 243, 255, .10), transparent 65%), linear-gradient(180deg, var(--panel), var(--bg-2)); }
  .qcard, .game-card { transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
  .qcard:hover, .game-card:hover { transform: translateY(-3px); }
}
.qcard::before { background: linear-gradient(135deg, var(--accent, var(--cyan)), var(--line) 35%, var(--line) 70%, var(--accent, var(--cyan))); }
.qcard .pill { border-color: var(--accent, var(--line)); color: var(--accent, var(--muted)); }
.hero .btn:first-child { animation: cta 2.6s ease-in-out infinite; }
@keyframes cta { 50% { filter: brightness(1.15); box-shadow: 0 0 26px rgba(200, 255, 46, .45); } }

/* Barra inferior: indicador que se desliza + icono que rebota */
#tabbar { --i: 0; }
#tabbar .ink { position: absolute; top: -1px; left: 0; width: 25%; height: 2px; background: var(--lime); box-shadow: var(--glow-lime), 0 6px 18px rgba(200, 255, 46, .35); transform: translateX(calc(var(--i) * 100%)); transition: transform .45s cubic-bezier(.3, 1.35, .5, 1); pointer-events: none; }
#tabbar a[aria-current='page']::before { display: none; }
#tabbar a[aria-current='page'] svg { animation: tabpop .45s cubic-bezier(.3, 1.6, .5, 1); filter: drop-shadow(0 0 6px rgba(200, 255, 46, .6)); }
@keyframes tabpop { 0% { transform: translateY(6px) scale(.8); } 60% { transform: translateY(-3px) scale(1.15); } 100% { transform: none; } }
.topnav a.link { position: relative; border-bottom: 0; }
.topnav a.link::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: var(--lime); box-shadow: var(--glow-lime); transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.3, 1, .4, 1); }
.topnav a.link:hover::after, .topnav a.link[aria-current='page']::after { transform: scaleX(1); }

/* Transición entre pantallas (View Transitions) con dirección */
#topbar { view-transition-name: topbar; } #tabbar { view-transition-name: tabbar; } #roombar { view-transition-name: roombar; }
::view-transition-old(root) { animation: vt-out .22s ease-in both; }
::view-transition-new(root) { animation: vt-in .38s cubic-bezier(.2, .9, .2, 1) both; }
html[data-nav='back']::view-transition-old(root) { animation-name: vt-out-r; }
html[data-nav='back']::view-transition-new(root) { animation-name: vt-in-r; }
@keyframes vt-in { from { opacity: 0; transform: translateX(34px); filter: blur(5px); } }
@keyframes vt-out { to { opacity: 0; transform: translateX(-34px); filter: blur(5px); } }
@keyframes vt-in-r { from { opacity: 0; transform: translateX(-34px); filter: blur(5px); } }
@keyframes vt-out-r { to { opacity: 0; transform: translateX(34px); filter: blur(5px); } }

/* Portada: cinta y cuadrilla de robots */
.ticker { overflow: hidden; border-block: 1px solid var(--line); margin: 6px calc(var(--gutter) * -1) 4px; background: rgba(14, 17, 32, .6); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker > div { display: flex; width: max-content; animation: marquee 26s linear infinite; }
.ticker span { padding: 9px 22px; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.ticker span:nth-child(3n+1) { color: var(--cyan); } .ticker span:nth-child(3n+2) { color: var(--lime); } .ticker span:nth-child(3n) { color: var(--magenta); }
@keyframes marquee { to { transform: translateX(-50%); } }
.crew { display: flex; align-items: center; margin-top: 18px; }
.crew .bot { width: 54px; height: 54px; margin: 0 -12px 0 0; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); animation: rise .5s both; }
.crew .bot:nth-child(2) { animation-delay: .08s; } .crew .bot:nth-child(3) { animation-delay: .16s; } .crew .bot:nth-child(4) { animation-delay: .24s; }
.crew .more { padding: 4px 8px; background: rgba(6, 7, 13, .75); margin-left: 22px; font-family: var(--font-mono); font-size: .8rem; color: var(--muted); letter-spacing: .08em; }

/* Cuenta atrás con anillo */
.ring { position: relative; width: min(260px, 68vw); aspect-ratio: 1; margin: 8px auto 12px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring .trk { fill: none; stroke: var(--panel-3); stroke-width: 5; }
.ring .arc { fill: none; stroke: var(--lime); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; filter: drop-shadow(0 0 6px var(--lime)); transition: stroke-dashoffset .2s linear; }
.ring .cd-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(4.5rem, 22vw, 8rem); }
.ring.low .arc { stroke: var(--magenta); filter: drop-shadow(0 0 6px var(--magenta)); }

/* Destellos de resultado y confeti */
.flash { position: fixed; inset: 0; z-index: var(--z-fx); pointer-events: none; animation: flash .7s ease-out forwards; }
.flash.ok { box-shadow: inset 0 0 110px 12px rgba(200, 255, 46, .5); }
.flash.bad { box-shadow: inset 0 0 110px 12px rgba(255, 46, 147, .5); }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
.confetti { position: fixed; inset: 0; z-index: var(--z-fx); pointer-events: none; width: 100%; height: 100%; }
.pop { animation: scorepop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes scorepop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ===================== 3D ===================== */
#scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; transition: opacity .8s; }
body.has-3d .orbs { display: none; }
body.has-3d::before { opacity: .18; }
.card::after, .game-card::after, .qedit::after { background: linear-gradient(180deg, rgba(14, 17, 32, .9), rgba(10, 12, 23, .94)); }
@media (hover: hover) and (pointer: fine) {
  .card::after { background: radial-gradient(260px circle at var(--mx) var(--my), rgba(39, 243, 255, .12), transparent 65%), linear-gradient(180deg, rgba(14, 17, 32, .9), rgba(10, 12, 23, .94)); }
  .qcard, .game-card, .player { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0)); transition: transform .2s ease-out; }
  .qcard:hover, .game-card:hover { --lift: -3px; }
}
main { perspective: 1400px; }
.q3d { animation: flip3d .7s cubic-bezier(.2, .9, .25, 1.1) both; transform-origin: 50% 0; }
@keyframes flip3d { from { opacity: 0; transform: perspective(1000px) rotateX(-38deg) translateZ(-160px) translateY(30px); filter: blur(6px); } }
.options .option { animation: opt3d .55s cubic-bezier(.2, .9, .3, 1.2) both; }
.options .option:nth-child(1) { animation-delay: .25s; } .options .option:nth-child(2) { animation-delay: .33s; }
.options .option:nth-child(3) { animation-delay: .41s; } .options .option:nth-child(4) { animation-delay: .49s; }
@keyframes opt3d { from { opacity: 0; transform: perspective(700px) rotateY(-55deg) translateX(-24px); } }
.cd-num.n3d { animation: num3d .9s cubic-bezier(.15, .9, .3, 1) both; }
@keyframes num3d { 0% { opacity: 0; transform: perspective(600px) translateZ(260px) rotateX(35deg); filter: blur(8px); } 35% { opacity: 1; filter: none; } 100% { transform: perspective(600px) translateZ(0); } }
.code span { display: inline-block; animation: drop3d .7s cubic-bezier(.2, 1.2, .3, 1) both; animation-delay: var(--d, 0ms); }
@keyframes drop3d { from { opacity: 0; transform: perspective(500px) translateY(-60px) rotateX(90deg); } }
.player { animation: card3d .6s cubic-bezier(.2, 1, .3, 1) both; }
@keyframes card3d { from { opacity: 0; transform: perspective(700px) rotateY(80deg) scale(.8); } }
.podium > div { animation: podium3d .9s cubic-bezier(.2, 1.1, .3, 1) both; transform-origin: 50% 100%; }
.podium .p1 { animation-delay: .35s; } .podium .p2 { animation-delay: .15s; } .podium .p3 { animation-delay: .5s; }
@keyframes podium3d { from { opacity: 0; transform: perspective(800px) rotateX(70deg) scaleY(.2); } }
.secret { animation: flip3d .7s both; }
.bot.lg { animation: spin3d 1s cubic-bezier(.2, .9, .3, 1.1) both; }
@keyframes spin3d { from { transform: perspective(600px) rotateY(-180deg) scale(.6); opacity: 0; } }

/* ===================== Universo Circuitia ===================== */
img.bot { object-fit: contain; animation: bob 3.2s ease-in-out infinite; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .55)) drop-shadow(0 0 10px rgba(39, 243, 255, .18)); user-select: none; -webkit-user-drag: none; }
img.bot.happy { animation: hop .7s ease-in-out infinite; }
img.bot.sad { animation: none; filter: grayscale(.35) drop-shadow(0 6px 14px rgba(0, 0, 0, .55)); }
img.bot.rare { filter: drop-shadow(0 0 12px rgba(255, 200, 61, .55)) drop-shadow(0 6px 14px rgba(0, 0, 0, .5)); }
.crew img.bot, .side-list img.bot, .board img.bot, .lane img.bot { animation-duration: 2.6s; }
.bot3d { display: block; margin: 0 auto; cursor: grab; touch-action: pan-y; }
.bot3d:active { cursor: grabbing; }
.bot-stage, .volt-stage { position: relative; display: grid; place-items: center; }
.bot-floor { width: 62%; height: 18px; margin-top: -14px; border-radius: 50%; background: radial-gradient(closest-side, rgba(39, 243, 255, .55), rgba(39, 243, 255, 0)); filter: blur(2px); animation: floorpulse 3s ease-in-out infinite; }
@keyframes floorpulse { 50% { transform: scaleX(.82); opacity: .6; } }

/* Portada */
.intro { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; align-items: center; min-height: min(78dvh, 680px); padding: 10px 0 20px; }
@media (max-width: 820px) { .intro { grid-template-columns: 1fr; min-height: 0; } .intro-hero { order: -1; } }
.intro h1 { font-size: clamp(2.6rem, 10vw, 5.4rem); line-height: .95; }
.intro h1 span { display: block; background: linear-gradient(90deg, var(--cyan), var(--lime) 50%, var(--magenta)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 0 18px rgba(39, 243, 255, .35)); background-size: 200% 100%; animation: sheen 6s linear infinite; }
@keyframes sheen { to { background-position: 200% 0; } }
.title-glitch { position: relative; }
.title-glitch::after { content: attr(data-text); position: absolute; inset: 0; color: var(--magenta); opacity: 0; clip-path: inset(40% 0 45% 0); animation: glitchbar 5s steps(1) infinite; pointer-events: none; }
@keyframes glitchbar { 0%, 92% { opacity: 0; } 93% { opacity: .8; transform: translate(-6px, 0); clip-path: inset(20% 0 65% 0); } 95% { opacity: .8; transform: translate(5px, 0); clip-path: inset(60% 0 20% 0); } 97% { opacity: 0; } }
.intro-copy p { font-size: 1.15rem; color: var(--muted); }
.intro-hero { position: relative; display: grid; place-items: center; }
.volt-stage { width: min(320px, 70vw); aspect-ratio: 1; }
.volt-stage img.bot { width: 100%; height: 100%; }
.bubble { position: relative; margin-top: 4px; max-width: 280px; min-height: 52px; padding: 12px 16px; background: rgba(14, 17, 32, .92); border: 1px solid var(--cyan); box-shadow: var(--glow-cyan); font-family: var(--font-head); font-weight: 600; letter-spacing: .02em; text-align: center; }
.bubble::before { content: ''; position: absolute; top: -8px; left: 50%; width: 14px; height: 14px; background: inherit; border-left: 1px solid var(--cyan); border-top: 1px solid var(--cyan); transform: translateX(-50%) rotate(45deg); }
.bubble::after { content: '▍'; color: var(--lime); animation: pulse 1s steps(1) infinite; margin-left: 2px; }
.progress-chips { display: flex; align-items: center; gap: 6px; margin-top: 18px; }
.progress-chips i { width: 18px; height: 18px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: var(--panel-3); }
.progress-chips i.on { background: var(--c); box-shadow: 0 0 12px var(--c); }
.progress-chips .small { margin-left: 6px; }

/* Prólogo tipo cómic */
.prologue { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 10px 0 6px; }
.panel { --cut: 16px; position: relative; isolation: isolate; clip-path: var(--shape); padding: 16px; display: grid; gap: 10px; background: linear-gradient(160deg, rgba(39, 243, 255, .08), rgba(255, 46, 147, .06)), rgba(14, 17, 32, .88); box-shadow: inset 0 0 0 1px var(--line); }
.panel h3 { text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.panel p { font-size: .95rem; color: var(--muted); margin: 0; }
.panel-art { height: 130px; display: grid; place-items: center; background: radial-gradient(closest-side, rgba(39, 243, 255, .18), transparent); }
.panel-art img.bot { width: 120px; height: 120px; }
.you-crew { display: flex; } .you-crew img.bot { width: 78px; height: 78px; margin: 0 -10px; }
.reveal { opacity: 0; transform: perspective(900px) rotateX(18deg) translateY(30px); transition: opacity .7s, transform .8s cubic-bezier(.2, .9, .3, 1); transition-delay: calc(var(--i, 0) * 120ms); }
.reveal.in { opacity: 1; transform: none; }

/* Mapa de mundos */
.map-card h2 { margin: 0; }
.map-wrap { margin: 10px -8px 0; overflow: hidden; }
.map { width: 100%; height: auto; display: block; overflow: visible; }
.map .road-shadow { fill: none; stroke: rgba(39, 243, 255, .12); stroke-width: 26; stroke-linecap: round; }
.map .road { fill: none; stroke-width: 6; stroke-linecap: round; filter: url(#glow); }
.map .road-dash { fill: none; stroke: rgba(255, 255, 255, .7); stroke-width: 2; stroke-dasharray: 2 18; stroke-linecap: round; animation: roaddash 2.4s linear infinite; }
@keyframes roaddash { to { stroke-dashoffset: -40; } }
.map .node { cursor: pointer; outline: none; }
.map .node .halo { fill: var(--c); opacity: .14; transition: opacity .3s, transform .3s; transform-box: fill-box; transform-origin: center; }
.map .node .planet { fill: #0e1120; stroke: var(--c); stroke-width: 4; filter: url(#glow); }
.map .node .ring { fill: none; stroke: var(--c); stroke-width: 2; opacity: .55; transform: rotate(-14deg); }
.map .node .ico { font-size: 34px; }
.map .node .lbl { fill: var(--ink); font-family: var(--font-head); font-weight: 700; font-size: 20px; letter-spacing: .04em; text-transform: uppercase; paint-order: stroke; stroke: #06070d; stroke-width: 6px; }
.map .node .ok { fill: var(--lime); font-size: 26px; font-weight: 700; }
.map .node:hover .halo, .map .node:focus .halo, .map .node.sel .halo { opacity: .45; transform: scale(1.25); }
.map .node.sel .planet { stroke-width: 6; }
.map .node.freed .planet { fill: color-mix(in srgb, var(--c) 30%, #0e1120); }
.map .node .halo { animation: halo 3s ease-in-out infinite; }
@keyframes halo { 50% { opacity: .3; } }
.map-volt { transition: transform .9s cubic-bezier(.5, 0, .3, 1); }
.map-volt.walking image { animation: walk .22s ease-in-out 4 alternate; }
@keyframes walk { to { transform: translateY(-10px) rotate(6deg); } }
.world-detail { display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 14px; margin-top: 6px; background: rgba(6, 7, 13, .6); box-shadow: inset 3px 0 0 var(--c); animation: rise .4s both; }
.wd-icon { font-size: 3rem; line-height: 1; filter: drop-shadow(0 0 14px var(--c)); }
.world-detail h3 { color: var(--c); text-transform: uppercase; font-size: 1.4rem; }
.rules { margin: 6px 0 12px; padding: 0; list-style: none; display: grid; gap: 6px; }
.rules li { padding-left: 22px; position: relative; color: var(--muted); }
.rules li::before { content: '▸'; position: absolute; left: 4px; color: var(--c, var(--cyan)); }

/* Selección de modo */
.mode-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin: 8px 0 4px; scrollbar-width: none; }
.mode-strip::-webkit-scrollbar { display: none; }
.mode-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; min-height: 46px; background: var(--panel-2); color: var(--ink); text-decoration: none; font-family: var(--font-head); font-weight: 600; font-size: .85rem; letter-spacing: .05em; text-transform: uppercase; box-shadow: inset 0 0 0 1px var(--line); clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); }
.mode-chip span { font-size: 1.2rem; }
.mode-chip.on { background: color-mix(in srgb, var(--c) 22%, var(--panel)); box-shadow: inset 0 0 0 2px var(--c), 0 0 18px color-mix(in srgb, var(--c) 40%, transparent); color: #fff; }
button.mode-chip { letter-spacing: .05em; }
.mode-ico { filter: drop-shadow(0 0 12px var(--c)); }
h1[style*='--c'] { color: var(--ink); }

/* Acabados y Taller */
.skins { display: flex; flex-wrap: wrap; gap: 6px; }
.skin-chip { font-family: var(--font-head); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; min-height: 34px; background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rc); clip-path: none; }
.skin-chip.on { background: var(--rc); color: #06070d; }
.skin-chip.locked { opacity: .45; display: inline-flex; align-items: center; }
.skin-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.skin-card { display: grid; justify-items: center; gap: 4px; padding: 10px; background: var(--panel-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 50%, transparent); text-align: center; }
.skin-card.on { box-shadow: inset 0 0 0 2px var(--rc), 0 0 16px color-mix(in srgb, var(--rc) 50%, transparent); }
.skin-card img.bot { width: 84px; height: 84px; }
.skin-card.locked { filter: saturate(.3); }
.lockbox { width: 84px; height: 84px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 2rem; color: var(--rc); background: rgba(0, 0, 0, .3); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.tokens { font-family: var(--font-head); font-size: 1.2rem; text-align: center; } .tokens b { font-size: 2.2rem; color: var(--amber); text-shadow: 0 0 14px rgba(255, 200, 61, .5); margin: 0 6px; }
.nut { display: inline-block; animation: spinz 6s linear infinite; color: var(--amber); }
@keyframes spinz { to { transform: rotate(360deg); } }
.capsule-stage { height: 260px; display: grid; place-items: center; perspective: 800px; }
.capsule { position: relative; width: 120px; height: 170px; transform-style: preserve-3d; animation: capfloat 3s ease-in-out infinite; }
.capsule i { position: absolute; left: 0; right: 0; height: 50%; border-radius: 60px 60px 12px 12px; background: linear-gradient(120deg, #ffffff55, transparent 40%), linear-gradient(180deg, var(--cyan), #0b6f85); box-shadow: 0 0 30px rgba(39, 243, 255, .45), inset 0 -6px 0 rgba(0, 0, 0, .25); }
.capsule i:last-child { bottom: 0; border-radius: 12px 12px 60px 60px; background: linear-gradient(120deg, #ffffff44, transparent 40%), linear-gradient(180deg, #ff6fd0, var(--magenta)); box-shadow: 0 0 30px rgba(255, 46, 147, .45); }
@keyframes capfloat { 50% { transform: translateY(-10px) rotateY(25deg); } }
.capsule-stage.shaking .capsule { animation: capshake .12s linear infinite; }
@keyframes capshake { 25% { transform: translate(-6px, 2px) rotate(-6deg); } 75% { transform: translate(6px, -2px) rotate(6deg); } }
.reveal-bot { position: relative; display: grid; justify-items: center; text-align: center; animation: spin3d .9s both; }
.reveal-bot .rays { position: absolute; inset: -60px; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rc) 40%, transparent) 0 10deg, transparent 10deg 20deg); -webkit-mask-image: radial-gradient(closest-side, #000, transparent); mask-image: radial-gradient(closest-side, #000, transparent); animation: spinz 8s linear infinite; z-index: -1; }
.reveal-bot h3 { font-size: 1.5rem; text-transform: uppercase; color: var(--rc); margin: 0; }

/* ===================== Modos a ritmo propio ===================== */
.pace-hud { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; margin: 4px 0 10px; }
.pscore { font-family: var(--font-mono); font-weight: 700; font-size: clamp(1.6rem, 6vw, 2.4rem); color: var(--c); text-shadow: 0 0 14px var(--c); }
.pace-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.streak { font-family: var(--font-mono); color: var(--amber); font-weight: 700; animation: pulse 1s infinite; }
.lure { font-family: var(--font-mono); color: var(--cyan); letter-spacing: 2px; }
.pw { font-family: var(--font-mono); font-size: .8rem; padding: 4px 8px; border: 1px solid var(--magenta); color: var(--magenta); }
.ptimer { font-family: var(--font-mono); font-size: 1.8rem; font-weight: 700; color: var(--lime); text-shadow: var(--glow-lime); }
.ptimer.low { color: var(--magenta); text-shadow: var(--glow-mag); animation: pulse .6s infinite; }
.frenzy { text-align: center; padding: 10px; margin-bottom: 8px; font-family: var(--font-head); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: linear-gradient(90deg, rgba(39, 243, 255, .25), rgba(200, 255, 46, .25), rgba(39, 243, 255, .25)); background-size: 200% 100%; animation: sheen 2s linear infinite; box-shadow: inset 0 0 0 1px var(--cyan); }
.track { display: grid; gap: 6px; margin-bottom: 10px; padding: 10px; background: rgba(14, 17, 32, .85); box-shadow: inset 0 0 0 1px var(--line); }
.lane { display: grid; grid-template-columns: 82px 1fr; gap: 8px; align-items: center; }
.lane-name { font-family: var(--font-head); font-size: .78rem; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.lane.me .lane-name { color: var(--cyan); }
.lane-road { position: relative; height: 40px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .08) 0 12px, transparent 12px 28px) center / 100% 2px no-repeat, linear-gradient(90deg, rgba(200, 255, 46, .06), rgba(255, 46, 147, .1)); margin-right: 26px; }
.lane-bot { position: absolute; top: 0; transform: translateX(-50%); transition: left .6s cubic-bezier(.3, 1.4, .5, 1); }
.lane-bot img.bot { width: 40px; height: 40px; }
.lane.me .lane-road { box-shadow: inset 0 0 0 1px var(--cyan); }
.flag { position: absolute; right: -24px; top: 8px; }
.pace-card { min-height: 280px; }
.capsules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; perspective: 900px; }
.cap { position: relative; aspect-ratio: 3 / 4; display: grid; place-items: center; background: linear-gradient(160deg, #1d2442, #0e1120); box-shadow: inset 0 0 0 2px var(--cyan), 0 0 24px rgba(39, 243, 255, .25); clip-path: polygon(50% 0, 100% 18%, 100% 82%, 50% 100%, 0 82%, 0 18%); animation: capin .6s cubic-bezier(.2, 1.3, .3, 1) both; color: var(--ink); }
.cap:nth-child(2) { animation-delay: .1s; } .cap:nth-child(3) { animation-delay: .2s; }
@keyframes capin { from { opacity: 0; transform: rotateY(90deg) scale(.6); } }
.cap .cap-ico { font-size: clamp(2rem, 9vw, 3rem); font-family: var(--font-mono); font-weight: 700; }
.cap .cap-glow { position: absolute; inset: 20%; background: radial-gradient(closest-side, rgba(39, 243, 255, .45), transparent); animation: floorpulse 1.6s infinite; }
button.cap:hover { transform: translateY(-6px) rotateY(10deg); }
.cap.open { animation: capflip .7s cubic-bezier(.2, 1, .3, 1) both; display: grid; align-content: center; gap: 6px; }
.cap.open:nth-child(2) { animation-delay: .12s; } .cap.open:nth-child(3) { animation-delay: .24s; }
@keyframes capflip { from { transform: rotateY(180deg); opacity: .2; } }
.cap.open:not(.picked) { opacity: .55; filter: saturate(.5); }
.cap.picked { box-shadow: inset 0 0 0 3px var(--lime), 0 0 30px rgba(200, 255, 46, .5); }
.cap.t-lose.picked, .cap.t-nothing.picked { box-shadow: inset 0 0 0 3px var(--magenta), 0 0 30px rgba(255, 46, 147, .5); }
.cap-label { font-family: var(--font-head); font-weight: 700; font-size: .85rem; text-transform: uppercase; text-align: center; }
.result-line { text-align: center; font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; color: var(--lime); min-height: 1.4em; }
.targets { display: grid; gap: 8px; margin: 10px 0; }
.target { justify-content: flex-start; background: var(--panel-2); color: var(--ink); text-transform: none; letter-spacing: 0; font-family: var(--font-body); gap: 10px; }
.target span { flex: 1; text-align: left; font-weight: 600; } .target b { font-family: var(--font-mono); color: var(--amber); }
.target img.bot { width: 36px; height: 36px; }
.catch { text-align: center; padding: 12px 0; animation: spin3d .7s both; }
.catch .fish { font-size: clamp(4rem, 18vw, 6rem); line-height: 1.1; filter: drop-shadow(0 0 20px var(--rc, var(--cyan))); animation: bob 2s ease-in-out infinite; }
.catch h2 { text-transform: uppercase; color: var(--rc, var(--ink)); }
.catch .kg { font-family: var(--font-mono); font-size: 2rem; font-weight: 700; color: var(--amber); }
.catch.bad .fish { filter: drop-shadow(0 0 20px var(--magenta)); color: var(--magenta); }
.pw-options { display: grid; gap: 10px; margin: 14px 0; }
.pw-btn { font-family: var(--font-mono); font-size: 1.3rem; letter-spacing: .2em; background: var(--panel-2); color: var(--magenta); box-shadow: inset 0 0 0 1px var(--magenta); min-height: 58px; }
.feed { display: grid; gap: 4px; margin-top: 8px; font-size: .85rem; color: var(--muted); }
.feed div { padding: 6px 10px; background: rgba(14, 17, 32, .75); border-left: 2px solid var(--magenta); animation: rise .3s both; }
.hearts { color: #ff5e5e; letter-spacing: 2px; } .hearts.big { font-size: 1.4rem; }
@media (max-width: 720px) { .pace-hud { grid-template-columns: 1fr auto; } .pace-meta { grid-column: 1 / -1; justify-content: flex-start; order: 3; } .lane { grid-template-columns: 64px 1fr; } .world-detail { grid-template-columns: 1fr; } .map .node .lbl { font-size: 26px; } }

.intro-copy { position: relative; }
.intro-copy::before { content: ''; position: absolute; inset: -40px -60px -40px -80px; z-index: -1; background: radial-gradient(closest-side, rgba(6, 7, 13, .82), rgba(6, 7, 13, 0)); pointer-events: none; }

/* ===================== Motion graphics ===================== */
[data-decode] { font-variant-ligatures: none; }
.float-score { position: fixed; z-index: var(--z-toast); transform: translate(-50%, 0); font-family: var(--font-mono); font-weight: 700; font-size: 2rem; text-shadow: 0 0 16px currentColor; pointer-events: none; animation: floatup 1.1s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes floatup { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -10px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -80px) scale(1); } }
.big-points { font-family: var(--font-mono); font-weight: 700; font-size: clamp(2.6rem, 10vw, 4rem); color: var(--lime); text-shadow: var(--glow-lime), 0 0 40px rgba(200, 255, 46, .4); animation: scorepop .6s cubic-bezier(.3, 1.6, .5, 1); }

/* Cine con el tráiler */
.cinema { --cut: 18px; position: relative; aspect-ratio: 16 / 9; margin: 6px 0 18px; clip-path: var(--shape); overflow: hidden; box-shadow: inset 0 0 0 1px var(--cyan); background: #000; }
.cinema-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cinema::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 55%, rgba(6, 7, 13, .85)), repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, .2) 2px 3px); }
.cinema-ui { position: absolute; left: 18px; bottom: 16px; right: 18px; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.trailer-dialog { width: min(1100px, 96vw); padding: 0; border: 0; background: #000; box-shadow: 0 0 0 1px var(--cyan), 0 0 60px rgba(39, 243, 255, .35); }
.trailer-dialog::backdrop { background: rgba(6, 7, 13, .88); backdrop-filter: blur(6px); }
.trailer-dialog video { display: block; width: 100%; height: auto; }
.trailer-dialog button { position: absolute; top: 8px; right: 8px; }

/* Presentación de mundo antes de empezar */
.stinger { position: relative; height: 230px; display: grid; place-items: center; overflow: hidden; margin: 4px 0 8px; }
.st-rings, .st-rings i { position: absolute; inset: 0; display: grid; place-items: center; }
.st-rings i { margin: auto; width: 120px; height: 120px; border-radius: 50%; box-shadow: 0 0 0 2px var(--c), 0 0 24px var(--c); opacity: 0; animation: ringout 2.4s cubic-bezier(.2, .8, .2, 1) infinite; }
.st-rings i:nth-child(2) { animation-delay: .5s; } .st-rings i:nth-child(3) { animation-delay: 1s; }
@keyframes ringout { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(3.4); opacity: 0; } }
.st-ico { position: relative; font-size: 4.4rem; filter: drop-shadow(0 0 24px var(--c)); animation: icodrop .8s cubic-bezier(.2, 1.4, .3, 1) both; z-index: 1; margin-top: -40px; }
@keyframes icodrop { from { transform: perspective(500px) translateZ(300px) rotateY(180deg); opacity: 0; } }
.st-lines { position: absolute; inset: 0; }
.st-lines i { position: absolute; left: -40%; height: 2px; width: 40%; background: linear-gradient(90deg, transparent, var(--c), transparent); animation: speed 1.2s linear infinite; }
.st-lines i:nth-child(1) { top: 20%; } .st-lines i:nth-child(2) { top: 42%; animation-delay: .3s; } .st-lines i:nth-child(3) { top: 64%; animation-delay: .6s; } .st-lines i:nth-child(4) { top: 82%; animation-delay: .9s; }
@keyframes speed { to { transform: translateX(360%); } }
.st-kicker { position: absolute; bottom: 58px; font-family: var(--font-mono); font-size: .8rem; letter-spacing: .4em; text-transform: uppercase; color: var(--c); animation: rise .5s .3s both; }
.st-name { position: absolute; bottom: 14px; font-family: var(--font-head); font-weight: 700; font-size: clamp(1.8rem, 7vw, 3rem); text-transform: uppercase; letter-spacing: .02em; color: #fff; text-shadow: 3px 0 rgba(255, 46, 147, .6), -3px 0 rgba(39, 243, 255, .5), 0 0 30px var(--c); animation: slicein .7s .2s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes slicein { from { clip-path: inset(0 50% 0 50%); opacity: 0; letter-spacing: .4em; } to { clip-path: inset(0 0 0 0); opacity: 1; } }

/* Radar de la sala de espera */
.radar-card { overflow: hidden; }
.radar { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; opacity: .5; }
.radar i { position: absolute; width: 140px; height: 140px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(39, 243, 255, .5); animation: ringout 3s linear infinite; }
.radar i:nth-child(2) { animation-delay: 1s; } .radar i:nth-child(3) { animation-delay: 2s; }
.radar b { position: absolute; width: 520px; height: 520px; border-radius: 50%; background: conic-gradient(from 0deg, rgba(39, 243, 255, .35), transparent 25%); animation: spinz 4s linear infinite; -webkit-mask-image: radial-gradient(closest-side, #000 60%, transparent); mask-image: radial-gradient(closest-side, #000 60%, transparent); }
.radar-card > *:not(.radar) { position: relative; }

/* ===================== Ilustraciones de mundos ===================== */
.map .node .planet-art { opacity: .95; }
.map .node .ico { font-size: 22px; }
.world-detail { grid-template-columns: minmax(200px, 340px) 1fr; }
.wd-art { position: relative; aspect-ratio: 16 / 9; overflow: hidden; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px)); box-shadow: inset 0 0 0 1px var(--c); }
.wd-art img { width: 100%; height: 100%; object-fit: cover; display: block; animation: kenburns 14s ease-in-out infinite alternate; }
.wd-art .wd-icon { position: absolute; left: 10px; bottom: 6px; font-size: 2rem; }
@keyframes kenburns { to { transform: scale(1.12) translate(-2%, -2%); } }
.world-banner { position: relative; height: clamp(140px, 26vw, 260px); margin: 6px 0 4px; overflow: hidden; clip-path: var(--shape); --cut: 18px; box-shadow: inset 0 0 0 1px var(--c); }
.world-banner img { width: 100%; height: 100%; object-fit: cover; display: block; animation: kenburns 16s ease-in-out infinite alternate; }
.world-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(6, 7, 13, .9)), repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, .18) 2px 3px); }
.wb-tag { position: absolute; left: 16px; bottom: 12px; z-index: 1; font-family: var(--font-head); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; text-shadow: 0 0 14px var(--c); }
.lobby-banner { height: clamp(120px, 22vw, 220px); }
.mode-chip img { width: 34px; height: 22px; object-fit: cover; clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%); }
.stinger::before { content: ''; position: absolute; inset: 0; background: var(--art) center / cover; opacity: .38; animation: kenburns 6s ease-out both; -webkit-mask-image: radial-gradient(closest-side, #000 40%, transparent); mask-image: radial-gradient(closest-side, #000 40%, transparent); }
@media (max-width: 720px) { .world-detail { grid-template-columns: 1fr; } }
