:root {
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --r-1: 10px; --r-2: 14px; --r-3: 20px;
  --bg: #07010f;
  --fg: #ffffff;
  --muted: #b8a9d9;
  --pink: #ff2bd6;
  --cyan: #00e5ff;
  --yellow: #ffe600;
  --panel: rgba(12, 4, 28, 0.82);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

/* inset + 100%: el lienzo sigue al área visible real (en iPhone 100vh no coincide y quedaba una franja abajo) */
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
.hud-top {
  position: absolute; left: 0; right: 0;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  padding: 0 16px;
  display: flex; justify-content: space-between; align-items: flex-start;
}
#score {
  font: italic 900 34px/1 var(--font);
  text-shadow: 0 0 12px var(--pink), 0 2px 0 #000;
  font-variant-numeric: tabular-nums;
}
#multWrap { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
#mult {
  font: italic 900 26px/1 var(--font);
  text-shadow: 0 0 10px currentColor, 0 2px 0 #000;
  display: inline-block;
}
#mult.pop { animation: pop 0.25s ease-out; }
@keyframes pop { 0% { transform: scale(1.7); } 100% { transform: scale(1); } }
#chainbar { width: 60px; height: 5px; background: rgba(255,255,255,.15); border-radius: 3px; overflow: hidden; }
#chainbar i { display: block; height: 100%; background: var(--yellow); transform-origin: left; }
.hud-right { text-align: right; margin-right: 44px; }
#speed { font: italic 900 22px/1 var(--font); color: var(--cyan); text-shadow: 0 0 10px var(--cyan); font-variant-numeric: tabular-nums; }
#speed small, #dist { font-size: 12px; font-weight: 700; color: var(--muted); }
#coins { font: 800 15px var(--font); margin-top: 3px; }
#pauseBtn {
  position: absolute; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 8px);
  pointer-events: auto; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.35); color: #fff; font-size: 12px;
}
/* botón de habilidad: anillo que se llena con la recarga */
#abilityBtn {
  --f: 1;
  position: absolute; right: 14px; bottom: calc(env(safe-area-inset-bottom, 0px) + 48px);
  width: 66px; height: 66px; border-radius: 50%; padding: 0; pointer-events: auto;
  border: none; color: #fff; font-size: 28px;
  background:
    radial-gradient(circle, rgba(10,4,24,.92) 58%, transparent 60%),
    conic-gradient(var(--cyan) calc(var(--f) * 360deg), rgba(255,255,255,.14) 0);
  opacity: .55; transition: opacity .15s, transform .1s;
  touch-action: none;
}
#abilityBtn.ready { opacity: 1; box-shadow: 0 0 18px rgba(0,229,255,.7); }
#abilityBtn.active { opacity: 1; box-shadow: 0 0 26px #fff; animation: breathe .4s ease-in-out infinite; }
#abilityBtn:active { transform: scale(.9); }
#abilityBtn.pulse { animation: pop .35s ease-out; }

#eventTag {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 120px); left: 50%; transform: translateX(-50%);
  padding: 4px 12px; border-radius: 99px; background: rgba(0,0,0,.6); border: 1px solid var(--pink);
  font: 800 12px var(--font); white-space: nowrap;
}
.hud-bottom {
  position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  padding: 0 16px; display: flex; align-items: center; gap: 10px;
}
#shields { min-width: 40px; font-size: 16px; }
#odbar {
  flex: 1; height: 16px; position: relative; border-radius: 9px; overflow: hidden;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,43,214,.6);
}
#odbar i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--pink), var(--yellow)); transform-origin: left; transform: scaleX(0); }
#odbar span { position: absolute; inset: 0; text-align: center; font: italic 900 11px/16px var(--font); letter-spacing: 2px; }
#odbar.cool i { background: linear-gradient(90deg, #555, #888); }
#odbar.cool span { color: #aaa; }
#odbar.active i { background: linear-gradient(90deg, #f0f, #0ff, #ff0, #f0f); background-size: 300% 100%; animation: rainbow 0.6s linear infinite; }
@keyframes rainbow { to { background-position: 300% 0; } }
#dash { display: flex; gap: 4px; min-width: 40px; justify-content: flex-end; }
#dash i {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--cyan);
  background: conic-gradient(var(--cyan) calc(var(--f) * 360deg), transparent 0);
  opacity: .7;
}
#dash i.ready { opacity: 1; box-shadow: 0 0 10px var(--cyan); }

/* ---------- Overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 5; /* por encima de los HUD de las partidas (2–3) y por debajo de la barra (6), avisos y diálogos */
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 16px calc(env(safe-area-inset-bottom, 0px) + 20px);
  background: radial-gradient(ellipse at center, rgba(20,4,40,.55), rgba(5,0,12,.88));
  overflow-y: auto; touch-action: pan-y;
  animation: fadein .2s ease-out;
}
/* centrado con márgenes automáticos: con justify-content:center, lo que desborda
   quedaría cortado por arriba sin poder hacer scroll hasta ello */
.overlay { justify-content: flex-start; }
.overlay > * { flex-shrink: 0; } /* si no, los hijos con overflow (carrusel) se aplastan */
.overlay > :first-child { margin-top: auto; }
.overlay > :last-child { margin-bottom: auto; }
#menu { background: linear-gradient(rgba(5,0,12,.2), rgba(5,0,12,.75)); }

/* rango de piloto */
.rank { width: min(360px, 100%); display: flex; flex-direction: column; gap: 5px; }
.rank-top { display: flex; justify-content: space-between; align-items: baseline; }
.rank-top b { font: italic 900 15px var(--font); color: var(--cyan); text-shadow: 0 0 8px rgba(0,229,255,.5); }
.rank-top small { color: var(--muted); font-size: 11px; font-weight: 700; }
.rank-bar { position: relative; height: 8px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.rank-bar i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--cyan), #7df9ff); transform-origin: left; }
.rank-bar u { position: absolute; top: 0; bottom: 0; background: var(--yellow); text-decoration: none; animation: blink .5s steps(2) 4; }
.xp-gain { text-align: center; font: italic 900 18px var(--font); color: var(--cyan); }
.rank-up { text-align: center; font: italic 900 16px var(--font); color: var(--yellow); animation: pop .5s ease-out; }
.rank-up.ach { color: #ffd60a; font-size: 14px; }

/* logros y colección */
.ach-item.t-bronze { border-left: 3px solid #cd7f32; }
.ach-item.t-silver { border-left: 3px solid #c0c0c0; }
.ach-item.t-gold { border-left: 3px solid #ffd60a; }
.ach-item .m-bar { margin: 4px 0 2px; }
.codex-grid { width: min(440px, 100%); display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.cx { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; background: var(--panel); border: 1px solid rgba(255,255,255,.14); text-align: center; }
.cx span { font-size: 24px; }
.cx small { font: 800 11px var(--font); line-height: 1.15; }
.cx em { position: absolute; top: 3px; right: 5px; font: 900 11px var(--font); color: var(--muted); font-style: normal; }
.cx.unknown { opacity: .35; filter: grayscale(1); }

/* misiones diarias */
.missions { width: min(360px, 100%); display: flex; flex-direction: column; gap: 6px; }
.missions h3 { margin: 0; text-align: center; font-size: 12px; }
.mission {
  --dc: #5ac8fa;
  padding: 7px 10px; border-radius: 10px; background: var(--panel);
  border: 1px solid rgba(255,255,255,.12); border-left: 3px solid var(--dc);
}
.mission.d-medium { --dc: #bf5af2; }
.mission.d-hard { --dc: #ff9f0a; }
.mission.done { border-color: #30d158; background: rgba(48,209,88,.12); }
.m-top { display: flex; justify-content: space-between; gap: 8px; font: 700 13px var(--font); }
.m-top b { color: var(--yellow); white-space: nowrap; font-size: 12px; }
.m-bar { height: 4px; margin: 5px 0 3px; border-radius: 2px; background: rgba(255,255,255,.12); overflow: hidden; }
.m-bar i { display: block; height: 100%; background: var(--dc); transform-origin: left; }
.mission.done .m-bar i { background: #30d158; }
.mission small { color: var(--muted); font-size: 11px; }
.missions.compact .mission { padding: 5px 8px; }
.missions.compact .m-top { font-size: 12px; }
#hangar, #achs, #codex, #station, #galMap, #atlas, #expMap, #expEvent, #expRest, #expEnd { background: radial-gradient(ellipse at top, #1d0838, var(--bg) 70%); }
#emTitle { font-size: 22px; text-align: center; }
#death, #pause, #shop, #cards { background: radial-gradient(ellipse at center, rgba(20,4,40,.82), rgba(5,0,12,.95)); }
@keyframes fadein { from { opacity: 0; } }

h1.logo {
  margin: 0; font: italic 900 clamp(48px, 15vw, 96px)/0.9 var(--font); letter-spacing: -2px;
  color: #fff; text-shadow: 0 0 18px var(--cyan), 4px 4px 0 var(--pink);
  transform: skewX(-8deg);
}
h1.logo span { color: var(--yellow); text-shadow: 0 0 18px var(--yellow), 4px 4px 0 var(--pink); }
.tag { margin: 0 0 8px; color: var(--muted); font-weight: 700; letter-spacing: 3px; text-transform: uppercase; font-size: 12px; }
h2 { margin: 0; font: italic 900 32px var(--font); text-shadow: 0 0 12px var(--pink); }
h3 { margin: 10px 0 0; font: 800 14px var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: 2px; }

.stats-row { display: flex; gap: 28px; margin-bottom: 8px; }
.stats-row div { text-align: center; }
.stats-row b { display: block; font: italic 900 26px var(--font); color: var(--yellow); }
.stats-row small, .grid small { color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; }

.btn {
  width: min(320px, 100%); padding: 14px 18px; border-radius: 14px;
  border: 2px solid var(--cyan); background: rgba(0,229,255,.12); color: #fff;
  font: italic 900 18px var(--font); letter-spacing: 1px; cursor: pointer;
  box-shadow: 0 0 16px rgba(0,229,255,.35), inset 0 0 12px rgba(0,229,255,.2);
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .35; filter: grayscale(1); }
.btn.big { padding: 18px; font-size: 26px; border-color: var(--pink); background: rgba(255,43,214,.2); box-shadow: 0 0 24px rgba(255,43,214,.55), inset 0 0 14px rgba(255,43,214,.3); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.04); } }
.btn.ghost { border-color: rgba(255,255,255,.3); background: transparent; box-shadow: none; }
.btn small { font-weight: 600; font-style: normal; font-size: 12px; color: var(--muted); }
.row { display: flex; gap: 10px; width: min(360px, 100%); }
.row .btn { flex: 1; }

.toggles { display: flex; gap: 10px; margin-top: 6px; }
.tg { width: 46px; height: 46px; border-radius: 12px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.35); font-size: 20px; color: #fff; font-weight: 900; font-family: var(--font); }
.tg.off { opacity: .35; filter: grayscale(1); }
.hint { margin: 4px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.blink { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .3; } }
.gems { margin: 0; font: 800 18px var(--font); }
.gems small { color: var(--muted); font-weight: 600; font-size: 12px; }

/* listas del hangar */
.list { display: flex; flex-direction: column; gap: 8px; width: min(420px, 100%); }
.item {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px;
  border-radius: 12px; border: 1px solid rgba(255,255,255,.18); background: var(--panel); color: #fff; font-family: var(--font);
}
.item.sel { border-color: var(--yellow); box-shadow: 0 0 12px rgba(255,230,0,.3); }
.item.locked { opacity: .5; }
.i-icon { font-size: 26px; width: 34px; text-align: center; }
.i-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.i-body small { color: var(--muted); font-size: 12px; }
.i-ab { color: var(--cyan) !important; }
.i-ab b { font-weight: 900; }
.i-act { font: italic 900 13px var(--font); color: var(--yellow); white-space: nowrap; }

/* hangar: carrusel, ficha y árbol */
.carousel {
  display: flex; gap: 8px; width: min(440px, 100%); overflow-x: auto; padding: 4px 2px 8px;
  scroll-snap-type: x mandatory; touch-action: pan-x pan-y; position: relative;
  max-height: 130px; transition: max-height .2s ease, padding .2s ease, opacity .2s ease;
}
.ship-chip {
  --sc: #00e5ff;
  flex: 0 0 78px; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; border-radius: 12px; border: 1px solid rgba(255,255,255,.15); background: var(--panel);
  color: #fff; font-family: var(--font);
}
.ship-chip b { font: italic 900 12px var(--font); }
.ship-chip small { font-size: 11px; color: var(--muted); }
.ship-chip.viewing { border-color: var(--sc); box-shadow: 0 0 14px color-mix(in srgb, var(--sc) 60%, transparent); transform: translateY(-2px); }
.ship-chip.equipped::after { content: 'EN USO'; font: 900 11px var(--font); color: var(--yellow); letter-spacing: 1px; }
.ship-chip.locked { opacity: .55; }

.hangar-view { width: min(440px, 100%); height: 150px; display: block; touch-action: none; transition: height .2s ease; cursor: grab; border-radius: 10px; background: radial-gradient(ellipse at 50% 70%, rgba(255,255,255,.05), transparent 70%); }
.cosmetics { width: min(440px, 100%); display: flex; flex-direction: column; gap: 8px; }
.cos-row > small { display: block; margin-bottom: 4px; font: 900 11px var(--font); letter-spacing: 1px; color: var(--muted); }
/* pan-x pan-y: de lado mueve la fila, arriba/abajo mueve la página (con solo pan-x no había forma de bajar) */
.cos-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; touch-action: pan-x pan-y; }
.cos {
  flex: 0 0 92px; width: 92px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 6px;
  border-radius: 10px; border: 1px solid rgba(255,255,255,.15); background: var(--panel); color: #fff; font-family: var(--font);
}
.cos i { width: 22px; height: 22px; border-radius: 50%; }
.cos i.sw-pal { width: 26px; height: 26px; border-radius: 7px; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.cos i.sw-emo { width: auto; height: auto; border-radius: 0; font-style: normal; font-size: 20px; line-height: 1; }
.cos i.sw-aura.rainbow { background: conic-gradient(#ff2d55, #ffe600, #39ff14, #00e5ff, #bf5af2, #ff2d55) !important; }
.cos-row small .cos-count { width: auto; height: auto; border-radius: 0; margin-left: 6px; font-style: normal; color: var(--muted); font-size: 11px; }
.cos-filter { display: flex; width: 100%; margin-bottom: 4px; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; overflow: hidden; }
.cos-filter button { flex: 1; padding: 9px 4px; background: transparent; color: var(--muted); border: 0; font: 900 12px var(--font); letter-spacing: .5px; }
.cos-filter button + button { border-left: 1px solid rgba(255,255,255,.12); }
.cos-filter button.on { background: rgba(255,230,0,.18); color: var(--yellow); }
.cos-empty { padding: 8px 4px; color: var(--muted); font-size: 12px; }
.cos b, .cos small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cos b { font: 800 11px var(--font); }
.cos small { font: 800 11px var(--font); color: var(--muted); }
.cos.on { border-color: var(--yellow); box-shadow: 0 0 10px rgba(255,230,0,.35); }
.cos.on small { color: var(--yellow); }
.cos.locked { opacity: .55; }
.cos.shake { animation: shake .3s; }
.cos { position: relative; }
.cos svg { width: 24px; height: 24px; fill: var(--yellow); stroke: var(--yellow); }
.cos.trying { border-color: var(--cyan); box-shadow: 0 0 12px rgba(0,229,255,.5); opacity: 1; }
.cos.excl { border-color: color-mix(in srgb, var(--sc) 70%, transparent); }
.cos em { position: absolute; top: -7px; left: 50%; transform: translateX(-50%); padding: 1px 5px; border-radius: 6px; background: var(--sc); color: #000; font: 900 11px var(--font); font-style: normal; letter-spacing: .5px; white-space: nowrap; }
.cos-chips { padding-top: 8px; }
.cos-preview { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 78px); z-index: 7; width: min(440px, calc(100% - 24px)); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 6px 8px; border-radius: 12px; background: rgba(11,2,33,.95); border: 1px solid var(--cyan); box-shadow: 0 0 16px rgba(0,229,255,.35); }
.cos-preview .pv-name { width: 100%; text-align: center; font: 800 12px var(--font); color: var(--muted); }
.cos-preview .pv-name b { color: #fff; }
.cos-preview small { color: var(--muted); font-size: 12px; }
.cos-preview .btn { width: auto; flex: 1 1 0; margin: 0; padding: 10px 8px; font-size: 14px; animation: none; }
.cos-style { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cos-style .seg { display: flex; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; overflow: hidden; }
.cos-style .seg button { padding: 6px 10px; background: transparent; color: var(--muted); border: 0; font: 800 11px var(--font); }
.cos-style .seg button.on { background: rgba(255,230,0,.18); color: var(--yellow); }
.cos-style .swatches { display: flex; gap: 6px; }
.cos-style .swatches button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); padding: 0; }
.cos-style .swatches button.on { border-color: #fff; box-shadow: 0 0 8px #fff; }
.sc-mini { width: 48px; height: 30px; display: block; margin: 0 auto; }
.ship-detail { width: min(440px, 100%); display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--panel); border: 1px solid rgba(255,255,255,.12); }
.sd-head { --sc: #00e5ff; display: flex; gap: 12px; align-items: center; }
.sd-head h3 { margin: 0; color: #fff; font: italic 900 22px var(--font); letter-spacing: 0; text-transform: none; }
.sd-head small { color: var(--muted); font-size: 12px; }
.sd-icon { font-size: 40px; color: var(--sc); text-shadow: 0 0 16px var(--sc); line-height: 1; }
.sd-ability { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; background: rgba(0,229,255,.08); border: 1px solid rgba(0,229,255,.3); font-size: 13px; }
.sd-ability > span { font-size: 28px; }
.sd-ability b { color: var(--cyan); font-weight: 900; }
.sd-ability small { color: #ddd; }
.stats { display: grid; gap: 5px; }
.stat { display: grid; grid-template-columns: 82px 1fr 14px; align-items: center; gap: 8px; font: 800 11px var(--font); color: var(--muted); letter-spacing: 1px; }
.stat .bar { position: relative; height: 7px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.stat .bar i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--cyan), var(--pink)); transform-origin: left; }
.stat .bar u { position: absolute; top: 0; bottom: 0; background: rgba(255,59,107,.45); text-decoration: none; }
.stat em { font-style: normal; font-size: 11px; }
.stat em.up { color: #30d158; }
.stat em.down { color: #ff3b6b; }
.ship-detail .btn { width: 100%; }

.tree { position: relative; width: min(440px, 100%); display: flex; flex-direction: column; gap: 8px; }
.tree-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tree.locked .branch { opacity: .35; filter: grayscale(.6); }
.tree-lock { position: absolute; inset: 0; margin: 0; pointer-events: none; display: grid; place-items: center; font: 900 14px var(--font); color: #fff; text-shadow: 0 2px 6px #000; }
.branch { display: flex; flex-direction: column; gap: 6px; }
.branch h4 { margin: 0; text-align: center; font: 900 11px var(--font); letter-spacing: 1px; color: var(--muted); }
.node {
  display: flex; flex-direction: column; gap: 3px; padding: 7px 6px; min-height: 92px; border-radius: 10px; text-align: left;
  border: 1px dashed rgba(255,255,255,.18); background: rgba(0,0,0,.35); color: #aaa; font-family: var(--font);
}
.node small { font: 900 11px var(--font); letter-spacing: 1px; color: var(--muted); }
.node span { font-size: 11px; line-height: 1.25; flex: 1; }
.node b { font: italic 900 12px var(--font); color: var(--yellow); }
.node.mut { border-color: rgba(255,159,10,.4); }
.node.mut small { color: #ff9f0a; }
.node.next { border-style: solid; border-color: rgba(255,255,255,.35); color: #fff; }
.node.afford { border-color: var(--yellow); box-shadow: 0 0 12px rgba(255,230,0,.35); animation: glowPulse 1.4s ease-in-out infinite; }
.node.bought { border-style: solid; border-color: #30d158; background: rgba(48,209,88,.14); color: #fff; }
.node.bought b { color: #30d158; }
.node.just { animation: chosen .35s ease-out; }
.node.shake { animation: shake .3s; }

/* cartas */
.cards { display: flex; gap: 10px; width: min(560px, 100%); justify-content: center; flex-wrap: wrap; }
.card {
  --rc: #5ac8fa;
  flex: 1 1 150px; max-width: 180px; min-height: 210px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 10px;
  border-radius: 16px; border: 2px solid var(--rc); color: #fff; font-family: var(--font);
  background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(0,0,0,.5)), var(--panel);
  box-shadow: 0 0 18px color-mix(in srgb, var(--rc) 45%, transparent);
  animation: deal .35s cubic-bezier(.2,1.6,.4,1) both;
}
@keyframes deal { from { transform: translateY(60px) rotate(-6deg) scale(.6); opacity: 0; } }
.card:active { transform: scale(.95); }
.card.chosen { animation: chosen .22s ease-out forwards; }
@keyframes chosen { to { transform: scale(1.15); box-shadow: 0 0 50px var(--rc); } }
.card.poor { opacity: .45; }
.card.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.c-rar { font: 900 11px var(--font); letter-spacing: 2px; color: var(--rc); }
.c-icon { font-size: 40px; line-height: 1.1; }
.c-name { font: italic 900 17px var(--font); text-align: center; }
.c-desc { font-size: 12.11px; color: #ddd; text-align: center; line-height: 1.3; }
.c-lvl { font: 800 11px var(--font); color: var(--muted); }
.c-syn { font: 900 11px var(--font); color: #ff9f0a; text-align: center; animation: blink 0.8s steps(2) infinite; }
.c-price { margin-top: auto; font: italic 900 16px var(--font); color: var(--yellow); }
.r-epic { animation: deal .35s cubic-bezier(.2,1.6,.4,1) both, glow 1.2s ease-in-out infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 34px var(--rc); } }
.build { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; font-size: 22px; max-width: 420px; }
.build sub { font-size: 11px; font-weight: 800; }
.build .syn { font: 900 11px var(--font); color: #ff9f0a; border: 1px solid #ff9f0a; border-radius: 6px; padding: 3px 6px; align-self: center; }

.reward {
  font: italic 900 20px var(--font); color: #30d158; text-shadow: 0 0 12px rgba(48,209,88,.6);
  padding: 6px 16px; border: 1px solid rgba(48,209,88,.5); border-radius: 99px; background: rgba(0,0,0,.4);
  animation: pop .45s ease-out;
}

/* cofre */
#chestBox { font-size: 110px; line-height: 1; }
#chestBox.shaking { animation: chestshake 0.12s linear infinite; }
@keyframes chestshake { 0% { transform: rotate(-8deg) scale(1); } 50% { transform: rotate(8deg) scale(1.08); } 100% { transform: rotate(-8deg) scale(1); } }
#chestBox.open { animation: chestopen .5s cubic-bezier(.2,1.8,.4,1); }
@keyframes chestopen { from { transform: scale(.2) rotate(-30deg); } }
#chestResult { font: italic 900 26px var(--font); color: var(--yellow); text-shadow: 0 0 14px var(--yellow); text-align: center; min-height: 32px; }

/* muerte */
.dead { color: #ff2d55; text-shadow: 0 0 16px #ff2d55; font-size: 40px; }
.newrec { font: italic 900 20px var(--font); color: var(--yellow); animation: pop .5s ease-out infinite alternate; }
.bigscore { font: italic 900 clamp(48px, 16vw, 80px)/1 var(--font); text-shadow: 0 0 20px var(--cyan); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 18px; width: min(360px, 100%); text-align: center; }
.grid b { display: block; font: italic 900 20px var(--font); }

/* movimiento reducido: sin animaciones infinitas de la interfaz */
@media (prefers-reduced-motion: reduce) {
  .btn.big, .r-epic, .newrec, .blink, .c-syn, #chestBox.shaking, .node.afford, #abilityBtn.active { animation: none; }
}

/* tutorial */
#tutorial {
  position: fixed; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 60px);
  pointer-events: none; display: flex; flex-direction: column; gap: 6px; align-items: center;
  font: 700 14px var(--font); text-shadow: 0 2px 4px #000; animation: fadein .4s;
}
#tutorial b { color: var(--yellow); }
#tutorial .t-hot { color: var(--pink); font-weight: 900; }
#tutorial .t-dodge { color: #ff3b6b; font-weight: 900; }
#tutorial .t-jump { color: #ffd60a; font-weight: 900; }
#tutorial .t-slide { color: #00e5ff; font-weight: 900; }

/* ---------- Campaña ---------- */
.btn.camp { border-color: var(--yellow); background: rgba(255,230,0,.12); box-shadow: 0 0 16px rgba(255,230,0,.35); }
.camp-map { display: flex; flex-direction: column; gap: 12px; width: min(440px, 100%); }
.sector { border: 1px solid var(--bc); border-radius: 12px; padding: 10px; background: rgba(0,0,0,.35); box-shadow: 0 0 14px color-mix(in srgb, var(--bc) 35%, transparent); }
.sector.locked { opacity: .45; filter: grayscale(.7); }
.sector.gen { background: linear-gradient(135deg, color-mix(in srgb, var(--bc) 12%, transparent), color-mix(in srgb, var(--bc2, var(--bc)) 12%, transparent)), rgba(0,0,0,.35); }
.lvl.elite { border-color: #ff2d55; box-shadow: 0 0 10px rgba(255,45,85,.45); }
.l-mods { font-size: 12px; letter-spacing: 1px; }
.lvl-mods { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.lvl-mods span { padding: 3px 8px; border-radius: 8px; background: rgba(255,43,214,.15); border: 1px solid var(--pink); font: 800 12px var(--font); }
.sec-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.sec-top b { font: italic 900 16px var(--font); color: var(--bc); }
.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lvl { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.05); color: #fff; font: inherit; cursor: pointer; }
.lvl.done { border-color: var(--bc); }
.lvl.boss { border-style: dashed; }
.lvl.locked { opacity: .4; cursor: default; }
.l-id { font: italic 900 18px var(--font); }
.l-ico { font-size: 11px; opacity: .8; }
.l-stars { color: var(--yellow); letter-spacing: 1px; font-size: 14px; }
.lvl-sheet { position: fixed; inset: auto 0 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); background: rgba(11,2,33,.97); border-top: 2px solid var(--yellow); display: flex; flex-direction: column; align-items: center; gap: 10px; animation: pop .25s ease-out; z-index: 5; }
.lvl-sheet .list, .goals { width: min(420px, 100%); }
.goals .item { padding: 8px 10px; }
.goals .i-icon { color: var(--yellow); }
.won { color: var(--yellow); text-shadow: 0 0 20px var(--yellow); }
.vstars { display: flex; gap: 10px; font-size: 56px; line-height: 1; }
.vstars span { color: rgba(255,255,255,.15); }
.vstars span.had { color: rgba(255,230,0,.35); }
.vstars span.on { color: var(--yellow); text-shadow: 0 0 22px var(--yellow); animation: starIn .45s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }

/* ---------- Modificadores ---------- */
.mods-btn { padding: 8px; font-size: 14px; }
.btn.mut { border-color: #39ff14; background: rgba(57,255,20,.1); box-shadow: 0 0 14px rgba(57,255,20,.3); }
.mod-total { font: 800 15px var(--font); color: var(--yellow); min-height: 20px; }
.mod-total small { color: var(--muted); font-weight: 600; }
.mod-grid { width: min(440px, 100%); display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mod { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px; border-radius: 12px; text-align: left;
  border: 1px solid rgba(255,255,255,.15); background: var(--panel); color: #fff; font-family: var(--font); }
.mod .mi { font-size: 22px; }
.mod b { font: italic 900 14px var(--font); }
.mod small { font-size: 11px; color: var(--muted); }
.mod em { position: absolute; top: 8px; right: 10px; font: 900 12px var(--font); font-style: normal; color: var(--yellow); }
.mod.on { border-color: var(--pink); background: rgba(255,43,214,.15); box-shadow: 0 0 12px rgba(255,43,214,.4); }
.mod.locked { opacity: .45; }
#modTag { position: absolute; top: calc(78px + env(safe-area-inset-top)); left: 12px; font-size: 14px; letter-spacing: 2px; opacity: .85; pointer-events: none; }

/* ---------- Prestigio ---------- */
.prest { color: var(--yellow); text-shadow: 0 0 8px var(--yellow); }
.btn.prestige { width: 100%; margin-top: 8px; padding: 10px; font-size: 16px; border-color: var(--yellow); color: var(--yellow);
  background: linear-gradient(90deg, rgba(255,230,0,.15), rgba(255,43,214,.15)); box-shadow: 0 0 18px rgba(255,230,0,.45); animation: glowPulse 1.6s ease-in-out infinite; }
@keyframes glowPulse { 50% { box-shadow: 0 0 30px rgba(255,230,0,.8); } }
.btn.prestige small { display: block; font-size: 11px; color: #fff; opacity: .8; }
.btn.prestige.confirm { border-color: #ff2d55; color: #ff2d55; box-shadow: 0 0 18px rgba(255,45,85,.6); }
.ship-chip.gold { border-color: #ffd60a; box-shadow: 0 0 10px rgba(255,214,10,.45), inset 0 0 8px rgba(255,214,10,.2); }

/* ---------- Hangar: cabecera fija y pestañas ---------- */
#hangar { padding-top: 0; gap: 10px; overflow-anchor: none; } /* el sitio lo restaura showHangar: sin "anclaje" del navegador que lo mueva */
#hangar > :first-child { margin-top: 0; }
.hangar-top {
  position: sticky; top: 0; z-index: 4; width: calc(100% + 32px); margin: 0 -16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 8px;
  background: linear-gradient(#170530 85%, rgba(23,5,48,.0)); backdrop-filter: blur(6px);
}
.h-bar { width: min(440px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.h-bar > b { font: italic 900 20px var(--font); letter-spacing: 1px; text-shadow: 0 0 12px var(--pink); }
.h-bar .gems { margin: 0; font-size: 15px; }
.h-back { width: auto; padding: 6px 10px; font-size: 12px; animation: none; }
.h-tabs { width: min(440px, 100%); display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.06); }
.h-tabs button { position: relative; padding: 11px 2px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: italic 900 13px var(--font); letter-spacing: .3px; }
.h-tabs button.on { background: rgba(255,43,214,.22); color: #fff; box-shadow: 0 0 10px rgba(255,43,214,.35), inset 0 -3px 0 var(--pink); }
.h-tabs button.dot::after { content: ''; position: absolute; top: 5px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.tab-panel { width: min(440px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tab-panel.hidden { display: none; }
.tab-panel .hint { margin: 0; }

/* ---------- Arena ---------- */
.modes { display: flex; gap: 8px; width: min(360px, 100%); }
.btn.mode { flex: 1; border-color: #ff6a00; background: rgba(255,106,0,.14); box-shadow: 0 0 16px rgba(255,106,0,.35); }
#arenaHud { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
#arenaHud button { pointer-events: auto; }
.ah-xp { position: absolute; top: env(safe-area-inset-top, 0px); left: 0; right: 0; height: 6px; background: rgba(255,255,255,.1); }
.ah-xp i { position: absolute; inset: 0; background: linear-gradient(90deg, #00e5ff, #7df9ff); transform-origin: left; transform: scaleX(0); box-shadow: 0 0 8px #7df9ff; }
.ah-top { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); left: 12px; right: 60px; display: flex; justify-content: space-between; align-items: flex-start; font-family: var(--font); }
.ah-top b { display: block; font: italic 900 22px var(--font); text-shadow: 0 0 10px var(--cyan); }
.ah-top small { color: var(--muted); font-size: 11px; }
.ah-lvl { font: 900 12px var(--font); color: var(--yellow); text-align: center; }
.ah-lvl b { font-size: 20px; color: var(--yellow); text-shadow: 0 0 10px var(--yellow); }
.ah-right { text-align: right; }
.ah-weapons { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 62px); left: 12px; display: flex; gap: 4px; font-size: 18px; }
.ah-weapons sub { font: 900 11px var(--font); color: var(--yellow); }
#arenaPause { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.4); color: #fff; }
#arenaAbility { position: absolute; right: 18px; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); width: 72px; height: 72px; border-radius: 50%; border: 0; font-size: 30px; color: #fff;
  background: conic-gradient(var(--cyan) calc(var(--f, 1) * 360deg), rgba(255,255,255,.12) 0); box-shadow: 0 0 18px rgba(0,229,255,.4); }
#arenaAbility.ready { box-shadow: 0 0 26px var(--cyan); }
#arenaAbility span { display: grid; place-items: center; position: absolute; inset: 5px; border-radius: 50%; background: #120626; }
.ah-hint { position: absolute; bottom: calc(env(safe-area-inset-bottom, 0px) + 110px); left: 0; right: 0; text-align: center; font: 800 13px var(--font); color: #fff; opacity: .8; }
.ah-hint.hidden { display: none; }
.au-options { display: flex; flex-direction: column; gap: 10px; width: min(420px, 100%); }
.au-opt { display: flex; align-items: center; gap: 12px; padding: 14px; text-align: left; border-radius: 14px; border: 2px solid rgba(255,255,255,.2); background: var(--panel); color: #fff; font-family: var(--font); animation: pop .25s ease-out; }
.au-opt .au-icon { font-size: 34px; }
.au-opt .au-body { display: flex; flex-direction: column; gap: 2px; }
.au-opt small { font: 900 11px var(--font); letter-spacing: 1px; color: var(--cyan); }
.au-opt b { font: italic 900 18px var(--font); }
.au-opt em { font-style: normal; font-size: 12px; color: var(--muted); }
.au-opt.k-passive small { color: #30d158; }
.au-opt.k-evolve { border-color: var(--yellow); box-shadow: 0 0 18px rgba(255,230,0,.5); }
.au-opt.k-evolve small { color: var(--yellow); }

/* ---------- Expedición ---------- */
.btn.mode.exp { border-color: #30d158; background: rgba(48,209,88,.12); box-shadow: 0 0 16px rgba(48,209,88,.3); }
.em-status { display: flex; gap: 14px; font: 800 14px var(--font); }
.em-status span:last-child { color: var(--yellow); letter-spacing: 2px; }
.em-map { position: relative; width: min(400px, 92%); flex-shrink: 0; }
.em-lines { position: absolute; inset: 0; overflow: visible; }
.em-lines line { stroke: rgba(255,255,255,.15); stroke-width: 2; stroke-dasharray: 4 5; }
.em-lines line.open { stroke: var(--yellow); stroke-width: 3; stroke-dasharray: none; filter: drop-shadow(0 0 4px var(--yellow)); }
.em-lines line.walked { stroke: var(--cyan); stroke-width: 3; stroke-dasharray: none; }
.em-node { position: absolute; transform: translate(-50%, -50%); width: 58px; height: 58px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,.2); background: #140830; color: #fff; font-family: var(--font); padding: 0; }
.em-node span { font-size: 22px; line-height: 1; }
.em-node small { font: 800 11px var(--font); margin-top: 2px; }
.em-node.locked { opacity: .35; }
.em-node.done { opacity: .55; border-color: var(--cyan); }
.em-node.here { border-color: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.em-node.open { border-color: var(--yellow); box-shadow: 0 0 16px rgba(255,230,0,.6); animation: glowPulse 1.2s ease-in-out infinite; }
.em-node.t-boss { width: 70px; height: 70px; border-color: #ff2d55; }
.em-node.t-elite { border-color: #ff9f0a; }
.ev-icon { font-size: 56px; }
.ev-text { max-width: 340px; text-align: center; color: #ddd; font-size: 15px; line-height: 1.4; }
.ev-choices { display: flex; flex-direction: column; gap: 10px; width: min(360px, 100%); }
.ev-choices .btn { font-size: 15px; }

/* ---------- Carreras ---------- */
.btn.mode.race { border-color: var(--cyan); background: rgba(0,229,255,.1); box-shadow: 0 0 16px rgba(0,229,255,.3); }
.modes { flex-wrap: wrap; }
.modes .btn.mode { flex: 1 1 45%; }
#raceTag { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 100px); left: 50%; transform: translateX(-50%); padding: 4px 12px; border-radius: 10px;
  background: rgba(0,0,0,.45); font: italic 900 20px var(--font); color: #fff; text-shadow: 0 0 10px var(--cyan); pointer-events: none; }
#raceTag.first { color: var(--yellow); text-shadow: 0 0 12px var(--yellow); }
#raceTag.hidden { display: none; }
.rc-list { display: flex; flex-direction: column; gap: 12px; width: min(420px, 100%); }
.rc-cup { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--cc); background: rgba(0,0,0,.35); box-shadow: 0 0 14px color-mix(in srgb, var(--cc) 35%, transparent); }
.rc-cup.locked { opacity: .45; filter: grayscale(.7); }
.rc-top { display: flex; justify-content: space-between; align-items: center; }
.rc-top b { font: italic 900 18px var(--font); color: var(--cc); }
.rc-top span { font-size: 26px; }
.rc-tracks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rc-tracks div { display: flex; flex-direction: column; padding: 6px; border-radius: 8px; background: rgba(255,255,255,.05); }
.rc-tracks small { font: 800 11px var(--font); }
.rc-tracks em { font-style: normal; font-size: 11px; color: var(--muted); }
.rp-order { display: flex; flex-direction: column; gap: 6px; width: min(360px, 100%); }
.rp-order div { display: grid; grid-template-columns: 38px 1fr auto 34px; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--panel); border-left: 4px solid var(--rc); }
.rp-order div.you { background: rgba(0,229,255,.15); box-shadow: 0 0 10px rgba(0,229,255,.35); }
.rp-order b { font: italic 900 18px var(--font); }
.rp-order span { font: 900 14px var(--font); }
.rp-order em { font-style: normal; color: var(--muted); font-size: 13px; }
.rp-order small { color: var(--yellow); font: 900 12px var(--font); }
.rp-cup { display: flex; flex-direction: column; gap: 3px; width: min(300px, 100%); font-size: 13px; }
.rp-cup > small { color: var(--muted); font: 900 11px var(--font); letter-spacing: 1px; }
.rp-cup div.you { color: var(--cyan); }
.rp-cup em { float: right; font-style: normal; }
.rp-medal { margin-top: 4px; text-align: center; font: italic 900 20px var(--font); color: var(--yellow); }

/* ---------- Galaxia ---------- */
.btn.galaxy { width: min(360px, 100%); padding: 16px; font-size: 22px; border-color: #7df9ff; color: #fff;
  background: linear-gradient(120deg, rgba(0,229,255,.25), rgba(191,90,242,.3)); box-shadow: 0 0 26px rgba(125,249,255,.5), inset 0 0 18px rgba(191,90,242,.35); }
#spaceHud { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
#spaceHud button { pointer-events: auto; }
.sh-top { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 12px; right: 60px; display: flex; justify-content: space-between; gap: 10px; }
.sh-bars { display: flex; flex-direction: column; gap: 4px; width: 46%; }
.sh-bar { position: relative; height: 7px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.sh-bar i { position: absolute; inset: 0; transform-origin: left; }
.sh-bar.shield i { background: #7df9ff; box-shadow: 0 0 6px #7df9ff; }
.sh-bar.hull i { background: #30d158; }
.sh-bar.cargo { flex: 1; }
.sh-bar.cargo i { background: #ffe600; }
.sh-cargo { display: flex; align-items: center; gap: 6px; font: 800 11px var(--font); }
.sh-cred { font: italic 900 18px var(--font); color: var(--yellow); text-shadow: 0 0 8px var(--yellow); }
.sh-obj { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 62px); left: 12px; right: 58px; text-align: center; font: 800 13px var(--font); color: var(--yellow);
  text-shadow: 0 1px 4px #000; }
#spacePause { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 10px); right: 12px; width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.4); color: #fff; }
#btnFire { position: absolute; right: 18px; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); width: 84px; height: 84px; border-radius: 50%; font-size: 32px;
  border: 3px solid #ff2d55; background: rgba(255,45,85,.22); box-shadow: 0 0 18px rgba(255,45,85,.5); touch-action: none; }
#btnFire:active { background: rgba(255,45,85,.5); }
#btnBoost { position: absolute; right: 116px; bottom: calc(env(safe-area-inset-bottom, 0px) + 34px); width: 60px; height: 60px; border-radius: 50%; font-size: 24px;
  border: 2px solid var(--cyan); background: rgba(0,229,255,.18); color: #fff; touch-action: none; }
#btnBoost.cool { opacity: .4; }
#btnDock { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 262px); transform: translateX(-50%); padding: 14px 22px; border-radius: 14px;
  border: 2px solid #30d158; background: rgba(48,209,88,.25); color: #fff; font: italic 900 18px var(--font); box-shadow: 0 0 20px rgba(48,209,88,.6); animation: glowPulse 1.2s infinite; }
#btnDock.hidden { display: none; }
.sh-hint { position: absolute; bottom: calc(env(safe-area-inset-bottom, 0px) + 196px); padding: 0 70px; left: 0; right: 0; text-align: center; font: 800 13px var(--font); color: #fff; opacity: .8; }
.sh-hint.hidden { display: none; }
.st-title { font-size: 24px; text-align: center; }
.st-block { width: min(420px, 100%); display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--panel); border: 1px solid rgba(255,255,255,.12); }
.st-block.hidden { display: none; }
.st-block h3 { margin: 0; }
.st-cargo div { display: flex; justify-content: space-between; font-size: 14px; }
.st-cargo small { color: var(--muted); }
.st-ups { display: flex; flex-direction: column; gap: 8px; }
.st-up { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.04); color: #fff; font-family: var(--font); text-align: left; }
.st-up.afford { border-color: var(--yellow); box-shadow: 0 0 10px rgba(255,230,0,.35); }
.st-up .su-icon { font-size: 26px; }
.st-up .su-body { flex: 1; display: flex; flex-direction: column; }
.st-up .su-body small { color: var(--muted); font-size: 11px; }
.st-up .su-body i { font-style: normal; color: var(--cyan); letter-spacing: 2px; font-size: 12px; }
.st-up .su-cost { font: 900 13px var(--font); color: var(--yellow); }
.st-up.shake { animation: shake .3s; }
.sh-bar.heat i { background: linear-gradient(90deg, #ffe600, #ff2d55); }
.sh-bar.heat.over { animation: shake .3s infinite; }
.sh-sys { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 36px); right: 60px; text-align: right; font: italic 900 11px var(--font); color: var(--muted); letter-spacing: 1px; }
#btnGalMap { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 54px); right: 12px; width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.4); font-size: 18px; }
.st-buy { display: flex; flex-direction: column; gap: 6px; }
.st-buy small { color: var(--muted); font-size: 12px; }
.gm-wrap { position: relative; width: min(440px, 100%); height: min(58vh, 560px); border-radius: 14px; background: radial-gradient(circle, #1a0a3a, #05020d); border: 1px solid rgba(125,249,255,.25); overflow: hidden; touch-action: none; flex: none; }
#gmSvg { width: 100%; height: 100%; }
#gmSvg line { stroke: rgba(125,249,255,.28); }
#gmSvg line.path { stroke: var(--yellow); }
#gmSvg line.gm-arrow { stroke: transparent; }
.gm-node { cursor: pointer; }
.gm-node circle.core { stroke: rgba(255,255,255,.85); }
.gm-node circle.hit { stroke: none; } /* zona táctil grande e invisible */
.gm-here { fill: none; stroke: var(--cyan); transform-box: fill-box; transform-origin: center; animation: gmPulse 1.6s ease-in-out infinite; }
.gm-sel { fill: none; stroke: var(--yellow); }
@keyframes gmPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(1.18); } }
.gm-badge circle { fill: #0b0420; stroke: rgba(255,255,255,.45); }
.gm-badge text { text-anchor: middle; dominant-baseline: central; }
.gm-more { fill: #fff; font-weight: 900; dominant-baseline: central; }
#gmSvg text.gm-label { fill: #fff; font-family: system-ui; font-weight: 900; text-anchor: middle; paint-order: stroke; stroke: #05020d; stroke-linejoin: round; pointer-events: none; }
.gm-zoom { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.gm-zoom button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(125,249,255,.4); background: rgba(5,2,13,.75); color: #fff; font: 900 18px var(--font); }
.gm-layers { width: min(440px, 100%); display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.gm-layer { padding: 7px 2px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.35); color: var(--muted); font: 800 11px var(--font); white-space: nowrap; }
.gm-layer.on { color: #fff; border-color: var(--cyan); background: rgba(0,229,255,.15); }
.gm-route { color: var(--yellow) !important; }
.gm-legend-box { width: min(440px, 100%); border-radius: 12px; border: 1px solid rgba(255,255,255,.15); background: rgba(0,0,0,.35); padding: 8px 12px; }
.gm-legend-box summary { font: 900 13px var(--font); cursor: pointer; }
.gl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; }
.gl-row b { width: 100%; font-size: 12px; color: var(--muted); }
.gl-row span, .gl-icons span { display: inline-flex; align-items: center; gap: 4px; }
.gl-row i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.gl-row i.ring, .gl-icons i.ring { background: none; border: 3px solid; width: 10px; height: 10px; }
.gl-row i.dash { border-style: dashed; }
.gl-icons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 10px; font-size: 12px; }
.gl-icons i.ring.here { display: inline-block; border-radius: 50%; border-color: var(--cyan); }
.gl-icons i.line { display: inline-block; width: 18px; height: 4px; border-radius: 2px; background: var(--yellow); }
.gm-info { width: min(420px, 100%); display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; min-height: 60px; }
.gm-info small { color: var(--muted); }
.gm-info .warn { color: #ff9f0a; }
.st-missions { display: flex; flex-direction: column; gap: 8px; }
.st-missions > small { color: var(--muted); }
.st-mis { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); }
.st-mis > span { font-size: 22px; }
.st-mis > div { flex: 1; display: flex; flex-direction: column; }
.st-mis b { font-size: 13px; }
.st-mis small { color: var(--yellow); font-size: 11px; }
.st-mis .btn { width: auto; padding: 8px 10px; font-size: 12px; animation: none; }
.st-mis.active { border-color: #30d158; background: rgba(48,209,88,.08); }
.at-perks { display: flex; flex-direction: column; gap: 6px; width: min(420px, 100%); }
.at-perks div { padding: 8px 10px; border-radius: 10px; background: var(--panel); opacity: .55; }
.at-perks div.on { opacity: 1; border: 1px solid var(--yellow); box-shadow: 0 0 10px rgba(255,230,0,.3); }
.at-perks small { display: block; color: var(--muted); font-size: 11px; }

/* ---------- Hub (menú principal) ---------- */
.hub { justify-content: flex-start; gap: var(--sp-3); }
.hub-top { width: min(440px, 100%); display: grid; grid-template-columns: 56px 1fr 44px; align-items: center; gap: var(--sp-2); }
.logo.small { font-size: clamp(30px, 10vw, 44px); margin: 0; text-align: center; }
.hub-badge { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--cyan); background: rgba(0,229,255,.12); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 0 12px rgba(0,229,255,.4); }
.hub-badge span { font: italic 900 18px/1 var(--font); }
.hub-badge small { font: 900 11px var(--font); color: var(--muted); }
.hub-badge.prest { border-color: var(--yellow); box-shadow: 0 0 14px rgba(255,230,0,.5); }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.35); font-size: 20px; }
.hub-stats { display: flex; gap: var(--sp-4); }
.hub-stats div, .hub-stats .wallet { display: flex; flex-direction: column; align-items: center; min-width: 110px; padding: 6px 12px; border-radius: var(--r-1); background: rgba(0,0,0,.3); }
.hub-stats b { font: italic 900 22px var(--font); }
.hub-stats small { color: var(--muted); font-size: 11px; }
.hub .rank { width: min(440px, 100%); }
.hub-hero { width: min(440px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.hero-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); min-height: 96px; padding: var(--sp-3); border-radius: var(--r-3); color: #fff; text-align: left; font-family: var(--font); }
.hero-card .hc-icon { font-size: 30px; line-height: 1; }
.hero-card .hc-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hero-card b { font: italic 900 22px var(--font); letter-spacing: .5px; }
.hero-card small { font-size: 11px; color: rgba(255,255,255,.75); overflow: hidden; text-overflow: ellipsis; }
.hero-card.galaxy { border: 2px solid #7df9ff; background: linear-gradient(140deg, rgba(0,229,255,.28), rgba(191,90,242,.32)); box-shadow: 0 0 22px rgba(125,249,255,.4); }
.hero-card.runner { padding: 0; border: 2px solid var(--pink); background: linear-gradient(140deg, rgba(255,43,214,.3), rgba(255,106,0,.2)); box-shadow: 0 0 22px rgba(255,43,214,.4); overflow: hidden; }
.hero-card.runner .hc-main { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-3); border: 0; background: transparent; color: #fff; text-align: left; font-family: var(--font); }
.hero-card.runner .hc-mods { position: absolute; top: 6px; right: 6px; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.35); color: #fff; font-size: 14px; }
.hc-mods small { font: 900 11px var(--font); color: var(--yellow); }
.mission-chip { width: min(440px, 100%); display: flex; align-items: center; gap: var(--sp-2); padding: 10px 14px; border-radius: var(--r-2); border: 1px solid rgba(255,255,255,.18); background: var(--panel); color: #fff; font: 800 14px var(--font); }
.mission-chip b { margin-left: auto; color: var(--yellow); }
.mission-chip .chev { transition: transform .2s; }
.mission-chip.open .chev { transform: rotate(180deg); }
.missions.collapsed { display: none; }
.hub-h { margin: var(--sp-1) 0 0; width: min(440px, 100%); text-align: left; }
.mode-grid { width: min(440px, 100%); display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.mode-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px; border-radius: var(--r-2); border: 1px solid var(--tc, rgba(255,255,255,.2)); background: rgba(0,0,0,.35); color: #fff; font-family: var(--font); }
.mode-tile span { font-size: 26px; }
.mode-tile b { font: italic 900 13px var(--font); }
.mode-tile small { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.2; }
.t-camp { --tc: #ffe600; } .t-arena { --tc: #ff6a00; } .t-exp { --tc: #30d158; } .t-race { --tc: #00e5ff; } .t-daily { --tc: #ff2bd6; } .t-mut { --tc: #39ff14; }
.mode-tile:active, .hero-card:active, .hc-main:active, .btn:active, .set-row:active { transform: scale(.97); }

/* ---------- Barra inferior y cabeceras ---------- */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 8px calc(env(safe-area-inset-bottom, 0px) + 6px); background: rgba(10,3,24,.96); border-top: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(8px); }
.bottom-nav.hidden { display: none; }
.bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border: 0; border-radius: var(--r-1); background: transparent; color: var(--muted); font-family: var(--font); }
.bottom-nav button span { font-size: 22px; filter: grayscale(.6); }
.bottom-nav button small { font: 800 11px var(--font); }
.bottom-nav button.on { color: #fff; background: rgba(255,43,214,.15); }
.bottom-nav button.on span { filter: none; }
/* las pantallas con barra inferior terminan ENCIMA de ella: nada queda tapado */
#menu, #hangar, #store, #achs, #codex { bottom: calc(env(safe-area-inset-bottom, 0px) + 74px); padding-bottom: 16px; }
.scr-head { position: sticky; top: 0; z-index: 3; width: calc(100% + 32px); margin: calc(-1 * var(--sp-3)) -16px 0; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; background: linear-gradient(#170530 85%, transparent); }
.scr-head b { font: italic 900 20px var(--font); text-align: center; letter-spacing: 1px; text-shadow: 0 0 10px var(--pink); }
.scr-back { width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.4); color: #fff; font: 900 20px var(--font); }
.overlay:has(> .scr-head) { justify-content: flex-start; padding-top: 0; }
.overlay > .scr-head:first-child { margin-top: calc(-1 * var(--sp-3)); }
.hub > :first-child { margin-top: 0; }
.overlay:has(> .scr-head) > .scr-head + * { margin-top: var(--sp-2); }

/* ---------- Ajustes ---------- */
#settings { background: radial-gradient(ellipse at top, #1d0838, var(--bg) 70%); }
.set-list { width: min(420px, 100%); display: flex; flex-direction: column; gap: var(--sp-2); }
.set-list h3 { margin: var(--sp-3) 0 0; text-align: left; }
.set-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: var(--sp-2); padding: 12px 14px; border-radius: var(--r-2);
  border: 1px solid rgba(255,255,255,.15); background: var(--panel); color: #fff; font: 800 15px var(--font); text-align: left; }
.set-row span { font-size: 20px; }
.set-row .sw { width: 44px; height: 24px; border-radius: 12px; background: var(--cyan); position: relative; transition: background .2s; }
.set-row .sw::after { content: ''; position: absolute; top: 3px; left: 23px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .2s; }
.set-row.off .sw { background: rgba(255,255,255,.2); }
.set-row.off .sw::after { left: 3px; }
.set-row input[type=range] { width: 120px; accent-color: var(--cyan); }

/* ---------- Avisos y transiciones ---------- */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); transform: translateX(-50%); z-index: 20; max-width: 86%;
  padding: 10px 16px; border-radius: var(--r-2); background: rgba(10,3,24,.95); border: 1px solid var(--yellow); color: #fff; font: 800 14px var(--font); text-align: center; pointer-events: none; }
.toast.hidden { display: none; }
.toast.pop { animation: pop .25s ease-out; }
.overlay:not(.hidden) { animation: screenIn .22s ease-out; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Hangar ampliado (U2) ---------- */
.hv-wrap { position: relative; }
.expo-btn { position: absolute; right: 6px; bottom: 6px; padding: 6px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.55); color: #fff; font: 900 12px var(--font); }
.sd-head { display: flex; align-items: flex-start; gap: var(--sp-2); }
.sd-head > div { flex: 1; min-width: 0; }
.sd-head h3 em { font-size: 13px; color: var(--muted); font-style: normal; }
.name-btn { flex-shrink: 0; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--sc, #fff); background: rgba(0,0,0,.35); color: #fff; font: 800 12px var(--font); }
.cos i.sw-engine, .cos i.sw-shot, .cos i.sw-aura { display: block; width: 26px; height: 26px; margin: 0 auto 2px; border-radius: 50%; }
.cos i.sw-engine { background: radial-gradient(circle at 50% 35%, #fff, var(--c) 45%, transparent 72%); }
.cos i.sw-shot { width: 30px; height: 8px; margin-top: 9px; margin-bottom: 11px; border-radius: 4px; background: var(--c); box-shadow: 0 0 8px var(--c); }
.cos i.sw-aura { border: 3px solid var(--c); box-shadow: 0 0 10px var(--c), inset 0 0 8px var(--c); }
.gal-tab { width: 100%; }
.gal-tab h3 { margin: var(--sp-3) 0 var(--sp-2); text-align: left; }
.st-ship { color: var(--cyan); font-size: 13px; }
.expo { padding: 0 0 var(--sp-3); background: #05010d; }
.expo #expoView { width: 100%; height: 52vh; display: block; touch-action: none; }
.expo-info { text-align: center; margin-top: calc(-1 * var(--sp-4)); }
.expo-info b { display: block; font: italic 900 26px var(--font); text-shadow: 0 0 12px var(--pink); }
.expo-info small { color: var(--muted); font-size: 13px; }
.expo-nav { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); margin: var(--sp-2) 0; }
.expo-nav > button:not(.btn) { width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.4); color: #fff; font: 900 26px var(--font); }
#expoCompare.on { background: var(--cyan); color: #000; }
.expo-stats { width: min(420px, calc(100% - 32px)); }
.cmp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-2); font-size: 13px; }
.cmp-head span { color: var(--muted); }
.bar.duo { position: relative; }
.stat .bar.duo { height: 10px; }
.bar.duo:has(.b2) i:first-child { bottom: 50%; }
.bar.duo .b2 { top: 50%; }

/* ---------- Vuelo libre (U3) ---------- */
.roll-btn { position: absolute; bottom: calc(env(safe-area-inset-bottom, 0px) + 122px); width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid rgba(125,249,255,.6); background: rgba(0,0,0,.45); color: #7df9ff; font: 900 24px var(--font); }
.roll-btn.l { right: 92px; }
.roll-btn.r { right: 28px; }
.roll-btn:active { background: rgba(125,249,255,.3); }
.throttle { position: absolute; left: 8px; bottom: calc(env(safe-area-inset-bottom, 0px) + 40px); width: 54px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 0; border-radius: 14px; background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.2); pointer-events: auto; }
.throttle small { font: 900 11px var(--font); color: var(--muted); }
.throttle b { font: 900 11px var(--font); color: #fff; white-space: nowrap; }
.throttle.rev b { color: #ff9f0a; }
.thr-track { position: relative; width: 34px; height: 170px; }
/* raíl de colores: naranja = marcha atrás (abajo), cian = adelante; la muesca separa los dos */
.thr-track::before { content: ''; position: absolute; left: 50%; top: 8px; bottom: 8px; width: 6px; margin-left: -3px; border-radius: 3px;
  background: linear-gradient(to top, #ff9f0a 0 28.6%, #30d158 28.6% 30%, var(--cyan) 30% 100%); opacity: .55; }
.throttle input { position: relative; writing-mode: vertical-lr; direction: rtl; width: 34px; height: 170px; accent-color: var(--cyan); touch-action: none; background: transparent; }
.thr-notch { position: absolute; left: -4px; right: -4px; bottom: calc(8px + (100% - 16px) * 0.286 - 1px); height: 3px; border-radius: 2px; background: #30d158; box-shadow: 0 0 6px #30d158; pointer-events: none; }
.throttle.stop { border-color: #30d158; box-shadow: 0 0 14px rgba(48,209,88,.45); }
.throttle.stop b { color: #30d158; }
#btnInv { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 98px); right: 12px; width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.4); font-size: 18px; }
.stick-vis { position: fixed; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); background: rgba(255,255,255,.05); pointer-events: none; z-index: 3; }
.stick-vis.hidden { display: none; }
.stick-vis i { position: absolute; left: 36px; top: 36px; width: 48px; height: 48px; border-radius: 50%; background: rgba(125,249,255,.45); box-shadow: 0 0 14px rgba(125,249,255,.6); }

/* ---------- Galaxia: combate y contenido (U4) ---------- */
#btnMissile { position: absolute; right: 190px; bottom: calc(env(safe-area-inset-bottom, 0px) + 36px); width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid #ffe600; background: rgba(255,230,0,.15); font-size: 22px; color: #fff; touch-action: none; }
#btnMissile b { position: absolute; right: -4px; top: -4px; min-width: 20px; padding: 1px 4px; border-radius: 10px; background: #ffe600; color: #000; font: 900 11px var(--font); }
#btnMissile.lock { border-color: #ff2d55; background: rgba(255,45,85,.35); box-shadow: 0 0 16px rgba(255,45,85,.7); }
#btnMissile.hidden, #btnAct.hidden { display: none; }
#btnAct { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 262px); transform: translateX(-50%); padding: 12px 20px; border-radius: 14px;
  border: 2px solid #ffe600; background: rgba(255,230,0,.2); color: #fff; font: italic 900 17px var(--font); box-shadow: 0 0 18px rgba(255,230,0,.5); }
.planet-info { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); text-align: center; }
.planet-info h3 { margin: 0; font: italic 900 26px var(--font); }
.planet-info p { margin: 0; color: #ddd; }
.pl-type { color: var(--cyan); font-weight: 800; }
.pl-first { color: var(--yellow) !important; font-weight: 800; }
.pl-globe { position: relative; width: 140px; height: 140px; border-radius: 50%; margin: var(--sp-2) 0;
  background: radial-gradient(circle at 35% 30%, var(--c1), var(--c2) 65%, #020108); box-shadow: 0 0 40px var(--c1), inset -20px -16px 40px rgba(0,0,0,.7); animation: glowPulse 3s infinite; }
.pl-globe i { position: absolute; left: -40px; right: -40px; top: 58px; height: 24px; border-radius: 50%; border: 5px solid var(--c1); opacity: .7; transform: rotate(-12deg); }
.pl-trade { width: 100%; display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3); border-radius: var(--r-2); background: var(--panel); border: 1px solid rgba(255,255,255,.15); }

/* ---------- Economía (E1) ---------- */
.hub-stats { gap: var(--sp-2); }
.hub-stats .wallet { border: 1px solid rgba(255,255,255,.15); color: #fff; font-family: var(--font); min-width: 0; }
.hub-stats div, .hub-stats .wallet { min-width: 96px; }
.wallet-info { width: min(440px, 100%); padding: var(--sp-3); border-radius: var(--r-2); background: var(--panel); border: 1px solid rgba(255,255,255,.15); font-size: 13px; text-align: left; }
.wallet-info p { margin: 4px 0; }
.wallet-info.hidden { display: none; }
.hc-boosts { position: absolute; left: 8px; top: 6px; font-size: 14px; }
.st-tabs { grid-template-columns: repeat(3, 1fr) !important; }
.st-tabs button { white-space: nowrap; font-size: 11px; }
.st-wallet { margin: var(--sp-1) 0; }
.store-body { width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--sp-2); }
.store-body .hint { text-align: center; }
.crate-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--sp-4); border-radius: var(--r-3); background: var(--panel); border: 2px solid rgba(255,255,255,.2); text-align: center; }
.crate-card.c-elite { border-color: var(--yellow); box-shadow: 0 0 20px rgba(255,214,10,.3); }
.crate-card .cc-icon { font-size: 48px; animation: glowPulse 2s infinite; }
.crate-card b { font: italic 900 20px var(--font); }
.crate-card small { font-size: 12px; line-height: 1.5; }
.crate-card small i { font-style: normal; white-space: nowrap; }
.boost-row { display: grid; grid-template-columns: 34px 1fr auto auto; align-items: center; gap: var(--sp-2); padding: 10px; border-radius: var(--r-2); background: var(--panel); border: 1px solid rgba(255,255,255,.12); }
.boost-row.on { border-color: var(--cyan); box-shadow: 0 0 12px rgba(0,229,255,.3); }
.boost-row .i-icon { font-size: 24px; }
.boost-row b em { color: var(--yellow); font-style: normal; }
.boost-row small { display: block; color: var(--muted); font-size: 12px; }
.boost-row .btn { padding: 8px 10px; font-size: 12px; min-width: 0; }
.tal-tree { display: flex; flex-direction: column; gap: 6px; }
.tal-tree h3 { margin: var(--sp-2) 0 0; text-align: left; }
.tal-node { display: grid; grid-template-columns: 22px 1fr auto; grid-template-rows: auto auto; column-gap: var(--sp-2); align-items: center; padding: 10px 12px; border-radius: var(--r-1);
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.12); color: var(--muted); text-align: left; font-family: var(--font); opacity: .6; }
.tal-node small { grid-row: span 2; font: 900 14px var(--font); }
.tal-node b { color: #fff; font-size: 14px; }
.tal-node span { grid-column: 2; font-size: 12px; }
.tal-node em { grid-row: 1 / span 2; grid-column: 3; font-style: normal; font-weight: 900; color: var(--yellow); }
.tal-node.bought { opacity: 1; border-color: #30d158; }
.tal-node.bought em { color: #30d158; }
.tal-node.next { opacity: 1; border-color: rgba(255,255,255,.4); }
.tal-node.next.afford { border-color: var(--yellow); box-shadow: 0 0 12px rgba(255,214,10,.35); }
.co-items { width: min(420px, 100%); display: flex; flex-direction: column; gap: var(--sp-2); margin: var(--sp-3) 0; }
.co-item { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: var(--sp-2); align-items: center; padding: 12px 14px; border-radius: var(--r-2);
  background: var(--panel); border: 2px solid var(--rc); box-shadow: 0 0 16px var(--rc); opacity: 0; animation: crateIn .45s ease-out forwards; }
.co-item span { grid-row: span 2; font-size: 32px; text-align: center; }
.co-item b { font: italic 900 17px var(--font); }
.co-item small { font-weight: 800; font-size: 12px; }
@keyframes crateIn { 0% { opacity: 0; transform: scale(.6) rotateY(90deg); } 70% { transform: scale(1.06); } 100% { opacity: 1; transform: none; } }

/* ---------- Árbol de mejoras (E1b) ---------- */
.tree-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px; }
.tree-head b { font: italic 900 20px var(--font); color: var(--yellow); }
.tree-head small { color: var(--muted); font-size: 12px; }
.branch { position: relative; }
/* las ramas se unen con una línea que se enciende al comprar */
.branch .node { position: relative; }
.branch .node + .node::before { content: ''; position: absolute; left: 50%; top: -8px; width: 2px; height: 8px; background: rgba(255,255,255,.15); }
.branch .node.bought + .node::before, .branch .node.bought + .node.bought::before { background: #30d158; box-shadow: 0 0 6px #30d158; }
.node.mastery { width: 100%; padding: 12px; border: 2px dashed rgba(255,214,10,.35); background: rgba(255,214,10,.06); }
.node.mastery small { color: var(--yellow); font-size: 13px; }
.node.mastery.bought { border-style: solid; border-color: var(--yellow); background: rgba(255,214,10,.16); box-shadow: 0 0 18px rgba(255,214,10,.35); }
.tree-reset { width: 100%; font-size: 13px; }
.tree-reset small { color: var(--muted); }
.tree-sheet { position: fixed; inset: 0; z-index: 8; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.55); padding: 0 12px calc(env(safe-area-inset-bottom, 0px) + 86px); }
.tree-sheet.hidden { display: none; }
.ts-card { width: min(440px, 100%); padding: var(--sp-4); border-radius: var(--r-3); background: #160530; border: 1px solid rgba(255,255,255,.2); box-shadow: 0 -8px 40px rgba(0,0,0,.6); animation: screenIn .2s ease-out; }
.ts-title { display: block; font: italic 900 18px var(--font); margin-bottom: 4px; }
.ts-card p { margin: 0 0 var(--sp-2); font-size: 14px; }
.ts-ab { color: var(--cyan); font-size: 13px !important; }
.ts-act { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.ts-act .btn { flex: 1; padding: 12px 8px; font-size: 16px; white-space: nowrap; }
.stat .bar u.gain { position: absolute; top: 0; bottom: 0; background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }

/* ---------- Mazo, arsenal y estilos nuevos (E1c) ---------- */
.deck-list { width: min(440px, 100%); display: flex; flex-direction: column; gap: 6px; }
.deck-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: var(--sp-2); padding: 8px 10px; border-radius: var(--r-1);
  background: var(--panel); border: 1px solid rgba(255,255,255,.12); text-align: left; }
.deck-row.r-rare { border-color: rgba(191,90,242,.45); }
.deck-row.r-epic { border-color: rgba(255,159,10,.5); }
.deck-row.locked { opacity: .75; }
.dk-icon { font-size: 24px; text-align: center; }
.dk-body { display: flex; flex-direction: column; min-width: 0; }
.dk-body b { font-size: 14px; }
.dk-body b em { font-style: normal; font-size: 11px; color: var(--yellow); }
.dk-body small { color: var(--muted); font-size: 12px; }
.dk-body i { font-style: normal; color: var(--yellow); font-size: 12px; letter-spacing: 2px; }
.deck-row .btn { padding: 8px 10px; font-size: 11px; white-space: nowrap; }
.dk-max { color: #30d158; font-weight: 900; font-size: 12px; }
.cos i.sw-stripe { display: block; width: 30px; height: 26px; margin: 0 auto 2px; border-radius: 6px; background: #1a1a2a; position: relative; overflow: hidden; }
.cos i.sw-stripe::before, .cos i.sw-stripe::after { content: ''; position: absolute; top: 0; bottom: 0; background: var(--c); }
.cos i.sw-stripe.s-single::before { left: 13px; width: 4px; }
.cos i.sw-stripe.s-double::before { left: 9px; width: 3px; }
.cos i.sw-stripe.s-double::after { left: 18px; width: 3px; }
.cos i.sw-stripe.s-wide::before { left: 8px; width: 14px; }
.cos i.sw-stripe.none::before { left: 4px; right: 4px; top: 12px; bottom: 12px; background: rgba(255,255,255,.4); }
.cos i.sw-cockpit { display: block; width: 28px; height: 18px; margin: 4px auto 6px; border-radius: 50% 50% 30% 30%; background: linear-gradient(160deg, #fff 0 15%, var(--c) 40%); box-shadow: 0 0 8px var(--c); }

/* ---------- Logros con estilo (E2) ---------- */
.ach-prize { display: flex !important; align-items: center; gap: 6px; color: var(--yellow) !important; font-weight: 800; }
.ach-sw { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(255,255,255,.4); flex-shrink: 0; }
.ach-item .ach-eq { padding: 6px 8px; font-size: 11px; white-space: nowrap; }

/* ---------- Facciones y caza (E3) ---------- */
#stFaction small { display: block; color: var(--muted); font-size: 12px; margin: 4px 0; }
#stFaction .rep { display: flex; align-items: center; gap: var(--sp-2); margin: 6px 0; }
#stFaction .rep .m-bar { flex: 1; }
#stFaction .rep b { font-size: 13px; white-space: nowrap; }
.gm-bounty { font-size: 22px; }
.gm-legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.gm-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 3px solid; margin-right: 3px; vertical-align: -2px; }

/* ---------- Fabricación e historia (E4) ---------- */
.st-mats { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 8px; font-size: 13px; }
.st-mats small { color: var(--muted); }
.st-slots { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.st-slots > div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.st-slots small { width: 64px; color: var(--muted); font-weight: 900; font-size: 11px; }
.st-slots .slot { padding: 4px 8px; border-radius: 8px; border: 1px dashed rgba(255,255,255,.25); font-size: 12px; color: var(--muted); }
.st-slots .slot.full { border-style: solid; border-color: var(--cyan); color: #fff; }
.st-up.on { border-color: #30d158 !important; }
.st-up b em { font-style: normal; font-size: 11px; color: var(--muted); }
.cr-cost { color: var(--yellow) !important; }
/* arriba, bajo las barras: así no tapa los mandos de vuelo (disparo, alabeo, acelerador) */
.dialog { position: fixed; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 150px); z-index: 30; display: flex; justify-content: center; padding: 0 12px; pointer-events: none; }
.dialog.hidden { display: none; }
.dl-card { pointer-events: auto; width: min(460px, 100%); padding: var(--sp-4); border-radius: var(--r-3); background: rgba(14,4,30,.97); border: 1px solid #bf5af2; box-shadow: 0 0 30px rgba(191,90,242,.45); animation: screenIn .2s ease-out; }
.dl-who { display: flex; align-items: center; gap: var(--sp-2); }
.dl-who span { font-size: 30px; }
.dl-who b { font: italic 900 17px var(--font); }
.dl-card p { margin: var(--sp-2) 0; font-size: 15px; line-height: 1.4; }
.dl-acts { display: flex; gap: var(--sp-2); }
.dl-acts .btn { flex: 1; padding: 10px; font-size: 14px; }
.at-story { width: min(440px, 100%); display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--sp-3); }
.at-story h3 { margin: 0 0 4px; }
.at-story > div { padding: 8px 12px; border-radius: var(--r-1); background: var(--panel); border: 1px solid rgba(255,255,255,.1); text-align: left; }
.at-story > div.now { border-color: #bf5af2; box-shadow: 0 0 12px rgba(191,90,242,.35); }
.at-story > div.done b { color: #30d158; }
.at-story > div.locked { opacity: .5; }
.at-story small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- Menú: 3 juegos y pantalla RUNNER ---------- */
.hub-games { width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--sp-2); }
.game-card { position: relative; display: grid; grid-template-columns: 56px 1fr 24px; align-items: center; gap: var(--sp-3); min-height: 96px; padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-3); color: #fff; text-align: left; font-family: var(--font); border: 2px solid var(--gc); background: linear-gradient(120deg, color-mix(in srgb, var(--gc) 30%, transparent), rgba(0,0,0,.4));
  box-shadow: 0 0 20px color-mix(in srgb, var(--gc) 40%, transparent); }
.game-card.g-runner { --gc: #ff2bd6; }
.game-card.g-galaxy { --gc: #7df9ff; }
.game-card.g-arena { --gc: #ff6a00; }
.gc-icon { font-size: 40px; text-align: center; }
.gc-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gc-text b { font: italic 900 24px var(--font); letter-spacing: .5px; }
.gc-text small { font-size: 12px; color: rgba(255,255,255,.75); }
.gc-text em { font-style: normal; font-weight: 900; font-size: 13px; color: var(--yellow); }
.gc-go { font: 900 30px var(--font); color: rgba(255,255,255,.6); }
.game-card:active { transform: scale(.98); }
.rh-main { width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--sp-2); position: relative; }
#runnerHub .hero-card.runner { min-height: 120px; padding: var(--sp-4); flex-direction: row; align-items: center; gap: var(--sp-3); border: 2px solid var(--pink); }
#runnerHub .hero-card .hc-icon { font-size: 42px; }
#runnerHub .hero-card b { font-size: 28px; }
#runnerHub .hc-mods { position: static; width: 100%; height: auto; padding: 12px; border-radius: var(--r-2); border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.45); color: #fff; font: 900 13px var(--font); }
#runnerHub .hc-mods small { color: var(--yellow); margin-left: 6px; }
#runnerHub .hc-boosts { left: auto; right: 12px; top: 10px; font-size: 18px; }
.mode-grid.two { grid-template-columns: repeat(2, 1fr); }
.mode-grid.two .mode-tile { padding: 16px 6px; }
.hub-stats .wallet { flex: 1; }

/* ---------- Panel de vuelo: inventario y misiones ---------- */
.gi-tabs { grid-template-columns: repeat(3, 1fr) !important; }
.gi-body { width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--sp-2); }
.gi-block { padding: var(--sp-3); border-radius: var(--r-2); background: var(--panel); border: 1px solid rgba(255,255,255,.12); text-align: left; }
.gi-block h3 { margin: 0 0 6px; text-align: left; }
.gi-block .m-bar { margin-bottom: 6px; }
.gi-row { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; align-items: baseline; padding: 4px 0; border-top: 1px solid rgba(255,255,255,.06); font-size: 14px; }
.gi-row small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.gi-row.total b { color: var(--yellow); }
.gi-row.empty span { color: var(--muted); }
.gi-row .dots { color: var(--cyan); letter-spacing: 2px; }
.gi-mats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.gi-mats small { color: var(--muted); }
.gi-mis { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-2); background: var(--panel); border: 1px solid rgba(255,255,255,.12); text-align: left; }
.gi-mis > span { font-size: 22px; }
.gi-mis b { display: block; font-size: 14px; }
.gi-mis small { color: var(--muted); font-size: 12px; }
.gi-mis.story { border-color: #bf5af2; }
.gi-mis.bounty { border-color: #ff9f0a; }
.gi-mis.lib { border-color: #ff2d55; }
.gi-x { padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.gi-block .m-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.gi-block .m-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); transform-origin: left; }

/* cabecera del hangar compacta al bajar: la nave sigue a la vista pero deja sitio a la lista */
.hangar-top.compact .carousel { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; overflow: hidden; pointer-events: none; }
.hangar-top.compact .hangar-view { height: 90px; }

/* ---------- Mercado y consumibles (G1) ---------- */
#stCargo .sat { font-style: normal; font-size: 11px; color: #ff9f0a; }
#btnItems { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 142px); right: 12px; width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.4); font-size: 18px; }
.item-bar { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 142px); right: 56px; display: flex; gap: 6px; pointer-events: auto; }
.item-bar.hidden { display: none; }
.item-bar .ib { position: relative; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--cyan); background: rgba(0,0,0,.55); color: #fff; font-size: 20px; padding: 0; }
.item-bar .ib b { position: absolute; right: -4px; top: -6px; min-width: 18px; padding: 0 4px; border-radius: 9px; background: var(--cyan); color: #000; font: 900 11px var(--font); }
.item-bar .ib small { position: absolute; left: 3px; bottom: 1px; font: 900 10px var(--font); color: var(--muted); }
.item-bar .ib.empty { opacity: .35; border-color: rgba(255,255,255,.2); }

/* ---------- Astillero, Mk y niveles de equipo (G2) ---------- */
.st-up .mk, .su-body i .mk, .dots .mk { font-style: normal; color: rgba(255,255,255,.25); }
.su-body i .mk.on, .dots .mk.on { color: #ff9f0a; text-shadow: 0 0 6px #ff9f0a; }
.su-body b em.mk { color: #ff9f0a; font-style: normal; }
.gear-up { display: inline-block; margin-top: 4px; padding: 3px 8px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); font-size: 11px; font-weight: 800; color: var(--muted); }
.gear-up.afford { border-color: var(--yellow); color: var(--yellow); }

/* ---------- Puestos avanzados (G3) ---------- */
#stOutpost.hidden { display: none; }
#stOutpost { border-color: rgba(48,209,88,.45); }
#stOutpost small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.op-store { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.op-store small { flex-basis: 100%; margin: 0 !important; }
#stOutpost .op-store .btn { flex: 1; min-height: 0; padding: 9px 10px; font-size: 13px; }

/* ---------- Hangar: sin rebote al compactar y botón de la nave siempre a mano ---------- */
#hangar::after { content: ''; flex: 0 0 var(--hspace, 0px); }
.ship-detail > .btn { position: sticky; bottom: 8px; z-index: 2; box-shadow: 0 6px 18px rgba(0,0,0,.6); }
.ship-detail > .btn.ghost { background: #1b0a33; }

/* ---------- Arena: mapas ---------- */
.arena-maps { width: min(440px, 100%); display: flex; flex-direction: column; gap: 10px; }
.arena-map { --am: var(--pink); display: flex; align-items: center; gap: 12px; padding: 14px 12px; border-radius: var(--r-2); border: 2px solid var(--am); background: linear-gradient(120deg, rgba(0,0,0,.55), color-mix(in srgb, var(--am) 18%, transparent)); color: #fff; text-align: left; font-family: var(--font); }
.arena-map.last { box-shadow: 0 0 16px color-mix(in srgb, var(--am) 55%, transparent); }
.arena-map.locked { opacity: .5; border-style: dashed; }
.am-icon { font-size: 34px; width: 44px; text-align: center; }
.am-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.am-body b { font: italic 900 18px var(--font); }
.am-body small { color: var(--muted); font-size: 12px; }
.am-body em { font-style: normal; font-size: 11px; color: var(--am); font-weight: 800; letter-spacing: .5px; }
.am-rec { font: 900 13px var(--font); color: var(--yellow); white-space: nowrap; }

/* ---------- Historia: chasis que solo da el Acto III ---------- */
#stShipyard .st-up.locked { opacity: .6; border-style: dashed; }
#stShipyard .st-up.locked .su-cost { color: #bf5af2; font-size: 12px; }

/* ---------- Arena: sin fin, cambiar y vetar ---------- */
.au-tools { display: flex; gap: 8px; width: min(400px, 100%); }
.au-tools .btn { flex: 1; padding: 10px; font-size: 13px; }
.au-tools .btn.on { border-color: #ff2d55; color: #ff2d55; box-shadow: 0 0 12px rgba(255,45,85,.5); }
.au-tools .hidden { display: none; }
#arenaChoice h2.won { color: var(--yellow); text-shadow: 0 0 18px var(--yellow); }
#arenaChoice .btn { width: min(360px, 100%); }

/* ---------- Carreras: contrarreloj ---------- */
.rc-tabs { width: min(440px, 100%); grid-template-columns: 1fr 1fr; margin-bottom: 4px; }
.tt-row { --cc: var(--cyan); width: min(440px, 100%); display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r-2); border: 1px solid var(--cc); background: rgba(0,0,0,.4); color: #fff; text-align: left; font-family: var(--font); }
.tt-medal { font-size: 26px; width: 34px; text-align: center; }
.tt-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tt-body b { font: italic 900 15px var(--font); }
.tt-body small { color: var(--muted); font-size: 11px; }
.tt-row em { font: 900 13px var(--font); color: var(--yellow); font-style: normal; }

/* ---------- Expedición: reliquias y forja ---------- */
.em-relics { letter-spacing: 2px; }
.em-node.t-forge small { color: #ff9f0a; }

/* ---------- Galaxia: sucesos y noticias ---------- */
.gi-mis.war { border-color: #ff2d55; }
.gi-mis.swarm { border-color: #ffd60a; }
.gi-news { display: flex; flex-direction: column; gap: 6px; }
.gi-news div { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.gi-news small { color: var(--muted); white-space: nowrap; }

/* ---------- Galaxia: amenaza y búsqueda ---------- */
.sh-wanted { font-size: 13px; letter-spacing: -1px; text-align: right; text-shadow: 0 0 8px #ff2d55; min-height: 0; }

/* ---------- PECIOS ---------- */
.game-card.g-pecio { --gc: #c8d6e5; }
#pecioHud { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
#pecioHud button { pointer-events: auto; }
.pc-top { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 12px; right: 112px; display: flex; flex-direction: column; gap: 4px; }
.pc-top b { font: italic 900 18px var(--font); color: #fff; }
.pc-top small { display: block; color: var(--muted); font: 800 11px var(--font); letter-spacing: 1px; }
.pc-hearts { font-size: 15px; letter-spacing: -1px; }
.pc-bag { display: flex; gap: 12px; font: 900 14px var(--font); color: #fff; }
.pc-btns { position: absolute; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); display: grid; grid-template-columns: 1.3fr 1.3fr 1fr; gap: 8px; }
.pc-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 2px; border-radius: 14px; border: 1px solid rgba(125,249,255,.45); background: rgba(5,3,11,.8); color: #fff; font-family: var(--font); }
.pc-btn span { font-size: 22px; line-height: 1; }
.pc-btn small { font: 900 10px var(--font); letter-spacing: .5px; color: var(--muted); white-space: nowrap; }
.pc-btn.cool { opacity: .5; }
/* PECIOS: equipo, mochila y botín */
.pc-gear { display: flex; gap: 4px; margin-top: 2px; }
.pg-it { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--rc); background: rgba(5,3,11,.75); font-size: 13px; box-shadow: 0 0 8px var(--rc); }
.pg-it.big { width: 48px; height: 48px; font-size: 24px; border-radius: 12px; }
.pc-bagbar { position: absolute; right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); display: flex; gap: 6px; }
.pc-cons { pointer-events: auto; display: flex; align-items: center; gap: 3px; padding: 7px 9px; border-radius: 12px; border: 1px solid rgba(125,249,255,.45); background: rgba(5,3,11,.8); color: #fff; font: 900 13px var(--font); }
.pc-cons span { font-size: 18px; }
.loot-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.loot-vs > div > small { display: block; text-align: center; font: 900 10px var(--font); letter-spacing: 1px; color: var(--muted); margin-bottom: 4px; }
.loot-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 8px; border-radius: 14px; border: 2px solid var(--rc, #555); background: rgba(5,3,11,.8); box-shadow: 0 0 14px color-mix(in srgb, var(--rc, #555) 45%, transparent); text-align: center; }
.loot-card.empty { min-height: 90px; justify-content: center; color: var(--muted); }
.loot-card .lc-icon { font-size: 30px; }
.loot-card b { font: italic 900 15px var(--font); }
.loot-card .lc-rar { color: var(--rc); font: 900 11px var(--font); letter-spacing: 1px; text-transform: uppercase; }
.loot-card .lc-set { color: #ffd60a; font-weight: 800; }
.loot-card.unique { box-shadow: 0 0 0 2px #ffd60a, 0 0 22px rgba(255,214,10,.45); }
.loot-card small { color: #dfe6ee; font-size: 12px; }
.pe-vault { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 6px 0; text-align: center; }
.pe-vault-row { display: flex; gap: 8px; justify-content: center; }
.pause-gear { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 40vh; overflow-y: auto; text-align: left; }
.pg-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: rgba(5,3,11,.6); }
.pg-row b { font: italic 900 14px var(--font); }
.pg-row i { font: 900 10px var(--font); letter-spacing: 1px; text-transform: uppercase; font-style: normal; }
.pg-row small { display: block; color: var(--muted); font-size: 11px; }
.pause-gear .pg-set { display: block; color: #ffd60a; font: 800 12px var(--font); padding: 2px 10px; }
.pc-btn.on { border-color: var(--yellow); box-shadow: 0 0 14px rgba(255,230,0,.55); }
.pc-btn.on small { color: var(--yellow); }
#pecioHub .hero-card.pecio { width: min(440px, 100%); min-height: 110px; flex-direction: row; align-items: center; gap: var(--sp-3); padding: var(--sp-4); border: 2px solid #c8d6e5; background: linear-gradient(140deg, rgba(200,214,229,.18), rgba(90,200,250,.18)); box-shadow: 0 0 22px rgba(200,214,229,.3); }
#pecioHub .hero-card .hc-icon { font-size: 42px; }
#pecioHub .hero-card b { font-size: 26px; }
.ph-wallet { margin: 0; }
.ph-info { width: min(440px, 100%); display: flex; flex-direction: column; gap: 10px; }
.ps-items { width: min(400px, 100%); display: flex; flex-direction: column; gap: 8px; }

/* ESTILO: sitio abajo para la barra de prueba flotante; el estilo del emblema, apagado sin emblema */
#hangar .tab-panel[data-panel="estilo"] { padding-bottom: 110px; }
.cos-style.off { opacity: .35; pointer-events: none; }
#expoView { touch-action: none; cursor: grab; }

/* ESTILO: iconos en mini lienzo (diseños, cabinas, estelas y explosiones) */
.cos canvas.sw-cv { width: 44px; height: 28px; display: block; border-radius: 6px; background: rgba(0,0,0,.35); }
.cos svg path:not([stroke-width]) { stroke: none; } /* sin trazo: el grosor 1 se comía la forma del emblema */

/* ESTILO · LOOKS guardados y barra de prueba con varias cosas */
.looks { width: 100%; display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.looks > small { font: 900 11px var(--font); letter-spacing: 1px; color: var(--muted); }
.looks-row { display: flex; gap: 6px; }
.looks-row.hidden { display: none; }
.look { flex: 1; display: flex; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: var(--panel); overflow: hidden; }
.look button { border: 0; background: transparent; color: #fff; font: 900 12px var(--font); padding: 8px 4px; }
.look .look-use { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; }
.look .look-use i { width: 18px; height: 18px; border-radius: 5px; box-shadow: 0 0 0 1px rgba(255,255,255,.3); }
.look.empty .look-use { color: var(--muted); }
.look .look-save { width: 34px; border-left: 1px solid rgba(255,255,255,.12); }
.looks-row.tools button, #lookCopyTo button { flex: 1; padding: 8px 4px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: var(--panel); color: #fff; font: 900 11px var(--font); }
#lookCopyTo { flex-wrap: wrap; }
#lookCopyTo button { flex: 0 0 auto; padding: 7px 10px; border-color: var(--cyan); }
.pv-items { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.pv-x { padding: 4px 8px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; font: 800 11px var(--font); }
/* con la barra de prueba abierta, los avisos salen por encima de ella (no la tapan) */
body:has(#cosPreview:not(.hidden)) .toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 250px); }

/* EXPO: vuelo, equipar o comprar, y solo las mías */
.expo-acts { display: flex; align-items: center; justify-content: center; gap: 8px; width: min(420px, calc(100% - 32px)); margin-bottom: var(--sp-2); }
.expo-acts .btn { flex: 1; margin: 0; padding: 10px 6px; font-size: 13px; }
.expo-tog { padding: 10px 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.4); color: #fff; font: 900 12px var(--font); white-space: nowrap; }
.expo-tog.on { background: var(--cyan); color: #000; border-color: var(--cyan); }

/* Ajustes abiertos desde la pausa: nada de la partida asoma por encima ni a través */
body.in-settings #hud, body.in-settings #spaceHud, body.in-settings #arenaHud, body.in-settings #pecioHud, body.in-settings .stick-vis { visibility: hidden; }

/* RUNNER: el tramo en el que vas, con una barrita hasta el final del tramo */
#secTag { margin-top: 3px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font: 900 12px var(--font); letter-spacing: 1px; color: var(--yellow); text-shadow: 0 0 8px rgba(0,0,0,.8); }
#secTag.hidden { display: none; }
#secTag .sec-bar { display: block; width: 74px; height: 4px; border-radius: 3px; background: rgba(255,255,255,.18); overflow: hidden; }
#secTag .sec-bar b { display: block; height: 100%; background: var(--yellow); transform-origin: left; transform: scaleX(0); }
