/* ═══════════════════════════════════════════════════════════════════════
   TRUMP WARS · HOMELAND DEFENSE — screens (package U4 of the "Fleet Command Console")
   Main menu (#menu), pause panel (#pauseP), field manual popup (#manualP, F1), after-action card (#end) and the onboarding
   hint (#help). Port of final.css 'U4 · OVERLAY SCREENS' and 'U4 · ONBOARDING HINT'; markup in index.html, content from
   js/ui/screens.js. #menu keeps the .hidden contract that inMenu() reads: it is shown / hidden only through .hidden, and the
   fade is an animation that runs when it appears. Text floor: every size under 1rem is max(9px, Xrem). Glyphs outside the
   two fonts (▸ ◂ ★ ✕) are CSS or SVG shapes, never typed.
   ═══════════════════════════════════════════════════════════════════════ */

/* ═══ U4 · OVERLAY SCREENS: shared ═══════════════════════════════════════ */
.overlay { position: fixed; inset: 0; z-index: 10; color: var(--txt); }
#menu:not(.hidden), #end:not(.hidden) { animation: scrIn .28s ease-out; }
@keyframes scrIn { from { opacity: 0; } }
html.still .overlay, html.still .overlay *, html.still #pauseP, html.still #pauseP * { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { .overlay, .overlay *, #pauseP, #pauseP * { animation: none !important; transition: none !important; } }
.overlay .scrim { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(2, 4, 8, .4), rgba(2, 4, 8, .82) 75%); }
.overlay .scrim.end { background: radial-gradient(ellipse at 50% 45%, rgba(14, 2, 2, .55), rgba(2, 3, 6, .88) 75%); }
/* left-dark: the picks sit on the dark side, the live battlefield shows on the right */
.overlay .scrim.menu { background: linear-gradient(90deg, rgba(3, 5, 9, .93) 0%, rgba(3, 5, 9, .84) 42%, rgba(3, 5, 9, .3) 70%, rgba(3, 5, 9, .5) 100%), linear-gradient(0deg, rgba(3, 5, 9, .6), rgba(3, 5, 9, 0) 40%); }
.overlay .screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 2rem; }
/* drawn markers (not in either font): ◂ = .tri.l (▸ = .tri from ui-intel.css), ★ = .star (svg), route swatches */
.tri.l { border-left: 0; border-right: .45em solid currentColor; margin: 0 .45em 0 0; }
.star { display: inline-block; width: .95em; height: .95em; vertical-align: -.12em; margin-right: .35em; }
.star svg { display: block; width: 100%; height: 100%; }
.sw { display: inline-block; width: 1.3em; height: .26em; vertical-align: .22em; margin: 0 .3em 0 .1em; background: var(--gnd); }
.sw.a { background: var(--air); }

/* buttons */
.btn-big { height: 5.4rem; min-width: 24rem; padding: 0 2rem; display: flex; align-items: center; justify-content: center; gap: 1.4rem; position: relative; color: var(--k0); background: var(--yel); white-space: nowrap;
  clip-path: polygon(1.2rem 0, 100% 0, 100% calc(100% - 1.2rem), calc(100% - 1.2rem) 100%, 0 100%, 0 1.2rem); font: 700 2.6rem/1 var(--f-txt); letter-spacing: .3em; text-transform: uppercase; }
.btn-big::before { content: ''; position: absolute; inset: 4px; border: 1px solid rgba(0, 0, 0, .3); clip-path: inherit; pointer-events: none; }
.btn-big .key { background: var(--k0); color: var(--yel); font-size: 1rem; height: 1.9rem; letter-spacing: .1em; padding: 0 .5rem; }
.btn-big:hover { background: #fff36b; }
.btn-big.warn { background: var(--warn); }
.btn-big.warn:hover { background: #ffb24d; }
.btn-2 { height: 4.2rem; padding: 0 1.4rem; display: inline-flex; align-items: center; gap: .8rem; font: 700 1.45rem/1 var(--f-txt); letter-spacing: .14em; text-transform: uppercase; color: var(--txt); box-shadow: inset 0 0 0 1px var(--ln); white-space: nowrap;
  clip-path: polygon(.8rem 0, 100% 0, 100% calc(100% - .8rem), calc(100% - .8rem) 100%, 0 100%, 0 .8rem); background: rgba(255, 255, 255, .03); }
.btn-2:hover { box-shadow: inset 0 0 0 1px var(--yel); color: var(--yel); }
.btn-2.ghost { box-shadow: none; color: var(--txt-3); padding: 0 1rem 0 .8rem; }
.btn-2.ghost:hover { color: var(--txt); }
.btn-2.fr { color: var(--fr); box-shadow: inset 0 0 0 1px rgba(82, 216, 255, .5); }
.btn-2.fr:hover { color: #9be9ff; box-shadow: inset 0 0 0 1px var(--fr); }
.btn-2 .key { font-size: max(9px, .95rem); height: 1.6rem; letter-spacing: .06em; }
.btn-2 .st { font: 400 1.25rem/1 var(--f-num); letter-spacing: .14em; color: var(--txt-3); text-transform: uppercase; }
.btn-2 .st.on { color: var(--fr); }
.btn-2 .st.warn { color: var(--warn); }
.fine { margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--ln-3); font: 400 max(9px, .95rem)/1.35 var(--f-num); letter-spacing: .08em; color: var(--txt-3); }
.fine a { color: var(--txt-2); text-decoration: none; border-bottom: 1px dotted; }
.fine a:hover { color: var(--yel); }

/* ═══ U4 · MAIN MENU (#menu) ═════════════════════════════════════════════
   Grid 72rem | 1fr | 34rem: title + picks left, the live battlefield in the middle, intel + field manual bottom right.  */
.menu2 { position: absolute; inset: 0; display: grid; grid-template-columns: 72rem minmax(0, 1fr) 34rem; grid-template-rows: auto 1fr; column-gap: 0; padding: 3rem 3.6rem 2.4rem; }
.menu2 .left { grid-column: 1; grid-row: 1 / 3; display: flex; flex-direction: column; min-height: 0; }
.menu2 .right { grid-column: 3; grid-row: 2; align-self: end; display: flex; flex-direction: column; gap: 1rem; }

/* title: original condensed lettering, both words solid. Each word gets its OWN stencil cut, made with a mask (the glyphs are
   cut, nothing is painted over them), so the cut is transparent, never sticks out past a letter and never crosses the word gap.
   The word's own text only sizes the box; ::after is the gradient face, ::before the dark drop copy + glow under it (a CSS filter
   on a masked, text-clipped element renders a dark box in Chrome, so the shadow is a copy of the glyphs instead). */
.title { text-align: left; }
.parody { display: flex; align-items: center; gap: 1rem; font: 400 1.2rem/1 var(--f-num); letter-spacing: .34em; color: var(--txt-2); text-transform: uppercase; white-space: nowrap; }
.parody::before { content: ''; width: 3.2rem; height: 1px; background: var(--amb); flex: none; }
.logo { position: relative; display: inline-block; margin: .9rem 0 .1rem; }
.logo h1 { margin: -.06em 0 -.06em; display: flex; gap: .32em; font: 700 8.4rem/.8 var(--f-txt); letter-spacing: .08em; text-transform: uppercase; }
.logo h1 .w { position: relative; display: inline-block; color: transparent; padding: .06em 0 .06em; white-space: nowrap; --cut-at: 47%;
  -webkit-mask-image: linear-gradient(180deg, #000 var(--cut-at), transparent var(--cut-at), transparent calc(var(--cut-at) + .3rem), #000 calc(var(--cut-at) + .3rem));
  mask-image: linear-gradient(180deg, #000 var(--cut-at), transparent var(--cut-at), transparent calc(var(--cut-at) + .3rem), #000 calc(var(--cut-at) + .3rem)); }
.logo h1 .w::before, .logo h1 .w::after { content: attr(data-t); position: absolute; left: 0; top: 0; padding: .06em 0 .02em; }
.logo h1 .w::before { color: rgba(0, 0, 0, .6); transform: translateY(.25rem); }
.logo h1 .w::after { background: linear-gradient(180deg, #fff6a0 0%, var(--yel) 34%, #f2cf00 60%, #c08f00 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--yel); }
.logo .rule { display: flex; align-items: center; gap: 1.2rem; margin-top: .9rem; font: 400 1.35rem/1 var(--f-num); letter-spacing: .62em; color: var(--txt); text-transform: uppercase; white-space: nowrap; }
.logo .rule::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--amb), transparent); }
.lead-m { margin: .9rem 0 0; max-width: 72rem; font: 500 1.45rem/1.3 var(--f-txt); color: var(--txt-2); }
.lead-m b { color: var(--txt); font-weight: 700; }

.menu-panel { margin-top: 1.4rem; padding: 1.3rem 1.6rem 1.4rem; --cut: 1.4rem; }
.step-h { display: flex; align-items: baseline; gap: .9rem; margin-bottom: .9rem; }
.step-h .n { font: 400 1.05rem/1 var(--f-num); color: var(--k0); background: var(--amb); padding: .28rem .4rem .22rem; letter-spacing: .1em; }
.step-h .t { font: 700 1.55rem/1 var(--f-txt); letter-spacing: .2em; color: var(--txt); text-transform: uppercase; }
.step-h .h { font: 400 1rem/1 var(--f-num); letter-spacing: .14em; color: var(--txt-3); text-transform: uppercase; white-space: nowrap; order: 2; }
.step-h::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--ln), transparent); align-self: center; order: 1; }
.step-h .h.live { color: var(--fr); }

/* pick cards (nation + battlefield) */
.nat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.pick { position: relative; text-align: left; padding: .65rem .9rem .7rem; color: var(--txt); background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px rgba(255, 184, 48, .17);
  clip-path: polygon(.8rem 0, 100% 0, 100% calc(100% - .8rem), calc(100% - .8rem) 100%, 0 100%, 0 .8rem); transition: background .12s; white-space: normal; min-width: 0; }
.pick:hover { background: rgba(255, 184, 48, .08); box-shadow: inset 0 0 0 1px var(--ln); }
.pick.on { background: linear-gradient(180deg, rgba(255, 232, 31, .13), rgba(255, 232, 31, .03)); box-shadow: inset 0 0 0 2px var(--yel); }
.pick.on::after { content: ''; position: absolute; right: 0; top: 0; width: 1.8rem; height: 1.8rem; background: var(--yel); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.pick .em { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.pick .em > span { display: block; width: 3rem; height: 3rem; flex: none; }
.pick .em svg { width: 100%; height: 100%; display: block; }
.pick .code { font: 400 1rem/1 var(--f-num); letter-spacing: .16em; color: var(--txt-3); }
.pick b { display: block; font: 700 1.55rem/1.05 var(--f-txt); letter-spacing: .04em; color: var(--txt); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick em { display: block; font: 700 1.15rem/1.1 var(--f-txt); font-style: normal; letter-spacing: .12em; color: var(--yel); text-transform: uppercase; margin-top: .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* "Change loadout": the picks pulse once when the menu opens from the after-action card */
.menu-panel.focus .nat-grid, .menu-panel.focus .map-row { animation: pickFocus 1.6s ease-out; }
@keyframes pickFocus { 0%, 35% { box-shadow: 0 0 0 .3rem rgba(255, 232, 31, .55); } 100% { box-shadow: 0 0 0 .3rem rgba(255, 232, 31, 0); } }

/* what the picked perk changes, in the game's own numbers */
.nat-brief { margin-top: .5rem; display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; padding: .6rem 1rem .65rem; background: rgba(255, 255, 255, .025); box-shadow: inset 2px 0 0 var(--yel), inset 0 0 0 1px var(--ln-3); }
.nat-brief .hd { margin-bottom: .45rem; }
.nat-brief .tx { font: 500 1.25rem/1.2 var(--f-txt); color: var(--txt-2); margin-bottom: .45rem; }
.nat-brief ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .3rem 1.6rem; }
.nat-brief li { font: 400 1.08rem/1.25 var(--f-num); color: var(--txt-2); letter-spacing: .02em; white-space: nowrap; }
.nat-brief li::before { content: ''; display: inline-block; border-top: .28em solid transparent; border-bottom: .28em solid transparent; border-left: .42em solid var(--amb); margin-right: .55em; vertical-align: .05em; }
.nat-brief li b { color: var(--yel); font-weight: 400; }
.nat-brief li b .tri { margin: 0 .35em 0 .25em; }
.nat-brief .sig { width: 4.6rem; height: 4.6rem; }
.nat-brief .sig svg { width: 100%; height: 100%; display: block; }

.sec2 { margin-top: 1rem; }
.map-row { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: .5rem; }
.pick.map { padding: .55rem .55rem .7rem; }
.pick.map canvas { width: 100%; height: 8.6rem; display: block; background: #05070a; box-shadow: 0 0 0 1px var(--ln-2); }
.pick.map .mt { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .6rem; padding: 0 .3rem; }
.pick.map .mt b { min-width: 0; }
.diff { display: inline-flex; align-items: center; gap: .25rem; font: 400 max(9px, .95rem)/1 var(--f-num); letter-spacing: .12em; color: var(--txt-2); white-space: nowrap; flex: none; }
.diff i { width: .9rem; height: .5rem; background: rgba(255, 255, 255, .14); transform: skewX(-24deg); }
.diff i.on { background: var(--amb); }
.pick.map .best { margin-top: .5rem; padding: 0 .3rem; font: 400 1rem/1 var(--f-num); letter-spacing: .1em; color: var(--txt-3); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick.map .best b { display: inline; font: inherit; letter-spacing: inherit; color: var(--yel); }

/* deploy row: summary (or the Resume block mid-run) + DEPLOY */
.deploy-row { display: flex; align-items: center; gap: 1.6rem; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--ln-2); }
.deploy-row .btn-big { height: 4.8rem; flex: none; }
/* compact content (nation code, map, '22 held'), so the columns never need an ellipsis */
.deploy-row .sum { flex: 1; display: flex; gap: 2.2rem; min-width: 0; }
.deploy-row .sum > div { flex: none; display: flex; flex-direction: column; gap: .45rem; white-space: nowrap; }
.deploy-row .sum b { font: 700 1.6rem/1 var(--f-txt); letter-spacing: .06em; text-transform: uppercase; }
.deploy-row .sum b small { font: 400 max(9px, 1rem)/1 var(--f-num); letter-spacing: .1em; color: var(--txt-3); margin-left: .35rem; }
/* a run alive behind the menu: RESUME is the primary (yellow) action, DEPLOY steps down to an outline until it asks to confirm */
.deploy-row.alive #b-resume { color: var(--k0); background: var(--yel); box-shadow: none; }
.deploy-row.alive #b-resume:hover { background: #fff36b; color: var(--k0); }
.deploy-row.alive #b-resume .key { background: var(--k0); color: var(--yel); }
.deploy-row.alive #b-start:not(.warn) { background: rgba(255, 255, 255, .03); color: var(--txt); box-shadow: inset 0 0 0 1px var(--ln); min-width: 18rem; font-size: 2.1rem; letter-spacing: .24em; }
.deploy-row.alive #b-start:not(.warn)::before { display: none; }
.deploy-row.alive #b-start:not(.warn):hover { color: var(--yel); box-shadow: inset 0 0 0 1px var(--yel); }
.deploy-row.alive #b-start:not(.warn) .key { background: var(--txt-3); color: var(--k0); }
/* mid-run menu: the Resume block takes the summary slot (the picks above already say nation + map); DEPLOY then asks to confirm */
.resume { flex: 1; display: flex; align-items: center; gap: 1rem; height: 4.8rem; padding: 0 .6rem 0 1rem; background: rgba(82, 216, 255, .06); box-shadow: inset 2px 0 0 var(--fr), inset 0 0 0 1px rgba(82, 216, 255, .25); white-space: nowrap; min-width: 0; }
.resume > div { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.resume .lbl { color: var(--fr); }
.resume b { font: 700 1.45rem/1 var(--f-txt); color: var(--txt); letter-spacing: .04em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; }
.resume .btn-2 { height: 3.4rem; flex: none; }
.resume .sp { flex: 1; }
.resume.warn { background: rgba(255, 154, 31, .08); box-shadow: inset 2px 0 0 var(--warn), inset 0 0 0 1px rgba(255, 154, 31, .35); }
.resume.warn .lbl { color: var(--warn); }

/* intel + field manual (menu right column, pause panel, F1 popup) */
.intel { padding: 1.1rem 1.3rem 1.2rem; }
.intel .kv3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: .9rem 0 .8rem; background: var(--ln-3); }
.intel .kv3 > div { background: var(--fill-solid); padding: .6rem .7rem .7rem; display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.intel .kv3 .v { font: 700 2.1rem/1 var(--f-txt); color: var(--txt); font-variant-numeric: tabular-nums; white-space: nowrap; }
.intel .kv3 .v small { font: 400 max(9px, .95rem)/1 var(--f-num); color: var(--txt-3); margin-left: .25rem; letter-spacing: .04em; }
.intel .kv3 .v.y { color: var(--yel); }
.intel p { margin: 0; font: 500 1.28rem/1.3 var(--f-txt); color: var(--txt-2); }
.intel p b { color: var(--txt); font-weight: 700; }
.manual { padding: 1.1rem 1.3rem 1.2rem; }
.manual .rows { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1.1rem; margin-top: .9rem; align-items: center; }
.manual .ks { display: flex; gap: .2rem; justify-content: flex-end; align-items: center; white-space: nowrap; }
.manual .ks .key { height: 1.75rem; min-width: 1.75rem; font-size: 1.02rem; }
.manual .ks i { font: 400 1rem/1 var(--f-num); color: var(--txt-3); font-style: normal; align-self: center; padding: 0 .1rem; }
.manual .ks i.w { color: var(--txt-2); letter-spacing: .1em; text-transform: uppercase; box-shadow: inset 0 0 0 1px var(--txt-3); padding: .3rem .4rem .28rem; }
.manual .d { font: 500 1.3rem/1.15 var(--f-txt); color: var(--txt-2); }
.manual .d b { color: var(--txt); font-weight: 700; }
.manual .hd .x-btn { order: 3; margin-left: .2rem; align-self: center; }

/* ═══ U4 · PAUSE (#pauseP, inside #hud): persistent dim + panel, driven by G.paused (not a fading banner) ═══ */
/* the card and the manual share one row track: equal heights, tops and bottoms aligned (the buttons sit at the card's foot) */
#hud .pause-wrap { position: fixed; inset: 0; z-index: 20; display: grid; grid-auto-flow: column; place-content: center; align-items: stretch; gap: 1.2rem; background: rgba(3, 5, 9, .62); pointer-events: auto; animation: scrIn .2s ease-out; }
.pause-card { width: 34rem; padding: 1.6rem 1.8rem 1.8rem; --cut: 1.4rem; display: flex; flex-direction: column; }
.pause-card .btns { margin-top: auto; padding-top: 1.4rem; }
.pause-card h2 { margin: 1rem 0 .3rem; font: 700 5rem/.9 var(--f-txt); letter-spacing: .2em; color: var(--yel); text-transform: uppercase; }
.pause-card .meta { font: 400 1.05rem/1.4 var(--f-num); letter-spacing: .1em; color: var(--txt-2); text-transform: uppercase; white-space: nowrap; }
.pause-card .meta b { color: var(--txt); font-weight: 400; }
.pause-card .btns { display: flex; flex-direction: column; gap: .5rem; }
.pause-card .btns .btn-big { min-width: 0; width: 100%; height: 4.8rem; font-size: 2.2rem; letter-spacing: .24em; }
.pause-card .btns .btn-2 { width: 100%; justify-content: space-between; }
.pause-card .btns .btn-2.ghost { justify-content: flex-start; }
.pause-wrap .manual { width: 36rem; }

/* F1 field manual in battle (#manualP): docked on the left in the comms-log slot (the camera centres on the ship, so a centred
   panel always covered it); the log steps aside while it is open and its lines come back on close. Click-through but its close button */
#manualP { position: absolute; left: var(--gap); top: 9.2rem; width: 36rem; z-index: 6; }
#hud:has(#manualP:not(.hidden)) #log { visibility: hidden; }
#hud #manualP { pointer-events: none; }
#hud #manualP .x-btn { pointer-events: auto; }
/* no orphan words in running text (text-wrap: pretty balances the last lines) */
.sl-f, .intel p, .manual .d, .fine, .lead-m, .end-card .lead, .nat-brief .tx, #help .s, .tip-card .call, .tip-card .dsc, .counter { text-wrap: pretty; }

/* ═══ U4 · AFTER-ACTION CARD (#end) ═════════════════════════════════════ */
.end-card { width: 68rem; max-width: 100%; padding: 1.6rem 2.2rem 1.8rem; --cut: 1.6rem; }
.end-card .top { display: flex; justify-content: space-between; align-items: center; gap: 2rem; font: 400 1.05rem/1 var(--f-num); letter-spacing: .2em; color: var(--txt-2); text-transform: uppercase; white-space: nowrap; }
.end-card .top .r { color: var(--txt-3); }
.end-card h1 { margin: 1.4rem 0 .4rem; font: 700 6.4rem/.9 var(--f-txt); letter-spacing: .12em; text-transform: uppercase; color: var(--hos); text-shadow: 0 0 2.4rem rgba(255, 59, 48, .3); white-space: nowrap; }
.end-card.win h1 { color: var(--yel); text-shadow: 0 0 2.4rem rgba(255, 232, 31, .3); }
.end-card .lead { font: 500 1.6rem/1.3 var(--f-txt); color: var(--txt-2); margin: 0; }
.end-card .lead b { color: var(--txt); font-weight: 700; }
.hero { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: end; margin-top: 1.6rem; padding: 1.2rem 1.3rem; background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--ln-2); }
.hero .val { font-size: 6rem; color: var(--txt); white-space: nowrap; }
.hero .val small { font-size: .3em; }
.hero .pips { margin: .9rem 0 0; }
.hero .pips i { height: 1rem; }
.hero .pips i.b { width: 1.1rem; height: 1.1rem; }
.hero .pips i.f { background: var(--hos); opacity: 1; box-shadow: 0 0 .5rem rgba(255, 59, 48, .7); }
.hero .pips i.bm { box-shadow: 0 0 0 1px var(--k0), 0 0 0 2.5px var(--yel); }
.hero .pips i.b.bm { box-shadow: inset 0 0 0 1.5px var(--hos), 0 0 0 1px var(--k0), 0 0 0 2.5px var(--yel); }
.pipl2 { display: flex; justify-content: space-between; gap: 1rem; margin-top: .4rem; font: 400 max(9px, .95rem)/1 var(--f-num); letter-spacing: .1em; color: var(--txt-3); white-space: nowrap; }
.pipl2 b { color: var(--yel); font-weight: 400; }
.hero .best { text-align: right; }
.hero .best .val { font-size: 3.8rem; color: var(--yel); }
.rec { display: inline-flex; align-items: center; font: 400 1rem/1 var(--f-num); letter-spacing: .16em; color: var(--k0); background: var(--yel); padding: .3rem .5rem; margin-bottom: .5rem; white-space: nowrap; }
.rec.no { background: none; color: var(--txt-2); box-shadow: inset 0 0 0 1px var(--txt-3); }
.kgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 1rem; background: var(--ln-3); box-shadow: 0 0 0 1px var(--ln-3); }
.kgrid > div { background: var(--fill-solid); padding: .85rem 1rem .9rem; display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.kgrid .val { font-size: 3rem; white-space: nowrap; }
.kgrid .val.y { color: var(--yel); }
.kgrid .val.r { color: var(--hos); }
.kgrid .val.t { font-size: 2.2rem; line-height: 1.05; letter-spacing: .04em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; }
.kgrid .val.t.sm { font-size: 1.6rem; line-height: 1.44; } /* same line box as the 2.2rem value */
.kgrid .sub { font: 400 max(9px, .95rem)/1.2 var(--f-num); letter-spacing: .06em; color: var(--txt-3); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kgrid .sub b { color: var(--txt-2); font-weight: 400; }
/* E1b · kills by source: one bar in the source colours (towers in their own colour), a legend of the top four, buildings downed and
   peak hostiles at the right; everything from UI.run (the view of G.stats) */
.kstrip { margin-top: 1rem; padding: .75rem 1rem .8rem; background: var(--fill-solid); box-shadow: 0 0 0 1px var(--ln-3); }
.kstrip .hd { display: flex; justify-content: space-between; align-items: baseline; gap: 1.2rem; white-space: nowrap; }
.kstrip .hd .r { display: flex; align-items: baseline; gap: .55rem; }
.kstrip .hd .r b { font: 400 1.3rem/1 var(--f-num); color: var(--txt); margin-right: .9rem; }
.kstrip .hd .r b:last-child { margin-right: 0; }
.kstrip .kb { display: flex; gap: 2px; height: .8rem; margin-top: .6rem; background: rgba(255, 255, 255, .04); clip-path: polygon(.5rem 0, 100% 0, 100% 100%, 0 100%, 0 .5rem); }
.kstrip .kb i { display: block; min-width: 3px; background: var(--c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.kstrip .kb i.fx, .kstrip .lg i.fx { background: repeating-linear-gradient(-45deg, var(--c) 0 .3rem, rgba(0, 0, 0, .55) .3rem .45rem), var(--c); }
.kstrip .kb.none { box-shadow: inset 0 0 0 1px var(--ln-3); }
.kstrip .lg { display: flex; flex-wrap: wrap; gap: .35rem 1.6rem; margin-top: .55rem; font: 400 max(9px, .95rem)/1.2 var(--f-num); letter-spacing: .08em; color: var(--txt-3); text-transform: uppercase; }
.kstrip .lg span { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
.kstrip .lg i { width: .75rem; height: .75rem; background: var(--c); }
.kstrip .lg i.o { background: none; box-shadow: inset 0 0 0 1px var(--txt-3); }
.kstrip .lg b { color: var(--txt-2); font-weight: 400; }
.end-btns { display: flex; align-items: center; gap: .8rem; margin-top: 1.6rem; }
.end-btns .sp { flex: 1; }
.end-btns .btn-big { min-width: 20rem; height: 4.8rem; font-size: 2.2rem; letter-spacing: .22em; }
.end-btns .btn-big.win { order: 5; }

/* ═══ U4 · ONBOARDING HINT (#help) ═══════════════════════════════════════
   Grid, not flex-with-gaps: the sentence is ONE text span with inline <b>/.key, so highlighted words never leave holes.
   Waves 1-3 only, one hint at a time; dismissed / learned hints are remembered (SAVE.tips in twtd3.save). It sits above
   the command bar (--hb is measured from #bar), and steps aside while #placing or a card tooltip shows.         */
#help { position: absolute; left: 50%; bottom: var(--hb, 10.6rem); transform: translateX(-50%); display: grid; grid-auto-flow: column; align-items: center; gap: .8rem; padding: .45rem .5rem .45rem .5rem; background: var(--plate); box-shadow: inset 0 0 0 1px var(--ln-3); white-space: nowrap; font: 500 1.35rem/1 var(--f-txt); color: var(--txt-2); letter-spacing: .02em; animation: hintIn .3s ease-out; }
@keyframes hintIn { from { opacity: 0; transform: translate(-50%, .5rem); } }
#help.off { visibility: hidden; }
#help .tip { font: 400 max(9px, .95rem)/1 var(--f-num); color: var(--k0); background: var(--amb); padding: .28rem .45rem .25rem; letter-spacing: .14em; }
#help { max-width: calc(100vw - 48.8rem); } /* clear of the #sel column (23rem) and the minimap on both sides; a longer tip wraps */
#help .s { white-space: normal; line-height: 1.3; }
#help .s b { color: var(--txt); font-weight: 700; }
#help .s .key, #help .s b, #help .s .sw { white-space: nowrap; }
#help .key { height: 1.55rem; min-width: 1.55rem; font-size: 1rem; vertical-align: .1rem; margin: 0 .1rem; }
#help .x { width: 2rem; height: 2rem; display: grid; place-items: center; color: var(--txt-3); box-shadow: inset 0 0 0 1px var(--ln-3); cursor: pointer; }
#help .x svg { width: .9rem; height: .9rem; display: block; }
#help .x:hover { color: var(--yel); box-shadow: inset 0 0 0 1px var(--yel); }
/* E1b · tipOnce tips (any wave, 6 s each, queued): the chip in the command amber, hostile red ('h') or hostile-air magenta ('air'),
   and a line along the bottom that drains while the tip is on screen (--tp, written by UI.hintTick) */
#help .tip.h { background: var(--hos); color: var(--k0); }
#help .tip.air { background: var(--hos-air); color: var(--k0); }
#help.tq::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--amb); opacity: .7; transform: scaleX(var(--tp, 1)); transform-origin: left center; }
