:root {
  --bg: #0a0b10; --panel: rgba(14, 15, 22, 0.92); --panel2: #171925; --line: #2a2d3e; --text: #e8e9f0; --muted: #8a8ea6;
  --blue: #2f7dff; --gold: #ffd34a; --red: #ff4a4a; --green: #6aff8a; --neon: #ff3df0; --cyan: #3df5ff;
  --display: Impact, 'Haettenschweiler', 'Arial Narrow Bold', 'Franklin Gothic Bold', sans-serif;
  --ui: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 var(--ui); overflow: hidden; user-select: none; }
[hidden] { display: none !important; }
button { font: inherit; color: var(--text); background: linear-gradient(#262a3c, #1a1d2b); border: 1px solid #3a3f58; border-radius: 6px; padding: 8px 14px; cursor: pointer; transition: transform .08s, border-color .15s, box-shadow .15s; }
button:hover { border-color: var(--blue); box-shadow: 0 0 12px rgba(47, 125, 255, .35); }
button:active { transform: translateY(1px) scale(.98); }
button.primary { background: linear-gradient(#2f7dff, #1d4fb0); border-color: #6aa8ff; }
button.danger { background: linear-gradient(#5a1a22, #3a1016); border-color: #a33; }
button.small { padding: 4px 10px; font-size: 12px; opacity: .7; }
select, input { font: inherit; color: var(--text); background: #12141e; border: 1px solid #343850; border-radius: 5px; padding: 6px 8px; }
kbd { display: inline-block; font: bold 10px/1 var(--ui); padding: 2px 4px; border-radius: 3px; background: #2a2e44; border: 1px solid #454a68; color: #fff; }
.muted { color: var(--muted); } .small { font-size: 12px; } .err { color: var(--red); min-height: 1.4em; margin-top: 8px; }
.good { color: var(--green); } .bad { color: var(--red); }

/* ---------------------------------------------------------------- canvas */
#game { position: fixed; inset: 0; display: block; outline: none; }

/* ---------------------------------------------------------------- intro splash */
/* The whole artwork is always visible (contain); a blurred copy fills the bars on screens
   that aren't 3:2. The main menu is already rendered underneath and is revealed on click. */
#splash { position: fixed; inset: 0; z-index: 60; background: #000; cursor: pointer; overflow: hidden; outline: none;
  display: flex; align-items: center; justify-content: center; transition: opacity .45s ease; -webkit-tap-highlight-color: transparent; }
#splash.out { opacity: 0; pointer-events: none; }
.splash-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(18px) brightness(.5) saturate(1.2); transform: scale(1.15); }
.splash-art { position: relative; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
@media (prefers-reduced-motion: reduce) { #splash { transition: none; } }

/* ---------------------------------------------------------------- menus */
#menu { position: fixed; inset: 0; overflow-y: auto; z-index: 10; }
#menu.bg-city { background:
  radial-gradient(ellipse at 20% 110%, rgba(47, 125, 255, .35), transparent 55%),
  radial-gradient(ellipse at 85% -10%, rgba(255, 61, 240, .25), transparent 50%),
  repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 2px, transparent 2px 60px),
  linear-gradient(#0b0c14, #07070b); }
/* Main screen: the intro art behind the menu, darkened so the buttons and cards stay readable. */
#menu.bg-title { background: #07070b; }
#menu.bg-title::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; /* a fixed layer, not background-attachment: fixed, which iOS ignores */
  background: linear-gradient(rgba(7, 7, 11, .55), rgba(7, 7, 11, .8)), url(../img/title-bg.jpg) center / cover no-repeat; }
.title-screen { position: relative; min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 22px; padding: 40px 16px; }
.main-btns { display: grid; gap: 10px; width: min(420px, 92vw); }
/* The buttons start a third of the way down, below the title art in the background. */
.title-screen .main-btns { margin-top: 23.33vh; margin-top: 23.33dvh; }
/* Button art from /admin (buttons/<id>.png) in place of the text button; the text stays for screen readers. */
button.art-btn { padding: 0; border: 0; background: none; box-shadow: none; font-size: 0; color: transparent; line-height: 0; }
button.art-btn > small { display: none; }
button.art-btn img { display: block; height: 38px; width: auto; pointer-events: none; -webkit-user-drag: none; }
.main-btns button.art-btn { display: block; padding: 0; font-size: 0; }
.main-btns button.art-btn img { width: 100%; height: auto; aspect-ratio: 551 / 112; object-fit: contain; } /* one shape, so the plates line up evenly */
button.art-btn:hover { box-shadow: none; filter: brightness(1.15) drop-shadow(0 0 8px rgba(47, 125, 255, .6)); }
.title-fs { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 1; white-space: nowrap; }
.title-fs:active { transform: translateX(-50%) translateY(1px) scale(.98); }
.title-fs.on { background: linear-gradient(#2f7dff, #1d4fb0); border-color: #6aa8ff; }
.main-btns .big { display: flex; justify-content: space-between; align-items: center; font: 22px var(--display); letter-spacing: 1px; padding: 14px 20px; text-align: left; }
.main-btns .big small { font: 12px var(--ui); color: #c8cce0; opacity: .8; letter-spacing: 0; }
.faction-strip { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 900px; }
.faction-strip span { border: 1px solid var(--c); color: var(--c); padding: 3px 10px; border-radius: 20px; font: 13px var(--display); letter-spacing: 1px; box-shadow: 0 0 10px color-mix(in srgb, var(--c) 30%, transparent); }
.screen { max-width: 1100px; margin: 0 auto; padding: 30px 20px 60px; position: relative; }
.screen h1 { font: 900 48px/1 var(--display); letter-spacing: 2px; margin: 10px 0 8px; text-shadow: 0 0 20px rgba(47, 125, 255, .6); }
.lead { font-size: 16px; color: #c7cbe0; max-width: 760px; }
.back { margin-bottom: 8px; }
.missions { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin: 20px 0; }
.save-list { display: grid; gap: 8px; max-width: 760px; }
.save-row { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 8px; padding: 12px 14px; }
.save-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.save-row small { color: #aab; }
.mission { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 8px; padding: 16px; cursor: pointer; transition: transform .1s, box-shadow .15s; }
.mission:hover { transform: translateY(-2px); box-shadow: 0 6px 30px rgba(47, 125, 255, .3); }
.mission.locked { opacity: .45; cursor: not-allowed; border-left-color: #444; }
.m-num { color: var(--gold); font: 13px var(--display); letter-spacing: 2px; text-transform: uppercase; }
.m-title { font: 28px var(--display); letter-spacing: 1px; }
.m-loc { color: var(--muted); font-size: 13px; }
.m-teach { margin-top: 8px; font-size: 13px; color: #b8c0e0; }
.briefing .brief-text { font-size: 19px; line-height: 1.6; max-width: 760px; border-left: 3px solid var(--neon); padding-left: 16px; margin: 20px 0; }
.brief-teach { background: var(--panel); padding: 12px; border-radius: 8px; max-width: 760px; }
.brief-cast { display: flex; gap: 14px; align-items: center; margin: 20px 0; }
.brief-cast img { width: 96px; height: 96px; flex: none; border-radius: 8px; border: 2px solid var(--blue); }
.big { font-size: 18px; padding: 12px 24px; }

.slots { display: grid; gap: 6px; margin: 18px 0; }
.slot { display: grid; grid-template-columns: 30px 1.2fr 230px 1.4fr 100px 120px 64px 24px; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--c, #444); border-radius: 6px; padding: 6px 10px; }
.slot.closed, .slot.open { grid-template-columns: 30px 1fr; opacity: .6; }
.slot-n { font: 20px var(--display); color: var(--muted); }
.slot-name { font-weight: bold; }
.slot-pass { cursor: help; color: var(--gold); }
.slot-diff { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.slot-res { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.slot-res label { display: flex; align-items: center; gap: 4px; } .slot-res input { width: 74px; padding: 2px 4px; }
.slot-ring { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.slot-diff span { font-size: 12px; color: var(--muted); }
.slot-diff select { flex: 1; min-width: 0; }
.lobby-settings { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.lobby-chat { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin-bottom: 14px; }
#lobby-chat { height: 90px; overflow-y: auto; font-size: 13px; }
.lobby-chat form { display: flex; gap: 8px; margin-top: 6px; } .lobby-chat input { flex: 1; min-width: 0; }
.code { color: var(--gold); letter-spacing: 6px; text-shadow: 0 0 12px var(--gold); }
.mp-box { display: grid; gap: 12px; max-width: 380px; margin-top: 20px; }
.mp-box label { display: grid; gap: 4px; }
.join-row { display: flex; gap: 8px; } .join-row input { flex: 1; text-transform: uppercase; letter-spacing: 4px; font-size: 20px; text-align: center; }
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #3a1016; border: 1px solid var(--red); padding: 10px 18px; border-radius: 8px; z-index: 100; }

.codex-tabs, .codex-sub { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.codex-tabs button { border-color: var(--c); }
.codex-tabs button.on, .codex-sub button.on { background: var(--c, var(--blue)); color: #000; font-weight: bold; }
.codex-sub button.on { --c: var(--fc); }
.codex-head p { max-width: 820px; }
.passive { background: var(--panel); border-left: 3px solid var(--fc); padding: 8px 12px; border-radius: 4px; }
.hero-card { display: flex; gap: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 12px 0 18px; }
.hero-card img { border-radius: 10px; border: 2px solid var(--gold); align-self: flex-start; }
.hero-card h2 { margin: 0; font: 30px var(--display); letter-spacing: 1px; }
.abil { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.ab { display: flex; gap: 8px; align-items: flex-start; background: var(--panel2); padding: 8px; border-radius: 6px; }
.ab > span { font-size: 24px; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ucard { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px; text-align: center; font-size: 12px; }
.ucard img { border-radius: 6px; }
.uname { font: 16px var(--display); letter-spacing: .5px; } .urole, .ucost { color: var(--muted); } .ustat { margin-top: 4px; } .uab { margin-top: 6px; color: var(--gold); }
.howto .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.settings .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.set-row input[type=range] { width: 180px; }
.swatches { display: flex; gap: 6px; margin: 10px 0; }
.swatches span { width: 26px; height: 18px; border-radius: 4px; border: 1px solid #0006; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.set-msg { min-height: 1.4em; margin-top: 8px; } .set-msg.ok { color: var(--green); } .set-msg.err { color: var(--red); }
.keybtn { min-width: 110px; padding: 4px 10px; font-weight: bold; }
.keybtn.listening { border-color: var(--gold); color: var(--gold); }
table.hotkeys td { vertical-align: middle; }
@media (max-width: 800px) { .howto .cols, .settings .cols { grid-template-columns: 1fr; } .slot { grid-template-columns: 24px 1fr 1fr; } }
table.keys { border-collapse: collapse; width: 100%; }
table.keys td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.keys td:first-child { white-space: nowrap; color: var(--gold); }

/* ---------------------------------------------------------------- tech tree */
.tt-grid { display: grid; gap: 4px; overflow-x: auto; }
.tt-row { display: grid; grid-template-columns: 210px 1fr 1fr 1fr; gap: 6px; align-items: stretch; min-width: 860px; }
.tt-header > div { font: 15px var(--display); letter-spacing: 1px; color: var(--gold); padding: 6px 8px; background: var(--panel2); border-radius: 4px; }
.tt-b { display: flex; gap: 8px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; position: relative; }
.tt-bi { font-size: 26px; }
/* Button art in place of an emoji (artIcon in ui/hud.js), sized to the spot it fills. */
img.art-ic { display: block; width: 1.4em; height: 1.4em; border-radius: 4px; object-fit: contain; }
.tt-bi img.art-ic { width: 44px; height: 44px; } .tt-ic img.art-ic { width: 36px; height: 36px; }
.uc-ai img.art-ic { width: 20px; height: 20px; } .tt-ab img.art-ic { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; }
.ab > span img.art-ic { width: 36px; height: 36px; } .sp-buffs img.art-ic { width: 18px; height: 18px; }
.tt-col { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 6px; background: rgba(255,255,255,.02); position: relative; }
.tt-col.t2 { background: rgba(47,125,255,.05); } .tt-col.t3 { background: rgba(255,211,74,.05); }
.tt-chip { display: flex; gap: 6px; align-items: center; background: #1b1e2c; border: 1px solid #30344a; border-radius: 6px; padding: 4px 8px 4px 4px; position: relative; min-width: 150px; flex: 1 1 150px; max-width: 230px; }
.tt-chip img { width: 36px; height: 36px; border-radius: 4px; }
.tt-ic { font-size: 22px; width: 36px; text-align: center; }
.tt-name { font-weight: bold; font-size: 12.5px; } .tt-cost { font-size: 11px; color: var(--muted); } .tt-req { font-size: 10.5px; color: #c9a26b; }
.tt-st { position: absolute; top: 3px; right: 5px; font-size: 11px; }
.tt-chip.have, .tt-b.have { border-color: #3a8a4a; box-shadow: inset 0 0 0 1px #3a8a4a; }
.tt-chip.locked, .tt-b.locked { opacity: .55; }
.tt-hero { display: flex; gap: 12px; align-items: center; background: var(--panel2); border: 1px solid var(--gold); border-radius: 8px; padding: 10px; margin-top: 10px; }
.tt-hero img { border-radius: 8px; }
.tt-abs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tt-ab { background: #222538; padding: 3px 8px; border-radius: 12px; font-size: 12px; }
.tt-legend { margin-bottom: 8px; color: #c7cbe0; }
#menutip { position: fixed; z-index: 200; max-width: 300px; background: #0c0d14; border: 1px solid #454a68; border-radius: 6px; padding: 8px 10px; font-size: 12.5px; pointer-events: none; box-shadow: 0 6px 30px rgba(0,0,0,.6); }

/* ---------------------------------------------------------------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
/* iPhone/iPad from the Home Screen draw the status bar over the page (viewport-fit=cover, black-translucent):
   start the HUD below it, or iOS takes taps on the top bar (Tools, Tech, Menu). */
#hud { top: env(safe-area-inset-top, 0px); }
#hud > * { pointer-events: auto; }
#topbar { position: absolute; top: 0; left: 0; right: 0; height: 38px; display: flex; gap: 6px; align-items: center; padding: 0 10px;
  background: linear-gradient(rgba(8,9,14,.95), rgba(8,9,14,.75)); border-bottom: 1px solid #23263a; }
#topbar .res { font-size: 15px; padding: 3px 12px; background: rgba(255,255,255,.04); border: 1px solid #262a3e; border-radius: 18px; cursor: help; }
#topbar .res b { font: 17px var(--display); letter-spacing: .5px; display: inline-block; font-variant-numeric: tabular-nums; }
/* Room reserved per number, so a value changing (cash climbing into 6 digits) never nudges the chips beside it. */
#r-cash b { min-width: 6.6ch; } #r-resp b, #r-fuel b { min-width: 4.6ch; } #r-crew b { min-width: 6ch; } #r-tier b { min-width: 2.2ch; }
#r-cash b { color: #8dff7a; } #r-resp b { color: var(--gold); } #r-fuel b { color: #ffb347; } #r-crew b.short { color: var(--red); animation: pulse 1s infinite; }
#topbar .spacer { flex: 1; }
#topbar button { padding: 4px 10px; font-size: 13px; }
/* Tools dropdown under its top-bar button: quick actions (touch only), sound, display. */
#b-tools.open { border-color: var(--gold); }
#b-tools.on, #b-fs.on, #tools button.on { background: linear-gradient(#2f7dff, #1d4fb0); border-color: #6aa8ff; }
#tools:not([hidden]) { display: flex; flex-direction: column; gap: 8px; position: absolute; top: 42px; right: max(10px, env(safe-area-inset-right)); z-index: 20; pointer-events: auto;
  width: 250px; max-height: calc(100vh - 52px); overflow-y: auto; padding: 8px 10px; background: rgba(8, 9, 14, .95); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 30px rgba(0,0,0,.6); }
#tools .tb-quick { display: none; }
body.touch #tools .tb-quick { display: flex; }
#tools .tb-touch { display: none; }
body.touch #tools .tb-row.tb-touch { display: flex; }
body:not(.touch) #tools .tb-quick + .tb-sec { border-top: 0; padding-top: 0; }
.tb-sec { display: flex; flex-direction: column; gap: 5px; }
.tb-sec + .tb-sec { border-top: 1px solid var(--line); padding-top: 8px; }
.tb-h { font: 13px var(--display); letter-spacing: 1px; text-transform: uppercase; color: var(--gold); }
.tb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
#tools button { padding: 7px 8px; font-size: 13px; white-space: nowrap; background: rgba(20, 22, 34, .88); }
.tb-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; cursor: pointer; }
.tb-row input[type=range] { width: 130px; }
.tb-row input[type=checkbox] { width: 20px; height: 20px; }
.tb-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
@keyframes pulse { 50% { opacity: .5; } }
#objectives { position: absolute; top: 48px; left: 10px; width: 300px; background: var(--panel); border: 1px solid #2a2d42; border-left: 3px solid var(--gold); border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.obj-title { font: 13px var(--display); letter-spacing: 2px; color: var(--gold); margin-bottom: 4px; }
.obj { padding: 2px 0; } .obj.done { color: var(--green); text-decoration: line-through; opacity: .8; } .obj.failed { color: var(--red); } .obj.opt { color: #b8c0e0; font-style: italic; }
.obj small { color: var(--gold); font-style: normal; }
#notices { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.notice { font: 16px var(--display); letter-spacing: .6px; padding: 4px 16px; border-radius: 4px; background: rgba(8,9,14,.75); text-shadow: 0 2px 4px #000; animation: noticeIn .25s ease-out; transition: opacity .8s; }
.notice.err { color: #ff8a8a; } .notice.good { color: #9dffb0; } .notice.fade { opacity: 0; }
@keyframes noticeIn { from { transform: scale(1.4); opacity: 0; } }
#hint { position: absolute; top: 48px; right: 10px; width: 340px; background: rgba(20, 26, 50, .95); border: 1px solid var(--blue); box-shadow: 0 0 22px rgba(47,125,255,.45); border-radius: 8px; padding: 10px 12px; font-size: 14px; line-height: 1.5; }
#hint.pop { animation: noticeIn .3s ease-out; }
#bottom { position: absolute; left: 0; right: 0; bottom: 0; height: 200px; display: flex; gap: 0; align-items: flex-end; pointer-events: none; }
#bottom > * { pointer-events: auto; }
#mm-wrap { width: 230px; height: 230px; padding: 5px; background: var(--panel); border: 1px solid #2c3048; border-radius: 0 10px 0 0; }
#minimap { width: 220px; height: 220px; display: block; cursor: pointer; image-rendering: pixelated; }
#selpanel { flex: 1; height: 170px; background: var(--panel); border-top: 1px solid #2c3048; padding: 10px; overflow: hidden; }
.sp-empty { color: var(--muted); text-align: center; padding-top: 40px; }
.sp-one { display: flex; gap: 12px; height: 100%; }
.sp-port { width: 96px; height: 96px; border-radius: 8px; border: 1px solid #3a3f58; flex-shrink: 0; }
img.sp-port { border-width: 2px; }
/* Dev portrait art (/media/...) may not be square: fill the frame instead of stretching. */
img[src^="/media/"] { object-fit: cover; }
.sp-port.big { display: flex; align-items: center; justify-content: center; font-size: 56px; background: #12141e; }
.sp-info { flex: 1; min-width: 0; }
.sp-name { font: 22px var(--display); letter-spacing: .5px; } .sp-name small { font: 12px var(--ui); color: var(--gold); }
.sp-sub { color: var(--muted); font-size: 12px; }
.sp-tag { font-size: 10px; font-weight: bold; text-transform: uppercase; letter-spacing: .5px; padding: 0 5px; border-radius: 3px; border: 1px solid; }
.sp-tag.ally { color: #ffe65a; border-color: #ffe65a66; }
.sp-tag.enemy { color: #ff5a5a; border-color: #ff5a5a66; }
.hpbar { position: relative; height: 16px; background: #2a0d10; border-radius: 3px; margin: 4px 0; overflow: hidden; max-width: 420px; }
.hpbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#4dff6a, #22a83c); transition: width .15s; }
.hpbar span { position: relative; font-size: 11px; font-weight: bold; padding-left: 6px; text-shadow: 0 1px 2px #000; }
.sp-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; } .sp-stats span { cursor: help; } .sp-stats small { color: var(--muted); }
.sp-desc { font-size: 12px; color: #b8bdd6; margin-top: 4px; max-height: 48px; overflow: hidden; }
.sp-xp { position: relative; height: 12px; background: #2a2410; border-radius: 3px; overflow: hidden; max-width: 420px; margin: 3px 0; }
.sp-xp i { position: absolute; inset: 0 auto 0 0; background: var(--gold); } .sp-xp span { position: relative; font-size: 10px; padding-left: 6px; color: #000; font-weight: bold; }
.sp-q { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.sp-q .bar, .sp-q > .bar { height: 6px; background: #222; border-radius: 3px; overflow: hidden; width: 200px; }
.sp-q .bar i { display: block; height: 100%; background: #6ac8ff; }
.qitem { position: relative; width: 40px; height: 40px; border: 1px solid #3a3f58; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.qitem img { width: 36px; height: 36px; } .qitem .qi { font-size: 22px; }
.qitem .bar { position: absolute; bottom: -8px; left: 0; width: 40px !important; }
.qitem:hover { border-color: var(--red); }
.sp-qlabel { font-size: 12px; color: var(--gold); margin-right: 6px; }
.sp-buffs { margin-top: 4px; display: flex; gap: 4px; } .sp-buffs span { cursor: help; }
.sp-multi { display: flex; flex-wrap: wrap; gap: 4px; }
.mini { width: 44px; height: 50px; border: 1px solid #3a3f58; border-radius: 4px; cursor: pointer; position: relative; background: #12141e; display: flex; flex-direction: column; align-items: center; }
.mini img { width: 40px; height: 40px; } .mini .bi { font-size: 26px; height: 40px; line-height: 40px; }
.mini b { position: absolute; bottom: 2px; left: 3px; right: 3px; height: 4px; background: #300; } .mini b i { display: block; height: 100%; background: #4dff6a; }
.mini.active { border-color: var(--gold); box-shadow: 0 0 6px var(--gold); }
.mini:hover { border-color: #fff; }
.more { align-self: center; color: var(--muted); }
/* Three rows show at a time; more buttons (a big mixed group) scroll, with the bar on the side. */
#cmdcard { --card-h: 220px; --pad: 6px; --gap: 4px; width: 290px; height: var(--card-h); box-sizing: border-box; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: calc((var(--card-h) - 2px - var(--pad) * 2 - var(--gap) * 2) / 3); gap: var(--gap); padding: var(--pad); background: var(--panel); border: 1px solid #2c3048; border-radius: 10px 0 0 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #5a6188 transparent; }
#cmdcard.more { -webkit-mask-image: linear-gradient(#000 calc(100% - 26px), rgba(0,0,0,.35)); mask-image: linear-gradient(#000 calc(100% - 26px), rgba(0,0,0,.35)); }
#cmdcard::-webkit-scrollbar { width: 8px; } #cmdcard::-webkit-scrollbar-thumb { background: #5a6188; border-radius: 4px; } #cmdcard::-webkit-scrollbar-track { background: transparent; }
/* Minimize/lock tab on the panel's top right corner; minimized, the panel slides away and the tab drops to the bottom. */
#hudctl { position: absolute; right: env(safe-area-inset-right); bottom: calc(var(--card-h, 220px) + env(safe-area-inset-bottom)); display: flex; gap: 2px; padding: 3px 4px 0; background: var(--panel); border: 1px solid #2c3048; border-bottom: 0; border-radius: 8px 8px 0 0; transition: bottom .2s ease; z-index: 1; }
#hudctl button { width: 30px; height: 24px; padding: 0; font-size: 14px; line-height: 1; background: #1c1f2e; color: #dfe3f5; border: 1px solid #3a3f58; border-radius: 5px; cursor: pointer; }
#hudctl button:hover { border-color: var(--gold); } #hudctl button.on { border-color: var(--gold); background: #2a2410; }
#selpanel, #cmdcard { transition: transform .2s ease; }
#bottom.min #selpanel, #bottom.min #cmdcard { transform: translateY(calc(100% + 40px)); pointer-events: none; }
#bottom.min #hudctl { bottom: env(safe-area-inset-bottom); }
.cmd { position: relative; background: linear-gradient(#262a3c, #161824); border: 1px solid #3a3f58; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; transition: transform .06s, border-color .12s; }
.cmd:hover { border-color: var(--gold); box-shadow: 0 0 10px rgba(255,211,74,.35); }
.cmd:active { transform: scale(.94); }
.cmd.empty { background: rgba(255,255,255,.02); border-color: #1d1f2c; cursor: default; box-shadow: none; }
.cmd .ic { font-size: 28px; filter: drop-shadow(0 2px 2px #000); }
.cmd img { width: 52px; height: 52px; border-radius: 4px; }
.cmd kbd { position: absolute; top: 2px; left: 2px; opacity: .9; }
.cmd .cc { position: absolute; bottom: 1px; right: 3px; font-size: 9.5px; text-shadow: 0 1px 2px #000; }
.cmd .cc .short, .tcost .short { color: var(--red); }
.cmd.poor img, .cmd.poor .ic { opacity: .55; }
.cmd.blocked { filter: grayscale(.85) brightness(.6); }
.cmd.passive { cursor: help; border-style: dashed; }
.cmd .lock { position: absolute; top: 2px; right: 3px; font-size: 11px; }
/* Banner art from hud/ (see ui/hud.js renderCommands): two columns wide, drawn whole; its own frame replaces the cell's. */
#cmdcard.wide { grid-auto-flow: row dense; }
#cmdcard.wide .cmd:not(.wide) img { max-height: 100%; width: auto; }
.cmd.wide { grid-column: span 2; background: none; border: 0; border-radius: 4px; }
.cmd.wide.end { grid-column: 3 / span 2; } /* Back, cancels and Rally Point stay bottom right */
.cmd.wide img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.cmd.wide:hover { box-shadow: none; filter: brightness(1.2) drop-shadow(0 0 6px rgba(255,211,74,.5)); }
.cmd.wide.blocked { filter: grayscale(.85) brightness(.6); }
.cdov { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.65); color: #fff; font: 18px var(--display); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.tut-hl { animation: hl 1s infinite; z-index: 3; }
@keyframes hl { 50% { box-shadow: 0 0 0 3px var(--gold), 0 0 24px var(--gold); } }
#cmdconfirm { position: fixed; z-index: 51; width: 300px; max-width: calc(100vw - 8px); box-sizing: border-box; background: #0c0d14; border: 1px solid #6a72a0; border-radius: 8px; padding: 10px 12px; font-size: 13px; box-shadow: 0 6px 30px rgba(0,0,0,.7); }
#cmdconfirm .cc-body { overflow-y: auto; overscroll-behavior: contain; }
#cmdconfirm .cc-btns { display: flex; gap: 8px; margin-top: 10px; }
#cmdconfirm .cc-skip { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: #aab; cursor: pointer; }
#cmdconfirm .cc-skip[hidden] { display: none; }
#cmdconfirm .cc-skip input { width: 20px; height: 20px; margin: 0; }
#cmdconfirm .cc-ok { flex: 1; padding: 10px; font-size: 16px; font-weight: bold; }
#cmdconfirm .cc-ok:disabled { opacity: .5; }
#cmdconfirm .cc-x { padding: 10px 16px; font-size: 16px; }
#tooltip { position: fixed; z-index: 50; width: 280px; background: #0c0d14; border: 1px solid #454a68; border-radius: 6px; padding: 8px 10px; font-size: 12.5px; pointer-events: none; box-shadow: 0 6px 30px rgba(0,0,0,.6); }
.tcost { margin: 3px 0; } .treq { color: var(--red); margin-top: 4px; }
#dialogue { position: absolute; left: 50%; bottom: 240px; transform: translateX(-50%); width: min(720px, 90vw); display: flex; gap: 12px; background: rgba(8,9,14,.94); border: 1px solid #3a3f58; border-top: 3px solid var(--gold); border-radius: 8px; padding: 10px 14px; cursor: pointer; animation: noticeIn .2s; }
#dlg-portrait { width: 80px; height: 80px; border-radius: 6px; border: 1px solid #454a68; }
#dlg-name { font: 20px var(--display); letter-spacing: 1px; }
#dlg-text { font-size: 16px; line-height: 1.45; min-height: 46px; }
#dlg-hint { font-size: 11px; color: var(--muted); text-align: right; }
/* Multiplayer chat: a thin strip under the top bar; the log opens while people talk. */
#chatbar { position: absolute; top: 41px; left: 50%; transform: translateX(-50%); width: min(540px, calc(100vw - 32px)); display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; z-index: 6; }
#chatbar > * { pointer-events: auto; }
.cb-bar { display: flex; align-items: center; gap: 2px; height: 20px; padding: 0 4px; background: rgba(10,12,20,.6); border: 1px solid #2c3048; border-radius: 10px; opacity: .7; transition: opacity .2s; }
#chatbar.open .cb-bar, .cb-bar:hover { opacity: 1; }
.cb-bar button { height: 16px; padding: 0 6px; font-size: 10.5px; line-height: 16px; background: none; border: 0; border-radius: 8px; color: #dfe3f5; cursor: pointer; white-space: nowrap; }
.cb-bar button:hover { background: rgba(255,255,255,.1); } .cb-bar button.off { color: var(--muted); text-decoration: line-through; }
.cb-bar i { width: 1px; height: 12px; background: #3a3f58; margin: 0 2px; }
#chatlog { width: 100%; max-height: 0; overflow: hidden; padding: 0 8px; background: rgba(10,12,20,.6); border-radius: 6px; font-size: 12px; line-height: 16px; text-shadow: 0 1px 2px #000; transition: max-height .2s, padding .2s; box-sizing: border-box; }
#chatbar.open #chatlog:not(:empty) { max-height: 68px; padding: 2px 8px; }
#chatbar.typing #chatlog:not(:empty) { max-height: 136px; overflow-y: auto; }
#chatlog .cl.allies b { color: #7dff9a; }
#chatbox { width: 100%; } #chatbox input { width: 100%; box-sizing: border-box; padding: 3px 8px; font-size: 12px; } #chatbox input.allies { border-color: #7dff9a; }
#aimbar[hidden] ~ #chatbar:not([hidden]) ~ #notices { top: 70px; }
#aimbar:not([hidden]) ~ #chatbar { display: none; }

/* ---------------------------------------------------------------- overlays */
#overlay { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;  padding-top: env(safe-area-inset-top, 0px); box-sizing: border-box; }
#overlay.dim { background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
.panel { background: var(--panel); border: 1px solid #3a3f58; border-radius: 10px; padding: 20px 24px; box-shadow: 0 20px 80px rgba(0,0,0,.7); max-height: 92vh; overflow-y: auto; }
.panel h2 { font: 30px var(--display); letter-spacing: 1px; margin: 0 0 12px; }
.menu { width: 340px; display: grid; gap: 8px; }
.menu .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.menu p { margin: 0 0 6px; line-height: 1.45; }
.help { width: min(720px, 94vw); }
.tech-panel { width: min(1200px, 96vw); }
.tt-head { display: flex; justify-content: space-between; align-items: center; }
.endscreen { width: min(760px, 94vw); text-align: center; }
.endscreen h1 { font: 900 80px/1 var(--display); letter-spacing: 6px; margin: 0 0 10px; }
.endscreen.win h1 { color: var(--gold); text-shadow: 0 0 30px var(--gold); }
.endscreen.lose h1 { color: var(--red); text-shadow: 0 0 30px var(--red); }
.debrief { font-size: 16px; line-height: 1.5; text-align: left; background: rgba(255,255,255,.03); border-radius: 8px; padding: 6px 16px; }
.debrief h3 { font: 26px var(--display); color: var(--gold); margin: 8px 0; }
table.stats { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px; }
table.stats th { color: var(--muted); font-weight: normal; border-bottom: 1px solid var(--line); padding: 4px; }
table.stats td { padding: 4px; border-bottom: 1px solid #1d2030; }
.btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.choice { width: min(640px, 94vw); display: grid; gap: 10px; }
.choice-btn { display: grid; text-align: left; gap: 4px; padding: 14px 18px; font-size: 18px; }
.choice-btn small { font-size: 13px; color: #c7cbe0; }
.choice-btn.has-face { grid-template-columns: 64px 1fr; column-gap: 14px; align-items: center; }
.choice-btn.has-face img { grid-row: span 2; width: 64px; height: 64px; border-radius: 8px; object-fit: cover; }


/* multiplayer: public rooms */
.mp-cols { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 30px; align-items: start; }
.mp-cols > * { min-width: 0; }
.mp-cols .mp-box { margin-top: 0; }
.mp-cols .join-row input { min-width: 0; width: 100%; }
.mp-cols .join-row .big { padding: 12px 16px; }
.mp-rooms-head { display: flex; justify-content: space-between; align-items: center; }
.mp-rooms-head h2 { margin: 0; }
#room-list { display: grid; gap: 8px; margin-top: 10px; }
.room-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; }
.lobby-settings label.check { display: flex; align-items: center; gap: 6px; }
@media (max-width: 800px) { .mp-cols { grid-template-columns: 1fr; } }
/* Main-screen hub: daily leaderboard, lobby chat, game browser */
.hub { width: min(1100px, 100%); display: grid; gap: 14px; }
.hub-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 14px; }
.hub-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hub-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hub-head h2 { margin: 0; font: 20px var(--display); letter-spacing: 1px; }
.hub-head small { color: var(--muted); }
.hub-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); }
.hub-name input { width: 200px; max-width: 100%; }
.board { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.board li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.board li .rk { grid-row: span 2; font: 20px var(--display); color: var(--muted); text-align: center; }
.board li:nth-child(1) .rk { color: var(--gold); } .board li:nth-child(2) .rk { color: #d6dae8; } .board li:nth-child(3) .rk { color: #e0955a; }
.board li .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: bold; }
.board li b { color: var(--green); font-size: 13px; }
.board li small { grid-column: 2 / 4; color: var(--muted); font-size: 11px; }
.board li.me { border-color: var(--blue); box-shadow: 0 0 10px rgba(47, 125, 255, .3); }
.hub-chatlog { height: 220px; overflow-y: auto; font-size: 13px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; user-select: text; overflow-wrap: anywhere; }
.hub-send { display: flex; gap: 8px; } .hub-send input { flex: 1; min-width: 0; }
.hub-create, .hub-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.hub-create input { flex: 1; min-width: 180px; }
.hub-filters input { flex: 1 1 180px; min-width: 0; }
.hub-filters select { flex: 0 1 auto; min-width: 0; }
.hub-list { display: grid; gap: 8px; max-height: 320px; overflow-y: auto; align-content: start; }
.game-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; }
.game-card .gc-main { min-width: 0; flex: 1; }
.gc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gc-desc { margin: 2px 0; overflow-wrap: anywhere; }
.gc-tag { font-size: 11px; padding: 1px 8px; border-radius: 10px; border: 1px solid; }
.gc-tag.open { color: var(--green); border-color: var(--green); } .gc-tag.live { color: var(--gold); border-color: var(--gold); }
.lobby-settings label.wide { flex: 1 1 100%; display: grid; gap: 4px; } .lobby-settings label.wide input { width: 100%; }
@media (max-width: 800px) { .hub-row { grid-template-columns: 1fr; } .hub-chatlog { height: 160px; } }

/* ---------------------------------------------------------------- touch (phones, tablets) */
#tools { display: none; }
body.touch { -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
/* iOS won't let you type into a field that inherits user-select: none, and zooms the page into any field under 16px. */
input, textarea { -webkit-user-select: text; user-select: text; }
body.touch input, body.touch select { font-size: 16px; }
body.touch button, body.touch .cmd, body.touch select { touch-action: manipulation; }
#game, #minimap { touch-action: none; }
#aimbar { position: absolute; top: 46px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; padding: 6px 6px 6px 16px; background: rgba(8,9,14,.9); border: 1px solid var(--gold); border-radius: 8px; font: 16px var(--display); letter-spacing: .5px; white-space: nowrap; }
#aimbar button { padding: 8px 16px; font: 14px var(--ui); }
#aimbar:not([hidden]) ~ #notices { top: 100px; }
body.touch .cmd > kbd, body.touch #dlg-hint { display: none; }
body.touch #topbar .res { cursor: default; }
#rotate { display: none; }
@media (orientation: portrait) and (max-width: 600px) {
  body.touch #hud:not([hidden]) ~ #rotate { display: flex; position: fixed; inset: 0; z-index: 100; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--bg); text-align: center; padding: 24px; }
  #rotate div { font-size: 64px; } #rotate p { font: 22px var(--display); letter-spacing: 1px; }
}
/* notch / home indicator */
#topbar { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
#bottom { padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); box-sizing: content-box; }

/* Phones in landscape: shrink the HUD so the map stays playable. */
@media (max-height: 560px) {
  #topbar { height: 32px; gap: 4px; }
  #topbar .res { font-size: 12px; padding: 2px 8px; } #topbar .res b { font-size: 14px; }
  #topbar button { padding: 3px 8px; font-size: 12px; }
  #bottom { height: 132px; }
  #mm-wrap { width: 132px; height: 132px; padding: 4px; } #minimap { width: 124px; height: 124px; }
  /* The panel grows up to the command card's height when it has more to show (a building's queue,
     a big group), so nothing is pushed off the bottom of the screen; the queue wraps instead of
     running into the command card. */
  #selpanel { height: auto; min-height: 96px; max-height: 156px; box-sizing: border-box; padding: 6px; }
  .sp-one { height: auto; } .sp-q { flex-wrap: wrap; gap: 4px 4px; row-gap: 10px; margin: 4px 0 8px; } .sp-qlabel { flex-basis: 100%; margin: 0; }
  .sp-empty { padding-top: 18px; font-size: 12px; }
  .sp-one { gap: 8px; } .sp-port { width: 56px; height: 56px; } .sp-port.big { font-size: 32px; }
  .sp-name { font-size: 16px; } .sp-stats { font-size: 11px; gap: 8px; } .hpbar { height: 13px; margin: 2px 0; } .hpbar span { font-size: 9px; line-height: 13px; vertical-align: top; }
  .sp-desc { display: none; }
  .qitem { width: 30px; height: 30px; } .qitem img { width: 26px; height: 26px; } .qitem .qi { font-size: 16px; } .qitem .bar { width: 30px !important; }
  .mini { width: 32px; height: 38px; } .mini img { width: 28px; height: 28px; } .mini .bi { font-size: 18px; height: 28px; line-height: 28px; }
  #cmdcard { width: 220px; --card-h: 156px; --gap: 3px; --pad: 4px; }
  #hudctl { bottom: calc(156px + env(safe-area-inset-bottom)); } #hudctl button { width: 34px; height: 26px; }
  .cmd .ic { font-size: 22px; } .cmd img { width: 36px; height: 36px; } .cmd .cc { font-size: 8.5px; }
  /* Phones: wide and short. Quick actions in one row, Sound and Display side by side. */
  #tools:not([hidden]) { top: 36px; flex-direction: row; flex-wrap: wrap; gap: 6px 14px; width: min(470px, calc(100vw - 24px)); padding: 6px 10px; max-height: calc(100vh - 42px); }
  .tb-sec { flex: 1 1 200px; gap: 3px; } .tb-quick { flex-basis: 100%; }
  .tb-sec + .tb-sec { border-top: 0; padding-top: 0; }
  .tb-grid { grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: 3px; }
  .tb-h { font-size: 11px; } .tb-row { font-size: 12px; } .tb-row input[type=range] { width: 110px; height: 18px; }
  .tb-row input[type=checkbox] { width: 18px; height: 18px; }
  #tools button { padding: 5px 6px; font-size: 12px; } #b-tools span, #b-fs span { display: none; }
  #aimbar { top: 38px; font-size: 13px; } #aimbar button { padding: 6px 12px; }
  #aimbar:not([hidden]) ~ #notices { top: 84px; }
  #objectives, #hint { top: 40px; width: 230px; font-size: 11.5px; padding: 6px 8px; }
  #notices { top: 40px; } .notice { font-size: 13px; } .notice:nth-last-child(n+3) { display: none; }
  #dialogue { bottom: 140px; padding: 6px 10px; } #dlg-portrait { width: 48px; height: 48px; } #dlg-name { font-size: 15px; } #dlg-text { font-size: 13px; min-height: 0; }
  #chatbar { top: 34px; } #aimbar[hidden] ~ #chatbar:not([hidden]) ~ #notices { top: 58px; } .cb-bar button span { display: none; }
  #tooltip { width: 240px; font-size: 11.5px; }
  #cmdconfirm { width: 250px; font-size: 12px; padding: 8px 10px; }
  #cmdconfirm .cc-btns { margin-top: 6px; } #cmdconfirm .cc-ok, #cmdconfirm .cc-x { padding: 7px 12px; font-size: 14px; }
  .panel { padding: 12px 16px; } .panel h2 { font-size: 22px; }
  .endscreen h1 { font-size: 48px; }
}

/* Unit stat cards (tech tree + codex roster) */
.uc-title-main { font: 22px var(--display); color: var(--gold); margin: 18px 0 2px; letter-spacing: 1px; }
.uc-group { font: 16px var(--display); color: #c7cbe0; letter-spacing: 1px; margin: 14px 0 6px; border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.uc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.ucard2 { background: var(--panel2); border: 1px solid var(--line); border-top: 3px solid var(--pc); border-radius: 8px; padding: 8px 10px; font-size: 12px; display: flex; flex-direction: column; gap: 6px; scroll-margin: 80px; }
.ucard2.hero { border-color: var(--gold); border-top-color: var(--gold); }
.ucard2.flash { animation: ucflash 1.2s ease-out; }
@keyframes ucflash { 0% { box-shadow: 0 0 0 3px var(--gold); } 100% { box-shadow: 0 0 0 0 transparent; } }
.uc-head { display: flex; gap: 8px; align-items: center; }
.uc-head img { width: 56px; height: 56px; border-radius: 6px; flex: none; }
.uc-name { font-weight: bold; font-size: 14px; } .uc-title { color: var(--gold); font-size: 11px; }
.uc-meta { color: var(--muted); font-size: 11px; } .uc-cost { font-size: 11.5px; }
.uc-bars { display: grid; gap: 2px; }
.uc-bar { display: grid; grid-template-columns: 70px 1fr auto; gap: 6px; align-items: center; font-size: 11px; }
.uc-bar b { height: 6px; background: #12141e; border-radius: 3px; overflow: hidden; }
.uc-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pc), #ffd34a); }
.uc-bar em { font-style: normal; color: #c7cbe0; white-space: nowrap; }
.uc-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.uc-flags span { background: #222538; border-radius: 10px; padding: 1px 7px; font-size: 10.5px; }
.uc-abs { display: grid; gap: 4px; }
.uc-abs > div { display: flex; gap: 6px; align-items: flex-start; }
.uc-ai { font-size: 16px; width: 20px; text-align: center; }
.uc-abs kbd { font-size: 9.5px; }
.uc-desc { color: #c7cbe0; font-size: 11.5px; }
.uc-up { color: #6aff8a; font-size: 10.5px; }
.tt-chip[data-card], .tt-hero[data-card] { cursor: pointer; }
.cc .fuel, .tcost .fuel { color: #ffb347; }
@media (max-width: 600px) { .uc-grid { grid-template-columns: 1fr; } }
