:where(.game-ui > *) { pointer-events:auto; }
:root {
  /* UI theme: one base colour (Settings → Colours) — hue + saturation drive every lighter / darker UI shade below.
     Default = pale blue (#a5c6e9). Set at run time by js/ui.js (orionTheme.apply). */
  --theme-h: 210.9;
  --theme-s: 0.607;
  --bg: hsl(calc(var(--theme-h) + 16) calc(53% * var(--theme-s)) 3%);
  --panel: hsl(calc(var(--theme-h) + 9) calc(55% * var(--theme-s)) 9% / 0.78);
  --border: hsl(calc(var(--theme-h) + 4) calc(100% * var(--theme-s)) 68% / 0.35);
  --text: hsl(calc(var(--theme-h) + 7) calc(100% * var(--theme-s)) 92%);
  --muted: hsl(calc(var(--theme-h) + 6) calc(33% * var(--theme-s)) 65%);
  --accent: #a5c6e9;
  --hp: #e0564f;
  --shield: #4fc3ff;
  --ok: #58d68d;
  --warn: #f5b041;
  /* Frame of every panel / window / hover card — the look of the P.E.T. panel in the UI colour of the settings:
     a vertical gradient, a blue edge with a soft outer glow and an inner glow, corners cut at 45° (--cut). */
  --panel-top: hsl(calc(var(--theme-h) - 3) calc(65% * var(--theme-s)) 16% / .92);
  --panel-bottom: hsl(calc(var(--theme-h) - 1) calc(67% * var(--theme-s)) 7% / .94);
  --panel-fill: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  --panel-edge: hsl(calc(var(--theme-h) - 8) calc(52% * var(--theme-s)) 39%);
  --panel-glow: hsl(calc(var(--theme-h) - 9) calc(67% * var(--theme-s)) 47% / .25);
  --panel-inner-glow: hsl(calc(var(--theme-h) - 5) calc(64% * var(--theme-s)) 43% / .15);
  --cut: 8px;
}

* { box-sizing: border-box; }

/* Scrollbars: every scrollable list of the UI (journal, missions, shop, hangar, chat, ...) in the UI colour of the
   settings panel (--theme-h / --theme-s / --accent) instead of the white system scrollbar. scrollbar-color is inherited,
   so html covers everything; the ::-webkit-* rules are the fallback for older Chromium / Safari. */
html { scrollbar-color: hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .75) hsl(calc(var(--theme-h) + 7) calc(58% * var(--theme-s)) 11% / .55); }
* { scrollbar-width: thin; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: hsl(calc(var(--theme-h) + 7) calc(58% * var(--theme-s)) 11% / .55); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .75); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
::-webkit-scrollbar-corner { background: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: "Segoe UI", system-ui, sans-serif; }
a { color: var(--accent); }
button { cursor: pointer; background: hsl(calc(var(--theme-h) + 4) calc(67% * var(--theme-s)) 21%); color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 6px 12px; }
button:hover { background: hsl(calc(var(--theme-h) + 4) calc(66% * var(--theme-s)) 30%); }
button:disabled { opacity: .5; cursor: default; }
button.active { background: var(--accent); color: hsl(calc(var(--theme-h) + 4) calc(84% * var(--theme-s)) 7%); }

/* Comboboxes (every <select> of the UI — administrator panel, Galaxy Gates, ...): one shared look in the UI colour of
   the settings panel (--theme-h / --theme-s / --accent, set by ui.js). The opened list is drawn by the browser: its
   options get an opaque background in the theme colour instead of the system grey. */
:root { --select-bg: hsl(calc(var(--theme-h) + 7) calc(58% * var(--theme-s)) 11%);
  --select-group: hsl(calc(var(--theme-h) + 6) calc(45% * var(--theme-s)) 72%); }
select { color-scheme: dark; color: var(--text); background-color: var(--select-bg); border: 1px solid var(--border);
  border-radius: 4px; font: inherit; padding: 5px 28px 5px 7px; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
select:hover:not(:disabled) { border-color: var(--accent); }
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .25); }
select:disabled { opacity: .55; cursor: default; }
select option { color: var(--text); background-color: var(--select-bg); }
select option:checked, select option:hover { color: hsl(calc(var(--theme-h) + 4) calc(84% * var(--theme-s)) 7%); background-color: var(--accent); }
select optgroup { color: var(--select-group); background-color: var(--select-bg); font-style: normal; font-weight: 700; }
/* Chromium draws the opened list natively and ignores option:hover (the row under the mouse was system grey). Where the
   customizable select is supported the list is drawn by the page instead: hover = a soft tint of the UI colour. */
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select::picker-icon { display: none; } /* the arrow is the background gradient above */
  ::picker(select) { background: var(--select-bg); color: var(--text); border: 1px solid var(--accent); border-radius: 4px;
    padding: 2px 0; max-height: 320px; overflow-y: auto; }
  select option { padding: 3px 10px; }
  select option::checkmark { display: none; }
  select option:hover, select option:focus-visible { color: var(--text); outline: none;
    background-color: hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .22); }
  select option:checked { color: hsl(calc(var(--theme-h) + 4) calc(84% * var(--theme-s)) 7%); background-color: var(--accent); }
  select optgroup { padding: 2px 0; }
  select optgroup legend { padding: 3px 8px; }
}

/* Text / number boxes (every one of the UI — settings, shop, admin, login, chat, ...): the same look as the comboboxes,
   in the UI colour of the settings panel instead of the white system box. Specific rules below may still size them. */
input:not([type]), input[type=text], input[type=number], input[type=password], input[type=email], input[type=search],
input[type=url], input[type=tel], textarea {
  color-scheme: dark; color: var(--text); background-color: var(--select-bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 3px 6px; font: inherit; }
input:not([type]):hover:not(:disabled), input[type=text]:hover:not(:disabled), input[type=number]:hover:not(:disabled),
input[type=password]:hover:not(:disabled), input[type=email]:hover:not(:disabled), input[type=search]:hover:not(:disabled),
textarea:hover:not(:disabled) { border-color: var(--accent); }
input:not([type]):focus, input[type=text]:focus, input[type=number]:focus, input[type=password]:focus, input[type=email]:focus,
input[type=search]:focus, input[type=url]:focus, input[type=tel]:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .25); }
input:disabled, textarea:disabled { opacity: .55; cursor: default; }
input::placeholder, textarea::placeholder { color: var(--muted); }
/* Browser autofill (login) would paint the box white / yellow: keep the theme colours. */
input:-webkit-autofill { -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0 1000px var(--select-bg) inset; caret-color: var(--text); }

.panel { background: var(--panel-fill); border: 1px solid var(--panel-edge); border-radius: 0; padding: 10px 12px; backdrop-filter: blur(4px);
  box-shadow: 0 0 10px var(--panel-glow), inset 0 0 18px var(--panel-inner-glow); }
.app-main { height: 100%; }

/* auth */
.auth-page { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px 16px 44px;
  background: radial-gradient(ellipse at top, hsl(calc(var(--theme-h) + 8) calc(66% * var(--theme-s)) 15%) 0%, var(--bg) 70%); }
.release-info { grid-column: 1 / -1; grid-row: 2; text-align: end; color: var(--muted); font-size: .75rem; line-height: 1.4; text-shadow: 0 1px 3px #000; }
.auth-card { width: min(360px, 100%); padding: 24px; }
.auth-card h1 { margin: 8px 0 0; letter-spacing: 4px; }
.auth-card h2 { margin: 4px 0 16px; font-weight: 400; color: var(--muted); font-size: 1rem; }
.auth-card form { display: flex; flex-direction: column; gap: 6px; }
.auth-card input, .auth-card select { padding: 8px; background: hsl(calc(var(--theme-h) + 5) calc(68% * var(--theme-s)) 7%); color: var(--text); border: 1px solid var(--border); border-radius: 4px; }
.auth-card small { color: var(--muted); margin-bottom: 6px; }
.auth-card button[type=submit] { margin-top: 10px; padding: 10px; }
.newsletter-opt-in { display: flex; gap: 8px; align-items: start; margin-top: 10px; }
.newsletter-opt-in input { margin: 3px 0 0; }
.login-page {
  position: relative; display: grid; grid-template-rows: auto auto 1fr; align-items: start;
  justify-content: stretch; justify-items: center; gap: 24px; padding: 18px 24px 58px;
  isolation: isolate; background: #060b12;
}
.auth-cinematic {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: var(--auth-cinematic-sky, url("../branding/orion-cinematic.jpg")) center / 100% 100% no-repeat #060b12;
}
.auth-cinematic canvas { display: block; width: 100%; height: 100%; }
.auth-cinematic::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, #04070c66, #04070c00 26%, #04070c14 48%, #04070cd9 100%);
}
.auth-motion {
  display: grid; place-items: center; position: fixed; right: 16px; bottom: 16px; z-index: 3;
  width: 38px; height: 38px; padding: 0; background: #0b1623e8; border-color: #8eabc47d;
}
.auth-motion-pause { width: 11px; height: 13px; border-inline: 3px solid currentColor; }
.auth-motion-play { margin-left: 2px; border-block: 6px solid transparent; border-left: 9px solid currentColor; }
.login-header { width: min(1100px, 100%); min-height: clamp(98px, 19vh, 164px); display: grid; align-items: start; }
.login-page:has(.login-panels) .login-header { min-height: clamp(184px, 39vh, 370px); }
.login-header h1 { margin: 0; }
.login-header h1 > a { display: block; position: relative; width: fit-content; pointer-events: none; }
/* The logo PNG has transparent padding. Keep the link's hit area inside the painted bounds. */
.login-header h1 > a::after { content: ""; position: absolute; inset: 9.765625% 9.375% 8.984375%; pointer-events: auto; }
.login-header img { display: block; width: clamp(132px, 18vw, 215px); height: auto; filter: drop-shadow(0 6px 16px #03060b); }
.login-panels {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  grid-template-areas: "news auth"; align-items: start; gap: 22px; width: min(940px, 100%);
}
.login-page :is(.auth-card, .home-news) {
  background: linear-gradient(150deg, #172434ed, #09121df0);
  border: 1px solid #91adc456;
  box-shadow: 0 18px 60px #03060c8c, inset 0 1px #e1f1ff17;
  border-radius: 6px;
}
.login-page :is(.auth-card, .home-news) :is(h2, h3) { letter-spacing: .025em; }
.login-page .auth-card button[type=submit] { background: #a7c7e5; color: #101e2e; font-weight: 650; }
.login-page .auth-card button[type=submit]:hover { background: #c3ddf5; }
.login-panels .auth-card { grid-area: auth; width: 100%; }
.login-page .auth-card h2 { color: var(--text); font-weight: 600; font-size: 1.25rem; }
.login-page .register-card { width: min(440px, 100%); }
@media (min-width: 1000px) {
  .login-page > :is(.register-card, .auth-action-card) {
    justify-self: end;
    margin-right: max(0px, (100% - 940px) / 2);
  }
  .login-page:not(:has(.login-panels)) .login-header img { width: 158px; }
  .login-page:not(:has(.login-panels)) .auth-cinematic canvas { transform: translateX(-10%); }
}
.login-footer { align-self: end; width: min(800px, 100%); text-align: center; }
.login-footer nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  border-top: 1px solid var(--border); padding-top: 14px; gap: 8px 16px; font-size: .85rem; color: var(--muted); }
.login-footer a { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border: 1px solid var(--border);
  border-radius: 4px; text-decoration: none; }
.login-footer a :is(svg, img) { width: 16px; height: 16px; }
.login-footer a:hover { border-color: var(--accent); color: var(--text); }
.login-footer a.support-link { border-color: #ffdd00; color: #ffdd00; }
.login-footer a.support-link:is(:hover, :focus-visible) { background: #ffdd00; color: #1c1700; }
.home-news { grid-area: news; min-width: 0; max-height: min(460px, 65vh); overflow: auto; padding: 24px; }
.home-news h2 { margin: 0; font-size: 1.25rem; }
.home-news-status { color: var(--muted); margin: 12px 0 0; }
.home-news-entry { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 16px; }
.home-news-entry h3 { margin: 4px 0 8px; overflow-wrap: anywhere; }
.home-news-entry time { color: var(--muted); font-size: .82rem; }
.home-news-entry p { margin: 0; }
.news-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.login-selectors { position: absolute; top: 18px; right: 24px; display: grid; grid-auto-flow: column; grid-template-columns: auto auto; align-items: start; gap: 4px 8px; }
.login-selectors > :is(.server-picker, .language-picker) { grid-row: 1; }
.server-picker-trigger {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; justify-items: start; align-items: center;
  gap: 2px 18px; width: clamp(130px, 20vw, 200px); padding: 6px 10px; text-align: left;
  background: var(--panel-fill); anchor-name: --server-picker-trigger;
}
.server-picker-trigger span { grid-column: 1; font-size: .75rem; color: var(--muted); }
.server-picker-trigger strong { grid-column: 1; overflow-wrap: anywhere; }
.server-picker-trigger::after {
  content: ""; grid-column: 2; grid-row: 1 / 3; width: 6px; height: 6px;
  border: solid currentColor; border-width: 0 1px 1px 0; rotate: 45deg;
}
:is(.server-picker, .language-picker):has(:popover-open) .server-picker-trigger::after { rotate: 225deg; }
:is(.server-picker-list, .language-picker-list) {
  inset: 72px 24px auto auto; margin: 0; padding: 4px; width: min(360px, calc(100vw - 40px));
  max-height: calc(100dvh - 88px); overflow: auto; color: var(--text);
  background: var(--select-bg); border: 1px solid var(--panel-edge); border-radius: 4px;
  box-shadow: 0 14px 44px #000a; position-anchor: --server-picker-trigger;
}
@supports (top: anchor(bottom)) {
  :is(.server-picker-list, .language-picker-list) { top: calc(anchor(bottom) + 6px); right: anchor(right); }
}
:is(.server-picker-list, .language-picker-list) ul { padding: 0; margin: 0; list-style: none; }
.language-picker-trigger { anchor-name: --language-picker-trigger; width: auto; min-width: 132px; gap: 2px 10px; }
.language-picker-list { position-anchor: --language-picker-trigger; width: min(175px, calc(100vw - 48px)); }
.language-picker-list button { width: 100%; display: flex; align-items: center; gap: 6px; padding: 7px; text-align: start; }
.language-picker-list button[aria-pressed="true"] { border-color: var(--accent); }
.language-picker-trigger strong { display: flex; align-items: center; gap: 5px; }
.language-flag { flex: 0 0 16px; width: 16px; height: 11px; border: 1px solid #ffffff40; border-radius: 2px; }
.language-flag[data-culture="pl"] { background: linear-gradient(#fff 50%, #dc143c 50%); }
.language-flag[data-culture="en"] {
  background:
    linear-gradient(90deg, transparent 42%, #c8102e 42% 58%, transparent 58%),
    linear-gradient(transparent 40%, #c8102e 40% 60%, transparent 60%),
    linear-gradient(90deg, transparent 36%, #fff 36% 64%, transparent 64%),
    linear-gradient(transparent 32%, #fff 32% 68%, transparent 68%),
    linear-gradient(32deg, transparent 43%, white 43% 57%, transparent 57%),
    linear-gradient(-32deg, transparent 43%, white 43% 57%, transparent 57%) #012169;
}
.server-picker-list li + li { border-top: 1px solid var(--border); }
.server-picker-list a { display: block; padding: 10px 12px; color: inherit; text-decoration: none; }
.server-picker-list a[aria-current] { box-shadow: inset 3px 0 var(--accent); }
.server-picker-list a[href]:hover, .server-picker-list a:focus-visible { background: var(--panel-top); }
.server-picker-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; overflow-wrap: anywhere; }
.server-state { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--muted); }
.server-state::before { content: ""; flex: 0 0 7px; height: 7px; border-radius: 50%; background: currentColor; }
.server-state[data-state="Available"] { color: var(--ok); }
.server-state[data-state="Maintenance"] { color: var(--warn); }
.server-state[data-state="Offline"] { color: var(--hp); }
.server-picker-list dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; margin: 8px 0 0; font-size: .8rem; }
.server-picker-list dt { color: var(--muted); }
.server-picker-list dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 620px) {
  .login-page { gap: 16px; padding-inline: 16px; }
  .login-header { align-content: start; }
  .login-page:has(.login-panels) .login-header { min-height: clamp(160px, 32vh, 230px); }
  .login-selectors { position: static; justify-self: end; }
  .login-panels { grid-template-columns: minmax(0, 1fr); grid-template-areas: "auth" "news"; max-width: 440px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-cinematic canvas, .auth-motion { display: none; }
}
.error { color: var(--hp); margin: 6px 0; }
.success { color: var(--ok); }
.lang-switcher { display: flex; gap: 4px; justify-content: flex-end; }
.lang-switcher button { padding: 2px 8px; font-size: .8rem; }

/* game */
.game-root { position: fixed; inset: 0; overflow: hidden; }
.game-canvas { width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
.hud { position: absolute; left: 258px; top: 12px; width: 260px; font-size: .85rem; }
.hud-name { font-size: 1.1rem; font-weight: 600; }
.hud-map, .hud-pos { color: var(--muted); margin: 2px 0; }
.bar-label { margin-top: 6px; font-size: .75rem; color: var(--muted); }
.bar { height: 8px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; }
.bar > div { height: 100%; transition: width .15s linear; }
/* Hull green, nano hull yellow, shield blue (every panel bar). */
.bar.hp > div { background: #58d68d; }
.bar.shield > div { background: var(--shield); }
.bar.hp { position: relative; }
/* Nano hull: yellow layer over the hull bar (HUD, target panel). */
.bar.hp > .nano { position: absolute; left: 0; top: 0; background: #f4d03f; box-shadow: 0 0 6px rgba(244, 208, 63, .6); }
.bar-label .nano-label { color: #f4d03f; }
.bar.cd { flex: 1; } .bar.cd > div { background: var(--warn); transition: none; }
.cooldown { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.cooldown .ready { color: var(--ok); }
.destroyed { margin-top: 8px; color: var(--hp); font-weight: 600; }

.target-panel { position: absolute; left: 12px; top: 220px; width: 260px; font-size: .85rem; }
.panel-title { color: var(--muted); text-transform: uppercase; font-size: .7rem; letter-spacing: 2px; }
.target-name { font-weight: 600; font-size: 1rem; }
.hint { color: var(--muted); font-size: .75rem; margin-top: 4px; }

.minimap { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.minimap canvas { width: 300px; height: 200px; background: rgba(0, 0, 0, .55); border-radius: 2px; }
.minimap .zoom-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--muted); cursor: pointer; }
.minimap .zoom-toggle input { margin: 0; }
.minimap .panel-title { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin: 0; }
.minimap .zoom-buttons { display: flex; align-items: center; gap: 4px; }
.minimap .zoom-buttons button { width: 24px; height: 22px; padding: 0; font-size: .95rem; line-height: 1; }
.minimap .minimap-pos { color: var(--muted); font-size: .72rem; text-align: center; font-variant-numeric: tabular-nums; }
.minimap .zoom-level { color: var(--muted); font-size: .7rem; min-width: 26px; text-align: center; }

.top-right {
  position: absolute; right: 12px; top: 0; display: grid; grid-template-columns: auto auto;
  justify-items: end; align-items: start; gap: 6px; max-width: calc(100% - 24px); pointer-events: none; z-index: 18;
}
.top-right .connection-status { grid-area: 1 / 1; margin-top: 12px; pointer-events: auto; }
.game-brand {
  --game-logo-size: clamp(88px, 14vw, 164px);
  grid-area: 1 / 2; position: relative; min-width: 224px;
  padding-top: max(8px, calc(var(--game-logo-size) * .39 - 33px));
}
.game-brand img {
  position: absolute; right: 0; top: 5px; width: var(--game-logo-size); height: auto; pointer-events: none;
}
.game-brand-actions { position: relative; display: flex; justify-content: flex-end; gap: 4px; padding-inline-end: 12px; }
.game-brand button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; }
.game-brand button { pointer-events: auto; background: var(--panel); border-color: var(--border); }
.game-brand button.logout { background-color: #7a1c1c; }
.game-brand button.inbox-toggle { position: relative; }
.game-brand .inbox-toggle .hex-badge { top: -5px; right: -5px; }
.game-brand button.settings-button:is(.active, [aria-pressed="true"]) { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--panel), var(--accent) 18%); }
.game-brand .ui-icon { width: 19px; height: 19px; }
button.logout { background: #7a1c1c; border-color: rgba(255, 110, 110, .6); color: #fff; font-weight: 600; }
button.logout:hover:not(:disabled) { background: #a32626; }
.connection-status { display: flex; gap: 6px; align-items: center; font-size: .8rem; background: var(--panel); border: 1px solid var(--border); border-radius: 4px; padding: 4px 8px; }
.connection-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-connected .dot { background: var(--ok); }
.status-reconnecting .dot, .status-connecting .dot { background: var(--warn); }
.status-disconnected .dot { background: var(--hp); }
.connection-status .ping { color: var(--muted); }
.connection-status .warn { color: var(--warn); }

/* Notifications = action log (rewards, notices): always at the top in the middle of the screen; under the target panel
   while it is shown in its default place (docked by ui.js, data-dock-below + data-dock-center). One line per reward,
   lines of one operation together, a small gap (.group-start) before the next operation. */
.notifications { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); display: flex; flex-direction: column;
  gap: 0; align-items: center; max-width: min(520px, 90vw); pointer-events: none; z-index: 3; }
/* Lines of one source packed with no gap; a gap (Settings → Interface, default 0.5em) before the next source. */
/* (the gap rule itself is below the reset of .notification — same specificity, so it must come after it) */
/* Action logs: text colour (default white) with an outline (default black), no background or frame; colours, size and
   the gap between sources come from the settings (Hud.razor sets the variables on .notifications). */
.notification, .notification.error, .notification.combat, .notification.reward {
  background: transparent; border: 0; padding: 0 5px; margin: 0; line-height: 1.15;
  font-size: var(--log-size, 13px); color: var(--log-color, #fff);
  text-shadow: -1px -1px 0 var(--log-outline, #000), 1px -1px 0 var(--log-outline, #000), -1px 1px 0 var(--log-outline, #000),
    1px 1px 0 var(--log-outline, #000), 0 0 2px var(--log-outline, #000); }
.notifications > .notification.group-start { margin-top: var(--log-group-gap, .5em); }
.notification.server, .reward-entry.server { font-weight: 700; color: #ffe29a; }

/* boot + error UI */
.boot { height: 100vh; display: flex; align-items: center; justify-content: center; }
.boot-spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 8px 16px; background: #5a1d1d; color: #fff; z-index: 1000; gap: 12px; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* ---------------------------------------------------------------- OrionWars gameplay UI */
.faction-badge { font-size: .7rem; padding: 1px 6px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }
.faction-1 { background: hsl(calc(var(--theme-h) + 6) calc(68% * var(--theme-s)) 36%); color: hsl(calc(var(--theme-h) + 7) calc(100% * var(--theme-s)) 93%); }
.faction-2 { background: #8a2b2b; color: #ffe0e0; }
.level { color: var(--muted); font-size: .8rem; margin-left: 4px; }
.tag { font-size: .7rem; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--border); margin-right: 4px; }
.tag.pvp, .tag.attack { border-color: var(--hp); color: #ffb3ae; }
.tag.safe { border-color: var(--ok); color: var(--ok); }
.tag.combat { border-color: var(--warn); color: var(--warn); }
.tag.repair { border-color: var(--shield); color: var(--shield); }
.tag.cloaked { border-color: #b58cff; color: #d7c2ff; }
/* CLO4K in use: the cloak slot of the action bar glows while the ship is invisible. */
.action-bar .slot.cpu.active { box-shadow: 0 0 0 2px #b58cff inset, 0 0 10px rgba(181, 140, 255, .55); }
.status-tags { margin-top: 6px; min-height: 18px; }
.bar.xp > div { background: #b58cff; }
.wallet { display: flex; gap: 10px; margin-top: 6px; font-size: .8rem; }


.reward-log { position: absolute; right: 12px; top: 56px; width: 260px; font-size: .75rem; display: flex; flex-direction: column; }
.journal-list { max-height: 32vh; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.reward-entry .time { color: var(--muted); font-size: .68rem; }
.reward-entry.error { color: #ffb3ad; }
.reward-entry.combat { color: #ffd0a0; }
.reward-entry.reward { color: #e4d6ff; }
.reward-entry { display: flex; flex-wrap: wrap; gap: 6px; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.05); }

.radiation-overlay { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 120px 30px rgba(255, 30, 30, .55);
  animation: radiation-pulse 1s ease-in-out infinite; }
@keyframes radiation-pulse { 50% { box-shadow: inset 0 0 60px 10px rgba(255, 30, 30, .25); } }
.radiation-banner { position: absolute; top: 90px; left: 50%; transform: translateX(-50%); background: rgba(120, 0, 0, .8);
  color: #fff; padding: 6px 16px; border-radius: 4px; font-weight: 600; pointer-events: none; }

.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 20; }
.modal { max-width: 360px; text-align: center; }

.faction-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 4px; }
.faction-option { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 8px; }
.faction-option small { color: var(--muted); font-size: .7rem; margin: 0; }
.faction-option.active { outline: 2px solid var(--accent); }

/* ---------------------------------------------------------------- toolbar, bars, windows (hangar / shop / settings) */
.panel-toolbar { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; background: var(--panel); border: 1px solid var(--border);
  border-radius: 4px; padding: 3px; }
.panel-toolbar button { padding: 3px 8px; font-size: .75rem; background: transparent; border-color: transparent; color: var(--muted); }
.panel-toolbar button:hover { background: hsl(calc(var(--theme-h) + 4) calc(67% * var(--theme-s)) 21%); color: var(--text); }
.panel-toolbar button.toggle.active { color: var(--text); border-color: var(--border); background: hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .18); }
.panel-toolbar button.active:not(.toggle) { background: var(--accent); color: hsl(calc(var(--theme-h) + 4) calc(84% * var(--theme-s)) 7%); }
.panel-toolbar .separator { width: 1px; align-self: stretch; background: var(--border); margin: 0 3px; }
.reward-log { top: 120px; }
.minimap-host.hidden { display: none; }
.hud-ship { color: var(--muted); margin: 2px 0; }
.tag.config { border-color: #b58cff; color: #e4d6ff; margin-left: 6px; }
.destroyed-banner { position: absolute; left: 50%; top: 140px; transform: translateX(-50%); color: var(--hp); font-weight: 600;
  background: var(--panel); border: 1px solid var(--hp); border-radius: 4px; padding: 6px 14px; pointer-events: none; }

.bottom-bars { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 8px;
  align-items: flex-end; }
.bottom-bars .bars { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.action-bar { padding: 5px; }
.action-bar .slots { display: flex; gap: 4px; align-items: stretch; }
.action-bar .bar-number { align-self: center; width: 14px; color: var(--muted); font-size: .7rem; text-align: center; }
.action-bar .slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 58px; min-height: 46px; padding: 3px 4px; font-size: .75rem; cursor: pointer; user-select: none; overflow: hidden;
  background: hsl(calc(var(--theme-h) + 5) calc(67% * var(--theme-s)) 13%); border: 1px solid var(--border); border-radius: 4px; }
.action-bar .slot:hover { background: hsl(calc(var(--theme-h) + 4) calc(66% * var(--theme-s)) 30%); }
.action-bar .slot .key { position: absolute; left: 3px; top: 1px; color: var(--muted); font-size: .6rem; }
.action-bar .slot .icon { position: absolute; right: 4px; top: 1px; font-size: .6rem; color: var(--muted); }
.action-bar .slot .name { font-weight: 600; margin-top: 6px; }
.action-bar .slot .count { font-size: .65rem; color: var(--muted); }
/* Selected ammunition / rocket: the same tile, 10% brighter (plus a coloured frame to tell the kinds apart). */
.action-bar .slot.active { background: color-mix(in srgb, hsl(calc(var(--theme-h) + 5) calc(67% * var(--theme-s)) 13%) 90%, #ffffff); }
.action-bar .slot.active:hover { background: color-mix(in srgb, hsl(calc(var(--theme-h) + 4) calc(66% * var(--theme-s)) 30%) 90%, #ffffff); }
.action-bar .slot.ammo.active { border-color: var(--accent); }
.action-bar .slot.rocket.active { border-color: #f5a13a; }
.action-bar .slot.attacking { box-shadow: 0 0 0 2px var(--hp) inset; }
.action-bar .slot.empty { opacity: .45; }
.action-bar .slot.empty-slot { border-style: dashed; background: rgba(0, 0, 0, .25); cursor: default; }
.action-bar .cooldown-fill { position: absolute; left: 0; bottom: 0; height: 3px; background: #f5a13a; }
.action-bar .cooldown-fill.ammo { background: var(--accent); }

.item-menu { position: relative; display: flex; flex-direction: column; align-items: flex-start; }
.item-menu-button { min-height: 46px; padding: 4px 10px; font-size: .8rem; }
.item-menu-button.active { background: var(--accent); color: hsl(calc(var(--theme-h) + 4) calc(84% * var(--theme-s)) 7%); }
.item-menu-panel { position: absolute; left: 0; bottom: 54px; width: 360px; padding: 8px; z-index: 6; }
.item-menu-panel .tabs { display: flex; gap: 4px; margin-bottom: 6px; }
.item-menu-panel .tabs button.active { background: var(--accent); color: hsl(calc(var(--theme-h) + 4) calc(84% * var(--theme-s)) 7%); }
.item-menu-panel .tabs .close { margin-left: auto; }
.item-menu-panel .palette { display: flex; flex-wrap: wrap; gap: 4px; }
.item-menu-panel .palette-item { display: flex; flex-direction: column; align-items: center; min-width: 62px; padding: 4px 6px;
  font-size: .75rem; border: 1px solid var(--border); border-radius: 4px; background: hsl(calc(var(--theme-h) + 4) calc(67% * var(--theme-s)) 21%); cursor: grab; user-select: none; }
.item-menu-panel .palette-item .count { font-size: .65rem; color: var(--muted); }

.hud-stats { display: flex; gap: 10px; margin: 2px 0; font-size: .8rem; }
.hud-stats .warn, .hint.warn { color: var(--warn); }

.damage-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.damage-text { position: absolute; left: 0; top: 0; font-weight: 700; font-size: .95rem; white-space: nowrap; will-change: transform, opacity;
  text-shadow: 0 0 3px #000, 0 0 6px #000; }
.damage-text.dealt { color: #ffd84d; }
.damage-text.taken { color: #ff5a50; font-size: 1.05rem; }
.damage-text.shield { color: #6fc8ff; }
.damage-text.other { color: hsl(calc(var(--theme-h) + 8) calc(37% * var(--theme-s)) 85%); font-size: .8rem; opacity: .9; }
.damage-text.heal { color: #58d68d; }
.damage-text.crit { font-size: 1.3rem; color: #ff9f1a; text-shadow: 0 0 6px rgba(255, 120, 0, .7); }
.damage-text.shield-gain { color: #6fc8ff; }
.damage-text.radiation::before { content: "☢ "; color: #d4ff3a; }

.game-window { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(920px, 94vw); max-height: 82vh;
  display: flex; flex-direction: column; z-index: 15; font-size: .85rem; }
.window-header { display: flex; align-items: center; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.window-title { font-size: 1.05rem; font-weight: 600; flex: 1; }
.window-header .wallet { margin: 0; }
.window-header .close { padding: 2px 8px; }
.window-body { overflow: auto; padding-top: 8px; }
.game-window .tabs { display: flex; gap: 4px; margin: 8px 0 4px; flex-wrap: wrap; }
.game-window .tabs .switch { margin-left: auto; }
.game-window button.small { padding: 2px 8px; font-size: .75rem; }
.muted { color: var(--muted); }
.bad { color: var(--hp); }

.shop-table { width: 100%; border-collapse: collapse; }
.shop-table th { text-align: left; color: var(--muted); font-weight: 400; font-size: .75rem; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.shop-table td { padding: 5px 6px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.shop-table td.name { font-weight: 600; }
.shop-table td.actions { text-align: right; white-space: nowrap; }
.shop-table td.actions button { padding: 2px 8px; margin-left: 3px; }
.shop-table tr.owned td { opacity: .6; }

.hangar-window { width: min(1180px, 96vw); max-height: 88vh; }
.hangar-tabs { margin-top: 8px; }
.hangar-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; min-height: 0; }
.hangar-ships { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; align-content: start; }
.hangar-ship { border: 1px solid var(--border); border-radius: 4px; padding: 6px; cursor: pointer; }
.hangar-ship.selected { border-color: var(--accent); background: hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .12); }
.hangar-ship .name { font-weight: 600; }
.hangar-ship button { margin-top: 4px; padding: 2px 8px; font-size: .75rem; }
.hangar-ship-line { display: flex; align-items: center; gap: 8px; }
.hangar-ship-line .name { font-weight: 600; font-size: .95rem; }
.hangar-ship-line .config-tabs { margin: 0 0 0 12px; }
/* Far from the configuration buttons, so it is not clicked by accident. */
.hangar-ship-line .change-ship { margin-left: auto; }
.hangar-config .stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 10px; }
/* Slot groups scroll on their own so 20-25 lasers + 20-25 generators + 10 extras still fit. */
.slot-groups { max-height: 58vh; overflow: auto; padding-right: 4px; }
.slot-group { border: 1px dashed transparent; border-radius: 4px; padding: 4px; margin-bottom: 8px; }
.slot-group.drop-ready { border-color: var(--accent); }
/* At most 5 slots per row. */
.slot-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
.equip-slot { position: relative; min-width: 0; min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 4px;
  border: 1px dashed var(--border); border-radius: 4px; color: var(--muted); font-size: .75rem; text-align: center; }
.equip-slot.filled { border-style: solid; background: hsl(calc(var(--theme-h) + 4) calc(67% * var(--theme-s)) 21%); color: var(--text); cursor: default; }
.equip-slot .slot-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.equip-slot .remove { padding: 0 5px; font-size: .7rem; flex: none; }
.upgrade { color: #ffcc55; font-weight: 600; font-size: .75rem; }
.upgrade.none { color: var(--muted); font-weight: 400; }
.hangar-inventory { max-height: 64vh; overflow: auto; }
.inventory-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 5px; }
.inventory-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 7px; border: 1px solid var(--border);
  border-radius: 4px; cursor: grab; background: hsl(calc(var(--theme-h) + 4) calc(67% * var(--theme-s)) 21% / .35); }
.inventory-item:hover { border-color: var(--accent); }
.inventory-item .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-card.floating { position: fixed; z-index: 40; width: 280px; pointer-events: none; background: hsl(calc(var(--theme-h) + 5) calc(67% * var(--theme-s)) 9%); border: 1px solid var(--accent);
  border-radius: 6px; padding: 8px 10px; font-size: .78rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
.item-card-body > div { margin-top: 2px; }
.item-card-title { font-weight: 600; font-size: .9rem; }

.settings-window { width: min(620px, 94vw); }
.settings-window section { margin-bottom: 14px; }
.settings-window .lang-switcher { justify-content: flex-start; margin-top: 6px; }
.settings-keys-title { display: flex; align-items: center; justify-content: space-between; }
.settings-window .settings-subtitle { margin: 10px 0 4px; font-size: .65rem; opacity: .85; }
.settings-window .name-tag-preview { display: inline-block; margin: 4px 0 8px; padding: 4px 10px; border-radius: 4px; background: rgba(0, 0, 0, .55);
  color: #ff4a4a; font-weight: 600; text-shadow: 0 0 3px #000, 0 0 2px #000; white-space: nowrap; }
.key-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin-top: 8px; }
.key-row { display: grid; grid-template-columns: 1fr 70px 72px; gap: 6px; align-items: center; }
.key-cap { text-align: center; border: 1px solid var(--border); border-radius: 4px; padding: 2px 4px; background: hsl(calc(var(--theme-h) + 5) calc(68% * var(--theme-s)) 7%); font-size: .75rem; }
.key-cap.capturing { border-color: var(--warn); color: var(--warn); }

/* ---------------------------------------------------------------- text selection
   The game UI is not selectable (dragging over panels must not highlight text); only the reward / event log, the chat
   and input fields are. */
.game-root { -webkit-user-select: none; user-select: none; }
.game-root .reward-log, .game-root .selectable, .game-root input, .game-root textarea { -webkit-user-select: text; user-select: text; }

/* ---------------------------------------------------------------- chat */
.chat-window { position: absolute; left: 12px; bottom: 12px; width: 340px; height: 230px; display: flex; flex-direction: column;
  gap: 6px; font-size: .8rem; z-index: 4; }
.chat-window .tabs { display: flex; gap: 4px; }
.chat-window .tabs button { padding: 2px 10px; font-size: .75rem; }
.chat-window .tabs button.unread:not(.active) { border-color: var(--warn); color: var(--warn); }
.chat-messages { flex: 1; overflow-y: auto; padding-right: 4px; }
.chat-line { padding: 1px 0; line-height: 1.35; word-break: break-word; }
.chat-line .time { color: var(--muted); font-size: .7rem; margin-right: 4px; }
.chat-line .sender { font-weight: 600; margin-right: 4px; background: none; }
.chat-line .sender.faction-1 { color: hsl(calc(var(--theme-h) + 5) calc(100% * var(--theme-s)) 75%); }
.chat-line .sender.faction-2 { color: #ff8f8f; }
.chat-line .sender.admin::before { content: "★ "; color: var(--warn); }
.chat-input { display: flex; gap: 4px; }
.chat-input input { flex: 1; padding: 4px 6px; background: hsl(calc(var(--theme-h) + 5) calc(68% * var(--theme-s)) 7%); color: var(--text); border: 1px solid var(--border); border-radius: 4px; }
.chat-input button { padding: 4px 10px; }
.admin-chat-history { max-height: 55vh; overflow: auto; margin: 8px 0; }
.admin-chat-history table { width: 100%; border-collapse: collapse; }
.admin-chat-history th, .admin-chat-history td { padding: 4px 7px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.admin-chat-history th { position: sticky; top: 0; background: var(--panel); }
.admin-chat-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- countdowns (portal jump, logout) */
.countdown-banner { position: absolute; top: 130px; left: 50%; transform: translateX(-50%); padding: 8px 18px; border-radius: 6px;
  font-weight: 600; display: flex; gap: 12px; align-items: center; z-index: 6; }
.countdown-banner.jump { background: hsl(calc(var(--theme-h) + 9) calc(75% * var(--theme-s)) 31% / .85); border: 1px solid hsl(calc(var(--theme-h) + 2) calc(100% * var(--theme-s)) 72%); pointer-events: none; }
.countdown-banner.logout { top: 170px; background: rgba(60, 40, 10, .88); border: 1px solid var(--warn); }
.countdown-banner button { padding: 3px 10px; }
.tag.admin { border-color: var(--warn); color: var(--warn); }
.tag.auto { border-color: var(--accent); color: var(--accent); }
.extras-line { display: flex; gap: 8px; align-items: center; margin-top: 6px; color: var(--muted); font-size: .75rem; }
.bar.cd.rocket > div { background: #ff9a3c; }

/* ---------------------------------------------------------------- name tags under ships / NPCs (scene.js) */
/* Keep label and bar stacking inside this layer, below the HUD panels that follow it. */
.name-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; isolation: isolate; }
.name-tag { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: var(--name-tag-size, 12px); font-weight: 600; letter-spacing: .2px;
  text-shadow: 0 0 3px #000, 0 0 2px #000; will-change: transform; color: hsl(calc(var(--theme-h) + 11) calc(77% * var(--theme-s)) 95%); }
.name-tag.self { color: #ffffff; }
.name-tag.ally { color: hsl(calc(var(--theme-h) + 2) calc(100% * var(--theme-s)) 78%); }
.name-tag.enemy { color: #ff8a80; }
.name-tag.npc { color: #ff4a4a; }
/* Shared company logos for ship name tags and the ranking. */
.company::after { display: inline-block; vertical-align: middle; width: 1.28em; height: 1.28em;
  border-radius: 50%; box-sizing: border-box;
  font: italic 700 .82em/1.28em Georgia, "Palatino Linotype", "Book Antiqua", serif; text-align: center; color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .55); letter-spacing: 0; }
.name-tag.company::after { position: relative; vertical-align: top; top: .74em; margin-left: .14em; }
.company-bsc::after { content: "b"; background: radial-gradient(circle at 35% 30%, #6fb6ff, #1f6fe0 60%, #0d3f9a);
  box-shadow: 0 0 4px rgba(40, 130, 255, .8), inset 0 0 0 1px rgba(255, 255, 255, .25); }
.company-ghc::after { content: "g"; line-height: 1.1em; background: radial-gradient(circle at 35% 30%, #7dffa0, #1fb34e 60%, #0b6a2a);
  box-shadow: 0 0 4px rgba(40, 220, 100, .8), inset 0 0 0 1px rgba(255, 255, 255, .25); }
/* Pilot rank (PlayerRanks): icon in front of the nickname, 1..20 = Basic Space Pilot..General, 21 = administrator. */
.name-tag.rank::before { content: ""; display: inline-block; width: 1.3em; height: 1.3em; margin-right: .3em;
  vertical-align: -.3em; background: center / contain no-repeat; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .9)); }
.name-tag.rank-1::before { background-image: url("../img/ranks/rank-1.svg"); }
.name-tag.rank-2::before { background-image: url("../img/ranks/rank-2.svg"); }
.name-tag.rank-3::before { background-image: url("../img/ranks/rank-3.svg"); }
.name-tag.rank-4::before { background-image: url("../img/ranks/rank-4.svg"); }
.name-tag.rank-5::before { background-image: url("../img/ranks/rank-5.svg"); }
.name-tag.rank-6::before { background-image: url("../img/ranks/rank-6.svg"); }
.name-tag.rank-7::before { background-image: url("../img/ranks/rank-7.svg"); }
.name-tag.rank-8::before { background-image: url("../img/ranks/rank-8.svg"); }
.name-tag.rank-9::before { background-image: url("../img/ranks/rank-9.svg"); }
.name-tag.rank-10::before { background-image: url("../img/ranks/rank-10.svg"); }
.name-tag.rank-11::before { background-image: url("../img/ranks/rank-11.svg"); }
.name-tag.rank-12::before { background-image: url("../img/ranks/rank-12.svg"); }
.name-tag.rank-13::before { background-image: url("../img/ranks/rank-13.svg"); }
.name-tag.rank-14::before { background-image: url("../img/ranks/rank-14.svg"); }
.name-tag.rank-15::before { background-image: url("../img/ranks/rank-15.svg"); }
.name-tag.rank-16::before { background-image: url("../img/ranks/rank-16.svg"); }
.name-tag.rank-17::before { background-image: url("../img/ranks/rank-17.svg"); }
.name-tag.rank-18::before { background-image: url("../img/ranks/rank-18.svg"); }
.name-tag.rank-19::before { background-image: url("../img/ranks/rank-19.svg"); }
.name-tag.rank-20::before { background-image: url("../img/ranks/rank-20.svg"); }
.name-tag.rank-21::before { background-image: url("../img/ranks/rank-21.svg"); }

/* ---------------------------------------------------------------- "Jump" button above a portal in range (scene.js) */
.portal-jump-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.portal-jump-button { position: absolute; left: 0; top: 0; pointer-events: auto; will-change: transform; cursor: pointer;
  padding: 4px 14px; font-size: .8rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  color: hsl(calc(var(--theme-h) + 4) calc(84% * var(--theme-s)) 7%); background: var(--accent);
  border: 1px solid hsl(var(--theme-h) calc(100% * var(--theme-s)) 82%); border-radius: 14px;
  box-shadow: 0 0 10px hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .55); }
.game-root.window-open .portal-jump-layer,
.game-root:has(.modal-backdrop) .portal-jump-layer { display: none; }
.portal-jump-button:hover { background: hsl(var(--theme-h) calc(100% * var(--theme-s)) 75%); }

/* ---------------------------------------------------------------- administrator panel */
.panel-toolbar .admin-toggle { border-color: var(--warn); color: var(--warn); }
.panel-toolbar .admin-toggle.active { background: var(--warn); color: #1a1205; }
.admin-window { width: min(760px, 94vw); }
.admin-window .window-body { overflow-y: auto; max-height: calc(82vh - 48px); overscroll-behavior: contain; }
.admin-section { border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-top: 10px; }
.admin-section-title { font-weight: 700; color: var(--warn); margin-bottom: 8px; }
.admin-subtitle { margin: 10px 0 4px; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.admin-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 10px; }
.admin-field { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--muted); min-width: 0; }
.admin-field.wide { flex: 1 1 260px; }
.admin-field.small { flex: 0 0 90px; }
.admin-field input { width: 100%; padding: 5px 7px; color: var(--text); background: rgba(0, 0, 0, .35);
  border: 1px solid var(--border); border-radius: 4px; font: inherit; font-size: .85rem; }
.admin-field select { width: 100%; font-size: .85rem; }
.admin-npc-combo { position: relative; color: var(--text); }
.admin-npc-current { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; font-size: .85rem; padding: 5px 8px; }
.admin-npc-current .caret { opacity: .7; }
.admin-npc-combo.open .admin-npc-current .caret { transform: rotate(180deg); }
.admin-npc-dropdown { display: flex; gap: 8px; margin-top: 4px; padding: 6px; background: rgba(0, 0, 0, .45); border: 1px solid var(--border, rgba(255, 255, 255, .15)); border-radius: 6px; }
.admin-npc-list { list-style: none; margin: 0; padding: 0; flex: 1 1 50%; max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
.admin-npc-list li { padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: .85rem; }
.admin-npc-list li.hover { background: rgba(255, 255, 255, .1); }
.admin-npc-list li.selected { color: var(--accent); font-weight: 700; }
.admin-npc-preview { flex: 0 0 240px; height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 45%, rgba(80, 120, 200, .18), transparent 70%); border-radius: 6px; }
.admin-npc-preview .model-preview.admin-npc-model { width: 100%; flex: 1 1 auto; min-height: 0; }
.admin-npc-preview-name { font-size: .78rem; color: var(--muted); padding: 4px; text-align: center; }
@media (max-width: 560px) { .admin-npc-dropdown { flex-direction: column; } .admin-npc-preview { flex-basis: 200px; height: 200px; } }
.admin-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 4px; }
.admin-check.disabled { opacity: .45; cursor: not-allowed; }
.admin-variants { gap: 16px; margin-bottom: 6px; }
.admin-actions { margin-top: 10px; align-items: center; }
.admin-actions .primary { margin-left: auto; }
.admin-window button.primary { background: var(--accent); color: hsl(calc(var(--theme-h) + 4) calc(84% * var(--theme-s)) 7%); font-weight: 700; }
.admin-window button.link { background: none; border-color: transparent; color: var(--accent); padding: 6px 4px; }
.admin-window .muted { font-size: .75rem; margin-top: 6px; }
.admin-message { margin-top: 10px; color: var(--ok); font-size: .85rem; }

/* ---------------------------------------------------------------- destruction panel (respawn choice) */
.death-backdrop { background: radial-gradient(ellipse at center, rgba(60, 0, 0, .35), rgba(0, 0, 0, .7)); z-index: 18; }
.death-panel { width: min(520px, 92vw); text-align: center; padding: 18px 20px; border-color: rgba(224, 86, 79, .55); }
.death-title { font-size: 1.25rem; font-weight: 700; color: var(--hp); margin-bottom: 4px; }
.death-text { margin: 4px 0 12px; color: var(--muted); }
.death-wait { margin: 0 0 10px; color: var(--warn); font-weight: 600; }
.death-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.death-option { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; }
.death-option-name { font-weight: 600; }
.death-option-info { font-size: .75rem; color: var(--muted); }
.death-option-price { font-size: .85rem; color: #b58cff; font-weight: 600; }
.death-option-price.free { color: var(--ok); }
.death-wallet { margin-top: 12px; font-size: .8rem; color: var(--muted); }
@media (max-width: 520px) { .death-options { grid-template-columns: 1fr; } }

/* Hull / shield bars above ships and NPCs (nameTags.js). */
.hp-bars { position: absolute; left: 0; top: 0; width: 46px; display: flex; flex-direction: column; gap: 1px; pointer-events: none;
  will-change: transform; }
.hp-bars:not(.no-hp) { z-index: 1; }
.hp-bar { height: 4.5px; background: rgba(0, 0, 0, .6); border: 1px solid rgba(0, 0, 0, .7); border-radius: 1px; overflow: hidden; }
.hp-bar > div { height: 100%; width: 100%; }
.hp-bar.hull { position: relative; }
.hp-bar.hull > div { background: #58d68d; }
/* Nano hull (Galaxy Gate reward): yellow layer over the green hull, share of the max hull. */
.hp-bar.hull > .nano { position: absolute; left: 0; top: 0; width: 0; background: #f4d03f; box-shadow: 0 0 3px #f4d03f; }
.hp-bar.shield > div { background: var(--shield); }
.hp-bars.no-hp .hp-bar { display: none; }
/* Drone letter colour by drone design: none = white, Havoc = red, Hercules = blue. */
.drone-letters .design-havoc { color: #ff4a3d; }
.drone-letters .design-hercules { color: #4aa8ff; }
/* Drone models hidden (settings, Graphics): letters of the drones above the hull bar, e.g. "FFIIA". */
.drone-letters { align-self: center; font: 700 calc(var(--name-tag-size, 12px) * .72)/1 ui-monospace, monospace; letter-spacing: 0;
  color: #fff; text-shadow: 0 0 2px #000, 0 0 3px #000; white-space: nowrap; margin-bottom: 1px; }
.drone-formation-dots { width: 1.55em; height: 1.08em; margin-right: .28em; vertical-align: middle;
  fill: currentColor; filter: drop-shadow(0 0 1px #000); }

/* Movable panels (js/panels.js). */
.drag-handle { cursor: move; }
.drag-strip { position: absolute; right: 6px; top: 4px; color: var(--muted); font-size: .8rem; letter-spacing: -2px; user-select: none; }
.drag-grip { display: inline-flex; align-items: center; padding: 0 4px; color: var(--muted); letter-spacing: -2px; user-select: none; }
[data-drag-panel].dragging { opacity: .85; z-index: 20; }
/* Selected windows sit above normal HUD/windows (15), below modal backdrops (18+). */
[data-drag-panel].panel-foreground { z-index: 17; }

.death-killer { color: #ff8a80; font-weight: 600; margin: 4px 0 8px; }

/* pilot profile */
.panel-toolbar .badge { display: inline-block; min-width: 16px; margin-left: 4px; padding: 0 4px; border-radius: 8px; background: var(--warn);
  color: hsl(calc(var(--theme-h) + 4) calc(84% * var(--theme-s)) 7%); font-size: .7rem; font-weight: 700; text-align: center; }
.pilot-window { width: min(720px, 94vw); }
.pilot-points { color: var(--muted); }
.pilot-points.has-points { color: var(--warn); font-weight: 600; }
.pilot-window .window-body { max-height: min(78vh, 760px); overflow-y: auto; overscroll-behavior: contain; }
.pilot-convert { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px; margin-bottom: 8px;
  border: 1px solid var(--accent); border-radius: 6px; }
.pilot-tier { margin-bottom: 10px; }
.pilot-tier.locked .skill-row { opacity: .55; }
.pilot-reset { display: flex; justify-content: flex-end; margin-top: 6px; }
.skill-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.skill-row { display: grid; grid-template-columns: 1fr 190px; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--border);
  border-radius: 4px; }
.skill-row.maxed { border-color: var(--ok); background: rgba(88, 214, 141, .06); }
.skill-row .name { font-weight: 600; }
.skill-steps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.skill-step { padding: 1px 6px; border: 1px solid var(--border); border-radius: 3px; font-size: .7rem; color: var(--muted); }
.skill-step.on { background: var(--accent); border-color: var(--accent); color: hsl(calc(var(--theme-h) + 4) calc(84% * var(--theme-s)) 7%); font-weight: 600; }
.skill-value { text-align: right; }
.skill-value button { margin-top: 4px; padding: 3px 8px; font-size: .75rem; }
.skill-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }

/* missions */
.missions-window { width: min(760px, 94vw); }
.mission-list { display: flex; flex-direction: column; gap: 8px; }
.mission { border: 1px solid var(--border); border-radius: 4px; padding: 8px; }
.mission.active { border-color: var(--accent); background: hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .07); }
.mission-header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.mission-header .name { font-weight: 600; font-size: .95rem; margin-right: 6px; }
.mission .description { margin-top: 3px; }
.mission .objectives { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.mission .objectives li { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.mission .objectives li.done .objective-text { color: var(--ok); }
.mission .objectives li.constraint .objective-text { color: var(--warn); }
.objective-progress { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.objective-progress.ok { color: var(--ok); }
.bar.mission-bar { width: 110px; display: inline-block; }
.bar.mission-bar > div { background: var(--ok); }
.mission .rewards { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .8rem; }
.mission .reward { color: #ffe08a; }
.mission-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.mission-actions .warn { color: var(--warn); }
.tag.status-active { border-color: var(--accent); color: var(--accent); }
.tag.status-completed { border-color: var(--ok); color: var(--ok); }
.tag.status-failed { border-color: var(--hp); color: #ffb3ae; }
.tag.status-abandoned { color: var(--muted); }

/* Hangar: hover breakdown of the summed statistics */
.hangar-config .stats .stat-hover { cursor: help; border-bottom: 1px dotted var(--border); }
.hangar-config .stats .stat-hover:hover { border-bottom-color: var(--accent); }
.item-card.floating.stat-card { width: 340px; }
.stat-breakdown .bd-row { display: flex; justify-content: space-between; gap: 10px; }
.stat-breakdown .bd-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-breakdown .bd-sum { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 3px; }
.stat-breakdown .bd-pilot { color: var(--ok); }
.stat-breakdown .bd-total { border-top: 1px solid var(--accent); margin-top: 3px; padding-top: 3px; font-size: .85rem; }
.stat-breakdown .bd-items { border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 3px; }
/* Pilot profile: scrollable skill list */
.pilot-window .skill-list { max-height: min(62vh, 560px); overflow-y: auto; padding-right: 4px; overscroll-behavior: contain; }

/* Galaxy Gates window */
.gates-window { width: min(780px, 94vw); }
.gates-body { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.gates-body .gate-running, .gates-body .gate-list { grid-column: 1 / -1; }
.gate-running { padding: 6px 10px; border: 1px solid var(--warn); border-radius: 4px; color: var(--warn); font-size: .85rem; }
.gate-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.gate-card { border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; cursor: pointer; background: hsl(calc(var(--theme-h) + 4) calc(67% * var(--theme-s)) 21% / .35); }
.gate-card .name { font-weight: 600; margin-bottom: 4px; }
.gate-card.selected { border-color: var(--accent); background: hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .18); }
.gate-card.prepared { box-shadow: inset 0 0 0 1px var(--ok); }
.bar.gate-parts > div { background: #b58cff; }
.energy-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 6px; }
.energy-buttons button { display: flex; flex-direction: column; align-items: center; padding: 4px 6px; }
.gate-result, .gate-info, .gate-actions { font-size: .8rem; }
.gate-info .bd-row, .gate-result .bd-row, .materials-list .bd-row { display: flex; justify-content: space-between; gap: 10px; }
.gate-info .gate-prize-sub { padding-left: 10px; opacity: .85; }
.materials-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 18px; font-size: .8rem; margin-top: 4px; }
.hint.ok { color: var(--ok); }

/* Drones (hangar tab) */
.drone-shop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 6px; }
.drone-offer { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; font-size: .8rem; }
.drone-offer .name { font-weight: 600; }
.drone-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.drone-card { border: 1px solid var(--border); border-radius: 4px; padding: 6px; cursor: pointer; }
.drone-card.selected { border-color: var(--accent); }
.drone-card.drop-ready { border-style: dashed; }
.drone-card .name { font-size: .8rem; font-weight: 600; margin-bottom: 4px; }

/* ---------------------------------------------------------------- drone formations on the action bars */
.action-bar .slot.formation.active { border-color: #b98cff; }
.action-bar .cooldown-fill.formation { background: #b98cff; }
.item-menu-panel .palette-item.formation { border-color: #b98cff; }

/* ---------------------------------------------------------------- purchase confirmation (uridium) */
.purchase-backdrop { z-index: 40; }
.purchase-dialog { min-width: 300px; display: flex; flex-direction: column; gap: 10px; outline: none; }
.purchase-dialog .purchase-item { font-size: 1.05rem; display: flex; justify-content: center; gap: 8px; }
.purchase-dialog .purchase-item .name { font-weight: 600; }
.purchase-dialog .purchase-cost { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.purchase-dialog .purchase-actions { display: flex; justify-content: center; gap: 10px; }
.purchase-dialog .purchase-actions .primary { background: var(--accent); color: hsl(calc(var(--theme-h) + 4) calc(84% * var(--theme-s)) 7%); font-weight: 600; }

/* ---------------------------------------------------------------- stats for nerds (key F) */
/* Above the minimap (docked by ui.js to wherever the minimap panel is). */
.nerd-stats { position: absolute; right: 12px; bottom: 280px; z-index: 15; font-size: .75rem;
  padding: 6px 10px; min-width: 200px; font-family: Consolas, "Courier New", monospace; pointer-events: none; }
.nerd-stats .nerd-title { font-weight: 600; margin-bottom: 4px; color: var(--accent); }
.nerd-stats table { border-collapse: collapse; width: 100%; }
.nerd-stats td { padding: 1px 4px; }
.nerd-stats td:first-child { color: var(--muted); }
.nerd-stats td:last-child { text-align: right; }
.nerd-stats .good, .nerd-stats .status-connected { color: var(--ok); }
.nerd-stats .warn, .nerd-stats .status-reconnecting, .nerd-stats .status-connecting { color: var(--warn); }
.nerd-stats .bad, .nerd-stats .status-disconnected { color: var(--hp); }
.nerd-stats .nerd-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.nerd-stats .nerd-actions { display: flex; gap: 4px; pointer-events: auto; }
.nerd-stats .nerd-actions button { font: inherit; font-size: .7rem; padding: 1px 6px; cursor: pointer; }
.nerd-stats.expanded { min-width: 300px; max-height: calc(100vh - 320px); overflow-y: auto; pointer-events: auto; }
.nerd-stats .nerd-section { margin: 6px 0 2px; color: var(--accent); font-weight: 600; border-top: 1px solid rgba(255,255,255,.12); padding-top: 4px; }
.nerd-stats .nerd-sub td:first-child { padding-left: 10px; }
.nerd-stats .nerd-dim { color: var(--muted); font-size: .9em; }
.nerd-stats .nerd-features { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; pointer-events: auto; }
.nerd-stats .nerd-features label { display: flex; align-items: center; gap: 4px; cursor: pointer; }

.drone-shop-hint { display: flex; align-items: center; gap: 8px; }

/* ---------------------------------------------------------------- item pictures (ItemIcon / ItemArt / ModelPreview) */
.item-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 48px; height: 48px; border-radius: 6px; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .18), hsl(calc(var(--theme-h) + 9) calc(69% * var(--theme-s)) 5% / .9) 70%);
  border: 1px solid hsl(calc(var(--theme-h) + 4) calc(100% * var(--theme-s)) 68% / .25); }
.item-icon > img, .item-icon > .item-art, .item-icon > .model-preview { width: 100%; height: 100%; display: block; }
.item-icon > img { object-fit: contain; }
.item-icon.elite { border-color: rgba(190, 120, 255, .75); box-shadow: inset 0 0 10px rgba(170, 90, 255, .35); }
.item-icon .elite-badge { position: absolute; top: 1px; right: 2px; font-size: .62rem; line-height: 1; filter: drop-shadow(0 0 2px #000); }
.item-icon .item-blocked-badge { position: absolute; top: 2px; left: 2px; padding: 0 4px; border-radius: 3px;
  background: #261216; color: #ff626c; font-size: .9rem; line-height: 1.15; font-weight: 800; }
.admin-item-blocked-note { color: #ff626c; font-weight: 700; }
.item-icon .icon-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 2px; font-size: .6rem; font-weight: 700;
  text-align: center; letter-spacing: .3px; background: hsl(calc(var(--theme-h) + 9) calc(75% * var(--theme-s)) 3% / .72); color: hsl(calc(var(--theme-h) + 6) calc(100% * var(--theme-s)) 95%); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.item-icon.large { width: 100%; height: 220px; border-radius: 8px;
  background: radial-gradient(ellipse at 50% 45%, hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .22), hsl(calc(var(--theme-h) + 9) calc(75% * var(--theme-s)) 3% / .95) 72%); }
.item-icon.large .elite-badge { font-size: 1rem; top: 6px; right: 8px; }
.model-preview { outline: none; touch-action: none; }

/* Animated pictures (shop detail): beam pulse, shield ring, flame flicker, gear spin, glow breathing. */
.item-art.art-anim .art-beam { animation: art-beam 1.1s ease-in-out infinite; transform-box: fill-box; transform-origin: left center; }
.item-art.art-anim .art-pulse { animation: art-pulse 1.6s ease-in-out infinite; }
.item-art.art-anim .art-glow { animation: art-glow 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.item-art.art-anim .art-flame { animation: art-flame .18s steps(2) infinite alternate; transform-box: fill-box; transform-origin: right center; }
.item-art.art-anim .art-ring { animation: art-ring 6s linear infinite; transform-box: fill-box; transform-origin: center; }
.item-art.art-anim .art-spin { animation: art-ring 5s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes art-beam { 0%, 100% { transform: scaleX(.35); opacity: .35; } 45% { transform: scaleX(1); opacity: 1; } }
@keyframes art-pulse { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
@keyframes art-glow { 0%, 100% { transform: scale(.9); opacity: .7; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes art-flame { from { transform: scaleX(.8); opacity: .75; } to { transform: scaleX(1.12); opacity: 1; } }
@keyframes art-ring { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- shop: cards + detail panel */
.shop-window { width: min(1120px, 96vw); max-height: 88vh; }
.shop-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: start; min-height: 0; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; max-height: 70vh; overflow: auto;
  padding-right: 4px; align-content: start; }
.shop-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px;
  background: hsl(calc(var(--theme-h) + 4) calc(67% * var(--theme-s)) 21% / .35); text-align: center; min-width: 0; }
.shop-card .item-icon { width: 64px; height: 64px; }
.shop-card.selected { border-color: var(--accent); background: hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .2); box-shadow: 0 0 0 1px var(--accent) inset; }
.shop-card.owned { opacity: .7; }
.shop-card .card-name { font-weight: 600; font-size: .8rem; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.shop-card .card-price { font-size: .72rem; color: var(--muted); }
.shop-card .card-badge { position: absolute; top: 4px; left: 4px; font-size: .62rem; padding: 0 4px; border-radius: 3px;
  background: hsl(calc(var(--theme-h) + 9) calc(75% * var(--theme-s)) 3% / .75); color: hsl(calc(var(--theme-h) + 5) calc(74% * var(--theme-s)) 85%); }
.shop-detail { position: sticky; top: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--border);
  border-radius: 6px; background: hsl(calc(var(--theme-h) + 9) calc(69% * var(--theme-s)) 5% / .55); max-height: 70vh; overflow: auto; }
.shop-detail .detail-name { font-size: 1rem; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.shop-detail .detail-code { font-size: .72rem; font-weight: 700; padding: 1px 5px; border-radius: 3px; background: hsl(calc(var(--theme-h) + 4) calc(67% * var(--theme-s)) 21%); color: hsl(calc(var(--theme-h) + 5) calc(100% * var(--theme-s)) 91%); }
.shop-detail .detail-stats { display: flex; flex-direction: column; gap: 2px; }
.stat-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.stat-row > span { color: var(--muted); }
.stat-row.bad b { color: var(--hp); }
.shop-detail .detail-price { font-size: .9rem; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 6px; }
button.primary { background: var(--accent); color: hsl(calc(var(--theme-h) + 4) calc(84% * var(--theme-s)) 7%); font-weight: 600; }
button.primary:hover { background: hsl(calc(var(--theme-h) + 1) calc(100% * var(--theme-s)) 74%); }
button.danger { background: #5a1a1a; border-color: rgba(255, 110, 110, .5); }
button.danger:hover { background: #7a2424; }
.tag.elite { display: inline-block; font-size: .68rem; padding: 0 5px; border-radius: 3px; background: rgba(150, 80, 255, .25);
  border: 1px solid rgba(190, 120, 255, .6); color: #e2ccff; }

/* ---------------------------------------------------------------- hangar: item tiles + interactive hover card */
.equip-slot.filled .item-icon { width: 100%; height: 44px; border: none; background: transparent; }
.equip-slot.filled { padding: 2px; min-height: 50px; }
.equip-slot.filled .remove { position: absolute; top: 1px; right: 1px; z-index: 2; }
.equip-slot.filled .upgrade { position: absolute; top: 1px; left: 3px; z-index: 2; }
.inventory-grid { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); }
.inventory-item { position: relative; justify-content: center; padding: 3px; }
.inventory-item .item-icon { width: 54px; height: 54px; }
.inventory-item .upgrade { position: absolute; top: 2px; left: 4px; }
.hangar-ship .item-icon { float: right; margin-left: 6px; }
.drone-name { display: flex; align-items: center; gap: 6px; }
.panel-title .equip-best { margin-left: 8px; vertical-align: middle; }
.equip-best { background: #1d4a2a; border-color: rgba(120, 230, 150, .5); }
.equip-best:hover { background: #276339; }
.panel-title .unequip-all { margin-left: 6px; vertical-align: middle; }
.unequip-all { background: #4a1d24; border-color: rgba(230, 120, 130, .5); }
.unequip-all:hover:not(:disabled) { background: #63272f; }
/* Drones tab: "Equip the best" / "Reset" side by side, as wide as their text (not the whole column). */
.equip-actions { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; }
.equip-actions > button { width: auto; flex: 0 0 auto; }
.small-hint { margin-left: 6px; cursor: help; }
.item-card.floating.interactive { pointer-events: auto; width: 300px; }
.item-card-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.item-card-sell { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px !important;
  padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .08); }
.muted.small { font-size: .7rem; }

/* ---------------------------------------------------------------- loot chest countdown (name-tag layer) */
/* The chest clock sits below both models and fills clockwise. */
.name-tag.chest-timer { position: absolute; width: 46px; height: 46px; display: grid; place-items: center; padding: 0;
  margin-top: 18px;
  color: #7dff9a; font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: 0 0 3px #000, 0 0 6px #000; }
.name-tag.chest-timer .ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.name-tag.chest-timer .ring-track { fill: rgba(0, 0, 0, .45); stroke: rgba(255, 255, 255, .18); stroke-width: 4; }
.name-tag.chest-timer .ring-fill { fill: none; stroke: #62ff8c; stroke-width: 4; stroke-linecap: round;
  filter: drop-shadow(0 0 3px rgba(80, 255, 140, .7)); }
.name-tag.chest-timer .ring-text { position: relative; }

/* ---------------------------------------------------------------- universal window frame
   Every game window (Shop, Hangar, Pilot, Missions, Galaxy Gates, Settings) has the same design size — the shop size,
   1120 × 720 — and is scaled as a whole to the browser window (--win-scale, js/ui.js), so the layout and every element
   in it look the same on every screen, browser and zoom level. The content areas fill the frame and scroll inside it. */
.game-window.panel { width: 1120px; height: 720px; max-width: none; max-height: none;
  transform: translate(-50%, -50%) scale(var(--win-scale, 1)); transform-origin: center center; overflow: hidden; }
.game-window > .window-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.game-window > .tabs { flex: none; }

.shop-body { grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.shop-grid, .shop-detail { max-height: none; height: 100%; }
.hangar-grid { grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.hangar-grid > .hangar-config { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.hangar-grid .slot-groups { max-height: none; flex: 1 1 auto; min-height: 0; }
.hangar-grid .hangar-inventory { max-height: none; height: 100%; }
.drones-grid .drone-list { flex: 1 1 auto; min-height: 0; overflow: auto; padding-right: 4px; }
.pilot-window .skill-list { max-height: none; }

/* shop: sections, locked offers, any-amount box */
.shop-section { grid-column: 1 / -1; margin: 6px 0 0; padding: 2px 4px; font-size: .78rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: hsl(calc(var(--theme-h) + 5) calc(100% * var(--theme-s)) 81%); border-bottom: 1px solid var(--border); }
.shop-section:first-child { margin-top: 0; }
.shop-card.locked { opacity: .45; filter: grayscale(.85); }
.shop-card.locked .card-price { color: var(--warn); }
.locked-note { color: var(--warn); }
.stat-row.good b { color: var(--ok); }
.stat-row.bad b { color: var(--hp); }
.stat-row.requirement { border-top: 1px dashed var(--border); margin-top: 2px; }
.small-note { font-size: .72rem; align-self: center; }
.amount-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; margin-top: 4px; padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, .06); }
.amount-buy label { color: var(--muted); font-size: .78rem; }
.amount-buy input { width: 110px; }
.amount-buy .amount-max { font-size: .7rem; }
.purchase-quantity, .shop-module-level { display: flex; flex-wrap: wrap; align-items: end; gap: 4px; }
.purchase-quantity label { display: grid; gap: 3px; }
.amount-buy .amount-max { flex-basis: 100%; }
.currency-amount { display: inline-flex; gap: .3em; align-items: center; vertical-align: middle; white-space: nowrap; }
.currency-icon { width: 1.12em; height: 1.12em; flex: none; vertical-align: middle; }
.currency-icon.wide { width: 1.7em; }
.item-icon > .currency-icon { width: 60%; height: 60%; }
.currency-frame { fill: #1c4e97; stroke: #91cfff; stroke-width: 1.25; }
.currency-shine { fill: #67adf5; opacity: .36; }
.currency-icon.uridium .currency-frame { fill: #234fa3; stroke: #aec2ff; }
.currency-icon.uridium .currency-shine { fill: #a8baff; }
.currency-icon.experience .currency-frame { fill: #18604f; stroke: #8fefc9; }
.currency-icon.experience .currency-shine { fill: #84e6bf; }
.currency-icon.honor .currency-frame { fill: #713652; stroke: #ffb7d8; }
.currency-icon.honor .currency-shine { fill: #ffb5d5; }
.currency-icon.level .currency-frame { fill: #493b78; stroke: #d1baff; }
.currency-icon.level .currency-shine { fill: #cbb8ff; }
.currency-icon.keys .currency-frame { fill: #65451a; stroke: #f8d492; }
.currency-icon.keys .currency-shine { fill: #ffd581; }
.currency-letter { fill: #f4fbff; }
.tracker-rewards { display: flex; flex-wrap: wrap; gap: .25em .6em; padding: .2em 0; }

/* purchase summary dialog */
.purchase-dialog { min-width: 340px; }
.purchase-dialog .purchase-summary { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.purchase-dialog .purchase-summary .total { border-top: 1px solid var(--accent); margin-top: 2px; }
.purchase-dialog .purchase-summary .good b { color: var(--ok); }

/* hangar: ships not owned yet, tabular hover card, items in drones */
.hangar-ship.not-owned { cursor: default; opacity: .75; border-style: dashed; }
.hangar-ship.not-owned .item-icon { filter: grayscale(.7); }
.hangar-ship.not-owned:hover { opacity: 1; }
.item-card-stats { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; }
.item-card-stats .stat-row { font-size: .76rem; }
.stat-breakdown .bd-drone { color: #b9e3ff; }
.stat-breakdown .drone-tag { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 3px; font-size: .66rem;
  background: rgba(120, 200, 255, .15); border: 1px solid rgba(120, 200, 255, .4); color: #cdeaff; }

/* ---------------------------------------------------------------- Galaxy Gates: list | gate model | star cauldron */
.gg-body { display: grid; grid-template-columns: 210px minmax(0, 1fr) 320px; grid-template-rows: minmax(0, 1fr); gap: 12px; overflow: hidden; }
.gg-list, .gg-side { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: auto; padding-right: 2px; }
.gg-gate { display: grid; grid-template-columns: 1fr auto; gap: 4px 6px; align-items: center; text-align: left; padding: 8px 10px;
  border: 1px solid var(--border); border-left: 4px solid var(--gate-color); background: hsl(calc(var(--theme-h) + 4) calc(67% * var(--theme-s)) 21% / .35); }
.gg-gate .gg-gate-name { font-weight: 600; }
.gg-gate .bar { grid-column: 1 / -1; height: 6px; }
.gg-gate .bar > span { display: block; height: 100%; background: var(--gate-color); transition: width .4s ease; }
.gg-gate .gg-gate-parts { font-size: .75rem; color: var(--muted); }
.gg-gate .tag { justify-self: end; }
.gg-gate.selected { background: hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .16); border-color: var(--gate-color); box-shadow: 0 0 12px -4px var(--gate-color); }
.gg-gate.prepared { box-shadow: inset 0 0 0 1px var(--ok); }
.gg-drone-parts { margin-top: 8px; font-size: .8rem; }
.gg-drone-parts .bd-row, .gg-chances .bd-row { display: flex; justify-content: space-between; gap: 8px; }

.gg-stage { position: relative; display: flex; flex-direction: column; align-items: center; min-height: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: 8px; padding: 8px;
  background: radial-gradient(ellipse at center, hsl(calc(var(--theme-h) + 9) calc(53% * var(--theme-s)) 33% / .35), hsl(calc(var(--theme-h) + 9) calc(75% * var(--theme-s)) 3% / .7) 70%); }
.gg-stage .gate-running { align-self: stretch; }
.gg-stage-title { display: flex; gap: 12px; align-items: baseline; font-size: 1.1rem; font-weight: 600; margin-top: 4px; }
.gg-stage-title b { color: var(--gate-color); }
.gg-model { position: relative; flex: 1 1 auto; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.gg-svg { width: min(100%, 470px); height: 100%; max-height: 470px; overflow: visible; }
.gg-piece { fill: rgba(255, 255, 255, .025); stroke: hsl(calc(var(--theme-h) + 6) calc(73% * var(--theme-s)) 78% / .28); stroke-width: .6; stroke-dasharray: 2 1.5;
  transition: fill .5s ease, stroke .5s ease; }
.gg-piece.on { fill: var(--gate-color); fill-opacity: .8; stroke: #fff; stroke-opacity: .55; stroke-dasharray: none; }
.gg-piece.fresh { animation: gg-fresh 1.1s ease-out; }
@keyframes gg-fresh { 0% { fill: #fff; fill-opacity: 1; transform: scale(1.06); } 100% { fill-opacity: .8; transform: scale(1); } }
.gg-model.empty .gg-piece { stroke-opacity: .5; }
.gg-model-empty { position: absolute; inset: auto 0 45% 0; text-align: center; color: var(--muted); font-size: .85rem; pointer-events: none; }
.gg-model.built .gg-pieces { animation: gg-breathe 3s ease-in-out infinite; }
@keyframes gg-breathe { 0%, 100% { opacity: .9; } 50% { opacity: 1; filter: brightness(1.25); } }
.gg-portal { transform-box: fill-box; transform-origin: center; }
.gg-portal .gg-swirl { fill: none; stroke: #fff; stroke-opacity: .55; stroke-width: 2.2; stroke-linecap: round;
  animation: art-ring 4s linear infinite; transform-box: fill-box; transform-origin: center; }
.gg-model.building .gg-piece { animation: gg-assemble .5s ease-out both; }
@keyframes gg-assemble { 0% { fill: rgba(255, 255, 255, .03); transform: scale(.7) rotate(-8deg); opacity: 0; }
  60% { fill: #fff; opacity: 1; } 100% { fill: var(--gate-color); fill-opacity: .8; transform: scale(1) rotate(0); opacity: 1; } }
.gg-model.building .gg-pieces { transform-box: view-box; transform-origin: center; }
.gg-model.building .gg-piece { transform-box: view-box; transform-origin: center; }
.gg-model.building .gg-portal { animation: gg-portal-open 2.6s ease-in both; }
@keyframes gg-portal-open { 0%, 55% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.gg-shock { fill: none; stroke: var(--gate-color); stroke-width: 3; opacity: 0; animation: gg-shock 1s ease-out 1.6s both;
  transform-box: fill-box; transform-origin: center; }
@keyframes gg-shock { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
.gg-flash { fill: #fff; opacity: 0; animation: gg-flash .9s ease-out 1.5s both; }
@keyframes gg-flash { 0% { opacity: 0; } 20% { opacity: .75; } 100% { opacity: 0; } }
.gg-build { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; max-width: 520px; }
.gg-build-button { font-size: 1.05rem; letter-spacing: .12em; padding: 8px 34px; }
.gg-build-button:not(:disabled) { animation: gg-ready 1.6s ease-in-out infinite; }
@keyframes gg-ready { 0%, 100% { box-shadow: 0 0 0 0 hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .0); } 50% { box-shadow: 0 0 18px 2px hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .7); } }
.gg-waves { font-size: .75rem; cursor: help; }

.gg-cauldron { position: relative; height: 180px; flex: none; display: flex; align-items: flex-end; justify-content: center; }
.gg-cauldron-svg { width: 220px; height: 180px; }
.gg-brew-swirl { fill: none; stroke: #fff; stroke-opacity: .45; stroke-width: 2; stroke-dasharray: 30 18;
  animation: gg-brew 3s linear infinite; }
@keyframes gg-brew { to { stroke-dashoffset: -96; } }
.gg-stars circle { fill: #fff; opacity: .2; animation: gg-twinkle 2.4s ease-in-out infinite; }
.gg-stars circle:nth-child(2n) { animation-delay: .8s; }
.gg-stars circle:nth-child(3n) { animation-delay: 1.5s; }
@keyframes gg-twinkle { 0%, 100% { opacity: .15; transform: translateY(0); } 50% { opacity: .9; transform: translateY(-6px); } }
.gg-cauldron.spinning .gg-brew-swirl { animation-duration: .5s; stroke-opacity: .9; }
.gg-cauldron.spinning .gg-stars circle { animation-duration: .6s; }
.gg-cauldron.spinning .gg-cauldron-svg { filter: drop-shadow(0 0 14px var(--gate-color)); animation: gg-shake .18s linear infinite; }
@keyframes gg-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-1.5px) rotate(-.4deg); } 75% { transform: translateX(1.5px) rotate(.4deg); } }
.gg-reel { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 64px; height: 64px; display: flex;
  align-items: center; justify-content: center; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .18), rgba(0, 0, 0, 0) 70%); }
.gg-reel-item { font-size: 2.1rem; line-height: 1; }
.gg-reel-item.rolling { animation: gg-roll .12s ease-out; }
@keyframes gg-roll { from { transform: translateY(-14px); opacity: .2; } to { transform: translateY(0); opacity: 1; } }
.gg-reel-item.done { animation: gg-pop .5s ease-out; filter: drop-shadow(0 0 8px #fff); }
@keyframes gg-pop { 0% { transform: scale(.4); } 70% { transform: scale(1.3); } 100% { transform: scale(1); } }
.gg-reel-item.idle { color: var(--muted); opacity: .6; }
.gg-noparts { font-size: .75rem; }
.gg-draw { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.gg-draw select { min-width: 0; }
.gg-draw-button { font-size: 1rem; letter-spacing: .12em; padding: 6px 18px; }
.gg-auto-button { width: 100%; font-weight: 700; letter-spacing: .08em; padding: 5px 10px; }
.gg-auto-button.running { background: rgba(220, 70, 60, .35); border-color: rgba(255, 110, 90, .8); color: #ffd9d2; animation: gg-auto-pulse 1.2s ease-in-out infinite; }
@keyframes gg-auto-pulse { 50% { box-shadow: 0 0 10px rgba(255, 110, 90, .6); } }
.gg-cost { font-size: .72rem; }
.gg-log { flex: 1 1 auto; min-height: 90px; overflow: auto; display: flex; flex-direction: column; gap: 4px; font-size: .78rem; }
.gg-log-entry { border: 1px solid var(--border); border-radius: 4px; padding: 4px 6px; background: hsl(calc(var(--theme-h) + 9) calc(69% * var(--theme-s)) 5% / .5); animation: gg-log-in .35s ease-out; }
.gg-log-entry.has-parts { border-color: rgba(181, 140, 255, .6); }
.gg-kronos-complete { color: var(--muted); opacity: .65; }
@keyframes gg-log-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.gg-log-head { display: flex; justify-content: space-between; gap: 6px; font-weight: 600; }
.gg-log-value { display: flex; justify-content: space-between; gap: 6px; margin-top: 3px; padding-top: 3px; border-top: 1px dashed rgba(120, 170, 220, .25); font-size: 12px; }
.gg-log-value b.ok { color: #7be08f; }
.gg-log-value b.warn { color: #ffb86b; }
.gg-spin-value { text-align: center; margin: 4px 0 6px; font-size: 13px; }
.gg-spin-value b { color: #9fd8ff; }
.gg-log-prizes { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.gg-prize b { color: var(--ok); }
.gg-prize.part { color: #d8c4ff; font-weight: 600; }
/* Extra amount of a multiplied prize: yellow, like the multiplier itself. */
.gg-prize.multi, .gg-prize.multi b { color: #ffc94d; }
.gg-prize.multi i { font-style: normal; opacity: .85; }
/* Reward of the gate: hover opens the breakdown card (main reward, aliens, pilot bonus, total). */
.gg-reward { display: inline-block; margin-top: 6px; cursor: help; border-bottom: 1px dotted var(--border); font-weight: 600; }
.gg-reward:hover { border-bottom-color: var(--accent); }
.gg-chances { font-size: .75rem; }
.gg-chances summary { cursor: pointer; color: var(--muted); }

/* ---------------------------------------------------------------- action bars: equal size, item pictures */
/* Both bars are identical: fixed-size slots (the content never changes the size) with the shop picture of the item. */
.action-bar .slots { align-items: center; }
.action-bar .slot { width: 58px; height: 58px; min-height: 0; flex: none; padding: 2px; justify-content: flex-end; }
.action-bar .slot .slot-icon { position: absolute; border: none; background: transparent; box-shadow: none; left: 50%; top: 4px; transform: translateX(-50%); width: 34px; height: 34px;
  pointer-events: none; }
.action-bar .slot .slot-icon svg, .action-bar .slot .slot-icon img { width: 100%; height: 100%; }
.action-bar .slot .key { z-index: 1; }
.action-bar .slot .count { position: relative; z-index: 1; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; line-height: 1.1; text-shadow: 0 0 3px #000; }

/* Item menu right of bar 1: a drop-down (drop-up) list; click = use, drag = place on a slot. */
.bottom-bars > .item-menu { position: absolute; left: calc(100% + 8px); bottom: 0; }
.item-menu-button { min-height: 58px; white-space: nowrap; }
.item-menu-button .caret { font-size: .7rem; opacity: .8; }
.item-menu-panel { left: 0; right: auto; bottom: 64px; width: 300px; }
.item-menu-panel .tabs { flex-wrap: wrap; }
.item-menu-panel .item-list { display: flex; flex-direction: column; gap: 3px; max-height: 300px; overflow-y: auto;
  overscroll-behavior: contain; padding-right: 2px; }
.item-menu-panel .item-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; padding: 3px 6px;
  font-size: .8rem; border: 1px solid var(--border); border-radius: 4px; background: hsl(calc(var(--theme-h) + 4) calc(67% * var(--theme-s)) 21%); cursor: pointer; user-select: none; }
.item-menu-panel .item-row:hover { background: hsl(calc(var(--theme-h) + 4) calc(66% * var(--theme-s)) 30%); }
.item-menu-panel .item-row:active { cursor: grabbing; }
.item-menu-panel .item-row .row-icon { width: 30px; height: 30px; border: none; background: transparent; pointer-events: none; }
.item-menu-panel .item-row .row-icon svg, .item-menu-panel .item-row .row-icon img { width: 100%; height: 100%; }
.item-menu-panel .item-row .count { font-size: .7rem; color: var(--muted); }
.item-menu-panel .item-row.active { border-color: var(--accent); background: color-mix(in srgb, hsl(calc(var(--theme-h) + 4) calc(67% * var(--theme-s)) 21%) 88%, #ffffff); }
.item-menu-panel .item-row.formation.active { border-color: #b98cff; }
.item-menu-panel .item-row.rocket.active { border-color: #f5a13a; }
.item-menu-panel .item-row.empty { opacity: .5; }
.item-menu-panel .hint { margin-top: 6px; }

/* Hangar: resources (ammunition, rockets, drone parts, keys) as amount tiles below the items. */
.inventory-item.resource { cursor: pointer; border-style: dashed; padding: 0; }
.inventory-item.resource.empty { opacity: .45; }
.resources-title { margin-top: 10px; }
.resource-sell { display: flex; gap: 6px; align-items: center; }
.resource-sell input { width: 90px; }
/* Amount sits just above the name strip of the icon (bottom 0 of .item-icon) so the two never overlap. */
.inventory-item.resource .resource-count { position: absolute; right: 5px; bottom: 18px; font-size: .7rem; font-weight: 700;
  line-height: 1; padding: 1px 3px; border-radius: 3px; background: rgba(0, 0, 0, .55); text-shadow: 0 0 3px #000; z-index: 1; }

/* Shop: unique items (not for sale). */
.shop-card.unique .card-price, .tag.unique { color: #ffcf4d; }
.tag.unique { border-color: #ffcf4d; }

/* Legendary items (LF-4, LF-5, SG3N-B03, X4, APIS, ZEUS): golden frame + label. */
.item-icon.legendary { border-color: rgba(255, 207, 77, .9); box-shadow: inset 0 0 12px rgba(255, 190, 40, .45), 0 0 6px rgba(255, 190, 40, .35); }
.item-icon .legendary-badge { color: #ffcf4d; }
.tag.legendary { display: inline-block; font-size: .68rem; padding: 0 5px; border-radius: 3px; background: rgba(255, 190, 40, .18);
  border: 1px solid rgba(255, 207, 77, .85); color: #ffe39a; box-shadow: 0 0 6px rgba(255, 190, 40, .35); }

/* Galaxy Gates: built gate as its 3D model; a quick, punchy draw. */
.gg-model .model-preview.gg-model-3d { width: min(100%, 470px); height: 100%; max-height: 470px; }
.gg-cauldron.spinning .gg-reel-item.rolling { animation: gg-roll .06s linear; }
.gg-reel-item.done { animation: gg-pop-big .35s cubic-bezier(.2, 1.6, .4, 1); }
.gg-reel-item.done.part { filter: drop-shadow(0 0 12px #ffe27a) drop-shadow(0 0 4px #fff); }
.gg-cauldron.burst .gg-cauldron-svg { animation: gg-flare .65s ease-out; }
.gg-burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.gg-burst i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gate-color); box-shadow: 0 0 8px var(--gate-color), 0 0 2px #fff;
  animation: gg-spark .6s ease-out forwards; transform: rotate(var(--a)) translateY(0); }
.gg-burst.part i { background: #ffe27a; box-shadow: 0 0 10px #ffe27a, 0 0 3px #fff; }
@keyframes gg-spark {
  0% { transform: rotate(var(--a)) translateY(0) scale(1.2); opacity: 1; }
  100% { transform: rotate(var(--a)) translateY(-54px) scale(.3); opacity: 0; }
}
@keyframes gg-pop-big {
  0% { transform: scale(.2) rotate(-25deg); opacity: 0; }
  60% { transform: scale(1.45) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
@keyframes gg-flare {
  0% { filter: drop-shadow(0 0 26px var(--gate-color)) brightness(1.7); }
  100% { filter: drop-shadow(0 0 0 transparent) brightness(1); }
}

/* Settings: colours */
.color-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.color-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 420px; }
.color-row input[type=color] { width: 56px; height: 28px; padding: 0 2px; background: transparent; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }

/* Galaxy Gate: countdown before every spawn of aliens */
.gate-countdown { position: absolute; top: 22%; left: 50%; transform: translateX(-50%); z-index: 40; pointer-events: none; text-align: center;
  color: #fff; text-shadow: 0 0 12px rgba(181, 140, 255, .9), 0 2px 4px rgba(0, 0, 0, .8); }
.gate-countdown-label { font-size: 1rem; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.gate-countdown-value { font-size: 4rem; font-weight: 700; line-height: 1; animation: gate-countdown-pop .9s ease-out; }
@keyframes gate-countdown-pop { 0% { transform: scale(1.6); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { opacity: .85; } }

/* ---------------------------------------------------------------- changing amounts (Amount.razor) */
.amount { display: inline-block; font-variant-numeric: tabular-nums; }
.amount.up { animation: amount-up 1.4s ease-out; }
.amount.down { animation: amount-down 1.4s ease-out; }
@keyframes amount-up {
  0%, 35% { color: #5dff8a; text-shadow: 0 0 6px rgba(93, 255, 138, .7); transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes amount-down {
  0%, 35% { color: #ff6b62; text-shadow: 0 0 6px rgba(255, 107, 98, .7); transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ---------------------------------------------------------------- galaxy map (GalaxyWindow.razor, js/babylon/galaxy.js) */
.galaxy-body { display: flex; gap: 10px; overflow: hidden; padding-top: 8px; }
.galaxy-view { position: relative; flex: 1 1 auto; min-width: 0; border-radius: 6px; overflow: hidden; background: #03040b; }
.galaxy-canvas { width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
.galaxy-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.galaxy-legend { position: absolute; left: 8px; bottom: 6px; display: flex; flex-wrap: wrap; gap: 10px; font-size: .72rem;
  background: rgba(0, 0, 0, .45); padding: 3px 8px; border-radius: 4px; pointer-events: none; }
.galaxy-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.galaxy-legend .dot.bsc { background: #4fa3ff; }
.galaxy-legend .dot.ghc { background: #ff5c4d; }
.galaxy-legend .dot.neutral { background: #b873ff; }
.galaxy-legend .dot.current { background: transparent; border: 2px solid #5aff8c; }
.galaxy-legend .dot.locked { background: #1b2a33; border: 1px solid rgba(63, 195, 230, .45); border-radius: 2px; }
.galaxy-side { flex: 0 0 270px; display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.galaxy-card { display: flex; flex-direction: column; gap: 2px; }
.galaxy-card-title { font-size: 1rem; font-weight: 600; margin-bottom: 4px; flex: 1; }
.galaxy-subtitle { margin-top: 10px; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.galaxy-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.galaxy-npc-list { display: flex; flex-direction: column; gap: 3px; }
.galaxy-npc { display: flex; justify-content: space-between; text-align: left; }
.galaxy-npc.active { outline: 1px solid var(--accent); }
.galaxy-jump { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.galaxy-npc-card { flex-basis: 240px; border-left: 1px solid var(--border); padding-left: 10px; }

/* ---------------------------------------------------------------- group */
.group-panel { position: absolute; left: 12px; bottom: 256px; width: 260px; max-height: 46vh; overflow-y: auto;
  font-size: .78rem; display: flex; flex-direction: column; gap: 4px; z-index: 4; }
.group-panel button.small, .target-panel button.small { padding: 2px 8px; font-size: .72rem; }
.group-bonus { color: var(--warn); font-size: .72rem; }
.group-members { display: flex; flex-direction: column; gap: 4px; }
.group-member { padding: 3px 4px; border: 1px solid var(--border); border-radius: 4px; }
.group-member.offline { opacity: .5; }
.group-member.other-map { opacity: .75; }
.group-member-line { display: flex; align-items: center; gap: 4px; }
.group-member-line .crown { width: 1.1em; text-align: center; }
.group-member-line .name { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-member-line .level, .group-member-line .map { color: var(--muted); font-size: .7rem; }
.group-member-line .map.warn { color: var(--warn); }
.group-member-line .group-hades-wave { padding: 0 3px; border: 1px solid #ff965f; border-radius: 3px; color: #ffb48a; font-size: .66rem; }
.group-member-line .kick { padding: 0 6px; }
.bar.thin { height: 4px; margin-top: 2px; }
.group-subtitle { margin-top: 4px; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.group-invite-line { display: flex; align-items: center; gap: 6px; }
.group-invite-line span:first-child { flex: 1; }
.group-invite-form { display: flex; gap: 4px; margin-top: 4px; }
/* Same look as the chat input (UI colour, not the white browser default). */
.group-invite-form input { flex: 1; min-width: 0; padding: 4px 6px; background: hsl(calc(var(--theme-h) + 5) calc(68% * var(--theme-s)) 7%);
  color: var(--text); border: 1px solid var(--border); border-radius: 4px; }
.group-invite-form input::placeholder { color: var(--muted); }
.group-invite-form button { padding: 2px 8px; }
.group-member-bars { display: flex; flex-direction: column; gap: 1px; }
.group-member-bars .bar { cursor: help; }
.group-target { display: flex; align-items: center; gap: 3px; cursor: help; }
.group-target .icon { font-size: .62rem; line-height: 1; }
.group-target .bar { flex: 1; margin-top: 0; }
.group-target.none { opacity: .35; }
.bar.target > div { background: var(--warn); }
.group-actions { display: flex; gap: 4px; justify-content: flex-end; }
.group-panel button.icon { padding: 1px 6px; }
.group-panel .leave { align-self: flex-start; margin-top: 2px; }
.group-events { margin-top: 4px; border-top: 1px solid var(--border); padding-top: 4px; font-size: .7rem; }
.group-event .time { color: var(--muted); margin-right: 4px; }
.group-invite-popup { position: absolute; left: 50%; top: 150px; transform: translateX(-50%); z-index: 20;
  display: flex; flex-direction: column; gap: 8px; min-width: 260px; font-size: .85rem; border-color: var(--warn); }
.group-invite-request .buttons { display: flex; gap: 6px; margin-top: 4px; }
.group-invite-request .accept { border-color: var(--warn); }
.target-panel .group-invite { margin-top: 6px; }
.group-member-line .name { background: none; }

/* ---------------------------------------------------------------- missions: categories, "coming soon", cancel */
.mission-filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 10px 0; }
.mission-filters .chip { font-size: .75rem; padding: 2px 8px; border-radius: 10px; }
.mission-filters .chip.active { border-color: var(--accent); color: var(--accent); }
.tabs .soon-tab { color: #b9c4ff; }
.mission.soon { opacity: .75; border-style: dashed; }
.mission.locked { opacity: .8; }
.mission .missing { margin: 4px 0 0; padding-left: 18px; font-size: .78rem; color: #b9c4ff; }
.tag.soon { border-color: #8f9dff; color: #b9c4ff; }
.tag.category-starter { border-color: #6fd2a8; color: #a6f0cf; }
.tag.category-epic { border-color: #ff9f43; color: #ffc98f; }
.tag.category-elite { border-color: #b58cff; color: #e4d6ff; }
.tag.category-blacklight { border-color: #6f6f6f; color: #d0d0d0; background: rgba(0, 0, 0, .35); }
.mission-cancel-dialog { max-width: 400px; }
.mission-cancel-dialog .modal-actions { display: flex; justify-content: center; gap: 10px; margin-top: 10px; }

/* ---------------------------------------------------------------- "Mission" tracker under the ship panel */
.mission-tracker { position: absolute; left: 12px; top: 300px; width: 260px; font-size: .78rem; padding: 6px 8px;
                   display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow-y: auto; }
.mission-tracker .tracker-title { display: flex; justify-content: space-between; align-items: center; font-weight: 600;
                                  text-transform: uppercase; letter-spacing: .05em; font-size: .7rem; color: var(--accent); }
.mission-tracker .tracker-title button.link { background: none; border: none; padding: 0 2px; color: var(--accent); cursor: pointer; }
.mission-tracker .tracker-name { display: flex; gap: 6px; align-items: baseline; }
.mission-tracker .tracker-name .name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mission-tracker .tracker-count { margin-left: auto; white-space: nowrap; }
.mission-tracker .tracker-reward-hint { width: 1.5em; height: 1.5em; flex-shrink: 0; padding: 0; border-radius: 50%;
  color: var(--accent); font-size: .9em; line-height: 1; cursor: help; }
.mission-tracker .tracker-name .warn { color: var(--warn); }
.mission-tracker .tracker-objective { display: grid; grid-template-columns: 1fr auto; gap: 1px 6px; align-items: center; }
.mission-tracker .tracker-objective .objective-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.mission-tracker .tracker-objective .objective-progress { font-variant-numeric: tabular-nums; }
.mission-tracker .tracker-objective .bar.mission-bar { grid-column: 1 / -1; width: 100%; height: 4px; }
.mission-tracker .tracker-objective.done .objective-text,
.mission-tracker .tracker-objective.done .objective-progress { color: var(--ok); }
.mission-tracker .bar.mission-bar > div { transition: width .25s ease-out; }

/* Shop: laser family table "bonus by the number of lasers" */
.laser-mechanics { margin-top: 8px; }
.laser-mechanics .stat-row { font-size: .8rem; }
.laser-mechanics .stat-row > b { text-align: right; }

/* HUD: hover the level -> progress to the next level (percent, mini bar, missing experience) */
.level-hover { position: relative; cursor: help; border-bottom: 1px dotted var(--muted); }
.level-tooltip { display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 50; min-width: 190px; padding: 8px 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: .78rem; font-weight: 400;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5); white-space: nowrap; flex-direction: column; gap: 4px; backdrop-filter: blur(4px); }
.level-hover:hover .level-tooltip, .level-hover:focus .level-tooltip { display: flex; }
.level-tooltip-title { font-weight: 600; }
.level-tooltip-missing { color: var(--muted); }
.level-mini-bar { display: block; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.level-mini-bar > span { display: block; height: 100%; background: #b58cff; }

/* Settings: checkbox rows (gameplay options) */
.toggle-row { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 0; }
.toggle-row input { width: 16px; height: 16px; accent-color: var(--accent); }

/* Mission tracker: one previewed mission, one dot per active mission (filled white = previewed) */
.mission-tracker .tracker-dots { display: flex; gap: 5px; margin-left: auto; margin-right: 6px; }
.mission-tracker .tracker-dot { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .75);
  background: transparent; cursor: pointer; }
.mission-tracker .tracker-dot:hover { background: rgba(255, 255, 255, .35); }
.mission-tracker .tracker-dot.selected { background: #fff; border-color: #fff; }

/* Ordered missions ("objectives in order"): banner, current step highlighted, later steps greyed out */
.ordered-banner { font-size: .72rem; color: var(--warn); border: 1px dashed rgba(245, 176, 65, .5); border-radius: 4px; padding: 2px 6px; }
.step-no { display: inline-block; min-width: 1.4em; color: var(--muted); }
.tracker-objective.current .objective-text, .objectives li.current .objective-text { color: var(--text); font-weight: 600; }
.tracker-objective.current .step-no, .objectives li.current .step-no { color: var(--accent); }
.tracker-objective.locked, .objectives li.locked { opacity: .45; filter: grayscale(1); }
.mission .objectives li.locked .objective-text { color: var(--muted); }

/* Group panel: bonus as a small badge (tooltip explains it), log in its own panel */
.group-panel .panel-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.group-bonus-badge { color: var(--warn); font-size: .72rem; font-weight: 600; border: 1px solid rgba(245, 176, 65, .45); border-radius: 8px;
  padding: 0 6px; cursor: help; margin-left: auto; }
.group-logs-toggle { margin-left: auto; }
.group-logs-toggle + .group-bonus-badge { margin-left: 0; }
.chest-green-title { color: #62ff8c; }
.chest-yellow-title { color: #ffd23f; }
.group-log-panel { position: absolute; left: 284px; bottom: 256px; width: 300px; max-height: 40vh; overflow-y: auto; font-size: .78rem;
  display: flex; flex-direction: column; gap: 4px; z-index: 6; }
.group-log-panel .group-events { border-top: none; margin-top: 0; padding-top: 0; }

/* Mission targets: yellow "!" next to the alien's name, above boxes / ore deposits / chests */
.name-tag.mission-target::after { content: " !"; color: #ffd400; font-weight: 800; text-shadow: 0 0 4px rgba(255, 212, 0, .8); }
.name-tag.mission-marker { color: #ffd400; font-size: 1.35rem; font-weight: 900; line-height: 1; background: none;
  text-shadow: 0 0 6px rgba(255, 212, 0, .9), 0 0 2px #000; animation: mission-marker-bob 1.2s ease-in-out infinite alternate; }
@keyframes mission-marker-bob { from { margin-top: 0; } to { margin-top: -4px; } }

.toggle-row input.small-number { width: 56px; height: auto; }

/* "Pilot" panel (split off the ship panel): right of the ship panel by default, movable like every HUD panel. */
.pilot-panel { position: absolute; left: 12px; top: 12px; width: 240px; font-size: .85rem; }
.pilot-panel .wallet { flex-wrap: wrap; gap: 4px 10px; }
.mission-tracker .tracker-title.drag-handle { cursor: move; }

/* Settings: tabs (General / Sound) and the sound volume sliders. */
.settings-window .tabs { margin-top: 6px; }
.sound-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.sound-row { display: grid; grid-template-columns: 170px 1fr 48px; align-items: center; gap: 10px; }
.sound-row.disabled { opacity: .5; }
.sound-row input[type=range] { width: 100%; accent-color: var(--accent); }
.sound-row .sound-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.sound-list .hint { margin: 0 0 6px; }

/* Mission places: "!" above the portal / point / base that advances an active mission. */
.name-tag.mission-marker.mission-place { font-size: 1.9rem; }

/* Level up: sci-fi effect in the middle of the screen (~10 s, see LevelUpOverlay.razor). */
.levelup-overlay { position: absolute; inset: 0; z-index: 40; pointer-events: none; display: flex; align-items: center;
  justify-content: center; overflow: hidden; animation: levelup-fade var(--levelup-duration, 10s) ease-in-out forwards; }
@keyframes levelup-fade { 0% { opacity: 0; } 4% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; } }
.levelup-beam { position: absolute; left: 50%; top: -10%; width: 220px; height: 120%; transform: translateX(-50%) scaleX(0);
  background: linear-gradient(90deg, transparent, rgba(120, 220, 255, .18) 35%, rgba(220, 250, 255, .45) 50%, rgba(120, 220, 255, .18) 65%, transparent);
  filter: blur(6px); animation: levelup-beam 1.6s .3s cubic-bezier(.2, .9, .2, 1) forwards; }
@keyframes levelup-beam { 0% { transform: translateX(-50%) scaleX(0); opacity: 0; } 30% { opacity: 1; transform: translateX(-50%) scaleX(1.4); }
  100% { transform: translateX(-50%) scaleX(.35); opacity: .35; } }
.levelup-rings { position: absolute; width: 0; height: 0; }
.levelup-rings span { position: absolute; left: 0; top: 0; width: 160px; height: 160px; margin: -80px 0 0 -80px; border-radius: 50%;
  border: 2px solid rgba(110, 220, 255, .85); box-shadow: 0 0 24px rgba(80, 200, 255, .7), inset 0 0 24px rgba(80, 200, 255, .5);
  opacity: 0; animation: levelup-ring 2.4s ease-out infinite; }
.levelup-rings span:nth-child(2) { animation-delay: .8s; border-color: rgba(255, 214, 90, .8); box-shadow: 0 0 24px rgba(255, 200, 60, .6); }
.levelup-rings span:nth-child(3) { animation-delay: 1.6s; }
@keyframes levelup-ring { 0% { transform: scale(.2); opacity: 0; } 15% { opacity: 1; } 100% { transform: scale(4.2); opacity: 0; } }
.levelup-sparks { position: absolute; width: 0; height: 0; }
.levelup-sparks i { position: absolute; left: -2px; top: -2px; width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(#fff, rgba(110, 220, 255, 0)); box-shadow: 0 0 8px #8fe3ff; opacity: 0;
  transform: rotate(var(--a)) translateY(0); animation: levelup-spark 1.4s var(--d) ease-out 3; }
@keyframes levelup-spark { 0% { opacity: 0; transform: rotate(var(--a)) translateY(-20px); } 20% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--r))); } }
.levelup-card { position: relative; text-align: center; padding: 22px 56px 20px; min-width: 340px;
  background: radial-gradient(ellipse at center, rgba(10, 30, 60, .82), rgba(4, 10, 24, .55) 70%, transparent);
  border-top: 1px solid rgba(120, 220, 255, .6); border-bottom: 1px solid rgba(120, 220, 255, .6);
  clip-path: polygon(6% 0, 94% 0, 100% 50%, 94% 100%, 6% 100%, 0 50%);
  animation: levelup-card .9s .2s cubic-bezier(.2, 1.4, .3, 1) both; }
.levelup-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .25;
  background: repeating-linear-gradient(0deg, rgba(160, 230, 255, .25) 0 1px, transparent 1px 3px); animation: levelup-scan 3s linear infinite; }
@keyframes levelup-scan { from { background-position: 0 0; } to { background-position: 0 60px; } }
@keyframes levelup-card { 0% { transform: scale(2.4); opacity: 0; filter: blur(8px); } 100% { transform: scale(1); opacity: 1; filter: none; } }
.levelup-kicker { font-size: .95rem; letter-spacing: .5em; text-transform: uppercase; color: #9fe6ff; text-shadow: 0 0 10px rgba(80, 200, 255, .9); }
.levelup-level { display: flex; align-items: baseline; justify-content: center; gap: 16px; margin: 6px 0 4px; }
.levelup-label { font-size: 1.4rem; letter-spacing: .25em; text-transform: uppercase; color: #dff6ff; }
.levelup-number { font-size: 5.2rem; font-weight: 900; line-height: 1; color: #fff;
  background: linear-gradient(180deg, #fff 10%, #ffe27a 55%, #ff9d2e 100%); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; filter: drop-shadow(0 0 14px rgba(255, 190, 60, .85)) drop-shadow(0 0 32px rgba(80, 200, 255, .55));
  animation: levelup-number 2.2s 1s ease-in-out infinite alternate; }
@keyframes levelup-number { from { filter: drop-shadow(0 0 10px rgba(255, 190, 60, .7)) drop-shadow(0 0 24px rgba(80, 200, 255, .4)); }
  to { filter: drop-shadow(0 0 22px rgba(255, 210, 90, 1)) drop-shadow(0 0 46px rgba(80, 200, 255, .8)); } }
.levelup-sub { font-size: .85rem; color: #b8d8ea; letter-spacing: .12em; }

/* ---------------------------------------------------------------- mission objectives (MissionObjectiveList.razor) */
/* Every objective: circle, what to do (wrapping) + map line, requirement on the right; restrictions with a square,
   indented under the objectives; locked steps greyed out. */
.mission-goals { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.mission-goals li { display: grid; grid-template-columns: 1.1em minmax(0, 1fr) auto; gap: 2px 8px; align-items: start; }
.mission-goals .goal-mark { color: var(--accent); line-height: 1.35; text-align: center; }
.mission-goals .goal-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mission-goals .goal-text { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.mission-goals .goal-sub { color: var(--muted); font-size: .85em; white-space: normal; overflow-wrap: anywhere; }
.mission-goals .goal-req { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text); text-align: right; line-height: 1.35; }
.mission-goals .bar.mission-bar { width: 100%; height: 4px; margin-top: 2px; }
.mission-goals .bar.mission-bar > div { transition: width .25s ease-out; }
.mission-goals li.done .goal-mark, .mission-goals li.done .goal-text, .mission-goals li.done .goal-req { color: var(--ok); }
.mission-goals li.current .goal-text { font-weight: 600; }
.mission-goals li.current .step-no { color: var(--accent); }
.mission-goals li.locked { opacity: .45; filter: grayscale(1); }
.mission-goals li.locked .goal-text { color: var(--muted); }
.mission-goals li.restriction { padding-left: 1.6em; }
.mission-goals li.restriction .goal-mark { color: var(--warn); font-size: .8em; line-height: 1.7; }
.mission-goals li.restriction .goal-text { color: var(--warn); }
.mission-goals li.goal-alternative { display: block; padding-left: calc(1.1em + 8px); color: var(--muted); font-weight: 600; }
.mission-goals.compact { gap: 3px; margin: 4px 0 0; font-size: .92em; }
.mission-goals.compact .goal-text { color: var(--muted); }
.mission-goals.compact li.current .goal-text { color: var(--text); }

/* ---------------------------------------------------------------- window tabs
   The section switches of the game windows (Shop, Hangar / equipment, Settings, ...) are drawn as tabs, not as
   buttons: a strip along the top of the content with the selected tab joined to it (accent line on top, no bottom
   border). The small configuration switches inside the hangar (.config-tabs) keep their button look. */
.game-window .tabs:not(.config-tabs) { gap: 2px; margin: 10px 0 0; padding: 0 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); align-items: flex-end; }
.game-window .tabs:not(.config-tabs) > button:not(.switch) { position: relative; margin-bottom: -1px;
  background: transparent; color: var(--muted); border: 1px solid transparent; border-bottom: none;
  border-radius: 6px 6px 0 0; padding: 7px 16px 6px; font-weight: 500; transition: color .12s, background .12s; }
.game-window .tabs:not(.config-tabs) > button:not(.switch):hover { color: var(--text);
  background: hsl(calc(var(--theme-h) + 4) calc(60% * var(--theme-s)) 50% / 0.12); }
.game-window .tabs:not(.config-tabs) > button.active:not(.switch) { color: var(--text); font-weight: 600;
  background: hsl(calc(var(--theme-h) + 9) calc(55% * var(--theme-s)) 13%);
  border-color: var(--border); box-shadow: inset 0 2px 0 var(--accent); }
.game-window .tabs:not(.config-tabs) > button.active:not(.switch)::after { content: ""; position: absolute; left: 0; right: 0;
  bottom: -1px; height: 2px; background: hsl(calc(var(--theme-h) + 9) calc(55% * var(--theme-s)) 13%); }
.game-window .tabs:not(.config-tabs) + .window-body,
.game-window .tabs:not(.config-tabs) ~ .window-body { padding-top: 10px; }

/* Settings → Graphics: main quality slider (Low / Medium / High) and segmented level pickers. */
.graphics-settings { margin-bottom: 14px; }
.graphics-preset { max-width: 460px; margin: 8px 0 4px; }
.graphics-preset input[type=range] { width: 100%; accent-color: var(--accent); }
.graphics-preset input[type=range].custom { opacity: .45; }
.graphics-preset-labels { display: flex; justify-content: space-between; margin-top: 2px; }
.graphics-preset-labels button.link { background: none; border: none; padding: 2px 4px; color: var(--muted); }
.graphics-preset-labels button.link.active { color: var(--accent); font-weight: 600; background: none; }
.graphics-preset-summary { margin-top: 6px; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; margin: 6px 0 4px; }
.segmented button { border: none; border-radius: 0; padding: 5px 16px; }
.segmented button + button { border-left: 1px solid var(--border); }

/* ---------------------------------------------------------------- hangar: sell box (numeric box, -1 / +1, All, red sell) */
.sell-amount-row { display: flex; align-items: stretch; gap: 4px; margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .08); }
input.sell-amount { width: 84px; min-width: 0; flex: 1 1 auto; padding: 3px 6px; font: inherit; color: var(--text);
  background: hsl(calc(var(--theme-h) + 7) calc(58% * var(--theme-s)) 11%); border: 1px solid var(--border); border-radius: 4px;
  -moz-appearance: textfield; appearance: textfield; }
input.sell-amount::-webkit-outer-spin-button, input.sell-amount::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input.sell-amount:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .25); }
.sell-amount-row button { padding: 3px 8px; }
.sell-amount-row button.step { min-width: 34px; font-variant-numeric: tabular-nums; }
button.sell-confirm { display: block; width: 100%; margin-top: 6px; padding: 6px 10px; font-weight: 600;
  background: #8a1f1f; border-color: rgba(255, 110, 110, .6); color: #fff; }
button.sell-confirm:hover { background: #a82a2a; }

/* ---------------------------------------------------------------- shop: model level preview (ships 1..3, drones 1..6) */
.preview-levels { display: flex; align-items: center; gap: 4px; justify-content: center; margin: 4px 0 6px; flex-wrap: wrap; }
.preview-levels .muted { font-size: .72rem; margin-right: 4px; }
button.preview-level { min-width: 30px; padding: 2px 8px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- boosters: administrator switch */
.booster-tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.booster-tile { display: flex; flex: 1 1 110px; min-width: 0; flex-direction: column; gap: 4px; padding: 7px; border: 1px solid var(--border);
  border-top-color: var(--booster-color); border-radius: 4px; background: var(--panel); font-size: .72rem; }
.booster-total b { color: var(--booster-color); font-size: .86rem; }
.booster-tile-title { display: flex; gap: 4px; align-items: center; overflow-wrap: anywhere; }
.booster-time { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.booster-tile.paused { opacity: .6; }
.booster-tile.paused .booster-time b { text-decoration: line-through; }
button.booster-toggle { padding: 3px; font-size: .7rem; }
button.booster-toggle.on { background: #5a1a1a; border-color: rgba(255, 110, 110, .5); }
button.booster-toggle.off { background: #1d4a2a; border-color: rgba(120, 230, 150, .5); }

/* ---------------------------------------------------------------- name tags: average drone level after the letters */
.drone-letters .drone-level { color: var(--muted); letter-spacing: 0; font-weight: 600; }

/* ---------------------------------------------------------------- tooltips (ui.js section 6) */
/* One look for every hover hint of the UI: the hangar hover card style in the UI colour of the settings panel. */
.ui-tooltip { position: fixed; left: 0; top: 0; z-index: 1000; max-width: 320px; pointer-events: none; opacity: 0;
  transition: opacity .12s ease-out; white-space: pre-line; overflow-wrap: anywhere;
  background: hsl(calc(var(--theme-h) + 5) calc(67% * var(--theme-s)) 9% / .97); color: var(--text);
  border: 1px solid var(--accent); border-radius: 6px; padding: 5px 9px; font: 400 .78rem/1.35 "Segoe UI", system-ui, sans-serif;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5), 0 0 0 1px hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .15) inset; }
.ui-tooltip.visible { opacity: 1; }
.ui-tooltip-stat { margin-right: .45em; padding: 0 .25em; border: 1px solid #b58cff; border-radius: 3px;
  color: #e6d8ff; background: #563481; font-size: .72em; font-weight: 700; vertical-align: .08em; }

/* ---------------------------------------------------------------- toolbar honeycombs (PanelToolbar, Services/HexLayout) */
/* Two movable honeycombs on the left in the middle of the screen (their default place): HUD panels, then the windows.
   Pointy-top hexagons, rows 1, 2, 1, 2, ... — the slanted lower edges of a row interlock with the row below. Only an
   icon on every button; its name is the tooltip. */
.hex-dock { position: absolute; top: 50%; transform: translateY(-50%); z-index: 6; display: flex; flex-direction: column;
  align-items: center; gap: 2px; padding: 2px; }
.hex-dock.hex-hud { left: 8px; }
.hex-dock.hex-windows { left: 118px; }
.hex-grip { width: 100%; text-align: center; font-size: .8rem; line-height: 1; color: var(--muted); cursor: move; user-select: none;
  padding: 2px 0; border-radius: 4px; }
.hex-grip:hover { color: var(--text); background: hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .15); }
.hex-dock.dragging .hex-grip { color: var(--accent); }
.hex-grid { position: relative; }
.hex-cell { position: absolute; }
/* The hexagon: the outer clip is the border (theme colour), ::before the fill; children (icon) above it. */
:is(button.hex, .launcher-status) { position: relative; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: var(--border);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: background .12s, color .12s, transform .12s; }
:is(button.hex, .launcher-status)::before { content: ""; position: absolute; inset: 1.5px; background: var(--panel);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); transition: background .12s; }
button.hex .hex-icon { position: relative; font-size: 1.15rem; line-height: 1; filter: saturate(.85); }
button.hex:hover { background: var(--accent); color: var(--text); }
button.hex:hover::before { background: hsl(calc(var(--theme-h) + 4) calc(66% * var(--theme-s)) 22% / .95); }
/* HUD honeycomb: a shown panel is lit; window honeycomb: the open window is filled with the theme colour. */
button.hex.toggle.active { background: var(--accent); color: var(--text); }
/* Active: a lit rim that dims towards the centre (the icon stays readable on a dark core). */
button.hex.toggle.active::before { background: radial-gradient(circle at 50% 50%,
  hsl(calc(var(--theme-h) + 4) calc(66% * var(--theme-s)) 14% / .96) 0%,
  hsl(calc(var(--theme-h) + 4) calc(66% * var(--theme-s)) 18% / .95) 48%,
  hsl(var(--theme-h) calc(100% * var(--theme-s)) 45% / .55) 78%,
  hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .75) 100%); }
button.hex.toggle:not(.active) .hex-icon { opacity: .55; }
button.hex.active:not(.toggle) { background: var(--accent); }
button.hex.active:not(.toggle)::before { background: radial-gradient(circle at 50% 50%,
  hsl(calc(var(--theme-h) + 4) calc(66% * var(--theme-s)) 13% / .97) 0%,
  hsl(calc(var(--theme-h) + 4) calc(66% * var(--theme-s)) 17% / .96) 45%,
  hsl(var(--theme-h) calc(100% * var(--theme-s)) 45% / .6) 76%,
  hsl(var(--theme-h) calc(100% * var(--theme-s)) 68% / .85) 100%); }
button.hex.active .hex-icon { filter: none; text-shadow: 0 0 6px hsl(var(--theme-h) calc(100% * var(--theme-s)) 70% / .9); }
button.hex.admin-toggle { background: var(--warn); color: var(--warn); }
button.hex.admin-toggle.active::before { background: hsl(40 90% 45% / .85); }
.hex-badge { position: absolute; right: -2px; top: 4px; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--warn);
  color: hsl(calc(var(--theme-h) + 4) calc(84% * var(--theme-s)) 7%); font-size: .68rem; font-weight: 700; text-align: center;
  line-height: 16px; pointer-events: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }

.pilot-rank-icon { width: 18px; height: 18px; vertical-align: middle; }
.ranking-window { width: min(680px, 94vw); }
.ranking-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ranking-controls select { margin-inline-start: 6px; }
.ranking-window table { width: 100%; border-collapse: collapse; }
.ranking-window :is(th, td) { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: start; }
.ranking-window .ranking-faction { width: 1%; text-align: center; white-space: nowrap; }
.ranking-window :is(th, td):last-child { text-align: end; font-variant-numeric: tabular-nums; }
.chat-moderation { display: inline-flex; gap: 3px; margin-inline-start: 5px; }
.chat-moderation button { font-size: .7rem; padding: 1px 4px; }

/* Settings → Interface: preview of the action log look. */
.notification-preview { display: flex; flex-direction: column; align-items: center; padding: 6px; margin-top: 4px; line-height: 1.15;
  background: rgba(0, 0, 0, .25); border-radius: 4px;
  text-shadow: -1px -1px 0 var(--log-outline), 1px -1px 0 var(--log-outline), -1px 1px 0 var(--log-outline), 1px 1px 0 var(--log-outline); }

/* Hover card taller than the screen: ui.js (8) sets --card-cols and .wrapped; the rows flow into several columns. */
.item-card.floating.wrapped { width: calc(var(--card-w, 280px) * var(--card-cols, 1)); max-width: calc(100vw - 12px); }
.item-card.floating.wrapped > .item-card-body { column-count: var(--card-cols, 1); column-gap: 16px; column-fill: balance; }
.item-card.floating.wrapped > .item-card-body > * { break-inside: avoid; }
.item-card.floating.wrapped .item-card-title, .item-card.floating.wrapped .item-card-head { column-span: all; }
.item-card.floating { --card-w: 280px; }
.item-card.floating.stat-card { --card-w: 340px; }
.item-card.floating.interactive { --card-w: 300px; }

/* Galaxy Gates: multiplier (duplicate parts) above the DRAW button. */
.gg-multiplier { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 6px 0; padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: .8rem; }
.gg-multiplier.has { border-color: #ffc94d; box-shadow: 0 0 8px rgba(255, 201, 77, .35); }
.gg-multiplier.has .gg-multiplier-value b { color: #ffc94d; }
.gg-multiplier-use { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }

/* Hull / shield bars above ships / aliens in the game shrink from both outer edges towards the middle (the nano layer is
   centred the same way). The bars of the panels (ship, target, group) fill from left to right. */
.hp-bar > div { margin-left: auto; margin-right: auto; }
.hp-bar.hull > .nano { left: 50%; transform: translateX(-50%); margin: 0; }

/* ---- Ship / pilot panels: two columns (name | value). A click on a value switches numbers <-> bar. ---- */
.stat-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; align-items: center; margin-top: 4px; }
.stat-label { color: var(--muted); white-space: nowrap; }
.stat-value { justify-self: end; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 0; }
button.stat-value { background: none; border: 0; padding: 1px 2px; margin: 0; font: inherit; color: inherit; cursor: pointer; border-radius: 3px; }
.stat-click:hover { background: rgba(120, 180, 255, .12); }
.stat-click:has(.stat-bar) { justify-self: stretch; }
.stat-bar { display: block; position: relative; width: 100%; min-width: 90px; height: 9px; }
.stat-bar > span { position: absolute; left: 0; top: 0; height: 100%; transition: width .15s linear; }
.stat-bar.hp > span { background: #58d68d; }
.stat-bar.hp > span.nano { background: #f4d03f; box-shadow: 0 0 6px rgba(244, 208, 63, .6); }
.stat-bar.shield > span { background: var(--shield); }
.stat-bar.xp > span { background: #b58cff; }
.config-switch { color: #e4d6ff; font-weight: 600; border: 1px solid #b58cff !important; padding: 0 8px !important; }
.pilot-user { display: inline-flex; align-items: center; gap: 6px; }
.pilot-user .copied { color: var(--ok); font-size: .75rem; }
.hud .status-tags { margin-top: 6px; }

/* ---- One grip for every movable panel (the same ⠿ as the toolbar honeycombs). Drag = move, double click = default place. ---- */
.panel-grip { color: var(--muted); cursor: move; user-select: none; font-size: .8rem; line-height: 1; letter-spacing: 0; border-radius: 4px; }
.panel-grip:hover { color: var(--text); background: hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .15); }
.panel-grip.inline { display: inline-block; padding: 1px 3px; margin-right: 2px; }
.drag-strip.panel-grip { padding: 1px 4px; }
.dragging .panel-grip, .dragging .hex-grip { color: var(--accent); }
.panel-title.drag-handle, .tracker-title.drag-handle { cursor: move; }

/* ---------------------------------------------------------------- action bars as honeycombs */
/* The bars block is a movable panel: grip + gear on the left, bar 2 above bar 1; the honeycomb item menu opens above
   bar 2 without moving the bars (absolute, grows upwards). */
.bottom-bars { align-items: stretch; }
.bars-side { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 0; }
.bars-side .hex-grip { width: auto; padding: 2px 3px; }
.bars-gear { width: 22px; height: 22px; padding: 2px; border: 0; background: transparent; color: var(--muted); border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: color .12s, transform .3s; }
.bars-gear svg { width: 100%; height: 100%; }
.bars-gear:hover { color: var(--text); transform: rotate(45deg); }
.bars-gear.active { color: var(--accent); transform: rotate(90deg); }
.bottom-bars .bars { position: relative; }
.bottom-bars > .item-menu { display: none; }

.hex-item-menu { position: absolute; left: 0; bottom: calc(100% + 6px); display: flex; flex-direction: column; gap: 2px; z-index: 6;
  pointer-events: none; }
.hex-item-menu .hex-row { display: flex; flex-wrap: wrap-reverse; gap: 0 3px; pointer-events: auto; max-width: 640px; }
.hex-item-menu .hex-row.hex-items { padding-left: 26px; } /* half a cell to the right: the rows interlock like a honeycomb */
.hex-cell-inline { width: 52px; height: 58px; margin-bottom: -10px; }
.hex-item-menu .hex-row:last-child .hex-cell-inline { margin-bottom: 0; }
.hex-item-menu .hex-empty { align-self: center; padding: 4px 8px; font-size: .75rem; background: var(--panel); border-radius: 4px; }
.hex-category .cat-svg { width: 26px; height: 26px; color: #ff9f3d; filter: drop-shadow(0 0 3px rgba(255, 140, 40, .65)); }
button.hex.toggle.hex-category:not(.active) .hex-icon { opacity: .8; }
button.hex.hex-category.active .cat-svg { color: #ffc070; }
:is(button.hex.hex-item, .launcher-status) { flex-direction: column; justify-content: center; }
button.hex.hex-item { cursor: grab; }
button.hex.hex-item:active { cursor: grabbing; }
:is(button.hex.hex-item, .launcher-status) .hex-item-icon { position: relative; width: var(--hex-icon-size, 28px); height: var(--hex-icon-size, 28px); border: none; background: transparent; box-shadow: none; pointer-events: none; }
:is(button.hex.hex-item, .launcher-status) .hex-item-icon :is(svg, img) { width: 100%; height: 100%; }
button.hex.hex-item .hex-stock { position: absolute; top: 9px; left: 30%; right: 30%; height: 3px; background: #46d3f0; box-shadow: 0 0 4px #46d3f0; }
:is(button.hex.hex-item, .launcher-status) .hex-count { position: relative; font-size: .6rem; color: var(--text); text-shadow: 0 0 3px #000; max-width: 44px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.launcher-status { --hex-icon-size: 22px; }
.launcher-rounds { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 40px; }
.launcher-round { width: 5px; height: 5px; border: 1px solid var(--muted); border-radius: 50%; }
.launcher-round.loaded { background: var(--rocket-color); border-color: var(--rocket-color); box-shadow: 0 0 3px var(--rocket-color); }
button.hex.hex-item.active { background: var(--accent); }
button.hex.hex-item.rocket.active { background: #f5a13a; }
button.hex.hex-item.formation.active { background: #b98cff; }
button.hex.hex-item.empty .hex-item-icon, button.hex.hex-item.empty .hex-stock { opacity: .4; }

/* Slots: pointy-top hexagons (outer clip = border colour, ::before = fill), the same look as the toolbar honeycombs. */
.action-bar { padding: 4px 6px; }
.action-bar .slots { gap: 3px; }
.action-bar .slot { width: 54px; height: 62px; padding: 0; border: 0; border-radius: 0; overflow: visible; justify-content: center;
  background: var(--border); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.action-bar .slot::before { content: ""; position: absolute; inset: 1.5px; z-index: 0; background: hsl(calc(var(--theme-h) + 5) calc(67% * var(--theme-s)) 13%);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); transition: background .12s; }
.action-bar .slot:hover { background: var(--accent); }
.action-bar .slot:hover::before { background: hsl(calc(var(--theme-h) + 4) calc(66% * var(--theme-s)) 24%); }
.action-bar .slot.active { background: var(--accent); }
.action-bar .slot.active::before { background: radial-gradient(circle at 50% 50%,
  hsl(calc(var(--theme-h) + 4) calc(66% * var(--theme-s)) 14% / .96) 0%,
  hsl(calc(var(--theme-h) + 4) calc(66% * var(--theme-s)) 18% / .95) 50%,
  hsl(var(--theme-h) calc(100% * var(--theme-s)) 45% / .6) 82%,
  hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .8) 100%); }
.action-bar .slot.rocket.active { background: #f5a13a; }
.action-bar .slot.formation.active { background: #b98cff; }
.action-bar .slot.cpu.active { background: #b58cff; box-shadow: none; }
.action-bar .slot.attacking { background: var(--hp); box-shadow: none; }
.action-bar .slot.empty-slot { background: hsl(var(--theme-h) calc(40% * var(--theme-s)) 40% / .45); }
.action-bar .slot.empty-slot::before { background: rgba(0, 0, 0, .45); }
.action-bar .slot > * { z-index: 1; }
.action-bar .slot .key { left: 50%; top: 7px; transform: translateX(-50%); font-size: .58rem; }
.action-bar .slot .slot-icon { top: 15px; width: 28px; height: 28px; }
.action-bar .slot .count { position: absolute; bottom: 12px; left: 8px; right: 8px; text-align: center; font-size: .58rem; }
.action-bar .slot .slot-icon, .action-bar .slot .count { transition: filter .22s, opacity .22s; }
.action-bar .slot.reloading :is(.slot-icon, .count) { filter: grayscale(1); opacity: .6; }
.action-bar .slot.reloading { background: var(--muted); }
.action-bar .slot.ready .slot-icon { filter: drop-shadow(0 0 4px var(--accent)); }
.action-bar .slot.ready.rocket .slot-icon { filter: drop-shadow(0 0 4px #f5a13a); }
.action-bar .cooldown-fill { left: 6px; bottom: 9px; height: 3px; max-width: calc(100% - 12px); }
.action-bar .bar-number { align-self: center; }

/* Bars without a panel background or bar numbers: only the honeycomb slots. Short hover popup above a slot. */
.bottom-bars .action-bar { position: relative; background: transparent; border: 0; padding: 0; backdrop-filter: none; box-shadow: none; }
/* The hovered bar (and its popup) is drawn above the other bar, the grip column and the honeycomb menu. */
.bottom-bars .action-bar:hover { z-index: 20; }
.action-bar .slot-tip.edge-left { transform: none; }
.bottom-bars .action-bar .bar-number { display: none; }
.action-bar .slot-tip, .hex-item-menu .slot-tip { position: absolute; bottom: calc(100% + 6px); transform: translateX(-50%); z-index: 8; pointer-events: none;
  min-width: 90px; max-width: 260px; padding: 5px 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 5px;
  font-size: .72rem; line-height: 1.35; white-space: normal; width: max-content; overflow-wrap: anywhere;
  text-align: left; backdrop-filter: blur(4px); }
.action-bar .slot-tip-name, .hex-item-menu .slot-tip-name { font-weight: 700; color: var(--text); }
.action-bar .slot-tip-line, .hex-item-menu .slot-tip-line { color: var(--muted); }
.action-bar .slot-tip-line.good, .hex-item-menu .slot-tip-line.good { color: #5fe07a; }
.action-bar .slot-tip-line.bad, .hex-item-menu .slot-tip-line.bad { color: #ff6464; }
/* Item menu: the popup sits centred above the hovered honeycomb. */
.hex-item-menu .hex-cell-inline { position: relative; }
.hex-item-menu .slot-tip { left: 50%; bottom: calc(100% + 4px); z-index: 9; }
/* Gear: never the generic blue button fill (button.active) - only the icon colour changes. */
.bars-gear, .bars-gear:hover, .bars-gear.active { background: transparent; border: 0; box-shadow: none; }

/* Hangar opened outside a safe zone: selling / equipping / changing the ship is refused by the server. */
.safe-zone-only { margin: 6px 10px 0; padding: 5px 9px; border: 1px solid rgba(255, 190, 70, .55); border-radius: 4px;
  background: rgba(255, 170, 40, .12); color: #ffd27a; font-size: .78rem; }

/* ------------------------------------------------------------------ tutorial (starter missions) */
.tutorial-bubble { grid-column: 1 / -1; z-index: 30; width: min(340px, 100%); pointer-events: auto;
  padding: 8px 12px 10px; border: 1px solid #ffcf4d; border-radius: 8px; box-shadow: 0 0 18px rgba(255, 207, 77, .35);
  animation: tutorial-in .35s ease-out; }
.tutorial-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tutorial-badge { font-size: .72rem; font-weight: 700; letter-spacing: .4px; color: #ffcf4d; text-transform: uppercase; }
.tutorial-bubble .close { background: transparent; border: 0; color: var(--muted); cursor: pointer; }
.tutorial-text { font-size: .86rem; line-height: 1.4; }
.tutorial-benefit { margin-top: 6px; font-size: .78rem; color: #8ff0a4; }
/* "Show tutorial" button:
   the reward log moves down a little while it is there. */
.tutorial-show { grid-column: 1 / -1; z-index: 30; white-space: nowrap; pointer-events: auto;
  border: 1px solid #ffcf4d; background: var(--panel); color: #ffcf4d; cursor: pointer; }
@keyframes tutorial-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* World arrow (scene.js): at the screen edge pointing to the target, or bouncing above it. */
.tutorial-arrow { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; width: 0; height: 0; }
.tutorial-arrow-head { position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; display: flex; align-items: center;
  justify-content: center; font-size: 28px; color: #ffcf4d; text-shadow: 0 0 8px rgba(255, 190, 40, .9), 0 0 2px #000; }
.tutorial-arrow-label { position: absolute; left: -12px; top: -46px; width: 24px; text-align: center; font-weight: 800; font-size: .9rem;
  color: #ffcf4d; text-shadow: 0 0 4px #000; }
.tutorial-arrow:not(.on-target) .tutorial-arrow-label { top: -40px; }
.tutorial-arrow.on-target .tutorial-arrow-head { animation: tutorial-bounce .8s ease-in-out infinite; }
.tutorial-arrow:not(.on-target) .tutorial-arrow-head { animation: tutorial-pulse 1s ease-in-out infinite; }
@keyframes tutorial-bounce { 0%, 100% { margin-top: -6px; } 50% { margin-top: 4px; } }
@keyframes tutorial-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* Interface element to click (scene.js setUiGuide): pulsing golden frame + arrow. */
.tutorial-highlight { outline: 2px solid #ffcf4d !important; outline-offset: 2px; animation: tutorial-glow 1s ease-in-out infinite; }
@keyframes tutorial-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 207, 77, .0); } 50% { box-shadow: 0 0 14px 4px rgba(255, 207, 77, .65); } }
.tutorial-ui-arrow { position: fixed; z-index: 200; pointer-events: none; transform: translateX(-50%); font-size: 30px; color: #ffcf4d;
  text-shadow: 0 0 8px rgba(255, 190, 40, .9), 0 0 2px #000; animation: tutorial-bounce .8s ease-in-out infinite; }

/* ---------------------------------------------------------------- P.E.T. (panel, hangar tab, shop, name tags) */
.pet-panel { position: absolute; right: 12px; bottom: 268px; width: 236px; font-size: .78rem; display: flex; flex-direction: column;
  gap: 4px; z-index: 4; }
.pet-panel .panel-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pet-panel .pet-status { margin-left: auto; }
.pet-bars { display: flex; flex-direction: column; gap: 2px; }
.pet-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pet-actions, .pet-modes, .pet-passives { display: flex; flex-wrap: wrap; gap: 4px; }
.pet-panel button.small { padding: 2px 8px; font-size: .72rem; }
.pet-panel { width: 290px; } /* frame: the shared .panel look (it was designed on this panel) */
.pet-main { display: flex; gap: 8px; align-items: center; }
.pet-portrait { position: relative; width: 58px; height: 58px; flex: none; border: 1px solid #5a8fb0; background: radial-gradient(circle, #1d3d58, #081521); }
.pet-portrait .item-icon { width: 100%; height: 100%; }
.pet-portrait-level { position: absolute; right: 2px; bottom: 0; font-weight: 700; font-size: .72rem; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.pet-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pet-name { text-align: center; font-weight: 700; color: #e6f2ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.pet-stat { display: flex; align-items: center; gap: 4px; min-width: 0; }
button.pet-stat { background: none; border: 0; padding: 1px 2px; margin: 0; font: inherit; color: inherit; cursor: pointer; border-radius: 3px; text-align: left; }
.pet-stat-text { flex: 1; min-width: 0; font-size: .75rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-stat-icon { width: 1.7em; text-align: center; color: #e9c48a; font-size: .8rem; flex: none; }
.pet-stat-icon.bad { filter: grayscale(1); opacity: .5; }
.pet-gauge { flex: 1; height: 6px; background: #05080c; border: 1px solid #23313d; }
.pet-gauge > div { height: 100%; transition: width .25s; }
.pet-gauge.hp > div { background: #3ee04a; }
.pet-gauge.fuel > div { background: #f2f2f2; }
.pet-gauge.shield > div { background: #3aa8ff; }
.pet-gauge.xp > div { background: #e12a2a; }
.pet-controls { display: flex; align-items: center; gap: 6px; }
.pet-panel button.pet-big-btn, .pet-panel button.pet-fuel-btn { height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #6b7b86, #2f3a42); border: 1px solid #1a2228; border-radius: 3px; }
.pet-panel button.pet-big-btn { width: 54px; }
.pet-panel button.pet-big-btn.repair { width: auto; padding: 0 4px; gap: .2em; font-size: .75rem; }
.pet-panel button.pet-fuel-btn { width: 36px; font-size: .8rem; }
.pet-fuel-btn b { color: #fff; margin-left: 1px; }
.pet-stop { width: 14px; height: 14px; background: #f5e6a8; border: 1px solid #b89a3c; }
.pet-play { width: 0; height: 0; border-left: 13px solid #f5e6a8; border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.pet-power { color: #8a6a1e; font-size: 1rem; }
.pet-power.on { color: #ffb21e; text-shadow: 0 0 6px rgba(255, 178, 30, .7); }
.pet-gear-select { flex: 1; min-width: 0; font-size: .72rem; background: #0c0f12; color: #e0e0e0; border: 1px solid #3a4650; }
.pet-mode.active { border-color: #b98cff; color: #d9c4ff; box-shadow: 0 0 6px rgba(185, 140, 255, .45); }
.pet-locator { display: flex; align-items: center; gap: 6px; }
.pet-locator select { flex: 1; min-width: 0; font-size: .72rem; }
.pet-locator-found { display: inline-flex; align-items: center; gap: 4px; color: #d9c4ff; white-space: nowrap; }
.pet-arrow { display: inline-block; transition: transform .3s linear; }
.pet-hangar.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px; text-align: center; }
.pet-summary { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.pet-summary .item-icon.large { width: 150px; height: 150px; flex: none; }
.pet-summary-stats { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pet-summary-stats button { align-self: flex-start; margin-top: 4px; }
.pet-slot-group .equip-slot.locked { opacity: .45; cursor: help; }
/* Next slot of the current P.E.T. level: bought with a click (uridium price shown in the corner). */
.pet-slot-group .equip-slot.locked.buyable { opacity: .85; cursor: pointer; border-style: dashed; border-color: rgba(120, 200, 255, .6); }
.pet-slot-group .equip-slot.locked.buyable:hover { background: rgba(120, 200, 255, .12); }
.pet-slot-group .equip-slot.locked.buyable .upgrade { font-size: 10px; white-space: nowrap; }
.pet-slot-group .slot-group-actions { white-space: nowrap; }
.pet-slot-group .equip-slot.filled { cursor: pointer; position: relative; }
/* P.E.T. tab statistics: hover a value for its breakdown (like the ship statistics). */
.pet-stat-list { display: flex; flex-direction: column; gap: 1px; }
.stat-breakdown .bd-row.bd-note { display: block; font-size: .7rem; line-height: 1.3; margin-top: 3px; }
.stat-breakdown .bd-row.bd-note > span:first-child { white-space: normal; overflow: visible; }
.pet-hangar .inventory-item.locked { opacity: .45; cursor: not-allowed; }
.pet-hangar .upgrade.bad { color: var(--danger, #ff6b6b); }
.pet-level-block { margin-top: 4px; padding-top: 2px; border-top: 1px solid var(--border); }
.pet-level-block.owned .shop-section { color: var(--ok); }
.name-tag.pet { font-size: .85em; opacity: .9; }
.name-tag.own-pet { color: #d9c4ff; }

/* ---------------------------------------------------------------- hangar: ships screen + manage screen
   Ships screen: grid of ship tiles + details on the right (small model, statistics, Fly / Manage).
   Manage screen: top bar (Back, configurations 1 / 2, clear configuration, Transfer), SPACESHIP / DRONES / P.E.T. tabs
   and three columns: small model + statistics | collapsible slot sections | inventory + transaction area. */
.hangar-ships-view { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 12px; grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.hangar-ships-view .hangar-ships { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; height: 100%; overflow: auto; padding-right: 4px; }
.hangar-ships-view .hangar-ship { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px 8px; text-align: center; }
.hangar-ships-view .hangar-ship .item-icon { float: none; margin: 0; }
.hangar-ships-view .hangar-ship .name { max-width: 100%; font-size: .7rem; letter-spacing: .4px; text-transform: uppercase;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hangar-ship .ship-check { position: absolute; right: 6px; bottom: 4px; color: var(--ok); font-weight: 700; font-size: .9rem; }
.hangar-ship-detail { display: flex; flex-direction: column; gap: 6px; height: 100%; min-height: 0; overflow: auto;
  border-left: 1px solid var(--border); padding-left: 12px; }
.hangar-ship-detail .detail-name { font-weight: 700; font-size: .95rem; letter-spacing: .6px; text-transform: uppercase; }
.hangar-ship-detail .detail-state { text-align: center; margin-top: 4px; }
.hangar-ship-detail .detail-state.active { font-size: 1.35rem; font-weight: 800; letter-spacing: 2px; color: var(--text); }
.hangar-ship-detail .detail-action { width: 100%; }
.hangar-ship-detail button.primary, .transaction-buttons button:not(.danger):not(:disabled):hover { border-color: var(--accent); }
.hangar-ship-detail button.primary { background: var(--accent); color: hsl(calc(var(--theme-h) + 4) calc(84% * var(--theme-s)) 7%); font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase; }

/* Model: deliberately small (a hint of the ship / drone / P.E.T., not the main part of the screen). */
.item-icon.equip-preview { width: 100%; height: 150px; border-radius: 8px;
  background: radial-gradient(ellipse at 50% 45%, hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .22), hsl(calc(var(--theme-h) + 9) calc(75% * var(--theme-s)) 3% / .95) 72%); }

.hangar-toolbar { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex: none; }
.hangar-toolbar button { padding: 3px 10px; font-size: .78rem; }
.hangar-toolbar .back { font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.hangar-toolbar .ship-name { font-weight: 600; font-size: .95rem; }
.config-switch { display: inline-flex; gap: 3px; margin-left: 6px; }
.hangar-toolbar .config-switch button { position: relative; min-width: 30px; padding: 2px 8px; font-weight: 700; }
.config-switch .in-use { position: absolute; top: -5px; right: -3px; font-size: .62rem; color: #ffcf4d; }
.hangar-toolbar .clear-config { display: inline-flex; gap: 6px; align-items: center; }
.hangar-toolbar .clear-config.confirm { border-color: var(--hp); color: var(--hp); }

.hangar-grid.equip-grid { grid-template-columns: 180px minmax(0, 1fr) 270px; }
.equip-model { display: flex; flex-direction: column; gap: 6px; height: 100%; min-height: 0; overflow: auto; padding-right: 2px; }
.equip-model > button { align-self: stretch; }
.equip-stats { display: flex; flex-direction: column; gap: 1px; font-size: .76rem; }
.equip-stats .stat-row { gap: 6px; }
.equip-stats .stat-row b { text-align: right; }
.equip-stats .stat-hover { cursor: help; }
.equip-stats .stat-hover:hover > span { color: var(--accent); }
.pet-hangar .equip-model .hangar-ship-line { flex-wrap: wrap; gap: 4px; }
.pet-hangar .equip-stats button { align-self: stretch; margin-top: 3px; }

.slot-group.equip-section { border: 1px solid var(--border); border-radius: 4px; padding: 0; margin-bottom: 6px; overflow: hidden; }
.slot-group.equip-section.drop-ready { border-style: dashed; border-color: var(--accent); }
.section-head { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-bottom: 1px solid var(--border);
  background: hsl(calc(var(--theme-h) + 4) calc(67% * var(--theme-s)) 18% / .85); }
.equip-section.collapsed .section-head { border-bottom: none; }
.section-head .section-toggle { flex: 1; padding: 0; border: none; background: none; text-align: left; color: var(--text); font-weight: 600;
  font-size: .74rem; letter-spacing: .6px; text-transform: uppercase; }
.section-head .section-toggle:hover { background: none; color: var(--accent); }
.section-head .caret { margin-right: 4px; font-size: .62rem; color: #ffcf4d; }
.section-head .section-title { flex: 1; font-weight: 600; font-size: .74rem; letter-spacing: .6px; text-transform: uppercase; }
.section-actions { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.equip-section .slot-row { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 4px; margin: 0; padding: 6px; }
.equip-section .equip-slot { min-height: 52px; }
.equip-slot.selected, .inventory-item.selected { border-color: #ffcf4d; box-shadow: inset 0 0 0 1px #ffcf4d; }
.equip-slot.filled { cursor: pointer; }

.hangar-grid .hangar-inventory.equip-inventory { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.equip-inventory .inventory-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; padding-right: 2px; }
.equip-inventory .inventory-grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
.equip-inventory .inventory-item .item-icon { width: 48px; height: 48px; }
.transaction-area { flex: none; display: flex; flex-direction: column; gap: 4px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.transaction-price { display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px;
  font-size: .78rem; background: hsl(calc(var(--theme-h) + 9) calc(75% * var(--theme-s)) 3% / .5); }
.transaction-price .transaction-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transaction-price b { color: #ffcf4d; white-space: nowrap; }
.transaction-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.transaction-buttons button { padding: 3px 6px; font-size: .76rem; text-transform: uppercase; letter-spacing: .4px; }
.transaction-buttons button.danger:not(:disabled) { background: rgba(122, 28, 28, .8); border-color: rgba(255, 110, 110, .6); color: #fff; }
.transaction-buttons button.danger:not(:disabled):hover { background: #a32626; }

/* Drones: one row per drone — picture + name | slots | level, effect, points (like the classic drone list). */
.drones-grid .drones-head { margin-bottom: 6px; border: 1px solid var(--border); border-radius: 4px; }
.drones-grid .drone-list { display: flex; flex-direction: column; gap: 4px; }
.drone-row { display: grid; grid-template-columns: 86px auto 54px minmax(0, 1fr); align-items: center; gap: 8px; padding: 4px 6px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 4px; }
.drone-row:hover { border-color: var(--accent); }
.drone-row.selected { border-color: var(--accent); background: hsl(var(--theme-h) calc(100% * var(--theme-s)) 65% / .1); }
.drone-row.drop-ready { border-style: dashed; }
.drone-row .drone-id { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; font-size: .74rem; letter-spacing: .4px; text-transform: uppercase; }
.drone-row .drone-id .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drone-row .drone-slots { display: flex; gap: 4px; }
.drone-row .drone-slots .equip-slot { width: 52px; height: 52px; min-height: 52px; }
.drone-row .drone-info { padding-left: 8px; border-left: 1px solid var(--border); font-size: .74rem; line-height: 1.4; }
.drone-row .drone-info .effect { color: #6fe0ff; }
.drone-design-control { display: grid; justify-items: center; gap: 2px; font-size: .65rem; }
.drone-design-control .equip-slot { width: 52px; height: 52px; min-height: 52px; border-color: var(--accent); }

/* ---------------------------------------------------------------- unified panel frame
   Every panel, game window, hover card and tooltip has the look of the P.E.T. panel (--panel-fill, --panel-edge, glows;
   see :root) and corners cut at 45° instead of rounded ones. Browsers with corner-shape draw the cut with the border and
   the glow following it; the others clip the box (clip-path) and draw the diagonal edges with small gradients. Panels
   with their own colour (death, tutorial, countdown banners) keep it — only the shape is shared. */
.item-card.floating, .ui-tooltip, .level-tooltip, .action-bar .slot-tip, .hex-item-menu .slot-tip, .panel-toolbar, .connection-status {
  background: var(--panel-fill); border-color: var(--panel-edge); }
.item-card.floating { box-shadow: 0 6px 20px rgba(0, 0, 0, .5), 0 0 10px var(--panel-glow), inset 0 0 18px var(--panel-inner-glow); }
.ui-tooltip, .level-tooltip, .action-bar .slot-tip, .hex-item-menu .slot-tip { --cut: 5px; box-shadow: 0 4px 14px rgba(0, 0, 0, .5), inset 0 0 12px var(--panel-inner-glow); }
.panel-toolbar, .connection-status, .destroyed-banner, .countdown-banner { --cut: 6px; box-shadow: 0 0 10px var(--panel-glow), inset 0 0 14px var(--panel-inner-glow); }
.destroyed-banner { background: var(--panel-fill); }

@supports (corner-shape: bevel) {
  .panel, .item-card.floating, .ui-tooltip, .level-tooltip, .action-bar .slot-tip, .hex-item-menu .slot-tip, .panel-toolbar,
  .connection-status, .destroyed-banner, .countdown-banner { border-radius: var(--cut); corner-shape: bevel; }
}

@supports not (corner-shape: bevel) {
  .panel, .item-card.floating, .ui-tooltip, .level-tooltip, .action-bar .slot-tip, .hex-item-menu .slot-tip, .panel-toolbar,
  .connection-status, .destroyed-banner, .countdown-banner {
    border-radius: 0;
    clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)),
      calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
  }
  /* The diagonal edges of the cut (the straight ones are the normal border). */
  .panel, .item-card.floating, .panel-toolbar {
    background:
      linear-gradient(to bottom right, transparent 50%, var(--panel-edge) 50%, var(--panel-edge) calc(50% + 1px), transparent calc(50% + 1px)) left top / var(--cut) var(--cut) no-repeat border-box,
      linear-gradient(to bottom left, transparent 50%, var(--panel-edge) 50%, var(--panel-edge) calc(50% + 1px), transparent calc(50% + 1px)) right top / var(--cut) var(--cut) no-repeat border-box,
      linear-gradient(to top right, transparent 50%, var(--panel-edge) 50%, var(--panel-edge) calc(50% + 1px), transparent calc(50% + 1px)) left bottom / var(--cut) var(--cut) no-repeat border-box,
      linear-gradient(to top left, transparent 50%, var(--panel-edge) 50%, var(--panel-edge) calc(50% + 1px), transparent calc(50% + 1px)) right bottom / var(--cut) var(--cut) no-repeat border-box,
      var(--panel-fill);
  }
}

/* Administrator panel, tab "Suspects" (security audit 2026-10-25): suspects, incidents, sessions and the replay. */
.admin-window.admin-window-wide { width: min(1180px, 96vw); }
.admin-tabs { margin-top: 0; }
.admin-news h2 { margin: 0; font-size: 1rem; }
.news-editor, .news-channels { border: 0; margin: 0; padding: 0; min-width: 0; }
.news-editor { display: grid; gap: 10px; margin-top: 12px; }
.admin-player-table { width: 100%; border-collapse: collapse; margin-block: 8px; }
.admin-player-table :is(th, td) { padding: .45rem .55rem; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; overflow-wrap: anywhere; }
.admin-player-table thead { color: var(--muted); }
.admin-player-table tbody tr:nth-child(odd) { background: color-mix(in srgb, var(--panel), var(--text) 5%); }
.inventory-admin-table .admin-item-id { max-width: 11rem; }
.player-account .account-details { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; }
.player-account .account-details dt { color: var(--muted); }
.player-account .account-details dd { margin: 0; overflow-wrap: anywhere; }
.news-bodies { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.admin-message-editor { min-width: 0; }
.admin-message-editor textarea { resize: vertical; width: 100%; }
.message-toolbar { margin-bottom: 6px; }
.admin-message-editor > button { display: block; margin-top: 6px; }
.message-preview { margin-top: 8px; max-height: 280px; overflow: auto; }
.message-html { overflow-wrap: anywhere; line-height: 1.5; }
.message-html pre { white-space: pre-wrap; }
.auth-card.auth-action-card { width: min(440px, 100%); }
.auth-action-card p { line-height: 1.5; }
.news-publish-time { width: fit-content; }
.news-publish-time input { color-scheme: dark; }
.news-channels { display: flex; flex-wrap: wrap; column-gap: 16px; }
.news-channels legend { padding: 0; margin-bottom: 6px; }
.news-hint { margin: 0; font-size: .82rem; }
.news-history-header, .news-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.news-history-header { justify-content: space-between; }
.news-record { border-top: 1px solid var(--border); margin-top: 8px; padding: 8px 0; }
.news-record-heading { overflow-wrap: anywhere; margin-bottom: 8px; }
.news-record-subject { font-weight: 600; margin-right: 12px; }
.news-record-meta { display: inline-flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .85rem; }
.news-record h3 { margin: 12px 0 2px; font-size: .84rem; color: var(--muted); }
.news-record p { margin: 4px 0 12px; }
.news-deliveries { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 10px; list-style: none; }
.news-deliveries li { border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; font-size: .82rem; }
.suspects-toolbar { margin-top: 6px; }
.suspects-scroll { max-height: 240px; overflow: auto; overscroll-behavior: contain; }
.suspects-scroll.short { max-height: 180px; }
.suspects-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.suspects-table th { position: sticky; top: 0; background: rgba(0, 0, 0, .6); text-align: left; font-weight: 600; color: var(--muted); padding: 3px 6px; }
.suspects-table td { padding: 3px 6px; border-top: 1px solid rgba(255, 255, 255, .06); vertical-align: top; }
.suspects-table tbody tr { cursor: pointer; }
.suspects-table tbody tr:hover { background: rgba(255, 255, 255, .06); }
.suspects-table tr.selected { background: hsl(var(--theme-h) calc(100% * var(--theme-s)) 60% / .18); }
.suspects-table tr.inactive { opacity: .55; }
.suspects-table td.details { max-width: 420px; word-break: break-word; color: var(--muted); }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #666; margin-right: 4px; }
.online-dot.on { background: #3ad36b; box-shadow: 0 0 6px #3ad36b; }
.replay-controls { align-items: center; }
.replay-slider { flex: 1 1 260px; }
.replay-clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .8rem; }
.replay-body { display: flex; gap: 10px; margin-top: 8px; }
.replay-map { flex: 1 1 60%; min-width: 0; aspect-ratio: 3 / 2; background: rgba(0, 0, 0, .45); border: 1px solid var(--border); border-radius: 6px; }
.replay-map-bg { fill: rgba(30, 50, 90, .25); stroke: rgba(255, 255, 255, .15); vector-effect: non-scaling-stroke; }
.replay-trail { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; opacity: .8; }
.replay-ship { fill: #ffd34d; stroke: #1a1205; vector-effect: non-scaling-stroke; }
.replay-shot { stroke: #ff5a4f; stroke-width: 2; vector-effect: non-scaling-stroke; }
.replay-hit { stroke: #b58cff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.replay-side { flex: 1 1 40%; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.replay-state { font-size: .8rem; display: grid; gap: 2px; }
.replay-log { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; font-size: .76rem; }
.replay-log li { display: flex; gap: 6px; padding: 2px 0; border-top: 1px solid rgba(255, 255, 255, .05); }
.replay-log .t { flex: none; width: 58px; color: var(--muted); font-variant-numeric: tabular-nums; }
.replay-log .k { flex: none; width: 92px; font-weight: 600; }
.replay-log .v { min-width: 0; word-break: break-word; }
.replay-log .kind-DamageDealt .k, .replay-log .kind-Kill .k { color: #ff7a6f; }
.replay-log .kind-DamageTaken .k, .replay-log .kind-Death .k { color: #b58cff; }
.replay-log .kind-Incident .k, .replay-log .kind-Rejected .k { color: var(--warn); }
.replay-targets { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; color: var(--muted); }
@media (max-width: 760px) { .replay-body { flex-direction: column; } }

/* Administrator panel: replay tabs (closable) and the right-click copy menu of the suspects tables. */
.admin-replay-tab { display: inline-flex; align-items: center; gap: 6px; }
.admin-tab-close { padding: 0 3px; border-radius: 3px; opacity: .6; }
.admin-tab-close:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
.replay-speed { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); }
.replay-speed input { width: 78px; }
.suspects-table td { user-select: text; }
.orion-copy-menu { position: fixed; z-index: 100000; display: flex; flex-direction: column; min-width: 170px; padding: 4px;
  background: rgba(10, 16, 28, .97); border: 1px solid var(--border, rgba(255, 255, 255, .2)); border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
.orion-copy-menu button { all: unset; cursor: pointer; padding: 5px 10px; border-radius: 4px; font-size: .82rem; color: #e6edf7; }
.orion-copy-menu button:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.orion-copy-menu button:disabled { opacity: .4; cursor: default; }
.suspects-table td.warn { color: var(--warn); font-weight: 600; }

/* Administrator panel: the replay drawn on the world recording (2026-10-25) — the whole map of every second with the
   replayed pilot highlighted (gold, ring), other pilots in their company colour, aliens, P.E.T.s, boxes, shots. Symbol
   sizes come from the view size (they stay readable at every zoom); strokes do not scale. */
.replay-view-controls { align-items: center; margin-top: 4px; }
.replay-view-controls .admin-check { margin-left: 6px; }
.replay-note { margin: 4px 0; }
.replay-loading { font-weight: 400; }
.replay-map { cursor: default; }
.replay-map .rp-label { fill: #dbe7ff; text-anchor: middle; paint-order: stroke; stroke: rgba(0, 0, 0, .75); stroke-width: 3px;
  vector-effect: non-scaling-stroke; pointer-events: none; font-family: inherit; }
.replay-map .rp-me-label { fill: #ffd34d; font-weight: 700; }
.replay-map .rp-npc-label { fill: #ffb3ad; }
.replay-map .rp-portal-label { fill: #9fd0ff; opacity: .8; }
.rp-base { fill: rgba(80, 200, 120, .08); stroke: rgba(80, 200, 120, .45); stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.rp-portal { fill: rgba(79, 163, 255, .12); stroke: #4fa3ff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.rp-pilot, .rp-alien { cursor: pointer; }
.rp-ship { stroke: #0b1220; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.rp-ship.rp-f0 { fill: #b8c2d6; }
.rp-ship.rp-f1 { fill: #4fa3ff; }
.rp-ship.rp-f2 { fill: #ff6b6b; }
.rp-me .rp-ship { fill: #ffd34d; stroke: #1a1205; stroke-width: 2; }
.rp-ship.rp-cloaked { fill-opacity: .35; stroke-dasharray: 3 2; }
.rp-ship.rp-offline { fill-opacity: .45; }
.rp-me-ring { fill: none; stroke: #ffd34d; stroke-width: 2; vector-effect: non-scaling-stroke; animation: rp-pulse 1.2s ease-in-out infinite; }
@keyframes rp-pulse { 0%, 100% { stroke-opacity: 1; } 50% { stroke-opacity: .25; } }
.rp-wreck { fill: none; stroke: #ff8f8f; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.rp-me .rp-wreck { stroke: #ffd34d; }
.rp-npc { fill: #e0564f; stroke: rgba(0, 0, 0, .6); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rp-npc.rp-owned { stroke: #ffd34d; stroke-width: 2; }
.rp-pet { fill: #5ee6e6; stroke: rgba(0, 0, 0, .6); vector-effect: non-scaling-stroke; cursor: pointer; }
.rp-pet.mine { stroke: #ffd34d; stroke-width: 2; }
.rp-box { fill: #f5d76e; stroke: rgba(0, 0, 0, .5); vector-effect: non-scaling-stroke; cursor: pointer; }
.rp-box.rp-cargo { fill: #c08a4a; }
.rp-box.rp-ore { fill: #b58cff; }
.rp-chest { fill: #ffb627; stroke: #5a3a00; vector-effect: non-scaling-stroke; cursor: pointer; }
.rp-aim { stroke: rgba(255, 255, 255, .22); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.rp-aim.mine { stroke: rgba(255, 211, 77, .55); }
.rp-laser { stroke: #ff5a4f; stroke-width: 1.5; stroke-opacity: .65; vector-effect: non-scaling-stroke; pointer-events: none; }
.rp-laser.mine { stroke: #ffd34d; stroke-width: 2.5; stroke-opacity: 1; }
.rp-rocket { stroke: #ff9f1a; stroke-width: 3.5; stroke-dasharray: 6 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.rp-other { stroke: #5ee6e6; stroke-width: 2; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.rp-kill { fill: none; stroke: #ffffff; stroke-width: 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.rp-kill.mine { stroke: #ffd34d; }
.rp-pick { fill: none; stroke: #58d68d; stroke-width: 2.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.rp-travel { fill: none; stroke: #9fd0ff; stroke-width: 2; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.replay-state-title { font-weight: 600; }
.replay-inspected { position: relative; padding: 4px 22px 4px 6px; border: 1px solid var(--border); border-radius: 4px; }
.replay-inspected .link { position: absolute; top: 2px; right: 4px; }
.replay-census { font-size: .76rem; }
.replay-log .ikind-Laser .k, .replay-log .ikind-Rocket .k, .replay-log .ikind-OtherDamage .k { color: #ff7a6f; }
.replay-log .ikind-Kill .k { color: #ffffff; }
.replay-log .ikind-Collected .k, .replay-log .ikind-ChestOpened .k { color: var(--ok); }
.replay-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .74rem; margin-top: 6px; }
.replay-legend span { display: inline-flex; align-items: center; gap: 4px; }
.replay-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.lg-me { background: #ffd34d; box-shadow: 0 0 0 2px rgba(255, 211, 77, .4); }
.lg-f1 { background: #4fa3ff; }
.lg-f2 { background: #ff6b6b; }
.lg-npc { background: #e0564f; }
.lg-pet { background: #5ee6e6; }
.replay-legend .lg-box { background: #f5d76e; border-radius: 1px; }
.replay-legend .lg-cargo { background: #c08a4a; border-radius: 1px; }
.replay-legend .lg-chest { background: #ffb627; border-radius: 1px; transform: rotate(45deg) scale(.85); }
.replay-legend .lg-ore { background: #b58cff; border-radius: 1px; }
.replay-legend .lg-laser { width: 16px; height: 2px; border-radius: 0; background: #ff5a4f; }
.replay-legend .lg-rocket { width: 16px; height: 3px; border-radius: 0; background: #ff9f1a; }

/* Administrator panel: flight recorder and server jobs tabs. */
.recorder-stats { margin: 4px 0; font-size: .78rem; }
.recorder-stats .warn { color: var(--warn); }
.suspects-table td.ok { color: var(--ok); }
.jobs code { font-size: .74rem; color: var(--text); word-break: break-all; }

/* Flight recorder (2026-10-25): pilots / maps views, live sessions, the recorded part of a running replay. */
.admin-subtabs { margin: 4px 0 0; }
.admin-subtabs button { padding: 2px 12px; font-size: .78rem; }
.recorder-maps tr.muted td { opacity: .6; }
.replay-live { color: #3ad36b; font-weight: 600; }
.replay-slider {
  --replay-ready: 100%;
  background: linear-gradient(to right, hsl(var(--theme-h) calc(100% * var(--theme-s)) 60% / .35) var(--replay-ready), rgba(255, 255, 255, .06) var(--replay-ready));
  border-radius: 4px;
}

.replay-log li.mine { background: rgba(255, 210, 90, .08); }

/* Kafelki aukcji korzystają z tych samych podglądów co sklep. */
.auction-countdown { font-size:1.8rem; font-weight:800; font-variant-numeric:tabular-nums; color:#b5efff; margin-left:auto; padding:2px 16px; }
.auction-layout { display:grid; grid-template-columns:140px minmax(0,1fr); gap:16px; }
.auction-categories { display:flex; flex-direction:column; gap:5px; align-self:start; position:sticky; top:0; }
.auction-categories button { text-align:left; padding:9px 12px; }
.auction-list { min-width:0; }
.auction-filters { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.auction-filters .active, .auction-categories .active { border-color:#26c8ff; background:#074569; color:white; }
.auction-group h3 { font-size:.9rem; color:#a8dff4; margin:14px 0 6px; padding-bottom:5px; border-bottom:1px solid #17618a; }
.auction-row { display:grid; grid-template-columns:36px minmax(100px,1fr) auto; align-items:center; gap:10px; min-height:48px; padding:6px 8px; border:1px solid #16465e; border-radius:4px; background:#061b29; margin-bottom:4px; }
.auction-row.selected { border-color:#96eaff; background:#0a3048; }
.auction-item-info { display:flex; flex-direction:column; gap:3px; min-width:0; }
.auction-item-info strong { font-size:.85rem; }
.auction-leader { color:#c0b387; font-size:.75rem; overflow-wrap:anywhere; }
.auction-leading { color:#8aff86; font-size:.75rem; }
.auction-row.unavailable { filter:grayscale(1); opacity:.5; }
.auction-unavailable { color:#a5adb5; font-size:.75rem; }
.auction-bid { display:flex; gap:6px; align-items:center; }
.auction-bid input { width:132px; min-width:0; box-sizing:border-box; }
.auction-bid button { min-width:80px; }
.auction-window .auction-bid button:disabled { background:#383d42; color:#858b91; border-color:#50555b; box-shadow:none; text-shadow:none; filter:grayscale(1); opacity:1; cursor:not-allowed; }
@media (max-width:680px) {
    .auction-layout { grid-template-columns:100px minmax(0,1fr); gap:8px; }
    .auction-categories button { padding:7px 5px; font-size:.75rem; }
    .auction-row { grid-template-columns:30px minmax(0,1fr); gap:6px; }
    .auction-bid, .auction-unavailable { grid-column:2; }
    .auction-bid input { width:100%; }
    .auction-countdown { font-size:1.35rem; padding:2px 6px; }
}
.auction-notification { pointer-events:auto; cursor:pointer; border:1px solid #24baff; background:#062336; color:#fff; padding:8px 12px; }

.notifications:has(.auction-notification, .notification.server) { z-index:25; }

/* Shared vector icon and panel chrome. */
.ui-icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.hex-icon .ui-icon { width: 24px; height: 24px; }
button.hex .hex-icon { display: flex; color: var(--text); filter: none; }
button.hex.active .ui-icon { color: var(--accent); filter: drop-shadow(0 0 4px var(--accent)); }
.panel-heading { position: relative; min-height: 24px; padding-right: 62px; box-sizing: border-box; flex-wrap: wrap; display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; margin-bottom: 5px; color: var(--muted); }
.panel-heading-name { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; }
.panel-heading-name .ui-icon { width: 16px; height: 16px; }
.panel-move { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; cursor: move; touch-action: none; color: var(--muted); border-radius: 4px; }
.panel-heading > .panel-move { position: absolute; right: 32px; top: 0; }
.window-header > .panel-move { margin-left: auto; }
.panel-move:hover { color: var(--accent); background: #ffffff0c; }
button.panel-minimize { position: absolute; right: 0; top: 0; margin-left: auto; display: inline-flex; justify-content: center; align-items: center; flex: none; width: 26px; height: 24px; padding: 2px; color: var(--muted); background: transparent; border: 1px solid transparent; }
button.panel-minimize:hover, button.panel-minimize:focus-visible { color: var(--accent); border-color: var(--accent); }
.window-title { display: flex; align-items: center; gap: 7px; }
.window-header > .close { margin-left: auto; }
.pet-name { text-align: left; }
.pet-name-level { color: var(--accent); font-size: .75rem; margin-right: 4px; }
.pet-panel .pet-status { margin-left: 0; }
.pet-statuses { align-items: center; }

.mission-tracker .panel-heading button.link { background: none; border: none; padding: 0 2px; color: var(--accent); cursor: pointer; }

.window-header > button.panel-minimize { position: static; margin-left: 0; padding: 2px; }
.hex-dock.hex-hud, .hex-dock.hex-windows { top: 360px; transform: none; }
.hex-dock.hex-hud { left: 12px; }
.hex-dock.hex-windows { left: 122px; }

.game-ui { position:absolute; left:0; top:0; width:calc(100% / var(--ui-scale, 1)); height:calc(100% / var(--ui-scale, 1)); transform:scale(var(--ui-scale, 1)); transform-origin:top left; pointer-events:none; }
