/* ===== Main game desktop layout (Claude, Oct16 evening) =====
   Owner: "remove the elements below and put it on the side so we can have bigger play space ... a phone like UI
   on the left side", "put the PWR distribution metrics below the auto stage", "modals ~75% of the current size",
   "make it more professional". Active only on the main game in portrait mode on screens >= 900 px
   (body.online-portrait.demo-desk, set by src/account-game.js fitField). Phones keep the bottom tabs. */

/* ---------- page frame ---------- */
.online-portrait.demo-desk { background: radial-gradient(120% 80% at 50% 0%, #0b1d26 0%, #050b0f 55%, #020507 100%); }
.online-portrait.demo-desk .shell { grid-template-rows: 58px minmax(0, 1fr) 0; }
.online-portrait.demo-desk .topbar { width: auto; }
.online-portrait.demo-desk .layout { padding: 0 16px; }
.online-portrait.demo-desk #view-combat {
  display: grid !important; grid-template-columns: 300px auto 330px; grid-template-areas: "left frame right";
  justify-content: center; align-items: start; column-gap: 18px; padding-top: 8px; background: transparent; overflow: visible;
}
.online-portrait.demo-desk .combat-frame { grid-area: frame; border: 1px solid #2c5361; box-shadow: 0 0 0 1px #000, 0 18px 50px #0009; }
.portrait-side { display: none; }
.online-portrait.demo-desk .portrait-side {
  display: flex; flex-direction: column; gap: 12px; min-width: 0; max-height: calc(100dvh - 74px);
  overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #274552 transparent; padding-bottom: 6px;
  /* Owner Oct18 video: in a non-maximized window the scrollbar came and went every tick (tiles size with the panel width),
     so the whole menu jumped. Always reserve the scrollbar space: the width never changes. */
  scrollbar-gutter: stable;
}
.online-portrait.demo-desk #portrait-left { grid-area: left; }
.online-portrait.demo-desk #portrait-right { grid-area: right; }
.online-portrait.demo-desk .portrait-side > * { width: auto !important; max-width: none !important; flex: none; }

/* shared card look */
.online-portrait .portrait-card, .online-portrait.demo-desk #portrait-left .combat-information {
  border: 1px solid #22404c; border-radius: 10px; background: linear-gradient(180deg, #0a1b23 0%, #07131a 100%);
  box-shadow: inset 0 1px 0 #ffffff0a, 0 8px 24px #0006; padding: 12px;
}
.panel-head { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.panel-head strong { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #9fdcef; }

/* ---------- left: ship info ---------- */
.online-portrait.demo-desk #portrait-left .combat-information { display: block; padding: 0; overflow: hidden; }
.online-portrait.demo-desk #portrait-left .combat-footer { display: grid; grid-template-columns: 1fr 1fr !important; border: 0; background: none; }
.online-portrait.demo-desk #portrait-left .combat-footer > div { padding: 9px 12px; border: 0; border-bottom: 1px solid #1b3540; min-width: 0; }
.online-portrait.demo-desk #portrait-left .combat-footer > div:nth-child(odd) { border-right: 1px solid #1b3540; }
.online-portrait.demo-desk #portrait-left .combat-footer > div:first-child,
.online-portrait.demo-desk #portrait-left .combat-footer > div:nth-child(2) { grid-column: 1 / -1; border-right: 0; }
.online-portrait.demo-desk #portrait-left .combat-footer > div:nth-last-child(-n+2) { border-bottom: 0; }
.online-portrait.demo-desk #portrait-left .combat-footer span,
.online-portrait.demo-desk #portrait-left .combat-footer small { font-size: 10px; letter-spacing: .06em; color: #7f9ca8; }
.online-portrait.demo-desk #portrait-left .combat-footer strong { font-size: 13px; }

/* ---------- left: command phone ---------- */
.rift-phone { display: none; }
.online-portrait.demo-desk .rift-phone {
  display: block; position: relative; border-radius: 26px; padding: 10px 12px 14px;
  background: linear-gradient(160deg, #10232c 0%, #081419 60%, #060f13 100%);
  border: 1px solid #2c5361; box-shadow: inset 0 0 0 3px #04090c, inset 0 2px 0 4px #ffffff08, 0 14px 36px #000a;
}
.online-portrait.demo-desk .rift-phone::after { /* home bar */
  content: ""; display: block; width: 84px; height: 4px; margin: 12px auto 0; border-radius: 4px; background: #2c5361;
}
.phone-status { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 2px 8px 10px; font-size: 11px; font-weight: 700; color: #9fb4bf; }
.phone-os { letter-spacing: .14em; color: #64f2c7; font-size: 10px; }
#phone-clock { font-variant-numeric: tabular-nums; color: #e7f3f7; font-size: 12px; }
.phone-signal { justify-self: end; display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.phone-signal i { display: block; width: 3px; background: #64f2c7; border-radius: 1px; }
.phone-signal i:nth-child(1) { height: 3px; } .phone-signal i:nth-child(2) { height: 5px; }
.phone-signal i:nth-child(3) { height: 7px; } .phone-signal i:nth-child(4) { height: 10px; }
.phone-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.phone-grid .tabs, .phone-grid .combat-quick-controls { display: contents !important; }

/* tiles: every navigation tab, notifications, store, music, account */
.online-portrait.demo-desk .phone-grid .tab,
.online-portrait.demo-desk .phone-grid .combat-quick-controls > button,
.online-portrait.demo-desk .phone-grid #open-account {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  width: auto !important; height: auto !important; min-height: 0; aspect-ratio: 1 / .86; flex: none !important; margin: 0;
  padding: 6px 4px; font-size: 11px; font-weight: 600; line-height: 1.1; text-align: center; color: #d9eaf0; white-space: nowrap;
  background: linear-gradient(180deg, #123542 0%, #0c2631 100%); border: 1px solid #23505f; border-image: none; border-radius: 8px;
  box-shadow: inset 0 1px 0 #ffffff12; transition: background .15s, border-color .15s, transform .08s;
}
.online-portrait.demo-desk .phone-grid .tab:hover,
.online-portrait.demo-desk .phone-grid .combat-quick-controls > button:hover,
.online-portrait.demo-desk .phone-grid #open-account:hover { border-color: #4fd2ea; background: linear-gradient(180deg, #17485a 0%, #0f3140 100%); }
.online-portrait.demo-desk .phone-grid .tab:active,
.online-portrait.demo-desk .phone-grid .combat-quick-controls > button:active { transform: scale(.97); }
.online-portrait.demo-desk .phone-grid .tab.is-active { background: linear-gradient(180deg, #4fe0f2 0%, #2fb9d3 100%); border-color: #8ff0ff; color: #04141a; }

.online-portrait.demo-desk .phone-grid .tab-icon,
.online-portrait.demo-desk .phone-grid .combat-quick-controls > button img { width: 28px !important; height: 28px !important; flex: none; margin: 0; image-rendering: pixelated; }
.online-portrait.demo-desk .phone-grid #open-void span { font-size: 11px; }
.online-portrait.demo-desk .phone-grid #open-void small { font-size: 9px; color: inherit; opacity: .7; margin-top: -4px; }
.online-portrait.demo-desk .phone-grid #open-account::before {
  content: ""; width: 28px; height: 28px; background: url("../assets/ui/icons/astronaut.png") center / contain no-repeat; image-rendering: pixelated;
}
.online-portrait.demo-desk .phone-grid #notification-count {
  position: absolute; top: 5px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  font-size: 10px; line-height: 18px; text-align: center; color: #04141a; background: #ffb35c;
}
.online-portrait.demo-desk .phone-grid #notification-count:empty,
.online-portrait.demo-desk .phone-grid #notification-count.is-zero { display: none; }
.phone-dock { margin-top: 10px; }
.online-portrait.demo-desk .phone-dock .account-connection {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; padding: 7px 10px; border: 1px solid #1b3540; border-radius: 8px;
  background: #050e12; font-size: 11px; line-height: 1.3; color: #9fb4bf;
}
.online-portrait.demo-desk .phone-dock .account-connection strong { color: #64f2c7; font-size: 11px; }
.online-portrait.demo-desk .phone-dock .account-connection strong::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #64f2c7; box-shadow: 0 0 6px #64f2c7; }
.online-portrait.demo-desk .phone-dock #account-status { flex: 1 1 140px; min-width: 0; }
.online-portrait.demo-desk .phone-dock #account-action-retry { width: 100%; min-height: 28px; font-size: 11px; }

/* ---------- right: sortie card ---------- */
.sortie-card { position: relative; }
.online-portrait.demo-desk #sortie-card .combat-options {
  display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0; min-height: 0; border: 0; background: none; align-items: stretch;
}
.online-portrait.demo-desk #sortie-card .combat-options > label:first-child {
  grid-column: 1 / -1; display: grid; gap: 5px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #7f9ca8;
}
.online-portrait.demo-desk #sortie-card .combat-options select {
  width: 100% !important; min-height: 36px; padding: 0 10px; font-size: 13px; letter-spacing: 0; text-transform: none; color: #e7f3f7;
  background-color: #06141b; border: 1px solid #2c5361; border-radius: 6px;
}
/* Auto next level: whole row is the switch (input stays a real checkbox for keyboard + tests) */
.online-portrait.demo-desk #sortie-card .switch-row {
  grid-column: 1 / -1; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 10px; cursor: pointer;
  padding: 8px 10px; border: 1px solid #1b3540; border-radius: 6px; background: #06141b; font-size: 12px; text-transform: none; letter-spacing: 0; color: #d9eaf0;
}
.online-portrait.demo-desk #sortie-card .switch-row:hover { border-color: #2c5361; }
.online-portrait.demo-desk #sortie-card #auto-levels, .online-portrait.demo-desk #sortie-card #repeat-sector {
  appearance: none; -webkit-appearance: none; position: relative; width: 40px; height: 22px; margin: 0; border-radius: 11px; cursor: pointer;
  background: #1a2e36; border: 1px solid #2c5361; transition: background .15s;
}
.online-portrait.demo-desk #sortie-card #auto-levels::after, .online-portrait.demo-desk #sortie-card #repeat-sector::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #9fb4bf; transition: transform .15s, background .15s;
}
.online-portrait.demo-desk #sortie-card #auto-levels:checked, .online-portrait.demo-desk #sortie-card #repeat-sector:checked { background: #157a8c; border-color: #4fd2ea; }
.online-portrait.demo-desk #sortie-card #auto-levels:checked::after, .online-portrait.demo-desk #sortie-card #repeat-sector:checked::after { transform: translateX(18px); background: #e9fbff; }
.online-portrait.demo-desk #sortie-card #auto-levels:focus-visible, .online-portrait.demo-desk #sortie-card #repeat-sector:focus-visible { outline: 2px solid #4fd2ea; outline-offset: 2px; }
.switch-text { display: grid; gap: 1px; min-width: 0; }
.switch-text b { font-size: 13px; color: #e7f3f7; }
.switch-text small { font-size: 11px; color: #7f9ca8; }
body:not(.demo-desk) .switch-text small { display: none; }
body:not(.demo-desk) .switch-text, body:not(.demo-desk) .switch-text b { display: inline; font-size: inherit; font-weight: inherit; color: inherit; }
/* Fire + Loot */
.online-portrait.demo-desk #sortie-card .combat-options > span.disabled-action { display: block; }
.online-portrait.demo-desk #sortie-card #fire-weapons,
.online-portrait.demo-desk #sortie-card #idle-summary,
.online-portrait.demo-desk #sortie-card #void-return-control {
  width: 100%; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; border-radius: 6px;
}
.online-portrait.demo-desk #sortie-card #void-return-control { grid-column: 1 / -1; }
.online-portrait.demo-desk #sortie-card #fire-weapons .command-icon { width: 16px; height: 16px; }
/* status pill in the card header */
.online-portrait.demo-desk #sortie-card #combat-run-status {
  position: absolute; top: 10px; right: 12px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 10px 2px 20px; border: 1px solid #2c5361; border-radius: 999px; font-size: 11px; font-weight: 700; color: #ffb35c; background: #06141b;
}
.online-portrait.demo-desk #sortie-card #combat-run-status::before { content: ""; position: absolute; left: 8px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: currentColor; }
.online-portrait.demo-desk #sortie-card #combat-run-status:empty { display: none; }
.online-portrait.demo-desk.combat-running #sortie-card #combat-run-status { color: #64f2c7; }
.online-portrait.demo-desk #sortie-card #combat-season { display: none !important; }
/* flight controls (dock / move / dash / pulse) */
.online-portrait.demo-desk #sortie-card .combat-commandbar {
  position: static !important; display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 10px; padding: 8px 0 0; border: 0; border-top: 1px solid #1b3540; background: none;
}
.online-portrait.demo-desk #sortie-card .combat-commandbar[hidden] { display: none !important; }
.online-portrait.demo-desk #sortie-card .combat-control-group, .online-portrait.demo-desk #sortie-card .combat-controls { position: static !important; display: flex; gap: 6px; }
.online-portrait.demo-desk #sortie-card .combat-commandbar button { width: 40px; height: 36px; min-height: 36px; padding: 0; border-radius: 6px; }
/* bounty */
.online-portrait.demo-desk #sortie-card .combat-score {
  display: flex !important; position: static; align-items: baseline; justify-content: space-between; margin-top: 10px; padding: 8px 10px;
  border: 1px solid #1b3540; border-radius: 6px; background: #06141b; transform: none; width: 100% !important; margin-left: 0; box-sizing: border-box;
}
.online-portrait.demo-desk #sortie-card .combat-score span { font-size: 10px; letter-spacing: .1em; color: #7f9ca8; }
.online-portrait.demo-desk #sortie-card .combat-score strong { font-size: 18px; color: #ffcf7a; font-variant-numeric: tabular-nums; }

/* ---------- right: PWR distribution ---------- */
.online-earnings { display: none; }
.online-portrait.demo-desk .online-earnings { display: block; }
.online-earnings .earn-head strong { font-size: 12px; letter-spacing: .12em; color: #9fdcef; }
.online-earnings .earn-tile, .online-earnings .earn-pool { border-radius: 6px; border-color: #1b3540; background: #06141b; }
.online-earnings .earn-bar { border-radius: 4px; }
.online-earnings .fine { font-size: 10.5px !important; }

/* ---------- windows / dialogs at ~75% on desktop ---------- */
@media (min-width: 900px) {
  .online-portrait #game-window { width: min(980px, calc(100vw - 48px)); height: min(840px, calc(100dvh - 48px)); border-radius: 10px; }
  .online-portrait #store-dialog { width: min(840px, calc(100vw - 48px)); max-height: min(720px, calc(100dvh - 48px)); }
  .online-portrait #recruitment-dialog { width: min(760px, calc(100vw - 48px)); max-width: 760px; }
  .online-portrait #session-dialog { max-height: min(680px, calc(100dvh - 48px)); }
  .online-portrait #game-window-content { padding: 10px 14px; }
  .online-portrait .game-window-heading { padding: 8px 12px; }
  .online-portrait .game-window-heading h2 { font-size: 17px; }
  .online-portrait #game-window::backdrop, .online-portrait dialog::backdrop { background: #000a; backdrop-filter: blur(2px); }
}

/* "Stop after this stage" choice, shown in the sortie card while the server holds a cleared stage */
.stage-slot:empty { display: none; }
.online-portrait.demo-desk #sortie-card .stage-result {
  position: static; display: grid; gap: 8px; margin: 10px 0 0; padding: 10px; border: 1px solid #ffb35c; border-radius: 6px;
  background: #1d1408; box-shadow: 0 0 18px #ffb35c22; transform: none; width: auto;
}
.online-portrait.demo-desk #sortie-card .stage-result[hidden] { display: none; }
.online-portrait.demo-desk #sortie-card #stage-result-title { font-size: 13px; color: #ffcf7a; }
.online-portrait.demo-desk #sortie-card .stage-result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.online-portrait.demo-desk #sortie-card .stage-result-actions button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; border-radius: 6px; width: 100%; }
.online-portrait.demo-desk #sortie-card .stage-result-actions .hud-icon { width: 14px; height: 14px; }
.online-portrait.demo-desk #sortie-card #result-repeat::after { content: "Replay"; }
.online-portrait.demo-desk #sortie-card #result-progress::after { content: "Next stage"; }
.online-portrait.demo-desk #sortie-card #result-progress { order: 2; border-color: #ffb35c; }
.online-portrait.demo-desk #sortie-card #result-repeat { order: 1; }
.online-portrait.demo-desk #sortie-card #result-finish { order: 3; grid-column: 1 / -1; }
.online-portrait.demo-desk #sortie-card #combat-run-status::first-letter { text-transform: uppercase; }

/* Galaxy window at the smaller size: all ten galaxies stay visible in one row */
@media (min-width: 900px) {
  .online-portrait #galaxy-tabs { grid-template-columns: repeat(10, minmax(0, 1fr)); overflow: visible; }
  .online-portrait #galaxy-tabs .galaxy-tab { min-width: 0; width: auto; padding: 6px 7px; font-size: 11px; white-space: normal; }
  .online-portrait #galaxy-tabs .galaxy-tab small, .online-portrait #galaxy-tabs .galaxy-tab span { font-size: 9px; }
}
/* shorter screens (e.g. 1366x768): compact tiles so the phone fits without scrolling */
@media (min-width: 900px) and (max-height: 840px) {
  .online-portrait.demo-desk .phone-grid .tab,
  .online-portrait.demo-desk .phone-grid .combat-quick-controls > button,
  .online-portrait.demo-desk .phone-grid #open-account { aspect-ratio: 1 / .62; gap: 3px; }
  .online-portrait.demo-desk .phone-grid .tab-icon,
  .online-portrait.demo-desk .phone-grid .combat-quick-controls > button img,
  .online-portrait.demo-desk .phone-grid #open-account::before { width: 24px !important; height: 24px !important; }
  .online-portrait.demo-desk #portrait-left .combat-footer > div { padding: 6px 12px; }
  .online-portrait.demo-desk .rift-phone { padding: 8px 10px 10px; }
  .online-portrait.demo-desk .rift-phone::after { margin-top: 8px; }
  .online-earnings .earn-tile small { display: none; }
}
.online-portrait #galaxy-tabs .galaxy-tab strong { overflow-wrap: normal; word-break: normal; hyphens: none; font-size: 11px; }

/* ---------- phones (< 900 px): keep bottom tabs, tidy the controls above the field ---------- */
@media (max-width: 899px) {
  .online-portrait .combat-options { display: grid !important; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px; padding: 6px 8px; }
  .online-portrait .combat-options > label:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; font-size: 11px; color: #9fb4bf; }
  .online-portrait .combat-options > label:first-child select { width: 100% !important; min-height: 32px; }
  .online-portrait .combat-options .switch-row { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
  .online-portrait .combat-options > span.disabled-action { display: none; }
  .online-portrait .combat-options #combat-run-status { font-size: 11px; color: #ffb35c; text-align: right; }
  .online-portrait .combat-options #combat-run-status::first-letter { text-transform: uppercase; }
  .online-portrait .combat-options #idle-summary { min-height: 30px; padding: 0 12px; }
  .online-portrait .combat-quick-controls { grid-column: 1 / -1; display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .online-portrait .combat-quick-controls button { min-height: 32px; font-size: 11px; padding: 0 6px; }
  .online-portrait .combat-options .account-connection { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 11px; margin: 0; }
  .online-portrait .combat-options .account-connection #account-status { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .online-portrait .combat-options .account-connection #open-account { min-height: 28px; font-size: 11px; }
}

/* ===================== Oct16 evening: window polish (owner list) ===================== */
/* Top bar: Genesis + Notifications, left of the resources */
.top-actions { display: none; }
.online-portrait .top-actions {
  display: flex; gap: 6px; align-items: stretch; position: absolute; z-index: 4; top: 6px; height: 46px;
  right: calc(min(800px, 100% - 270px) + 18px);
}
.online-portrait .top-actions > button {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; min-height: 0; padding: 0 12px; margin: 0; border-radius: 8px;
  font-size: 12px; font-weight: 700; color: #d9eaf0; background: #06141b; border: 1px solid #274552; border-image: none; white-space: nowrap;
}
.online-portrait .top-actions > button:hover { border-color: #4fd2ea; }
.online-portrait .top-actions img { width: 22px; height: 22px; image-rendering: pixelated; }
.online-portrait .genesis-cta { position: relative; color: #ffe6a8 !important; border-color: #b8862e !important; background: linear-gradient(180deg, #2a1d08 0%, #150e04 100%) !important; box-shadow: 0 0 0 1px #000, 0 0 16px #ffb35c33; }
.online-portrait .genesis-cta span { display: grid; text-align: left; line-height: 1.1; }
.online-portrait .genesis-cta b { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #ffd27a; }
.online-portrait .genesis-cta small { font-size: 10px; font-weight: 600; color: #c9a86a; }
.online-portrait .genesis-cta::after { content: ""; position: absolute; inset: -1px; border-radius: 8px; pointer-events: none; animation: genesis-glow 2.6s ease-in-out infinite; }
@keyframes genesis-glow { 0%, 100% { box-shadow: 0 0 0 0 #ffb35c00; } 50% { box-shadow: 0 0 14px 1px #ffb35c66; } }
@media (prefers-reduced-motion: reduce) { .online-portrait .genesis-cta::after { animation: none; } }
.online-portrait .top-actions #open-notifications { position: relative; }
.online-portrait .top-actions #notification-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 10px; line-height: 18px; text-align: center; color: #04141a; background: #ffb35c;
}
.online-portrait .top-actions #notification-count.is-zero { display: none; }
@media (max-width: 1240px) { .online-portrait .top-actions #open-notifications { font-size: 0; gap: 0; padding: 0 10px; } .online-portrait .genesis-cta small { display: none; } }
@media (max-width: 899px) {
  .online-portrait .top-actions { top: 8px; right: 8px; height: 38px; }
  .online-portrait .top-actions > button { height: 38px; padding: 0 9px; }
}
/* Loot lives on the sortie card; the phone and the bottom tabs do not repeat it */
.online-portrait #open-loot { display: none !important; }

/* Genesis window */
.online-portrait #genesis-dialog { width: min(820px, calc(100vw - 32px)); max-height: min(760px, calc(100dvh - 40px)); overflow-y: auto; border-radius: 10px; }
.online-portrait #genesis-dialog .dialog-heading h2 { color: #ffd27a; letter-spacing: .04em; }
.online-portrait #genesis-dialog .launch-heading h3 { display: none; }

/* Confirmations: a small modal on top of the window that asked */
#transaction-dialog.is-stacked { width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 60px #000c; }
#transaction-dialog.is-stacked::backdrop { background: #0007; }
#transaction-dialog #transaction-detail h3 { font-size: 16px; margin: 0 0 6px; }
#transaction-dialog #transaction-detail p { font-size: 13px; line-height: 1.45; color: #c7d8df; }
#transaction-dialog #transaction-confirm { width: 100%; min-height: 40px; margin-top: 8px; }

@media (min-width: 900px) {
  /* ---------- Recruitment: all ten candidates visible ---------- */
  .online-portrait #recruitment-dialog { width: min(820px, calc(100vw - 48px)); max-width: 820px; padding: 12px 14px; border-radius: 10px; }
  .online-portrait #recruitment-dialog .dialog-heading { margin-bottom: 4px; }
  .online-portrait #recruitment-dialog .recruitment-toolbar { margin: 4px 0 8px; gap: 10px; font-size: 12px; color: #9fb4bf; }
  .online-portrait #recruitment-dialog #refresh-recruits { min-height: 32px; padding: 0 12px; font-size: 12px; margin-left: auto; }
  .online-portrait #recruitment-dialog #recruitment-feedback:empty { display: none; }
  .online-portrait #recruitment-dialog .grid-details-layout,
  .online-portrait #view-commanders .grid-details-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 12px; align-items: start; }
  .online-portrait #recruitment-grid, .online-portrait #commander-list {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 6px; max-height: none !important; overflow: visible !important; min-height: 0 !important;
  }
  .online-portrait #recruitment-grid .inventory-tile, .online-portrait #commander-list .inventory-tile {
    height: 104px; min-height: 0; grid-template-rows: 48px 18px 16px; gap: 2px; padding: 6px 3px; border-radius: 6px;
  }
  .online-portrait #recruitment-grid .commander-portrait, .online-portrait #commander-list .commander-portrait { width: 48px; height: 48px; object-fit: cover; }
  .online-portrait #recruitment-grid .tile-name, .online-portrait #commander-list .tile-name { font-size: 11px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .online-portrait #recruitment-grid .inventory-tile small, .online-portrait #commander-list .inventory-tile small { font-size: 9.5px; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .online-portrait #recruitment-grid .tile-badge, .online-portrait #commander-list .tile-badge { font-size: 9px; padding: 0 3px; top: 3px; right: 3px; }
  .online-portrait #recruitment-details, .online-portrait #commander-details {
    order: 0 !important; display: block !important; border: 1px solid #1b3540 !important; border-radius: 8px; padding: 10px !important; background: #06141b;
    max-height: min(520px, calc(100dvh - 220px)); overflow-y: auto; font-size: 12px;
  }
  .online-portrait #recruitment-details .commander-hero, .online-portrait #commander-details .commander-hero { grid-template-columns: 64px minmax(0, 1fr); gap: 8px; padding: 8px; }
  .online-portrait #recruitment-details .commander-hero img, .online-portrait #commander-details .commander-hero img { width: 64px; height: 64px; }
  .online-portrait #recruitment-details h3, .online-portrait #commander-details h3 { font-size: 16px; }
  .online-portrait #recruitment-details button, .online-portrait #commander-details button { min-height: 34px; font-size: 12px; }

  /* ---------- Commanders: same layout as recruitment ---------- */
  .online-portrait #view-commanders .section-heading { display: flex; justify-content: flex-end; margin: 0 0 8px; }
  .online-portrait #view-commanders .section-heading h2 { display: none; }
  .online-portrait #view-commanders #recruit-commander { min-height: 32px; font-size: 12px; padding: 0 12px; }
  .online-portrait #view-commanders .inventory-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }

  /* ---------- Inventory: compact three columns ---------- */
  .online-portrait #view-fleet > .section-heading { display: none; }
  .online-portrait .inv-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid #1b3540; }
  .online-portrait .inv-toolbar .inventory-tabs { display: flex; gap: 2px; margin: 0; padding: 2px; border: 1px solid #1b3540; border-radius: 8px; background: #050e12; flex-wrap: nowrap; }
  .online-portrait .inv-toolbar .inventory-tabs button {
    min-height: 28px; height: 28px; padding: 0 10px; font-size: 12px; border: 0; border-image: none; border-radius: 6px; background: transparent; color: #9fb4bf; white-space: nowrap;
  }
  .online-portrait .inv-toolbar .inventory-tabs button:hover { color: #e7f3f7; background: #0c2631; }
  .online-portrait .inv-toolbar .inventory-tabs button.is-active, .online-portrait .inv-toolbar .inventory-tabs button[aria-pressed="true"] { color: #04141a; background: #4fd2ea; }
  .online-portrait .inv-toolbar #module-count { margin-left: auto; font-size: 11px; color: #7f9ca8; }
  .online-portrait #inventory-workbench { display: grid; grid-template-columns: 236px minmax(0, 1fr) 250px; gap: 12px; align-items: start; }
  .online-portrait #inventory-workbench > * { min-width: 0; border: 0; padding: 0; }
  .online-portrait .equipped-pane { display: grid; gap: 8px; align-content: start; }
  .online-portrait .equipped-pane > h3 { margin: 4px 0 0; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #7f9ca8; }
  .online-portrait .equipped-pane > h3:first-child { display: none; }
  .online-portrait #ship-list { display: grid; gap: 6px; padding: 8px; border: 1px solid #1b3540; border-radius: 8px; background: #06141b; }
  .online-portrait #ship-list .equipped-ship { display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: auto auto; gap: 0 8px; align-items: center; min-height: 0; padding: 4px; text-align: left; border-radius: 6px; }
  .online-portrait #ship-list .equipped-ship .inventory-ship { grid-row: 1 / 3; width: 52px; height: 52px; }
  .online-portrait #ship-list .equipped-ship strong { font-size: 13px; line-height: 1.2; }
  .online-portrait #ship-list .equipped-ship span { font-size: 10.5px; color: #9fb4bf; }
  .online-portrait #ship-list .hull-meter { font-size: 11px; }
  .online-portrait #ship-list .ship-card-facts { display: flex; justify-content: space-between; margin: 0; font-size: 11px; color: #9fb4bf; }
  .online-portrait #ship-list .ship-repair-shortcut { min-height: 28px; font-size: 11px; }
  .online-portrait #equip-best { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: end; margin: 0; }
  .online-portrait #equip-best label { display: grid; gap: 2px; font-size: 10px; color: #7f9ca8; }
  .online-portrait #equip-best select { min-height: 30px; font-size: 12px; }
  .online-portrait #equip-best-action { min-height: 30px; padding: 0 10px; font-size: 12px; white-space: nowrap; }
  .online-portrait #module-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .online-portrait #module-slots > .disabled-action { display: block; min-width: 0; }
  .online-portrait #module-slots .equipment-slot {
    position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; width: 100%; height: 62px; min-height: 0; padding: 4px 2px;
    border-radius: 6px; text-align: center; overflow: hidden;
  }
  .online-portrait #module-slots .equipment-slot .module-icon, .online-portrait #module-slots .equipment-slot img { width: 30px; height: 30px; margin: 0; }
  .online-portrait #module-slots .equipment-slot > span { display: block; min-width: 0; max-width: 100%; }
  .online-portrait #module-slots .equipment-slot strong { display: block; font-size: 9.5px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .online-portrait #module-slots .equipment-slot small { display: none; }
  .online-portrait #module-slots .equipment-slot > b { position: absolute; top: 2px; right: 3px; font-size: 9px; }
  .online-portrait #loadout-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: end; padding: 8px 0 0; border-top: 1px solid #1b3540; }
  .online-portrait #loadout-panel h4 { grid-column: 1 / -1; margin: 0; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #7f9ca8; }
  .online-portrait #loadout-panel label { display: grid; gap: 2px; font-size: 10px; color: #7f9ca8; }
  .online-portrait #loadout-panel input { min-height: 30px; font-size: 12px; }
  .online-portrait #save-loadout { min-height: 30px; padding: 0 10px; font-size: 12px; }
  .online-portrait #loadout-panel > .disabled-action, .online-portrait #loadout-panel > #unlock-loadout { grid-column: 1 / -1; }
  .online-portrait #loadout-panel #unlock-loadout { min-height: 26px; font-size: 11px; width: 100%; }
  .online-portrait #loadout-panel [data-apply-loadout] { min-height: 28px; font-size: 11px; }
  .online-portrait #view-fleet .inventory-pane { display: grid; gap: 8px; align-content: start; }
  .online-portrait #view-fleet .inventory-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; }
  .online-portrait #view-fleet .inventory-controls label { display: grid; gap: 2px; font-size: 10px; color: #7f9ca8; min-width: 0; }
  .online-portrait #view-fleet .inventory-controls select { min-height: 30px; font-size: 12px; width: 100%; }
  .online-portrait #module-inventory { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; max-height: none; }
  .online-portrait #module-inventory .inventory-tile { height: 92px; grid-template-rows: 40px 18px 16px; gap: 2px; padding: 6px 3px; border-radius: 6px; }
  .online-portrait #module-inventory .inventory-tile .module-icon, .online-portrait #module-inventory .inventory-tile > img { width: 40px; height: 40px; }
  .online-portrait #module-inventory .tile-name { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .online-portrait #module-inventory .inventory-tile small { font-size: 9.5px; }
  .online-portrait #inventory-count { margin: 0; font-size: 11px; color: #7f9ca8; }
  .online-portrait #module-salvage { border-top: 1px solid #1b3540; padding-top: 6px; font-size: 12px; }
  .online-portrait #inventory-details { border: 1px solid #1b3540 !important; border-radius: 8px; padding: 10px !important; background: #06141b; font-size: 12px; max-height: none; }
  .online-portrait #inventory-details h3 { font-size: 15px; }
  .online-portrait #inventory-details button { min-height: 32px; font-size: 12px; }
  .online-portrait #inventory-details > h3:first-child:only-of-type + .fine { margin-top: 4px; }
}

.online-portrait #view-fleet .inventory-pane > .inventory-grid { min-height: 0; }
@media (min-width: 900px) {
  /* commander card inside the narrow details column */
  .online-portrait #recruitment-dialog .grid-details-layout, .online-portrait #view-commanders .grid-details-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .online-portrait :is(#recruitment-details, #commander-details) .commander-hero { grid-template-columns: 60px minmax(0, 1fr) !important; gap: 10px; align-items: start; padding: 8px; margin-bottom: 8px; }
  .online-portrait :is(#recruitment-details, #commander-details) .commander-hero .detail-image { width: 60px; height: 60px; }
  .online-portrait :is(#recruitment-details, #commander-details) .commander-hero .commander-portrait { width: 56px; height: 56px; }
  .online-portrait :is(#recruitment-details, #commander-details) .commander-hero h3 { font-size: 15px; margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .online-portrait :is(#recruitment-details, #commander-details) .commander-hero-body { min-width: 0; }
  .online-portrait :is(#recruitment-details, #commander-details) .effect-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
  .online-portrait :is(#recruitment-details, #commander-details) .effect-chip { font-size: 10.5px; padding: 1px 6px; }
  .online-portrait :is(#recruitment-details, #commander-details) .commander-passive { margin: 0 0 8px; padding: 6px 8px; font-size: 12px; }
  .online-portrait :is(#recruitment-details, #commander-details) .commander-rolls-title { font-size: 12px; margin: 0 0 4px; }
  .online-portrait :is(#recruitment-details, #commander-details) .commander-rolls div { padding: 3px 0; font-size: 12px; }
  .online-portrait :is(#recruitment-details, #commander-details) .detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .online-portrait :is(#recruitment-details, #commander-details) .detail-actions button { width: 100%; padding: 0 6px; }
  .online-portrait :is(#recruitment-details, #commander-details) .detail-actions > :first-child:last-child,
  .online-portrait :is(#recruitment-details, #commander-details) .detail-actions > :first-child { grid-column: 1 / -1; }
  .online-portrait :is(#recruitment-details, #commander-details) details { font-size: 11px; margin-top: 6px; }
  /* tile captions wrap to two short lines instead of being cut */
  .online-portrait :is(#recruitment-grid, #commander-list) .inventory-tile { height: 112px; grid-template-rows: 48px 16px 28px; }
  .online-portrait :is(#recruitment-grid, #commander-list) .inventory-tile small { white-space: normal !important; line-height: 13px !important; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .online-portrait #view-commanders .inventory-controls select { min-height: 30px; font-size: 12px; }
  .online-portrait #view-commanders .inventory-controls label { display: grid; gap: 2px; font-size: 10px; color: #7f9ca8; }
}
@media (min-width: 900px) {
  /* compact form controls in every window */
  .online-portrait :is(#game-window, #recruitment-dialog, #store-dialog) select { min-height: 30px !important; height: 30px; font-size: 12px; padding-block: 0; }
  .online-portrait :is(#game-window, #recruitment-dialog, #store-dialog) .inventory-controls label,
  .online-portrait #store-dialog .store-category-label { font-size: 10px; color: #7f9ca8; display: grid; gap: 2px; }
  /* Missions */
  .online-portrait #view-missions > .section-heading { display: none; }
  .online-portrait #view-missions .mission-tabs { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid #1b3540; border-radius: 8px; background: #050e12; margin: 8px 0; }
  .online-portrait #view-missions .mission-tabs button { min-height: 28px; height: 28px; padding: 0 12px; font-size: 12px; border: 0; border-image: none; border-radius: 6px; background: transparent; color: #9fb4bf; }
  .online-portrait #view-missions .mission-tabs button[aria-selected="true"], .online-portrait #view-missions .mission-tabs button.is-active { color: #04141a; background: #4fd2ea; }
  .online-portrait #view-missions .mission-tabs .tab-count { font-size: 10px; padding: 0 5px; }
  .online-portrait #view-missions .mission-builder { gap: 8px; align-items: end; }
  .online-portrait #view-missions #launch-expedition { min-height: 32px; font-size: 12px; }
  .online-portrait #view-missions .mission-subheading { font-size: 13px; margin: 12px 0 6px; }
  .online-portrait #contract-pool article, .online-portrait #contract-pool > div > div { padding: 6px 8px; }
}

/* Inventory, second pass (owner reference: compact backpack grid, few buttons) */
@media (min-width: 900px) {
  .online-portrait #inventory-workbench > .equipped-pane,
  .online-portrait #inventory-workbench > .inventory-pane { padding: 10px; border: 1px solid #1b3540; border-radius: 10px; background: #06141b; }
  .online-portrait #inventory-workbench > .inventory-pane::before { content: "Backpack"; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #9fdcef; }
  .online-portrait #module-inventory { grid-template-columns: repeat(auto-fill, 66px); justify-content: start; gap: 6px; }
  .online-portrait #module-inventory .inventory-tile {
    position: relative; width: 66px; height: 66px; padding: 4px; grid-template-rows: 1fr auto; place-items: center; gap: 0;
    border: 1px solid color-mix(in srgb, var(--rarity, #2c5361) 70%, #000); border-image: none; border-radius: 8px;
    background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rarity, #2c5361) 22%, #0b1d25) 0%, #07131a 75%);
  }
  .online-portrait #module-inventory .inventory-tile:hover { border-color: var(--rarity, #4fd2ea); }
  .online-portrait #module-inventory .inventory-tile[aria-pressed="true"] { outline: 2px solid #ffd27a; outline-offset: 1px; }
  .online-portrait #module-inventory .inventory-tile .tile-name { display: none; }
  .online-portrait #module-inventory .inventory-tile small { font-size: 8.5px; line-height: 1; color: #9fb4bf; text-transform: uppercase; letter-spacing: .04em; }
  .online-portrait #module-slots .equipment-slot { border: 1px solid color-mix(in srgb, var(--rarity, #2c5361) 70%, #000); border-image: none; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rarity, #2c5361) 18%, #0b1d25) 0%, #07131a 75%); }
  .online-portrait #loadout-panel .disabled-action:has(#unlock-loadout[disabled]) { display: none; }
}
@media (min-width: 900px) {
  .online-portrait #module-slots .equipment-slot strong { font-size: 9px; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.05; }
}

/* small polish (Oct16 evening) */
@media (min-width: 900px) {
  .online-portrait #game-window .equipment-slot strong { font-size: 9px; line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; }
  .online-portrait #market-quote { display: block; margin: 6px 0 12px; }
}

/* ===== Oct 16 night: bag, compare, red stop reasons, Battle Lab, Admin (src/online-features.js) ===== */
.stop-reason { margin: 6px 0 0; padding: 7px 10px; border: 1px solid #7a2a2f; border-left: 3px solid #ff5a5f; border-radius: 6px; background: #2a0d10; color: #ff8a8e; font-size: 12px; font-weight: 600; line-height: 1.35; }
.stop-reason[hidden] { display: none; }
.stop-reasons { display: grid; gap: 4px; }
.stop-reasons .stop-reason { margin: 0; }
.online-portrait.demo-desk #sortie-card .sortie-stop { margin: 0 0 10px; }
.online-portrait #sortie-card .stage-result.is-bag-full { border-color: #ff5a5f; background: #2a0d10; box-shadow: 0 0 18px #ff5a5f22; }
.online-portrait #sortie-card .stage-result.is-bag-full #stage-result-title { color: #ff8a8e; }
/* bag meter in the inventory toolbar */
.bag-meter { display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 4px 6px 4px 10px; border: 1px solid #1b3540; border-radius: 8px; background: #050e12; font-size: 12px; }
.bag-meter .bag-label { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #7f9ca8; }
.bag-meter strong { font-variant-numeric: tabular-nums; color: #e7f3f7; }
.bag-meter .bag-track { width: 90px; height: 6px; border-radius: 3px; background: #10262f; overflow: hidden; }
.bag-meter .bag-track i { display: block; height: 100%; background: #64f2c7; transition: width .4s; }
.bag-meter.is-near .bag-track i { background: #ffb35c; } .bag-meter.is-near strong { color: #ffb35c; }
.bag-meter.is-full { border-color: #ff5a5f; background: #2a0d10; } .bag-meter.is-full .bag-track i { background: #ff5a5f; } .bag-meter.is-full strong { color: #ff8a8e; }
.bag-meter button { min-height: 26px; padding: 0 10px; font-size: 11px; border-radius: 6px; white-space: nowrap; }
.bag-meter .bag-max { font-size: 11px; color: #7f9ca8; }
.online-portrait .inv-toolbar #module-count { margin-left: 0; }
/* backpack tiles: bigger, rarity first */
@media (min-width: 900px) {
  .online-portrait #module-inventory { grid-template-columns: repeat(auto-fill, 76px); gap: 7px; }
  .online-portrait #module-inventory .inventory-tile { width: 76px; height: 76px; border-width: 2px; border-color: color-mix(in srgb, var(--rarity, #2c5361) 85%, #000);
    background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--rarity, #2c5361) 34%, #0b1d25) 0%, color-mix(in srgb, var(--rarity, #2c5361) 8%, #07131a) 70%); }
  .online-portrait #module-inventory .inventory-tile .module-icon, .online-portrait #module-inventory .inventory-tile > img { width: 46px; height: 46px; }
  .online-portrait #module-inventory .inventory-tile[data-rarity="Epic"] { box-shadow: 0 0 10px color-mix(in srgb, var(--rarity) 45%, transparent); }
  .online-portrait #module-inventory .inventory-tile[data-rarity="Legendary"] { box-shadow: 0 0 14px color-mix(in srgb, var(--rarity) 60%, transparent), inset 0 0 10px color-mix(in srgb, var(--rarity) 30%, transparent); }
  .online-portrait #module-inventory .inventory-tile small { display: none; }
}
.inventory-tile .rar-chip { position: absolute; right: 3px; bottom: 3px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 4px; font: 800 9.5px/15px system-ui, sans-serif; font-style: normal; text-align: center; color: #04141a; background: var(--rarity, #a9b4bf); }
.inventory-tile .eq-chip { position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; border-radius: 4px; font: 800 9.5px/15px system-ui, sans-serif; font-style: normal; text-align: center; color: #04141a; background: #64f2c7; }
/* compact module details */
.mdx { display: grid; gap: 8px; }
.mdx-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; }
.mdx-head .detail-image { width: 64px; height: 64px; margin: 0; display: grid; place-items: center; border: 2px solid var(--rarity, #2c5361); border-radius: 10px; background: radial-gradient(circle, color-mix(in srgb, var(--rarity, #2c5361) 30%, #0b1d25), #07131a 75%); }
.mdx-head .detail-image img, .mdx-head .detail-image .module-icon { width: 46px; height: 46px; }
.mdx-head h3 { margin: 0; font-size: 15px; line-height: 1.2; text-align: left !important; }
.mdx-sub { margin: 4px 0 0; font-size: 11px; color: #9fb4bf; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rarity-pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #04141a; background: var(--rarity, #a9b4bf); }
.mdx-vs { margin: 0; font-size: 11.5px; color: #9fb4bf; display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.mdx-vs b { color: #e7f3f7; }
.cmp-tag { padding: 1px 7px; border-radius: 4px; font-size: 10.5px; font-weight: 700; }
.cmp-tag.up { color: #04141a; background: #64f2c7; } .cmp-tag.down { color: #fff; background: #b8343a; } .cmp-tag.same, .cmp-tag.eq { color: #cfe6ef; background: #1b3540; }
.mdx-stats { display: grid; gap: 0; margin: 0; border: 1px solid #1b3540; border-radius: 6px; overflow: hidden; }
.mdx-stats > div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 8px; font-size: 12px; }
.mdx-stats > div:nth-child(odd) { background: #0a1a22; }
.mdx-stats dt { color: #9fb4bf; } .mdx-stats dd { margin: 0; font-weight: 700; color: #e7f3f7; font-variant-numeric: tabular-nums; }
.dlt { font-style: normal; font-weight: 700; margin-left: 4px; } .dlt.up { color: #64f2c7; } .dlt.down { color: #ff7a7f; } .dlt.same { color: #7f9ca8; }
.mdx-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mdx-actions select { flex: 1 1 100%; min-height: 30px; font-size: 12px; }
.mdx-actions button { flex: 1 1 0; min-height: 34px; font-size: 12px; }
.mdx-actions button.primary { font-weight: 700; }
.mdx-toggle { justify-self: start; min-height: 26px !important; padding: 0 10px; font-size: 11.5px !important; color: #7fe7ff; background: none; border: 1px solid #1b3540; border-image: none; border-radius: 6px; }
.mdx-full { max-height: 34vh; overflow: auto; padding-right: 4px; font-size: 11.5px; }
.mdx-full[hidden] { display: none; }
.mdx-full > .detail-image, .mdx-full > h3, .mdx-full > .detail-rarity, .mdx-full > .item-summary-stats + .decision-stats ~ dl:empty { display: none; }
.mdx-vs { justify-content: flex-start; }
/* hover compare card */
.inv-tip { position: fixed; z-index: 2147483000; width: 230px; padding: 10px; border: 1px solid var(--rarity, #2c5361); border-radius: 10px; background: #071219f2; box-shadow: 0 12px 30px #000c; pointer-events: none; display: grid; gap: 6px; font-size: 12px; }
.inv-tip[hidden] { display: none; }
.inv-tip > strong { font-size: 13px; }
.inv-tip .rarity-pill { justify-self: start; }
/* extra phone tiles: Battle Lab, Admin */
.online-portrait.demo-desk .phone-grid .tab-extra {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; aspect-ratio: 1 / .86; margin: 0; padding: 6px 4px;
  font-size: 11px; font-weight: 600; color: #d9eaf0; background: linear-gradient(180deg, #123542 0%, #0c2631 100%); border: 1px solid #23505f; border-image: none; border-radius: 8px; box-shadow: inset 0 1px 0 #ffffff12;
}
.online-portrait.demo-desk .phone-grid .tab-extra:hover { border-color: #4fd2ea; }
.online-portrait.demo-desk .phone-grid .tab-extra .tab-icon { width: 28px !important; height: 28px !important; image-rendering: pixelated; }
.online-portrait.demo-desk .phone-grid .tab-extra.is-admin { background: linear-gradient(180deg, #3a2a10 0%, #251a08 100%); border-color: #8a6420; color: #ffd27a; }
@media (min-width: 900px) and (max-height: 840px) { .online-portrait.demo-desk .phone-grid .tab-extra { aspect-ratio: 1 / .62; gap: 3px; } .online-portrait.demo-desk .phone-grid .tab-extra .tab-icon { width: 24px !important; height: 24px !important; } }
body:not(.demo-desk) .tabs .tab-extra { flex: 0 0 94px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; }
/* feature dialogs */
.feature-dialog { width: min(460px, calc(100vw - 24px)); }
.admin-grid, .lab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin: 10px 0; }
.admin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-grid label, .lab-grid label { display: grid; gap: 4px; font-size: 11px; color: #9fb4bf; }
.admin-grid input, .lab-grid select { min-height: 32px; width: 100%; }
.lab-grid .lab-check { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 12px; color: #d9eaf0; }
.admin-actions { display: flex; gap: 8px; }
.admin-actions button { flex: 1; min-height: 36px; }
body.lab-active .combat-frame::after { content: "BATTLE LAB · no cost · no rewards"; position: absolute; left: 50%; top: 150px; transform: translateX(-50%); padding: 2px 10px; border: 1px solid #ffb35c; border-radius: 999px; font: 700 10px/16px system-ui, sans-serif; letter-spacing: .08em; color: #ffb35c; background: #1d1408cc; pointer-events: none; z-index: 5; }

@media (min-width: 900px) {
  .online-portrait #inventory-workbench > .inventory-pane::before { content: none; }
  .online-portrait #view-fleet .inventory-pane > .bag-meter { margin: 0; justify-content: flex-start; }
  .online-portrait #view-fleet .inventory-pane > .bag-meter .bag-track { flex: 1; width: auto; }
}
.mdx-full .item-stats div, .mdx-full dt, .mdx-full dd { font-size: 11.5px !important; }
.mdx-full .item-stats { margin: 6px 0; }
.online-portrait #action-notices.is-empty { display: none !important; }
.online-portrait #action-notices [data-notice][hidden] { display: none !important; }

/* ===== Oct 16 late: Exchange (testing), layout fixes, Void HUD ===== */
.online-portrait.demo-desk .phone-grid .tab-extra.is-test { border-color: #6b5a1f; }
.tab-extra .test-chip { position: absolute; top: 4px; right: 4px; padding: 0 4px; border-radius: 3px; font: 800 8px/13px system-ui, sans-serif; letter-spacing: .06em; color: #04141a; background: #ffb35c; }
/* consumables / materials use full-width cards, not the 76 px module grid */
.online-portrait #module-inventory[data-category="consumables"], .online-portrait #module-inventory[data-category="materials"] { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important; }
.online-portrait #module-inventory[data-category="consumables"] > *, .online-portrait #module-inventory[data-category="materials"] > * { width: auto !important; min-width: 0; writing-mode: horizontal-tb; }
.online-portrait #module-inventory[data-category="consumables"] button { white-space: normal; width: 100%; }
/* Acquire / Workshop body under the toolbar */
.online-portrait #ship-workshop { margin-top: 8px; }
.online-portrait #ship-acquire-view[hidden], .online-portrait #view-fleet.is-workshop #ship-acquire-view { display: none !important; } /* Nov 1: never under Owned Ships */
.online-portrait #ship-acquire-view { display: grid !important; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 14px; align-items: start; }
.online-portrait #ship-acquire-view .acquisition-main { display: grid; gap: 10px; }
/* Void access timer: bottom-left of the field, above the weapon slots */
.online-portrait .combat-frame > #void-hud:not([hidden]) { position: absolute; left: 8px; bottom: calc(var(--weapon-hud-band) + 8px); z-index: 4; min-width: 0; padding: 4px 10px; border: 1px solid #7a4fd1; border-image: none; border-radius: 8px; background: #120a24d9; }
.online-portrait .combat-frame > #void-hud strong { font-size: 12px; }
.rar-word { font-weight: 700; }
/* Exchange window */
.exchange-dialog { width: min(1020px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 40px); overflow: auto; padding: 12px 16px 16px; }
.ex-head { align-items: center; margin-bottom: 8px; }
.ex-head h2 { margin: 0; }
.ex-test { margin-right: auto; margin-left: 10px; padding: 2px 8px; border: 1px solid #ffb35c; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .08em; color: #ffb35c; }
.ex-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ex-pairs, .ex-intervals, .ex-side { display: flex; gap: 4px; padding: 3px; border: 1px solid #1b3540; border-radius: 10px; background: #050e12; }
.ex-pairs button, .ex-intervals button, .ex-side button { min-height: 30px; padding: 0 12px; border: 0; border-image: none; border-radius: 7px; background: transparent; color: #9fb4bf; font-size: 12px; font-weight: 700; }
.ex-pairs button.is-active, .ex-intervals button.is-active { background: #ffcf7a; color: #1a1200; }
.ex-intervals { margin-left: auto; }
.ex-price strong { font-size: 26px; font-variant-numeric: tabular-nums; color: #f4f7fb; }
.ex-price span { font-size: 12px; color: #9fb4bf; }
.ex-price em { margin-left: 10px; font-style: normal; font-weight: 700; font-size: 12px; } .ex-price em.up { color: #3ddc97; } .ex-price em.down { color: #ff5a5f; }
.ex-sub { margin: 6px 0 8px; font-size: 11.5px; color: #7f9ca8; }
.ex-chart-wrap { position: relative; border: 1px solid #1b3540; border-radius: 10px; background: #050c10; padding: 6px 0; }
#ex-chart { display: block; width: 100%; height: 240px; }
.ex-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #7f9ca8; font-size: 13px; }
.ex-empty[hidden] { display: none; }
.ex-grid { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 10px; margin-top: 10px; }
.ex-card { border: 1px solid #1b3540; border-radius: 10px; background: #06141b; padding: 10px; min-width: 0; }
.ex-card h3 { margin: 0 0 6px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #9fdcef; }
.ex-book-head, .ex-row, .ex-trade { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.ex-book-head { color: #7f9ca8; font-size: 10.5px; padding: 0 6px 4px; } .ex-card:first-child .ex-book-head, .ex-row { grid-template-columns: 1fr 1fr; }
.ex-row { width: 100%; min-height: 22px; padding: 2px 6px; border: 0; border-image: none; border-radius: 4px; text-align: left; cursor: pointer; background: linear-gradient(to left, var(--bar) var(--depth), transparent var(--depth)); }
.ex-row.ask { --bar: #ff5a5f22; color: #ff8a8e; } .ex-row.bid { --bar: #3ddc9722; color: #6ff0b8; }
.ex-row span:last-child { text-align: right; color: #d9eaf0; }
.ex-spread { padding: 4px 6px; font-size: 11px; color: #7f9ca8; border-block: 1px solid #1b3540; margin: 4px 0; }
.ex-book, .ex-trades { display: grid; gap: 1px; max-height: 190px; overflow: auto; }
.ex-trade { padding: 2px 6px; } .ex-trade.buy span:first-child { color: #6ff0b8; } .ex-trade.sell span:first-child { color: #ff8a8e; } .ex-trade.mine { background: #0c2631; border-radius: 4px; }
.ex-trade span:nth-child(3) { text-align: right; color: #7f9ca8; }
.ex-form { display: grid; gap: 7px; align-content: start; }
.ex-side { width: 100%; } .ex-side button { flex: 1; }
.ex-side button[data-side="buy"].is-active { background: #3ddc97; color: #04140c; } .ex-side button[data-side="sell"].is-active { background: #ff5a5f; color: #fff; }
.ex-form label { display: grid; gap: 3px; font-size: 11px; color: #9fb4bf; } .ex-form label small { color: #7f9ca8; }
.ex-form input { min-height: 32px; font-size: 13px; }
.ex-total { display: flex; justify-content: space-between; margin: 0; font-size: 12px; color: #9fb4bf; } .ex-total strong { color: #f4f7fb; }
.ex-avail { margin: 0; font-size: 11px; color: #7f9ca8; } .ex-avail b { color: #d9eaf0; }
#ex-place { min-height: 38px; font-weight: 800; background: #3ddc97; color: #04140c; border-image: none; border: 0; border-radius: 8px; }
.exchange-dialog.is-sell #ex-place { background: #ff5a5f; color: #fff; }
.ex-mine { display: grid; gap: 3px; max-height: 150px; overflow: auto; }
.ex-order { display: grid; grid-template-columns: 42px 52px 1fr 48px 62px; gap: 6px; align-items: center; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ex-order button { min-height: 22px; padding: 0 6px; font-size: 10.5px; } .ex-order em { font-style: normal; color: #7f9ca8; font-size: 10.5px; }
.ex-tag { padding: 1px 5px; border-radius: 4px; font-size: 10px; font-weight: 800; text-align: center; } .ex-tag.buy { background: #3ddc9733; color: #6ff0b8; } .ex-tag.sell { background: #ff5a5f33; color: #ff8a8e; }
.ex-locks { margin: 0; font-size: 11px; color: #ffcf7a; }
@media (max-width: 899px) { .ex-grid { grid-template-columns: 1fr; } .ex-intervals { margin-left: 0; } }
.online-portrait.demo-desk .inv-toolbar #module-count { display: none; }
.online-portrait #ship-workshop:has(#ship-acquire-view:not([hidden])) .workshop-bands { display: none; }
.ex-order button { white-space: nowrap; height: 22px; min-height: 22px !important; padding: 0 8px; border: 1px solid #2c5361; border-image: none; border-radius: 4px; background: #0c2631; color: #d9eaf0; }
.online-portrait .rarity-name[style*="--rarity"], .online-portrait [style*="--rarity"] > .rarity-name, .online-portrait .odds-row .rarity-name { color: var(--rarity); font-weight: 700; }
.ex-permit { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid #ffb35c; border-radius: 8px; background: #1d1408; font-size: 11.5px; color: #ffcf7a; }
.ex-permit strong { font-size: 12.5px; color: #ffcf7a; } .ex-permit span { color: #d9c49a; }
.ex-permit.is-active { grid-template-columns: 1fr auto; align-items: center; border-color: #2c5361; background: #06141b; }
.ex-permit .ex-permit-ok { color: #6ff0b8; font-weight: 700; }
.ex-permit button { min-height: 28px; font-size: 11.5px; }
.ex-fees { display: grid; gap: 2px; padding: 6px 8px; border: 1px solid #1b3540; border-radius: 6px; background: #050e12; }
.ex-fees p { display: flex; justify-content: space-between; margin: 0; font-size: 11.5px; color: #9fb4bf; } .ex-fees strong { color: #d9eaf0; font-variant-numeric: tabular-nums; }
.ex-fees .ex-net { padding-top: 3px; margin-top: 2px; border-top: 1px dashed #1b3540; font-size: 12.5px; } .ex-fees .ex-net strong { color: #fff; }
/* PWR ranking (Oct17) */
.online-earnings .earn-rank-btn { width: 100%; margin-top: 8px; min-height: 30px; font-size: 12px; }
#earn-ranking { width: min(560px, calc(100vw - 32px)); }
.earn-you-row { margin: 6px 0 10px; padding: 8px 10px; border: 1px solid #b4882f; border-radius: 6px; background: #1d1408; color: #ffcf7a; font-size: 12.5px; }
.earn-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.earn-table th { padding: 5px 6px; border-bottom: 1px solid #1b3540; color: #7fa2b0; font-size: 10.5px; letter-spacing: .08em; text-align: right; text-transform: uppercase; }
.earn-table td { padding: 5px 6px; border-bottom: 1px solid #0f2129; color: #cfe2ea; text-align: right; }
.earn-table th:nth-child(2), .earn-table td:nth-child(2) { text-align: left; } .earn-table th:first-child, .earn-table td:first-child { text-align: center; width: 34px; }
.earn-table tr.is-you td { background: #2a1d07; color: #ffd98a; font-weight: 700; }
.earn-table td:last-child { color: #6ff0b8; }
.earn-sim { margin-left: 4px; padding: 0 4px; border: 1px solid #2c5361; border-radius: 3px; color: #7fa2b0; font-size: 9.5px; font-style: normal; letter-spacing: .06em; }
/* Genesis Modification rarity (Oct17) */
.mod-rarity { display: inline-block; padding: 0 6px; border-radius: 4px; font: 800 10px/16px system-ui, sans-serif; letter-spacing: .05em; text-transform: uppercase; color: #04141a; background: #a9b4bf; vertical-align: 1px; }
.mod-rarity.rarity-uncommon { background: #64f2c7; } .mod-rarity.rarity-rare { background: #57b8ff; } .mod-rarity.rarity-epic { background: #d787ff; } .mod-rarity.rarity-legendary { background: #ffca63; }
.rarity-name-common { color: #a9b4bf; } .rarity-name-uncommon { color: #64f2c7; } .rarity-name-rare { color: #57b8ff; } .rarity-name-epic { color: #d787ff; } .rarity-name-legendary { color: #ffca63; }
.genesis-mod-badge.rarity-uncommon { border-color: #64f2c7; color: #64f2c7; } .genesis-mod-badge.rarity-rare { border-color: #57b8ff; color: #57b8ff; } .genesis-mod-badge.rarity-epic { border-color: #d787ff; color: #d787ff; }
.genesis-tier-rules { margin: 4px 0 8px; padding-left: 18px; font-size: 12px; }
#ex-place { width: 100%; }
#ex-place:disabled { opacity: .45; cursor: not-allowed; }
.ex-permit.is-active .ex-permit-ok { white-space: nowrap; }
/* Admin feature flags (Oct17) */
.admin-h { margin: 14px 0 4px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #9fdcef; }
.admin-flags { display: grid; gap: 6px; }
.flag-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid #1b3540; border-radius: 6px; background: #06141b; }
.flag-row small { display: block; color: #7fa2b0; font-size: 11px; } .flag-row b { color: #d9eaf0; }
.flag-row .flag-stage { padding: 0 5px; border: 1px solid #2c5361; border-radius: 3px; font-size: 10px; color: #9fb4bf; text-transform: uppercase; }
.flag-row .flag-state { font-weight: 800; color: #ff8b9c; } .flag-row.is-on .flag-state { color: #6ff0b8; }
.flag-row button { min-height: 28px; font-size: 11.5px; }
/* ---- Rewards: chests, galaxy boss card, Arch Ship (Oct17) ---- */
.tab-extra .tile-badge { position: absolute; top: 4px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff5f78; color: #fff; font: 800 11px/18px system-ui, sans-serif; }
.tab-extra.is-chests, .tab-extra.is-arch { position: relative; }
.online-portrait.demo-desk .phone-grid .tab-extra.is-arch { border-color: #ff8a3d; background: linear-gradient(180deg, #3a1a0c 0%, #1d0d06 100%); color: #ffd2a6; }
.event-chip { background: #ff8a3d !important; color: #1d0d06 !important; }
.tab-icon[src*="chests/"], .chest-card img, .chest-odds img, .reveal-head img, .gb-reward img, .arch-mine img, .cine-chest img, .reveal-list img { image-rendering: pixelated; }
.chests-dialog { width: min(620px, calc(100vw - 32px)); }
.chest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; margin: 8px 0; }
.chest-card { display: grid; justify-items: center; gap: 3px; padding: 10px 8px; border: 1px solid var(--rc, #a9b4bf); border-radius: 8px; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rc, #a9b4bf) 22%, transparent), #06141b 70%); color: #d9eaf0; cursor: pointer; }
.chest-card img { width: 64px; height: 64px; filter: drop-shadow(0 0 10px var(--rc, #a9b4bf)); }
.chest-card small { color: #9fb4bf; font-size: 10.5px; text-align: center; } .chest-card .chest-open { margin-top: 2px; padding: 2px 12px; border-radius: 999px; background: var(--rc, #a9b4bf); color: #04141a; font-weight: 800; font-size: 11px; }
.chest-card:hover { transform: translateY(-2px); box-shadow: 0 0 18px color-mix(in srgb, var(--rc) 45%, transparent); }
.chest-card.is-opening img { animation: chest-shake .9s ease-in-out; } @keyframes chest-shake { 0%,100% { transform: none; } 20% { transform: rotate(-10deg) scale(1.1); } 40% { transform: rotate(9deg) scale(1.15); } 60% { transform: rotate(-7deg) scale(1.2); } 80% { transform: rotate(5deg) scale(1.25); filter: brightness(2) drop-shadow(0 0 20px var(--rc)); } }
.rarity-common { --rc: #a9b4bf; } .rarity-uncommon { --rc: #64f2c7; } .rarity-rare { --rc: #57b8ff; } .rarity-epic { --rc: #d787ff; } .rarity-legendary { --rc: #ffca63; }
.chest-empty { padding: 18px; text-align: center; color: #7fa2b0; border: 1px dashed #1b3540; border-radius: 8px; }
.chest-reveal { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--rc, #1b3540); border-radius: 8px; background: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--rc, #1b3540) 25%, transparent), #050e12 70%); animation: reveal-in .4s ease-out; }
.reveal-head { display: flex; align-items: center; gap: 8px; } .reveal-head img { width: 40px; height: 40px; } .reveal-head strong { font-size: 15px; color: var(--rc, #fff); }
.reveal-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; } .reveal-list li { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; background: #071820; opacity: 0; animation: reveal-in .35s ease-out forwards; animation-delay: calc(var(--i) * .18s); font-size: 12.5px; }
.reveal-list li img { width: 22px; height: 22px; } .reveal-list li small { color: #7fa2b0; }
@keyframes reveal-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chest-odds { margin-top: 8px; font-size: 12px; color: #9fb4bf; } .chest-odds ul { margin: 6px 0 0; padding-left: 0; list-style: none; display: grid; gap: 4px; } .chest-odds img { width: 20px; height: 20px; vertical-align: -5px; margin-right: 4px; }
.galaxy-boss-card { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; margin: 6px 0 8px; padding: 8px 10px; border: 1px solid #5a2a32; border-radius: 8px; background: linear-gradient(90deg, #1f0d12, #0a1218); }
.galaxy-boss-card.is-won { border-color: #2c6150; background: linear-gradient(90deg, #0c1f18, #0a1218); }
.gb-sprite { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 0 8px #ff5f7866); } .is-won .gb-sprite { filter: grayscale(.6) drop-shadow(0 0 6px #6ff0b866); }
.gb-text { display: grid; gap: 2px; font-size: 12px; } .gb-text small { color: #ff8b9c; font-size: 10px; letter-spacing: .1em; } .is-won .gb-text small { color: #6ff0b8; }
.gb-text strong { font-size: 15px; color: #fff; } .gb-text > span { color: #9fb4bf; } .gb-reward, .gb-won { margin: 2px 0 0; font-size: 12px; color: #d9eaf0; } .gb-reward img { width: 20px; height: 20px; vertical-align: -5px; } .gb-won { color: #6ff0b8; }
.boss-win-dialog { width: min(460px, calc(100vw - 32px)); } .bw-hero { display: flex; align-items: center; gap: 12px; } .bw-hero img { width: 110px; height: 110px; object-fit: contain; filter: drop-shadow(0 0 14px #ff5f78); }
.bw-hero small { color: #ffcf7a; letter-spacing: .12em; font-size: 10.5px; } .bw-hero strong { display: block; font-size: 22px; color: #fff; }
/* Arch Ship dialog */
.arch-dialog { width: min(640px, calc(100vw - 32px)); border-color: #ff8a3d !important; }
.arch-title { letter-spacing: .14em; color: #ffd2a6; }
.arch-hero { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 10px; background: radial-gradient(circle at 18% 50%, #5a2410 0%, #12070a 60%); border: 1px solid #5a2a14; }
.arch-hero img { width: 140px; height: 140px; object-fit: contain; filter: drop-shadow(0 0 16px #ff8a3d); } /* Nov 1: no float (read as vibrating) */
@keyframes arch-float { 50% { transform: translateY(6px); } }
.arch-hero-text { display: grid; gap: 3px; } .arch-hero-text small { color: #ff8a3d; letter-spacing: .12em; font-size: 10.5px; } .arch-hero-text strong { font-size: 20px; color: #fff; } .arch-hero-text span { color: #d9c4b0; font-size: 12.5px; } .arch-hero-text em { color: #9fb4bf; font-size: 11.5px; font-style: normal; }
.arch-life { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 10px 0; }
.arch-seg { position: relative; height: 26px; border: 1px solid #3a1f14; border-radius: 4px; background: #120a08; overflow: hidden; }
.arch-seg i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ff5f2e, #ffb35c); } .arch-seg.is-done i { background: #4a2a1a; }
.arch-seg span { position: relative; display: block; padding: 0 6px; font: 700 10.5px/26px system-ui, sans-serif; color: #fff; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arch-seg.is-now { border-color: #ff8a3d; box-shadow: 0 0 10px #ff8a3d66; }
.arch-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; } .arch-stats div { padding: 6px 8px; border: 1px solid #1b3540; border-radius: 6px; background: #06141b; } .arch-stats span { display: block; color: #7fa2b0; font-size: 10.5px; } .arch-stats strong { font-size: 15px; color: #fff; }
.arch-go { width: 100%; min-height: 40px; font-size: 14px; letter-spacing: .06em; background: linear-gradient(180deg, #ff8a3d, #d9531d) !important; color: #1d0d06 !important; border: 0 !important; }
.arch-go:disabled { opacity: .45; }
.arch-mine { display: grid; gap: 4px; margin: 8px 0; } .arch-mine div { display: grid; grid-template-columns: 70px 60px 1fr 22px 70px; gap: 6px; align-items: center; padding: 4px 8px; border-radius: 6px; background: #071820; font-size: 12px; } .arch-mine img { width: 20px; height: 20px; }
.arch-rank-btn { width: 100%; margin: 6px 0; min-height: 30px; }
@media (max-width: 560px) { .arch-stats { grid-template-columns: repeat(2, 1fr); } .arch-hero { grid-template-columns: 90px 1fr; } .arch-hero img { width: 90px; height: 90px; } }
/* Arch Ship cinematic overlay */
body.arch-active .combat-frame .combat-top-hud { opacity: .25; } body.arch-active #boss-hud { display: none !important; }
.arch-cine { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.arch-cine .cine-bar { display: none; } /* Nov 1: the letterbox bars covered the HP strip ("ui of the archship is broken") */ .cine-bar.top { top: 0; } .cine-bar.bottom { bottom: 0; }
@keyframes bars-in { from { height: 0; } }
.cine-title { position: absolute; left: 0; right: 0; top: 34%; display: grid; justify-items: center; gap: 2px; text-align: center; animation: title-card 3.2s ease-in-out forwards; }
.cine-title small { color: #ff8a3d; letter-spacing: .3em; font-size: 11px; } .cine-title strong { font: 900 34px/1.05 system-ui, sans-serif; letter-spacing: .18em; color: #fff; text-shadow: 0 0 18px #ff5f2e, 0 0 40px #ff5f2e88; }
.cine-title em { font-style: normal; color: #ffd2a6; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; } .cine-title span { color: #d9c4b0; font-size: 12px; max-width: 80%; }
@keyframes title-card { 0% { opacity: 0; transform: scale(1.15); } 15%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-20px); } }
.cine-dmg { position: absolute; top: calc(9% + 8px); right: 12px; display: grid; justify-items: end; } .cine-dmg span { color: #ff8a3d; font-size: 10px; letter-spacing: .2em; } .cine-dmg strong { font: 900 30px/1 system-ui, sans-serif; color: #fff; text-shadow: 0 0 12px #ff5f2e; font-variant-numeric: tabular-nums; } .cine-dmg em { color: #ffcf7a; font-size: 11px; font-style: normal; }
.cine-time { position: absolute; left: 0; right: 0; bottom: 9%; height: 4px; background: #2a1208; } .cine-time i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb35c, #ff3b54); }
.cine-skip { position: absolute; right: 12px; bottom: calc(9% + 12px); pointer-events: auto; min-height: 28px; padding: 0 12px; border-radius: 999px; background: #000a !important; border: 1px solid #ff8a3d !important; color: #ffd2a6 !important; font-size: 12px; }
.arch-cine.is-enraged::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 120px 30px #ff1f3a88; animation: enrage 0.7s ease-in-out infinite alternate; } @keyframes enrage { to { box-shadow: inset 0 0 160px 50px #ff1f3acc; } }
.combat-frame.cine-shake { animation: cine-shake .35s; } @keyframes cine-shake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -4px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, -1px); } }
.cine-result { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(340px, 86%); display: grid; justify-items: center; gap: 6px; padding: 16px; border: 1px solid #ff8a3d; border-radius: 12px; background: #0b0605ee; pointer-events: auto; text-align: center; animation: reveal-in .4s ease-out; }
.cine-result small { color: #ff8a3d; letter-spacing: .16em; font-size: 10.5px; } .cine-result strong { font: 900 28px/1.1 system-ui, sans-serif; color: #fff; } .cine-result p { margin: 0; color: #d9c4b0; font-size: 12px; }
.cine-chest { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--rc); border-radius: 8px; background: color-mix(in srgb, var(--rc) 14%, #000); } .cine-chest img { width: 40px; height: 40px; filter: drop-shadow(0 0 10px var(--rc)); }
.cine-actions { display: flex; gap: 8px; } .cine-actions button { min-height: 32px; }
/* ---- Jobs, away report, locked balances, bound modules, roll range (Oct17) ---- */
.jobs-button { cursor: pointer; } .jobs-button:hover { border-color: #4fd2ea !important; }
.jobs-pop { position: fixed; z-index: 60; width: 350px; max-height: 70vh; overflow: auto; padding: 10px 12px; border: 1px solid #2c5361; border-radius: 10px; background: #071219f2; box-shadow: 0 12px 40px #000a; }
.jobs-pop header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; } .jobs-pop header strong { color: #fff; font-size: 14px; } .jobs-pop header button { min-height: 24px; width: 24px; padding: 0; }
.jobs-pop .job { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 6px 4px; border-bottom: 1px solid #10242d; }
.jobs-pop .job img { width: 24px; height: 24px; image-rendering: pixelated; object-fit: contain; } .jobs-pop .job b { display: block; color: #e6f3f8; font-size: 12.5px; } .jobs-pop .job small { color: #7fa2b0; font-size: 11px; }
.jobs-pop .job i { display: block; height: 3px; margin-top: 3px; border-radius: 2px; background: linear-gradient(90deg, #4fd2ea var(--p), #12303b var(--p)); }
.jobs-pop .job span { font: 700 12.5px/1 ui-monospace, monospace; color: #ffcf7a; } .jobs-pop .job.is-passive span { color: #6ff0b8; }
.locked-chip { position: absolute; right: 6px; bottom: 3px; font-style: normal; font-size: 10.5px; color: #ffcf7a; } header article { position: relative; }
.away-dialog { width: min(440px, calc(100vw - 32px)); } .away-list li { justify-content: space-between; } .away-list li span { flex: 1; } .away-list b.gain { color: #6ff0b8; } .away-list b.loss { color: #ff8b9c; }
.bound-tag { margin: 4px 0; padding: 4px 8px; border: 1px solid #ffb35c; border-radius: 6px; background: #1d1408; color: #ffcf7a; font-size: 11.5px; font-weight: 700; }
.roll-box { margin: 6px 0; padding: 6px 8px; border: 1px solid #1b3540; border-radius: 6px; background: #050e12; font-size: 11.5px; color: #9fb4bf; } .roll-box p { margin: 0 0 4px; }
.roll-box ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; } .roll-box li { display: grid; grid-template-columns: 1fr auto; } .roll-box li small { grid-column: 1 / -1; color: #6f8a96; font-size: 10.5px; } .roll-box li b { color: #e6f3f8; }
#module-inventory .inventory-tile.is-bound::after { content: "🔒"; position: absolute; left: 3px; top: 2px; font-size: 11px; filter: drop-shadow(0 0 2px #000); }
.away-dialog .admin-actions { margin-top: 12px; }
/* ---- Marketplace tabs + equipment market, Community (Oct17) ---- */
.market-tabs, .cm-tabs, .cm-sub { display: flex; gap: 4px; margin: 6px 0 10px; } .market-tabs button, .cm-tabs button, .cm-sub button { min-height: 30px; padding: 0 14px; border-radius: 6px; }
.market-tabs button.is-active, .cm-tabs button.is-active, .cm-sub button.is-active { background: #4fd2ea !important; color: #04141a !important; border-color: #4fd2ea !important; font-weight: 800; }
.equipment-market { display: grid; grid-template-columns: 260px 1fr; gap: 12px; } @media (max-width: 760px) { .equipment-market { grid-template-columns: 1fr; } }
.eqm-sell { display: grid; gap: 6px; align-content: start; padding: 10px; border: 1px solid #1b3540; border-radius: 8px; background: #06141b; } .eqm-sell h3, .eqm-main h3 { margin: 0 0 4px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #9fdcef; }
.eqm-sell label, .eqm-filters label { display: grid; gap: 2px; font-size: 11.5px; color: #7fa2b0; } .eqm-quote { margin: 0; font-size: 12px; color: #cfe2ea; }
.eqm-filters { display: flex; gap: 6px; align-items: end; margin-bottom: 8px; flex-wrap: wrap; } .eqm-filters button { min-height: 32px; }
.eqm-grid { display: grid; gap: 6px; max-height: 420px; overflow: auto; }
.eqm-card { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid color-mix(in srgb, var(--rarity) 55%, #1b3540); border-radius: 8px; background: linear-gradient(90deg, color-mix(in srgb, var(--rarity) 14%, #06141b), #06141b 60%); }
.eqm-card > :first-child { width: 44px; height: 44px; } .eqm-card small { display: block; color: #8fa9b4; font-size: 11px; } .eqm-buy { display: grid; justify-items: end; gap: 4px; } .eqm-buy strong { color: #6ff0b8; font-variant-numeric: tabular-nums; } .eqm-buy button { min-height: 28px; }
.eqm-mine { display: grid; gap: 3px; } .eqm-mine div { display: grid; grid-template-columns: 1fr 80px 90px; gap: 6px; padding: 3px 6px; border-radius: 4px; background: #071820; font-size: 12px; }
.community-dialog { width: min(720px, calc(100vw - 32px)); } .cm-body { max-height: 66vh; overflow: auto; }
.cm-news { padding: 8px 10px; margin-bottom: 6px; border: 1px solid #1b3540; border-radius: 8px; background: #06141b; } .cm-news small { color: #7fa2b0; font-size: 11px; } .cm-news b { display: block; color: #fff; font-size: 14px; } .cm-news p { margin: 4px 0 0; color: #cfe2ea; font-size: 12.5px; }
.cm-ref { display: grid; gap: 4px; padding: 10px; border: 1px solid #b4882f; border-radius: 8px; background: #1d1408; } .cm-ref small { color: #ffcf7a; letter-spacing: .14em; font-size: 10.5px; } .cm-ref strong { font: 900 26px/1 ui-monospace, monospace; color: #fff; letter-spacing: .12em; }
.cm-link { display: flex; gap: 6px; } .cm-link input { flex: 1; } .cm-rules { margin: 8px 0; padding-left: 18px; font-size: 12.5px; color: #cfe2ea; display: grid; gap: 3px; }
.cm-engage { display: grid; gap: 6px; padding: 8px 10px; margin-bottom: 6px; border: 1px solid #1b3540; border-radius: 8px; background: #06141b; } .cm-engage a { color: #83e9ff; word-break: break-all; } .cm-engage small { display: block; color: #9fb4bf; } .cm-reward { color: #ffcf7a; font-size: 12px; font-weight: 700; }
.cm-submit { display: flex; gap: 6px; } .cm-submit input { flex: 1; } .cm-status { font-style: normal; font-weight: 700; font-size: 12px; } .cm-status.pending { color: #ffcf7a; } .cm-status.approved { color: #6ff0b8; } .cm-status.rejected { color: #ff8b9c; }
.cm-admin { display: grid; gap: 6px; padding: 10px; margin-bottom: 8px; border: 1px solid #5a2a32; border-radius: 8px; background: #12080b; } .cm-admin h3 { margin: 0; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: #ff8b9c; }
.cm-admin textarea { resize: vertical; } .cm-row { display: flex; gap: 6px; align-items: center; font-size: 12px; color: #cfe2ea; } .cm-row span { flex: 1; word-break: break-all; } .cm-row button { min-height: 26px; }
#market-tabs button.is-active, #cm-tabs button.is-active, .community-dialog .cm-sub button.is-active { border-image: none !important; border: 1px solid #4fd2ea !important; background: #4fd2ea !important; background-image: none !important; color: #04141a !important; border-color: #4fd2ea !important; box-shadow: 0 0 10px #4fd2ea55; }
/* Connect X + Share on X (Oct17) */
.cm-xlink { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 0 0 10px; padding: 8px 10px; border: 1px solid #285268; background: #071820; font-size: 13px; }
.cm-share { margin: 10px 0; } .cm-share .button { display: inline-block; text-decoration: none; padding: 8px 14px; }
/* Void portal sale (Oct17) */
.store-price s { color: var(--muted); font-size: 12px; }
.store-sale { color: #ffcf5a; font-style: normal; font-weight: 700; font-size: 12px; }
/* Epic Boxes in the Chests dialog (Oct17) */
.box-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.box-actions input { width: 7em; }
.chest-card.is-box { cursor: default; }
/* Daily rewards (Oct17): 7-day login calendar + share card */
.daily-dialog { width: min(920px, calc(100vw - 24px)); }
.daily-body { display: grid; gap: 18px; padding: 4px 2px 6px; }
.daily-body section > header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.daily-body section > header span { color: #9fc3d1; font-size: 13px; }
.daily-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.daily-day { display: grid; justify-items: center; align-content: start; gap: 6px; padding: 10px 6px; min-height: 118px; text-align: center; border: 1px solid #23414f; border-radius: 4px; background: linear-gradient(180deg, #0c1c27, #08131b); }
.daily-day small { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #8fb2c1; }
.daily-day img { width: 36px; height: 36px; image-rendering: pixelated; }
.daily-day b { font-size: 12px; line-height: 1.25; }
.daily-day em { font-style: normal; font-size: 11px; color: #71ecff; }
.daily-day.is-today { border-color: #f2c35b; box-shadow: 0 0 14px #f2c35b66; }
.daily-day.is-today em { color: #f2c35b; }
.daily-day.is-done { opacity: .55; }
.daily-day.is-chest { border-color: #4f8cff; }
.daily-claim { margin-top: 12px; min-width: 200px; }
.daily-share canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 1px solid #23414f; border-radius: 4px; background: #02060c; }
.daily-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.daily-msg { min-height: 1.2em; margin: 0; color: #f2c35b; }
.tab-extra.is-daily .tile-badge { background: #f2c35b; color: #1b1406; }
@media (max-width: 640px) { .daily-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .daily-day { min-height: 104px; } }
/* Tradable vs locked tags (Oct17: "a visible distinction if it's tradable or not") */
.trade-tag { display: inline-block; margin: 2px 0; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; vertical-align: middle; }
.trade-tag.is-tradable { color: #7dffb0; border: 1px solid #2f8a5a; background: #0b2a1c; }
.trade-tag.is-bound { color: #ffd27a; border: 1px solid #8a6a2f; background: #2a200b; }
.bound-tag.is-tradable { color: #7dffb0; }
.chest-reveal .reveal-head small { margin-left: auto; color: #9fc3d1; font-size: 11px; }
.chest-card .trade-tag { margin-top: 2px; }
/* Bug report form (Oct17) */
.cm-bug { display: grid; gap: 8px; margin: 8px 0 14px; }
.cm-bug label { display: grid; gap: 4px; font-size: 12px; color: #9fc3d1; }
.cm-bug input, .cm-bug select, .cm-bug textarea { width: 100%; }
.cm-bugrow small { color: #9fc3d1; white-space: pre-wrap; }
.cm-bugrow input { max-width: 220px; }
/* Guide, in-game Terms, event banner (Oct17) */
.pilot-guide-dialog { width: min(760px, calc(100vw - 24px)); }
.pilot-guide-dialog .guide-body, #pg-body { padding: 6px 2px 4px; }
.guide-steps, .guide-terms { display: grid; gap: 10px; padding-left: 22px; margin: 6px 0 12px; line-height: 1.45; }
.guide-lede { margin: 6px 0 10px; }
.guide-banner { margin: 4px 0 12px; padding: 8px 10px; border: 1px solid #8a6a2f; border-radius: 4px; background: #2a200b; color: #ffd27a; }
.guide-flags { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 16px; padding: 0; list-style: none; }
.guide-flags li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border: 1px solid #23414f; border-radius: 4px; }
.guide-on, .guide-off { font-style: normal; font-weight: 700; font-size: 11px; text-transform: uppercase; }
.guide-on { color: #7dffb0; } .guide-off { color: #ff8f8f; }
.guide-ok { color: #7dffb0; font-weight: 700; }
.guide-dialog .terms-check { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.event-banner { position: relative; z-index: 5; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 6px 12px; font-size: 12px; color: #ffd27a; background: linear-gradient(90deg, #2a200b, #3a2b0c, #2a200b); border-bottom: 1px solid #8a6a2f; }
.event-banner b { letter-spacing: .08em; text-transform: uppercase; }
.event-banner button { padding: 2px 10px; font-size: 11px; }
#guide-accept { display: block; margin-top: 8px; min-width: 200px; }
.cm-admin textarea, .cm-bug textarea { font-family: inherit; }
@media (max-width: 700px) { .event-banner { flex-wrap: nowrap; gap: 8px; padding: 3px 8px; font-size: 11px; } .event-banner span { display: none; } .event-banner button { padding: 1px 8px; font-size: 10px; } }
.pilot-guide-dialog .cm-tabs { display: flex; flex-wrap: wrap; gap: 6px; } .pilot-guide-dialog .cm-tabs button { white-space: nowrap; padding: 6px 12px; }
.market-tabs, .cm-tabs, .cm-sub { flex-wrap: wrap; } .market-tabs button, .cm-tabs button, .cm-sub button { white-space: nowrap; flex: 0 0 auto; }
#pg-tabs button.is-active { border-image: none !important; border: 1px solid #4fd2ea !important; background: #4fd2ea !important; color: #04141a !important; }
@media (max-width: 700px) { .tabs button { word-break: keep-all; overflow-wrap: normal; hyphens: none; } .tabs .tab-extra { font-size: 10px; letter-spacing: 0; } }
/* Epic Box: two ways to open (Oct17) */
.box-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.box-choice { display: grid; gap: 3px; text-align: left; padding: 10px 12px; border: 1px solid #2c5361; border-radius: 8px; background: #0f1d24; color: var(--text, #e6f1f5); cursor: pointer; }
.box-choice b { font-size: 16px; } .box-choice span { font-size: 12px; } .box-choice small { color: #8aa4b0; font-size: 11px; }
.box-choice.is-pwr { border-color: #8b5cc4; background: #1b1426; } .box-choice.is-pwr b { color: #d787ff; }
.box-choice:hover { filter: brightness(1.2); }
@media (max-width: 520px) { .box-choices { grid-template-columns: 1fr; } }

/* ===================== Mobile first (Claude, Oct17; owner: "optimize for mobile first. make sure mobile users get
   the same experience") — phones and small tablets (< 900 px, the desktop "command phone" layout starts at 900). ===== */
@media (max-width: 899px) {
  /* header: the Epoch banner is one slim line, and the Genesis / Notifications buttons sit in the header again
     (they were positioned against the page and hidden under the banner) */
  .online-portrait .shell { position: relative; }
  .event-banner { min-height: 0; height: 30px; padding: 0 10px; gap: 10px; font-size: 11px; }
  .event-banner button { min-height: 0 !important; height: 24px; padding: 0 10px !important; line-height: 22px; font-size: 11px; border-image: none !important; border: 1px solid #8a6a2f !important; border-radius: 6px; background: #1f1708 !important; color: #ffd27a !important; }
  /* the game first: the view scrolls, so the sortie options and the PWR Core panel are reachable under the game */
  .online-portrait #view-combat.is-active { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 96px; scroll-padding-bottom: 96px; }
  .online-portrait #view-combat .combat-options { margin-top: 6px; }
  .online-portrait #view-combat > #online-earnings { display: block; margin: 10px 6px 0; }
  .online-portrait #view-combat > #online-earnings [data-earn="pool"] { font-size: 18px; }
  /* Store, Music, Account in the bottom tab bar, styled like the tabs */
  .online-portrait .tabs .combat-quick-controls { display: contents; }
  .online-portrait .tabs .combat-quick-controls > button, .online-portrait .tabs > #open-account { flex: 0 0 82px; width: 82px; height: 62px; min-height: 0; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 4px; font-size: 10px; }
  .online-portrait .tabs .combat-quick-controls > button img { width: 26px; height: 26px; }
  .online-portrait .tabs > #open-account::before { content: ""; width: 26px; height: 26px; background: url("../assets/ui/items/report.png") center / contain no-repeat; image-rendering: pixelated; }
  /* HUD text that was 9 px */
  .online-portrait .combat-top-hud strong, .online-portrait #combat-hull, .online-portrait #combat-shield, .online-portrait #combat-armor { font-size: 11px; }
}
/* touch screens: the keyboard legend means nothing; the on-screen buttons do the same */
@media (pointer: coarse) { .manual-guide kbd, .manual-guide > span { display: none; } }
@media (max-width: 899px) {
  /* solid bar behind the bottom tabs so scrolled content never shows between them */
  .online-portrait .tabs { background: #050b0f; box-shadow: 0 -8px 12px #050b0f; padding-top: 4px; }
}
/* phone "Menu": pinned at the right end of the bottom bar, opens every command as a grid (src/online-mobile.js) */
#open-menu { display: none; }
@media (max-width: 899px) {
  .online-portrait .tabs > #open-menu { display: inline-flex; position: sticky; right: 0; z-index: 2; flex: 0 0 72px; width: 72px; height: 62px; min-height: 0; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 4px; font-size: 10px; font-weight: 700; color: #04141a; background: linear-gradient(180deg, #ffd27a, #e3a33a) !important; border: 1px solid #ffe6a8 !important; border-image: none !important; box-shadow: -10px 0 12px #050b0f; }
  .online-portrait .tabs > #open-menu[hidden] { display: none; }
  #open-menu .menu-icon { display: grid; gap: 4px; width: 22px; } #open-menu .menu-icon i { display: block; height: 3px; border-radius: 2px; background: #04141a; }
}
.phone-menu { width: min(560px, calc(100vw - 16px)); max-height: calc(100dvh - 32px); padding: 12px; }
.phone-menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-top: 8px; }
.phone-menu-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px; padding: 8px 4px; border: 1px solid #274552; border-radius: 10px; background: linear-gradient(180deg, #0f2a35, #0a1c24); color: #d9eaf0; font-size: 12px; font-weight: 600; text-align: center; border-image: none; }
.phone-menu-item img { width: 32px; height: 32px; image-rendering: pixelated; }
.phone-menu-item.is-active { border-color: #8ff0ff; background: linear-gradient(180deg, #1d5a6b, #0f3140); }
.phone-menu-badge { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ffb35c; color: #04141a; font: 700 11px/18px sans-serif; font-style: normal; }
/* Phones held sideways: the game is a portrait shooter, so ask to turn the phone upright (a short landscape screen
   leaves the playfield about 170 px wide) */
.rotate-hint { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .online-portrait .rotate-hint { position: fixed; inset: 0; z-index: 9999; display: grid; place-content: center; gap: 14px; padding: 24px; text-align: center; background: #050b0fee; color: #e6f1f5; font-size: 16px; }
  .rotate-hint .rotate-phone { width: 44px; height: 72px; margin: 0 auto; border: 3px solid #4fd2ea; border-radius: 8px; transform: rotate(-90deg); animation: rotate-upright 2.4s ease-in-out infinite; }
  .rotate-hint small { color: #8aa4b0; font-size: 13px; }
}
@keyframes rotate-upright { 0%, 30% { transform: rotate(-90deg); } 60%, 100% { transform: rotate(0deg); } }
@media (prefers-reduced-motion: reduce) { .rotate-hint .rotate-phone { animation: none; transform: none; } }
@media (max-width: 899px) {
  /* thumb-sized controls the audit flagged (tools/mobile-audit.js) */
  .online-portrait #combat-mode { min-height: 36px; }
  .chest-odds > summary, details > summary { min-height: 36px; display: flex; align-items: center; }
  #music-volume, #sfx-volume { height: 32px; }
  #bag-expand, #idle-summary { min-height: 36px; }
}
@media (max-width: 899px) {
  /* locked Credits/Fuel chip: its own line under the amount instead of on top of it */
  .online-portrait .resource-strip article { height: auto !important; min-height: 46px; }
  .online-portrait .locked-chip { position: static; display: block; grid-column: 1 / -1; font-size: 10.5px; line-height: 12px; }
  /* the fixed "Asset credits" footer sat under the Menu button; it lives in the Menu on phones */
  .online-portrait .game-credits { display: none; }
  .phone-menu .game-credits-copy { margin-top: 12px; font-size: 12px; color: #8aa4b0; }
  .online-portrait #idle-summary { min-height: 36px !important; }
  .online-portrait #view-combat .earn-explain { font-size: 12px; }
}
/* the Genesis / Notifications buttons are positioned inside the game shell, so the Epoch banner never covers them */
.online-portrait .shell { position: relative; }
@media (max-width: 899px) {
  /* deploy panel: more room so Galaxy, Level and Deploy all show on small phones */
  .online-portrait .combat-message { max-height: calc(100% - 150px); }
}
@media (max-width: 899px) and (max-height: 780px) {
  /* short phones: drop the deploy panel's subtitle so Galaxy, Level and Deploy fit without scrolling */
  .online-portrait .combat-message h2 + p { display: none; }
  .online-portrait .combat-message h2 { font-size: 18px; margin-bottom: 2px; }
}

/* Rollout countdown + on-screen announcements (src/online-live.js) */
.rollout-timer { min-height: 0 !important; height: 28px; padding: 0 12px !important; border-radius: 999px; border: 1px solid #8a6a2f !important; border-image: none !important; background: #120d04 !important; color: #ffe6a8 !important; font: 600 12px/26px ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; }
.screen-announce { position: relative; z-index: 5; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 12px; color: #e6f1f5; background: linear-gradient(90deg, #0b2a36, #10384a 50%, #0b2a36); border-bottom: 1px solid #2c6a80; font-size: 13px; }
.screen-announce .sa-icon { flex: none; font-size: 16px; color: #ffd27a; }
.screen-announce .sa-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.screen-announce.is-open .sa-text { white-space: normal; }
.screen-announce .sa-text b { color: #8ff0ff; }
.screen-announce .sa-count { flex: none; color: #8aa4b0; font-size: 11px; }
.screen-announce .sa-link { flex: none; padding: 5px 12px; border-radius: 6px; background: #4fd2ea; color: #04141a; font-weight: 700; text-decoration: none; white-space: nowrap; }
.screen-announce .sa-close { flex: none; width: 32px; height: 32px; min-height: 0 !important; padding: 0 !important; border-radius: 6px; border: 1px solid #2c6a80 !important; border-image: none !important; background: transparent !important; color: #e6f1f5; font-size: 18px; line-height: 1; }
@media (max-width: 899px) {
  .event-banner { justify-content: space-between; }
  .event-banner > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .rollout-timer { height: 24px; padding: 0 8px !important; font-size: 11px; line-height: 22px; overflow: hidden; text-overflow: ellipsis; }
  .screen-announce { font-size: 12px; gap: 8px; padding: 5px 8px; }
}
@media (max-width: 420px) { .event-banner:has(#rollout-timer) > b { display: none; } }
.guide-sub { margin: 12px 0 6px; font-size: 14px; color: #8ff0ff; }
.guide-schedule { margin: 0 0 10px; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.guide-schedule li { padding: 8px 10px; border: 1px solid #274552; border-radius: 8px; font-size: 13px; }
.guide-schedule li small { display: block; color: #8aa4b0; margin-top: 2px; }
.guide-schedule li.is-open { border-color: #2f7d58; } .guide-schedule li.is-open small { color: #6be39a; }
.adm-duration { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .adm-duration label { display: grid; gap: 4px; }
.adm-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.adm-tag { color: #04141a; background: #ffd27a; border-radius: 4px; padding: 0 5px; font-size: 10.5px; }
.cm-news-link { display: inline-block; margin-top: 6px; color: #8ff0ff; font-weight: 600; }
/* Community -> Online (Oct17): who is in the game now. Dot: cyan flying, purple in the Void, grey in the hangar. */
.cm-online { display: grid; gap: 4px; }
.cm-online-row { padding: 6px 8px; border: 1px solid rgba(84,228,245,.14); background: rgba(3,12,18,.55); }
.cm-online-row span { word-break: normal; overflow-wrap: anywhere; }
.cm-online-row em { font-style: normal; color: #9fc4cf; white-space: nowrap; font-size: 11px; }
.cm-online-row.is-you { border-color: rgba(84,228,245,.55); }
.cm-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #6f8790; margin-right: 6px; vertical-align: 1px; }
.cm-dot.is-flying { background: #54e4f5; } .cm-dot.is-void { background: #b48cff; }
/* Admin: wipe + new epoch (Oct17) */
.adm-wipe { margin-top: 10px; padding: 8px; border: 1px solid rgba(255,107,122,.45); background: rgba(40,6,10,.35); }
.adm-wipe h4 { margin: 0 0 4px; color: #ff9aa5; font-size: 13px; }
.adm-wipe .adm-warn { color: #ffc857; }
.adm-wipe button.danger { border-color: #ff6b7a; color: #ffd0d5; }
@media (max-width: 600px) { .cm-online-row { flex-wrap: wrap; } .cm-online-row em { white-space: normal; } }
/* Admin: test epoch form (Oct17) */
.cm-admin .adm-feats { border: 1px solid rgba(84,228,245,.2); padding: 6px 8px; margin: 6px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2px 10px; }
.cm-admin .adm-feats legend { font-size: 11px; color: #9fc4cf; padding: 0 4px; }
/* Test epoch screens (src/online-live.js): waiting card before the start, closed screen with the final ranking after the end */
.epoch-screen { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(2,8,12,.82); }
.epoch-screen .es-card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #071923; border: 1px solid #2c6d80; box-shadow: 0 0 0 1px rgba(84,228,245,.15), 0 10px 40px rgba(0,0,0,.6); padding: 18px; color: #e8f6fa; }
.epoch-screen .es-kicker { margin: 0; font-size: 12px; letter-spacing: .2em; color: #ffc857; }
.epoch-screen h2 { margin: 4px 0 6px; font-size: 26px; color: #54e4f5; }
.epoch-screen .es-clock { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; color: #54e4f5; margin: 6px 0; }
.epoch-screen .es-note { white-space: pre-line; background: rgba(255,200,87,.08); border: 1px solid rgba(255,200,87,.35); padding: 8px 10px; margin: 8px 0; }
.epoch-screen table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.epoch-screen td, .epoch-screen th { padding: 5px 6px; border-bottom: 1px solid rgba(84,228,245,.12); text-align: left; }
.epoch-screen td.n, .epoch-screen th.n { text-align: right; font-variant-numeric: tabular-nums; }
.epoch-screen tr.is-you td { color: #54e4f5; font-weight: 700; }
.epoch-screen .es-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.epoch-screen .es-actions button { min-height: 44px; }
/* Lock (Oct17): the countdown/ended screen covers everything (above panels and dialogs) and is fully opaque. */
.epoch-screen { z-index: 2147482000; background: rgba(2,8,12,.97); }
.epoch-screen .es-actions a.button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; color: #e8f6fa; border: 1px solid #2c6d80; background: #0b2a36; text-decoration: none; font-weight: 700; }
.epoch-screen .es-fine { font-size: 12px; color: #9fc4cf; }
.cm-admin #adm-epoch-note { display: block; width: 100%; box-sizing: border-box; min-height: 72px; margin-top: 2px; }
.cm-admin #adm-wl-add { display: block; width: 100%; box-sizing: border-box; min-height: 60px; margin-top: 2px; }
.cm-online-row code { font-size: 11px; word-break: break-all; }
/* Narrow desktop field (Oct17): phone-size weapon HUD so the controls stay in proportion with a small battlefield. */
html.field-compact { --weapon-hud-band: 56px; --weapon-button-size: 44px; --weapon-art-size: 32px; }
html.field-compact .combat-meter { font-size: 10px; }

/* Update refresh banner (Oct18): above everything, including the epoch lock screen. */
.update-refresh { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 2147483600; display: flex; align-items: center; gap: 14px; width: min(640px, calc(100vw - 24px)); box-sizing: border-box; padding: 12px 14px 12px 18px; background: #0b2a36; border: 1px solid #54e4f5; box-shadow: 0 8px 30px rgba(0,0,0,.6); color: #e8f6fa; font-size: 15px; line-height: 1.35; }
.update-refresh span { flex: 1; } .update-refresh b { color: #54e4f5; }
.update-refresh button { flex: none; min-height: 44px; padding: 0 18px; font-weight: 800; cursor: pointer; color: #041016; background: #54e4f5; border: 0; }
@media (max-width: 520px) { .update-refresh { flex-direction: column; align-items: stretch; text-align: center; } }

/* Toast above modals (Oct18) and the low-funds warning in confirm windows. */
.rift-toast { position: fixed; inset: auto; top: 16px; left: 50%; transform: translate(-50%, -8px); margin: 0; z-index: 2147483640; display: flex; align-items: flex-start; gap: 10px; width: min(560px, calc(100vw - 24px)); box-sizing: border-box; padding: 12px 12px 12px 16px; border: 1px solid #54e4f5; border-left-width: 5px; background: #071923; color: #e8f6fa; font: 600 15px/1.4 Inter, Arial, sans-serif; box-shadow: 0 10px 30px rgba(0,0,0,.65); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
.rift-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.rift-toast:popover-open { display: flex; }
.rift-toast.error { border-color: #ff6b6b; background: #2a0b0e; }
.rift-toast.ok { border-color: #5fe08a; background: #0b2416; }
.rift-toast .rt-icon { font-size: 18px; line-height: 1.2; }
.rift-toast.error .rt-icon { color: #ff6b6b; } .rift-toast.ok .rt-icon { color: #5fe08a; }
.rift-toast .rt-text { flex: 1; }
.rift-toast .rt-close { flex: none; width: 32px; height: 32px; border: 0; background: transparent; color: #cfe6ee; font-size: 22px; cursor: pointer; }
.low-funds-warning { margin: 12px 0 0; padding: 10px 12px; border: 1px solid #e0a43a; background: rgba(224,164,58,.12); color: #ffd58a; font-weight: 600; line-height: 1.4; }

/* Void maxed -> real-space boss prompt (Oct18). */
.void-boss-hint { max-width: min(460px, calc(100vw - 24px)); padding-top: 16px; }
.void-boss-hint h3 { margin: 0 0 8px; color: #c9a8ff; }
.void-boss-hint p { margin: 0 0 14px; line-height: 1.45; }
.void-boss-hint .vbh-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.void-boss-hint .vbh-actions button { flex: 1 1 180px; min-height: 44px; }
.void-boss-hint .vbh-off { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; color: #9fb6c2; }

/* Recruitment odds tooltip (Oct18). */
.recruit-odds-tip { position: relative; display: inline-flex; vertical-align: middle; align-items: center; margin-left: 10px; font-weight: 600; letter-spacing: 0; text-transform: none; padding: 4px 9px; border: 1px solid #2a5568; border-radius: 999px; font-size: 12px; color: #9fd6ee; cursor: help; user-select: none; }
.recruit-odds-tip .tip { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 210px; padding: 8px 10px; background: #071219; border: 1px solid #2a5568; border-radius: 8px; box-shadow: 0 8px 24px #000a; color: #cfe3ee; font-size: 12px; }
@media (hover: hover) { .recruit-odds-tip:hover .tip { display: block; } } .recruit-odds-tip.is-open .tip { display: block; } /* tap or Enter toggles (src/account-game.js); not on the automatic focus when the window opens (Oct20: it covered Refresh on phones) */
.recruit-odds-tip .tip b { display: block; margin-bottom: 4px; }
.recruit-odds-tip .odds-row { display: flex; justify-content: space-between; padding: 2px 0; color: var(--rarity); }
.recruit-odds-tip .odds-row i { font-style: normal; opacity: .7; font-size: 11px; }
.recruit-odds-tip small { display: block; margin-top: 4px; opacity: .7; }

/* Locked buttons: clicks fall through to a handler that shows the reason (Oct18). */
button:disabled { pointer-events: none; }
.disabled-action { cursor: not-allowed; }

/* Required pilot name (Oct18). */
.ign-dialog { max-width: 420px; width: calc(100vw - 32px); padding: 22px 22px 18px; border: 1px solid #2a8fb0; border-radius: 12px; background: #07131b; color: #dcebf2; }
.ign-dialog::backdrop { background: #000c; }
.ign-dialog h2 { margin: 0 0 8px; font-size: 20px; }
.ign-dialog p { margin: 0 0 12px; font-size: 13px; line-height: 1.45; color: #a9c2ce; }
.ign-dialog label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.ign-dialog input { width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 16px; border-radius: 8px; border: 1px solid #2a5568; background: #0b1d27; color: #fff; }
.ign-dialog .ign-error { color: #ff7b7b; min-height: 18px; margin: 6px 0 8px; }
.ign-dialog button { width: 100%; padding: 11px; font-weight: 700; }

/* Contract drop hint (Oct18). */
.contract-drop-hint { margin: 6px 0 10px; color: #9fc3d2; }
.mission-guide p { margin: 4px 0; font-size: 13px; line-height: 1.45; }
.mission-guide .mission-warn { padding: 8px 10px; border: 1px solid #a8812c; border-radius: 8px; background: #2a200a; color: #ffd98a; }
/* Marketplace switched off (Oct18): no way in. */
body.market-off [data-wb-action="sell"], body.market-off [data-wb-action="sell-commander"], body.market-off [data-open-market], body.market-off .disabled-action:has(> [data-wb-action="sell"]), body.market-off .disabled-action:has(> [data-wb-action="sell-commander"]) { display: none !important; }
/* Expedition Center hidden online (Oct18): resource expeditions are offline-only. */
body.online-game .building-card[data-building="expedition"] { display: none !important; }
/* AFK Patrol button (Oct18). */
#start-patrol { width: 100%; margin-top: 6px; padding: 8px 10px; font-size: 13px; font-weight: 700; border: 1px dashed #3b7a92; background: #0a1c25; color: #9fe3ff; }
#start-patrol:disabled { opacity: .55; }
/* Server stats popup (Oct18): same look as Jobs. */
.stats-pop .job span { color: #e6f3f8; }
/* AFK Patrol banner (Oct18): impossible to miss. */
.patrol-banner { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); z-index: 30; width: calc(100% - 24px); box-sizing: border-box; flex-wrap: wrap; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  padding: 10px 14px; border: 2px solid #ff4d4d; border-radius: 12px; background: #2a0808ee; color: #ffd6d6; box-shadow: 0 0 24px #ff4d4d66; animation: pb-glow 2s ease-in-out infinite; }
.patrol-banner > div { flex: 1 1 200px; min-width: 0; }
.patrol-banner b { display: block; font-size: 15px; letter-spacing: .08em; color: #ff5c5c; }
.patrol-banner small { display: block; font-size: 12px; color: #ff9a9a; }
.patrol-banner button { white-space: nowrap; padding: 7px 12px; font-weight: 700; margin-left: auto; }
.patrol-banner .pb-dot { width: 12px; height: 12px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 10px #ff4d4d; flex: none; animation: pb-blink 1s steps(2) infinite; }
@keyframes pb-glow { 50% { box-shadow: 0 0 6px #ff4d4d33; } }
@keyframes pb-blink { 50% { opacity: .25; } }
@media (max-width: 620px) { .patrol-banner { top: 70px; padding: 8px 10px; } .patrol-banner small { display: none; } }
/* Same guard for other scrolling windows whose content sizes with their width (Oct18). */
.cm-body, .exchange-dialog, .epoch-screen .es-card, #game-window-content { scrollbar-gutter: stable; }
/* Game tooltips (Oct18). */
#rift-tip { position: fixed; inset: auto; margin: 0; overflow: visible; z-index: 2147483000; max-width: min(300px, calc(100vw - 12px)); padding: 7px 10px; border: 1px solid #3a8fac; border-radius: 8px;
  background: #061823f2; color: #e3f4fa; font-size: 12.5px; line-height: 1.4; box-shadow: 0 8px 22px #000b; pointer-events: none; white-space: pre-line; }
#transaction-dialog .no-ask { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: #9fc3d2; }
/* "In use" tags (Oct18). */
.inventory-tile { position: relative; }
.use-tag { position: absolute; left: 3px; right: 3px; bottom: 3px; padding: 1px 3px; border-radius: 4px; font: 800 9px/1.3 system-ui, sans-serif; letter-spacing: .04em; text-align: center; pointer-events: none; white-space: nowrap; overflow: hidden; }
.use-banner { margin: 0 0 8px; padding: 6px 10px; border-radius: 8px; font-weight: 800; font-size: 12px; letter-spacing: .04em; }
.tag-sortie { background: #b3261e; color: #fff; } .tag-busy { background: #c77700; color: #fff; } .tag-deployed { background: #1c7a5a; color: #e9fff6; }
.tag-listed { background: #6a3fb0; color: #fff; } .tag-locked { background: #3d4b55; color: #e3eef3; }

.sim-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.sim-actions button { padding: 8px 4px; font-size: 12px; }

/* Command phone categories (owner Oct18 "ui function per category") */
.phone-cat { display: none; }
.online-portrait.demo-desk .phone-grid .phone-cat { display: flex; align-items: center; gap: 6px; grid-column: 1 / -1; margin: 0 2px -3px; font-size: 9px; font-weight: 700; line-height: 10px; letter-spacing: 2px; text-transform: uppercase; color: #6fd7ea; opacity: .8; }
.online-portrait.demo-desk .phone-grid .phone-cat::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(79,210,234,.45), transparent); }
@media (min-width: 900px) and (max-height: 900px) {
  .online-portrait.demo-desk .phone-grid .tab, .online-portrait.demo-desk .phone-grid .combat-quick-controls > button,
  .online-portrait.demo-desk .phone-grid #open-account, .online-portrait.demo-desk .phone-grid .tab-extra { aspect-ratio: 1 / .54 !important; gap: 2px !important; }
  .online-portrait.demo-desk .phone-grid .tab-icon, .online-portrait.demo-desk .phone-grid .combat-quick-controls > button img { width: 22px !important; height: 22px !important; }
}
.online-portrait.demo-desk .phone-grid .phone-cat[data-phone-cat="Flight"] { margin-top: 0; }
.online-portrait.demo-desk .phone-grid #open-account.has-app-icon::before { display: none; }
.online-portrait.demo-desk .phone-grid img[src*="assets/ui/apps/"] { image-rendering: pixelated; }
.cm-more { display: block; margin: 8px auto 0; padding: 6px 16px; font-size: 13px; }
/* Bag pages (owner Oct18): the pager already shows the item count */
.inventory-pagination:not([hidden]) + #inventory-count, .inventory-pagination:not([hidden]) ~ #inventory-count { display: none; }
/* Store category tabs (owner Oct18) */
.store-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.store-cats button { padding: 7px 14px; border: 1px solid #2c5361; border-radius: 6px; background: #0e1d27; color: #cfe7ef; font-size: 13px; cursor: pointer; }
.store-cats button small { margin-left: 4px; opacity: .6; font-size: 11px; }
.store-cats button:hover { border-color: #4fd2ea; }
.store-cats button.is-active { background: linear-gradient(180deg, #4fe0f2 0%, #2fb9d3 100%); border-color: #8ff0ff; color: #04141a; font-weight: 700; }
/* Salvage always visible with rarity chips (owner Oct18) */
#module-salvage > summary { list-style: none; pointer-events: none; display: flex; gap: 8px; align-items: baseline; }
#module-salvage > summary::-webkit-details-marker { display: none; }
#module-salvage .recycle-toolbar { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
#module-salvage .recycle-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#module-salvage .recycle-choice > label[for="recycle-rarity"], #module-salvage #recycle-rarity { display: none; }
.recycle-chips { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
.recycle-chips button { padding: 3px 8px; font-size: 11px; border: 1px solid color-mix(in srgb, var(--chip) 55%, transparent); border-radius: 5px; background: #0e1d27; color: var(--chip); cursor: pointer; }
.recycle-chips button b { color: #e6f3f8; margin-left: 2px; }
.recycle-chips button.is-active { background: color-mix(in srgb, var(--chip) 22%, #0e1d27); border-color: var(--chip); }
.recycle-chips button[data-empty] { opacity: .45; }
#module-salvage .panel-close, #module-salvage #recycle-rarity-quote, #module-salvage #recycle-all-quote, #module-salvage .recycle-label, #module-salvage .recycle-toolbar > p.fine:not(#recycle-status) { display: none !important; }
#module-salvage #recycle-status:empty { display: none; }
#module-salvage .recycle-toolbar { flex-direction: row; flex-wrap: wrap; align-items: center; }
#module-salvage .recycle-choice { display: contents; }
#module-salvage #recycle-rarity-action, #module-salvage #recycle-all-action { padding: 5px 10px; font-size: 12px; min-height: 0; }
#module-salvage .secondary-panel-body { display: contents; }
.recycle-chips button { padding: 2px 7px !important; min-height: 0 !important; line-height: 18px; }
/* Salvage window (owner Oct18 "salvage should be its own modal") */
.open-salvage { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 8px; padding: 8px 12px; font-size: 13px; }
.open-salvage small { opacity: .75; font-size: 11.5px; }
.salvage-dialog { width: min(520px, calc(100vw - 32px)); padding: 18px 20px; border: 1px solid #2c5361; border-radius: 10px; background: #0b1820; color: #e6f3f8; }
.salvage-dialog::backdrop { background: #000a; }
.salvage-dialog > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.salvage-dialog > header h2 { margin: 0; font-size: 18px; }
.salvage-dialog > header button { min-width: 34px; }
.salvage-dialog #module-salvage { display: block !important; border: 0; padding: 0; }
.salvage-dialog #module-salvage > summary { margin-bottom: 4px; }
.salvage-dialog .recycle-chips button { padding: 5px 10px !important; font-size: 12.5px; }
.salvage-dialog #recycle-rarity-action, .salvage-dialog #recycle-all-action { padding: 8px 14px !important; font-size: 13px !important; }
.salvage-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; max-height: min(46vh, 380px); overflow-y: auto; margin: 8px 0; padding: 2px; }
.salvage-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 4px !important; min-height: 0 !important; border: 1px solid color-mix(in srgb, var(--rarity) 50%, transparent) !important; border-radius: 6px; background: #0e1d27; cursor: pointer; }
.salvage-tile .module-icon, .salvage-tile img { width: 34px; height: 34px; }
.salvage-tile small { font-size: 10px; color: #ffd36b; }
.salvage-tile.is-picked { background: color-mix(in srgb, var(--rarity) 22%, #0e1d27); border-color: var(--rarity) !important; box-shadow: 0 0 0 2px var(--rarity) inset; }
.salvage-tile.is-picked::after { content: "✓"; position: absolute; top: 2px; right: 4px; font-size: 11px; font-weight: 700; color: #e6f3f8; }

/* ===================== Mobile v2 (owner Oct19 "mobile ui is clunky") ===================== */
html.m2 .event-banner { padding: 2px 8px !important; min-height: 0 !important; font-size: 10px !important; gap: 6px !important; }
html.m2 .event-banner button { min-height: 22px !important; height: 22px; padding: 0 8px !important; font-size: 10px !important; }
html.m2 .topbar { min-height: 0 !important; padding-top: 4px !important; padding-bottom: 4px !important; }
html.m2 .topbar .brand-mark { width: 26px !important; height: 26px !important; }
html.m2 .topbar .brand-copy small, html.m2 .topbar .brand-copy span:not(:first-child) { display: none !important; }
html.m2 .resource-strip { gap: 4px !important; padding: 2px 6px 4px !important; }
html.m2 .resource-strip article { min-height: 0 !important; padding: 3px 6px !important; gap: 4px !important; }
html.m2 .resource-strip .resource-icon { width: 16px !important; height: 16px !important; }
html.m2 .resource-strip article span { font-size: 9px !important; line-height: 1.1 !important; }
html.m2 .resource-strip article strong { font-size: 13px !important; line-height: 1.15 !important; }
html.m2 #view-combat { padding-left: 0 !important; padding-right: 0 !important; }
html.m2 .combat-frame { margin-left: auto !important; margin-right: auto !important; border-radius: 0 !important; }
/* flight controls float on the field */
html.m2 .combat-frame > #combat-commandbar { position: absolute !important; inset: 0 !important; display: block !important; background: none !important; border: 0 !important; padding: 0 !important; margin: 0 !important; pointer-events: none; z-index: 6; }
html.m2 .combat-frame > #combat-commandbar[hidden] { display: none !important; }
html.m2 .combat-frame > #combat-commandbar .combat-control-group, html.m2 .combat-frame > #combat-commandbar .combat-controls:not([hidden]) { display: contents !important; }
html.m2 .combat-frame > #combat-commandbar button { pointer-events: auto; }
html.m2 #combat-commandbar #dock-combat { position: absolute; top: 96px; left: 6px; width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 50%; opacity: .85; }
html.m2 #combat-commandbar #dock-combat img { width: 16px; height: 16px; }
html.m2 #combat-commandbar #combat-dash { position: absolute; right: 12px; bottom: calc(var(--weapon-hud-band, 0px) + 16px); width: 66px; height: 66px; min-height: 0; padding: 0; border-radius: 50%; border: 2px solid #64dfff; background: radial-gradient(circle at 50% 40%, #1d5b6e, #0a2530); box-shadow: 0 0 18px #64dfff55; }
html.m2 #combat-commandbar #combat-dash img { width: 30px; height: 30px; }
html.m2 #combat-commandbar #combat-dash .control-cooldown { position: absolute; inset: auto 0 6px; font-size: 10px; }
html.m2.m2-touch #combat-commandbar [data-combat-move] { display: none !important; }
/* EMP Pulse (Oct19): round button above Dash (alone in AUTO) */
html.m2 #combat-commandbar #combat-pulse { position: absolute; right: 16px; bottom: calc(var(--weapon-hud-band, 0px) + 92px); width: 56px; height: 56px; min-height: 0; padding: 0; border-radius: 50%; border: 2px solid #57b8ff; background: radial-gradient(circle at 50% 40%, #1c3f78, #0a1630); box-shadow: 0 0 16px #57b8ff55; }
html.m2:not(.m2-manual) #combat-commandbar #combat-pulse { bottom: calc(var(--weapon-hud-band, 0px) + 16px); }
html.m2 #combat-commandbar #combat-pulse img { width: 26px; height: 26px; }
html.m2 #combat-commandbar #combat-pulse .control-cooldown { position: absolute; inset: auto 0 4px; font-size: 10px; }
html.m2 #combat-commandbar #combat-pulse:disabled { opacity: .55; filter: grayscale(.4); }
html.m2:not(.m2-touch) #combat-commandbar [data-combat-move] { position: absolute; bottom: calc(var(--weapon-hud-band, 0px) + 20px); width: 52px; height: 52px; min-height: 0; border-radius: 50%; }
html.m2:not(.m2-touch) #combat-commandbar [data-combat-move="left"] { right: 150px; }
html.m2:not(.m2-touch) #combat-commandbar [data-combat-move="right"] { right: 88px; }
html.m2.m2-manual.m2-touch #combat-canvas { touch-action: none; }
.m2-fab { display: none; }
html.m2 .m2-fab { display: grid; place-items: center; position: absolute; z-index: 7; width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 50%; font-size: 18px; line-height: 1; color: #d9f6ff; background: #0a2530cc; border: 1px solid #3f8fa3; }
html.m2 .m2-gear { top: 96px; right: 6px; }
.m2-touch-hint { display: none; }
html.m2 .m2-touch-hint:not([hidden]) { display: block; position: absolute; z-index: 6; left: 50%; bottom: calc(var(--weapon-hud-band, 0px) + 96px); transform: translateX(-50%); padding: 6px 12px; border-radius: 14px; font-size: 12px; font-weight: 700; color: #04141a; background: #64dfffdd; pointer-events: none; white-space: nowrap; animation: m2-pulse 1.6s ease-in-out infinite; }
@keyframes m2-pulse { 50% { opacity: .55; } }
/* sortie options sheet */
.m2-sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid #2c5361; border-radius: 14px 14px 0 0; background: #0b1820; color: #e6f3f8; max-height: 80dvh; overflow-y: auto; }
.m2-sheet::backdrop { background: #0009; }
.m2-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.m2-sheet-head h2 { margin: 0; font-size: 17px; }
.m2-sheet-head button { min-width: 36px; min-height: 36px; }
.m2-sheet .combat-options { display: grid !important; grid-template-columns: 1fr; gap: 8px !important; padding: 0 !important; border: 0 !important; background: none !important; }
.m2-sheet .combat-options .switch-row { display: flex !important; white-space: normal !important; }
/* five tabs; everything else lives in Menu */
html.m2 .tabs .m-offbar { display: none !important; }
html.m2 .tabs { overflow: hidden !important; display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 4px !important; }
html.m2 .tabs > button:not(.m-offbar) { min-width: 0 !important; width: auto !important; }
html.m2 .tabs .combat-quick-controls { display: contents !important; }
html.m2 .topbar h1 { font-size: 18px !important; line-height: 1 !important; }
html.m2 .topbar .eyebrow { display: none !important; }
html.m2 .topbar { height: 44px !important; }
html.m2 .resource-strip article { display: flex !important; align-items: center !important; height: 30px !important; min-height: 0 !important; flex-wrap: nowrap; overflow: hidden; }
html.m2 .resource-strip article > span:not(:has(strong)), html.m2 .resource-strip article > small:not([class*="lock"]) { display: none !important; }
html.m2 .resource-strip article strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.m2:not(.m2-manual) #combat-commandbar #combat-dash { display: none !important; }
html.m2 .resource-strip { display: grid !important; grid-template-columns: 1.45fr .9fr .8fr .62fr 1.8fr !important; }
html.m2 .resource-strip article { padding: 3px 5px !important; }
html.m2 .resource-strip article small { font-size: 9px !important; line-height: 1 !important; }
html.m2 .resource-strip article strong { font-size: 12.5px !important; }
html.m2.m2-touch #manual-guide { display: none !important; }
/* sortie sheet: the same switches as the desktop card */
.m2-sheet .switch-row { align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #1f3a48; border-radius: 8px; }
.m2-sheet #auto-levels, .m2-sheet #repeat-sector { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 40px; height: 22px; margin: 0; border-radius: 11px; background: #1a2e36; border: 1px solid #2c5361; }
.m2-sheet #auto-levels::after, .m2-sheet #repeat-sector::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #9fb4bf; transition: transform .15s; }
.m2-sheet #auto-levels:checked, .m2-sheet #repeat-sector:checked { background: #157a8c; border-color: #4fd2ea; }
.m2-sheet #auto-levels:checked::after, .m2-sheet #repeat-sector:checked::after { transform: translateX(18px); background: #e9fbff; }
html.m2 .tabs > [data-view="combat"] { order: 1 !important; }
html.m2 .tabs > [data-view="fleet"] { order: 2 !important; }
html.m2 .tabs > [data-view="missions"] { order: 3 !important; }
html.m2 .tabs > [data-view="galaxy"] { order: 4 !important; }
html.m2 .tabs > #open-menu { order: 9 !important; }
@media (max-width: 380px) {
  html.m2 .resource-strip { grid-template-columns: 1.4fr 1fr .8fr 1.7fr !important; }
  html.m2 .resource-strip article:nth-child(4) { display: none !important; }
}
/* ---- Mobile v2 part 2: windows are full-screen pages on phones (owner Oct19) ---- */
html.m2 dialog[open]:not(#transaction-dialog):not(.m2-sheet):not(#chest-reel-dialog):not(#ign-dialog):not(#salvage-dialog) {
  position: fixed !important; inset: 0 !important; width: 100vw !important; max-width: 100vw !important; height: 100dvh !important; max-height: 100dvh !important;
  margin: 0 !important; border-radius: 0 !important; border-left: 0 !important; border-right: 0 !important; transform: none !important;
  padding: calc(8px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom)) !important; overflow-y: auto !important; overscroll-behavior: contain;
}
html.m2 dialog[open] > :is(.dialog-heading, header, .game-window-heading):first-child { position: sticky; top: calc(-8px - env(safe-area-inset-top)); z-index: 5; margin: -8px -12px 8px !important; padding: 10px 12px !important; background: #0b1820; border-bottom: 1px solid #1f3a48; }
html.m2 dialog[open] > :is(.dialog-heading, header) button[data-close], html.m2 dialog[open] [aria-label^="Close"] { min-width: 44px !important; min-height: 44px !important; }
/* the game window keeps its own inner scroller */
html.m2 #game-window[open] { display: flex !important; flex-direction: column; overflow: hidden !important; }
html.m2 #game-window[open] #game-window-content { flex: 1; overflow-y: auto; }
/* bigger touch targets inside windows */
html.m2.m2-touch dialog[open] :is(button, select, input[type="text"], input[type="number"], input[type="url"]) { min-height: 40px; }
html.m2.m2-touch dialog[open] :is(.tab, [role="tab"], .cm-sub button, [data-cm-tab], [data-store-cat]) { min-height: 44px; }
/* confirmations and the salvage picker: bottom sheets */
html.m2 #transaction-dialog[open], html.m2 #salvage-dialog[open] { width: 100vw !important; max-width: 100vw !important; margin: auto 0 0 !important; border-radius: 14px 14px 0 0 !important; padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important; max-height: 88dvh !important; overflow-y: auto !important; }
html.m2 #salvage-dialog .salvage-pick { max-height: 46dvh; }
html.m2 .salvage-pick > p { grid-column: 1 / -1; }
html.m2 #recruitment-dialog .dialog-heading { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
html.m2 #recruitment-dialog .dialog-heading h2 { flex: 1; min-width: 0; font-size: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
html.m2 .recruit-odds-tip { margin-left: 0; }
html.m2 .recruit-odds-tip .tip { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; }
/* Open all chests (Oct19) */
.chest-all { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 6px 0 10px; }
.chest-all small { color: #9fb4bf; font-size: 12px; }

/* Arena phase 1 (Claude, Oct19): Mirror rival on top + 5 opponents, brackets, defense log, rankings, replay. */
.arena-dialog { width: min(760px, calc(100vw - 32px)); }
.ar-body { max-height: 62vh; overflow: auto; display: grid; gap: 10px; }
.ar-head { display: flex; gap: 12px; align-items: stretch; margin: 4px 0 8px; flex-wrap: wrap; }
.ar-badge { display: grid; place-content: center; text-align: center; min-width: 96px; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--br); background: color-mix(in srgb, var(--br) 12%, #0b1820); }
.ar-badge b { color: var(--br); letter-spacing: 1px; text-transform: uppercase; font-size: 13px; } .ar-badge span { font-size: 22px; font-weight: 700; }
.ar-stats { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ar-stats span { display: grid; gap: 1px; padding: 6px 8px; border: 1px solid #1f3a48; border-radius: 8px; background: #0e1d27; min-width: 0; }
.ar-stats small { color: #8fa9b6; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; } .ar-stats b { font-size: 17px; } .ar-stats em { font-style: normal; color: #8fa9b6; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-list { display: grid; gap: 8px; }
.ar-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid #1f3a48; border-left: 4px solid var(--br); border-radius: 10px; background: #0e1d27; }
.ar-card.is-mirror { grid-template-columns: minmax(0, 1fr) auto auto; border: 2px solid #ffca63; background: linear-gradient(90deg, rgba(255, 202, 99, .14), #0e1d27 60%); }
.ar-rival { grid-column: 1 / -1; font-size: 11px; font-weight: 700; letter-spacing: 1px; color: #ffca63; line-height: 1.3; }
.ar-card.is-beaten { opacity: .55; }
.ar-box { color: #d787ff; font-weight: 700; }
.ar-week-note { padding: 8px 12px; border: 1px solid #ffca63; border-radius: 10px; background: rgba(255, 202, 99, .1); color: #ffe7b0; }
.ar-who { display: grid; min-width: 0; } .ar-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ar-who small { color: #8fa9b6; }
.ar-ai { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 4px; font-style: normal; font-size: 10px; font-weight: 700; color: #04141a; background: #8fa9b6; vertical-align: 2px; }
.ar-meta { display: flex; gap: 10px; align-items: center; font-variant-numeric: tabular-nums; color: #cfe6f0; }
.ar-br { color: var(--br, #4fd2ea); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.ar-fight { min-width: 92px; min-height: 40px; font-weight: 700; }
.ar-refresh, .ar-defense { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 10px; border: 1px dashed #1f3a48; border-radius: 10px; }
.ar-defense div { display: grid; } .ar-defense small { color: #8fa9b6; font-size: 11px; text-transform: uppercase; } .ar-defense span { color: #8fa9b6; font-size: 12px; }
.ar-result { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 12px; border-radius: 10px; border: 2px solid; }
.ar-result.is-win { border-color: #64f2c7; background: rgba(100, 242, 199, .08); } .ar-result.is-loss { border-color: #ff7a7a; background: rgba(255, 122, 122, .08); }
.ar-result > b { font-size: 24px; letter-spacing: 3px; } .ar-result.is-win > b { color: #64f2c7; } .ar-result.is-loss > b { color: #ff7a7a; }
.ar-result div { display: flex; gap: 8px; margin-top: 4px; }
.ar-rows { display: grid; gap: 6px; } .ar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; }
.ar-row.is-you { outline: 1px solid #4fd2ea; border-radius: 6px; } .ar-row em { font-style: normal; } .ar-row span:last-child { display: flex; gap: 6px; justify-content: flex-end; }
em.is-win { color: #64f2c7; } em.is-loss { color: #ff7a7a; }
.ar-brackets { display: flex; flex-wrap: wrap; gap: 6px; } .ar-brackets span { padding: 3px 8px; border: 1px solid var(--br); border-radius: 999px; font-size: 12px; color: #cfe6f0; } .ar-brackets b { color: var(--br); margin-right: 4px; }
.arena-replay { width: min(520px, calc(100vw - 24px)); }
.arena-replay canvas { display: block; height: min(66vh, 140vw); width: auto; max-width: 100%; aspect-ratio: 2 / 3; border-radius: 8px; background: #050b12; margin: 0 auto; }
.ar-vs { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; } .ar-vs span { display: grid; } .ar-vs .is-top b { color: #ff8a5c; } .ar-vs .is-bottom { text-align: right; } .ar-vs .is-bottom b { color: #57b8ff; } .ar-vs small { color: #8fa9b6; }
.ar-replay-bar { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; } .ar-replay-bar span { margin-left: auto; font-variant-numeric: tabular-nums; color: #8fa9b6; }
@media (max-width: 640px) {
  .ar-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ar-card, .ar-card.is-mirror { grid-template-columns: minmax(0, 1fr) auto; } .ar-card .ar-meta { grid-column: 1; } .ar-card .ar-who { grid-column: 1; } .ar-card .ar-fight { grid-column: 2; grid-row: span 2; }
  .ar-row { grid-template-columns: minmax(0, 1fr) auto; } .ar-row > :nth-child(3) { grid-column: 1; color: #8fa9b6; font-size: 12px; }
  html.m2 .ar-body { max-height: none; }
}

/* Daily missions (Claude, Oct19). */
.daily-missions { display: grid; gap: 8px; margin-bottom: 14px; }
.daily-missions header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; } .daily-missions header span { color: #8fa9b6; font-size: 12px; }
.dm-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid #1f3a48; border-radius: 10px; background: #0e1d27; }
.dm-row.is-done { border-color: #64f2c7; } .dm-row.is-claimed { opacity: .6; }
.dm-text { display: grid; gap: 3px; min-width: 0; } .dm-text small { color: #8fa9b6; font-size: 12px; }
.dm-bar { height: 6px; border-radius: 3px; background: #13303d; overflow: hidden; } .dm-bar i { display: block; height: 100%; background: linear-gradient(90deg, #4fd2ea, #64f2c7); }
.dm-num { font-variant-numeric: tabular-nums; color: #cfe6f0; font-size: 13px; white-space: nowrap; }
.dm-row button { min-height: 40px; white-space: nowrap; }
.dm-all { border-style: dashed; border-color: #ffca63; }
@media (max-width: 640px) { .dm-row { grid-template-columns: minmax(0, 1fr) auto; } .dm-row button { grid-column: 1 / -1; } }

/* Achievements (Claude, Oct19). */
.achievements-dialog { width: min(760px, calc(100vw - 32px)); } .ach-body { max-height: 66vh; overflow: auto; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ach-card { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid #1f3a48; border-radius: 10px; background: #0e1d27; }
.ach-card.is-ready { border-color: #64f2c7; box-shadow: 0 0 0 1px rgba(100, 242, 199, .25); } .ach-card.is-complete { border-color: #ffca63; }
.ach-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; } .ach-card small { color: #8fa9b6; }
.ach-pips { display: flex; gap: 3px; } .ach-pips i { width: 10px; height: 10px; border-radius: 2px; background: #13303d; border: 1px solid #1f3a48; }
.ach-pips i.is-done { background: #64f2c7; } .ach-pips i.is-claimed { background: #ffca63; border-color: #ffca63; }
.ach-num { font-variant-numeric: tabular-nums; font-size: 12px; color: #cfe6f0; } .ach-card button { min-height: 40px; font-size: 13px; } .ach-done { color: #ffca63; font-style: normal; font-weight: 700; }
html.m2 .ach-body { max-height: none; }

/* Arena bracket icons (Oct19). */
.ar-rank { width: 18px; height: 18px; image-rendering: pixelated; vertical-align: -4px; margin-right: 4px; }
.ar-rank-big { width: 40px; height: 40px; image-rendering: pixelated; justify-self: center; margin: 0 auto 2px; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--br) 60%, transparent)); }
.ar-br { display: inline-flex; align-items: center; } .ar-brackets span { display: inline-flex; align-items: center; gap: 2px; }

/* Playtester badge (Oct19). */
.playtest-badge { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 50; padding: 6px 14px; border-radius: 999px; background: rgba(255, 202, 99, .14); border: 1px solid #ffca63; color: #ffe7b0; font-size: 12px; font-weight: 700; letter-spacing: .5px; pointer-events: none; }
html.m2 .playtest-badge { bottom: calc(76px + env(safe-area-inset-bottom)); }

/* Admin console layout (Oct19): chest picker row and the instant-timers switch. */
#admin-dialog .admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#admin-dialog .admin-actions > select { flex: 1 1 160px; height: auto; min-height: 40px; max-height: 44px; }
#admin-dialog .admin-actions > button { flex: 1 1 140px; min-height: 40px; writing-mode: horizontal-tb; }
#admin-dialog .admin-instant { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 13px; }

/* Mobile smoothness (Claude, Oct20; owner: "UI upgrades specially on mobile, clunky movements"). */
/* A live blur behind a window has to be recomputed every frame over the moving battlefield: phones get a plain dim. */
.online-portrait #game-window::backdrop, .online-portrait dialog::backdrop, html.m2 dialog::backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; background: #000c; }
/* No pull-to-refresh / rubber-band of the whole page while flying or scrolling a list. */
html.m2, html.m2 body { overscroll-behavior-y: none; }
/* Taps: no grey flash, no double-tap zoom on fast repeated taps (Dash, tabs, Open). */
html.m2 button, html.m2 a, html.m2 [role="button"], html.m2 summary, html.m2 .tabs > * { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
/* Buttons answer the finger at once (the press shows before the click lands). */
html.m2 button:active, html.m2 .button:active { filter: brightness(1.2); transition: none; }
/* Lists scroll on the compositor with momentum. */
html.m2 #game-window-content, html.m2 .inventory-grid, html.m2 .secondary-panel-body { -webkit-overflow-scrolling: touch; will-change: scroll-position; }

/* Reward system v2 (Oct20): Cache odds line, pay tag, Arch Fragments + crafting. */
.chest-card .chest-odds-line { display: block; font-size: 11px; line-height: 1.35; margin: 2px 0 4px; min-height: 2.7em; }
.trade-tag.is-choice { color: #cfe6ef; border-color: #2f6178; background: #0a1a24; white-space: normal; text-align: center; }
.chest-all > span { color: #cfe6ef; font-weight: 700; }
.cache-table td { vertical-align: top; } .cache-table img { width: 22px; height: 22px; vertical-align: middle; image-rendering: pixelated; }
.arch-craft { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.arch-frag { grid-column: 1 / -1; display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid #5a4a1c; border-radius: 6px; background: linear-gradient(90deg, #1d1708, #0a0d10); }
.arch-frag img { width: 44px; height: 44px; image-rendering: pixelated; }
.arch-frag small { display: block; font-size: 11px; letter-spacing: .06em; color: #c9a85a; }
.arch-frag strong { display: block; font-size: 20px; color: #ffe2a0; font-variant-numeric: tabular-nums; }
.arch-frag span { display: block; font-size: 12px; color: #b8ccd6; }
.arch-craft-btn { display: grid; gap: 2px; padding: 8px 10px; min-height: 58px; text-align: left; }
.arch-craft-btn b { font-size: 14px; } .arch-craft-btn span { font-size: 12px; color: #b8ccd6; }
.arch-mine em { font-style: normal; font-size: 12px; color: #9fe8b0; }
@media (max-width: 560px) { .arch-craft { grid-template-columns: 1fr; } }
/* Earnings pool tooltip (Oct20): tap or click the ⓘ. */
.earn-tip { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.earn-tip-btn { display: inline-grid; place-items: center; width: 24px; height: 24px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: #9fe8f5; font-size: 14px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.earn-tip-text { position: absolute; z-index: 30; left: 0; top: calc(100% + 6px); width: min(300px, 78vw); padding: 10px 12px; border: 1px solid #2f6178; border-radius: 6px; background: #06121b; color: #d2e5ef; font-size: 12px; font-weight: 400; line-height: 1.5; text-transform: none; letter-spacing: 0; box-shadow: 0 8px 24px #000a; white-space: normal; }
.earn-tip-text[hidden] { display: none; }
/* ---- Mobile audit fixes (Oct20) ---- */
/* resource strip: locked Credits sit on a second line, so the Credits value is never cut to "4…" */
html.m2 .resource-strip article { height: 34px !important; }
html.m2 .resource-strip article:has(.locked-chip) { display: grid !important; grid-template-columns: 16px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 4px; align-content: center; }
html.m2 .resource-strip article:has(.locked-chip) .resource-icon { grid-row: 1 / 3; align-self: center; }
html.m2 .resource-strip article:has(.locked-chip) strong { grid-column: 2; grid-row: 1; }
html.m2 .resource-strip article:has(.locked-chip) .locked-chip { position: static; grid-column: 2; grid-row: 2; font-size: 9.5px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Exchange: title, TEST pill and × stay on one line */
html.m2 .ex-head { flex-wrap: nowrap !important; }
html.m2 .ex-test { min-width: 0; margin-left: 8px; font-size: 9px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Inventory categories: words never split ("Consuma bles") */
html.m2 #view-fleet > #inventory-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 4px; }
html.m2 #inventory-tabs button { overflow-wrap: normal; word-break: keep-all; hyphens: none; font-size: 11px; padding-inline: 2px; letter-spacing: 0; line-height: 1.15; }
/* Community / Marketplace tabs: an even grid instead of ragged wrapping */
html.m2 :is(.cm-tabs, .market-tabs) { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); }
html.m2 :is(.cm-tabs, .market-tabs) button { padding: 2px 4px; white-space: normal; line-height: 1.15; overflow-wrap: normal; word-break: keep-all; }
html.m2 .market-tabs:has(> button:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* "What's on": a bigger touch area without making the banner taller */
html.m2 .event-banner button { position: relative; }
html.m2 .event-banner button::after { content: ""; position: absolute; inset: -6px -4px; }
html.m2 .earn-tip-btn { position: relative; } html.m2 .earn-tip-btn::after { content: ""; position: absolute; inset: -10px; }
html.m2 :is([data-stats-close], [data-sim-close], [data-jobs-close]) { min-width: 40px !important; min-height: 40px !important; }
/* bottom bar on phones: only the five tabs, from the first frame (not after the 500 ms tidy-up in mobile-v2.js) */
html.m2 .tabs > button:not([data-view="combat"]):not([data-view="fleet"]):not([data-view="missions"]):not([data-view="galaxy"]):not(#open-menu), html.m2 .tabs > .combat-quick-controls > button, html.m2 .tabs > #open-account { display: none !important; }
/* Community keeps one size on desktop: loading news or switching tabs (News, Rankings, ...) no longer resizes it */
@media (min-width: 900px) { #community-dialog[open] { height: min(640px, 88vh); overflow-y: auto; } }
/* Referral prize clause (Oct21, owner: "if your referral gets to win on our Test epoch you also get 50% of the Prize") */
.cm-rules .cm-rule-prize { list-style: none; margin: 4px 0 0 -18px; padding: 8px 10px; border: 1px solid #ffc26680; background: #1d1708; color: #ffe7b0; }
.cm-rules .cm-rule-prize b { color: #ffc266; }
/* Oct21: a control's cooldown sits on its own button, never over the whole Combat card (it covered the card on
   narrower desktop windows). */
#combat-commandbar button { position: relative; }
/* Narrower desktop windows (owner Oct21: "problems with UI if the window is a little bit smaller"): app tile names stay
   on one line, and the brand shrinks before the Genesis button can cover it. */
.online-portrait.demo-desk .phone-grid .tab-extra { min-width: 0; overflow-wrap: normal; word-break: normal; white-space: nowrap; line-height: 1.15; }
@media (max-width: 1280px) { .online-portrait.demo-desk .phone-grid .tab-extra { font-size: 10.5px; letter-spacing: -.01em; } }
@media (max-width: 1180px) { html:not(.m2) .topbar .brand-copy { display: none; } } /* the logo mark stays */
/* Add email sign-in + referral pass (Oct21) */
.account-email-form { display: grid; gap: 6px; margin: 10px 0; padding: 12px; border: 1px solid #23505f; background: #07151f; }
.account-email-form input { width: 100%; box-sizing: border-box; } .account-email-form label small { color: #9fb6c2; font-weight: 400; }
#account-email-code-row:not([hidden]) { display: grid; gap: 6px; } .account-email-actions { display: flex; gap: 8px; margin-top: 6px; }
#account-email small.fine { display: block; margin-top: 4px; }
.cm-ref-pass { display: grid; gap: 6px; margin: 10px 0; padding: 10px 12px; border: 1px solid #ffc26680; background: #1d1708; color: #ffe7b0; font-size: 12.5px; }
.cm-ref-pass b { color: #ffc266; font-size: 13px; }
/* Genesis License tab (Oct21, src/online-licenses.js) */
.license-dialog { width: min(980px, calc(100vw - 32px)); } .lic-body { max-height: 72vh; overflow: auto; }
.lic-lead { margin: 0 0 10px; font-size: 13px; color: #b8ccd6; line-height: 1.5; } .lic-lead b { color: #e8fbff; }
.lic-ok { margin: 0 0 10px; padding: 8px 10px; border: 1px solid #2f8a5a; background: #0a1d17; color: #9ff0c4; font-size: 13px; }
.lic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.lic-Uncommon { --lc: #5fe39a; } .lic-Rare { --lc: #57b8ff; } .lic-Epic { --lc: #d787ff; } .lic-Legendary { --lc: #ffc857; }
.lic-card { display: grid; gap: 6px; align-content: start; padding: 12px; background: linear-gradient(180deg, #0a1923, #040b11); border: 2px solid var(--lc); clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.lic-card.is-equipped { box-shadow: inset 0 0 28px color-mix(in srgb, var(--lc) 22%, transparent); }
.lic-top { display: flex; justify-content: space-between; font: 800 10px/1.2 system-ui, sans-serif; letter-spacing: .14em; color: var(--lc); } .lic-top b { color: #e8fbff; }
.lic-art { position: relative; height: 130px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--lc, #54e4f5) 45%, transparent); background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--lc, #54e4f5) 30%, transparent) 0%, #02060c 62%), #02060c; color: var(--lc, #54e4f5); }
.lic-art svg { width: 110px; height: 110px; filter: drop-shadow(0 0 10px var(--lc, #54e4f5)); }
.lic-name { font: 900 italic 19px/1.1 system-ui, sans-serif; text-transform: uppercase; color: #e8fbff; } .lic-tier { font-weight: 800; font-size: 12px; letter-spacing: .12em; color: var(--lc); }
.lic-stats { margin: 0; display: grid; gap: 3px; font-size: 12px; } .lic-stats div { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid #1e4152; padding-top: 3px; }
.lic-stats dt { color: #9fb6c2; } .lic-stats dd { margin: 0; color: #e8fbff; font-weight: 700; text-align: right; }
.lic-where { margin: 2px 0 0; font-size: 12px; color: #b8ccd6; } .lic-where b { color: var(--lc); }
.lic-act button { width: 100%; } .lic-card .fine { margin: 0; font-size: 11px; }
.lic-empty { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px; border: 1px dashed #2f6178; } .lic-empty p { margin: 0; color: #b8ccd6; font-size: 13px; line-height: 1.5; }
@media (max-width: 560px) { .lic-empty { grid-template-columns: 1fr; } .lic-grid { grid-template-columns: 1fr; } .lic-body { max-height: none; } .lic-art { height: 110px; } }
/* License tab: views, mint bar, marketplace rows, sell form (Oct21) */
.lic-views { display: flex; gap: 6px; margin: 0 0 10px; } .lic-views button { flex: 0 0 auto; padding: 6px 12px; } .lic-views button.on { border-color: #54e4f5; color: #e8fbff; box-shadow: inset 0 -2px 0 #54e4f5; }
.lic-mintbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; padding: 8px 10px; border: 1px solid #ffc85766; background: linear-gradient(90deg, #1d1606, #07121a); font-size: 13px; color: #d8c9a0; } .lic-mintbar b { color: #ffc857; }
.lic-act { display: grid; gap: 6px; } .lic-sell { opacity: .9; } .lic-listed { margin: 0; font-size: 12px; color: #b8ccd6; } .lic-listed b { color: #ffc857; }
.lic-price { display: grid; gap: 4px; font-size: 12px; color: #9fb6c2; } .lic-price input { width: 100%; box-sizing: border-box; }
.lic-rows { display: grid; gap: 8px; }
.lic-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--lc); background: #06111a; }
.lic-row-art { width: 44px; height: 44px; color: var(--lc); } .lic-row-art svg { width: 44px; height: 44px; }
.lic-row b { color: #e8fbff; } .lic-row small { display: block; color: #9fb6c2; font-size: 12px; overflow-wrap: anywhere; } .lic-row strong { color: #ffc857; white-space: nowrap; }
.lic-hist p { margin: 4px 0; font-size: 12px; color: #b8ccd6; }
@media (max-width: 560px) { .lic-row { grid-template-columns: 36px minmax(0, 1fr) auto; } .lic-row-art, .lic-row-art svg { width: 36px; height: 36px; } .lic-row button { grid-column: 1 / -1; } }
/* Genesis License mint panel in the Genesis window (src/launch-pack-features.js) */
.lic-sale-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 10px; font-size: 13px; color: #b8ccd6; } .lic-sale-stats b { color: #ffc857; }
.lic-phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 0 0 10px; }
.lic-phase { display: grid; gap: 8px; align-content: space-between; padding: 10px; border: 1px solid #2f6178; background: #06111a; opacity: .75; }
.lic-phase.is-open { opacity: 1; border-color: #ffc857; box-shadow: inset 0 0 24px #ffc85722; }
.lic-phase h4 { margin: 0 0 2px; color: #e8fbff; font-size: 14px; } .lic-phase p { margin: 0; font-size: 12px; color: #9fb6c2; } .lic-phase small { color: #9fb6c2; font-size: 12px; } .lic-phase button { width: 100%; }
.lic-odds { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; } .lic-odds li { padding: 4px 8px; border: 1px solid var(--lic); font-size: 12px; color: #b8ccd6; } .lic-odds b { color: var(--lic); }
/* License slot on the ship panel (Oct22): one slot card like the equipment slots. */
.lic-slot { --lc: #5fe39a; display: flex; align-items: center; gap: 10px; width: 100%; margin: 8px 0; padding: 6px 10px 6px 6px; text-align: left; background: #06121b; border: 1px solid var(--lc); border-image: none; color: #d9f6ff; cursor: pointer; min-height: 0; white-space: normal; }
.lic-slot:hover { background: #0a1c28; }
.lic-slot.lic-Rare { --lc: #57b8ff; } .lic-slot.lic-Epic { --lc: #d787ff; } .lic-slot.lic-Legendary { --lc: #ffc857; }
.lic-slot-icon { flex: none; width: 40px; height: 40px; background: url("../assets/ui/apps/license.png") center/28px no-repeat, radial-gradient(circle, color-mix(in srgb, var(--lc) 30%, transparent), #02060c 70%); border: 1px solid color-mix(in srgb, var(--lc) 55%, transparent); image-rendering: pixelated; }
.lic-slot-txt { display: grid; gap: 2px; min-width: 0; }
.lic-slot-txt small { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #8fa6b2; }
.lic-slot-txt b { font-size: 13px; color: #e8fbff; }
.lic-slot-line { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 11px; }
.lic-slot-line em { font-style: normal; color: var(--lc); font-weight: 700; }
.lic-slot-mod { padding: 1px 6px; border: 1px solid #2f6178; color: #9fb6c2; } .lic-slot-mod.is-on { border-color: #5fe39a; color: #c9f7dc; }
.lic-how { margin: -4px 0 12px; font-size: 13px; color: #b8ccd6; } .lic-how summary { cursor: pointer; color: #54e4f5; } .lic-how ul { margin: 6px 0 0; padding-left: 18px; } .lic-how li { margin: 3px 0; line-height: 1.45; }
.lic-perks { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 0 0 10px; }
.lic-perks > div { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid #1e4152; background: #06121b; }
.lic-perks b { color: #ffc857; font-size: 16px; } .lic-perks span { color: #9fb6c2; font-size: 12px; line-height: 1.35; }
/* Training ladder + CALI (Oct22, src/online-progress.js) */
/* Training locks (Nov3): locked items stay visible, greyed with a lock; a tap shows what opens them. */
.pg-locked { opacity: .42; filter: grayscale(.9); cursor: not-allowed; position: relative; }
.pg-locked::before { content: "🔒"; position: absolute; top: 2px; left: 3px; font-size: 11px; line-height: 1; filter: none; z-index: 1; pointer-events: none; }
.pg-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 6px auto 4px; padding: 6px 12px; max-width: 1180px; box-sizing: border-box; border: 1px solid #ffc266; border-left-width: 4px; background: linear-gradient(90deg, rgba(255,194,102,.14), rgba(4,17,26,.92)); color: #e8fbff; font-size: 14px; line-height: 1.35; }
.pg-strip .pg-badge { font-weight: 700; letter-spacing: .04em; color: #03080d; background: #ffc266; padding: 2px 8px; }
.pg-strip .pg-dots { display: inline-flex; gap: 4px; } .pg-strip .pg-dots i { width: 18px; height: 6px; background: #2f4b58; } .pg-strip .pg-dots i.done { background: #54e4f5; } .pg-strip .pg-dots i.now { background: #ffc266; }
.pg-strip .pg-goal { flex: 1 1 320px; } .pg-strip .pg-goal b { color: #ffc266; }
.pg-strip .pg-fine { font-size: 12px; color: #9fb6c2; }
@media (max-width: 600px) { .pg-strip { margin: 6px 8px 2px; padding: 8px 10px; font-size: 13px; } .pg-strip .pg-fine { display: none; } }
.pg-next { grid-column: 1 / -1; margin: 6px 0 2px; padding: 6px 8px; font-size: 11px; line-height: 1.4; color: #b8ccd6; border: 1px dashed #2f6178; background: #04111a; }
.pg-next b { color: #54e4f5; }
.cali-layer { position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; }
.cali-layer[hidden] { display: none; }
.cali-dim { position: fixed; background: #000a; pointer-events: auto; }
.cali-layer:not(.is-block) .cali-dim { display: none; }
.cali-ring { position: fixed; border: 2px solid #ffc857; box-shadow: 0 0 0 3px #ffc85744, 0 0 22px #ffc857aa; pointer-events: none; animation: cali-pulse 1.4s ease-in-out infinite; }
.cali-ring[hidden] { display: none; }
@keyframes cali-pulse { 50% { box-shadow: 0 0 0 6px #ffc85722, 0 0 30px #ffc857; } }
@media (prefers-reduced-motion: reduce) { .cali-ring { animation: none; } }
.cali-card { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(460px, calc(100vw - 20px)); display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 12px 14px;
  background: linear-gradient(180deg, #0a1f2c, #05121b); border: 1px solid #54e4f5; box-shadow: 0 10px 40px #000c, 0 0 0 1px #02060c; color: #e8f6fa; pointer-events: auto; font-size: 14px; line-height: 1.45; }
.cali-card.is-top { top: 14px; bottom: auto; }
.cali-face { display: grid; justify-items: center; align-content: start; gap: 2px; } .cali-face svg { width: 56px; height: 56px; } .cali-face b { font-size: 11px; letter-spacing: .2em; color: #54e4f5; }
.cali-text p { margin: 0 0 6px; } .cali-text b { color: #fff; } .cali-fine { font-size: 12px; color: #9fb6c2; }
.cali-row { display: flex; justify-content: flex-end; margin-top: 6px; } .cali-row button { min-height: 38px; padding: 6px 16px; }
.cali-list { margin: 0; padding-left: 18px; font-size: 13px; } .cali-list li { margin: 3px 0; }
@media (max-width: 600px) { .cali-card { grid-template-columns: 44px minmax(0, 1fr); gap: 8px; padding: 10px; font-size: 13px; bottom: 76px; } .cali-face svg { width: 40px; height: 40px; } }
em.stop-reason { display: block; font-style: normal; width: fit-content; }
/* UI pass Oct29: report filter chips never break a word ("Comba t" on phones); they wrap as whole chips instead. */
#report-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
#report-tabs button { flex: 1 0 auto; word-break: normal; overflow-wrap: normal; white-space: nowrap; }
/* UI pass Oct29: the selected Arena tab read as disabled (dark on dark); same bright style as the other window tabs. */
#ar-tabs button.is-active { border-image: none !important; border: 1px solid #4fd2ea !important; background: #4fd2ea !important; background-image: none !important; color: #04141a !important; font-weight: 800; }
/* UI pass Oct29 (owner: "a card based system on each, instead of wall of text"): short explainer cards for windows. */
.info-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0 0 10px; }
.info-cards > div { display: grid; align-content: start; gap: 3px; padding: 9px 11px; border: 1px solid #1e4152; border-top: 2px solid #4fd2ea; background: #06121b; }
.info-cards > div.warn { border-top-color: #ffc857; }
.info-cards b { color: #e8fbff; font-size: 14px; } .info-cards span { color: #9fb6c2; font-size: 12.5px; line-height: 1.4; }
.info-cards em { font-style: normal; color: #ffc857; font-weight: 700; }
/* Boss finale (Oct29): overlay canvas for the boss explosion, and a short shake of the battlefield. */
.boss-finale { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2147483000; }
.boss-shake { animation: boss-shake .5s linear 2; }
@keyframes boss-shake { 0%,100% { transform: none; } 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -4px); } 60% { transform: translate(-4px, -2px); } 80% { transform: translate(3px, 4px); } }
@media (prefers-reduced-motion: reduce) { .boss-shake { animation: none; } }
.boss-finale-on #combat-message { visibility: hidden; }
/* UI pass Oct29: sector labels sit clear of the selected outline and on a backing, so connector lines don't run through them. */
.galaxy-route-nodes .route-node small { top: calc(100% + 9px); padding: 0 4px; background: #050d13; line-height: 1.3; z-index: 1; }
/* UI pass Oct29: on phones the empty Reports detail pane kept 260px of blank space above "PWR history". */
@media (max-width: 700px) { #report-detail { min-height: 0; border-left: 0; padding-left: 0; } }
/* Arch Ship test Oct29: on phones the cinematic damage counter sat on the HP strip and the settings button. */
@media (max-width: 700px) { .arch-cine .cine-dmg { top: auto; bottom: calc(9% + 96px); right: 14px; } }
/* The Arch Ship cinematic takes no input (AUTO only): hide the move buttons while it plays. */
.combat-frame:has(#arch-cine) [data-combat-move] { visibility: hidden; }

/* Marketplace (Nov 1; owner: "basic like on the reference but our own design ... Not much text"): Buy / Sell /
   My listings as item cards for modules and commanders (src/online-market.js). */
.mk-market { display: grid; gap: 10px; }
.mk-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mk-cats { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid #1b3540; border-radius: 8px; background: #04101a; }
.mk-cats button { min-height: 32px; padding: 0 16px; border: 0 !important; border-radius: 6px; background: transparent !important; color: #9fbfcc; font-weight: 700; }
.mk-cats button.is-active { background: #54e4f5 !important; color: #03222b !important; }
.mk-bal { display: flex; gap: 6px; font-size: 13px; color: #9fbfcc; }
.mk-bal span { padding: 5px 10px; border: 1px solid #1b3540; border-radius: 999px; background: #06141b; }
.mk-bal b { color: #ffc266; }
.mk-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid #1b3540; }
.mk-tabs button { min-height: 38px; border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0; background: transparent !important; color: #8fb0bd; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 12.5px; }
.mk-tabs button.is-active { color: #54e4f5; border-bottom-color: #54e4f5 !important; }
.mk-tabs em { font-style: normal; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #54e4f5; color: #03222b; font-size: 11px; }
.mk-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.mk-filters select { width: auto !important; flex: 1 1 130px; min-height: 32px; }
.mk-filters #mk-refresh { flex: 0 0 auto; width: 38px !important; min-height: 32px; padding: 0; }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mk-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 10px 10px; text-align: center; border: 1px solid color-mix(in srgb, var(--rar) 45%, #1b3540); border-top: 3px solid var(--rar); border-radius: 8px; background: linear-gradient(180deg, color-mix(in srgb, var(--rar) 9%, #06141b), #050f15 70%); }
.mk-rar { position: absolute; top: 6px; left: 8px; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--rar); }
.mk-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 2px 0 4px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--rar) 26%, transparent), transparent 70%); }
.mk-icon canvas { width: 44px; height: 44px; image-rendering: pixelated; }
.mk-icon img, .mk-icon .commander-portrait { max-width: 52px; max-height: 52px; width: auto; height: auto; object-fit: contain; image-rendering: pixelated; border-radius: 6px; }
.mk-name { font-size: 14px; line-height: 1.2; color: #e8fbff; }
.mk-stats { min-height: 1.3em; font-size: 11.5px; color: #8fb0bd; }
.mk-price { margin-top: 2px; font-size: 18px; font-weight: 800; color: #ffc266; } .mk-price i { font-style: normal; font-size: 11px; color: #c9a66b; }
.mk-btn { width: 100%; min-height: 34px; margin-top: auto; font-weight: 800; }
.mk-card .mk-btn { margin-top: 6px; }
.mk-btn.primary { background: #54e4f5 !important; background-image: none !important; border-image: none !important; color: #03222b !important; border: 1px solid #54e4f5 !important; border-radius: 6px; }
.mk-btn.primary:hover:not(:disabled) { background: #8ef0fb !important; }
.mk-btn.primary:disabled { opacity: .5; }
.mk-empty { grid-column: 1 / -1; margin: 30px 0; text-align: center; color: #7fa2b0; font-style: italic; }
.mk-hint { margin: 0 0 8px; font-size: 12px; color: #7fa2b0; text-align: center; }
.mk-error { margin: 0; padding: 8px 10px; border: 1px solid #ff6b6b66; border-radius: 6px; background: #2a0c0c; color: #ffb4b4; font-size: 13px; }
.mk-sub { margin: 14px 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #9fdcef; }
.mk-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mk-recent li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 6px 10px; border: 1px solid #1b3540; border-radius: 6px; font-size: 12.5px; color: #cfe2ea; } .mk-recent b { color: #ffc266; }
.mk-foot { margin: 4px 0 0; text-align: center; font-size: 11.5px; color: #6f8f9c; font-style: italic; }
.mk-dialog { width: min(380px, calc(100vw - 32px)); padding: 18px; border: 1px solid #54e4f5; border-radius: 10px; background: #06141b; color: #e8fbff; }
.mk-dialog::backdrop { background: #000a; }
.mk-dialog h2 { margin: 0 0 12px; font-size: 18px; }
.mk-dlg-item { display: flex; align-items: center; gap: 12px; padding: 10px; margin-bottom: 12px; border: 1px solid color-mix(in srgb, var(--rar) 45%, #1b3540); border-radius: 8px; }
.mk-dlg-item .mk-icon { margin: 0; flex: none; } .mk-dlg-item > div:last-child { display: grid; gap: 2px; text-align: left; } .mk-dlg-item .mk-rar { position: static; }
.mk-dialog label { display: block; margin-bottom: 4px; font-size: 12px; color: #8fb0bd; }
.mk-price-in { display: flex; align-items: center; border: 1px solid #54e4f5; border-radius: 6px; background: #03080d; }
.mk-price-in input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; color: #e8fbff; font-size: 20px; font-weight: 800; padding: 8px 10px; }
.mk-price-in span { padding: 0 12px; color: #ffc266; font-weight: 800; }
.mk-quote { margin: 8px 0 14px; font-size: 13px; color: #cfe2ea; } .mk-quote em { color: #ff9a9a; font-style: normal; }
.mk-dlg-row { display: flex; gap: 8px; } .mk-dlg-row .mk-btn { flex: 1; margin: 0; }
@media (max-width: 520px) { .mk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .mk-card { padding: 20px 6px 8px; } .mk-bal { width: 100%; } .mk-bal span { flex: 1; text-align: center; } }

/* Playtest timeline (Nov 1): the countdown chip next to Genesis and Guide -> Playtest (src/online-timeline.js) */
.online-portrait .top-actions > .tl-chip { border-color: #2f6b82; }
.tl-chip img { width: 22px; height: 22px; image-rendering: pixelated; }
.tl-chip span { display: grid; line-height: 1.1; text-align: left; }
.tl-chip small { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8fb0bd; }
.tl-chip b { font-size: 14px; color: #54e4f5; font-variant-numeric: tabular-nums; }
.tl-note { margin: 0 0 8px; padding: 8px 10px; border-left: 3px solid #ffc266; background: #1d1608; color: #f1dfb8; font-size: 13px; }
.tl-list { list-style: none; margin: 8px 0 0; padding: 0 0 0 4px; }
.tl-list li { position: relative; display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: start; padding: 7px 0 7px 0; border-left: 2px solid #1b3540; margin-left: 6px; padding-left: 0; }
.tl-list li > .tl-dot { width: 12px; height: 12px; margin: 3px 0 0 -7px; border-radius: 50%; background: #06141b; border: 2px solid #2f6b82; }
.tl-list li > div { display: grid; gap: 2px; font-size: 13px; color: #e8fbff; } .tl-list small { color: #8fb0bd; font-size: 12px; }
.tl-list time { font-size: 12px; color: #8fb0bd; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-list em { font-style: normal; color: #54e4f5; font-weight: 800; margin-left: 4px; }
.tl-list .tl-payout > div b { font-weight: 600; color: #cfe2ea; }
.tl-list .tl-start .tl-dot, .tl-list .tl-end .tl-dot { border-color: #ffc266; }
.tl-list .tl-unlock .tl-dot { border-color: #b77cff; }
.tl-list .is-past { opacity: .45; } .tl-list .is-past .tl-dot { background: #2f6b82; }
.tl-list .is-next .tl-dot { background: #54e4f5; border-color: #54e4f5; box-shadow: 0 0 8px #54e4f5aa; }
.tl-list .is-next > div b { color: #54e4f5; }

/* RIFT-OS folding (Nov3 launch): tap the status bar to hide or show every app, a section title to fold that section. */
.online-portrait.demo-desk .rift-phone .phone-status { cursor: pointer; border-radius: 10px; }
.online-portrait.demo-desk .rift-phone .phone-status:hover, .online-portrait.demo-desk .rift-phone .phone-status:focus-visible { background: #0f2a35; outline: none; }
.online-portrait.demo-desk .rift-phone .phone-os::after { content: " ▾"; color: #9fb4bf; }
.online-portrait.demo-desk .rift-phone.is-folded .phone-os::after { content: " ▸"; }
.online-portrait.demo-desk .rift-phone.is-folded .phone-grid { display: none; }
.online-portrait.demo-desk .phone-grid .phone-folded { display: none !important; }
.online-portrait.demo-desk .phone-grid .phone-cat { cursor: pointer; }
.online-portrait.demo-desk .phone-grid .phone-cat::before { content: "▾"; font-size: 10px; letter-spacing: 0; }
.online-portrait.demo-desk .phone-grid .phone-cat[aria-expanded="false"]::before { content: "▸"; }
.online-portrait.demo-desk .phone-grid .phone-cat:hover, .online-portrait.demo-desk .phone-grid .phone-cat:focus-visible { opacity: 1; color: #bff8ff; outline: none; }
