* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #05060d;
  overflow: hidden;
}

body {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  color: #dffcff;
  user-select: none;
  -webkit-user-select: none;
}

#wrap { position: fixed; inset: 0; }

/* ---------------------------------------------------------------- phone gate
   Touch-only devices see this instead of the game (the inline check in
   index.html sets html.phone-gate). */
#phone-gate { display: none; }
html.phone-gate, html.phone-gate body { overflow: auto; height: auto; min-height: 100%; }
html.phone-gate #wrap { display: none; }
html.phone-gate #phone-gate {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background:
    radial-gradient(ellipse at 50% 0%, rgba(75, 225, 255, .14), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 75, 216, .12), transparent 55%),
    linear-gradient(rgba(90, 120, 255, .08) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(90, 120, 255, .08) 1px, transparent 1px) 0 0 / 28px 28px,
    #05060d;
  user-select: text;
  -webkit-user-select: text;
}
.pg-card { width: 100%; max-width: 420px; text-align: center; }
.pg-logo { width: 64px; height: 64px; filter: drop-shadow(0 0 10px rgba(75, 225, 255, .6)); animation: pg-pulse 2.4s ease-in-out infinite; }
@keyframes pg-pulse { 50% { filter: drop-shadow(0 0 18px rgba(255, 75, 216, .7)); } }
.pg-kicker { margin-top: 14px; font-size: 11px; letter-spacing: 3px; color: #ff4bd8; }
#phone-gate h1 { margin: 6px 0 0; font-size: 34px; letter-spacing: 8px; font-weight: 700; color: #e6fbff; text-shadow: 0 0 18px rgba(75, 225, 255, .55); }
#pg-preview { display: block; width: 100%; max-width: 320px; height: auto; aspect-ratio: 320 / 150; margin: 18px auto 4px; border: 1px solid rgba(120, 220, 255, .18); background: rgba(8, 12, 26, .7); }
#phone-gate h2 { margin: 18px 0 8px; font-size: 16px; letter-spacing: 2px; color: #4be1ff; font-weight: 700; }
#phone-gate p { margin: 0 auto; font-size: 13px; line-height: 1.6; color: #9fc6d8; max-width: 360px; }
.pg-keys { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pg-keys li { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; font-size: 10px; letter-spacing: 2px; color: #9fc6d8; text-transform: uppercase; border: 1px solid rgba(120, 220, 255, .14); background: rgba(8, 12, 26, .6); }
.pg-keys span { display: flex; gap: 3px; }
.pg-keys kbd { min-width: 22px; padding: 3px 5px; font: 700 11px ui-monospace, SFMono-Regular, Consolas, monospace; color: #e6fbff; border: 1px solid rgba(159, 244, 255, .5); border-bottom-width: 3px; border-radius: 4px; background: rgba(75, 225, 255, .08); }
.pg-keys kbd.wide { padding: 3px 10px; }
.pg-where { margin-top: 20px; font-size: 12px; color: #9fc6d8; display: flex; flex-direction: column; gap: 4px; }
.pg-where b { font-size: 15px; letter-spacing: 1px; color: #e6fbff; word-break: break-all; }
.pg-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.pg-btn { width: 100%; min-height: 48px; font: 700 14px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 3px; color: #4be1ff; background: rgba(75, 225, 255, .06); border: 1px solid rgba(75, 225, 255, .55); cursor: pointer; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); }
.pg-btn.primary { color: #05060d; background: #4be1ff; box-shadow: 0 0 22px rgba(75, 225, 255, .35); }
.pg-btn.done { background: #56ff9a; color: #05060d; }
.pg-btn.hidden { display: none; }
.pg-btn:active { transform: translateY(1px); }
.pg-anyway { margin-top: 22px; padding: 10px; font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; color: #6f8ca0; background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .pg-logo { animation: none; } }

#game {
  display: block;
  position: absolute;
  inset: 0;
  cursor: none;
}

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; }

.hud-left { position: absolute; top: 18px; left: 20px; width: 240px; }

.bar-label { font-size: 11px; letter-spacing: 2px; opacity: .7; margin-bottom: 4px; }

.bar {
  position: relative;
  height: 16px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(120, 220, 255, .35);
  border-radius: 3px;
  overflow: hidden;
}

.bar > div { height: 100%; width: 100%; }

#hp-fill { background: linear-gradient(90deg, #2bd97c, #7dffb2); transform-origin: left; transition: transform .12s linear; }

#hp-text {
  position: absolute;
  right: 6px;
  top: 0;
  font-size: 11px;
  line-height: 14px;
  color: #eafff6;
  text-shadow: 0 0 6px #000;
}

/* ARMOR: a labelled row under the hull: slanted segments, spare plates, KIT, the R key */
.armor { display: flex; align-items: center; gap: 7px; margin-top: 7px; font-size: 9px; letter-spacing: 2px; color: #6ea8ff; }
.ar-label { font-size: 10px; letter-spacing: 2px; color: #9cc3ff; opacity: .9; }
.ar-segs { display: flex; flex: 1; min-width: 0; gap: 3px; }
.ar-segs i {
  position: relative; display: block; flex: 1; min-width: 14px; height: 10px; overflow: hidden;
  background: rgba(110, 168, 255, .1); border: 1px solid rgba(110, 168, 255, .45);
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
}
.ar-segs i b { position: absolute; inset: 0; background: linear-gradient(90deg, #3d7bff, #9cc3ff); transform-origin: left; transform: scaleX(0); }
.ar-segs i.full { border-color: #9cc3ff; box-shadow: 0 0 8px rgba(110, 168, 255, .55); }
.ar-segs i.filling b { background: linear-gradient(90deg, #6ea8ff, #ffffff); }
.ar-segs i.filling { border-color: #ffffff; }
.armor.bare .ar-segs i { border-color: rgba(110, 168, 255, .3); }
.ar-sat { font-weight: 700; color: #cfe0ff; }
.ar-sat::before { content: ''; display: inline-block; width: 7px; height: 9px; margin-right: 4px; vertical-align: -1px; background: #6ea8ff; clip-path: polygon(0 0, 100% 0, 100% 65%, 50% 100%, 0 65%); }
.ar-sat.empty { opacity: .45; }
.ar-kit { padding: 1px 5px; border: 1px solid #bcd4ff; color: #fff; }
/* the R key: always there while you carry a plate, lit when a press would put one on */
.ar-hint { font: inherit; font-size: 10px; font-weight: 700; letter-spacing: 0; padding: 1px 6px; color: #9cc3ff; background: transparent; border: 1px solid rgba(110, 168, 255, .5); border-radius: 2px; }
.ar-hint.ready { color: #05060d; background: #6ea8ff; border-color: #6ea8ff; animation: arPulse 1s ease-in-out infinite; }
.armor.plating .ar-hint { opacity: .4; animation: none; }
@keyframes arPulse { 50% { background: #ffffff; box-shadow: 0 0 10px #6ea8ff; } }
@media (prefers-reduced-motion: reduce) { .ar-hint.ready { animation: none; } }
html.touch .ar-hint { display: none; }
.bar.dash { height: 6px; margin-top: 8px; border-color: rgba(120, 180, 255, .3); }
#dash-fill { background: #4be1ff; transform-origin: left; transition: transform .08s linear; }

/* OVERDRIVE meter: fills from kills, pulses when ready, drains while active */
.bar.od { height: 12px; margin-top: 8px; border-color: rgba(255, 209, 102, .35); }
#od-fill { background: linear-gradient(90deg, #ff8c42, #ffd166); transform-origin: left; transform: scaleX(0); transition: transform .12s linear; }
#od-text {
  position: absolute; left: 6px; top: 0; font-size: 9px; line-height: 11px; letter-spacing: 2px;
  color: #fff4d6; text-shadow: 0 0 5px #000; opacity: .75;
}
.bar.od.ready { border-color: #ffd166; box-shadow: 0 0 12px rgba(255, 209, 102, .55); animation: od-pulse .9s ease-in-out infinite; }
.bar.od.ready #od-text { opacity: 1; }
.bar.od.active #od-fill { background: linear-gradient(90deg, #ff4bd8, #ffffff); }
.bar.od.active { border-color: #ff4bd8; box-shadow: 0 0 14px rgba(255, 75, 216, .6); }
@keyframes od-pulse { 50% { box-shadow: 0 0 22px rgba(255, 209, 102, .9); } }

/* Squad panel: every teammate's hull, status and revive clock at a glance */
.squad { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.reinforce { margin-top: 12px; display: flex; align-items: center; gap: 8px; font-size: 9px; letter-spacing: 2px; color: #7df0ff; }
.reinforce .rf-label { opacity: .75; }
.reinforce .rf-pips { display: inline-flex; gap: 4px; }
.reinforce .rf-pips i {
  width: 10px; height: 12px; background: rgba(125, 240, 255, .12); border: 1px solid rgba(125, 240, 255, .35);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.reinforce .rf-pips i.on { background: #7df0ff; box-shadow: 0 0 8px #7df0ff; border-color: #7df0ff; }
.reinforce.low { color: #ffd166; }
.reinforce.low .rf-pips i.on { background: #ffd166; border-color: #ffd166; }
.reinforce.empty { color: #ff5d7d; }
.reinforce.empty .rf-label::after { content: ' \2022  NONE LEFT'; }
.reinforce.bump { animation: rfBump .6s ease; }
@keyframes rfBump { 30% { transform: scale(1.12); filter: brightness(1.8); } }
.sq-row { display: grid; grid-template-columns: 10px 1fr 64px; align-items: center; gap: 6px; font-size: 10px; letter-spacing: 1px; }
.sq-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.sq-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq-bar { grid-column: 2 / 4; height: 4px; background: rgba(255, 255, 255, .08); border-radius: 2px; overflow: hidden; }
.sq-bar > div { height: 100%; width: 100%; transform-origin: left; background: #7dffb2; transition: transform .12s linear; }
.sq-state { text-align: right; opacity: .8; }
.sq-row.down .sq-state { color: #ff5d7d; opacity: 1; animation: od-blink .6s steps(2) infinite; }
.sq-row.down { background: rgba(255, 93, 125, .14); box-shadow: inset 3px 0 0 #ff5d7d; animation: sqDown 1.1s ease-in-out infinite; }
@keyframes sqDown { 50% { background: rgba(255, 93, 125, .3); } }
.sq-row.ghost { opacity: .55; }
.sq-row.reviving .sq-state { color: #56ff9a; animation: none; }
.sq-row.od .sq-state { color: #ffd166; }
@keyframes od-blink { 50% { opacity: .35; } }

/* What's new card on the main menu */
.whats-new {
  position: absolute; right: 22px; bottom: 22px; max-width: 330px; text-align: left; font-size: 11px; line-height: 1.5;
  border: 1px solid rgba(255, 209, 102, .35); border-radius: 6px; padding: 10px 14px;
  background: rgba(255, 209, 102, .05);
}
@media (max-width: 1100px) {
  .whats-new { position: static; margin: 0 auto; max-width: 460px; }
}
.whats-new h4 { margin: 0 0 4px; font-size: 11px; letter-spacing: 3px; color: #ffd166; }
.whats-new ul { margin: 0; padding-left: 16px; opacity: .85; }
.perk-list .squad-head { margin: 10px 0 4px; font-size: 11px; letter-spacing: 2px; opacity: .8; }

.hud-right { position: absolute; top: 18px; right: 20px; text-align: right; }
.stat { display: flex; gap: 10px; justify-content: flex-end; font-size: 20px; line-height: 1.2; }
.stat .k { font-size: 11px; opacity: .6; letter-spacing: 2px; align-self: center; }

.hud-center { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); text-align: center; }
#wave-text { font-size: 15px; letter-spacing: 3px; opacity: .9; }
#mode-text { font-size: 11px; letter-spacing: 4px; opacity: .5; margin-bottom: 2px; }
#mutator-text { font-size: 10px; letter-spacing: 2px; opacity: .8; margin-top: 2px; }
#timer-text { font-size: 22px; letter-spacing: 3px; color: #ffd166; margin-top: 2px; }
#enemy-text { font-size: 11px; letter-spacing: 2px; opacity: .55; margin-top: 3px; }

/* Boss bar: name + title, a phase notch where the next phase starts, and a
   cast line that names the attack being wound up. --bc is the boss colour. */
#boss-bar { --bc: #ff3b6b; margin-top: 10px; width: min(520px, 60vw); }
#boss-bar .boss-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 5px; }
#boss-label { font-size: 15px; letter-spacing: 5px; color: var(--bc); text-shadow: 0 0 12px var(--bc); }
#boss-title { font-size: 10px; letter-spacing: 2px; color: #9fc6d8; flex: 1; text-align: left; }
#boss-pct { font-size: 11px; letter-spacing: 1px; color: #e6fbff; opacity: .85; }
#boss-bar .bar { position: relative; height: 12px; border-color: color-mix(in srgb, var(--bc) 55%, transparent); overflow: visible; }
#boss-fill { background: linear-gradient(90deg, var(--bc), color-mix(in srgb, var(--bc) 55%, #ffffff)); transform-origin: left; transition: transform .1s linear; box-shadow: 0 0 10px color-mix(in srgb, var(--bc) 60%, transparent); }
.boss-notch { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: #ffffff; box-shadow: 0 0 6px #ffffff; }
.boss-notch.passed { opacity: .25; box-shadow: none; }
.boss-cast { display: flex; align-items: center; gap: 10px; margin-top: 7px; font-size: 10px; letter-spacing: 2px; }
.boss-cast b { color: #ffffff; font-size: 12px; letter-spacing: 3px; white-space: nowrap; }
.boss-cast .cast-bar { flex: 0 0 150px; height: 6px; background: rgba(0, 0, 0, .5); border: 1px solid rgba(255, 255, 255, .5); }
#boss-cast-fill { height: 100%; background: #ffffff; box-shadow: 0 0 8px #ffffff; transform-origin: left; transform: scaleX(0); }
#boss-cast-hint { color: #9fc6d8; white-space: nowrap; }
@keyframes cast-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.boss-cast:not(.hidden) { animation: cast-in .15s ease-out; }
/* a boss MECHANIC: red name, a LETHAL tag, a red fill */
.boss-cast.lethal b { color: #ff3b6b; text-shadow: 0 0 10px rgba(255, 59, 107, .7); }
.boss-cast.lethal b::after { content: 'LETHAL'; margin-left: 8px; padding: 1px 5px; font-size: 9px; letter-spacing: 2px; color: #05060d; background: #ff3b6b; vertical-align: 2px; }
.boss-cast.lethal .cast-bar { border-color: rgba(255, 59, 107, .8); }
.boss-cast.lethal #boss-cast-fill { background: #ff3b6b; box-shadow: 0 0 10px #ff3b6b; }
.boss-cast.lethal #boss-cast-hint { color: #ffd1da; }
#over-sub.cause { color: #ff8fa6; letter-spacing: 1px; text-transform: none; }

.hud-bottom {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  align-items: baseline;
}
#weapon-text { font-size: 16px; letter-spacing: 3px; color: #9ff4ff; }
#ammo-text { font-size: 14px; opacity: .75; }
/* two-slot weapon panel: the gun in hand is a card, the holster sits beside */
.slot { display: flex; align-items: baseline; gap: 10px; padding: 6px 12px; border-radius: 6px; }
.slot.hand {
  position: relative; background: rgba(8, 14, 24, .72); border: 1px solid rgba(120, 220, 255, .35);
  box-shadow: 0 0 14px rgba(75, 225, 255, .12);
}
.slot.hand.evolved { border-color: #ffb000; box-shadow: 0 0 16px rgba(255, 176, 0, .3); }
.slot .slot-key { font-size: 9px; letter-spacing: 2px; opacity: .5; }
.ammo-bar { position: absolute; left: 10px; right: 10px; bottom: 3px; height: 2px; background: rgba(255, 255, 255, .08); }
#ammo-fill { height: 100%; width: 100%; transform-origin: left; background: #9ff4ff; transition: transform .1s linear; }
.slot.alt { background: rgba(8, 14, 24, .55); border: 1px dashed rgba(120, 220, 255, .35); font-size: 11px; letter-spacing: 2px; opacity: .85; }
.slot.alt.suggest { opacity: 1; color: #ffd166; border-style: solid; animation: swap-pulse .8s ease-in-out infinite; }
@keyframes swap-pulse { 50% { box-shadow: 0 0 18px rgba(255, 209, 102, .6); transform: translateY(-2px); } }
.hud-bottom { align-items: center; }

#combo-text {
  position: absolute;
  right: 28px;
  top: 46%;
  font-size: 30px;
  color: #ffd166;
  text-shadow: 0 0 14px rgba(255, 209, 102, .6);
  opacity: 0;
  transition: opacity .15s linear, font-size .1s ease;
}
#combo-text.show { opacity: 1; }
#combo-text.hot { color: #ff7d5d; font-size: 40px; text-shadow: 0 0 20px rgba(255, 125, 93, .85); }

/* ---------- Banner ---------- */
#banner {
  position: absolute;
  top: 28%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.9);
  font-size: clamp(30px, 6vw, 58px);
  letter-spacing: 10px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 0 26px currentColor;
  white-space: nowrap;
  z-index: 20;
}
#banner small {
  display: block;
  font-size: 13px;
  letter-spacing: 6px;
  opacity: .8;
  margin-top: 10px;
  text-shadow: none;
}
#banner.show { animation: bannerIn 1.9s ease forwards; }

/* Small toasts for status news (streaks, overdrive), so only real calls to
   action get the big banner. */
#toast {
  position: absolute; left: 50%; top: 96px; transform: translateX(-50%);
  font-size: 13px; letter-spacing: 3px; pointer-events: none; opacity: 0; z-index: 6;
  text-shadow: 0 0 10px currentColor; white-space: nowrap;
}
#toast.show { animation: toastIn 1.6s ease forwards; }
@keyframes toastIn {
  0% { opacity: 0; transform: translate(-50%, 6px); }
  12% { opacity: 1; transform: translate(-50%, 0); }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

/* One-time contextual tips */
.tip {
  position: absolute; right: 22px; bottom: 90px; max-width: 330px; z-index: 7;
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start;
  padding: 10px 12px; font-size: 12px; line-height: 1.45; letter-spacing: .5px;
  background: rgba(8, 12, 22, .92); border: 1px solid rgba(75, 225, 255, .5); border-radius: 6px;
  box-shadow: 0 0 18px rgba(75, 225, 255, .2); animation: tipIn .25s ease;
}
.tip b { color: #4be1ff; letter-spacing: 2px; font-size: 11px; }
.tip button { background: none; border: 0; color: #9fb3c8; font: inherit; font-size: 16px; cursor: pointer; line-height: 1; pointer-events: auto; }
@keyframes tipIn { from { opacity: 0; transform: translateY(8px); } }

.guide { width: min(820px, 94vw); display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; text-align: left; }
.guide section { padding: 10px 14px; border: 1px solid rgba(120, 200, 230, .18); border-radius: 6px; background: rgba(255, 255, 255, .03); }
.guide h3 { margin: 0 0 6px; font-size: 12px; letter-spacing: 3px; color: #4be1ff; }
.guide p { margin: 4px 0; font-size: 12px; line-height: 1.55; opacity: .88; }
.guide b { color: #dffcff; }

@keyframes bannerIn {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.82); }
  12%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  78%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.04); }
}

/* ---------- Overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  gap: 20px;
  overflow-y: auto;
  padding: 24px;
  background: radial-gradient(ellipse at center, rgba(8, 10, 20, .82), rgba(3, 4, 9, .96));
  z-index: 10;
  text-align: center;
  padding: 24px;
}

.title {
  font-size: clamp(40px, 9vw, 92px);
  letter-spacing: 14px;
  margin: 0;
  color: #dffcff;
  text-shadow: 0 0 30px rgba(75, 225, 255, .75);
}
.title span { color: #4be1ff; }

.tagline { margin: 0; opacity: .72; font-size: 13px; letter-spacing: 1px; }

.btn {
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  letter-spacing: 4px;
  padding: 14px 46px;
  color: #031018;
  background: #4be1ff;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 0 24px rgba(75, 225, 255, .45);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 0 36px rgba(75, 225, 255, .75); }
.btn:active { transform: translateY(0) scale(.99); }
.btn.ghost { background: transparent; color: #9fd7e8; border: 1px solid rgba(120, 200, 230, .4); box-shadow: none; }
.btn.ghost:hover { box-shadow: 0 0 18px rgba(75, 225, 255, .25); }

.controls {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px 26px;
  font-size: 12px;
  opacity: .78;
  letter-spacing: 0;
}
.controls b { color: #4be1ff; }

.hint { font-size: 12px; opacity: .62; letter-spacing: 0; margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, auto)); gap: 10px 28px; }
.stats div { text-align: center; }
.stats span { display: block; font-size: 11px; letter-spacing: 1px; opacity: .7; margin-bottom: 2px; }
.stats b { font-size: 22px; }

.best { color: #ffd166; letter-spacing: 4px; margin: 0; animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: .55; } to { opacity: 1; } }

#overlay-over h2 { color: #ff5d7d; text-shadow: 0 0 26px rgba(255, 59, 107, .6); }
#overlay-pause h2 { color: #ffd166; text-shadow: 0 0 26px rgba(255, 209, 102, .45); }

h2 { letter-spacing: 8px; font-size: 34px; margin: 0; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; gap: 10px 26px; width: min(560px, 86vw); }

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 12px;
  letter-spacing: 1px;
}
.set-row label { opacity: .8; }
.set-row input[type="range"] { width: 220px; accent-color: #4be1ff; }

.seg {
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  letter-spacing: 2px;
  padding: 6px 14px;
  min-width: 64px;
  color: #9fd7e8;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(120, 200, 230, .35);
  border-radius: 3px;
}
.seg.on, .seg:hover { color: #031018; background: #4be1ff; border-color: #4be1ff; }
.seg-group { display: flex; gap: 6px; }
.seg-group .seg { min-width: 74px; }

.btn-row { display: flex; gap: 14px; }

#fps-text { margin-top: 8px; font-size: 11px; letter-spacing: 1px; opacity: .6; }
#net-text { margin-top: 6px; font-size: 10px; letter-spacing: 1px; opacity: .72; line-height: 1.6; white-space: pre; }

#hud.minimal #enemy-text,
#hud.minimal #combo-text,
#hud.minimal #perk-count,
#hud.minimal #mutator-text,
#hud.minimal #boss-label,
#hud.minimal #boss-title,
#hud.minimal #boss-cast-hint,
#hud.minimal #od-text { display: none; }
#hud.minimal .bar { opacity: .65; }

/* ---------- Draft ---------- */
.draft-cards { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

.draft-card {
  cursor: pointer;
  width: 210px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(10, 14, 24, .92);
  border: 2px solid rgba(120, 200, 230, .35);
  border-radius: 6px;
  color: #dffcff;
  font: inherit;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.draft-card:hover { transform: translateY(-4px); }
.draft-card .glyph { font-size: 22px; font-weight: 700; letter-spacing: 2px; }
.draft-card b { font-size: 14px; letter-spacing: 2px; }
.draft-card small { font-size: 12px; letter-spacing: 0; opacity: .78; line-height: 1.5; }
.draft-card i { font-size: 11px; opacity: .62; font-style: normal; letter-spacing: 1px; }
.draft-card em { font-style: normal; font-size: 11px; letter-spacing: 1px; color: #ffd166; }
.draft-card.rarity-common { border-color: rgba(160, 180, 200, .45); }
.draft-card.rarity-rare { border-color: #7df0ff; box-shadow: 0 0 18px rgba(125, 240, 255, .25); }
.draft-card.rarity-legendary {
  border-color: #ffb000; box-shadow: 0 0 26px rgba(255, 176, 0, .45);
  background: linear-gradient(160deg, rgba(255, 176, 0, .12), rgba(8, 10, 20, .92) 60%);
  animation: legend-glow 1.4s ease-in-out infinite;
}
.draft-card.rarity-legendary i { color: #ffb000; opacity: 1; }
@keyframes legend-glow { 50% { box-shadow: 0 0 40px rgba(255, 176, 0, .7); } }
.draft-card.rarity-epic { border-color: #ff7df0; box-shadow: 0 0 22px rgba(255, 125, 240, .35); }

#overlay-draft h2 { color: #7dffb2; text-shadow: 0 0 24px rgba(125, 255, 178, .45); }

/* ---------- Mode select ---------- */
.mode-cards { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.mode-card {
  cursor: pointer;
  width: 190px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(10, 14, 24, .92);
  border: 2px solid rgba(120, 200, 230, .3);
  border-radius: 6px;
  color: #dffcff;
  font: inherit;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.mode-card:hover { transform: translateY(-3px); }
.mode-card.on { border-color: #4be1ff; box-shadow: 0 0 20px rgba(75, 225, 255, .35); }
.mode-card b { font-size: 15px; letter-spacing: 2px; }
.mode-card small { font-size: 11px; opacity: .65; line-height: 1.5; text-align: center; }
.mode-card i { font-size: 10px; opacity: .5; font-style: normal; letter-spacing: 1px; }

/* ---------- Arsenal ---------- */
.arsenal-list { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; max-width: 80vw; }

.unlock-card {
  cursor: pointer;
  width: 180px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(10, 14, 24, .92);
  border: 2px solid rgba(120, 200, 230, .25);
  border-radius: 6px;
  color: #dffcff;
  font: inherit;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.unlock-card b { font-size: 13px; letter-spacing: 1px; }
.unlock-card small { font-size: 10px; opacity: .65; line-height: 1.5; text-align: center; }
.unlock-card i { font-size: 10px; font-style: normal; letter-spacing: 1px; opacity: .6; }
.unlock-card.affordable { border-color: #7dffb2; box-shadow: 0 0 16px rgba(125, 255, 178, .25); }
.unlock-card.affordable:hover { transform: translateY(-3px); }
.unlock-card.owned { opacity: .72; border-color: rgba(255, 209, 102, .5); cursor: default; }

/* ---------- Browser surfaces (themed) ---------- */
::selection { background: rgba(75, 225, 255, .28); color: #eaffff; }
:focus-visible { outline: 2px solid #4be1ff; outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: rgba(75, 225, 255, .45) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: rgba(255, 255, 255, .04); }
*::-webkit-scrollbar-thumb { background: rgba(75, 225, 255, .35); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(75, 225, 255, .6); background-clip: content-box; }

/* ---------- Panel head (arsenal / modes) ---------- */
.panel-head { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 6px; }
.panel-meta { display: flex; align-items: baseline; gap: 14px; }
.credits-chip {
  font-size: 13px;
  letter-spacing: 2px;
  color: #031018;
  background: #4be1ff;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(75, 225, 255, .35);
}
.progress { width: min(360px, 60vw); height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .09); overflow: hidden; }
.progress-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #2bd97c, #7dffb2); border-radius: 999px; transform-origin: left; transform: scaleX(0); transition: transform .25s cubic-bezier(.2, .8, .2, 1); }

/* ---------- Arsenal ---------- */
.arsenal-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  width: min(980px, 88vw);
}

.unlock-card {
  position: relative;
  cursor: pointer;
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  background: #0b0f1a;
  border: 1px solid rgba(120, 200, 230, .22);
  border-radius: 8px;
  color: #dffcff;
  font: inherit;
  transition: transform .14s cubic-bezier(.2, .8, .2, 1), border-color .14s ease, box-shadow .14s ease;
}
.unlock-card .card-icon { color: #7fb6cc; display: inline-flex; }
.unlock-card b { font-size: 13px; letter-spacing: 1.5px; }
.unlock-card small { font-size: 12px; line-height: 1.55; letter-spacing: 0.02em; color: #9fb8c8; }
.unlock-card .card-state {
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 1px;
}
.unlock-card .card-state svg { width: 14px; height: 14px; }
.unlock-card .owned-state { color: #7dffb2; }
.unlock-card .buy-state { color: #4be1ff; }
.unlock-card .lock-state { color: #93aab8; }

.unlock-card.affordable { border-color: #4be1ff; box-shadow: 0 0 22px rgba(75, 225, 255, .18); }
.unlock-card.affordable .card-icon { color: #4be1ff; }
.unlock-card.affordable:hover { transform: translateY(-3px); box-shadow: 0 0 30px rgba(75, 225, 255, .32); }
.unlock-card.affordable:active { transform: translateY(-1px) scale(.995); }
.unlock-card.owned { border-color: rgba(125, 255, 178, .4); background: #0a1410; }
.unlock-card.owned .card-icon { color: #7dffb2; }
.unlock-card.locked { opacity: .72; }
.unlock-card.locked:hover { opacity: .85; }

.unlock-card.just-bought { animation: pop .55s cubic-bezier(.2, .9, .2, 1); border-color: #7dffb2; box-shadow: 0 0 34px rgba(125, 255, 178, .4); }
.unlock-card.denied { animation: shake .35s ease; border-color: #ff5d7d; }
@keyframes pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ---------- Settings sections ---------- */
.settings-grid { display: block; width: min(620px, 88vw); }
.set-section { margin-bottom: 4px; }
.set-section h3 {
  margin: 20px 0 6px;
  font-size: 12px;
  letter-spacing: 3px;
  font-weight: 600;
  color: #4be1ff;
  opacity: .9;
}
.set-section:first-child h3 { margin-top: 0; }
.set-section .set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(120, 200, 230, .1);
  font-size: 12px;
  letter-spacing: 1px;
}
.set-section .set-row:last-child { border-bottom: 0; }
.set-section .set-row label { color: #cfe6f2; }

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 210px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  outline: none;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4be1ff;
  box-shadow: 0 0 12px rgba(75, 225, 255, .7);
  cursor: pointer;
}
.slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: #4be1ff;
  box-shadow: 0 0 12px rgba(75, 225, 255, .7);
  cursor: pointer;
}
.range-value { width: 42px; text-align: right; font-size: 11px; color: #9fb8c8; }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  letter-spacing: 2px;
  color: #7f93a3;
  background: none;
  border: 0;
}
.switch .knob {
  position: relative;
  width: 36px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(120, 200, 230, .3);
  transition: background .16s ease, border-color .16s ease;
}
.switch .knob::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #8aa7b5;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), background .16s ease, box-shadow .16s ease;
}
.switch.on { color: #dffcff; }
.switch.on .knob { background: rgba(75, 225, 255, .22); border-color: #4be1ff; }
.switch.on .knob::after { transform: translateX(18px); background: #4be1ff; box-shadow: 0 0 10px rgba(75, 225, 255, .85); }
.switch .switch-label { min-width: 26px; }

.seg-group { display: inline-flex; gap: 4px; padding: 3px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(120, 200, 230, .18); border-radius: 6px; }
.seg-group .seg { min-width: 58px; background: transparent; border-color: transparent; }
.seg-group .seg.on { color: #031018; background: #4be1ff; border-color: #4be1ff; }

.danger-row { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255, 93, 125, .2); }
.btn.danger { background: transparent; color: #ff9db1; border: 1px solid rgba(255, 93, 125, .45); box-shadow: none; font-size: 12px; padding: 10px 20px; }
.btn.danger:hover { background: rgba(255, 93, 125, .12); box-shadow: 0 0 18px rgba(255, 93, 125, .22); }
.btn.danger.armed { background: rgba(255, 93, 125, .18); color: #ffd9e2; border-color: #ff5d7d; }

/* ---------- Mode select ---------- */
.mode-cards { display: grid; grid-template-columns: repeat(2, minmax(240px, 300px)); gap: 12px; justify-content: center; }

.mode-card {
  cursor: pointer;
  padding: 16px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  text-align: left;
  background: #0b0f1a;
  border: 1px solid rgba(120, 200, 230, .22);
  border-radius: 8px;
  color: #dffcff;
  font: inherit;
  transition: transform .14s cubic-bezier(.2, .8, .2, 1), border-color .14s ease, box-shadow .14s ease;
}
.mode-card .card-icon { color: #7fb6cc; }
.mode-card b { font-size: 14px; letter-spacing: 2px; }
.mode-card small { font-size: 12px; line-height: 1.5; letter-spacing: 0.02em; color: #9fb8c8; }
.mode-card .mode-foot { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.mode-card .mode-foot i { font-style: normal; font-size: 11px; letter-spacing: 1px; color: #93aab8; }
.mode-card .tag { font-size: 10px; letter-spacing: 1px; color: #ffd166; border: 1px solid rgba(255, 209, 102, .4); border-radius: 999px; padding: 2px 8px; }
.mode-card:hover { transform: translateY(-3px); border-color: rgba(75, 225, 255, .6); }
.mode-card.on { border-color: #4be1ff; box-shadow: 0 0 26px rgba(75, 225, 255, .28); }
.mode-card.on .card-icon { color: #4be1ff; }

.map-row { width: min(660px, 88vw); margin-top: 4px; }
.map-cards { display: flex; gap: 8px; }
.map-card {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(120, 200, 230, .2);
  border-radius: 6px;
  color: #9fb8c8;
  font: inherit;
  font-size: 12px;
  letter-spacing: 1px;
  transition: border-color .14s ease, color .14s ease, box-shadow .14s ease;
}
.map-card .card-icon { color: inherit; display: inline-flex; }
.map-card .card-icon svg { width: 30px; height: 30px; }
.map-card:hover { color: #dffcff; border-color: rgba(75, 225, 255, .5); }
.map-card.on { color: #dffcff; border-color: #4be1ff; box-shadow: 0 0 18px rgba(75, 225, 255, .25); }

.chip-btn {
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  letter-spacing: 1px;
  color: #9fb8c8;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(120, 200, 230, .2);
  border-radius: 999px;
  padding: 8px 16px;
  transition: color .14s ease, border-color .14s ease;
}
.chip-btn:hover { color: #dffcff; border-color: rgba(75, 225, 255, .55); }

.ui-icon { display: block; }

/* ---------- Profile & callsign ---------- */
.text-input {
  font: inherit;
  font-size: 18px;
  letter-spacing: 4px;
  text-align: center;
  text-transform: uppercase;
  color: #dffcff;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(120, 200, 230, .4);
  border-radius: 6px;
  padding: 12px 16px;
  width: min(320px, 70vw);
  outline: none;
}
.text-input:focus { border-color: #4be1ff; box-shadow: 0 0 18px rgba(75, 225, 255, .25); }
.text-input.small { font-size: 14px; padding: 8px 12px; width: 190px; letter-spacing: 2px; }
.text-input.denied { animation: shake .35s ease; border-color: #ff5d7d; }

.swatches { display: flex; gap: 10px; }
.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .12s cubic-bezier(.2, .8, .2, 1), border-color .12s ease;
}
.swatch:hover { transform: scale(1.12); }
.swatch.on { border-color: #dffcff; transform: scale(1.12); }

.inline-field { display: flex; align-items: center; gap: 8px; }
.profile-row { width: min(560px, 88vw); }
.btn.small { font-size: 11px; padding: 8px 14px; letter-spacing: 2px; min-height: 28px; }

/* Keep every interactive control at a comfortable tap size. */
.btn.ghost, .seg-btn, .text-input.small { min-height: 28px; }

/* Respect reduced motion: no shake, no pulsing, no sliding chrome. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 10px 18px; width: min(560px, 88vw); }
.stats-grid div {
  text-align: center;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(120, 200, 230, .16);
  border-radius: 6px;
  padding: 10px 6px;
}
.stats-grid span { display: block; font-size: 11px; letter-spacing: 1px; opacity: .72; margin-bottom: 4px; }
.stats-grid b { font-size: 18px; }

/* ---------- Co-op ---------- */
.coop-body { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(560px, 88vw); }
.coop-code {
  font-size: 46px;
  letter-spacing: 14px;
  color: #4be1ff;
  text-shadow: 0 0 26px rgba(75, 225, 255, .5);
  padding: 6px 10px;
}
.coop-roster { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.coop-seat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(120, 200, 230, .16);
  border-radius: 6px;
  font-size: 13px;
  letter-spacing: 1px;
}
.coop-seat i { font-style: normal; font-size: 10px; letter-spacing: 1px; opacity: .65; }

/* ---------- Perk list ---------- */
#perk-count { font-size: 12px; letter-spacing: 2px; opacity: .7; }

.perk-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  max-width: 70vw;
}
.perk-row { display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 1px; opacity: .85; }
.perk-row .glyph { font-weight: 700; }
.perk-row i { font-style: normal; opacity: .6; }
.perk-row.empty { opacity: .4; letter-spacing: 3px; }

/* ---------- run systems: shop, objective, loadouts, report ---------- */
.shop-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: stretch; }
.shop-row .scrap-chip { align-self: center; font-size: 12px; letter-spacing: 2px; color: #ffe14b; margin-right: 6px; }
.shop-item {
  display: flex; flex-direction: column; gap: 2px; min-width: 128px; padding: 8px 12px; cursor: pointer;
  background: rgba(255, 225, 75, .06); color: #fff4d6; border: 1px solid rgba(255, 225, 75, .45);
  border-radius: 6px; font: inherit; letter-spacing: 1px;
}
.shop-item b { font-size: 12px; letter-spacing: 2px; }
.shop-item small { font-size: 10px; opacity: .75; }
.shop-item i { font-size: 11px; font-style: normal; color: #ffe14b; }
.shop-item:hover:not(:disabled) { background: rgba(255, 225, 75, .16); }
.shop-item:disabled { opacity: .35; cursor: default; }
#objective-text { margin-top: 6px; font-size: 12px; letter-spacing: 3px; }
.obj-bar { margin: 4px auto 0; width: 180px; height: 4px; background: rgba(255, 255, 255, .1); border-radius: 2px; overflow: hidden; }
#objective-fill { height: 100%; width: 100%; transform-origin: left; transform: scaleX(0); transition: transform .15s linear; background: currentColor; }
#boost-text { margin-top: 6px; font-size: 13px; letter-spacing: 3px; color: #ffe14b; text-shadow: 0 0 10px rgba(255, 225, 75, .7); }
#alt-text { font-size: 11px; letter-spacing: 2px; opacity: .6; }
.run-report { width: min(640px, 92vw); display: grid; grid-template-columns: 1fr 1fr; gap: 14px; text-align: left; font-size: 11px; letter-spacing: 1px; }
.run-report:empty { display: none; }
.run-report h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: 3px; opacity: .7; }
.rr-bar { display: grid; grid-template-columns: 90px 1fr 54px; gap: 6px; align-items: center; margin: 3px 0; }
.rr-bar > div { height: 6px; background: rgba(255, 255, 255, .08); border-radius: 3px; overflow: hidden; }
.rr-bar > div > i { display: block; height: 100%; background: #4be1ff; }
.rr-bar em { font-style: normal; text-align: right; opacity: .8; }
.rr-facts { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; }
.rr-facts b { color: #dffcff; }
.rr-challenges { grid-column: 1 / 3; color: #ffd166; }
.rr-challenges div { margin: 2px 0; }
.arsenal-sub { margin: 10px 0 0; font-size: 13px; letter-spacing: 4px; opacity: .85; }
.challenge-list, .mastery-list { width: min(760px, 94vw); display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.challenge { text-align: left; padding: 8px 10px; border: 1px solid rgba(120, 200, 230, .18); border-radius: 6px; font-size: 11px; background: rgba(255, 255, 255, .03); }
.challenge b { display: block; letter-spacing: 2px; font-size: 11px; }
.challenge small { opacity: .7; }
.challenge i { float: right; font-style: normal; color: #ffd166; }
.challenge.done { border-color: rgba(125, 255, 178, .5); }
.challenge.done b { color: #7dffb2; }
.mastery { display: flex; justify-content: space-between; padding: 6px 10px; font-size: 11px; letter-spacing: 2px; border: 1px solid rgba(120, 200, 230, .15); border-radius: 6px; }
.mastery .stars { color: #ffd166; }

/* co-op lobby setup rows (leader picks mode / map / difficulty) */
.lb-table { width: min(640px, 94vw); min-height: 120px; display: flex; flex-direction: column; gap: 4px; }
.lb-row { display: grid; grid-template-columns: 34px 1fr 90px 60px 70px; gap: 10px; align-items: center; padding: 6px 10px;
  font-size: 12px; letter-spacing: 1px; border: 1px solid rgba(120, 200, 230, .12); border-radius: 5px; background: rgba(255, 255, 255, .03); text-align: left; }
.lb-row.head { border: 0; background: none; font-size: 10px; letter-spacing: 2px; opacity: .55; }
.lb-row .rank { color: #ffd166; }
.lb-row.top1 { border-color: rgba(255, 209, 102, .6); box-shadow: 0 0 12px rgba(255, 209, 102, .15); }
.lb-row .names { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-row .names span + span::before { content: ' + '; color: #6b7c8f; }
.lb-row .num { text-align: right; }
.lb-empty { opacity: .6; font-size: 12px; padding: 20px; }
.rank-line { font-size: 13px; letter-spacing: 2px; color: #ffd166; margin: 0; }
.lobby-row { width: min(560px, 94vw); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lobby-row label { font-size: 11px; letter-spacing: 2px; opacity: .75; }
.lobby-row .seg-group .seg { min-width: 0; padding: 6px 10px; font-size: 11px; }

/* =====================================================================
   UI REWORK: menu, panels, codex, HUD polish
   ===================================================================== */
:root {
  --cyan: #4be1ff;
  --cyan-soft: rgba(75, 225, 255, .35);
  --pink: #ff4bd8;
  --gold: #ffd166;
  --ink: #dffcff;
  --glass: rgba(8, 12, 26, .72);
  --glass-strong: rgba(6, 9, 20, .9);
  --line: rgba(120, 220, 255, .22);
}

/* every overlay: dark glass over the live backdrop, framed with HUD brackets */
.overlay {
  background: radial-gradient(ellipse at center, rgba(6, 8, 18, .72), rgba(2, 3, 8, .92));
  backdrop-filter: blur(2px);
}
.overlay::before, .overlay::after {
  content: ''; position: fixed; width: 46px; height: 46px; pointer-events: none;
  border: 2px solid var(--cyan-soft); opacity: .7;
}
.overlay::before { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.overlay::after { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }
.overlay h2 {
  letter-spacing: 10px; font-size: 32px; text-shadow: 0 0 18px rgba(75, 225, 255, .45);
  background: linear-gradient(180deg, #ffffff, #9ff4ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.kicker { display: block; font-size: 10px; letter-spacing: 3px; color: var(--pink); opacity: .85; margin-bottom: 6px; }
.panel-head { text-align: center; }

/* ---------- main menu ---------- */
.overlay.menu-screen { background: linear-gradient(90deg, rgba(3, 4, 10, .78) 0%, rgba(3, 4, 10, .35) 55%, rgba(3, 4, 10, .6) 100%); justify-content: safe center; }
.menu-grid { width: min(1120px, 94vw); display: grid; grid-template-columns: 1.25fr .9fr; gap: 40px; align-items: center; }
.menu-main { display: flex; flex-direction: column; gap: 22px; text-align: left; }
.brand .tagline { margin-top: 6px; font-size: 13px; letter-spacing: 2px; opacity: .75; }
.title.glitch {
  position: relative; margin: 0; font-size: clamp(46px, 7vw, 92px); letter-spacing: clamp(6px, 1vw, 14px);
  line-height: 1; color: #eafcff; text-shadow: 0 0 22px rgba(75, 225, 255, .55), 0 0 60px rgba(255, 75, 216, .25);
}
.title.glitch span { color: var(--cyan); }
.title.glitch::before, .title.glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: .55;
}
.title.glitch::before { color: var(--pink); transform: translate(2px, 0); clip-path: inset(0 0 55% 0); animation: glitchA 4.2s infinite steps(1); }
.title.glitch::after { color: var(--cyan); transform: translate(-2px, 0); clip-path: inset(55% 0 0 0); animation: glitchB 3.7s infinite steps(1); }
@keyframes glitchA { 0%, 92%, 100% { transform: translate(2px, 0); } 93% { transform: translate(-6px, -2px); } 95% { transform: translate(5px, 1px); } }
@keyframes glitchB { 0%, 88%, 100% { transform: translate(-2px, 0); } 89% { transform: translate(6px, 2px); } 91% { transform: translate(-4px, 0); } }
@media (prefers-reduced-motion: reduce) { .title.glitch::before, .title.glitch::after { animation: none; } }

.menu-nav { display: flex; flex-direction: column; gap: 10px; max-width: 520px; }
.menu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu-btn {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 18px;
  font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  background: linear-gradient(90deg, rgba(75, 225, 255, .1), rgba(75, 225, 255, .02));
  border: 1px solid var(--line); border-left: 3px solid var(--cyan-soft);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.menu-btn:hover, .menu-btn:focus-visible {
  transform: translateX(6px); border-left-color: var(--cyan); outline: none;
  background: linear-gradient(90deg, rgba(75, 225, 255, .24), rgba(75, 225, 255, .04));
  box-shadow: 0 0 24px rgba(75, 225, 255, .18);
}
.menu-btn .mi { width: 28px; height: 28px; flex: 0 0 28px; color: var(--cyan); display: grid; place-items: center; }
.menu-btn .mi svg { width: 26px; height: 26px; }
.menu-btn b { display: block; font-size: 16px; letter-spacing: 4px; }
.menu-btn small { display: block; font-size: 11px; letter-spacing: 1px; opacity: .6; margin-top: 3px; }
.menu-btn kbd { margin-left: auto; }
.menu-btn.primary { padding: 20px 22px; border-left-color: var(--cyan); background: linear-gradient(90deg, rgba(75, 225, 255, .32), rgba(75, 225, 255, .06)); }
.menu-btn.primary b { font-size: 22px; letter-spacing: 6px; color: #fff; text-shadow: 0 0 14px rgba(75, 225, 255, .8); }
.menu-btn.primary::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .18) 45%, transparent 60%);
  transform: translateX(-100%); animation: sheen 3.2s ease-in-out infinite;
}
@keyframes sheen { 60%, 100% { transform: translateX(100%); } }
.menu-btn.coop { border-left-color: rgba(255, 75, 216, .6); background: linear-gradient(90deg, rgba(255, 75, 216, .16), rgba(255, 75, 216, .02)); }
.menu-btn.coop .mi { color: var(--pink); }
.menu-btn.coop b { font-size: 18px; }
.menu-btn.small { padding: 10px 14px; }
.menu-btn.small b { font-size: 12px; letter-spacing: 3px; }
.menu-btn.small .mi, .menu-btn.small .mi svg { width: 20px; height: 20px; flex-basis: 20px; }

kbd {
  display: inline-block; min-width: 22px; padding: 2px 7px; font: inherit; font-size: 10px; letter-spacing: 1px; text-align: center;
  color: var(--ink); background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03));
  border: 1px solid rgba(160, 220, 255, .35); border-bottom-width: 3px; border-radius: 4px;
}

.menu-side { display: flex; flex-direction: column; gap: 14px; }
.card {
  position: relative; padding: 14px 16px; text-align: left; font-size: 12px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: inset 0 0 30px rgba(75, 225, 255, .04);
}
.card h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: 3px; color: var(--gold); }
.card p { margin: 0 0 10px; opacity: .8; line-height: 1.5; }
.pilot-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pilot-dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 12px currentColor; }
.pilot-head b { font-size: 18px; letter-spacing: 3px; }
.pilot-head small { margin-left: auto; font-size: 10px; letter-spacing: 3px; opacity: .5; }
.pilot-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pilot-stats div { display: flex; flex-direction: column; padding: 8px 10px; border: 1px solid rgba(120, 220, 255, .12); border-radius: 6px; background: rgba(255, 255, 255, .02); }
.pilot-stats b { font-size: 18px; color: #fff; }
.pilot-stats span { font-size: 9px; letter-spacing: 2px; opacity: .55; margin-top: 2px; }
.daily-card { border-color: rgba(255, 209, 102, .3); }
.whats-new { position: static; max-width: none; margin: 0; border-color: rgba(255, 75, 216, .3); background: var(--glass); }
.whats-new h4 { color: var(--pink); }

/* developer credit */
.dev-card {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 16px;
  border-color: rgba(75, 225, 255, .3);
  background: linear-gradient(100deg, rgba(75, 225, 255, .08), rgba(255, 75, 216, .06) 60%, transparent), var(--glass);
}
.dev-card::before {
  content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--pink)); box-shadow: 0 0 10px rgba(75, 225, 255, .6);
}
.dev-id { display: flex; flex-direction: column; min-width: 0; }
.dev-id .kicker { font-size: 9px; letter-spacing: 2px; opacity: .6; }
.dev-id b { font-size: 18px; letter-spacing: 5px; color: #fff; text-shadow: 0 0 14px rgba(75, 225, 255, .7); line-height: 1.25; }
.dev-id small { font-size: 10px; letter-spacing: 1px; color: var(--cyan); opacity: .8; }
.dev-links { display: flex; gap: 8px; margin-left: auto; }
.dev-link {
  --lc: var(--ink);
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px;
  font-size: 10px; letter-spacing: 2px; font-weight: 700; color: var(--lc); text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--lc) 40%, transparent); border-radius: 6px;
  background: color-mix(in srgb, var(--lc) 7%, transparent);
  transition: background .15s, box-shadow .15s, transform .15s, border-color .15s;
}
.dev-link svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.dev-link.tg { --lc: #2aabee; }
.dev-link:hover, .dev-link:focus-visible {
  outline: none; transform: translateY(-1px); border-color: var(--lc);
  background: color-mix(in srgb, var(--lc) 16%, transparent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--lc) 45%, transparent);
}
.dev-card { flex-wrap: wrap; row-gap: 8px; }
.dev-thanks {
  flex: 1 0 100%; padding-top: 7px; border-top: 1px solid rgba(75, 225, 255, .14);
  font-size: 10px; letter-spacing: 1.5px; color: var(--ink); opacity: .7; text-decoration: none;
  transition: opacity .15s, color .15s;
}
.dev-thanks b { color: var(--pink); letter-spacing: 2px; text-shadow: 0 0 10px rgba(255, 75, 216, .5); }
.dev-thanks .heart { font-size: 11px; }
.dev-thanks:hover, .dev-thanks:focus-visible { outline: none; opacity: 1; color: var(--cyan); }
@media (max-width: 420px) {
  .dev-link span { display: none; }
}

.keys {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; width: min(1120px, 94vw);
  font-size: 11px; letter-spacing: 1px; opacity: .8;
}
.keys span { white-space: nowrap; }

@media (max-width: 900px) {
  .menu-grid { grid-template-columns: 1fr; gap: 20px; }
  .menu-main { align-items: stretch; }
  .keys { position: static; transform: none; }
}
@media (max-height: 760px) {
  .menu-btn { padding: 10px 14px; }
  .menu-btn.primary { padding: 14px 18px; }
  .whats-new { display: none; }
}

/* ---------- buttons elsewhere get the same edge ---------- */
.btn { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); border-radius: 0; }

/* ---------- codex ---------- */
.codex-tabs { flex-wrap: wrap; justify-content: center; }
.codex-grid {
  width: min(1060px, 95vw); display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px;
  max-height: 62vh; overflow-y: auto; padding: 4px 6px;
}
.codex-card {
  display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; padding: 10px 12px; text-align: left;
  background: var(--glass); border: 1px solid var(--line); border-radius: 8px; transition: border-color .15s ease, transform .15s ease;
}
.codex-card:hover { border-color: var(--cyan-soft); transform: translateY(-2px); }
.codex-art {
  width: 76px; height: 76px; display: grid; place-items: center; border-radius: 8px;
  background: radial-gradient(circle at center, rgba(75, 225, 255, .08), rgba(0, 0, 0, .35));
  border: 1px solid rgba(120, 220, 255, .12);
}
.codex-body b { display: block; font-size: 13px; letter-spacing: 3px; }
.codex-body i { display: block; font-style: normal; font-size: 10px; letter-spacing: 1.5px; opacity: .55; margin: 3px 0 5px; }
.codex-body p { margin: 0; font-size: 11.5px; line-height: 1.5; opacity: .85; }

/* ---------- HUD polish ---------- */
.bar { border-radius: 0; clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.bar.hp::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 22px, rgba(0, 0, 0, .35) 22px 24px);
}
.bar-label { color: var(--cyan); opacity: .85; }
#wave-text { font-size: 17px; letter-spacing: 5px; text-shadow: 0 0 12px rgba(75, 225, 255, .5); }
.hud-right .stat b, #score-text { text-shadow: 0 0 10px rgba(75, 225, 255, .35); }
.diff-desc { max-width: 640px; font-size: 11px; letter-spacing: 1px; color: #9fd7e8; opacity: .85; }
.mode-cards { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 12px; width: min(920px, 94vw); align-items: stretch; }
.mode-cards .mode-card { height: 100%; width: auto; }
@media (max-width: 820px) { .mode-cards { grid-template-columns: repeat(2, minmax(150px, 1fr)); } }

/* =====================================================================
   HANGAR (solo progression): wallet, circuit board, armory, implants,
   threat, records; launch bay rows; victory + rewards; HUD additions
   ===================================================================== */
:root {
  --flux: #4be1ff;
  --cipher: #ff4bd8;
  --halo: #ffe14b;
  --danger: #ff3b6b;
}
.hg-ic { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: 0 0 auto; }
.hg-ic svg { width: 100%; height: 100%; }

/* price tags: icon + number in the currency colour */
.price { display: inline-flex; align-items: center; gap: 4px; font-style: normal; }
.price .hg-ic { width: 14px; height: 14px; }
.price b { font-size: 12px; letter-spacing: 1px; }
.price.flux { color: var(--flux); }
.price.ciphers { color: var(--cipher); }
.price.halos { color: var(--halo); }

/* rank pips: little diamonds */
.pips { display: inline-flex; gap: 6px; align-items: center; }
.pips i {
  width: 9px; height: 9px; transform: rotate(45deg); border: 1.5px solid var(--c, var(--cyan));
  opacity: .45; transition: background .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.pips i.on { background: var(--c, var(--cyan)); opacity: 1; box-shadow: 0 0 8px var(--c, var(--cyan)); }

.overlay.hangar { justify-content: flex-start; gap: 12px; padding-top: 26px; }
.hangar-top {
  width: min(1180px, 95vw); display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.hangar-top .panel-head { text-align: left; }
.hangar-top h2 { font-size: 36px; }

.wallet { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.coin {
  --cc: var(--flux);
  position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 10px; min-width: 118px;
  color: var(--cc); border: 1px solid color-mix(in srgb, var(--cc) 45%, transparent);
  background: linear-gradient(120deg, color-mix(in srgb, var(--cc) 18%, transparent), rgba(4, 6, 14, .7));
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.coin.ciphers { --cc: var(--cipher); }
.coin.halos { --cc: var(--halo); }
.coin .hg-ic { width: 24px; height: 24px; filter: drop-shadow(0 0 6px var(--cc)); }
.coin b { font-size: 22px; color: #fff; text-shadow: 0 0 10px var(--cc); min-width: 28px; }
.coin small { font-size: 9px; letter-spacing: 2px; opacity: .8; }
.coin.gain { animation: coinGain .6s ease; }
.coin.spend { animation: coinSpend .45s ease; }
@keyframes coinGain { 30% { transform: scale(1.08); box-shadow: 0 0 26px var(--cc); } }
@keyframes coinSpend { 20% { transform: translateY(-3px); } 40% { transform: translateY(2px); filter: brightness(1.6); } }

.hangar-tabs { width: min(1180px, 95vw); display: flex; gap: 6px; flex-wrap: wrap; }
.hg-tab {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 18px; font: inherit; font-size: 12px;
  letter-spacing: 3px; color: #9fd7e8; cursor: pointer; background: rgba(8, 12, 26, .55); border: 1px solid var(--line);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); transition: all .15s ease;
}
.hg-tab:hover { color: #fff; background: rgba(75, 225, 255, .1); }
.hg-tab.on {
  color: #fff; border-color: var(--cyan); background: linear-gradient(180deg, rgba(75, 225, 255, .28), rgba(75, 225, 255, .06));
  text-shadow: 0 0 10px rgba(75, 225, 255, .8);
}
.hg-tab.on::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.hg-badge { font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 9px; color: #1a0610; background: linear-gradient(90deg, #ffd166, #ff3b6b); }

.hangar-body { width: min(1180px, 95vw); max-height: calc(100vh - 250px); overflow-y: auto; padding: 4px 6px 10px; text-align: left; }
.hangar-body > * { animation: hgIn .28s ease both; }
@keyframes hgIn { from { opacity: 0; transform: translateY(8px); } }
.hg-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; font-size: 12px; opacity: .85; }
.hg-intro p { margin: 0; max-width: 780px; line-height: 1.5; }
.hg-sub { margin: 18px 0 10px; font-size: 11px; letter-spacing: 3px; color: var(--gold); }
.chip-btn .price { margin-left: 4px; }
.chip-btn:disabled { opacity: .4; cursor: default; }

/* ---------- THE CIRCUIT: a board of A/B talent rows on one live trace ---------- */
.circuit { position: relative; display: grid; gap: 10px; padding: 6px 0; }
.circuit::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-1px);
  background: linear-gradient(180deg, transparent, rgba(75, 225, 255, .5) 8%, rgba(255, 75, 216, .5) 60%, transparent);
  background-size: 100% 200%; animation: trace 4s linear infinite;
}
@keyframes trace { to { background-position: 0 -200%; } }
.c-row { position: relative; display: grid; grid-template-columns: 1fr 190px 1fr; gap: 14px; align-items: stretch; animation: hgIn .35s ease both; }
.c-node {
  position: relative; display: flex; flex-direction: column; gap: 3px; padding: 11px 16px; font: inherit; color: var(--ink);
  text-align: left; cursor: pointer; background: rgba(8, 12, 26, .72); border: 1px solid rgba(120, 220, 255, .14);
  opacity: .62; transition: opacity .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.c-node.a { clip-path: polygon(0 0, 100% 0, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }
.c-node.b { text-align: right; align-items: flex-end; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%); }
.c-node:hover { opacity: .9; transform: translateY(-1px); }
.c-node.on {
  opacity: 1; border-color: var(--c);
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 20%, transparent), rgba(8, 12, 26, .8));
  box-shadow: inset 0 0 22px color-mix(in srgb, var(--c) 18%, transparent);
}
.c-node.b.on { background: linear-gradient(270deg, color-mix(in srgb, var(--c) 20%, transparent), rgba(8, 12, 26, .8)); }
.c-node b { font-size: 13px; letter-spacing: 3px; }
.c-node.on b { color: #fff; text-shadow: 0 0 10px var(--c); }
.c-node small { font-size: 11px; opacity: .7; line-height: 1.4; letter-spacing: .3px; }
.c-now { font-style: normal; font-size: 10px; letter-spacing: 2px; color: var(--c); margin-top: 2px; }
.c-node:not(.on) .c-now { opacity: .7; }
.c-core {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px 8px;
  background: radial-gradient(circle at center, color-mix(in srgb, var(--c) 14%, transparent), rgba(4, 6, 14, .92) 70%), #060812;
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); z-index: 1;
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);
}
.c-core::before, .c-core::after { content: ''; position: absolute; top: 50%; width: 14px; height: 2px; background: var(--c); opacity: .6; }
.c-idx { position: absolute; top: 4px; left: 22px; font-size: 10px; letter-spacing: 2px; opacity: .45; }
.c-buy {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; font: inherit; font-size: 11px; letter-spacing: 2px;
  color: #cfefff; cursor: pointer; background: rgba(255, 255, 255, .04); border: 1px solid rgba(160, 220, 255, .3); border-radius: 3px;
  transition: all .15s ease;
}
.c-buy.can { color: #fff; border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, transparent); animation: canBuy 1.8s ease-in-out infinite; }
.c-buy.can:hover { box-shadow: 0 0 16px var(--c); }
@keyframes canBuy { 50% { box-shadow: 0 0 14px color-mix(in srgb, var(--c) 60%, transparent); } }
.c-buy.lock { color: var(--cipher); border-color: rgba(255, 75, 216, .45); }
.c-buy .hg-ic { width: 14px; height: 14px; }
.c-max { font-size: 11px; letter-spacing: 4px; color: var(--gold); text-shadow: 0 0 10px rgba(255, 209, 102, .7); }
.c-row.maxed .c-core { border-color: var(--gold); box-shadow: 0 0 18px rgba(255, 209, 102, .25); }
.c-row.locked .c-node { filter: grayscale(.8); opacity: .35; }
.c-row.locked .c-core { filter: saturate(.6); }
.denied { animation: denied .4s ease; }
@keyframes denied { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* ---------- ARMORY ---------- */
.armory { display: grid; grid-template-columns: 290px 1fr; gap: 16px; align-items: start; }
.gun-list { display: grid; gap: 6px; }
.gun-tile {
  position: relative; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 6px 12px 6px 8px;
  font: inherit; color: var(--ink); text-align: left; cursor: pointer; background: rgba(8, 12, 26, .7);
  border: 1px solid rgba(120, 220, 255, .14); border-left: 3px solid color-mix(in srgb, var(--c) 60%, transparent);
  transition: all .15s ease;
}
.gun-tile:hover { transform: translateX(3px); border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.gun-tile.on { border-color: var(--c); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 22%, transparent), rgba(8, 12, 26, .8)); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 18%, transparent); }
.gun-tile.locked { opacity: .55; }
.gun-tile.locked canvas { filter: grayscale(1) brightness(.7); }
.gt-txt b { display: block; font-size: 12px; letter-spacing: 3px; }
.gt-txt small { display: block; font-size: 9px; letter-spacing: 2px; opacity: .6; margin-top: 2px; }
.gt-tag { font-style: normal; font-size: 9px; letter-spacing: 2px; padding: 2px 6px; color: #031018; background: var(--c); }
.gt-win { position: absolute; top: 3px; right: 6px; font-style: normal; font-size: 9px; color: var(--halo); letter-spacing: 1px; }
.gun-detail {
  position: relative; padding: 18px 20px; background: var(--glass); border: 1px solid var(--line); border-top: 2px solid var(--c);
  box-shadow: inset 0 40px 60px -40px color-mix(in srgb, var(--c) 25%, transparent);
}
.gd-top { display: grid; grid-template-columns: 130px 1fr; gap: 18px; align-items: center; }
.gd-art {
  width: 130px; height: 130px; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%);
  border: 1px dashed color-mix(in srgb, var(--c) 50%, transparent); animation: spinSlow 18s linear infinite;
}
.gd-art canvas { animation: spinSlow 18s linear infinite reverse; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.gd-info h3 { margin: 0; font-size: 30px; letter-spacing: 8px; color: #fff; text-shadow: 0 0 16px var(--c); }
.gd-info p { margin: 4px 0 10px; font-size: 12px; opacity: .8; }
.gd-facts { display: grid; grid-template-columns: repeat(4, minmax(80px, 1fr)); gap: 6px; margin-bottom: 12px; }
.gd-facts span { display: flex; flex-direction: column; padding: 6px 10px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(120, 220, 255, .12); }
.gd-facts i { font-style: normal; font-size: 9px; letter-spacing: 2px; opacity: .55; }
.gd-facts b { font-size: 15px; color: #fff; }
.gd-act { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.gd-primary { font-size: 11px; letter-spacing: 3px; color: var(--c); }
.btn.small { padding: 9px 18px; font-size: 12px; letter-spacing: 3px; display: inline-flex; align-items: center; gap: 6px; }
.variants { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.v-card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: rgba(8, 12, 26, .72);
  border: 1px solid rgba(120, 220, 255, .14); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  transition: all .15s ease;
}
.v-card.on { border-color: var(--c); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 20%, transparent), rgba(8, 12, 26, .85)); box-shadow: 0 0 20px color-mix(in srgb, var(--c) 18%, transparent); }
.v-card.locked { opacity: .6; }
.v-card b { font-size: 13px; letter-spacing: 3px; }
.v-card small { font-size: 11px; line-height: 1.45; opacity: .78; min-height: 32px; }
.v-now { font-style: normal; font-size: 10px; letter-spacing: 2px; color: var(--c); }
.v-act { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; align-items: center; }
.v-eq { font-size: 10px; letter-spacing: 2px; color: var(--c); }

/* ---------- IMPLANTS ---------- */
.implant-rack { display: flex; gap: 12px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.i-slot {
  --c: rgba(120, 220, 255, .5);
  min-width: 280px; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 10px 16px; border: 1px dashed rgba(120, 220, 255, .3); background: rgba(4, 6, 14, .5);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.i-slot.full { border: 1px solid var(--c); background: radial-gradient(circle at top, color-mix(in srgb, var(--c) 22%, transparent), rgba(4, 6, 14, .85)); box-shadow: 0 0 22px color-mix(in srgb, var(--c) 22%, transparent); }
.i-slot b { font-size: 15px; letter-spacing: 4px; color: #fff; text-shadow: 0 0 10px var(--c); }
.i-slot small { font-size: 10px; letter-spacing: 2px; opacity: .75; }
.implant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.i-card {
  display: grid; grid-template-columns: 50px 1fr; gap: 12px; align-items: start; padding: 12px; font: inherit; color: var(--ink);
  text-align: left; cursor: pointer; background: rgba(8, 12, 26, .72); border: 1px solid rgba(120, 220, 255, .14); transition: all .15s ease;
}
.i-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.i-card.on { border-color: var(--c); box-shadow: 0 0 20px color-mix(in srgb, var(--c) 22%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 16%, transparent), rgba(8, 12, 26, .85)); }
.i-card.locked { opacity: .6; }
.i-chip {
  width: 50px; height: 50px; display: grid; place-items: center; color: var(--c);
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 25%, transparent), rgba(0, 0, 0, .3));
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.i-chip .hg-ic { width: 26px; height: 26px; filter: drop-shadow(0 0 6px var(--c)); }
.i-txt { display: flex; flex-direction: column; gap: 4px; }
.i-txt b { font-size: 12px; letter-spacing: 3px; color: #fff; }
.i-txt small { font-size: 11px; opacity: .75; line-height: 1.4; }
.i-vals { display: flex; gap: 4px; }
.i-vals i { font-style: normal; font-size: 10px; padding: 1px 6px; border: 1px solid rgba(160, 220, 255, .2); opacity: .5; }
.i-vals i.on { opacity: 1; color: #031018; background: var(--c); border-color: var(--c); }
.i-bar { height: 3px; background: rgba(255, 255, 255, .08); }
.i-bar i { display: block; height: 100%; background: var(--c); box-shadow: 0 0 6px var(--c); }
.i-state { font-style: normal; font-size: 9px; letter-spacing: 2px; opacity: .7; display: inline-flex; gap: 6px; align-items: center; }

/* ---------- THREAT ---------- */
.threat-gauge {
  --f: 0;
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'num bar' 'num perks'; gap: 6px 22px; align-items: center;
  padding: 16px 22px; margin-bottom: 14px; overflow: hidden;
  background: linear-gradient(100deg, rgba(8, 12, 26, .9), rgba(60, 10, 20, calc(.25 + var(--f) * .6)));
  border: 1px solid rgba(255, 59, 107, calc(.25 + var(--f) * .7));
}
.threat-gauge::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 60%; pointer-events: none; opacity: calc(var(--f) * .9);
  background: repeating-linear-gradient(100deg, transparent 0 18px, rgba(255, 90, 60, .08) 18px 20px);
  animation: heatDrift 2.4s linear infinite;
}
@keyframes heatDrift { to { background-position: 60px 0; } }
.tg-num { grid-area: num; display: flex; align-items: baseline; gap: 8px; }
.tg-num span { font-size: 12px; letter-spacing: 4px; opacity: .7; writing-mode: vertical-rl; transform: rotate(180deg); }
.tg-num b { font-size: 72px; line-height: .9; color: #fff; text-shadow: 0 0 22px rgba(255, 59, 107, .9), 0 0 50px rgba(255, 140, 66, .5); }
.tg-num small { font-size: 14px; opacity: .6; }
.tg-bar { grid-area: bar; height: 12px; background: rgba(255, 255, 255, .06); clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.tg-bar i { display: block; height: 100%; width: calc(var(--f) * 100%); background: linear-gradient(90deg, #4be1ff, #ffd166 45%, #ff8c42 70%, #ff3b6b); box-shadow: 0 0 14px rgba(255, 90, 60, .6); transition: width .3s ease; }
.tg-perks { grid-area: perks; display: flex; gap: 8px; flex-wrap: wrap; }
.tg-perks span { font-size: 10px; letter-spacing: 2px; padding: 3px 9px; border: 1px solid rgba(255, 209, 102, .35); color: var(--gold); }
.tg-reset {
  position: relative; z-index: 1; margin-left: auto; font: inherit; font-size: 10px; letter-spacing: 2px; padding: 4px 12px; cursor: pointer;
  color: var(--ink); background: rgba(255, 255, 255, .04); border: 1px solid rgba(160, 220, 255, .3); transition: all .12s ease;
}
.tg-reset:hover:not(:disabled), .tg-reset:focus-visible { border-color: #ff3b6b; color: #fff; box-shadow: 0 0 10px rgba(255, 59, 107, .35); outline: none; }
.tg-reset.armed { color: #fff; background: rgba(255, 59, 107, .28); border-color: #ff3b6b; box-shadow: 0 0 14px rgba(255, 59, 107, .5); }
.tg-reset:disabled { opacity: .3; cursor: default; }
.threat-cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: start; }
.threat-list { display: grid; gap: 6px; }
.t-row {
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 10px 14px; background: rgba(8, 12, 26, .7);
  border: 1px solid rgba(120, 220, 255, .12); border-left: 3px solid rgba(255, 255, 255, .12); transition: all .15s ease;
}
.t-row.on { border-left-color: var(--c); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 16%, transparent), rgba(8, 12, 26, .8)); }
.t-txt b { display: block; font-size: 12px; letter-spacing: 3px; }
.t-row.on .t-txt b { color: #fff; text-shadow: 0 0 8px var(--c); }
.t-txt small { display: block; font-size: 11px; opacity: .72; margin-top: 2px; }
.t-ctl { display: flex; align-items: center; gap: 10px; }
.t-step {
  width: 30px; height: 30px; font: inherit; font-size: 18px; line-height: 1; color: var(--ink); cursor: pointer;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(160, 220, 255, .3); transition: all .12s ease;
}
.t-step:hover:not(:disabled) { border-color: var(--c); color: #fff; box-shadow: 0 0 10px var(--c); }
.t-step:disabled { opacity: .25; cursor: default; }
.bounty-board { padding: 12px 14px; background: var(--glass); border: 1px solid rgba(255, 225, 75, .25); }
.bounty-board .hg-sub { margin-top: 0; }
.bounty-board .hint { margin-bottom: 10px; line-height: 1.5; }
.b-row { display: grid; grid-template-columns: 28px 1fr auto 72px; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); font-size: 11px; }
.b-row b { letter-spacing: 2px; }
.b-row span { opacity: .65; font-size: 10px; letter-spacing: 1px; }
.b-row em { font-style: normal; text-align: right; opacity: .5; font-size: 10px; }
.b-row em.pay { color: var(--halo); opacity: 1; text-shadow: 0 0 8px rgba(255, 225, 75, .6); }
.b-row.locked { opacity: .4; }

/* ---------- RECORDS ---------- */
.rec-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rec { display: flex; flex-direction: column; padding: 12px 14px; background: rgba(8, 12, 26, .7); border: 1px solid rgba(120, 220, 255, .12); }
.rec b { font-size: 26px; color: #fff; }
.rec span { font-size: 9px; letter-spacing: 2px; opacity: .6; margin-top: 2px; }
.rec.gold b { color: var(--halo); text-shadow: 0 0 12px rgba(255, 225, 75, .6); }
.rec.pink b { color: var(--cipher); text-shadow: 0 0 12px rgba(255, 75, 216, .6); }
.rec.flux b { color: var(--flux); }
.rec.ciphers b { color: var(--cipher); }
.rec.halos b { color: var(--halo); }

/* ---------- launch bay (mode select) ---------- */
.mode-cards { grid-template-columns: 1.5fr repeat(4, minmax(150px, 1fr)); width: min(1060px, 95vw); }
.mode-card.featured {
  position: relative; border-color: rgba(255, 225, 75, .55) !important;
  background: linear-gradient(160deg, rgba(255, 209, 102, .2), rgba(255, 75, 216, .1) 60%, rgba(8, 12, 26, .85)) !important;
  box-shadow: 0 0 26px rgba(255, 209, 102, .15);
}
.mode-card.featured b { font-size: 20px; letter-spacing: 6px; color: #fff; text-shadow: 0 0 14px rgba(255, 209, 102, .8); }
.mode-card.featured .card-icon { color: var(--halo); }
.feat-tag { position: absolute; top: 8px; right: 8px; font-size: 8px; letter-spacing: 2px; padding: 2px 6px; color: #1a1204; background: var(--halo); }
.tag.gold { color: var(--halo); border-color: rgba(255, 225, 75, .5); }
@media (max-width: 980px) { .mode-cards { grid-template-columns: repeat(2, minmax(150px, 1fr)); } .mode-card.featured { grid-column: span 2; } }
.sector-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 150px; padding: 8px 12px; color: var(--c);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 14%, transparent), rgba(8, 12, 26, .7));
  position: relative;
}
.sector-chip + .sector-chip::before { content: '\2192'; position: absolute; left: -16px; top: 50%; transform: translateY(-50%); color: rgba(255, 255, 255, .4); }
.sector-chip b { font-size: 12px; letter-spacing: 3px; color: #fff; }
.sector-chip small { font-size: 9px; letter-spacing: 1.5px; opacity: .75; }
.sector-chip .card-icon svg { width: 22px; height: 22px; }
#map-picker:has(.sector-chip) { gap: 22px; }
.gun-pick { display: flex; flex-direction: column; align-items: center; gap: 2px; border-bottom: 2px solid transparent; }
.gun-pick.on { border-bottom-color: var(--c); box-shadow: 0 6px 16px -8px var(--c); }
.gun-pick canvas { margin-bottom: 2px; }
.launch-chip { display: flex; flex-direction: column; padding: 6px 12px; border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.launch-chip b { font-size: 11px; letter-spacing: 2px; color: #fff; }
.launch-chip small { font-size: 9px; letter-spacing: 1px; opacity: .75; }
.launch-threat { --f: 0; display: grid; grid-template-columns: auto 160px; gap: 2px 12px; align-items: center; padding: 6px 12px; border: 1px solid rgba(255, 59, 107, calc(.25 + var(--f) * .7)); background: rgba(60, 10, 20, calc(.2 + var(--f) * .5)); max-width: 460px; }
.launch-threat b { font-size: 14px; letter-spacing: 3px; color: #fff; text-shadow: 0 0 10px rgba(255, 59, 107, .8); }
.launch-threat i { height: 6px; background: linear-gradient(90deg, #4be1ff, #ffd166 45%, #ff3b6b) no-repeat; background-size: calc(var(--f) * 100%) 100%; background-color: rgba(255, 255, 255, .08); }
.launch-threat small { grid-column: 1 / -1; font-size: 9px; letter-spacing: 1px; opacity: .75; text-align: left; }
.chip-btn.link { align-self: center; }

/* ---------- pilot card wallet (main menu) ---------- */
.pilot-wallet {
  width: 100%; margin-top: 10px; display: flex; align-items: center; gap: 12px; padding: 8px 10px; font: inherit; cursor: pointer;
  color: var(--ink); background: rgba(255, 255, 255, .03); border: 1px solid rgba(120, 220, 255, .18); transition: all .15s ease;
}
.pilot-wallet:hover { border-color: var(--cyan); box-shadow: 0 0 16px rgba(75, 225, 255, .2); }
.pilot-wallet .coin { min-width: 0; padding: 0; border: 0; background: none; clip-path: none; gap: 5px; }
.pilot-wallet .coin svg { width: 16px; height: 16px; }
.pilot-wallet .coin b { font-size: 15px; }
.pilot-wallet em { margin-left: auto; font-style: normal; font-size: 10px; letter-spacing: 2px; color: var(--cyan); }
.menu-btn.hangar-btn { border-left-color: rgba(255, 225, 75, .6); }
.menu-btn.hangar-btn .mi { color: var(--halo); }

/* ---------- results: rewards + victory ---------- */
.over-sub { margin: -10px 0 0; font-size: 12px; letter-spacing: 4px; color: var(--halo); }
.run-rewards { width: min(760px, 94vw); }
.rewards { display: flex; flex-direction: column; gap: 10px; }
.rw-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rw-tile {
  --cc: var(--flux);
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 10px; color: var(--cc); opacity: .45;
  border: 1px solid color-mix(in srgb, var(--cc) 35%, transparent); background: rgba(4, 6, 14, .6);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.rw-tile.ciphers { --cc: var(--cipher); }
.rw-tile.halos { --cc: var(--halo); }
.rw-tile.got { opacity: 1; background: linear-gradient(140deg, color-mix(in srgb, var(--cc) 24%, transparent), rgba(4, 6, 14, .7)); box-shadow: 0 0 22px color-mix(in srgb, var(--cc) 25%, transparent); animation: rwIn .5s ease both; }
.rw-tile .hg-ic { width: 26px; height: 26px; filter: drop-shadow(0 0 6px var(--cc)); }
.rw-tile b { font-size: 26px; color: #fff; text-shadow: 0 0 12px var(--cc); }
.rw-tile small { font-size: 9px; letter-spacing: 2px; }
.rw-tile.ciphers.got { animation-delay: .12s; }
.rw-tile.halos.got { animation-delay: .24s; }
@keyframes rwIn { from { transform: translateY(10px) scale(.94); opacity: 0; } }
.rw-lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 4px 16px; font-size: 11px; }
.rw-lines span { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed rgba(255, 255, 255, .08); }
.rw-lines i { font-style: normal; opacity: .65; letter-spacing: 1px; }
.rw-lines b { color: var(--flux); }
.rw-lines .mult b { color: var(--gold); }
.rw-lines .ci b { color: var(--cipher); }
.rw-bounty {
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 14px; color: var(--halo);
  border: 1px solid rgba(255, 225, 75, .6); background: linear-gradient(90deg, rgba(255, 225, 75, .08), rgba(255, 225, 75, .22), rgba(255, 225, 75, .08));
  animation: rwIn .5s .35s ease both;
}
.rw-bounty .hg-ic { width: 22px; height: 22px; }
.rw-bounty b { font-size: 12px; letter-spacing: 3px; color: #fff; }
.rw-bounty span { font-size: 14px; letter-spacing: 2px; text-shadow: 0 0 10px rgba(255, 225, 75, .8); }
.rw-note { font-size: 11px; letter-spacing: 1px; padding: 6px 12px; border-left: 3px solid var(--c, var(--cyan)); background: rgba(255, 255, 255, .03); text-align: left; }
.rw-note.ch { border-left-color: var(--gold); }
.btn.gold { color: #1a1204; background: linear-gradient(90deg, #ffe14b, #ffb000); box-shadow: 0 0 26px rgba(255, 209, 102, .55); }
.btn.gold:hover { box-shadow: 0 0 40px rgba(255, 209, 102, .85); }
#overlay-over.victory { background: radial-gradient(ellipse at 50% 30%, rgba(255, 209, 102, .22), rgba(4, 4, 10, .9) 65%); }
#overlay-over.victory h2 {
  font-size: 52px; letter-spacing: 18px; background: linear-gradient(180deg, #fff6c2, #ffd166 55%, #ff8c42); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; filter: drop-shadow(0 0 22px rgba(255, 209, 102, .7)); animation: victoryIn .8s cubic-bezier(.2, 1.4, .4, 1) both;
}
#overlay-over.victory::before, #overlay-over.victory::after { border-color: rgba(255, 225, 75, .7); }
#overlay-over.extended h2 { color: var(--halo); }
@keyframes victoryIn { from { transform: scale(1.6); opacity: 0; letter-spacing: 40px; } }

/* ---------- HUD: shield + deadline ---------- */
.bar.shield { height: 5px; margin-top: 3px; background: rgba(125, 240, 255, .1); }
#shield-fill { height: 100%; background: linear-gradient(90deg, #7df0ff, #cfffff); transform-origin: left; box-shadow: 0 0 8px #7df0ff; }
#timer-text.late { color: #ff8c42; animation: pulse .5s infinite alternate; }

@media (max-width: 900px) {
  .c-row { grid-template-columns: 1fr; }
  .circuit::before { display: none; }
  .c-node.b { text-align: left; align-items: flex-start; }
  .armory, .threat-cols { grid-template-columns: 1fr; }
  .variants { grid-template-columns: 1fr; }
  .rec-grid { grid-template-columns: repeat(2, 1fr); }
  .hangar-top { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .circuit::before, .gd-art, .gd-art canvas, .threat-gauge::after, .c-buy.can { animation: none; }
}
.threat-num { color: #ff8c42; text-shadow: 0 0 12px rgba(255, 59, 107, .7); }
#overlay-over .stats { width: min(820px, 94vw); grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px 14px; }
#overlay-over .stats div { padding: 6px 4px; border: 1px solid rgba(120, 220, 255, .1); background: rgba(4, 6, 14, .45); }
#overlay-over .stats div.hidden { display: none; }

/* =====================================================================
   SCREENS in the hangar style: field guide, leaderboard, profile,
   settings, and the LEVEL UP draft
   ===================================================================== */
.overlay.screen { justify-content: flex-start; gap: 14px; padding-top: 26px; }
.screen .hangar-top h2 { font-size: 34px; }
.top-note { max-width: 420px; text-align: right; line-height: 1.5; }
.screen > .btn, .screen > .btn-row { margin-top: 4px; }

/* ---------- field guide ---------- */
.guide-screen .hangar-top, .guide-screen .key-deck, .guide-screen .guide { width: min(1180px, 95vw); }
.key-deck {
  display: flex; flex-wrap: wrap; gap: 8px 10px; justify-content: center; padding: 10px 12px;
  background: rgba(8, 12, 26, .6); border: 1px solid var(--line);
}
.key-deck span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(120, 220, 255, .1); }
.key-deck i { font-style: normal; font-size: 10px; letter-spacing: 2px; opacity: .75; margin-left: 4px; }
/* no max-height: with CSS columns, a capped height spills cards into hidden extra columns */
.guide-screen .guide { display: block; columns: 3 330px; column-gap: 12px; padding: 2px 4px; text-align: left; }
.g-card {
  break-inside: avoid; margin: 0 0 12px; padding: 14px 16px 12px; position: relative;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 10%, transparent), rgba(8, 12, 26, .82) 55%);
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); border-left: 3px solid var(--c);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  animation: hgIn .35s ease both;
}
.g-card header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.g-ic {
  width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px; color: var(--c);
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 25%, transparent), rgba(0, 0, 0, .3));
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.g-ic svg { width: 19px; height: 19px; filter: drop-shadow(0 0 5px var(--c)); }
.g-idx { font-size: 10px; letter-spacing: 2px; opacity: .45; }
.g-card h3 { margin: 0; font-size: 13px; letter-spacing: 3px; color: #fff; text-shadow: 0 0 10px var(--c); }
.g-card p { margin: 6px 0 0; font-size: 12px; line-height: 1.6; opacity: .86; }
.g-card b { color: var(--c); font-weight: 700; }

/* ---------- leaderboard ---------- */
.lb-screen .hangar-top, .lb-screen .hangar-tabs, .lb-screen .lb-table { width: min(960px, 95vw); }
.lb-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.lb-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 11px; letter-spacing: 2px; border: 1px solid var(--line); background: rgba(8, 12, 26, .6); color: #9fd7e8; }
.lb-chip.you { border-color: rgba(255, 225, 75, .5); color: var(--halo); }
.lb-chip.you i { font-style: normal; font-size: 9px; opacity: .7; }
.lb-chip.you b { color: #fff; }
.lb-screen .hangar-tabs { justify-content: center; }
.lb-screen .hg-tab { background: rgba(8, 12, 26, .55); }
.lb-modes { display: flex; gap: 6px; justify-content: center; }
.lb-modes .seg { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; font-size: 11px; letter-spacing: 2px; }
.lb-modes .seg .hg-ic { width: 15px; height: 15px; }
.lb-modes .seg.on { color: #031018; background: var(--cyan); border-color: var(--cyan); }
.lb-table { min-height: 240px; display: flex; flex-direction: column; gap: 12px; }
.lb-row.skeleton { height: 40px; border: 1px solid rgba(120, 220, 255, .08); background: linear-gradient(90deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.lb-podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 12px; align-items: end; }
.lb-pod {
  --m: #ffe14b;
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--m) 18%, transparent), rgba(8, 12, 26, .88));
  border: 1px solid color-mix(in srgb, var(--m) 55%, transparent); border-top: 3px solid var(--m);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
  animation: rwIn .5s ease both;
}
.lb-pod.gold { --m: #ffe14b; min-height: 190px; box-shadow: 0 0 30px rgba(255, 225, 75, .15); }
.lb-pod.silver { --m: #cfe3ff; min-height: 160px; }
.lb-pod.bronze { --m: #ff9d5c; min-height: 145px; }
.lb-medal {
  width: 38px; height: 38px; display: grid; place-items: center; font-size: 18px; font-weight: 700; color: #120c02;
  background: var(--m); box-shadow: 0 0 16px var(--m); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.lb-pod .names { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; font-size: 13px; letter-spacing: 2px; }
.lb-score { font-size: 28px; color: #fff; text-shadow: 0 0 14px var(--m); }
.lb-pod.gold .lb-score { font-size: 34px; }
.lb-pod small { font-size: 10px; letter-spacing: 1.5px; opacity: .65; }
.lb-you, .lb-row.me::after { position: absolute; top: 8px; right: 10px; font-style: normal; font-size: 9px; letter-spacing: 2px; padding: 2px 6px; color: #120c02; background: var(--halo); }
.lb-list { display: flex; flex-direction: column; gap: 5px; }
.lb-row {
  position: relative; display: grid; grid-template-columns: 42px 1fr auto 220px; gap: 12px; align-items: center; padding: 8px 12px;
  background: rgba(8, 12, 26, .72); border: 1px solid rgba(120, 220, 255, .12); animation: hgIn .3s ease both;
}
.lb-row .rank { font-size: 14px; color: #9fd7e8; text-align: center; }
.lb-row .names { display: flex; gap: 2px 10px; flex-wrap: wrap; font-size: 12px; letter-spacing: 2px; overflow: hidden; }
.lb-row .facts { font-size: 10px; letter-spacing: 1px; opacity: .55; white-space: nowrap; }
.lb-row .num { position: relative; display: flex; align-items: center; justify-content: flex-end; height: 22px; }
.lb-row .num .bar { position: absolute; left: 0; top: 50%; height: 4px; transform: translateY(-50%); background: linear-gradient(90deg, rgba(75, 225, 255, .15), rgba(75, 225, 255, .6)); }
.lb-row .num b { position: relative; font-size: 15px; color: #fff; }
.lb-row.me { border-color: rgba(255, 225, 75, .6); background: linear-gradient(90deg, rgba(255, 225, 75, .12), rgba(8, 12, 26, .8)); }
.lb-row.me::after { content: 'YOU'; top: -8px; right: 8px; }
.lb-pod.me { outline: 1px dashed var(--halo); outline-offset: 3px; }
.names span { color: var(--pc, #dffcff); text-shadow: 0 0 8px color-mix(in srgb, var(--pc, #4be1ff) 50%, transparent); }
.names span::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--pc, #4be1ff); box-shadow: 0 0 6px var(--pc, #4be1ff); vertical-align: 1px; }
.lb-row .names span + span::before, .lb-pod .names span + span::before { content: ''; }
.lb-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 20px; border: 1px dashed rgba(120, 220, 255, .2); background: rgba(8, 12, 26, .5); }
.lb-empty-ic { width: 54px; height: 54px; color: var(--halo); opacity: .8; filter: drop-shadow(0 0 10px rgba(255, 225, 75, .5)); }
.lb-empty-ic svg { width: 100%; height: 100%; }
.lb-empty p { margin: 0; font-size: 13px; opacity: .8; }
@media (max-width: 760px) {
  .lb-podium { grid-template-columns: 1fr; }
  .lb-row { grid-template-columns: 34px 1fr 110px; }
  .lb-row .facts { display: none; }
}

/* ---------- profile ---------- */
.profile-screen .hangar-top, .profile-body { width: min(1060px, 95vw); }
.profile-body { display: grid; grid-template-columns: 430px 1fr; gap: 18px; align-items: start; text-align: left; }
.id-card {
  --pc: #4be1ff;
  position: relative; padding: 16px 18px 14px; overflow: hidden;
  background: linear-gradient(150deg, color-mix(in srgb, var(--pc) 16%, transparent), rgba(6, 9, 20, .92) 55%);
  border: 1px solid color-mix(in srgb, var(--pc) 50%, transparent);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  box-shadow: inset 0 0 40px color-mix(in srgb, var(--pc) 10%, transparent);
}
.id-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .25;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, .03) 3px 4px);
}
.id-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.id-org { font-size: 9px; letter-spacing: 3px; opacity: .6; }
.id-rank { --rc: #9fb3c8; font-size: 11px; letter-spacing: 3px; padding: 3px 10px; color: #0a0a12; background: var(--rc); box-shadow: 0 0 14px var(--rc); }
.id-main { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; }
.id-ship {
  width: 150px; height: 150px; display: grid; place-items: center; border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--pc) 55%, transparent);
  background: radial-gradient(circle, color-mix(in srgb, var(--pc) 22%, transparent), transparent 70%);
}
.id-ship canvas { width: 140px; height: 140px; }
.id-info { display: flex; flex-direction: column; gap: 8px; }
.id-name { font-size: 26px; letter-spacing: 5px; font-weight: 700; text-shadow: 0 0 16px currentColor; }
.id-since { font-size: 9px; letter-spacing: 2px; opacity: .55; margin-top: -6px; }
.id-field label { display: block; font-size: 9px; letter-spacing: 2px; opacity: .6; margin-bottom: 4px; }
.id-field .inline-field { display: flex; gap: 6px; }
.id-field .text-input { width: 150px; }
.id-field .swatches { gap: 7px; flex-wrap: wrap; }
.id-field .swatch { width: 22px; height: 22px; }
.sig-weapon {
  --c: #9fb3c8;
  display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 8%, transparent);
}
.sig-weapon span { display: flex; flex-direction: column; }
.sig-weapon i { font-style: normal; font-size: 9px; letter-spacing: 2px; opacity: .6; }
.sig-weapon b { font-size: 14px; letter-spacing: 3px; color: var(--c); }
.sig-weapon small { font-size: 10px; opacity: .7; color: var(--halo); }
.id-barcode { height: 14px; margin-top: 12px; opacity: .35; background: repeating-linear-gradient(90deg, #dffcff 0 2px, transparent 2px 4px, #dffcff 4px 5px, transparent 5px 9px, #dffcff 9px 12px, transparent 12px 14px); }
.profile-side .hg-sub { margin-top: 0; }
.profile-screen .stats-grid { width: 100%; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.profile-screen .stats-grid div {
  display: flex; flex-direction: column-reverse; padding: 10px 12px; text-align: left; border-radius: 0;
  background: rgba(8, 12, 26, .72); border: 1px solid rgba(120, 220, 255, .12); border-left: 3px solid rgba(160, 220, 255, .25);
}
.profile-screen .stats-grid span { font-size: 9px; letter-spacing: 2px; opacity: .6; margin: 2px 0 0; }
.profile-screen .stats-grid b { font-size: 22px; color: #fff; }
.profile-screen .stats-grid .cyan { border-left-color: var(--cyan); }
.profile-screen .stats-grid .pink { border-left-color: var(--pink); }
.profile-screen .stats-grid .gold { border-left-color: var(--halo); }
.profile-screen .stats-grid .gold b { color: var(--halo); text-shadow: 0 0 10px rgba(255, 225, 75, .5); }
.profile-screen .stats-grid .red { border-left-color: var(--danger); }
.profile-screen .stats-grid .red b { color: #ff8c42; }
.profile-screen .stats-grid .green { border-left-color: #56ff9a; }
@media (max-width: 900px) { .profile-body { grid-template-columns: 1fr; } .profile-screen .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- settings ---------- */
.settings-screen .hangar-top { width: min(1060px, 95vw); }
.settings-screen .settings-grid {
  width: min(1060px, 95vw); display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start;
  max-height: calc(100vh - 230px); overflow-y: auto; padding: 2px 4px; text-align: left;
}
.settings-screen .set-section {
  --c: var(--cyan);
  position: relative; margin: 0; padding: 12px 16px 6px 16px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 9%, transparent), rgba(8, 12, 26, .82) 50%);
  border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); border-top: 2px solid var(--c);
  animation: hgIn .3s ease both;
}
.settings-screen .set-section.wide { grid-row: span 3; }
.settings-screen .set-section h3 { margin: 0 0 6px 34px; font-size: 13px; letter-spacing: 4px; color: #fff; text-shadow: 0 0 10px var(--c); opacity: 1; }
.set-ic { position: absolute; top: 9px; left: 14px; width: 22px; height: 22px; color: var(--c); filter: drop-shadow(0 0 5px var(--c)); }
.set-ic svg { width: 100%; height: 100%; }
.settings-screen .set-section .set-row { padding: 10px 2px; border-bottom: 1px solid rgba(120, 200, 230, .08); }
.settings-screen .set-row label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; letter-spacing: 1.5px; }
.settings-screen .set-row label small { font-size: 10px; letter-spacing: .3px; opacity: .55; }
.settings-screen .slider { width: 180px; }
.settings-screen .slider::-webkit-slider-thumb { background: var(--c); box-shadow: 0 0 12px var(--c); border-radius: 2px; transform: rotate(45deg); }
.settings-screen .seg-group { border-radius: 0; }
.settings-screen .seg-group .seg { border-radius: 0; min-width: 0; padding: 6px 10px; font-size: 10px; }
.settings-screen .seg-group .seg.on { background: var(--c); border-color: var(--c); }
.settings-screen .switch.on .knob { border-color: var(--c); background: color-mix(in srgb, var(--c) 25%, transparent); }
.settings-screen .switch.on .knob::after { background: var(--c); box-shadow: 0 0 10px var(--c); }
.xhair-preview {
  position: absolute; top: 12px; right: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.xhair-preview canvas { width: 58px; height: 58px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 20%, transparent); }
.xhair-preview small { font-size: 8px; letter-spacing: 2px; opacity: .5; }
.settings-screen .set-section.wide h3 { margin-bottom: 52px; }
@media (max-width: 900px) { .settings-screen .settings-grid { grid-template-columns: 1fr; } .settings-screen .set-section.wide { grid-row: auto; } }

/* ---------- LEVEL UP draft ---------- */
.draft-screen { gap: 14px; }
.draft-head { text-align: center; }
.draft-head h2 {
  font-size: 44px; letter-spacing: 16px;
  background: linear-gradient(180deg, #eafff4, #56ff9a 60%, #4be1ff); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 16px rgba(86, 255, 154, .45)); animation: victoryIn .55s cubic-bezier(.2, 1.4, .4, 1) both;
}
.draft-head .kicker { color: #56ff9a; }
#draft-hint { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; letter-spacing: 3px; opacity: .8; }
#draft-hint span { opacity: .6; letter-spacing: 1px; }
.draft-status {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: stretch; width: min(980px, 95vw);
  padding: 8px 12px; background: rgba(8, 12, 26, .6); border: 1px solid var(--line);
}
.ds-bar { display: grid; grid-template-columns: auto 110px auto; gap: 8px; align-items: center; font-size: 10px; letter-spacing: 2px; }
.ds-bar div { height: 7px; background: rgba(255, 255, 255, .07); clip-path: polygon(0 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.ds-bar i { display: block; height: 100%; box-shadow: 0 0 8px currentColor; }
.ds-bar span { opacity: .6; }
.ds-bar b { font-size: 11px; color: #fff; }
.ds-gun { display: flex; flex-direction: column; justify-content: center; padding: 2px 10px; border-left: 2px solid var(--c); }
.ds-gun span { font-size: 8px; letter-spacing: 2px; opacity: .55; }
.ds-gun b { font-size: 11px; letter-spacing: 2px; color: var(--c); }
.ds-gun small { font-size: 9px; opacity: .6; }
.ds-perks { display: flex; align-items: center; gap: 6px; font-size: 10px; letter-spacing: 2px; opacity: .85; }
.ds-perks b { font-size: 16px; color: var(--gold); }
.draft-screen .draft-cards { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; width: min(1180px, 96vw); }
.draft-screen .draft-card {
  --c: #9fd7e8; --g: #ffd166;
  position: relative; width: 210px; min-height: 250px; display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 18px 16px 14px; font: inherit; color: var(--ink); cursor: pointer; text-align: center; border-radius: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 14%, transparent), rgba(6, 9, 20, .92) 60%);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); border-top: 3px solid var(--c);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  animation: cardIn .45s cubic-bezier(.2, 1.2, .4, 1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(26px) rotateX(35deg); } }
.draft-screen .draft-card:hover, .draft-screen .draft-card:focus-visible {
  transform: translateY(-8px); border-color: var(--c); outline: none;
  box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--c) 70%, transparent), inset 0 0 30px color-mix(in srgb, var(--c) 12%, transparent);
}
.draft-card .dk { position: absolute; top: 8px; left: 8px; }
.d-rar { position: absolute; top: 9px; right: 10px; font-size: 8px; letter-spacing: 2px; color: var(--c); }
.d-badge {
  width: 66px; height: 66px; margin: 6px 0 4px; display: grid; place-items: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--g) 34%, transparent) 0 45%, color-mix(in srgb, var(--g) 12%, transparent) 46% 70%, transparent 71%);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.d-badge .glyph { font-size: 20px; font-weight: 700; letter-spacing: 1px; color: var(--g); text-shadow: 0 0 12px var(--g); }
.draft-screen .draft-card b { font-size: 14px; letter-spacing: 3px; color: #fff; }
.draft-screen .draft-card small { font-size: 12px; line-height: 1.45; opacity: .85; min-height: 34px; }
.draft-screen .draft-card em {
  font-style: normal; font-size: 9px; letter-spacing: 2px; padding: 3px 8px; color: #120c02; background: var(--gold);
  box-shadow: 0 0 12px rgba(255, 209, 102, .6);
}
.draft-screen .draft-card.synergy { box-shadow: 0 0 22px rgba(255, 209, 102, .25); }
.d-pips { display: flex; gap: 5px; margin-top: auto; }
.d-pips i { width: 8px; height: 8px; transform: rotate(45deg); border: 1.5px solid var(--c); opacity: .35; }
.d-pips i.on { background: var(--c); opacity: 1; }
.d-pips i.nx { background: var(--g); border-color: var(--g); opacity: 1; box-shadow: 0 0 8px var(--g); animation: pulse .7s infinite alternate; }
.draft-screen .draft-card > i { font-style: normal; font-size: 9px; letter-spacing: 2px; opacity: .6; }
.draft-card.rarity-legendary { background: linear-gradient(180deg, rgba(255, 176, 0, .22), rgba(6, 9, 20, .92) 60%); }
.draft-card.rarity-legendary::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 225, 150, .22) 50%, transparent 65%);
  transform: translateX(-100%); animation: sheen 2.6s ease-in-out infinite;
}
.draft-card.rarity-epic .d-rar, .draft-card.rarity-legendary .d-rar { text-shadow: 0 0 8px var(--c); }
.reroll-btn { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; }
.reroll-btn b { font-size: 10px; letter-spacing: 2px; opacity: .7; }
.draft-screen .shop-row {
  display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; justify-content: center; padding: 10px 12px;
  background: rgba(20, 16, 4, .45); border: 1px solid rgba(255, 225, 75, .22);
}
.shop-head { display: flex; flex-direction: column; justify-content: center; padding: 0 12px 0 4px; border-right: 1px solid rgba(255, 225, 75, .2); }
.shop-head span { font-size: 9px; letter-spacing: 3px; opacity: .65; }
.shop-head .scrap-chip { font-size: 16px; color: var(--halo); text-shadow: 0 0 10px rgba(255, 225, 75, .5); }
.draft-screen .shop-item {
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'k b' 'k s' 'k i'; column-gap: 10px; align-items: center;
  padding: 8px 14px 8px 10px; min-width: 170px; font: inherit; color: var(--ink); text-align: left; cursor: pointer; border-radius: 0;
  background: rgba(8, 12, 26, .7); border: 1px solid rgba(255, 225, 75, .3); transition: all .15s ease;
}
.draft-screen .shop-item kbd { grid-area: k; }
.draft-screen .shop-item b { grid-area: b; font-size: 11px; letter-spacing: 2px; }
.draft-screen .shop-item small { grid-area: s; font-size: 9px; opacity: .7; }
.draft-screen .shop-item i { grid-area: i; font-style: normal; font-size: 10px; letter-spacing: 1px; color: var(--halo); }
.draft-screen .shop-item:not(:disabled):hover { transform: translateY(-2px); border-color: var(--halo); box-shadow: 0 0 16px rgba(255, 225, 75, .25); }
.draft-screen .shop-item:disabled { opacity: .45; cursor: default; }
.draft-screen .shop-item:disabled i { color: #9fb3c8; }
@media (prefers-reduced-motion: reduce) {
  .draft-screen .draft-card, .draft-card.rarity-legendary::after, .d-pips i.nx, .lb-row.skeleton { animation: none; }
}

/* ---------- PAUSE ---------- */
.pause-screen { gap: 16px; justify-content: safe center; }
.pause-head { text-align: center; }
.pause-head h2 {
  font-size: 46px; letter-spacing: 18px;
  background: linear-gradient(180deg, #fff6c2, #ffd166 60%, #ff8c42); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 16px rgba(255, 209, 102, .45));
}
.pause-head .kicker { color: var(--gold); }
.pause-grid { width: min(1180px, 95vw); display: grid; grid-template-columns: 300px 1fr 1.2fr; gap: 16px; align-items: start; text-align: left; }
.pause-menu { max-width: none; gap: 8px; }
.pause-menu .menu-btn.small { padding: 11px 14px; }
.pause-menu .menu-btn.small small { font-size: 9px; }
.menu-btn.danger-btn { border-left-color: rgba(255, 93, 125, .5); background: linear-gradient(90deg, rgba(255, 93, 125, .1), rgba(255, 93, 125, .02)); }
.menu-btn.danger-btn .mi { color: #ff7a93; }
.menu-btn.danger-btn.armed { border-color: #ff5d7d; background: linear-gradient(90deg, rgba(255, 93, 125, .32), rgba(255, 93, 125, .06)); box-shadow: 0 0 20px rgba(255, 93, 125, .3); animation: denied .4s ease; }
.menu-btn.danger-btn.armed b { color: #fff; }
.pause-run, .pause-build { padding: 14px 16px; background: rgba(8, 12, 26, .72); border: 1px solid var(--line); }
.pause-build { border-color: rgba(255, 209, 102, .25); max-height: min(520px, 60vh); overflow-y: auto; }
.pause-build .hg-sub { margin-top: 0; }
.pause-build .hg-sub span { color: #9fd7e8; opacity: .7; }
.pr-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.pr-tile { display: flex; flex-direction: column; padding: 8px 10px; background: rgba(255, 255, 255, .03); border-left: 3px solid rgba(160, 220, 255, .25); }
.pr-tile b { font-size: 18px; color: #fff; }
.pr-tile span { font-size: 9px; letter-spacing: 2px; opacity: .6; }
.pr-tile.cyan { border-left-color: var(--cyan); }
.pr-tile.pink { border-left-color: var(--pink); }
.pr-bar { display: grid; grid-template-columns: 76px 1fr 64px; gap: 8px; align-items: center; margin: 6px 0; font-size: 10px; letter-spacing: 2px; }
.pr-bar span { opacity: .6; }
.pr-bar div { height: 7px; background: rgba(255, 255, 255, .07); clip-path: polygon(0 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.pr-bar i { display: block; height: 100%; }
.pr-bar b { text-align: right; color: #fff; font-size: 11px; }
.pr-guns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.pr-gun { display: flex; flex-direction: column; padding: 6px 10px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 8%, transparent); }
.pr-gun span { font-size: 8px; letter-spacing: 2px; opacity: .55; }
.pr-gun b { font-size: 12px; letter-spacing: 2px; color: var(--c); }
.pr-gun small { font-size: 9px; opacity: .7; }
.pr-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.pr-chip { --c: #9fd7e8; font-size: 9px; letter-spacing: 1.5px; padding: 3px 8px; color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); }
.pr-chip.threat { --c: #ff8c42; }
.pause-build .perk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 5px; max-width: none; }
.pause-build .perk-row {
  --g: #ffd166; --c: #9fd7e8;
  display: grid; grid-template-columns: 34px 1fr auto; grid-template-areas: 'g b x' 'g p x'; column-gap: 8px; align-items: center;
  padding: 5px 8px; opacity: 1; background: rgba(255, 255, 255, .025); border: 1px solid rgba(255, 255, 255, .06); border-left: 2px solid var(--c);
}
.pause-build .perk-row .glyph {
  grid-area: g; width: 32px; height: 32px; display: grid; place-items: center; font-size: 10px; color: var(--g); text-shadow: 0 0 8px var(--g);
  background: radial-gradient(circle, color-mix(in srgb, var(--g) 25%, transparent), transparent 70%);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.pause-build .perk-row b { grid-area: b; font-size: 10px; letter-spacing: 1.5px; }
.pause-build .perk-row .pp { grid-area: p; display: flex; gap: 3px; }
.pause-build .perk-row .pp i { width: 6px; height: 6px; transform: rotate(45deg); border: 1px solid var(--c); opacity: .35; }
.pause-build .perk-row .pp i.on { background: var(--c); opacity: 1; }
.pause-build .perk-row > i { grid-area: x; font-style: normal; font-size: 10px; color: var(--g); opacity: .9; }
.pause-build .perk-row.rarity-legendary { background: linear-gradient(90deg, rgba(255, 176, 0, .14), rgba(255, 255, 255, .02)); }
.pause-build .perk-row.empty { display: block; grid-column: 1 / -1; padding: 16px; text-align: center; opacity: .5; letter-spacing: 3px; border-left-color: rgba(255, 255, 255, .1); }
.pause-syn { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.syn-chip { font-size: 9px; letter-spacing: 2px; padding: 3px 8px; color: #120c02; background: var(--gold); box-shadow: 0 0 10px rgba(255, 209, 102, .4); }
.pause-squad .squad-head { margin: 12px 0 6px; font-size: 11px; letter-spacing: 3px; }
@media (max-width: 1000px) { .pause-grid { grid-template-columns: 1fr; } }

/* ---------- CO-OP ---------- */
.coop-screen .hangar-top, .coop-body { width: min(980px, 95vw); }
.coop-body { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.coop-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.coop-card {
  --c: var(--cyan);
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 20px; text-align: center;
  background: linear-gradient(170deg, color-mix(in srgb, var(--c) 16%, transparent), rgba(8, 12, 26, .88) 60%);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); border-top: 3px solid var(--c);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%); animation: hgIn .35s ease both;
}
.coop-card.join { --c: var(--pink); animation-delay: 80ms; }
.coop-card .hg-ic { width: 44px; height: 44px; color: var(--c); filter: drop-shadow(0 0 10px var(--c)); }
.coop-card b { font-size: 18px; letter-spacing: 5px; color: #fff; }
.coop-card small { font-size: 12px; opacity: .75; max-width: 320px; line-height: 1.5; }
.code-input { width: 170px; font-size: 22px !important; letter-spacing: 12px !important; text-align: center; text-transform: uppercase; }
.coop-facts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
/* SQUAD CHALLENGES: what only happens with a squad */
.squad-intro { padding: 16px 18px 14px; border: 1px solid rgba(255, 75, 216, .28); background: linear-gradient(160deg, rgba(40, 10, 40, .45), rgba(8, 12, 26, .75)); animation: hgIn .35s ease both; animation-delay: 140ms; }
.sq-head { display: grid; gap: 4px; margin-bottom: 12px; }
.sq-head .kicker { color: var(--pink); }
.sq-head b { font-size: 16px; letter-spacing: 5px; color: #fff; }
.sq-head small { font-size: 12px; opacity: .78; line-height: 1.5; }
.sq-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sq-card { text-align: left; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; padding: 9px 10px; background: rgba(8, 12, 26, .7); border: 1px solid rgba(160, 220, 255, .12); border-left: 3px solid var(--c); }
.sq-glyph { display: grid; place-items: center; width: 34px; height: 34px; font-style: normal; font-weight: 700; font-size: 11px; letter-spacing: 1px; color: var(--c); border: 1px solid var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 40%, transparent) inset; }
.sq-txt b { display: block; font-size: 11px; letter-spacing: 2px; color: #fff; margin-bottom: 3px; }
.sq-txt small { display: block; font-size: 11px; line-height: 1.45; opacity: .75; }
.sq-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.sq-tiers { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; }
.sq-tiers small { font-size: 11px; opacity: .72; flex-basis: 260px; flex-grow: 1; text-align: left; }
.sq-tier { font-size: 10px; letter-spacing: 2px; padding: 4px 9px; border: 1px solid; }
.sq-tier.hard { color: #ffd166; border-color: rgba(255, 209, 102, .55); }
.sq-tier.nightmare { color: #ff3b6b; border-color: rgba(255, 59, 107, .6); text-shadow: 0 0 8px rgba(255, 59, 107, .5); }
@media (max-width: 900px) { .sq-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .sq-grid { grid-template-columns: 1fr; } }
.coop-facts span { font-size: 10px; letter-spacing: 2px; padding: 5px 10px; border: 1px solid var(--line); background: rgba(8, 12, 26, .6); color: #9fd7e8; }
.coop-error { color: #ff8fa6; opacity: 1; }
.coop-lobby { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; text-align: left; }
.coop-left, .coop-right { padding: 16px; background: rgba(8, 12, 26, .72); border: 1px solid var(--line); }
.coop-right .hg-sub { margin-top: 0; }
.coop-codebox { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'l b' 'c b'; align-items: center; gap: 2px 12px; margin-bottom: 14px; }
.coop-codebox span { grid-area: l; font-size: 10px; letter-spacing: 3px; opacity: .6; }
.coop-codebox .coop-code { grid-area: c; margin: 0; font-size: 46px; letter-spacing: 14px; color: #fff; text-shadow: 0 0 22px rgba(75, 225, 255, .8); }
.coop-codebox .chip-btn { grid-area: b; }
.coop-roster { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: auto; }
.coop-seat {
  --pc: #4be1ff;
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--pc) 14%, transparent), rgba(8, 12, 26, .6)); border: 1px solid color-mix(in srgb, var(--pc) 35%, transparent); border-left: 3px solid var(--pc);
}
.coop-seat b { font-size: 14px; letter-spacing: 3px; text-shadow: 0 0 8px currentColor; }
.coop-seat i { font-style: normal; font-size: 9px; letter-spacing: 2px; }
.coop-seat i.lead { color: var(--gold); }
.coop-seat i.ready { color: #56ff9a; }
.coop-seat i.away { color: #ff8fa6; }
.coop-seat.open { background: none; border: 1px dashed rgba(120, 220, 255, .2); border-left: 3px dashed rgba(120, 220, 255, .25); opacity: .55; }
.coop-seat.open b { color: #9fd7e8; text-shadow: none; font-size: 11px; }
.coop-right .lobby-row { flex-wrap: wrap; }
.coop-fair { margin-top: 10px; line-height: 1.5; }
@media (max-width: 800px) { .coop-cards, .coop-lobby { grid-template-columns: 1fr; } }

/* ---------- CODEX (hangar chrome) ---------- */
.codex-screen .hangar-top, .codex-screen .codex-grid { width: min(1180px, 95vw); }
.codex-screen .codex-grid { max-height: calc(100vh - 250px); }
.codex-screen .codex-tabs { width: min(1180px, 95vw); display: flex; gap: 6px; padding: 0; background: none; border: 0; justify-content: flex-start; }
.codex-screen .codex-tabs .seg {
  padding: 9px 16px; font-size: 11px; letter-spacing: 3px; color: #9fd7e8; background: rgba(8, 12, 26, .55); border: 1px solid var(--line); border-radius: 0;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.codex-screen .codex-tabs .seg.on { color: #fff; background: linear-gradient(180deg, rgba(75, 225, 255, .28), rgba(75, 225, 255, .06)); border-color: var(--cyan); text-shadow: 0 0 10px rgba(75, 225, 255, .8); }
.codex-screen .codex-card { border-radius: 0; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); animation: hgIn .3s ease both; }

/* ---------- callsign (first visit) ---------- */
.callsign-screen { justify-content: safe center; }
.id-card.enlist { width: min(460px, 92vw); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 26px 18px; text-align: center; }
.id-card.enlist .id-head { width: 100%; }
.id-card.enlist .id-rank { --rc: var(--cyan); }
.id-card.enlist h2 { font-size: 30px; }
.id-card.enlist .text-input { width: 100%; font-size: 20px; letter-spacing: 6px; text-align: center; }
.id-card.enlist .id-field { width: 100%; }
.id-card.enlist .swatches { justify-content: center; }
.id-card.enlist .id-barcode { width: 100%; }

/* ---------- launch bay (mode select) ---------- */
.modes-screen .hangar-top { width: min(1060px, 95vw); }
.modes-screen .map-row { width: min(1060px, 95vw); padding: 10px 14px; background: rgba(8, 12, 26, .6); border: 1px solid rgba(120, 220, 255, .12); border-left: 3px solid var(--cyan-soft); }
.modes-screen .map-row label { font-size: 11px; letter-spacing: 3px; color: #9fd7e8; }
.modes-screen .diff-desc { width: min(1060px, 95vw); }
.coop-body > .btn-row { justify-content: center; }
.coop-body > .hint { text-align: center; }
.coop-left .hint { margin-top: 10px; }

/* ---------- online: badge, leaderboard layout, pilots online, pilot card ---------- */
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: #56ff9a; box-shadow: 0 0 0 0 rgba(86, 255, 154, .7); animation: livePing 1.8s ease-out infinite;
}
@keyframes livePing { 0% { box-shadow: 0 0 0 0 rgba(86, 255, 154, .7); } 80%, 100% { box-shadow: 0 0 0 9px rgba(86, 255, 154, 0); } }

.online-badge {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px; font: inherit; text-align: left; cursor: pointer;
  color: var(--ink); background: linear-gradient(100deg, rgba(86, 255, 154, .12), rgba(8, 12, 26, .75) 55%);
  border: 1px solid rgba(86, 255, 154, .35); border-left: 3px solid #56ff9a;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  transition: background .15s, transform .15s; animation: hgIn .35s ease both;
}
.online-badge:hover, .online-badge:focus-visible { outline: none; transform: translateY(-1px); background: linear-gradient(100deg, rgba(86, 255, 154, .2), rgba(8, 12, 26, .8) 60%); }
.online-badge .ob-main { font-size: 11px; letter-spacing: 2px; }
.online-badge .ob-main b { font-size: 16px; color: #fff; text-shadow: 0 0 10px rgba(86, 255, 154, .7); margin-right: 2px; }
.online-badge .ob-sub { font-size: 9px; letter-spacing: 1.5px; opacity: .6; white-space: nowrap; }
.online-badge .ob-go { margin-left: auto; font-size: 9px; letter-spacing: 2px; color: #56ff9a; white-space: nowrap; }

/* leaderboard: filters, board + side panel */
.lb-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; width: min(1120px, 95vw); }
.lb-seg-group { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.lb-seg-group .seg { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; font-size: 11px; letter-spacing: 2px; }
.lb-seg-group .seg .hg-ic { width: 15px; height: 15px; }
.lb-seg-group .seg.on { color: #031018; background: var(--cyan); border-color: var(--cyan); }
.lb-seg-group.diff .seg.on { background: var(--halo); border-color: var(--halo); color: #120c02; }
.lb-seg-group.diff { padding-left: 18px; border-left: 1px solid var(--line); }
.lb-screen .hangar-top, .lb-screen .hangar-tabs { width: min(1120px, 95vw); }
.lb-layout { width: min(1120px, 95vw); display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; align-items: start; }
.lb-screen .lb-layout .lb-table { width: auto; }
.lb-side { display: flex; flex-direction: column; gap: 12px; text-align: left; position: sticky; top: 8px; }
.lb-card {
  --pc: var(--cyan);
  position: relative; padding: 12px 14px; background: linear-gradient(160deg, color-mix(in srgb, var(--pc) 10%, transparent), rgba(8, 12, 26, .85) 55%);
  border: 1px solid color-mix(in srgb, var(--pc) 35%, transparent); border-top: 2px solid var(--pc); animation: hgIn .3s ease both;
}
.lb-card h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 10px; letter-spacing: 3px; color: #fff; }
.yc-id { display: flex; align-items: center; gap: 10px; }
.yc-ship { width: 48px; height: 48px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--pc) 55%, transparent); }
.yc-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.yc-name b { font-size: 16px; letter-spacing: 3px; color: var(--pc); text-shadow: 0 0 10px color-mix(in srgb, var(--pc) 60%, transparent); }
.yc-claim { font-size: 9px; letter-spacing: 2px; opacity: .8; }
.yc-claim.ok { color: #56ff9a; }
.yc-claim.ok::before { content: '\2713  '; }
.yc-claim.warn { color: var(--halo); }
.yc-claim.bad { color: #ff5d7d; }
.yc-rank { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0 10px; margin: 12px 0 10px; padding: 10px 12px; background: rgba(0, 0, 0, .25); border: 1px solid rgba(120, 220, 255, .12); }
.yc-rank span { grid-column: 1 / -1; font-size: 9px; letter-spacing: 2px; opacity: .6; }
.yc-rank b { font-size: 30px; color: var(--halo); text-shadow: 0 0 14px rgba(255, 225, 75, .5); }
.yc-rank b.none { color: #6b7c8f; text-shadow: none; }
.yc-rank small { font-size: 10px; letter-spacing: 1px; opacity: .7; text-align: right; }
.yc-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.online-card { --pc: #56ff9a; }
.oc-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; min-height: 20px; }
.oc-list .dim, .lb-side .dim { font-size: 10px; opacity: .55; }
.oc-row {
  --pc: #4be1ff; --ac: #9fb3c8;
  display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; font: inherit; text-align: left; cursor: pointer;
  color: var(--ink); background: rgba(8, 12, 26, .6); border: 1px solid rgba(120, 220, 255, .1); transition: border-color .15s, background .15s;
}
.oc-row:hover, .oc-row:focus-visible { outline: none; border-color: var(--pc); background: color-mix(in srgb, var(--pc) 10%, rgba(8, 12, 26, .8)); }
.oc-row b { font-size: 11px; letter-spacing: 2px; color: var(--pc); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-row small { font-size: 8px; letter-spacing: 1.5px; color: var(--ac); white-space: nowrap; }
.ol-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ac, #56ff9a); box-shadow: 0 0 8px var(--ac, #56ff9a); }

/* names are links to pilot cards */
.names .pilot-link {
  --pc: #4be1ff;
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; letter-spacing: inherit;
  color: var(--pc); text-shadow: 0 0 8px color-mix(in srgb, var(--pc) 50%, transparent);
}
.names .pilot-link::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 6px var(--pc); }
.names .pilot-link:hover, .names .pilot-link:focus-visible { outline: none; text-decoration: underline; text-underline-offset: 3px; }
.lb-pod-ship { width: 56px; height: 56px; margin: -4px 0 -6px; }
.lb-list.pinned { margin-top: -6px; }
.lb-gap { text-align: center; font-size: 16px; letter-spacing: 6px; opacity: .4; line-height: 1; }
.rank-line.solo { min-height: 16px; color: #4be1ff; }
.rank-line.solo.gold { color: var(--halo); text-shadow: 0 0 10px rgba(255, 225, 75, .5); }
.rank-line.solo.dim { color: #9fb3c8; opacity: .75; font-size: 11px; }
@media (max-width: 980px) {
  .lb-layout { grid-template-columns: 1fr; }
  .lb-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .lb-pod.gold { order: -1; }
}
@media (max-width: 620px) {
  .lb-side { grid-template-columns: 1fr; }
  .lb-seg-group.diff { padding-left: 0; border-left: 0; }
}

/* pilots online */
.online-screen .hangar-top, .online-grid { width: min(1060px, 95vw); }
.online-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; min-height: 160px; align-content: start; }
.online-grid .lb-empty { grid-column: 1 / -1; }
.ol-tile {
  --pc: #4be1ff; --ac: #9fb3c8;
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; font: inherit; text-align: left; cursor: pointer;
  color: var(--ink); background: linear-gradient(150deg, color-mix(in srgb, var(--pc) 12%, transparent), rgba(8, 12, 26, .85) 60%);
  border: 1px solid color-mix(in srgb, var(--pc) 35%, transparent); border-left: 3px solid var(--pc);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  animation: rwIn .4s ease both; transition: transform .15s, background .15s;
}
.ol-tile:hover, .ol-tile:focus-visible { outline: none; transform: translateY(-2px); background: linear-gradient(150deg, color-mix(in srgb, var(--pc) 22%, transparent), rgba(8, 12, 26, .85) 60%); }
.ol-tile.me { box-shadow: 0 0 0 1px var(--halo) inset; }
.ol-tile.skeleton { height: 86px; border-left-color: rgba(120, 220, 255, .2); background: linear-gradient(90deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.ol-head { display: flex; align-items: center; gap: 8px; }
.ol-name { font-size: 15px; letter-spacing: 3px; color: var(--pc); text-shadow: 0 0 10px color-mix(in srgb, var(--pc) 55%, transparent); }
.ol-rank { --rc: #9fb3c8; font-size: 8px; letter-spacing: 2px; padding: 2px 7px; color: #0a0a12; background: var(--rc); }
.ol-act { font-size: 10px; letter-spacing: 1.5px; color: var(--ac); }
.ol-guests { grid-column: 1 / -1; margin: 4px 0 0; font-size: 10px; letter-spacing: 1px; opacity: .55; text-align: center; }
.lb-chip.live { color: #56ff9a; border-color: rgba(86, 255, 154, .45); }
#online-hide.on { color: var(--halo); border-color: var(--halo); }

/* public pilot card */
.pilot-body { width: min(720px, 95vw); text-align: left; }
.pc-card {
  --pc: #4be1ff;
  position: relative; padding: 18px 22px 16px; overflow: hidden; animation: rwIn .4s ease both;
  background: linear-gradient(150deg, color-mix(in srgb, var(--pc) 16%, transparent), rgba(6, 9, 20, .94) 50%);
  border: 1px solid color-mix(in srgb, var(--pc) 50%, transparent);
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 24px 100%, 0 calc(100% - 24px));
  box-shadow: inset 0 0 50px color-mix(in srgb, var(--pc) 10%, transparent);
}
.pc-card::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .25; background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, .03) 3px 4px); }
.pc-card.skeleton { height: 420px; background: linear-gradient(90deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.pc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pc-main { display: grid; grid-template-columns: 132px 1fr; gap: 18px; align-items: center; }
.pc-ship { width: 132px; height: 132px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--pc) 55%, transparent); background: radial-gradient(circle, color-mix(in srgb, var(--pc) 22%, transparent), transparent 70%); }
.pc-info { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.pc-info .lb-you { position: static; }
.pc-name { font-size: 32px; letter-spacing: 6px; color: var(--pc); text-shadow: 0 0 18px color-mix(in srgb, var(--pc) 70%, transparent); line-height: 1.1; }
.pc-status { --ac: #56ff9a; display: inline-flex; align-items: center; gap: 8px; font-size: 10px; letter-spacing: 2px; opacity: .7; }
.pc-status.live { opacity: 1; color: var(--ac); }
.pc-status.live .live-dot { background: var(--ac); }
.pc-since { font-size: 9px; letter-spacing: 2px; opacity: .5; }
.pc-sig { --c: #9fb3c8; display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 6px 10px; border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 8%, transparent); }
.pc-sig span { display: flex; flex-direction: column; }
.pc-sig i { font-style: normal; font-size: 8px; letter-spacing: 2px; opacity: .6; }
.pc-sig b { font-size: 12px; letter-spacing: 3px; color: var(--c); }
.pc-sig small { font-size: 9px; color: var(--halo); }
.pc-card .hg-sub { margin: 16px 0 8px; }
.pc-card .stats-grid.pc-stats { width: 100%; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pc-card .stats-grid div { display: flex; flex-direction: column-reverse; padding: 8px 12px; background: rgba(8, 12, 26, .72); border: 1px solid rgba(120, 220, 255, .12); border-left: 3px solid rgba(160, 220, 255, .25); border-radius: 0; text-align: left; }
.pc-card .stats-grid span { font-size: 8px; letter-spacing: 2px; opacity: .6; margin: 2px 0 0; }
.pc-card .stats-grid b { font-size: 19px; color: #fff; }
.pc-card .stats-grid .cyan { border-left-color: var(--cyan); }
.pc-card .stats-grid .pink { border-left-color: var(--pink); }
.pc-card .stats-grid .gold { border-left-color: var(--halo); }
.pc-card .stats-grid .gold b { color: var(--halo); }
.pc-card .stats-grid .red { border-left-color: var(--danger); }
.pc-card .stats-grid .red b { color: #ff8c42; }
.pc-card .stats-grid .green { border-left-color: #56ff9a; }
.pc-bests { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pc-best { display: grid; grid-template-columns: 18px 1fr auto auto; align-items: center; gap: 8px; padding: 7px 10px; background: rgba(8, 12, 26, .6); border: 1px solid rgba(120, 220, 255, .1); }
.pc-best .hg-ic { width: 16px; height: 16px; color: var(--cyan); }
.pc-best span { font-size: 9px; letter-spacing: 2px; opacity: .75; }
.pc-best b { font-size: 14px; color: #fff; }
.pc-board { font-style: normal; font-size: 8px; letter-spacing: 1.5px; padding: 2px 6px; color: #031018; background: var(--cyan); }
.pc-board.podium { background: var(--halo); box-shadow: 0 0 10px rgba(255, 225, 75, .5); }
.pc-hangar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pc-hangar div { display: flex; flex-direction: column; gap: 3px; padding: 7px 10px; background: rgba(8, 12, 26, .6); border: 1px solid rgba(255, 75, 216, .18); border-top: 2px solid var(--pink); }
.pc-hangar span { font-size: 8px; letter-spacing: 2px; opacity: .6; }
.pc-hangar b { font-size: 12px; letter-spacing: 1.5px; color: #fff; }
.pc-mastery { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 18px; }
.pc-m { --c: #4be1ff; display: grid; grid-template-columns: 92px 1fr 56px; align-items: center; gap: 8px; }
.pc-m span { font-size: 9px; letter-spacing: 2px; color: var(--c); }
.pc-m i { height: 5px; background: rgba(255, 255, 255, .06); }
.pc-m i b { display: block; height: 100%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.pc-m small { font-size: 9px; opacity: .6; text-align: right; }
@media (max-width: 640px) {
  .pc-main { grid-template-columns: 1fr; justify-items: center; }
  .pc-info { align-items: center; }
  .pc-card .stats-grid.pc-stats, .pc-hangar { grid-template-columns: repeat(2, 1fr); }
  .pc-bests, .pc-mastery { grid-template-columns: 1fr; }
}

/* profile screen: ONLINE ID */
.profile-online { margin-top: 14px; padding: 12px 14px; background: rgba(8, 12, 26, .7); border: 1px solid rgba(86, 255, 154, .25); border-left: 3px solid #56ff9a; }
.profile-online .hg-sub { margin: 0 0 8px; color: #56ff9a; }
.oid-line { margin: 0 0 8px; font-size: 11px; line-height: 1.5; }
.oid-line.ok { color: #56ff9a; }
.oid-line.warn { color: var(--halo); }
.oid-line.bad { color: #ff5d7d; }
.oid-line.dim { opacity: .6; font-size: 10px; }
.oid-code { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.oid-code span { font-size: 9px; letter-spacing: 2px; opacity: .6; }
.oid-code b { font-size: 15px; letter-spacing: 3px; color: #fff; padding: 3px 8px; background: rgba(0, 0, 0, .35); border: 1px dashed rgba(86, 255, 154, .4); }
.oid-code b.masked { color: transparent; text-shadow: 0 0 8px rgba(223, 252, 255, .8); user-select: none; }
.oid-restore { margin-top: 10px; font-size: 10px; letter-spacing: 1.5px; }
.oid-restore summary { cursor: pointer; opacity: .7; }
.oid-restore .inline-field { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.oid-restore .text-input { width: 140px; }
.oid-msg { display: block; margin-top: 6px; color: var(--halo); }
@media (prefers-reduced-motion: reduce) {
  .live-dot, .ol-tile, .ol-tile.skeleton, .pc-card, .pc-card.skeleton, .online-badge { animation: none; }
}

/* co-op squad tier picker */
.tier-row .seg:nth-child(2).on { background: #ffd166; border-color: #ffd166; color: #120c02; }
.tier-row .seg:nth-child(3).on { background: #ff3b6b; border-color: #ff3b6b; color: #fff; box-shadow: 0 0 14px rgba(255, 59, 107, .5); }
.tier-desc { --tc: #7df0ff; margin: 2px 0 0; padding: 6px 10px; border-left: 3px solid var(--tc); background: color-mix(in srgb, var(--tc) 8%, transparent); color: var(--tc); opacity: .95; }

/* ---------------------------------------------------------------- announcement
   Sent from the admin dashboard: a strip over the menus (a run shows it once
   as a banner instead). info cyan, warn amber, alert red. */
.announce {
  --ac: var(--cyan);
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 12px; max-width: min(760px, 92vw); padding: 9px 12px 9px 16px;
  font-size: 12px; letter-spacing: 1.5px; line-height: 1.45; color: var(--ink);
  background: linear-gradient(100deg, color-mix(in srgb, var(--ac) 16%, transparent), rgba(8, 12, 26, .92) 60%);
  border: 1px solid color-mix(in srgb, var(--ac) 45%, transparent); border-left: 3px solid var(--ac);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  box-shadow: 0 6px 30px rgba(0, 0, 0, .45); animation: hgIn .35s ease both; user-select: text; -webkit-user-select: text;
}
.announce.warn { --ac: var(--halo); }
.announce.alert { --ac: #ff3b6b; }
.announce .an-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--ac); box-shadow: 0 0 10px var(--ac); }
.announce .an-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.announce .an-x {
  flex: none; width: 24px; height: 24px; padding: 0; font: inherit; font-size: 16px; line-height: 1; cursor: pointer;
  color: var(--ink); background: transparent; border: 1px solid color-mix(in srgb, var(--ac) 35%, transparent); opacity: .7;
}
.announce .an-x:hover, .announce .an-x:focus-visible { opacity: 1; outline: none; border-color: var(--ac); }
@media (prefers-reduced-motion: reduce) { .announce { animation: none; } }
.lb-seg-group.season { flex-basis: 100%; }
.lb-seg-group.season .seg.on { background: var(--pink); border-color: var(--pink); color: #14030f; }
.lb-chip.archived { color: var(--pink); border-color: color-mix(in srgb, var(--pink) 45%, transparent); }

/* ---------- PVP (DUEL / SKIRMISH) ---------- */
.menu-btn.pvp { border-left-color: rgba(255, 225, 75, .6); background: linear-gradient(90deg, rgba(255, 225, 75, .14), rgba(255, 225, 75, .02)); }
.menu-btn.pvp .mi { color: #ffe14b; }
.menu-btn.pvp b { font-size: 18px; }
.pvp-screen .coop-card.host { --c: #ffe14b; }
.pvp-intro { border-color: rgba(255, 225, 75, .28); background: linear-gradient(160deg, rgba(40, 34, 10, .45), rgba(8, 12, 26, .75)); }
.pvp-intro .sq-head .kicker { color: #ffe14b; }
.pvp-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; }
.pvp-vs { align-self: center; font-size: 13px; letter-spacing: 3px; color: #ffe14b; opacity: .8; }
.pvp-side { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent); border-top: 3px solid var(--tc); background: color-mix(in srgb, var(--tc) 7%, rgba(8, 12, 26, .6)); }
.pvp-side h5 { margin: 0 0 2px; font-size: 11px; letter-spacing: 3px; color: var(--tc); }
.pvp-side.bench { margin-top: 10px; }
.pvp-side .chip-btn { align-self: stretch; }
.pvp-facts { margin-top: 10px; font-size: 11px; letter-spacing: 1px; }
.pvp-hud { margin-bottom: 6px; display: grid; gap: 4px; justify-items: center; }
.pv-score { display: flex; align-items: center; gap: 14px; }
.pv-score em { font-style: normal; font-size: 12px; letter-spacing: 3px; opacity: .8; }
.pv-side { display: flex; align-items: center; gap: 8px; color: var(--tc); font-size: 13px; letter-spacing: 2px; }
.pv-side.b { flex-direction: row-reverse; }
.pv-side b { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 0 10px color-mix(in srgb, var(--tc) 60%, transparent); }
.pv-side.mine b { text-decoration: underline; text-underline-offset: 4px; }
.pv-pips { display: flex; gap: 4px; }
.pv-pips i { width: 10px; height: 10px; border: 1px solid var(--tc); transform: rotate(45deg); }
.pv-pips i.on { background: var(--tc); box-shadow: 0 0 8px var(--tc); }
.pv-phase { font-size: 12px; letter-spacing: 3px; color: #dffcff; }
.pv-phase.draft { color: #ff7df0; }
.pv-phase.count { color: #ffe14b; font-size: 16px; }
.pv-phase.ring { color: #ff5d7d; animation: od-blink .8s steps(2) infinite; }
.pv-phase.win { color: #56ff9a; }
.pv-phase.loss { color: #ff5d7d; }
.pv-picks { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 520px; }
.pv-picks span { font-size: 10px; letter-spacing: 1px; padding: 2px 7px; border: 1px solid var(--tc); color: var(--tc); background: rgba(8, 12, 26, .7); }
#hud.pvp .hud-right, #hud.pvp #wave-text, #hud.pvp #enemy-text, #hud.pvp #reinforce, #hud.pvp #combo-text { display: none; }
#hud.pvp.no-od #od-bar { display: none; }
.pvp-result:empty { display: none; }
.pvp-result { width: min(640px, 92vw); display: grid; gap: 12px; }
.pr-score { display: flex; align-items: center; justify-content: center; gap: 18px; }
.pr-score em { font-style: normal; font-size: 40px; opacity: .6; }
.pr-side { display: grid; justify-items: center; color: var(--tc); }
.pr-side small { font-size: 11px; letter-spacing: 3px; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-side b { font-size: 48px; line-height: 1; text-shadow: 0 0 18px color-mix(in srgb, var(--tc) 60%, transparent); }
.pr-side:not(.won) { opacity: .6; }
.pr-table { display: grid; gap: 4px; }
.pr-row { display: grid; grid-template-columns: 1fr 60px 76px 70px 100px; gap: 8px; align-items: center; padding: 6px 10px; font-size: 12px; letter-spacing: 1px; text-align: right; border: 1px solid rgba(120, 200, 230, .12); border-left: 3px solid var(--tc, transparent); background: rgba(255, 255, 255, .03); }
.pr-row b { text-align: left; color: var(--tc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-row.head { border: 0; background: none; font-size: 10px; letter-spacing: 2px; opacity: .55; }
.pr-row.head span:first-child { text-align: left; }
.pr-row.me { background: rgba(255, 255, 255, .07); }
.pr-report { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; font-size: 10px; letter-spacing: 2px; }
.pr-report span { opacity: .55; }
.pr-report .btn { font-size: 10px; padding: 5px 10px; }
.pr-report .btn:disabled { opacity: .55; cursor: default; }
#overlay-over.pvp .stats, #overlay-over.pvp #run-rewards, #overlay-over.pvp #run-report, #overlay-over.pvp #solo-rank-line { display: none; }
#overlay-over.pvp-win #over-header { color: #56ff9a; }
#overlay-over.pvp-loss #over-header { color: #ff5d7d; }
@media (max-width: 700px) { .pvp-sides { grid-template-columns: 1fr; } .pvp-vs { justify-self: center; } .pr-row { grid-template-columns: 1fr 44px 60px 56px; } .pr-row > :last-child { display: none; } }

/* ================================================================
   Phones and tablets (html.touch, set by js/touch.js)
   ================================================================ */
html:not(.touch) .touch-only { display: none !important; }
html.touch .desk-only,
html.touch kbd:not(.tk),
html.touch #over-keys { display: none !important; }
html, body { overscroll-behavior: none; }
html.touch { -webkit-tap-highlight-color: transparent; }
html.touch body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.touch input { -webkit-user-select: text; user-select: text; }
html.touch #game { touch-action: none; }

/* the control layer: sticks float where a thumb lands */
.touch-layer {
  position: absolute; inset: 0; z-index: 4; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.t-stick {
  position: absolute; left: 0; top: 0; width: 112px; height: 112px; border-radius: 50%;
  border: 2px solid rgba(75, 225, 255, .4); background: radial-gradient(circle, rgba(75, 225, 255, .12), rgba(75, 225, 255, .03));
  pointer-events: none; opacity: 0; transition: opacity .12s ease;
}
.t-stick.on { opacity: 1; }
.t-stick b {
  position: absolute; left: 30px; top: 30px; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(75, 225, 255, .3); border: 2px solid #4be1ff; box-shadow: 0 0 14px rgba(75, 225, 255, .45);
}
.t-stick.t-aim { border-color: rgba(255, 75, 216, .45); background: radial-gradient(circle, rgba(255, 75, 216, .12), rgba(255, 75, 216, .03)); }
.t-stick.t-aim b { background: rgba(255, 75, 216, .3); border-color: #ff4bd8; box-shadow: 0 0 14px rgba(255, 75, 216, .45); }

.t-btn {
  --c: 75, 225, 255;
  position: absolute; display: grid; place-items: center; width: 58px; height: 58px; padding: 0; border-radius: 50%;
  font: inherit; font-size: 9px; letter-spacing: 1.5px; line-height: 1.1; color: rgb(var(--c));
  background: rgba(6, 10, 20, .55); border: 2px solid rgba(var(--c), .55); box-shadow: 0 0 12px rgba(var(--c), .18);
  touch-action: none; opacity: .85; transition: transform .06s ease, background .06s ease;
}
.t-btn span { pointer-events: none; }
.t-btn.on { transform: scale(.92); background: rgba(var(--c), .3); opacity: 1; }
.t-btn.dim { opacity: .35; }
.t-dash { --c: 75, 225, 255; width: 72px; height: 72px; font-size: 11px; right: calc(26px + env(safe-area-inset-right)); bottom: calc(150px + env(safe-area-inset-bottom)); }
.t-swap { --c: 159, 244, 255; right: calc(112px + env(safe-area-inset-right)); bottom: calc(176px + env(safe-area-inset-bottom)); }
.t-od { --c: 255, 140, 66; right: calc(33px + env(safe-area-inset-right)); bottom: calc(234px + env(safe-area-inset-bottom)); }
.t-od.ready { opacity: 1; background: rgba(255, 140, 66, .28); box-shadow: 0 0 22px rgba(255, 140, 66, .7); animation: t-pulse .9s ease-in-out infinite; }
.t-armor { --c: 110, 168, 255; right: calc(112px + env(safe-area-inset-right)); bottom: calc(108px + env(safe-area-inset-bottom)); }
.t-armor.hint { opacity: 1; box-shadow: 0 0 20px rgba(110, 168, 255, .75); animation: t-pulse .9s ease-in-out infinite; }
.t-pause { width: 40px; height: 40px; font-size: 11px; letter-spacing: 0; top: calc(12px + env(safe-area-inset-top)); right: calc(14px + env(safe-area-inset-right)); border-radius: 8px; opacity: .7; }
/* ONE-STICK: the right thumb only presses buttons, so they sit low in one cluster */
.touch-layer.one .t-dash { right: calc(28px + env(safe-area-inset-right)); bottom: calc(30px + env(safe-area-inset-bottom)); width: 80px; height: 80px; }
.touch-layer.one .t-armor { right: calc(124px + env(safe-area-inset-right)); bottom: calc(24px + env(safe-area-inset-bottom)); }
.touch-layer.one .t-od { right: calc(114px + env(safe-area-inset-right)); bottom: calc(104px + env(safe-area-inset-bottom)); }
.touch-layer.one .t-swap { right: calc(36px + env(safe-area-inset-right)); bottom: calc(126px + env(safe-area-inset-bottom)); }
.t-fire { --c: 255, 75, 216; display: none; font-size: 13px; letter-spacing: 2px; }
/* ONE-STICK with FIRE: the right thumb rests on a big FIRE, the rest around it */
.touch-layer.manual .t-fire { display: grid; width: 92px; height: 92px; right: calc(24px + env(safe-area-inset-right)); bottom: calc(26px + env(safe-area-inset-bottom)); }
.touch-layer.manual .t-dash { width: 66px; height: 66px; right: calc(132px + env(safe-area-inset-right)); bottom: calc(22px + env(safe-area-inset-bottom)); }
.touch-layer.manual .t-swap { right: calc(40px + env(safe-area-inset-right)); bottom: calc(134px + env(safe-area-inset-bottom)); }
.touch-layer.manual .t-od { right: calc(120px + env(safe-area-inset-right)); bottom: calc(104px + env(safe-area-inset-bottom)); }
.touch-layer.manual .t-armor { right: calc(212px + env(safe-area-inset-right)); bottom: calc(26px + env(safe-area-inset-bottom)); }
@keyframes t-pulse { 50% { transform: scale(1.07); } }
@media (prefers-reduced-motion: reduce) { .t-od.ready, .t-armor.hint { animation: none; } }

/* HUD: clear of the notch, the pause button and the thumbs */
html.touch .hud-left { top: calc(10px + env(safe-area-inset-top)); left: calc(14px + env(safe-area-inset-left)); transform: scale(.8); transform-origin: top left; }
html.touch .hud-right { top: calc(10px + env(safe-area-inset-top)); right: calc(66px + env(safe-area-inset-right)); transform: scale(.8); transform-origin: top right; }
html.touch .hud-center { top: calc(8px + env(safe-area-inset-top)); }
html.touch .hud-center > * { zoom: .85; }
html.touch .hud-bottom { bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%) scale(.85); transform-origin: bottom center; }
html.touch .hud-right .stat:nth-child(2) { display: none; }
html.touch .tip { top: calc(84px + env(safe-area-inset-top)); bottom: auto; right: auto; left: 50%; transform: translateX(-50%); max-width: min(420px, 60vw); z-index: 7; }
html.touch .tip button { font-size: 22px; padding: 0 4px; }
@keyframes tipInTouch { from { opacity: 0; } }
html.touch .tip { animation: tipInTouch .25s ease; }
/* phones: a smaller HUD, so the arena is not buried under it */
html.phone .hud-left { top: calc(6px + env(safe-area-inset-top)); left: calc(10px + env(safe-area-inset-left)); transform: scale(.6); }
html.phone .hud-right { top: calc(8px + env(safe-area-inset-top)); right: calc(58px + env(safe-area-inset-right)); transform: scale(.62); }
html.phone .hud-center { top: calc(4px + env(safe-area-inset-top)); }
html.phone .hud-center > * { zoom: .66; }
html.phone .hud-center #mode-text { display: none; }
html.phone .hud-bottom { bottom: calc(4px + env(safe-area-inset-bottom)); transform: translateX(-50%) scale(.6); gap: 8px; }
html.phone .hud-bottom .slot-key, html.phone #perk-count { display: none !important; }
html.phone .t-pause { width: 34px; height: 34px; top: calc(8px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); }
html.phone .tip { top: calc(56px + env(safe-area-inset-top)); max-width: min(340px, 50vw); padding: 7px 10px; gap: 8px; font-size: 10.5px; line-height: 1.4; }
html.phone .tip b { font-size: 9px; }
html.phone #banner { font-size: clamp(20px, 4.2vw, 34px); letter-spacing: 6px; top: 30%; }
html.phone #banner small { font-size: 10px; letter-spacing: 4px; margin-top: 6px; }
html.phone #combo-text { zoom: .7; }
html.phone #toast { zoom: .7; }
html.phone .touch-layer .t-btn:not(.t-pause) { zoom: .86; }
html.phone #overlay-over .btn { min-height: 38px; padding: 8px 22px; font-size: 12px; }

/* portrait: the game is landscape only */
.rotate { display: none; }
@media (orientation: portrait) {
  html.touch .rotate {
    position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    background: #05060d; color: #dffcff; text-align: center; letter-spacing: 3px; padding: 24px;
  }
  html.touch .rotate b { font-size: 18px; letter-spacing: 5px; color: #4be1ff; }
  html.touch .rotate span { font-size: 12px; opacity: .7; letter-spacing: 1px; }
  .rot-phone {
    width: 46px; height: 78px; border: 3px solid #4be1ff; border-radius: 9px; box-shadow: 0 0 18px rgba(75, 225, 255, .5);
    animation: rot-turn 2.4s ease-in-out infinite;
  }
  @keyframes rot-turn { 0%, 25% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }
  @media (prefers-reduced-motion: reduce) { .rot-phone { animation: none; transform: rotate(-90deg); } }
}

/* ---------- install card (js/pwa.js): main menu, phones only ---------- */
.install {
  position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 55;
  width: min(460px, calc(100vw - 24px)); animation: installIn .3s ease-out;
}
.in-card {
  display: grid; grid-template-columns: 52px 1fr; gap: 10px 12px; align-items: center; padding: 12px 14px; text-align: left;
  background: linear-gradient(110deg, rgba(75, 225, 255, .14), rgba(8, 12, 26, .96) 55%); border: 1px solid rgba(75, 225, 255, .45);
  border-left: 3px solid var(--cyan); box-shadow: 0 10px 40px rgba(0, 0, 0, .6), 0 0 24px rgba(75, 225, 255, .15);
}
.in-icon { width: 52px; height: 52px; border-radius: 12px; box-shadow: 0 0 14px rgba(75, 225, 255, .35); }
.in-head b { display: block; font-size: 13px; letter-spacing: 3px; color: #eafcff; }
.in-head span { display: block; margin-top: 3px; font-size: 11px; line-height: 1.45; letter-spacing: .5px; opacity: .8; }
.in-steps { grid-column: 1 / -1; margin: 0; padding-left: 20px; font-size: 12px; line-height: 1.9; letter-spacing: .5px; }
.in-steps b { color: var(--cyan); }
.in-ic { display: inline-grid; place-items: center; width: 22px; height: 22px; vertical-align: -6px; color: var(--cyan); border: 1px solid rgba(75, 225, 255, .35); border-radius: 5px; }
.in-ic svg { width: 15px; height: 15px; }
.in-note { grid-column: 1 / -1; margin: 0; font-size: 10.5px; line-height: 1.45; opacity: .6; }
.in-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.in-btn { padding: 9px 16px; font: inherit; font-size: 11px; letter-spacing: 2px; color: #9fb3c8; background: transparent; border: 1px solid rgba(159, 179, 200, .35); cursor: pointer; }
.in-btn.primary { color: #05060d; background: var(--cyan); border-color: var(--cyan); font-weight: bold; }
@keyframes installIn { from { opacity: 0; transform: translate(-50%, 16px); } }
@media (prefers-reduced-motion: reduce) { .install { animation: none; } }
/* ================================================================
   PHONE LAYOUTS (html.phone: touch + short side <= 500 px, js/touch.js)
   Landscape only. Nothing here reaches desktop or tablets.
   ================================================================ */
html.phone {
  --ph-pad: 10px;
  --ph-l: calc(12px + env(safe-area-inset-left));
  --ph-r: calc(12px + env(safe-area-inset-right));
}
html.phone .overlay {
  padding: var(--ph-pad) var(--ph-r) var(--ph-pad) var(--ph-l); gap: 10px; justify-content: flex-start;
}
html.phone .overlay > * { flex-shrink: 0; }
/* a phone has half a desktop's height: the content screens are drawn at 78%
   (zoom keeps layout and hit areas in step, unlike transform) */
html.phone .overlay:is(.screen, .hangar, .pause-screen, .callsign-screen) { zoom: .78; }
/* ...which leaves room for the desktop's side-by-side layouts that the narrow
   (max-width) rules would otherwise stack into one long column */
html.phone .c-row { grid-template-columns: 1fr 150px 1fr; gap: 10px; }
html.phone .circuit::before { display: block; }
html.phone .c-node.b { text-align: right; align-items: flex-end; }
html.phone .c-node { padding: 8px 12px; }
html.phone .c-core { padding: 8px 6px; gap: 6px; }
html.phone .armory { grid-template-columns: 250px 1fr; gap: 12px; }
html.phone .gun-list { max-height: none; }
html.phone .threat-cols { grid-template-columns: 1.55fr 1fr; gap: 12px; }
html.phone .variants { grid-template-columns: repeat(3, 1fr); }
html.phone .rec-grid { grid-template-columns: repeat(4, 1fr); }
html.phone .hangar-top { flex-direction: row; align-items: center; }
html.phone .settings-screen .settings-grid { grid-template-columns: 1fr 1fr; }
html.phone .profile-body { grid-template-columns: 430px 1fr; }
html.phone .profile-screen .stats-grid { grid-template-columns: repeat(3, 1fr); }
html.phone .sq-grid { grid-template-columns: repeat(3, 1fr); }
html.phone .hangar-body, html.phone .codex-grid, html.phone .lb-layout, html.phone .coop-body { width: 100%; }
html.phone .pr-bar { grid-template-columns: 76px 1fr auto; }
html.phone .pr-bar b { white-space: nowrap; }
html.phone .coop-lobby { grid-template-columns: 1fr 1fr; }
html.phone .overlay:is(.screen, .hangar) .btn-row { margin-top: auto; } /* short screens: the buttons sit at the bottom, not mid-page */
html.phone .modes-screen .set-row.map-row { padding: 2px 0; }
html.phone #loadout-picker .map-card, html.phone #implant-picker .map-card { min-height: 0; padding: 4px 10px; }
html.phone .overlay::before, html.phone .overlay::after { display: none; }
html.phone .overlay h2 { font-size: 20px; letter-spacing: 6px; }
html.phone .kicker { font-size: 8px; letter-spacing: 2px; margin-bottom: 2px; }
html.phone .hint.top-note, html.phone .keys { display: none !important; }
html.phone .btn { min-height: 44px; padding: 10px 22px; font-size: 13px; }
html.phone .seg, html.phone .hg-tab, html.phone .chip-btn { min-height: 38px; }

/* a slim top bar that stays while the content scrolls, and BACK always in reach */
html.phone .overlay.screen .hangar-top,
html.phone .overlay.hangar .hangar-top {
  position: sticky; top: calc(-1 * var(--ph-pad)); z-index: 3; width: 100%; margin: calc(-1 * var(--ph-pad)) 0 0;
  padding: 8px 0 6px; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px;
  background: #03040a; box-shadow: 0 10px 18px 4px #03040a;
}
html.phone .hangar-top h2 { font-size: 18px; margin: 0; }
html.phone .hangar-top .panel-head { display: flex; align-items: baseline; gap: 10px; }
html.phone .hangar-top .panel-head .kicker { display: none; }
html.phone .wallet { gap: 6px; flex-wrap: nowrap; }
html.phone .wallet > * { transform: scale(.78); transform-origin: right center; margin-left: -18px; }
html.phone .overlay .btn-row,
html.phone #codex-back, html.phone #coop-back, html.phone #lb-back,
html.phone #pilot-back, html.phone #guide-back {
  position: sticky; bottom: calc(-1 * var(--ph-pad)); z-index: 3; margin-bottom: calc(-1 * var(--ph-pad));
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
html.phone .overlay .btn-row {
  width: 100%; justify-content: center; background: linear-gradient(0deg, rgba(3, 4, 10, .97) 70%, rgba(3, 4, 10, 0));
}
html.phone #codex-back, html.phone #coop-back, html.phone #lb-back,
html.phone #pilot-back, html.phone #guide-back {
  padding: 10px 26px; box-shadow: 0 -12px 26px 8px rgba(3, 4, 10, .96);
}
html.phone .btn.ghost:is(#codex-back, #coop-back, #lb-back, #pilot-back, #guide-back) { background-color: #03040a; }
html.phone .hangar-tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
html.phone .hangar-tabs::-webkit-scrollbar { display: none; }
html.phone .hg-tab { flex: 0 0 auto; padding: 8px 12px; font-size: 11px; }
html.phone .hangar-body, html.phone .codex-grid, html.phone .settings-screen .settings-grid, html.phone .pause-build {
  max-height: none; overflow: visible; width: 100%;
}
html.phone .overlay.hangar > .hint { display: none; }

/* ---------- main menu: one screen, no scrolling ---------- */
html.phone .overlay.menu-screen { justify-content: center; padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 8px; }
html.phone .menu-grid {
  width: 100%; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-auto-rows: auto; gap: 8px 14px; align-items: stretch;
}
html.phone .menu-main, html.phone .menu-nav { display: contents; }
html.phone .brand { grid-column: 1; grid-row: 1; align-self: end; text-align: left; }
html.phone .brand .kicker, html.phone .brand .tagline { display: none; }
html.phone .title.glitch { font-size: clamp(30px, 5.4vw, 44px); letter-spacing: 5px; }
html.phone #btn-play { grid-column: 1; grid-row: 2; }
html.phone #btn-coop { grid-column: 1; grid-row: 3; }
html.phone #btn-pvp { grid-column: 1; grid-row: 4; }
html.phone .menu-row { grid-column: 2; gap: 8px; }
html.phone .menu-row:nth-of-type(1) { grid-row: 2; }
html.phone .menu-row:nth-of-type(2) { grid-row: 3; }
html.phone .menu-row:nth-of-type(3) { grid-row: 4; }
html.phone .menu-btn { padding: 8px 12px; min-height: 48px; gap: 10px; }
html.phone .menu-btn b { font-size: 13px; letter-spacing: 3px; }
html.phone .menu-btn small { font-size: 9.5px; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.phone .menu-btn.primary { padding: 10px 14px; }
html.phone .menu-btn.primary b { font-size: 17px; letter-spacing: 5px; }
html.phone .menu-btn.coop b, html.phone .menu-btn.pvp b { font-size: 14px; }
html.phone .menu-btn .mi, html.phone .menu-btn .mi svg { width: 20px; height: 20px; flex-basis: 20px; }
html.phone .menu-btn.small { padding: 6px 10px; }
html.phone .menu-btn.small b { font-size: 10.5px; letter-spacing: 2px; }
html.phone .menu-btn.small .mi, html.phone .menu-btn.small .mi svg { width: 17px; height: 17px; flex-basis: 17px; }
html.phone .menu-side { grid-column: 2; grid-row: 1; flex-direction: row; align-items: center; justify-content: flex-end; gap: 8px; align-self: end; }
html.phone .menu-side .pilot-card, html.phone .menu-side .daily-card, html.phone .menu-side .whats-new { display: none; }
html.phone .online-badge { margin: 0; }
html.phone .dev-card { padding: 6px 10px; gap: 10px; }
html.phone .dev-id .kicker { font-size: 7px; }
html.phone .dev-id b { font-size: 12px; letter-spacing: 3px; }
html.phone .dev-id small { display: none; }
html.phone .dev-link { padding: 4px 8px; }
html.phone .dev-link span { display: none; }
html.phone .dev-card { row-gap: 4px; }
html.phone .dev-thanks { padding-top: 4px; font-size: 8px; letter-spacing: 1px; }
html.phone .dev-thanks .heart { font-size: 9px; }

/* ---------- mode select: every mode in one row, START always at the bottom ---------- */
html.phone .mode-cards { width: 100%; grid-template-columns: 1.25fr repeat(4, minmax(0, 1fr)); gap: 6px; }
html.phone .mode-cards .mode-card { padding: 8px 8px 9px; gap: 3px; height: 100%; min-width: 0; }
html.phone .mode-card.featured { grid-column: auto; }
html.phone .mode-card.featured b { font-size: 13px; letter-spacing: 3px; }
html.phone .mode-card b { font-size: 11px; letter-spacing: 1.5px; }
html.phone .mode-card small { font-size: 9.5px; line-height: 1.3; }
html.phone .mode-card .card-icon svg { width: 18px; height: 18px; }
html.phone .mode-card .mode-foot { flex-wrap: wrap; gap: 4px; margin-top: 2px; }
html.phone .mode-card .mode-foot i, html.phone .mode-card i { font-size: 9px; }
html.phone .mode-card .tag { font-size: 8.5px; padding: 1px 5px; }
html.phone .mode-card.featured .tag, html.phone .mode-card .ribbon { font-size: 7px; }
html.phone .map-row { width: 100%; display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 8px; margin: 0; padding: 4px 0; }
html.phone .map-row .map-card { padding: 5px 10px; }
html.phone .map-row .map-card b { font-size: 11px; }
html.phone .map-row .map-card small { font-size: 9px; }
html.phone .map-row > label { font-size: 10px; letter-spacing: 2px; text-align: left; }
html.phone .map-cards { overflow-x: auto; scrollbar-width: none; padding: 2px; }
html.phone .map-cards::-webkit-scrollbar { display: none; }
html.phone .map-card { flex: 0 0 auto; min-height: 44px; padding: 6px 10px; font-size: 10px; }
html.phone .map-card .card-icon svg { width: 20px; height: 20px; }
html.phone .diff-desc { font-size: 10px; margin: 0; }
html.phone .sector-chip { min-width: 0; flex: 1 1 0; flex-direction: row; gap: 8px; padding: 5px 10px; }
html.phone .sector-chip small { display: none; }
html.phone .sector-chip b { font-size: 11px; letter-spacing: 2px; }
html.phone .sector-chip .card-icon svg { width: 16px; height: 16px; }
html.phone #map-picker:has(.sector-chip) { gap: 20px; }
html.phone .set-row.map-row { min-height: 0; }

/* ---------- perk draft: the three cards side by side, no scrolling ---------- */
html.phone .draft-screen { justify-content: center; gap: 6px; }
html.phone .draft-head h2 { font-size: 18px; margin: 0; }
html.phone .draft-head .hint { font-size: 10px; margin: 2px 0 0; }
html.phone .draft-status { display: none; }
html.phone .draft-cards { flex-wrap: nowrap; gap: 8px; width: 100%; justify-content: center; }
html.phone .draft-card { flex: 1 1 0; min-width: 0; max-width: 250px; width: auto; min-height: 0; padding: 10px 10px 12px; gap: 5px; }
html.phone .draft-card .glyph { font-size: 16px; }
html.phone .draft-card b { font-size: 12px; }
html.phone .draft-card small { font-size: 10.5px; line-height: 1.35; }
html.phone .draft-card i, html.phone .draft-card em { font-size: 9.5px; }
html.phone .draft-card svg { max-width: 54px; max-height: 54px; }
html.phone .shop-row { gap: 6px; flex-wrap: nowrap; }
html.phone .shop-row > * { padding: 6px 10px; min-height: 40px; }
html.phone .shop-row small, html.phone .shop-row i { display: none; }
html.phone .reroll-btn { min-height: 38px; }
html.phone .d-badge { width: 44px; height: 44px; margin: 2px 0; }
html.phone .d-badge .glyph { font-size: 14px; }
html.phone .draft-screen .draft-card b { font-size: 12px; letter-spacing: 2px; }
html.phone .draft-screen .draft-card small { font-size: 10.5px; min-height: 0; }
html.phone .draft-screen .shop-row { padding: 6px 8px; width: 100%; }
html.phone .shop-head { padding: 0 8px 0 2px; }
html.phone .shop-head span { font-size: 7.5px; letter-spacing: 2px; }
html.phone .shop-head .scrap-chip { font-size: 13px; }
html.phone .draft-screen .shop-item { flex: 1 1 0; min-width: 0; }

/* ---------- co-op / pvp: host and join side by side ---------- */
html.phone .coop-body { width: 100%; gap: 10px; }
html.phone .coop-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
html.phone .coop-card { padding: 12px 14px; gap: 6px; }
html.phone .coop-card .hg-ic { width: 28px; height: 28px; }
html.phone .coop-card b { font-size: 14px; letter-spacing: 3px; }
html.phone .coop-card small { font-size: 10.5px; line-height: 1.35; }

/* ---------- pause: buttons on the left, the run on the right ---------- */
html.phone .pause-screen { justify-content: flex-start; }
html.phone .pause-head h2 { font-size: 18px; margin: 0; }
html.phone .pause-grid { width: 100%; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 10px; align-items: start; }
html.phone .pause-menu { position: sticky; top: 0; }
html.phone .pause-menu .menu-btn { min-height: 44px; }
html.phone .pause-menu .menu-btn small { display: none; }
html.phone .pause-build { grid-column: 2; }

/* ---------- game over: the result in a strip, the buttons always visible ---------- */
html.phone #overlay-over { justify-content: flex-start; gap: 8px; }
html.phone #over-header { font-size: 22px; margin: 0; }
html.phone #overlay-over .stats { width: 100%; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 6px; }
html.phone #overlay-over .stats div { padding: 4px; }
html.phone #overlay-over .stats span { font-size: 8.5px; }
html.phone #overlay-over .stats b { font-size: 15px; overflow-wrap: anywhere; }
html.phone #overlay-over .stats { grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: 4px; }
html.phone #overlay-over .stats span { font-size: 7.5px; letter-spacing: 1px; }
html.phone #overlay-over .stats b { font-size: 13px; overflow-wrap: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.phone .run-rewards, html.phone .run-report { width: 100%; }
html.phone .rw-tile { padding: 6px 8px; }
html.phone .rw-tile b { font-size: 18px; }
html.phone .rw-tile .hg-ic { width: 18px; height: 18px; }
html.phone .run-report { font-size: 10px; gap: 10px; }
html.phone #over-keys { display: none; }

/* ---------- callsign and settings ---------- */
html.phone .callsign-screen { justify-content: center; }
html.phone .id-card.enlist { padding: 14px 18px; gap: 8px; }
html.phone .id-card.enlist h1, html.phone .id-card.enlist .enlist-title { font-size: 22px; }
html.phone .set-row { padding: 8px 0; }
@media (max-height: 500px) {
  /* landscape phone: sit bottom right, beside the menu column (only phones ever get the card) */
  .install { left: auto; right: calc(12px + env(safe-area-inset-right)); transform: none; width: min(380px, 46vw); animation-name: installInSide; }
  .in-note { display: none; }
  .in-steps { line-height: 1.6; font-size: 11px; }
}
@keyframes installInSide { from { opacity: 0; transform: translateY(16px); } }
