/* War of the East — BFME1-inspired theme layer (design canvas: "War of the North — Faction HUD", the game's former name).
   Menus and dialogs share a bronze-and-umber war-atlas look. The battle HUD (the BFME bottom-left cluster and its
   per-faction metals) lives in hud.css, loaded after this file. Loaded after style.css and fonts.css. */

:root {
  --brass: #c89a4e;
  --brass-light: #e8c27a;
  --pine: #3a2412;
  --slate: #150d0b;
  --ink: #0e0907;
  --bone: #efe3cc;
  --muted: #b9a383;
  --ember: #d9553a;
  --line: rgba(200, 154, 78, .34);
  --panel: rgba(24, 15, 11, .95);
  --display: "Cinzel", "Palatino Linotype", Georgia, serif;
  /* 1.06's APT screens set their words in Albertus MT (flared strokes, true lower case): not on the archives, commercial; Marcellus (OFL) is the closest free face with both */
  --apt-font: "Marcellus", "Palatino Linotype", Georgia, serif;
  --body: "Alegreya Sans", "Avenir Next", "Segoe UI", sans-serif;
}

body { font-size: 15px; }
h1, h2, h3 { letter-spacing: .02em; }
button { background: #1d120d; border-color: #6b4a2a; }
button:not(:disabled):hover { background-color: #2c1b11; border-color: var(--brass); }
.primary { background: #3a2412; border-color: #e0b565; color: #f7e3b4; box-shadow: inset 0 0 0 3px #3a2412, inset 0 0 0 4px #8a5f2c; }
.primary:not(:disabled):hover { background: #4a2e16; border-color: #f0c877; color: #fff0cc; box-shadow: inset 0 0 0 3px #4a2e16, inset 0 0 0 4px #a8753a; }
.primary:not(:disabled):active { background: #2c1b0e; }
.eyebrow { color: var(--brass-light); }

/* ---- Main menu: carved bronze column over the live dark-tower scene ---- */
#menu { background: linear-gradient(90deg, rgba(14, 8, 6, .97) 0%, rgba(20, 12, 9, .94) 30%, rgba(20, 12, 9, .55) 46%, rgba(20, 12, 9, 0) 62%); }
.menu-frame { border-color: rgba(200, 154, 78, .5); box-shadow: inset 0 0 0 5px rgba(14, 8, 6, .6), inset 0 0 0 6px rgba(92, 61, 33, .8); }
.menu-title { font-family: "Cinzel", serif; font-weight: 700; font-size: clamp(42px, 5.2vw, 82px); letter-spacing: .03em; line-height: .98; color: #f3e6c8; }
.menu-primary .icon, .mbtn.primary .icon { color: #f0c877; }
.menu-btns { margin-top: 22px; }
.menu-btns .mbtn { min-height: 54px; }
.menu-btns .menu-primary { min-height: 64px; }
.menu-title span:first-child { letter-spacing: .06em; color: var(--brass-light); }
.menu-sub { font-family: "Cinzel", serif; color: #d8c7a7; }
.mbtn { font-family: "Cinzel", serif; font-size: 17px; background: #1d120d; border: 1px solid #7a5530; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%); padding-left: 22px; padding-right: 22px; }
.mbtn small { font-family: var(--body); font-size: 12px; color: #c4ad8a; }
.mbtn:not(:disabled):hover { background: #2c1b11; border-color: #e0b565; }
.mbtn.primary, .menu-primary { background: #3a2412; border-color: #e0b565; color: #f7e3b4; }
.mbtn.primary small, .menu-primary small { color: #dcc293; }
.button-end { font-family: "Cinzel", serif; color: #8f7556; }

/* ---- Setup, dialogs, loading ---- */
.modal-card { background: #1a100c; border-color: #b8893f; box-shadow: inset 0 0 0 5px #1a100c, inset 0 0 0 6px #5c3d21, 0 20px 90px rgba(0, 0, 0, .6); }
.modal { background: rgba(10, 6, 4, .74); }
.toast-stack > .alert { background: #1a100c; border-color: #5c3d21; border-left-color: #b8893f; color: #efe0bd; }
.toast-stack > .alert.error { border-left-color: #c4532d; }
.fcard, .gcard, .frow > button, .genrow > button { background: #1d120d; border-color: #6b4a2a; }
.fcard.sel, .gcard.sel, .frow > button[aria-pressed="true"], .genrow > button[aria-pressed="true"] { border-color: #e8c27a; box-shadow: inset 0 0 0 1px #e8c27a; background: #2c1b11; }
#loading { background: #0e0907; }
.setup-launch { background: linear-gradient(180deg, rgba(21, 13, 11, 0), rgba(21, 13, 11, .97) 28%); }
#introGate { background: linear-gradient(0deg, rgba(8, 3, 2, .88), rgba(8, 3, 2, .12) 55%, rgba(8, 3, 2, .3)); }
.intro-title { font-family: "Cinzel", serif; font-weight: 700; }

/* Short desktop windows: scale the menu column by height so every entry (and the footer) fits */
.menu-title { font-size: clamp(40px, min(5.2vw, 9vh), 82px); }
@media (max-height: 960px) and (min-width: 701px) {
  .menu-content { padding-top: 4vh; }
  .menu-head > .eyebrow { margin-bottom: 10px; }
  .menu-sub { margin-top: 8px; font-size: 17px; }
  .title-rule { margin: 14px 0; }
  .menu-btns { margin-top: 14px; gap: 7px; }
  .menu-btns .mbtn { min-height: 46px; padding-top: 6px; padding-bottom: 6px; }
  .menu-btns .menu-primary { min-height: 54px; }
  .menu-extras .sound-toggle { margin-top: 6px; min-height: 36px; }
  .menu-saves { margin-top: 7px; }
  .menu-saves .mbtn { min-height: 40px; }
  .menu-foot { display: none; }
}
@media (max-height: 760px) and (min-width: 701px) {
  .menu-content { padding-top: 2vh; padding-bottom: 24px; }
  .menu-btns .mbtn { min-height: 42px; }
  .menu-btns .menu-primary { min-height: 50px; }
  .menu-saves .mbtn { min-height: 36px; }
}

.screen { background: linear-gradient(105deg, rgba(16, 10, 7, .98), rgba(24, 15, 10, .95) 65%, rgba(18, 11, 8, .88)); }
.primary .icon { color: #f0c877; }
.fcard .icon { color: var(--brass-light); fill: none; stroke: currentColor; }

/* ---- Conquest of the East: the strategic war map ---- */
.conquest-wrap { max-width: 1400px; }
.conquest-wrap .screen-header { flex-wrap: wrap; }
.conquest-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.war-map { margin: 0; padding: 8px; border: 1px solid #b8893f; background: #1a110c; box-shadow: inset 0 0 0 5px #1a110c, inset 0 0 0 6px #5c3d21; }
.war-map svg { display: block; width: 100%; height: auto; }
.war-map .region { cursor: pointer; }
.war-map .region:focus-visible { outline: none; }
.war-map .region:focus-visible .region-ring, .war-map .region.selected .region-ring { stroke: #fff3cf; stroke-width: 4; }
.war-map .region.attackable .region-pulse { animation: region-pulse 1.8s ease-in-out infinite; }
@keyframes region-pulse { 0%, 100% { opacity: .15; } 50% { opacity: .7; } }
.war-panel { padding: 18px; border: 1px solid #b8893f; background: #1a100c; box-shadow: inset 0 0 0 4px #1a100c, inset 0 0 0 5px #5c3d21; display: flex; flex-direction: column; gap: 14px; }
.war-panel h2 { margin: 0; font-size: 22px; }
.war-panel h3 { margin: 0; font-size: 15px; color: var(--brass-light); letter-spacing: .06em; }
.war-panel p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.war-panel .war-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.war-panel .war-facts dt { color: var(--muted); }
.war-panel .war-facts dd { margin: 0; color: var(--bone); }
.war-panel .army-list { display: flex; flex-wrap: wrap; gap: 6px; }
.war-panel .army-list span { padding: 3px 8px; border: 1px solid #6b4a2a; font-size: 12px; }
.war-panel .war-log { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
.war-panel .faction-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.war-panel .faction-pick button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px; min-height: 76px; text-align: left; font-size: 13px; }
.war-panel .faction-pick button .icon { width: 26px; height: 26px; color: var(--brass-light); }
.war-panel .faction-pick button[aria-pressed="true"] { border-color: #e8c27a; box-shadow: inset 0 0 0 1px #e8c27a; background: #2c1b11; }
.war-panel .war-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.war-panel .war-banner { padding: 10px 12px; border: 1px solid #e8c27a; color: #f7e3b4; font-family: var(--display); }
@media (max-width: 960px) { .conquest-body { grid-template-columns: 1fr; } }
/* Structure commands: demolish (armed = waiting for the confirming press), repair, rebuild, fortify */

/* ---- Multiplayer: war room (lobby), connection chip, banners ---- */
.mp-wrap { max-width: 980px; }
.mp-name { display: flex; flex-direction: column; gap: 8px; max-width: 320px; margin-bottom: 22px; color: var(--muted); font-size: 10px; letter-spacing: .06em; }
.mp-name input, .mp-code-field input { min-height: 46px; padding: 10px 12px; color: var(--bone); background: #1d120d; border: 1px solid #6b4a2a; font: 16px var(--body); }
.mp-name input:focus, .mp-code-field input:focus { outline: 2px solid #e8c27a; outline-offset: 1px; border-color: #e8c27a; }
.mp-entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mp-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px solid #6b4a2a; background: linear-gradient(160deg, #22150e, #160e0a); }
.mp-card h2 { margin: 0; font: 22px var(--display); color: #f1dcae; }
.mp-card > p, .mp-help { margin: 0; color: var(--muted); font-size: 12px; }
.mp-card label { color: var(--muted); font-size: 10px; letter-spacing: .06em; }
.mp-card .mbtn { margin-top: auto; }
.mp-code-field { display: flex; align-items: stretch; }
.mp-code-field > span { display: flex; align-items: center; padding: 0 10px; border: 1px solid #6b4a2a; border-right: 0; background: #2c1b11; color: #e0b565; font: 15px "Cinzel", var(--display); letter-spacing: .08em; }
.mp-code-field input { flex: 1; min-width: 0; font: 20px "Cinzel", var(--display); letter-spacing: .18em; text-transform: uppercase; }
.mp-status { min-height: 22px; margin-top: 16px; color: var(--muted); font-size: 12px; }
.mp-status.error { color: #f0a080; }
.mp-code-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding: 18px 20px; border: 1px solid #b8893f; background: linear-gradient(120deg, #2c1b11, #1a100c); box-shadow: inset 0 0 0 4px #1a100c, inset 0 0 0 5px #5c3d21; }
.mp-code-card strong { display: block; margin: 4px 0; font: clamp(28px, 6vw, 44px)/1.1 "Cinzel", var(--display); letter-spacing: .12em; color: #f7e3b4; user-select: all; }
.mp-share { display: flex; gap: 8px; flex-wrap: wrap; }
.mp-share .compact-btn { min-height: 44px; min-width: 76px; }
.mp-seats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.mp-seat { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 12px; align-items: center; min-height: 92px; padding: 14px 16px; border: 1px solid #6b4a2a; background: #1d120d; opacity: .75; }
.mp-seat.online { opacity: 1; }
.mp-seat.mine { border-color: #e8c27a; box-shadow: inset 0 3px #e8c27a; }
.mp-seat > .icon { grid-row: 1 / 4; width: 38px; height: 38px; color: var(--brass-light); fill: none; stroke: currentColor; }
.mp-seat-role { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #c4ad8a; }
.mp-seat strong { font: 19px var(--display); color: var(--bone); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-seat small { color: var(--muted); font-size: 11px; }
.mp-seat-state { position: absolute; top: 12px; right: 14px; font-size: 11px; color: #e0b565; }
.mp-seat:not(.online) .mp-seat-state { color: #a3978a; }
.mp-factions .fcard { display: flex; flex-direction: column; justify-content: flex-start; gap: 8px; min-height: 0; padding: 14px 12px; }
.mp-factions .fcard .icon { flex: 0 0 auto; margin: 0; }
.mp-factions .fcard strong, .mp-factions .fcard small { margin: 0; overflow-wrap: anywhere; }
#mpMaps .gcard { min-height: 0; }
.mp-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 14px 0 10px; }
/* The lobby's launch bar is part of the page flow (not the setup screen's sticky bar), so nothing slides under it. */
.setup-launch.mp-launch { position: static; flex-wrap: wrap; margin-top: 8px; padding: 18px 0 calc(8px + var(--safe-bottom)); background: none; box-shadow: none; }
.mp-launch > p { flex: 1 1 260px; margin: 0; }
.mp-actions { display: flex; align-items: center; gap: 18px; }
.mp-actions .text-btn { margin-top: 0; }
#mpGo { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 56px; min-width: 220px; padding: 14px 22px; font: 18px var(--display); }
#mpGo:disabled { opacity: .5; }
#mpGo.is-ready, #mpGo.is-ready:disabled { opacity: 1; cursor: default; background: #243a22; border-color: #8fc27a; color: #d7f0c4; }

.net-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 2px 9px; border: 1px solid var(--f-frame, #7a5530); font-size: 11px; color: #d9c6a1; white-space: nowrap; }
.net-chip i { width: 8px; height: 8px; border-radius: 50%; background: #8a8a8a; }
.net-chip[data-state="good"] i { background: #7fd08a; }
.net-chip[data-state="fair"] i { background: #e2c35a; }
.net-chip[data-state="poor"] i { background: #e8894f; }
.net-chip[data-state="down"] i { background: #d9523f; animation: net-blink 1s steps(2) infinite; }
@keyframes net-blink { 50% { opacity: .2; } }
.net-banner { position: absolute; top: calc(112px + var(--safe-top)); left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 12px; max-width: calc(100% - 28px); padding: 9px 16px; border: 1px solid #b8893f; background: rgba(26, 16, 12, .94); color: #f1dcae; font: 14px var(--display); box-shadow: 0 8px 30px rgba(0, 0, 0, .45); }
.net-banner .compact-btn { min-height: 34px; }
.net-debug { position: absolute; left: calc(var(--edge, 12px) + var(--safe-left, 0px)); bottom: calc(210px + var(--safe-bottom, 0px)); z-index: 6; margin: 0; padding: 6px 8px; background: rgba(0, 0, 0, .62); color: #cfe8c0; font: 10px/1.45 ui-monospace, Menlo, monospace; white-space: pre-wrap; pointer-events: none; max-width: min(520px, 90vw); }

@media (max-width: 700px) {
  .mp-entry-grid, .mp-seats { grid-template-columns: 1fr; }
  .mp-wrap .page-heading { margin: 18px 0; }
  .mp-wrap .page-heading h1 { font-size: 30px; }
  .mp-seat { min-height: 70px; padding: 10px 12px; }
  .mp-seat > .icon { width: 30px; height: 30px; }
  .mp-seat strong { font-size: 17px; }
  .mp-seats { gap: 8px; margin-bottom: 18px; }
  .mp-factions .fcard { flex-direction: row; align-items: center; gap: 10px; min-height: 56px; padding: 10px 12px; }
  .mp-factions .fcard .icon { width: 22px; height: 22px; }
  .mp-factions .fcard strong { font-size: 14px; line-height: 1.2; }
  #mpMaps .gcard { min-height: 0; padding: 12px 14px; }
  #mpMaps .gcard small { margin-top: 4px; }
  .mp-name { max-width: none; }
  .mp-code-card { flex-direction: column; align-items: stretch; }
  .mp-share .compact-btn { flex: 1; }
  .mp-factions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mp-factions .fcard small { display: none; }
  .mp-rules { grid-template-columns: 1fr; }
  .mp-launch { flex-direction: column; align-items: stretch; }
  .mp-actions { flex-direction: column-reverse; align-items: stretch; gap: 6px; width: 100%; }
  .mp-launch > p { flex-basis: auto; }
  #mpGo { width: 100%; min-width: 0; }
  #mpMaps { grid-template-columns: 1fr; }
  .net-banner { top: calc(96px + var(--safe-top)); font-size: 13px; }
  .net-chip { padding: 2px 6px; }
  .net-debug { bottom: calc(260px + var(--safe-bottom, 0px)); }
}

/* ---- Add to home screen: a full-width bronze row under Export/Import, and the themed help sheet (InstallUI.js) ---- */
.menu-install { width: min(360px, 100%); margin: 8px 0 4px; }
.menu-install .mbtn { width: 100%; justify-content: center; gap: 12px; min-height: 48px; padding-top: 7px; padding-bottom: 7px; font-size: 15px; letter-spacing: .05em; text-align: left; }
.menu-install .mbtn small { margin-top: 1px; font-size: 11px; letter-spacing: .02em; }
.menu-install .icon { width: 20px; height: 20px; color: #f0c877; }
.menu-offline { width: min(360px, 100%); margin: 2px 0 6px; font-size: 12px; letter-spacing: .03em; color: var(--muted, #a3ada0); text-align: center; }
.menu-offline small { display: block; margin-top: 2px; font-size: 10.5px; opacity: .8; }
.menu-offline.ready span { color: #b8d39a; }
.menu-offline small.music { opacity: .95; }
.menu-update { display: flex; align-items: center; justify-content: center; gap: 10px; width: min(360px, 100%); margin: 2px 0 6px; padding: 6px 8px 6px 12px; border: 1px solid #5c3d21; border-left: 2px solid #e0b565; background: #1a100c; color: #efe0bd; font-size: 12px; letter-spacing: .03em; }
.menu-update[hidden] { display: none; }
.menu-update .mbtn { min-height: 32px; padding: 4px 14px; font-size: 13px; }
.mp-status .mp-update { display: block; margin: 8px auto 0; min-height: 40px; padding: 6px 18px; }
.install-card { width: min(520px, 100%); padding-top: 26px; }
.install-card .screen-header { margin-bottom: 18px; padding-bottom: 14px; }
.install-card h1 { font-family: var(--display); font-size: clamp(24px, 3.4vw, 32px); letter-spacing: .01em; }
.install-steps { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.install-steps li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid #5c3d21; background: linear-gradient(100deg, #24160f, #1a100c); }
.install-glyph { position: relative; flex: 0 0 auto; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid #8a5f2c; border-radius: 12px; background: #2c1b11; color: #f0c877; }
.install-glyph-icon { width: 26px; height: 26px; }
.install-num { position: absolute; top: -8px; left: -8px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #b8893f; color: #1a100c; font: 700 11px/1 var(--body); }
.install-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.install-copy strong { color: var(--bone); font: 500 16px/1.3 var(--display); }
.install-copy small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.install-note { margin-top: 14px; padding-left: 12px; border-left: 2px solid var(--brass); color: var(--muted); font-size: 13px; line-height: 1.5; }
.install-note-strong { color: var(--bone); }
.install-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.install-actions .mbtn { min-height: 44px; min-width: 132px; justify-content: center; gap: 8px; padding: 8px 22px; font-size: 14px; }
.install-actions .install-glyph-icon { width: 18px; height: 18px; }
/* Real BFME1 assets (src/game/pack/PackUI.js) */
.pack-notice { margin-top: 14px; padding: 10px 12px; border: 1px solid #8a5f2c; background: #2c1b11; color: var(--bone); font-size: 13px; line-height: 1.5; }
.pack-status { margin: 16px 0 0; color: var(--bone); font-size: 15px; line-height: 1.45; }
.pack-detail { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.pack-detail:empty, .pack-result:empty { display: none; }
.pack-detail code { font-size: 12px; color: var(--bone); }
.pack-progress { margin-top: 14px; height: 8px; border: 1px solid #5c3d21; background: #1a100c; }
.pack-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8a5f2c, #f0c877); }
.pack-result { margin: 12px 0 0; padding-left: 12px; border-left: 2px solid var(--brass); color: var(--bone); font-size: 14px; line-height: 1.45; }
.pack-result.pack-error { border-left-color: #c0573a; color: #f2b8a2; }
.pack-how { margin-top: 18px; }
.pack-steps { margin: 18px 0 0; padding-left: 1.3em; font-size: 14px; line-height: 1.5; color: var(--ink-soft, inherit); }
.pack-steps li { margin-bottom: 6px; }
@media (max-width: 700px) {
  .menu-install { margin-top: 6px; }
  .menu-install .mbtn { min-height: 48px; padding-top: 4px; padding-bottom: 4px; }
  .install-steps li { padding: 10px 12px; gap: 12px; }
  .install-actions .mbtn { flex: 1 1 0; }
}
@media (max-height: 960px) and (min-width: 701px) {
  .menu-install { margin-top: 7px; }
  .menu-install .mbtn { min-height: 42px; padding-top: 4px; padding-bottom: 4px; }
}
/* The extra row costs ~45px; short windows (1366x768, 1280x720) win it back from the title block and gaps. */
@media (max-height: 800px) and (min-width: 701px) {
  .menu-title { font-size: clamp(40px, min(5.2vw, 8vh), 82px); }
  .menu-content .title-rule { margin: 12px 0 8px; }
  .menu-install { margin-top: 6px; }
  .menu-install .mbtn { min-height: 38px; font-size: 14px; }
  .menu-install .mbtn small { display: inline; margin-left: 8px; }
}
@media (max-height: 760px) and (min-width: 701px) {
  .menu-head > .eyebrow { margin-bottom: 6px; }
  .menu-sub { margin-top: 4px; }
  .menu-btns { gap: 5px; }
}
@media (orientation: landscape) and (max-height: 540px) {
  .menu-install { width: 100%; margin-top: 6px; }
  .menu-install .mbtn { min-height: 40px; }
  .menu-install .mbtn small { display: inline; margin-left: 8px; }
}

/* ---- Menu fit with the Multiplayer entry and the Add to home screen row (1440x900 … 1280x720, 390x844): the
   secondary entries drop their one-line descriptions on short windows and phones. ---- */
@media (max-height: 860px) and (min-width: 701px) {
  .menu-btns .mbtn:not(.menu-primary) small { display: none; }
  .menu-btns .mbtn:not(.menu-primary) { min-height: 44px; }
}
@media (max-height: 800px) and (min-width: 701px) {
  .menu-head > .eyebrow { margin-bottom: 4px; }
  .menu-btns { margin-top: 10px; gap: 5px; }
  .menu-btns .mbtn:not(.menu-primary) { min-height: 40px; }
}
@media (max-width: 700px) {
  .menu-content { padding-top: 26px; padding-bottom: 18px; }
  .menu-head > .eyebrow { margin-bottom: 10px; }
  .menu-title { font-size: clamp(40px, 10.5vw, 72px); }
  .menu-sub { font-size: 17px; }
  .menu-content .title-rule { margin: 12px 0 8px; }
  .menu-btns { margin-top: 14px; gap: 6px; }
  .menu-btns .mbtn:not(.menu-primary) small { display: none; }
  .menu-btns .mbtn:not(.menu-primary) { min-height: 48px; padding-top: 6px; padding-bottom: 6px; }
  .menu-btns .menu-primary { min-height: 62px; }
  .menu-foot { display: none; }
}
@media (max-height: 800px) and (min-width: 701px) {
  .menu-content { padding-bottom: 10px; }
}
@media (max-height: 760px) and (min-width: 701px) {
  .menu-content { padding-top: 1.5vh; padding-bottom: 6px; }
  .menu-title { font-size: clamp(36px, min(5vw, 7.6vh), 64px); }
  .menu-sub { font-size: 15px; }
  .menu-btns .menu-primary { min-height: 50px; padding-top: 4px; padding-bottom: 4px; }
}
@media (max-height: 960px) and (min-width: 701px) and (min-height: 861px) {
  .menu-content { padding-bottom: 12px; }
  .menu-btns { gap: 5px; }
}

/* ---- Notched phones and Home Screen apps: keep the war room inside the safe area (the battle HUD is in hud.css) ---- */
.mp-card, .mp-code-field { min-width: 0; }
.mp-code-field input { width: 100%; }
@media (max-width: 700px) {
  .mp-entry-grid, .mp-seats { grid-template-columns: minmax(0, 1fr); }
}

/* Random map card (ADR 006): a biome choice and an editable seed inside the map grid. */
.gcard.random-map { display: flex; flex-direction: column; gap: 9px; cursor: default; }
.random-map .random-pick { all: unset; display: block; cursor: pointer; }
.random-map .random-pick:disabled { cursor: default; }
.random-map .random-pick:focus-visible, .random-map .chip:focus-visible, .random-map .seed-input:focus-visible { outline: 2px solid #e8c27a; outline-offset: 2px; }
.random-map .biome-chips, .random-map .seed-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.random-map .chip { min-height: 30px; padding: 4px 10px; border: 1px solid #6b4a2a; background: #140c08; color: var(--bone); font: 12px/1.3 var(--body); cursor: pointer; }
.random-map .chip[aria-pressed="true"] { border-color: #e8c27a; color: #f3dca8; background: #2c1b11; }
.random-map .chip:disabled { opacity: .55; cursor: default; }
.random-map .seed-row label { display: flex; align-items: center; gap: 6px; color: var(--muted); font: 12px/1.3 var(--body); }
.random-map .seed-input { width: 11ch; min-height: 30px; padding: 3px 6px; background: #140c08; border: 1px solid #6b4a2a; color: var(--bone); font: 16px/1.2 var(--body); font-variant-numeric: tabular-nums; }

/* ---- Replays: the menu list (#replays) and the playback bar (#replayBar) ---- */
.replays-card { width: min(620px, 100%); }
.replay-list { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 8px; }
.replay-item { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .22); }
.replay-item h2 { margin: 0; font: 600 15px/1.3 var(--display); color: var(--bone); }
.replay-item p { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.replay-item .replay-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.replay-badge { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 3px; font: 600 11px/1.4 var(--body); vertical-align: 1px; }
.replay-badge.warn { background: rgba(182, 75, 56, .3); color: #f2b4a6; box-shadow: inset 0 0 0 1px var(--ember); }
.replay-badge.old, .replay-badge.imported { background: rgba(198, 166, 109, .14); color: var(--brass-light); box-shadow: inset 0 0 0 1px var(--line); }
.replay-status { min-height: 1.4em; color: var(--muted); font-size: 13px; }
.replay-bar { position: fixed; z-index: 20; top: calc(var(--safe-top) + 58px); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: rgba(12, 18, 15, .9); box-shadow: 0 0 0 1px var(--line), 0 6px 20px rgba(0, 0, 0, .5); color: var(--bone); font-size: 13px; }
.replay-bar .compact-btn { min-height: 34px; border: 1px solid var(--line); background: rgba(0, 0, 0, .35); }
.replay-bar .compact-btn[aria-pressed="true"] { border-color: var(--brass); color: var(--brass-light); }
.replay-speeds { display: flex; gap: 4px; }
.replay-bar input[type="range"] { width: min(260px, 60vw); accent-color: var(--brass); }
.replay-time { font: 13px/1 var(--mono); }
.replay-verdict { font-size: 12px; color: var(--muted); }
.replay-verdict.bad { color: #f2b4a6; }
.playtest-line { color: var(--muted); font-size: 12px; line-height: 1.5; }
@media (pointer: coarse) { .replay-bar .compact-btn, .replay-item .compact-btn { min-height: 44px; } }
@media (max-width: 520px) { .replay-item { grid-template-columns: 1fr; } .replay-item .replay-actions { justify-content: flex-start; } .replay-bar { top: calc(var(--safe-top) + 112px); padding: 6px 8px; gap: 6px; } .replay-bar .compact-btn { padding: 4px 9px; } }
