/* The screens outside the battle (src/main.js, ui/menu.js, ui/skirmish.js, ui/lobby.js, ui/replays.js, ui/settings.js,
   ui/commander_ui.js): the loading screen, the main menu - the brand (the logo of tools/logo/build.py and the byline),
   the rail of tabs on the left (Kampanie, Potyczka, Gra sieciowa, Powtórki, Ustawienia) with its foot (controls, test
   mode, the offline package, the version), the panels of the tabs, the faction window and the controls window - and the
   room, name, pause, settings and end screens. The battle's HUD, buttons, fields and dropdowns: style.css. */
:root { --menu-w: 1180px; --rail: 236px; --line: #2a2e33; --card: linear-gradient(#17191c, #0d0e10); }

/* ---------------- overlays: the screens over the game */
/* The backdrop's colours are variables, registered so a change glides (the menu tints them to the campaign shown -
   ui/campaign.js sets them on #screen-menu): the core of the glow, its middle, the grid floor's lines, the searchlights. */
@property --bg-core { syntax: '<color>'; inherits: true; initial-value: #44110b; }
@property --bg-mid { syntax: '<color>'; inherits: true; initial-value: #150706; }
@property --bg-line { syntax: '<color>'; inherits: true; initial-value: rgba(216, 58, 44, .4); }
@property --bg-beam { syntax: '<color>'; inherits: true; initial-value: rgba(255, 110, 70, .1); }
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: safe center; overflow-y: auto; padding: 16px 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 3px), radial-gradient(ellipse at 50% 38%, var(--bg-core) 0%, var(--bg-mid) 55%, #000 100%);
  transition: --bg-core .9s ease, --bg-mid .9s ease, --bg-line .9s ease, --bg-beam .9s ease; }
.overlay[hidden] { display: none; }
.overlay.dim { background: rgba(0, 0, 0, .72); backdrop-filter: blur(2px); }

/* ---------------- the brand: the logo - assets/logo.svg in the menu head, logo_hero.svg on the loading screen (both
   drawn by tools/logo/build.py, every letter a path) - and the byline under it, thin fading lines; a light shadow only
   (the user, 2026-10-20) */
.brand { display: flex; align-items: center; }
.logo { margin: 0; line-height: 0; }
.logo img { display: block; max-width: calc(100vw - 32px); height: auto; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .7)) drop-shadow(0 3px 4px rgba(0, 0, 0, .4)); }
#screen-loading .logo img { filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .7)) drop-shadow(0 4px 7px rgba(0, 0, 0, .4)); }
.byline { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0; font: 600 12px var(--font-d); font-stretch: semi-condensed;
  letter-spacing: 6px; text-transform: uppercase; color: #b9b2a6; text-shadow: 0 2px 0 #000; }
.byline::before, .byline::after { content: ''; width: 110px; height: 1px; background: linear-gradient(90deg, transparent, rgba(216, 58, 44, .85)); }
.byline::after { transform: scaleX(-1); }
#screen-loading { gap: 14px; }
#screen-loading .byline { margin-bottom: 12px; font-size: 14px; letter-spacing: 7px; }
#screen-loading .byline::before, #screen-loading .byline::after { width: 170px; }
#screen-loading .bar { width: min(886px, calc(100vw - 36px)); }
.bar { width: 320px; height: 10px; border: 1px solid #000; border-radius: 5px; background: #0a0b0c; box-shadow: 0 0 0 1px var(--metal), inset 0 1px 3px #000; overflow: hidden; }
#load-fill { height: 100%; width: 0; background: linear-gradient(90deg, #8a2218, var(--accent), var(--accent-hi)); box-shadow: 0 0 10px rgba(255, 90, 60, .6); transition: width .15s; }
#load-text { margin: 0; color: #b9b2a6; letter-spacing: 1px; }

/* ---------------- the main menu: backdrop, head, the rail and the panels */
/* (the scrollbar's room kept on both sides always: only the tall Campaigns tab scrolls - the panel no longer changes its
   width and place when the tabs switch) */
.overlay.menu { isolation: isolate; justify-content: flex-start; gap: 12px; padding: 10px 16px 20px; scrollbar-gutter: stable both-edges; }
.menu-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.menu-fx::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, transparent 35%, rgba(0, 0, 0, .75) 100%); }
.menu-fx .floor { position: absolute; left: -50%; right: -50%; bottom: -8%; height: 62%; transform-origin: 50% 100%; transform: perspective(420px) rotateX(62deg);
  -webkit-mask: linear-gradient(transparent, #000 45%); mask: linear-gradient(transparent, #000 45%); overflow: hidden; }
.menu-fx .floor::before { content: ''; position: absolute; left: 0; right: 0; top: -64px; bottom: 0; animation: grid-run 6s linear infinite;
  background: linear-gradient(var(--bg-line) 1px, transparent 1px) 0 0 / 64px 64px, linear-gradient(90deg, color-mix(in srgb, var(--bg-line) 75%, transparent) 1px, transparent 1px) 0 0 / 64px 64px; }
@keyframes grid-run { to { transform: translateY(64px); } }
.menu-fx .beam { position: absolute; left: 50%; top: -30%; width: 46vmax; height: 130vh; margin-left: -23vmax; transform-origin: 50% 0; opacity: .5;
  background: conic-gradient(from 168deg at 50% 0, transparent, var(--bg-beam) 10deg, color-mix(in srgb, var(--bg-beam) 50%, transparent) 14deg, transparent 24deg);
  animation: sweep 14s ease-in-out infinite alternate; }
.menu-fx .beam.b2 { animation-duration: 19s; animation-delay: -7s; opacity: .35; }
@keyframes sweep { from { transform: rotate(-28deg); } to { transform: rotate(28deg); } }
@media (prefers-reduced-motion: reduce) { .menu-fx .floor::before, .menu-fx .beam { animation: none; } }
.menu-head { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; max-width: var(--menu-w); padding-top: 2px; }
#lang-select-dd { position: absolute; top: 0; right: 0; width: auto; min-width: 128px; }
.menu-body { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: 16px; width: 100%; max-width: var(--menu-w); align-items: start; }
.rail { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; }
.rail > * { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 8px; border: 1px solid #000; border-radius: 5px;
  background: linear-gradient(180deg, rgba(32, 35, 39, .97), rgba(15, 17, 19, .97));
  box-shadow: 0 0 0 1px var(--metal), inset 0 1px 0 rgba(255, 255, 255, .07), 0 16px 44px rgba(0, 0, 0, .85); }
.tabs::before { content: ''; position: absolute; left: 14px; right: 14px; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
/* a tab: an icon (a mask in --ico), its name and a line about it; the chosen one in crimson with a gold edge */
.tabs button { display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; column-gap: 11px; align-items: center; min-height: 54px; padding: 8px 12px;
  text-align: left; letter-spacing: 0; border-color: transparent; border-radius: 4px; background: transparent; box-shadow: none; }
.tabs button::before { content: ''; grid-row: 1 / 3; width: 24px; height: 24px; background: #a8a194; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.tabs button span { font: 700 15px var(--font-d); font-stretch: semi-condensed; letter-spacing: 2.5px; text-transform: uppercase; color: #ece8df; }
.tabs button small { font: 11.5px/1.25 "Segoe UI", Tahoma, sans-serif; color: var(--t3); }
@media (hover: hover) { .tabs button:hover { background: linear-gradient(90deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); transform: none; } }
@media (hover: hover) { .tabs button:hover::before { background: var(--gold); } }
.tabs button.on { background: linear-gradient(90deg, #a23e2d, #5c1c14); border-color: #250705;
  box-shadow: inset 4px 0 0 var(--gold), inset 0 1px 0 rgba(255, 190, 170, .28), 0 0 12px rgba(216, 58, 44, .4); }
@media (hover: hover) { .tabs button.on:hover { background: linear-gradient(90deg, #a23e2d, #5c1c14); border-color: #250705;
  box-shadow: inset 4px 0 0 var(--gold), inset 0 1px 0 rgba(255, 190, 170, .28), 0 0 12px rgba(216, 58, 44, .4); } }
.tabs button.on::before { background: #fff; }
.tabs button.on span { color: #fff; }
.tabs button.on small { color: #f3cdc2; }
.tabs em.soon { grid-column: 2; justify-self: start; margin-top: 2px; padding: 1px 7px; border: 1px solid rgba(240, 200, 80, .45); border-radius: 9px;
  font: 600 9.5px var(--font-d); font-style: normal; letter-spacing: 1.4px; text-transform: uppercase; color: var(--gold); }
.tabs .on em.soon { border-color: rgba(255, 230, 180, .6); color: #ffe9a8; }
.nv-camp { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 2h2.4v20H4zm3.6 1.5H20l-3.4 5 3.4 5H7.6z'/%3E%3C/svg%3E"); }
.nv-sk { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zm0 2.6a6.4 6.4 0 1 1 0 12.8 6.4 6.4 0 0 1 0-12.8z'/%3E%3Cpath d='M10.9 1h2.2v5.2h-2.2zm0 16.8h2.2V23h-2.2zM1 10.9h5.2v2.2H1zm16.8 0H23v2.2h-5.2z'/%3E%3Ccircle cx='12' cy='12' r='2.6'/%3E%3C/svg%3E"); }
.nv-net { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm7.9 9h-3a15 15 0 0 0-1.3-5.4A8 8 0 0 1 19.9 11zM12 4c.9 1.2 1.8 3.6 2.1 7H9.9c.3-3.4 1.2-5.8 2.1-7zM4.1 11a8 8 0 0 1 4.3-5.4A15 15 0 0 0 7.1 11zm0 2h3a15 15 0 0 0 1.3 5.4A8 8 0 0 1 4.1 13zM12 20c-.9-1.2-1.8-3.6-2.1-7h4.2c-.3 3.4-1.2 5.8-2.1 7zm3.6-1.6a15 15 0 0 0 1.3-5.4h3a8 8 0 0 1-4.3 5.4z'/%3E%3C/svg%3E"); }
.nv-rp { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M2 4h20v16H2zm2.2 2.2v11.6h15.6V6.2zM9.5 8l6.5 4-6.5 4z'/%3E%3C/svg%3E"); }
.nv-set { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M10.3 2h3.4l.5 2.5 1.8.8 2.1-1.4 2.4 2.4-1.4 2.1.8 1.8 2.5.5v3.4l-2.5.5-.8 1.8 1.4 2.1-2.4 2.4-2.1-1.4-1.8.8-.5 2.5h-3.4l-.5-2.5-1.8-.8-2.1 1.4-2.4-2.4 1.4-2.1-.8-1.8L2 13.7v-3.4l2.5-.5.8-1.8-1.4-2.1 2.4-2.4 2.1 1.4 1.8-.8zM12 8.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7z'/%3E%3C/svg%3E"); }
.nv-keys { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M1 5h22v14H1zm2 2v10h18V7zm2 2h2v2H5zm4 0h2v2H9zm4 0h2v2h-2zm4 0h2v2h-2zM5 13h2v2H5zm4 0h6v2H9zm8 0h2v2h-2z'/%3E%3C/svg%3E"); }
.nv-test { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 1h6v1.5h-1v4l4.3 6.6A1.6 1.6 0 0 1 13 15.5H3a1.6 1.6 0 0 1-1.3-2.4L6 6.5v-4H5zm2.5 1.5v4.4L5.4 10h5.2L8.5 6.9V2.5z'/%3E%3C/svg%3E"); }
.nv-off { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M7 1h2v7.2l2.6-2.6 1.4 1.4L8 12 3 7l1.4-1.4L7 8.2zM2 13h12v2H2z'/%3E%3C/svg%3E"); }
.nv-cmdr { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4 4h8v8H4zm2 2v4h4V6zM6.5 0h1v3h-1zm2 0h1v3h-1zm-2 13h1v3h-1zm2 0h1v3h-1zM0 6.5h3v1H0zm0 2h3v1H0zm13-2h3v1h-3zm0 2h3v1h-3z'/%3E%3C/svg%3E"); }
/* the rail's foot: the controls window, test mode, the offline package (src/ui/offline_link.js) and the version */
.rail-foot button { display: flex; align-items: center; gap: 9px; padding: 7px 10px; text-align: left; letter-spacing: 1px; font-size: 12px; color: var(--t2);
  border-color: transparent; background: transparent; box-shadow: none; }
.rail-foot button::before { content: ''; flex: none; width: 16px; height: 16px; background: var(--gold); -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
@media (hover: hover) { .rail-foot button:hover { background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); transform: none; color: #fff; } }
.rail-foot .nv-off span { display: flex; flex-direction: column; gap: 1px; }
.rail-foot .nv-off small { font: 10px Consolas, monospace; letter-spacing: .5px; color: #a49a86; text-transform: none; }
.version { padding: 5px 10px 2px; font: 11px Consolas, monospace; color: var(--t4); letter-spacing: 1px; }

/* ---------------- panels */
.panel { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px 22px 20px; border: 1px solid #000; border-radius: 5px;
  background: linear-gradient(180deg, rgba(32, 35, 39, .97), rgba(15, 17, 19, .97));
  box-shadow: 0 0 0 1px var(--metal), inset 0 1px 0 rgba(255, 255, 255, .07), 0 16px 44px rgba(0, 0, 0, .85); }
.panel::before { content: ''; position: absolute; left: 14px; right: 14px; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.panels { min-width: 0; }
.panels > .panel { width: 100%; }
.panel.small { width: min(380px, calc(100vw - 32px)); }
.panel.wide { width: min(960px, calc(100vw - 32px)); }
/* (a panel's header, footer, cards, toggles, sliders, icon buttons: widgets.css) */
.cap { margin: 0; font: 600 11px var(--font-d); letter-spacing: 1.6px; text-transform: uppercase; color: var(--t3); }
.note { margin: 0; color: var(--t3); font-size: 12px; }
.note.dim { color: var(--t4); }
.note code { color: var(--gold); }
.error { margin: 0; color: #f77; font-weight: 600; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
label.row { color: var(--t2); font-size: 12px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; align-content: start; }
.grid label, .panel.small label { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--t3); font-size: 12px; }
.grid label { font: 600 11px var(--font-d); letter-spacing: 1.6px; text-transform: uppercase; }
.panel.small button { width: 100%; }
.panel.small .row button { width: auto; }

/* ---------------- Kampanie (step 28, src/ui/campaign.js): the carousel of the campaigns (campaign.css), the mission
   select, the briefing - and what to play meanwhile */
/* the art slot: a mission's picture when it exists, else its prompt (the user's wish) or a quiet caption */
.art { position: relative; overflow: hidden; border: 1px solid #000; border-radius: 3px; background: var(--card); box-shadow: 0 0 0 1px var(--line), inset 0 0 18px #000; }
.art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.art .soon, .art .prompt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 6px 10px; text-align: center;
  color: var(--t4); font: 600 10px var(--font-d); letter-spacing: 1.4px; text-transform: uppercase; }
.art .prompt { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 6px; padding: 10px 14px; text-align: left; letter-spacing: 0; text-transform: none; overflow-y: auto; }
.art .prompt b { font: 600 10px var(--font-d); letter-spacing: 1.4px; text-transform: uppercase; color: var(--gold); }
.art .prompt span { font: 11px/1.45 "Segoe UI", Tahoma, sans-serif; color: var(--t3); user-select: text; }
/* the mission select: the panel's second state (the list hidden) - campaign.css; the objectives known at the start drawn
   as in the briefing */
#panel-campaign.msn > .camp-list, #panel-campaign.msn > .ph { display: none; }
.msn-objs ul, .br-objs { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.msn-objs li, .br-objs li { position: relative; padding-left: 18px; color: var(--t2); font-size: 12.5px; line-height: 1.35; }
.msn-objs li::before, .br-objs li::before { content: ''; position: absolute; left: 2px; top: 6px; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); }
.msn-objs li.secondary, .br-objs li.secondary { color: var(--t3); }
.msn-objs li.secondary::before, .br-objs li.secondary::before { background: var(--t4); }
.msn-objs li small, .br-objs li small { display: block; margin-top: 1px; font-size: 11.5px; font-style: italic; color: var(--t3); }  /* an objective's tip (D34) */
.msn-objs li.step, .br-objs li.step { margin-top: -2px; padding-left: 32px; font-size: 11.5px; color: #c3bcad; }  /* its steps (D34) */
.msn-objs li.step::before, .br-objs li.step::before { left: 18px; top: 5px; width: 5px; height: 5px; background: none; border: 1px solid #a99f86; transform: none; }
/* (the briefing before a mission: screens.css) */

/* ---------------- Potyczka, Ustawienia, the keys' and the commander's windows: menu_opts.css (step 29 E5) */

/* ---------------- windows over the menu: the faction picker and the controls (src/ui/menu.js) */
.modal { position: fixed; inset: 0; z-index: 25; display: flex; align-items: safe center; justify-content: center; padding: 20px; overflow-y: auto;
  background: rgba(3, 2, 2, .78); backdrop-filter: blur(3px); animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal-box { width: min(1060px, 100%); animation: pop .18s ease-out; }
.modal-box.narrow { width: min(760px, 100%); }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.factions { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.faction { --fc: var(--gold); position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px 10px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 5px; cursor: pointer; text-align: center; outline: none;
  background: var(--card); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); transition: border-color .12s, box-shadow .12s, transform .12s; }
.faction::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--fc); opacity: .55; }
.faction:focus-visible { border-color: color-mix(in srgb, var(--fc) 70%, #000); transform: translateY(-2px);
  background: radial-gradient(ellipse at 50% 20%, color-mix(in srgb, var(--fc) 20%, transparent), transparent 70%), linear-gradient(#1b1d21, #0f1012);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .55), 0 0 14px color-mix(in srgb, var(--fc) 25%, transparent); }
@media (hover: hover) { .faction:hover { border-color: color-mix(in srgb, var(--fc) 70%, #000); transform: translateY(-2px);
  background: radial-gradient(ellipse at 50% 20%, color-mix(in srgb, var(--fc) 20%, transparent), transparent 70%), linear-gradient(#1b1d21, #0f1012);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .55), 0 0 14px color-mix(in srgb, var(--fc) 25%, transparent); } }
.faction small { color: var(--t3); font-size: 11px; line-height: 1.3; }
.faction input { display: none; }
.faction img { width: 54px; height: 54px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); transition: transform .15s; }
@media (hover: hover) { .faction:hover img { transform: scale(1.08); } }
.faction span { font: 600 15px var(--font-d); font-stretch: semi-condensed; letter-spacing: 1px; text-transform: uppercase; color: #ece8df; }
.faction:has(input:checked) { border-color: var(--gold); background: radial-gradient(ellipse at 50% 20%, rgba(240, 200, 80, .16), transparent 70%), linear-gradient(#241f12, #120f09);
  box-shadow: 0 0 14px rgba(240, 200, 80, .28), inset 0 0 0 1px rgba(240, 200, 80, .35); }
.faction:has(input:checked)::after { content: ''; position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg);
  box-shadow: 0 0 6px rgba(240, 200, 80, .8); }

/* ---------------- Gra sieciowa, the room, Powtórki, the pause, the briefing, the replay bar: screens.css (step 29 E5) */

/* ---------------- the end of a battle (src/ui/endscreen.js): the result in the header (gold for a win, crimson for a
   loss) with the battle's clock on the right, the sides' row, four counters as bars in the sides' colours; a mission
   puts its debriefing and the fate of every objective (cards) in the same frame (ui/campaign_brief.js) */
.panel.end { width: min(640px, calc(100vw - 32px)); gap: 14px; }
/* (the result in fixed colours: over a battle var(--gold) is the faction theme's accent - ui/themes.js) */
.panel.end[data-result=win] .ph h2 { color: #f0c850; text-shadow: 0 2px 0 #000, 0 0 22px rgba(240, 200, 80, .4); }
.panel.end[data-result=lose] .ph h2 { color: #ff6a55; text-shadow: 0 2px 0 #000, 0 0 22px rgba(216, 58, 44, .5); }
.panel.end[data-result=win]::before { background: linear-gradient(90deg, transparent, #f0c850, transparent); }
.panel.end[data-result=lose]::before { background: linear-gradient(90deg, transparent, #d83a2c, transparent); }
.ph .ph-clock { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; margin: 0; font: 700 26px/1 Consolas, monospace; color: var(--t1); letter-spacing: 1px; text-shadow: 0 2px 0 #000; }
.ph-clock small { font: 600 10px var(--font-d); letter-spacing: 1.6px; text-transform: uppercase; color: var(--t3); text-shadow: none; }
/* (one row of up to three sides, four as two rows of two - endscreen.js sets --n) */
#end-sides { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 8px; }
.es-side { --pc: var(--t3); min-width: 0; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; column-gap: 9px; align-items: center;
  padding: 7px 10px 7px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); box-shadow: inset 0 2px 0 var(--pc); }
.es-side img { grid-row: 1 / 3; width: 36px; height: 36px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .75)); }
.es-side > b, .es-side > small { grid-column: 2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.es-side > b { font: 700 13px var(--font-d); font-stretch: semi-condensed; letter-spacing: 1px; text-transform: uppercase; color: var(--pc); }
.es-side > small { font-size: 11px; color: var(--t3); }
.es-side em { grid-column: 3; grid-row: 1 / 3; display: flex; flex-direction: column; align-items: center; font: normal 600 9.5px var(--font-d); letter-spacing: 1.4px; color: var(--t3); }
.es-side em b { font: 700 17px/1.1 Consolas, monospace; letter-spacing: 0; color: var(--t1); }
.es-side.win { border-color: rgba(240, 200, 80, .55); box-shadow: inset 0 2px 0 var(--pc), 0 0 12px rgba(240, 200, 80, .16); }
.es-side.out img { opacity: .5; filter: grayscale(.7); }
#end-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 22px; }
#end-stats section { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.eb { --pc: var(--t3); display: grid; grid-template-columns: 18px minmax(0, 1fr) 62px; align-items: center; gap: 7px; }
.eb img { width: 18px; height: 18px; }
.eb span { text-align: right; font: 600 12.5px Consolas, monospace; color: var(--t2); font-variant-numeric: tabular-nums; }
.eb span.nd { grid-column: 2 / 4; text-align: left; font: italic 600 12px var(--font-d); letter-spacing: .3px; color: var(--t3); white-space: nowrap; }
/* (a mode of many sides - step 31 F0, up to 16: a wider window, four sides to a row, the counters in four columns) */
.panel.end:has(#end-sides.many) { width: min(900px, calc(100vw - 32px)); }
#end-sides.many { gap: 5px; }
#end-sides.many .es-side { grid-template-columns: 22px minmax(0, 1fr) auto; column-gap: 6px; padding: 4px 8px 4px 6px; }
#end-sides.many .es-side img { width: 22px; height: 22px; }
#end-sides.many .es-side > b { font-size: 11px; }
#end-sides.many .es-side > small { font-size: 10px; }
#end-stats.many { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; }
#end-stats.many section { gap: 2px; }
#end-stats.many .eb { grid-template-columns: 14px minmax(0, 1fr) 40px; gap: 4px; }
#end-stats.many .eb img { width: 14px; height: 14px; }
#end-stats.many .eb span { font-size: 11px; }
#end-note { color: var(--t2); }
#end-brief { color: var(--t2); font-size: 13px; line-height: 1.5; text-align: left; }
#end-objectives { display: flex; flex-direction: column; gap: 5px; }
#end-objectives .obj { flex-direction: row; align-items: baseline; gap: 9px; padding: 8px 12px; font-size: 12.5px; color: var(--t2); }
#end-objectives .obj i { flex: none; width: 14px; font: 700 13px var(--font-d); font-style: normal; text-align: center; color: var(--t3); }
#end-objectives .obj.secondary { color: var(--t3); }
#end-objectives .obj.done { border-color: rgba(159, 224, 122, .35); }
#end-objectives .obj.done i { color: #9fe07a; }
#end-objectives .obj.failed { border-color: rgba(255, 106, 85, .35); }
#end-objectives .obj.failed i { color: #ff6a55; }

/* ---------------- narrower screens: the rail becomes a strip of tabs over the panel */
@media (max-width: 1000px) {
  .menu-body { grid-template-columns: 1fr; }
  .rail { position: static; gap: 8px; }
  .tabs, .rail-foot { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .tabs button { flex: 1 1 auto; min-height: 0; grid-template-columns: 20px 1fr; column-gap: 8px; padding: 7px 12px; }
  .tabs button::before { width: 18px; height: 18px; }
  .tabs button small, .tabs em.soon { display: none; }
  .rail-foot .version { margin-left: auto; }
  .br-cols { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sk-cols, .net-cols, .set-row { grid-template-columns: 1fr; }
  .menu-head .logo img { width: 447px; }
}
@media (max-width: 820px) { #lang-select-dd { position: relative; align-self: flex-end; } }  /* (an iPad mini upright, 744: beside the logo it covered its end) */
