:root {
  --s: 1;
  --font: Impact, "Arial Black", "Trebuchet MS", sans-serif;
  --ink: #14160c;
  --text: #efe6c8;
  --olive: #4b5530;
  --khaki: #b9a86c;
  --brass: #e2c878;
  --amber: #e2c878;
  --red: #e0705a;
  --pb: calc(12px * var(--s) + 8px);           /* drawn thickness of a panel frame */
  --side-w: max(220px, calc(292px * var(--s)));
  --ol: -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink), 0 3px 0 var(--ink);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0f08; user-select: none; -webkit-user-select: none; touch-action: none; }
#app { position: fixed; inset: 0; overflow: hidden; font-family: var(--font); color: var(--text); letter-spacing: 0.02em; container: app / size; }
/* request 49: upright phone pages hold the landscape game in a 704×396 box scaled to the width (see resize in main.js);
   the phone rules are container queries on #app, so the box gets exactly the sideways-phone layout */
html.boxed, html.boxed body { background: #050604; }
html.boxed #app { inset: auto; left: 0; width: 704px; height: 396px; transform-origin: 0 0; box-shadow: 0 0 0 1px #2b302c, 0 10px 40px #000; }
#gl, #overlay { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#overlay { pointer-events: none; }
.hidden { display: none !important; }

/* ---------- shared UI art: riveted olive steel, see-through so it sits on the scene ---------- */
.panel { position: relative; isolation: isolate; border: var(--pb) solid transparent; background: none; }
.panel::before {
  content: ""; position: absolute; inset: calc(-1 * var(--pb)); z-index: -1; pointer-events: none;
  border-style: solid; border-width: var(--pb);
  border-image: url(assets/ui-panel.webp) 96 fill / var(--pb) / calc(var(--pb) * 0.23) stretch;
  opacity: 0.84;
}
.panel::after {
  content: ""; position: absolute; inset: calc(-1 * var(--pb) - 26px); z-index: -2; pointer-events: none;
  background: radial-gradient(closest-side, rgba(10, 12, 5, 0.55), rgba(10, 12, 5, 0.25) 70%, transparent);
}
.btn {
  all: unset; box-sizing: border-box; cursor: pointer; text-align: center; position: relative;
  font-family: var(--font); font-weight: 900; color: var(--text); text-transform: uppercase; letter-spacing: 0.05em;
  font-size: max(14px, calc(18px * var(--s)));
  padding: calc(4px * var(--s) + 2px) calc(16px * var(--s) + 4px);
  min-height: 44px; min-width: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-style: solid; border-width: 7px 9px;
  border-image: url(assets/ui-button.webp) 76 42 84 42 fill / 21px 11px 31px 11px / 14px 2px 24px 2px stretch;
  text-shadow: var(--ol);
  transition: transform 0.12s cubic-bezier(.3,1.6,.5,1), filter 0.12s;
  white-space: nowrap;
}
.btn:hover, .btn.focus { filter: brightness(1.22) drop-shadow(0 0 7px rgba(226, 200, 120, 0.85)); transform: scale(1.05); }
.btn:active, .btn.pressed { transform: scale(0.93); }
.btn.sel { filter: brightness(1.25) sepia(0.5) saturate(1.8) drop-shadow(0 0 6px rgba(226, 200, 120, 0.9)); color: #fff3c8; }
.btn.dis { filter: grayscale(1) brightness(0.6); }
.btn.warn { color: #ffb4a0; }
.btn.big { font-size: max(16px, calc(23px * var(--s))); padding: calc(8px * var(--s) + 2px) calc(30px * var(--s) + 6px); color: #fff0c0; }
.btn.small { font-size: max(12px, calc(14px * var(--s))); padding: 2px 6px; }
.outline { text-shadow: var(--ol); }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
/* minimap: top-left corner (the build sidebar owns the right edge, the clock the top centre) */
#hud { --mm: calc(150px * var(--s) + 2 * var(--pb)); }
#mmwrap { position: absolute; left: max(10px, env(safe-area-inset-left)); top: 10px; width: var(--mm); height: var(--mm); padding: 0; }
#minimap { width: 100%; height: 100%; display: block; border-radius: 3px; cursor: crosshair; }
/* operation clock: alone at the top centre */
#clockbar { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: calc(8px * var(--s) + 2px); padding: 0 calc(10px * var(--s) + 4px); height: calc(30px * var(--s) + 2 * var(--pb) - 6px); pointer-events: none; white-space: nowrap; }
#clockbar .cl-label { font-size: max(12px, calc(13px * var(--s))); color: var(--khaki); letter-spacing: 1px; text-shadow: var(--ol); font-weight: 900; }
#clockbar #clock { font-size: max(18px, calc(26px * var(--s))); font-weight: 900; color: #fff1c4; text-shadow: var(--ol), 0 0 10px rgba(226, 200, 120, 0.5); font-variant-numeric: tabular-nums; letter-spacing: 1px; }
#clockbar .cl-star { color: var(--brass); font-size: max(11px, calc(14px * var(--s))); text-shadow: 0 1px 0 #000; }
/* funds + power plates at the top of the build sidebar */
#resbox { display: flex; flex-direction: column; gap: 3px; }
#creditpanel { position: relative; display: flex; align-items: center; gap: 6px; height: max(30px, calc(40px * var(--s))); padding: 0 8px; border-radius: 4px;
  background: linear-gradient(#e9cf82, #b48a36 48%, #8a6420 52%, #c49a48); box-shadow: inset 0 0 0 2px #3a2a0c, inset 0 2px 0 3px rgba(255, 244, 200, 0.5), 0 2px 0 #0a0b05; }
#creditpanel::before, #creditpanel::after { content: ""; position: absolute; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6d0, #6a4c12); box-shadow: 0 0 0 1px #2a1d06; }
#creditpanel::before { left: 4px; } #creditpanel::after { right: 4px; }
#creditpanel .ico { margin-left: 6px; }
#creditpanel .rl { font-size: max(11px, calc(12px * var(--s))); font-weight: 900; color: #3a2a0c; text-shadow: 0 1px 0 rgba(255, 240, 190, 0.6); }
#credits { margin-left: auto; margin-right: 8px; padding: 0 6px; min-width: 4.4em; text-align: right; font-size: max(16px, calc(25px * var(--s))); font-weight: 900; color: #ffe9a8; background: linear-gradient(#1a1c10, #2a2d1a); border-radius: 3px; box-shadow: inset 0 2px 3px #000, 0 0 0 1px #5a4414; font-variant-numeric: tabular-nums; text-shadow: 0 0 6px rgba(255, 210, 110, 0.6); transition: color 0.2s; }
#credits.up { color: #c8ff9a; text-shadow: 0 0 10px #9cff6a; }
#credits.down { color: #ffb08a; text-shadow: 0 0 10px #ff8a5a; }
#powerpanel { display: flex; align-items: center; gap: 6px; height: max(24px, calc(32px * var(--s))); padding: 0 6px; border-radius: 4px; background: linear-gradient(#2c3220, #1a1e10); box-shadow: inset 0 0 0 2px #0c0e06, inset 0 0 0 3px rgba(185, 168, 108, 0.45); }
#powercells { flex: 1; display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; height: 62%; }
#powercells i { display: block; border-radius: 1px; background: #11140a; box-shadow: inset 0 0 0 1px #2f3520; }
#powercells i.free { background: linear-gradient(#bff08a, #5f9a32); box-shadow: 0 0 4px rgba(150, 240, 100, 0.55); }
#powercells i.use { background: linear-gradient(#ffe08a, #c08a26); }
#powercells i.over { background: linear-gradient(#ff9a80, #b33a24); }
#powerpanel.low { box-shadow: inset 0 0 0 2px #2a0804, inset 0 0 0 3px rgba(255, 110, 90, 0.8); animation: lowFlash 0.6s infinite alternate; }
#powerpanel.low #powercells i.use, #powerpanel.low #powercells i.over { background: linear-gradient(#ff8a70, #a8301c); animation: lowFlash 0.6s infinite alternate; }
#powertxt { min-width: 2.6em; text-align: right; font-size: max(13px, calc(15px * var(--s))); font-weight: 900; text-shadow: var(--ol); font-variant-numeric: tabular-nums; }
#powerpanel.low #powertxt { color: #ff8a70; }
@keyframes lowFlash { from { filter: brightness(0.75); } to { filter: brightness(1.35); } }
.ico { display: inline-block; width: max(18px, calc(24px * var(--s))); height: max(18px, calc(24px * var(--s))); border-radius: 50%; }
.ico.credits { width: max(24px, calc(32px * var(--s))); height: max(24px, calc(32px * var(--s))); border-radius: 0; background: url("assets/ui-coin.webp") center / contain no-repeat, radial-gradient(circle at 35% 30%, #fff0b8, #d9b24a 55%, transparent 58%); filter: drop-shadow(0 2px 1px rgba(0,0,0,0.6)); position: relative; flex: none; }
.ico.credits::after { content: ""; position: absolute; inset: -20%; background: radial-gradient(circle, rgba(255, 246, 190, 0.95), rgba(255, 220, 110, 0) 60%); opacity: 0; pointer-events: none; }
.ico.credits.gain { animation: coinPop 0.45s cubic-bezier(.3,1.6,.5,1); }
.ico.credits.gain::after { animation: coinFlash 0.45s ease-out; }
@keyframes coinPop { 0% { transform: scale(1); } 40% { transform: scale(1.22) rotate(-8deg); } 100% { transform: scale(1); } }
@keyframes coinFlash { 0% { opacity: 0.95; transform: scale(0.6); } 100% { opacity: 0; transform: scale(1.4); } }
.ico.bolt { background: linear-gradient(#f6eaa0, #d0a83a); box-shadow: 0 0 0 2px var(--ink); clip-path: polygon(55% 0, 15% 55%, 45% 55%, 35% 100%, 85% 40%, 55% 40%, 70% 0); border-radius: 0; }
#sidebar { position: absolute; right: max(10px, env(safe-area-inset-right)); top: 10px; bottom: 10px; width: var(--side-w); display: flex; flex-direction: column; gap: calc(6px * var(--s) + 1px); padding: 0; }
#tabs { display: flex; gap: 4px; }
#tabs .btn { flex: 1; min-width: 0; padding: 0 2px; font-size: max(14px, calc(18px * var(--s))); min-height: max(44px, calc(48px * var(--s))); }
#tabs .btn.fresh { animation: tabFresh 0.45s 7 alternate; }
@keyframes tabFresh { from { filter: brightness(1); } to { filter: brightness(1.5) drop-shadow(0 0 8px #ffd84a); color: #fff3b0; } }
/* pause: a riveted steel plate with a brass ❚❚, part of the sidebar's top row */
#tabs #btnPause { flex: none; width: max(44px, calc(52px * var(--s))); padding: 0; }
#btnPause .pz { display: block; width: 16px; height: 18px; background: linear-gradient(90deg, var(--brass) 0 36%, transparent 36% 64%, var(--brass) 64%); filter: drop-shadow(0 2px 0 var(--ink)) drop-shadow(0 0 1px var(--ink)); }
#cards { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: min-content; gap: calc(4px * var(--s) + 1px); overflow-y: auto; overflow-x: hidden; align-content: start; scrollbar-width: none; }
#cards::-webkit-scrollbar { display: none; }
.card { position: relative; aspect-ratio: 1 / 1.08; min-height: 48px; overflow: hidden; cursor: pointer; border-radius: 3px;
  background: radial-gradient(circle at 50% 38%, #5d6a3c, #2a3018 75%);
  box-shadow: inset 0 0 0 2px #0f1108, inset 0 0 0 3px rgba(226, 200, 120, 0.35);
  transition: transform 0.12s cubic-bezier(.3,1.6,.5,1), filter 0.15s; }
.card::after { content: ""; position: absolute; left: 3px; top: 3px; width: 4px; height: 4px; border-radius: 50%; background: #c9b67a; box-shadow: calc(100% + 0px) 0 0 transparent; opacity: 0.7; }
.card.sig { background: radial-gradient(circle at 50% 38%, #7a6a34, #33290f 75%); box-shadow: inset 0 0 0 2px #0f1108, inset 0 0 0 3px rgba(255, 214, 120, 0.8); }
.card.sig .name::before { content: "★"; color: var(--brass); margin-right: 1px; }
.card.air { background: radial-gradient(circle at 50% 38%, #4e6a74, #1d2a30 75%); }
.card img { position: absolute; inset: 18% 6% 15% 6%; width: 88%; height: 67%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 3px 2px rgba(0,0,0,0.5)); }
.card.fresh { animation: cardFresh 0.4s 8 alternate; }
.card.fresh::before { content: "NEW"; position: absolute; right: 2px; top: 34%; z-index: 2; padding: 0 4px; font-size: 11px; font-weight: 900; color: #1a1406; background: linear-gradient(#ffe48a, #d6a63a); border-radius: 2px; box-shadow: 0 0 0 1px #2a1d06; }
@keyframes cardFresh { from { box-shadow: inset 0 0 0 2px #0f1108, inset 0 0 0 3px rgba(255, 216, 74, 0.5); } to { box-shadow: inset 0 0 0 2px #0f1108, inset 0 0 0 4px #ffd84a, 0 0 12px rgba(255, 216, 74, 0.8); } }
.card .cost { position: absolute; left: 5px; bottom: 2px; font-size: max(15px, calc(20px * var(--s))); font-weight: 900; color: #ffe7a0; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; }
.card .hk { display: none; } /* number keys still pick cards; the numbers are no longer drawn */
.card .name { position: absolute; left: 5px; top: 4px; right: 5px; font-size: max(14px, calc(18px * var(--s))); font-weight: 900; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; line-height: 1.08; overflow: hidden; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; letter-spacing: 0; }
.card .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; background: rgba(8, 10, 4, 0.62); transform-origin: top; pointer-events: none; }
.card .cnt { position: absolute; right: 3px; top: 30%; font-size: max(14px, calc(18px * var(--s))); font-weight: 900; color: #fff; text-shadow: var(--ol); }
.card .ready { position: absolute; inset: auto 0 34% 0; text-align: center; font-size: max(11px, calc(13px * var(--s))); font-weight: 900; color: #c8f08a; text-shadow: var(--ol); animation: pulse 0.8s infinite alternate; }
.card.locked { filter: grayscale(1) brightness(0.45); }
.card.poor .cost { color: #ff8a70; }
.card:hover, .card.focus { transform: scale(1.05); filter: brightness(1.2); z-index: 1; }
.card:active { transform: scale(0.94); }
#sideactions { display: flex; gap: 4px; }
#sideactions .btn { flex: 1 1 0; padding: 0 1px; min-width: 44px; min-height: max(44px, calc(48px * var(--s))); border-width: 12px 8px; font-size: max(12px, calc(15px * var(--s))); letter-spacing: 0; }
.skpanel { display: flex; flex-direction: column; align-items: center; gap: calc(10px * var(--s)); padding: calc(6px * var(--s)) calc(16px * var(--s)); }

#selinfo { position: absolute; left: max(10px, env(safe-area-inset-left)); bottom: 10px; max-width: calc(100% - var(--side-w) - 44px); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 0 4px; }
.selitem { display: flex; align-items: center; gap: 4px; font-weight: 900; font-size: max(14px, calc(16px * var(--s))); }
.selitem img { width: calc(40px * var(--s) + 6px); height: calc(40px * var(--s) + 6px); object-fit: contain; }
.selitem .desc { font-size: max(12px, calc(13px * var(--s))); color: var(--khaki); font-weight: 700; max-width: 16em; text-shadow: 0 1px 0 #000; }
.selitem .hpb { width: 44px; height: 6px; background: #1a1d10; overflow: hidden; box-shadow: 0 0 0 1px #000; margin-top: 2px; }
.selitem .hpb i { display: block; height: 100%; background: #a6d070; }

#toasts { position: absolute; top: calc(64px * var(--s) + 20px); left: calc((100% - var(--side-w)) / 2); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none !important; }
.toast { font-weight: 900; font-size: max(15px, calc(19px * var(--s))); padding: 4px 18px; background: linear-gradient(90deg, transparent, rgba(16, 19, 8, 0.82) 15%, rgba(16, 19, 8, 0.82) 85%, transparent); text-shadow: 0 2px 0 #000; animation: toastIn 0.25s cubic-bezier(.3,1.6,.5,1); white-space: nowrap; border-top: 1px solid rgba(226,200,120,0.35); border-bottom: 1px solid rgba(226,200,120,0.35); }
.toast.warn { color: #ffa48c; }
.toast.good { color: #cdf09a; }
#placehint { position: absolute; bottom: 12px; left: calc((100% - var(--side-w)) / 2); transform: translateX(-50%); font-weight: 900; font-size: max(14px, calc(17px * var(--s))); padding: 6px 22px; background: linear-gradient(90deg, transparent, rgba(16, 19, 8, 0.85) 12%, rgba(16, 19, 8, 0.85) 88%, transparent); pointer-events: none !important; text-align: center; max-width: 56%; }
#subtitle { position: absolute; bottom: calc(64px * var(--s) + 20px); left: calc((100% - var(--side-w)) / 2); transform: translateX(-50%); max-width: 60%; text-align: center; font-weight: 900; font-size: max(15px, calc(20px * var(--s))); padding: 6px 24px; background: linear-gradient(90deg, transparent, rgba(12, 14, 6, 0.85) 12%, rgba(12, 14, 6, 0.85) 88%, transparent); pointer-events: none; z-index: 30; }
#subtitle b { color: var(--nation, #e2c878); margin-right: 8px; }

/* ---------- screens: menus float over the key art like a briefing on a war-room map ---------- */
.screen { position: absolute; inset: 0; z-index: 20; }
.screen .bg { position: absolute; inset: 0; background: #15170e url(assets/title-bg.webp) center / cover no-repeat; transition: background-image 0.4s; }
.screen .bg.dim::after { content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(226,200,120,0.05) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(226,200,120,0.05) 0 1px, transparent 1px 48px),
    radial-gradient(ellipse at center, rgba(16,19,8,0.45), rgba(8,10,4,0.9)); }
.screen .bg.ending::after { background: linear-gradient(180deg, rgba(8,10,4,0.55), transparent 25%, transparent 50%, rgba(8,10,4,0.85)); }
#screen-title .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(8,10,4,0.75)); }
/* request 52: the new start screen — key art with a slow push-in, drifting smoke, rising embers, a flickering warm lamp and a shine across the logo (all CSS transforms/opacity: light on phones) */
#screen-title { overflow: hidden; background: #0c0d08; }
#screen-title .bg { background-image: url(assets/title-bg2.webp), url(assets/title-bg.webp); background-position: center 60%, center; animation: tbgZoom 26s ease-in-out infinite alternate; will-change: transform; }
.tfx { position: absolute; pointer-events: none; }
.tsmoke { inset: -10% -40%; opacity: 0.55; will-change: transform;
  background: radial-gradient(ellipse 30% 18% at 20% 70%, rgba(150,145,130,0.35), transparent 70%),
              radial-gradient(ellipse 26% 14% at 55% 80%, rgba(120,115,100,0.32), transparent 70%),
              radial-gradient(ellipse 34% 16% at 85% 64%, rgba(140,130,115,0.3), transparent 70%); }
.tsmoke.s1 { animation: tsmoke 38s linear infinite alternate; }
.tsmoke.s2 { opacity: 0.38; animation: tsmoke 52s linear -20s infinite alternate-reverse; top: -22%; }
.tdust { left: 0; top: 0; width: calc(100% + 240px); height: calc(100% + 200px); opacity: 0.8; will-change: transform; animation: tdust 16s linear infinite;
  background-image: radial-gradient(circle at 30px 40px, rgba(255,196,120,0.9) 0 1.4px, transparent 2.2px),
                    radial-gradient(circle at 150px 120px, rgba(255,220,160,0.7) 0 1px, transparent 1.8px),
                    radial-gradient(circle at 200px 30px, rgba(230,210,180,0.55) 0 1.2px, transparent 2px),
                    radial-gradient(circle at 90px 170px, rgba(255,170,90,0.8) 0 1px, transparent 1.8px);
  background-size: 240px 200px; }
.tlamp { inset: 0; mix-blend-mode: screen; background: radial-gradient(ellipse 45% 55% at 82% 62%, rgba(255,160,70,0.28), transparent 70%), radial-gradient(ellipse 60% 40% at 50% 100%, rgba(255,130,50,0.16), transparent 70%); animation: tlamp 5s steps(1) infinite; }
#title-logo-wrap { position: absolute; left: 0; right: 0; margin: 0 auto; top: 3%; width: min(68%, 960px); animation: logoIn 0.7s cubic-bezier(.3,1.5,.5,1) both, floaty 4s 0.7s ease-in-out infinite; }
#title-logo { display: block; width: 100%; max-height: 46cqh; object-fit: contain; filter: drop-shadow(0 6px 0 rgba(0,0,0,0.55)) drop-shadow(0 0 22px rgba(0,0,0,0.6)); }
#title-shine { position: absolute; inset: 0; pointer-events: none; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; mix-blend-mode: screen;
  background: linear-gradient(105deg, transparent 42%, rgba(255,244,200,0.75) 50%, transparent 58%) no-repeat; background-size: 300% 100%; animation: tshine 4.5s 1s ease-in-out infinite; }
@keyframes tbgZoom { from { transform: scale(1); } to { transform: scale(1.07) translateY(-1%); } }
@keyframes tsmoke { from { transform: translateX(-12%); } to { transform: translateX(12%); } }
@keyframes tdust { from { transform: translate(0, 0); } to { transform: translate(-240px, -200px); } }
@keyframes tlamp { 0% { opacity: 1; } 37% { opacity: 0.82; } 39% { opacity: 1; } 61% { opacity: 0.9; } 63% { opacity: 0.7; } 65% { opacity: 1; } 88% { opacity: 0.86; } }
@keyframes tshine { 0% { background-position: 120% 0; } 45%, 100% { background-position: -20% 0; } }
/* request 53: the key art lives in a box shaped like the picture (cover-fitted, 60% down like before), so the
   flags and the lamp sit on their painted spots at every screen shape and move with the slow push-in */
#screen-title .bg.tscene { inset: auto; left: 50%; top: 60%; width: max(100cqw, 150cqh); height: auto; aspect-ratio: 3 / 2;
  background: #0c0d08 url(assets/title-bg2.webp) center / 100% 100% no-repeat; transform: translate(-50%, -60%); animation: tsceneZoom 26s ease-in-out infinite alternate; }
@keyframes tsceneZoom { from { transform: translate(-50%, -60%) scale(1); } to { transform: translate(-50%, -61%) scale(1.07); } }
.tflag { position: absolute; height: auto; transform-origin: 0% 30%; pointer-events: none; will-change: transform; filter: brightness(0.92) saturate(0.9); }
.tflag.f1 { left: 28.15%; top: 48.4%; width: 6.4%; animation: flagA 3.1s ease-in-out infinite; }
.tflag.f2 { left: 36.45%; top: 49.9%; width: 6.4%; animation: flagB 2.6s ease-in-out -0.9s infinite; }
.tflag.f3 { left: 53.2%; top: 51.4%; width: 6.0%; animation: flagA 3.6s ease-in-out -1.7s infinite; }
.tflag.f4 { left: 61.3%; top: 52.6%; width: 6.2%; animation: flagB 2.9s ease-in-out -0.4s infinite; }
@keyframes flagA { 0%,100% { transform: skewY(0deg) scaleX(1) rotate(0deg); } 25% { transform: skewY(-4deg) scaleX(0.95) rotate(1.5deg); } 55% { transform: skewY(3deg) scaleX(1.02) rotate(-1deg); } 80% { transform: skewY(-2deg) scaleX(0.97) rotate(0.8deg); } }
@keyframes flagB { 0%,100% { transform: skewY(1deg) scaleX(0.98) rotate(-0.5deg); } 35% { transform: skewY(-3deg) scaleX(1.02) rotate(1.2deg); } 65% { transform: skewY(4deg) scaleX(0.94) rotate(-1.5deg); } }
.tlampfx { position: absolute; left: 81%; top: 52.4%; width: 20%; height: 30%; pointer-events: none; }
.tlampfx i { position: absolute; display: block; }
.lglow { inset: -20%; mix-blend-mode: screen; background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(255,170,80,0.42), rgba(255,120,40,0.14) 40%, transparent 70%); animation: lampGlow 2.3s steps(1) infinite, lampBreath 3.7s ease-in-out infinite; }
.lflame { left: 50%; top: 50%; width: 4.6%; height: 8%; margin: -6% 0 0 -2.3%; border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%; transform-origin: 50% 90%;
  background: radial-gradient(ellipse 50% 60% at 50% 65%, #fffbe0, #ffd27a 35%, rgba(255,140,40,0.7) 65%, transparent 72%); mix-blend-mode: screen; animation: flame 0.9s ease-in-out infinite alternate, lampGlow 1.7s steps(1) infinite; }
@keyframes lampGlow { 0% { opacity: 1; } 18% { opacity: 0.78; } 21% { opacity: 0.95; } 47% { opacity: 0.85; } 50% { opacity: 1; } 73% { opacity: 0.7; } 76% { opacity: 0.92; } }
@keyframes lampBreath { 0%,100% { transform: scale(1); } 40% { transform: scale(1.08); } 70% { transform: scale(0.95); } }
@keyframes flame { 0% { transform: scale(1, 1) skewX(0deg); } 30% { transform: scale(0.9, 1.12) skewX(4deg); } 60% { transform: scale(1.06, 0.92) skewX(-3deg); } 100% { transform: scale(0.95, 1.06) skewX(2deg); } }
/* request 53: the iron doors between the title and the command room */
#irondoor { position: absolute; inset: 0; z-index: 70; display: none; pointer-events: none; }
#irondoor.closing, #irondoor.opening { display: block; pointer-events: auto; }
/* request 54: painted weathered steel (chipped olive paint, rust, rivets, welds, brass seam strip) — one picture per door, no live effects */
#irondoor .door { position: absolute; top: 0; bottom: 0; width: 50.5%; will-change: transform; background-color: #353b23;
  background-repeat: no-repeat; background-size: cover; }
#irondoor .door.l { left: 0; transform: translateX(-102%); background-image: url("assets/irondoor-l.webp"), linear-gradient(180deg, #535a36, #353b23 55%, #262a19);
  background-position: right center, 0 0; box-shadow: inset -10px 0 14px -6px rgba(0,0,0,0.75), inset 0 0 50px rgba(0,0,0,0.45); }
#irondoor .door.r { right: 0; transform: translateX(102%); background-image: url("assets/irondoor-r.webp"), linear-gradient(180deg, #535a36, #353b23 55%, #262a19);
  background-position: left center, 0 0; box-shadow: inset 10px 0 14px -6px rgba(0,0,0,0.75), inset 0 0 50px rgba(0,0,0,0.45); }
#irondoor.closing .door.l { animation: doorInL 0.26s cubic-bezier(.6,0,.95,.5) forwards; }
#irondoor.closing .door.r { animation: doorInR 0.26s cubic-bezier(.6,0,.95,.5) forwards; }
#irondoor.closing { animation: doorJolt 0.12s 0.25s linear; }
#irondoor.opening .door { transform: none; }
#irondoor.opening { animation: doorFade 0.3s ease-out forwards; }
@keyframes doorInL { from { transform: translateX(-102%); } to { transform: translateX(0); } }
@keyframes doorInR { from { transform: translateX(102%); } to { transform: translateX(0); } }
@keyframes doorJolt { 0% { transform: translate(0, 0); } 25% { transform: translate(-4px, 3px); } 50% { transform: translate(3px, -2px); } 75% { transform: translate(-2px, 1px); } 100% { transform: none; } }
@keyframes doorFade { from { opacity: 1; } to { opacity: 0; } }
#title-prompt { position: absolute; left: 50%; bottom: 9%; transform: translateX(-50%); text-align: center; font-weight: 900; font-size: max(18px, calc(28px * var(--s))); text-transform: uppercase; letter-spacing: 0.12em; color: #fff0c0; white-space: nowrap;
  padding: 8px 48px; background: linear-gradient(90deg, transparent, rgba(16,19,8,0.8) 18%, rgba(16,19,8,0.8) 82%, transparent);
  border-top: 2px solid rgba(226,200,120,0.5); border-bottom: 2px solid rgba(226,200,120,0.5);
  animation: pulse 1.1s ease-in-out infinite alternate; text-shadow: var(--ol); }
#title-prompt::before, #title-prompt::after { content: "★"; color: var(--brass); margin: 0 14px; }

#menu-body { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(58px * var(--s) + 10px) max(18px, env(safe-area-inset-right)) calc(14px * var(--s)) max(18px, env(safe-area-inset-left)); gap: calc(12px * var(--s) + 2px); }
.backbtn { position: absolute !important; top: max(10px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); z-index: 5; font-size: max(14px, calc(17px * var(--s))) !important; }
.mtitle { font-size: max(20px, calc(34px * var(--s))); font-weight: 900; color: var(--brass); text-transform: uppercase; letter-spacing: 0.08em; text-align: center;
  text-shadow: -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink), 3px 3px 0 var(--ink), 0 5px 0 var(--ink);
  animation: popIn 0.3s cubic-bezier(.3,1.6,.5,1) both; display: flex; align-items: center; gap: 0.5em; max-width: 92%; }
.mtitle::before, .mtitle::after { content: ""; flex: none; width: calc(60px * var(--s)); height: 8px; background: repeating-linear-gradient(-45deg, var(--brass) 0 6px, transparent 6px 12px); opacity: 0.8; }
.mtitle.win { color: #ffe08a; } .mtitle.lose { color: #ff9a84; }
.m-result .mtitle, .m-ending .mtitle { font-size: max(28px, calc(52px * var(--s))); }
.msub { font-weight: 700; opacity: 0.85; text-shadow: 0 2px 0 #000; }
.row { display: flex; gap: calc(14px * var(--s)); align-items: stretch; justify-content: center; flex-wrap: nowrap; }
.mcard { all: unset; box-sizing: border-box; cursor: pointer; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; text-align: center; animation: popIn 0.3s cubic-bezier(.3,1.6,.5,1) both; transition: transform 0.12s cubic-bezier(.3,1.6,.5,1), filter 0.15s; }
.mcard.panel { border: var(--pb) solid transparent; padding: 2px 4px; }
.mcard:hover, .mcard.focus { transform: translateY(-4px) scale(1.04); filter: brightness(1.15) drop-shadow(0 0 10px rgba(226,200,120,0.7)); }
.mcard:active { transform: scale(0.95); }
.mcard.sel { filter: brightness(1.18) drop-shadow(0 0 12px var(--nc, #e2c878)); }
.mcard.sel::after { content: "★"; position: absolute; top: -6px; right: -4px; font-size: 24px; color: var(--nc, #e2c878); text-shadow: 0 2px 0 #000; background: none; inset: auto -4px auto auto; z-index: 2; }
.mcard.lock { filter: grayscale(1) brightness(0.5); }
.mcard h3 { margin: 0; font-size: max(15px, calc(21px * var(--s))); font-weight: 900; text-shadow: var(--ol); }
.mcard p { margin: 0; font-weight: 700; font-size: max(12px, calc(14px * var(--s))); line-height: 1.3; opacity: 0.92; text-shadow: 0 1px 0 #000; }
.mcard img.portrait { width: 100%; max-height: calc(160px * var(--s) + 16px); object-fit: contain; filter: drop-shadow(0 6px 4px rgba(0,0,0,0.5)); }
.modes .mcard { width: min(28vw, 320px); }
.nations .mcard { width: min(22vw, 250px); }
.nations .mcard img.emblem { position: absolute; left: -4px; top: -4px; width: calc(46px * var(--s) + 6px); z-index: 2; filter: drop-shadow(0 2px 2px #000); }
.nations .mcard p.sig { color: var(--brass); font-size: max(12px, calc(13px * var(--s))); }
.nations .mcard p.prog { color: #cdf09a; }
.mgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: calc(10px * var(--s)); width: min(96%, 1100px); }
.mcard.mission { align-items: flex-start; text-align: left; min-height: calc(92px * var(--s) + 20px); }
.mcard.mission .mno { font-size: max(12px, calc(13px * var(--s))); color: var(--nc, var(--brass)); text-shadow: var(--ol); letter-spacing: 0.08em; }
.mcard.mission h3 { font-size: max(14px, calc(18px * var(--s))); }
.mcard.mission.final { filter: drop-shadow(0 0 8px rgba(255, 120, 90, 0.55)); }
.mcard.mission.final .mno { color: #ff9a84; }
.stars { color: #ffd76a; font-size: max(14px, calc(16px * var(--s))); text-shadow: var(--ol); }
.stars span { color: var(--text); font-size: max(12px, calc(13px * var(--s))); }
.stars.big { font-size: max(20px, calc(30px * var(--s))); }
.stars .lbl { font-size: max(14px, calc(17px * var(--s))); color: var(--khaki); }
.navrow { display: flex; gap: calc(14px * var(--s) + 4px); justify-content: center; flex-wrap: wrap; }
.goldchip { all: unset; cursor: pointer; position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 5; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 6px; font-weight: 900; font-size: max(15px, calc(19px * var(--s))); text-shadow: var(--ol);
  background: linear-gradient(90deg, rgba(16,19,8,0.85), rgba(40,46,22,0.85)); border: 2px solid rgba(226,200,120,0.6); border-radius: 4px; transition: transform 0.12s; }
.goldchip img { width: 34px; height: 34px; object-fit: contain; }
.goldchip b { color: var(--brass); font-size: 1.2em; margin-left: 4px; }
.goldchip:hover, .goldchip.focus { transform: scale(1.06); filter: brightness(1.2); }
.optlabel { font-weight: 900; font-size: max(14px, calc(18px * var(--s))); margin-right: 6px; min-width: 6em; text-align: right; align-self: center; text-shadow: var(--ol); }
.enemies { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-weight: 900; font-size: max(14px, calc(17px * var(--s))); margin-top: 6px; text-shadow: var(--ol); }
.enemies .en { display: inline-flex; align-items: center; gap: 4px; }
.enemies img { width: calc(30px * var(--s) + 6px); height: calc(30px * var(--s) + 6px); object-fit: contain; }
.brief { display: flex; gap: calc(18px * var(--s)); align-items: center; max-width: 920px; width: 92%; padding: calc(6px * var(--s)) calc(12px * var(--s)); animation: popIn 0.3s cubic-bezier(.3,1.6,.5,1) both; }
.brief > img { width: calc(190px * var(--s) + 24px); flex: none; filter: drop-shadow(0 8px 6px rgba(0,0,0,0.6)); }
.brief .txt { font-weight: 700; font-size: max(14px, calc(18px * var(--s))); line-height: 1.5; margin-bottom: 4px; text-shadow: 0 1px 0 #000; }
.brief .txt.stat { color: var(--brass); }
.brief .who { color: var(--nc, #e2c878); font-weight: 900; margin-bottom: 4px; font-size: max(14px, calc(18px * var(--s))); text-shadow: var(--ol); letter-spacing: 0.06em; }
.confirm { max-width: 640px; width: 88%; padding: calc(10px * var(--s)) calc(18px * var(--s)); display: flex; flex-direction: column; gap: 16px; align-items: center; text-align: center; animation: popIn 0.25s cubic-bezier(.3,1.6,.5,1) both; }
.confirm .txt { font-weight: 900; font-size: max(15px, calc(20px * var(--s))); line-height: 1.5; text-shadow: var(--ol); }
.m-ending { justify-content: flex-start !important; }
.m-ending .spacer { flex: 1; }
.m-ending .mtitle { order: 0; margin-bottom: calc(6px * var(--s)); }
.m-ending .spacer { order: -1; }
.endcap { max-width: 980px; width: 92%; padding: calc(6px * var(--s)) calc(16px * var(--s)); animation: popIn 0.5s 0.3s cubic-bezier(.3,1.4,.5,1) both; }
.endcap .txt { font-weight: 700; font-size: max(14px, calc(19px * var(--s))); line-height: 1.55; text-shadow: 0 1px 0 #000; }
.endcap .quote { margin-top: 6px; font-weight: 900; font-size: max(14px, calc(18px * var(--s))); color: #fff0c0; text-shadow: var(--ol); }
.endcap .quote b { color: var(--nc, #e2c878); margin-right: 8px; }
.paintrow { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.paint { all: unset; cursor: pointer; width: max(44px, calc(54px * var(--s))); height: max(44px, calc(54px * var(--s))); border-radius: 4px; background: rgba(20,24,10,0.75); box-shadow: inset 0 0 0 2px rgba(226,200,120,0.3); display: flex; align-items: center; justify-content: center; position: relative; transition: transform 0.12s; }
.paint img { width: 84%; height: 84%; object-fit: contain; }
.paint.sel { box-shadow: inset 0 0 0 3px var(--brass), 0 0 12px rgba(226,200,120,0.7); }
.paint.lock img { filter: grayscale(1) brightness(0.5); }
.paint.lock::after { content: "🔒"; position: absolute; right: 2px; bottom: 0; font-size: 14px; }
.paint:hover, .paint.focus { transform: scale(1.1); }
.paint .sw { width: 60%; height: 60%; border-radius: 50%; }
#help { max-width: 900px; width: 94%; padding: calc(4px * var(--s)) calc(14px * var(--s)); font-weight: 700; font-size: max(13px, calc(15px * var(--s))); line-height: 1.5; animation: popIn 0.3s cubic-bezier(.3,1.6,.5,1) both; max-height: 64vh; overflow: auto; text-shadow: 0 1px 0 #000; scrollbar-width: thin; scrollbar-color: #8a7a44 transparent; }
#help div { margin: 2px 0; }
#help b { color: var(--brass); margin-right: 8px; text-shadow: var(--ol); }
#help b::before { content: "★ "; }

/* ---------- tutorial hint box ---------- */
#tutbox { position: absolute; left: max(10px, env(safe-area-inset-left)); top: calc(var(--mm, 170px) + 20px); width: min(370px, 34%); padding: 2px 6px 4px; z-index: 6; animation: popIn 0.25s cubic-bezier(.3,1.6,.5,1) both; }
#tutbox .tuthead { color: var(--brass); font-weight: 900; font-size: max(13px, calc(15px * var(--s))); letter-spacing: 0.04em; }
#tutbox .tuthead::before { content: "★ "; }
#tutbox .tutbody { font-weight: 800; font-size: max(14px, calc(17px * var(--s))); line-height: 1.4; margin: 3px 0 2px; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
#tutbox .tutrow { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
#tutbox .tutrow:empty { display: none; }
#tutbox .btn { min-height: 44px; }
.tut-hl { outline: 3px solid #ffd84a !important; outline-offset: 1px; box-shadow: 0 0 16px 4px rgba(255, 216, 74, 0.75) !important; animation: tutGlow 0.7s infinite alternate !important; z-index: 4; }
#tutarrow { position: absolute; z-index: 7; display: none; font-size: 30px; line-height: 32px; color: #ffd84a; pointer-events: none !important; text-shadow: 0 0 2px #000, 0 2px 0 #000, 0 0 10px rgba(255, 216, 74, 0.9); animation: tutNudge 0.5s infinite alternate ease-in-out; }
@keyframes tutGlow { from { outline-color: #ffd84a; } to { outline-color: #fff4c0; } }
@keyframes tutNudge { from { translate: -4px 0; } to { translate: 4px 0; } }
/* ---------- skirmish setup ---------- */
.skwrap { display: flex; gap: calc(14px * var(--s)); align-items: stretch; justify-content: center; width: min(96%, 1060px); min-height: 0; }
.skmap { flex: 1 1 46%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 2px 8px; text-align: center; animation: popIn 0.3s cubic-bezier(.3,1.6,.5,1) both; min-width: 0; }
.skmap .optlabel, .skslots > .optlabel { text-align: center; min-width: 0; margin: 0; color: var(--brass); font-size: max(13px, calc(15px * var(--s))); }
.skmap .mrow { display: flex; align-items: center; gap: 8px; }
.skmap .thumb { width: calc(210px * var(--s) + 20px); height: calc(210px * var(--s) + 20px); border-radius: 4px; box-shadow: 0 0 0 2px #0c0e06, 0 0 0 4px rgba(226, 200, 120, 0.5), 0 6px 10px rgba(0, 0, 0, 0.6); image-rendering: auto; }
.skmap h3 { margin: 0; font-size: max(16px, calc(22px * var(--s))); font-weight: 900; text-shadow: var(--ol); color: #fff0c0; }
.skmap .mmeta { font-weight: 900; color: var(--khaki); font-size: max(12px, calc(14px * var(--s))); text-shadow: var(--ol); }
.skmap .mdesc { margin: 0; font-weight: 700; font-size: max(12px, calc(14px * var(--s))); line-height: 1.35; text-shadow: 0 1px 0 #000; max-width: 34em; }
.btn.arrow { min-width: 44px; font-size: 18px; }
.skslots { flex: 1 1 54%; display: flex; flex-direction: column; gap: 4px; padding: 2px 8px; min-width: 0; animation: popIn 0.3s 0.05s cubic-bezier(.3,1.6,.5,1) both; }
.slotlist { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; overflow-y: auto; max-height: calc(250px * var(--s) + 30px); scrollbar-width: thin; scrollbar-color: #8a7a44 transparent; }
.slot { display: flex; align-items: center; gap: 4px; min-width: 0; }
.slot .who { font-weight: 900; font-size: max(12px, calc(14px * var(--s))); min-width: 3.2em; text-shadow: var(--ol); white-space: nowrap; }
.slot .btn.swatch { width: 44px; min-width: 44px; padding: 0; }
.slot .btn.swatch::after { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 0 2px #0c0e06, 0 0 6px var(--tc); }
.slot .btn.nat { flex: 1; min-width: 0; justify-content: flex-start; overflow: hidden; }
.slot .btn.nat img { width: 24px; height: 24px; object-fit: contain; flex: none; }
.slot .btn.nat span { overflow: hidden; text-overflow: ellipsis; }
.slot .btn.del { min-width: 44px; padding: 0; color: #ffb4a0; }
.skslots .btn.add { align-self: center; }
.skslots .row { justify-content: flex-start; gap: 6px; align-items: center; flex-wrap: wrap; }
.skslots .row .optlabel { min-width: 5em; font-size: max(13px, calc(15px * var(--s))); }
/* ---------- lesson picker ---------- */
.mgrid.lessons { grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(96%, 1040px); }
.mcard.lesson { flex-direction: row; text-align: left; align-items: center; gap: 8px; min-height: calc(70px * var(--s) + 24px); }
.mcard.lesson .licon { width: calc(56px * var(--s) + 10px); height: calc(56px * var(--s) + 10px); object-fit: contain; flex: none; filter: drop-shadow(0 3px 3px rgba(0,0,0,0.6)); }
.mcard.lesson h3 { font-size: max(14px, calc(18px * var(--s))); }
.mcard.lesson.all h3 { color: var(--brass); }
.mcard.lesson { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-content: center; column-gap: 8px; row-gap: 2px; padding: 4px 6px; }
.mcard.lesson .licon { grid-row: 1 / span 2; align-self: center; }
.mcard.lesson h3 { align-self: end; }
.mcard.lesson p { align-self: start; }
@container app (max-height: 520px) {
  #hud { --mm: 112px; }
  #resbox { flex-direction: row; gap: 3px; }
  #creditpanel { flex: 1.15; height: 30px; padding: 0 4px; gap: 3px; }
  #creditpanel .rl { display: none; }
  #creditpanel .ico { margin-left: 4px; width: 22px; height: 22px; }
  .card { aspect-ratio: 1 / 0.9; }
  #credits { margin-right: 6px; min-width: 0; padding: 0 3px; font-size: 15px; }
  #powerpanel { flex: 1; height: 30px; padding: 0 4px; gap: 3px; }
  #powerpanel .ico { display: none; }
  #powercells { grid-template-columns: repeat(12, 1fr); gap: 1px; }
  #powertxt { min-width: 0; font-size: 12px; }
  .skmap .thumb { width: 118px; height: 118px; }
  .skmap .mdesc { font-size: 12px; line-height: 1.25; }
  .slotlist { max-height: 150px; }
  .mcard.lesson { min-height: 60px; }
  .mcard.lesson p { font-size: 12px; }
  .mcard.lesson .licon { width: 40px; height: 40px; }
  #tutbox { width: min(300px, 40%); }
  #tutbox .tutbody { font-size: 14px; line-height: 1.3; }
}

#banner { position: absolute; left: 0; right: 0; top: 34%; text-align: center; z-index: 35; font-weight: 900; font-size: max(40px, calc(84px * var(--s))); letter-spacing: 0.1em; text-transform: uppercase; pointer-events: none; animation: slam 0.45s cubic-bezier(.3,1.6,.5,1) both;
  text-shadow: -4px -4px 0 var(--ink), 4px -4px 0 var(--ink), -4px 4px 0 var(--ink), 4px 4px 0 var(--ink), 0 8px 0 var(--ink);
  background: linear-gradient(90deg, transparent, rgba(10,12,5,0.7) 20%, rgba(10,12,5,0.7) 80%, transparent); padding: 6px 0; }
#banner.win { color: #ffe08a; }
#banner.lose { color: #ff9a84; }
/* request 43: the loading screen is a radar scope sweeping the battlefield (CSS only: it keeps turning while the game works) */
#loading { position: absolute; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; font-weight: 900; text-shadow: var(--ol);
  background: repeating-linear-gradient(0deg, rgba(120,255,140,0.035) 0 1px, transparent 1px 4px), radial-gradient(ellipse at center, #141a0e 0%, #070906 75%); }
#loading .ld-box { display: flex; align-items: center; justify-content: center; gap: clamp(16px, 4vw, 48px); width: 92%; max-width: 1000px;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
#loading .ld-radar { position: relative; flex: none; width: min(62cqh, 44cqw); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background:
    linear-gradient(transparent calc(50% - 1px), rgba(120,255,140,0.35) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(120,255,140,0.35) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    repeating-radial-gradient(circle, transparent 0 calc(12.5% - 1.5px), rgba(120,255,140,0.28) calc(12.5% - 1.5px) 12.5%),
    radial-gradient(circle, #0f2a12 0%, #071407 70%, #040a04 100%);
  box-shadow: 0 0 0 3px #1c2210, 0 0 0 7px #4b5530, 0 0 0 9px #14160c, 0 0 30px 6px rgba(80,220,100,0.18), inset 0 0 40px rgba(0,0,0,0.85); }
#loading .ld-radar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(120,255,140,0.4) 0 0.5deg, transparent 0.5deg 10deg); -webkit-mask: radial-gradient(circle, transparent 46%, #000 46.5%, #000 48%, transparent 48.5%); mask: radial-gradient(circle, transparent 46%, #000 46.5%, #000 48%, transparent 48.5%); }
#loading .ld-sweep { position: absolute; inset: 0; border-radius: 50%; will-change: transform;
  background: conic-gradient(from 0deg, transparent 0deg 285deg, rgba(110,255,140,0.04) 285deg, rgba(110,255,140,0.42) 357deg, rgba(200,255,200,0.95) 359.5deg, transparent 360deg);
  animation: ldSweep 2.4s linear infinite; }
#loading .ld-blip { position: absolute; width: 3.2%; height: 3.2%; margin: -1.6% 0 0 -1.6%; border-radius: 50%; background: #c8ffc8; box-shadow: 0 0 8px 3px rgba(120,255,140,0.85); opacity: 0;
  animation: ldBlip 2.4s var(--d) linear infinite; }
#loading .ld-blip.small { width: 2.2%; height: 2.2%; margin: -1.1% 0 0 -1.1%; }
#loading .ld-info { flex: 1 1 auto; min-width: 0; max-width: 440px; padding: 4px 10px; display: flex; flex-direction: column; gap: 10px; }
#loading .ld-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: max(16px, calc(26px * var(--s))); color: #b8ffbe; letter-spacing: 0.08em; }
#loading .ld-title span:first-child::after { content: "_"; animation: ldCaret 0.8s steps(1) infinite; }
#loading #loadpct { font-size: 1.15em; color: #e2ffe0; font-variant-numeric: tabular-nums; }
#loading .ld-bar { height: 12px; background: #0a120a; box-shadow: 0 0 0 1px #000, 0 0 0 2px rgba(120,255,140,0.35); overflow: hidden; }
#loading .ld-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, #7dff8e 0 10px, #3cbf52 10px 14px); box-shadow: 0 0 10px rgba(120,255,140,0.8); transition: width 0.2s; }
#loading .ld-tip { font-size: max(14px, calc(17px * var(--s))); font-weight: 700; line-height: 1.4; color: var(--text); text-shadow: 0 1px 0 #000; min-height: 2.8em; }
/* request 70: skip the last waits of the loading screen; card placeholders while a card picture is on its way */
#loading #loadskip { align-self: flex-end; min-width: 110px; min-height: 44px; padding: 6px 18px; font-size: max(15px, calc(17px * var(--s))); animation: ldSkipIn .25s ease-out; }
@keyframes ldSkipIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#cards .card.pending { background-image: linear-gradient(110deg, rgba(34, 40, 24, 0.95) 30%, rgba(86, 92, 58, 0.95) 50%, rgba(34, 40, 24, 0.95) 70%); background-size: 240% 100%; animation: cardShim 1.2s linear infinite; }
#cards .card.pending img.art { opacity: 0; }
#cards .card img.art { transition: opacity .25s ease-out; }
@keyframes cardShim { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.tutfig .tdone { position: absolute; right: 4%; top: 4%; font-size: 22px; color: #9be27a; text-shadow: 0 0 4px #000, 0 2px 0 #000; }
.tdots i.done { background: #7fbf5a; }
@keyframes ldSweep { to { transform: rotate(360deg); } }
@keyframes ldBlip { 0% { opacity: 1; transform: scale(1.6); } 8% { opacity: 1; transform: scale(1); } 70% { opacity: 0.12; } 100% { opacity: 0; } }
@keyframes ldCaret { 50% { opacity: 0; } }
@container app (max-aspect-ratio: 1/1) { #loading .ld-box { flex-direction: column; } #loading .ld-radar { width: min(70cqw, 46cqh); } #loading .ld-info { width: 100%; } }
#padcursor { position: absolute; z-index: 60; width: 30px; height: 30px; margin: -15px 0 0 -15px; pointer-events: none; border-radius: 50%; border: 3px solid var(--brass); box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #000; }
#padcursor::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; background: var(--brass); border-radius: 50%; }

@container app (max-height: 520px) {
  #menu-body { gap: 6px; padding-top: 58px; padding-bottom: 6px; }
  .mcard img.portrait { max-height: 70px; }
  .modes .mcard img.portrait { max-height: 110px; }
  .mtitle { font-size: 21px; }
  .mtitle::before, .mtitle::after { width: 26px; }
  .mcard.mission { min-height: 72px; }
  .mcard.mission p { display: none; }
  .nations .mcard p.sig { display: none; }
  .brief > img { width: 110px; }
  .brief .txt { font-size: 14px; line-height: 1.4; }
  #help { max-height: 58vh; }
  .m-result .mtitle, .m-ending .mtitle { font-size: 28px; }
}

/* ---------- command room: every menu is shown on the big screen above the commander's console ---------- */
#screen-menu .bg.cr { background-image: url(assets/cmdroom-bg.webp); }
#screen-menu .bg.cr::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 34%, rgba(8,10,4,0) 30%, rgba(8,10,4,0.55) 80%), linear-gradient(180deg, rgba(8,10,4,0.2), transparent 30%, transparent 62%, rgba(8,10,4,0.65)); }
#menu-body.cr { display: block; padding: 0; gap: 0; --crt-l: 15%; --crt-t: max(10px, 2.4%); --crt-h: 60%; --deck-t: 63.6%; --cmdr-h: 37%; --pbc: calc(10px * var(--s) + 6px); }
#menu-body.cr.wide { --crt-l: 13%; --crt-h: 74.5%; --deck-t: 78.8%; --cmdr-h: 20.5%; }
#menu-body.cr .backbtn { padding: 2px calc(8px * var(--s) + 4px); border-width: 10px; }
#menu-body.cr .goldchip img { width: 26px; height: 26px; }
.cr .crt { position: absolute; left: var(--crt-l); right: var(--crt-l); top: var(--crt-t); height: var(--crt-h); z-index: 2;
  border-style: solid; border-width: var(--pbc); border-image: url(assets/ui-panel.webp) 120 / var(--pbc) stretch;
  background: radial-gradient(ellipse at 50% 40%, rgba(34, 52, 40, 0.94), rgba(10, 16, 12, 0.97) 75%); background-clip: padding-box;
  box-shadow: 0 0 calc(30px * var(--s)) rgba(120, 220, 170, 0.12), 0 12px 24px rgba(0,0,0,0.55); }
.cr .crt::after { content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(200, 255, 220, 0.035) 0 1px, transparent 1px 3px), radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(0,0,0,0.35)); }
.cr .crt::before { content: ""; position: absolute; inset: 0; z-index: 7; pointer-events: none; background: #d8ffe8; opacity: 0; }
.cr .crt.boot::before { animation: crtFlash 0.32s ease-out; }
.cr .crt.boot .crt-in { animation: crtOn 0.28s cubic-bezier(.2,1.3,.5,1) both; }
.crhead { position: absolute; left: 0; right: 0; top: 0; height: max(20px, calc(26px * var(--s))); display: flex; align-items: center; gap: 8px; padding: 0 8px; z-index: 5;
  font-weight: 900; letter-spacing: 0.12em; font-size: max(12px, calc(15px * var(--s))); color: #9fe6bd; text-shadow: 0 0 6px rgba(120, 230, 170, 0.6), 0 1px 0 #000;
  border-bottom: 1px solid rgba(159, 230, 189, 0.25); white-space: nowrap; overflow: hidden; text-transform: uppercase; }
.crhead .dot { width: 8px; height: 8px; border-radius: 50%; background: #ff6b4a; box-shadow: 0 0 6px #ff6b4a; flex: none; animation: pulse 0.8s ease-in-out infinite alternate; }
.crt-in { position: absolute; left: 0; right: 0; bottom: 0; top: max(22px, calc(28px * var(--s))); display: flex; padding: calc(6px * var(--s) + 2px) calc(8px * var(--s) + 4px); overflow: hidden; min-height: 0; }
.cr .cmdr { position: absolute; left: 50%; bottom: 0; height: var(--cmdr-h); transform: translateX(-50%); z-index: 3; pointer-events: none; filter: drop-shadow(0 8px 10px rgba(0,0,0,0.65)); }
.cr .deck { position: absolute; top: var(--deck-t); bottom: max(8px, 1.6%); width: 35%; z-index: 4; display: flex; flex-direction: column; justify-content: center; gap: 6px;
  border-style: solid; border-width: var(--pbc); border-image: url(assets/ui-panel.webp) 120 fill / var(--pbc) stretch; padding: 2px 4px; }
.cr .deck.left { left: max(10px, env(safe-area-inset-left), 1.5%); }
.cr .deck.right { right: max(10px, env(safe-area-inset-right), 1.5%); align-items: stretch; }
.cr.wide .deck.right { flex-direction: row; align-items: center; justify-content: flex-end; width: 40%; }
.cr .deck .btn { white-space: normal; line-height: 1.1; }
.cr .deck.right .btn.big { padding-left: 10px; padding-right: 10px; }
.cr .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cr .opt { min-height: 46px; font-size: max(14px, calc(20px * var(--s))); justify-content: flex-start; padding: 2px 6px; text-align: left; letter-spacing: 0.02em; overflow-wrap: anywhere; min-width: 0; }
.cr .opts.four .opt { font-size: max(13px, calc(17px * var(--s))); gap: 4px; }
.cr .opt .oi { width: max(26px, calc(36px * var(--s))); height: max(26px, calc(36px * var(--s))); object-fit: contain; flex: none; }
.cr .opt.sel { color: #fff3c8; filter: brightness(1.3) sepia(0.4) saturate(1.6) drop-shadow(0 0 7px var(--nc, rgba(226, 200, 120, 0.9))); }
.cr .opt.sel::before { content: "▶"; font-size: 0.7em; color: var(--nc, var(--brass)); }
.deckinfo { display: flex; align-items: center; gap: 10px; font-weight: 900; text-shadow: var(--ol); }
.deckinfo .em { width: max(40px, calc(64px * var(--s))); }
.deckinfo div { display: flex; flex-direction: column; gap: 2px; font-size: max(14px, calc(18px * var(--s))); }
.deckinfo span { color: #cdf09a; font-size: 0.85em; }
/* screen content */
.crt-in p, .crt-in .txt, .crt-in .mdesc, .crt-in #help { font-family: "Trebuchet MS", "Segoe UI", var(--font); }
.crt-in .split { display: grid; grid-template-columns: 42% minmax(0, 1fr); gap: calc(12px * var(--s) + 4px); width: 100%; height: 100%; min-height: 0; }
.crt-in .split .pic { position: relative; overflow: hidden; border-radius: 4px; min-height: 0; box-shadow: 0 0 0 1px rgba(159, 230, 189, 0.3); }
.crt-in .split .pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.crt-in .split.nat { grid-template-columns: 31% minmax(0, 1fr); }
.crt-in .split .pic.portrait { box-shadow: none; background: radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--nc) 45%, transparent), transparent 70%); }
.crt-in .split .pic.portrait img { object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 6px 8px rgba(0,0,0,0.6)); }
.crt-in .info { overflow-y: auto; min-height: 0; padding-right: 6px; scrollbar-width: thin; scrollbar-color: #6fa587 transparent; }
.crt-in h2 { margin: 0 0 4px; font-size: max(18px, calc(30px * var(--s))); font-weight: 900; color: var(--nc, var(--brass)); text-shadow: var(--ol); letter-spacing: 0.04em; line-height: 1.15; }
.crt-in h2.nh { display: flex; align-items: center; gap: 8px; }
.crt-in h2 .em { width: max(28px, calc(44px * var(--s))); flex: none; }
.crt-in .who { color: #cfe9d6; font-weight: 900; font-size: max(13px, calc(16px * var(--s))); margin-bottom: 4px; text-shadow: 0 1px 0 #000; }
.crt-in .lead, .crt-in .story { margin: 0 0 4px; font-weight: 700; font-size: max(13px, calc(17px * var(--s))); line-height: 1.55; color: #eef5e6; text-shadow: 0 1px 0 #000; }
.crt-in .sec { margin: calc(6px * var(--s) + 2px) 0 3px; color: #9fe6bd; font-weight: 900; letter-spacing: 0.1em; font-size: max(12px, calc(15px * var(--s))); display: flex; align-items: center; gap: 8px; text-transform: uppercase; }
.crt-in .sec::after { content: ""; flex: 1; height: 1px; background: rgba(159, 230, 189, 0.3); }
.crt-in .chip { display: inline-block; padding: 2px 8px; border-radius: 4px; background: rgba(226, 200, 120, 0.15); color: var(--brass); font-weight: 900; font-size: max(13px, calc(16px * var(--s))); }
.crt-in .ugrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 4px 10px; }
.crt-in .urow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.crt-in .urow .ui { width: max(34px, calc(50px * var(--s))); height: max(34px, calc(50px * var(--s))); object-fit: contain; flex: none; filter: drop-shadow(0 3px 3px rgba(0,0,0,0.6)); }
.crt-in .ut { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.crt-in .ut b { color: #fff0c0; font-size: max(13px, calc(16px * var(--s))); text-shadow: var(--ol); }
.crt-in .ut span { font-size: max(12px, calc(14px * var(--s))); color: #cfe9d6; font-family: "Trebuchet MS", "Segoe UI", var(--font); font-weight: 700; }
.crt-in .prog { margin-top: 6px; color: #cdf09a; font-weight: 900; font-size: max(13px, calc(15px * var(--s))); text-shadow: 0 1px 0 #000; }
.crt-in .mgrid { width: 100%; height: 100%; overflow-y: auto; align-content: start; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 4px; scrollbar-width: thin; }
.crt-in .mcard { background: linear-gradient(180deg, rgba(40, 60, 46, 0.75), rgba(16, 24, 18, 0.85)); border: 1px solid rgba(159, 230, 189, 0.35); border-radius: 6px; padding: 6px 8px; }
.crt-in .mcard.mission { min-height: calc(92px * var(--s) + 16px); }
.crt-in .mcard:hover, .crt-in .mcard.focus { transform: scale(1.03); }
.crt-in #help { width: 100%; max-width: none; max-height: 100%; overflow-y: auto; padding: 0 6px; animation: none; }
.crt-in .brief { display: grid; grid-template-columns: 28% minmax(0, 1fr); gap: 14px; width: 100%; height: 100%; max-width: none; padding: 0; animation: none; align-items: stretch; }
.crt-in .brief > img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
.crt-in .brief .info { display: flex; flex-direction: column; justify-content: center; }
.crt-in .brief .info > * { flex: none; }
.crt-in .mtitle { font-size: max(24px, calc(44px * var(--s))) !important; justify-content: flex-start; max-width: 100%; }
.crmsg { margin: auto; max-width: 80%; text-align: center; font-weight: 900; font-size: max(16px, calc(24px * var(--s))); line-height: 1.5; text-shadow: var(--ol); }
.endview { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 4px; margin: calc(-6px * var(--s) - 2px) calc(-8px * var(--s) - 4px); width: calc(100% + 16px * var(--s) + 8px); height: calc(100% + 12px * var(--s) + 4px); }
.endview .endimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.endview .endcap { position: absolute; left: 0; right: 0; bottom: 0; max-height: 62%; overflow-y: auto; padding: 30px 16px 10px; background: linear-gradient(180deg, transparent, rgba(6, 10, 6, 0.88) 30%); }
.endview .endcap .txt { font-weight: 700; font-size: max(13px, calc(17px * var(--s))); line-height: 1.5; text-shadow: 0 1px 0 #000; }
.endview .endcap .quote { margin-top: 4px; color: var(--brass); font-weight: 900; font-size: max(13px, calc(16px * var(--s))); }
.endview .endcap .quote b { color: var(--nc); margin-right: 6px; }
/* big screen as one picture: image fills it, text over a dark fade, sized to fill (--fz set by fitText) */
.crt-in .scene { position: absolute; inset: 0; overflow: hidden; }
.crt-in .scene .bgimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.crt-in .scene.nat .bgimg { filter: brightness(0.42) saturate(0.6) blur(1px); transform: scale(1.03); }
.crt-in .scene .tint { position: absolute; inset: 0; background: radial-gradient(ellipse 45% 85% at 17% 82%, color-mix(in srgb, var(--nc) 55%, transparent), transparent 75%); }
.crt-in .scene .portrait { position: absolute; left: 1%; bottom: 0; height: 100%; width: auto; max-width: 40%; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.7)); }
.crt-in .scene .fade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(6,12,9,0) 18%, rgba(6,12,9,0.55) 32%, rgba(6,12,9,0.86) 46%, rgba(6,12,9,0.93) 70%, rgba(6,12,9,0.95)); }
.crt-in .scene.nat .fade { background: linear-gradient(90deg, rgba(6,12,9,0) 25%, rgba(6,12,9,0.6) 33%, rgba(6,12,9,0.88) 44%, rgba(6,12,9,0.94)); }
.crt-in .scene .ov { position: absolute; top: 0; bottom: 0; right: 0; left: 36%; z-index: 2; font-size: var(--fz, 18px);
  padding: 0.9em 1.1em 0.9em 0.4em; overflow-y: auto; display: flex; flex-direction: column; overscroll-behavior: contain; }
.crt-in .scene.nat .ov { left: 31%; }
.crt-in .scene .ov.more { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 2.2em), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 2.2em), transparent); }
.crt-in .scene .ov > :first-child { margin-top: auto; }
.crt-in .scene .ov > :last-child { margin-bottom: auto; }
.crt-in .ov h2 { font-size: 1.75em; margin: 0 0 0.3em; flex: none; }
.crt-in .ov h2 .em { width: 1.35em; }
.crt-in .ov .who { font-size: 0.9em; margin-bottom: 0.3em; }
.crt-in .ov .lead, .crt-in .ov .story { font-size: 1em; line-height: 1.68; margin: 0 0 0.3em; text-shadow: 0 1px 0 #000, 0 0 8px rgba(0,0,0,0.85); }
.crt-in .ov .sec { font-size: max(12px, 0.8em); margin: 0.65em 0 0.3em; flex: none; }
.crt-in .ov .chip { font-size: 0.9em; align-self: flex-start; }
.crt-in .ov .ugrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13em), 1fr)); gap: 0.3em 0.7em; flex: none; }
.crt-in .ov .urow .ui { width: 2.6em; height: 2.6em; }
.crt-in .ov .ut b { font-size: 0.95em; }
.crt-in .ov .ut span { font-size: max(12px, 0.8em); }
.crt-in .ov .prog { font-size: 0.88em; flex: none; }
/* nation screen: the nation's own scene behind the commander, slowly drifting, with ambient particles */
.crt-in .scene.nat .bgimg { filter: brightness(0.85) saturate(1); animation: natPan 22s ease-in-out infinite alternate; transform-origin: 70% 50%; }
.crt-in .scene.nat .fade { background: linear-gradient(90deg, rgba(6,12,9,0) 27%, rgba(6,12,9,0.42) 36%, rgba(6,12,9,0.66) 50%, rgba(6,12,9,0.74)); }
.crt-in .scene.nat .ov, .crt-in .scene.mis .ov { text-shadow: 0 1px 0 #000, 0 0 6px rgba(0,0,0,0.95), 0 0 14px rgba(0,0,0,0.7); }
.crt-in .scene .fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.crt-in .scene .portrait.anim { max-width: none; background-repeat: no-repeat; object-fit: initial; }
/* story missions: the mission's map fills the screen, the briefing on a fade at the right */
.crt-in .scene.mis .bgimg { filter: blur(2px) brightness(0.62) saturate(0.95); transform: scale(1.04); }
.crt-in .scene.mis .mapsq { position: absolute; top: 4%; bottom: 4%; left: 3%; aspect-ratio: 1; border: 2px solid rgba(159, 230, 189, 0.45); box-shadow: 0 0 18px rgba(0,0,0,0.7), inset 0 0 30px rgba(0,0,0,0.5); }
.crt-in .scene.mis .mapsq img { width: 100%; height: 100%; display: block; }
.crt-in .scene.mis .mk { position: absolute; width: 0; height: 0; z-index: 1; }
.crt-in .scene.mis .mk .ring { position: absolute; left: -1.25em; top: -1.25em; width: 2.5em; height: 2.5em; border-radius: 50%; border: 3px solid var(--nc); background: rgba(8, 10, 6, 0.75); box-shadow: 0 0 10px var(--nc); display: flex; align-items: center; justify-content: center; font-size: max(12px, calc(15px * var(--s))); }
.crt-in .scene.mis .mk .ring img { width: 78%; height: 78%; object-fit: contain; }
.crt-in .scene.mis .mk.me .ring { animation: pulse 0.7s ease-in-out infinite alternate; }
.crt-in .scene.mis .mk span { position: absolute; left: 50%; top: 1.6em; transform: translateX(-50%); white-space: nowrap; font-weight: 900; font-size: max(11px, calc(13px * var(--s))); color: var(--nc); text-shadow: var(--ol); filter: brightness(1.3); }
.crt-in .scene.mis .mk.top span { top: auto; bottom: 1.6em; }
.crt-in .scene.mis .fade { background: linear-gradient(90deg, rgba(6,12,9,0) 36%, rgba(6,12,9,0.6) 46%, rgba(6,12,9,0.8) 58%, rgba(6,12,9,0.86)); }
.crt-in .scene.mis .ov { left: 47%; }
.crt-in .ov .txt { font-size: 1em; line-height: 1.6; margin: 0 0 0.3em; text-shadow: 0 1px 0 #000, 0 0 8px rgba(0,0,0,0.85); white-space: pre-line; }
.crt-in .ov .enemies { font-size: 0.85em; display: flex; flex-wrap: wrap; gap: 0.3em 0.8em; align-items: center; flex: none; }
.crt-in .ov .enemies .en { display: inline-flex; align-items: center; gap: 0.25em; font-weight: 900; }
.crt-in .ov .enemies img { width: 1.4em; height: 1.4em; object-fit: contain; }
.crt-in .ov .stars { color: #ffd877; font-size: 0.9em; flex: none; }
#screen-menu .bg.cr.war { background-image: url(assets/warroom-bg.webp); }
@keyframes lampBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes readout { 0% { transform: scaleY(0.25); } 100% { transform: scaleY(1); } }
@keyframes needle { 0% { transform: rotate(-55deg); } 40% { transform: rotate(-20deg); } 100% { transform: rotate(38deg); } }
@keyframes natPan { 0% { transform: scale(1.04) translate(0, 0); } 100% { transform: scale(1.12) translate(-2.5%, -1.5%); } }
@keyframes fanPress { 0% { transform: translateY(0); } 35% { transform: translateY(5px) scale(0.98); } 100% { transform: translateY(0); } }
/* dropdown popup */
.ddback { position: absolute; inset: 0; z-index: 40; background: rgba(6, 8, 4, 0.62); display: flex; align-items: center; justify-content: center; }
.ddpop { min-width: min(340px, 84%); max-width: 90%; max-height: 88%; display: flex; flex-direction: column; gap: 6px; padding: 4px 8px; animation: popIn 0.2s cubic-bezier(.3,1.6,.5,1) both; }
.ddhead { font-weight: 900; color: var(--brass); text-align: center; font-size: max(16px, calc(24px * var(--s))); text-shadow: var(--ol); letter-spacing: 0.08em; }
.ddlist { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; overflow-y: auto; min-height: 0; padding: 4px; }
.ddlist.swatches { grid-template-columns: repeat(5, 60px); justify-content: center; }
.ddopt { min-height: 50px; justify-content: flex-start; text-transform: none; font-size: max(15px, calc(19px * var(--s))); }
.ddlist.swatches .ddopt { justify-content: center; padding: 0; }
.ddopt .sw { width: 26px; height: 26px; }
.ddopt .di { width: 30px; height: 30px; object-fit: contain; flex: none; }
.ddopt.dis { filter: brightness(0.5) saturate(0.55); cursor: not-allowed; }
.ddlist.swatches .ddopt.dis::after { content: "✕"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #ffd0c0; font-size: 26px; text-shadow: var(--ol); }
.ddlist.swatches .ddopt.sel { filter: brightness(1.15); outline: 3px solid #fff3c8; outline-offset: 1px; border-radius: 8px; }
@container app (max-height: 520px) {
  #menu-body.cr.fanned { --crt-h: 61%; }
  #menu-body.cr.fanned.two { --crt-h: 55%; }
  .cr .fan { height: 33%; }
  .cr .fan.two { height: 40%; }
  .cr .fanbtn { font-size: 18px; }
  .cr .fanbtn.nat { font-size: 14px; }
  .cr .fanbtn.nat .fl { flex-direction: column; gap: 1px; }
  .cr .fanbtn.nat .fp { height: 26px; width: 26px; }
  .cr .fanbtn.key { font-size: 15px; }
  .cr .fanbtn.key.small { font-size: 12px; }
  .cr .fanbtn.mis { font-size: 12px; }
  .cr .fanbtn.mis .no { font-size: 20px; }
  .cr .fanbtn.mis .mt { display: none; }
  .crt-in .scene.mis .ov { left: 45%; }
  .crt-in .scene .ov { left: 31%; padding: 0.6em 0.8em 0.6em 0.3em; }
  .crt-in .scene.nat .ov { left: 29%; }
  .crt-in { padding: 4px 8px; }
  .crt-in .lead, .crt-in .story { font-size: 13px; line-height: 1.45; }
  .crt-in .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .crt-in .mcard.mission { min-height: 64px; }
  .crt-in .mcard.mission p { display: none; }
  .crt-in .mcard.lesson { min-height: 52px; }
  .crt-in .mcard.lesson p { display: none; }
  .crt-in .brief .txt { font-size: 13px; }
  .cr .opts { gap: 4px; }
  .cr .opt { font-size: 14px; min-height: 44px; }
  .cr .deck { gap: 4px; }
}
@keyframes crtOn { 0% { transform: scale(1.02, 0.02); opacity: 0.4; } 55% { transform: scale(1, 1.03); opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes crtFlash { 0% { opacity: 0.32; } 100% { opacity: 0; } }
@keyframes pulse { from { opacity: 0.6; } to { opacity: 1; } }
@keyframes logoIn { 0% { opacity: 0; transform: translateY(-60px) scale(0.7); } 100% { opacity: 1; transform: none; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.85); } 100% { opacity: 1; transform: none; } }
@keyframes toastIn { 0% { opacity: 0; transform: translateY(-12px) scale(0.8); } 100% { opacity: 1; transform: none; } }
@keyframes slam { 0% { opacity: 0; transform: scale(2.6); } 70% { opacity: 1; transform: scale(0.92); } 100% { transform: scale(1); } }
