:root {
  --ink: #183027;
  --deep: #142820;
  --pine: #223d30;
  --moss: #4b6b4d;
  --paper: #e9e3d2;
  --cream: #f7f3e8;
  --gold: #ddbb75;
  --copper: #a85b39;
  --line: #b9beaa;
  --muted: #536457;
  --display: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --ui: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--ui);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; background: radial-gradient(circle at 88% 18%, #f6efd9 0, transparent 30%), linear-gradient(#e9e3d2, #dce3d4); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
button:focus-visible, a:focus-visible, input:focus-visible, canvas:focus-visible, .import-button:focus-within { outline: 3px solid var(--copper); outline-offset: 3px; }
a { color: inherit; }
.skip-link { position: absolute; z-index: 50; left: 12px; top: -60px; padding: 12px 16px; background: var(--gold); color: var(--deep); font-weight: 800; }
.skip-link:focus { top: 12px; }
.sr-only, .file-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px clamp(16px, 4vw, 60px); background: var(--deep); color: #f3ecd9; border-bottom: 1px solid #4b5949; }
.wordmark { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 700 23px/1 var(--display); letter-spacing: .11em; }
.wordmark small { display: block; margin-top: 5px; color: #c5d0ba; font: 800 9px/1.2 var(--ui); letter-spacing: .23em; }
.sigil { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid var(--gold); color: var(--gold); font: 700 24px var(--display); transform: rotate(-8deg); }
/* Brand lockup in the header (integration Stage 2). Keep the lockup at 112px wide or more; the subtitle stays outside its clear space. */
.wordmark .lockup { display: block; height: 34px; width: auto; flex: none; }
.wordmark small { margin-top: 0; padding-left: 12px; border-left: 1px solid #4b5949; }
@media (max-width: 560px) { .wordmark { gap: 10px; } .wordmark .lockup { height: 28px; } .wordmark small { padding-left: 10px; } }
.site-header nav { display: flex; gap: clamp(12px, 2vw, 28px); flex-wrap: wrap; }
.site-header nav a { color: #dce4d4; text-decoration: none; border-bottom: 1px solid #829a83; font-size: 12px; font-weight: 700; }

.cover { position: relative; isolation: isolate; min-height: clamp(330px, 37vw, 480px); overflow: hidden; color: #fff9e9; background: var(--pine); }
.cover > img { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 46%; filter: saturate(.84) contrast(1.06); }
.cover-shade { position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #10231df2 0%, #10231dce 29%, #10231d28 72%), linear-gradient(0deg, #10231d90, transparent 35%); }
.cover-copy { position: relative; max-width: 800px; padding: clamp(54px, 6vw, 86px) clamp(22px, 7vw, 110px) 80px; }
.kicker { margin: 0; color: var(--copper); font-size: 10px; font-weight: 900; letter-spacing: .2em; line-height: 1.4; }
.cover .kicker { color: #ecc98e; }
.cover h1 { margin: 15px 0 17px; font: 400 clamp(54px, 7.4vw, 105px)/.89 var(--display); letter-spacing: -.055em; }
.cover h1 em { color: #efd49a; font-weight: 400; }
.cover-copy > p:not(.kicker) { max-width: 420px; margin: 0; color: #ecebd8; font: 400 clamp(16px, 1.5vw, 20px)/1.42 var(--display); }
.jump { display: inline-flex; align-items: center; gap: 28px; margin-top: 24px; padding: 12px 17px; background: var(--gold); color: var(--deep); text-decoration: none; font-size: 12px; font-weight: 900; letter-spacing: .04em; }
.jump span { font-size: 18px; }
.cover-caption { position: absolute; right: 24px; bottom: 14px; margin: 0; color: #f2e8ce; font-size: 10px; letter-spacing: .04em; text-align: right; }

.match-section { max-width: 1530px; margin: auto; padding: 36px clamp(14px, 3vw, 54px) 68px; scroll-margin-top: 8px; }
.section-lead { display: flex; align-items: end; justify-content: space-between; gap: 36px; margin-bottom: 19px; }
.section-lead h2, .next-step h2 { margin: 8px 0 0; font: 400 clamp(32px, 3.7vw, 54px)/1.03 var(--display); letter-spacing: -.035em; }
.section-lead > p { max-width: 430px; margin: 0 0 2px; color: var(--muted); font-size: 13px; line-height: 1.52; }
.match-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(305px, .75fr); gap: clamp(12px, 1.5vw, 22px); align-items: start; }
.game-column { display: flex; flex-direction: column; min-width: 0; }
.match-hud { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: #50624d; border: 1px solid #50624d; }
.match-hud > div { min-width: 0; padding: 8px 14px 7px; background: var(--pine); color: #f6eedb; }
.match-hud small, .readout small { display: block; color: #bdcbb4; font-size: 9px; font-weight: 900; letter-spacing: .15em; }
.match-hud strong { display: block; margin: 3px 0 6px; font: 400 24px/1 var(--display); font-variant-numeric: tabular-nums; }
.meter { height: 4px; overflow: hidden; background: #536b57; }
.meter > span { display: block; width: 100%; height: 100%; background: #e09b76; transition: width .2s; }
.meter.supply > span { background: #ebc579; }
.meter.wave > span { background: #a4cf9e; }
.match-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 0; }
.match-actions button { flex: 0 1 auto; min-width: 82px; }
.match-actions #start { min-width: 128px; }
.save-indicator { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; padding: 5px 8px; color: var(--moss); border: 1px solid var(--line); font-size: 10px; font-weight: 900; letter-spacing: .04em; }
.save-indicator::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--moss); }
.campaign-track { display: flex; align-items: center; gap: 14px; min-height: 34px; padding: 5px 11px; color: #e8d9b6; background: #304937; border: 1px solid #617356; border-bottom: 0; }
.campaign-track-label, .campaign-track-end { flex: none; font-size: 9px; font-weight: 900; letter-spacing: .13em; white-space: nowrap; }
.campaign-track-end { color: #bbccb3; }
.campaign-track ol { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); flex: 1; gap: 5px; margin: 0; padding: 0; list-style: none; }
.campaign-track li { min-width: 0; padding: 3px 1px; color: #f4e1b9; border-top: 2px solid #d8b878; font-size: 9px; font-weight: 900; line-height: 1; text-align: center; }
.stage-frame { position: relative; display: grid; justify-items: center; padding: 8px; background: radial-gradient(ellipse at 48% 42%, #345146, #152a23 72%); border: 1px solid #526950; box-shadow: 0 17px 35px #25392c32; }
.field-ground { position: absolute; z-index: 2; bottom: 10px; left: 50%; transform: translateX(-50%); max-width: 90%; padding: .45rem .7rem; margin: 0; border-radius: 8px; border: 1px solid #a78b58; color: #fff1d1; background: #182f26ed; font-size: .8rem; font-weight: 700; pointer-events: none; }
.field-construction { display: grid; gap: .35rem; margin-top: .3rem; }
.field-construction button { min-height: 44px; }
#site-details p { margin: .15rem 0 .4rem; font-size: .8rem; }
.site-actions { display: grid; grid-template-columns: auto auto minmax(0,1fr); gap: .35rem; }
@media(max-width: 720px) {
  #play[data-mobile-view="map"] { --mx-phone-map-dock: min(37dvh, 238px); }
  #play[data-mobile-view="map"][data-survey="true"] { --mx-phone-map-dock: min(48dvh, 318px); }
}
.stage-top, .stage-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 27px; padding: 5px 7px; color: #e2e7d4; font-size: 10px; font-weight: 900; letter-spacing: .13em; }
.stage-top { background: #10221ce8; border-bottom: 1px solid #385647; }
.stage-status, .stage-clock { display: inline-flex; align-items: center; gap: 8px; }
.pan-hint { color: #d4bb84; font-size: 9px; white-space: nowrap; }
.stage-clock-label { color: #a7baa5; font-size: 8px; }
#clock { color: #f0d394; font-variant-numeric: tabular-nums; font-size: 13px; }
.stage-bottom { color: #c4d1bd; background: #10221ce8; border-top: 1px solid #385647; font-size: 9px; }
.stage-bottom b { margin-inline: 4px; color: #b8955f; }
.signal, .feed-pulse { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #df9b62; box-shadow: 0 0 0 4px #df9b6230; }
#battlefield { display: block; width: min(100%, 480px); height: auto; aspect-ratio: 3 / 5; touch-action: none; background: #1b332b; box-shadow: 0 0 0 1px #d5c08b, 0 14px 28px #071910a3; cursor: grab; }
#battlefield:active { cursor: grabbing; }
.world-controls { padding: 10px 12px 12px; color: #e8eddf; background: #233d30; border: 1px solid #526950; border-top: 0; }
.control-head { display: flex; justify-content: space-between; gap: 12px; color: #d5decb; font-size: 10px; font-weight: 900; letter-spacing: .04em; }
.control-head output { color: var(--gold); font-variant-numeric: tabular-nums; }
.road-range { display: flex; align-items: center; gap: 10px; margin: 7px 0 10px; }
.road-range span { color: #d4bb84; font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.world-controls input { display: block; flex: 1; width: 100%; min-width: 0; margin: 0; accent-color: var(--gold); }
.map-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.world-controls button { width: 100%; }
.command-strip { position: sticky; z-index: 5; bottom: 8px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 8px; padding: 7px; background: #c9c9af; border: 1px solid #9da78d; box-shadow: 0 8px 20px #162b2052; }
.command-strip button { min-width: 0; min-height: 78px; padding: 9px 12px; text-align: left; color: var(--ink); background: #f5ebd3; border: 1px solid #b6a98a; transition: background .15s, transform .15s; }
.command-strip button:hover:not(:disabled) { background: #fff5db; transform: translateY(-2px); }
.command-strip button:disabled { opacity: 1; color: #5f6b5d; background: #dcdccd; border-color: #aeb5a4; }
.command-strip button:disabled .command-num, .command-strip button:disabled small { color: #687568; }
.command-strip button[aria-pressed="true"], .command-strip button.is-active { color: #fff7e6; background: var(--pine); border-color: var(--gold); }
.command-strip button[aria-pressed="true"] :is(.command-num, small), .command-strip button.is-active :is(.command-num, small) { color: #ebd29c; }
.command-strip .wave-command:not(:disabled) { color: #fff7e6; background: #8f4c30; border-color: #713a28; }
.command-strip .wave-command:not(:disabled) :is(.command-num, small) { color: #f2d6a0; }
.command-strip .wave-command:hover:not(:disabled) { background: #aa5b37; }
.command-strip strong, .command-strip small, .command-num { display: block; }
#play .command-strip [hidden] { display: none !important; }
.command-num { color: #955333; font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.command-strip strong { margin: 5px 0 2px; font: 400 clamp(15px, 1.45vw, 19px)/1.08 var(--display); }
.command-strip small { color: #576452; font-size: 10px; font-weight: 800; }

.command-desk { min-width: 0; background: var(--cream); border: 1px solid var(--line); box-shadow: 0 12px 30px #223a2b1c; }
.desk-title { position: relative; isolation: isolate; overflow: hidden; min-height: 190px; padding: 23px 24px 20px; color: #f7f2df; background: var(--deep); border-bottom: 1px solid #55664f; }
.desk-title::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #13271fef, #13271fc4 59%, #13271f78), url("../assets/concepts/mythox-world-slice-higgsfield.png") center 58% / cover; filter: saturate(.77); }
.desk-title .kicker { color: #e2c68f; }
.desk-title h3 { margin: 10px 0 8px; font: 400 clamp(29px, 2.7vw, 39px)/.98 var(--display); letter-spacing: -.035em; }
.desk-title p:last-child { max-width: 390px; margin: 0; color: #e1e7d7; font-size: 12px; line-height: 1.5; }
.match-actions button, .world-controls button, .desk-footer button, .import-button { display: inline-grid; place-items: center; min-height: 42px; padding: 9px 10px; color: var(--ink); background: #e8eddf; border: 1px solid #9da993; font-size: 11px; font-weight: 900; line-height: 1.1; text-align: center; }
.match-actions #start { color: #fff8e9; background: var(--moss); border-color: var(--moss); }
.match-actions button:hover:not(:disabled), .world-controls button:hover, .desk-footer button:hover, .import-button:hover { background: #fff3d3; }
.battle-brief { display: grid; grid-template-columns: minmax(115px, .7fr) minmax(0, 1.3fr); gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.brief-card { display: flex; flex-direction: column; min-width: 0; min-height: 98px; padding: 12px 13px; color: var(--cream); background: var(--pine); border-left: 3px solid var(--gold); }
.brief-card small { color: #e5d3a8; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.brief-card strong { display: block; margin: 7px 0 3px; font: 400 25px/1.05 var(--display); overflow-wrap: anywhere; }
.brief-card span { margin-top: auto; color: #d7e1d2; font-size: 10px; line-height: 1.3; }
.wave-brief { background: #e3e9d9; color: var(--ink); border-left-color: var(--moss); }
.wave-brief small { color: var(--moss); }
.wave-brief strong { font-size: 18px; line-height: 1.1; }
.wave-brief span { color: var(--muted); }
.readout { margin: 14px 20px; padding: 13px 14px; background: #e1e8d9; border-left: 3px solid #789077; }
.readout small { color: var(--moss); }
.readout strong { display: block; margin: 5px 0; font: 400 21px/1.15 var(--display); }
.readout p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.feed { margin: 14px 20px 16px; border-top: 2px solid var(--moss); }
.feed-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 0 8px; }
.feed-head .kicker { color: var(--moss); }
.feed-head span:not(.feed-pulse) { display: block; margin-top: 2px; color: #6e806e; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.feed ol { max-height: 255px; min-height: 70px; margin: 0; padding: 0; overflow: auto; list-style: none; scrollbar-color: #a3b29e transparent; }
.feed li { display: grid; grid-template-columns: 40px 1fr; gap: 9px; padding: 9px 0; border-top: 1px solid #d4dbce; font-size: 12px; line-height: 1.36; }
.feed time { color: #976449; font-size: 10px; font-weight: 900; font-variant-numeric: tabular-nums; }
.feed li.urgent { color: #973f35; }
.feed li.good { color: #336946; }
.desk-footer { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 20px 20px; }
.import-button { position: relative; cursor: pointer; }
.desk-footer p { width: 100%; margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.42; }
.next-step { max-width: 1530px; margin: auto; padding: 44px clamp(14px, 3vw, 54px) 80px; border-top: 1px solid var(--line); }
.next-step p:not(.kicker) { max-width: 690px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.next-step a { display: inline-block; margin-top: 10px; padding-bottom: 5px; color: var(--moss); border-bottom: 1px solid var(--moss); text-decoration: none; font-size: 12px; font-weight: 900; }

@media (max-width: 980px) {
  .match-layout { grid-template-columns: 1fr; }
  .game-column, .command-desk { width: 100%; max-width: 690px; margin-inline: auto; }
  .section-lead { display: block; }
  .section-lead > p { margin-top: 9px; }
  .desk-title { min-height: 160px; }
}
@media (max-width: 700px) {
  body { padding-bottom: calc(145px + env(safe-area-inset-bottom)); }
  .site-header { padding: 10px 14px; }
  .wordmark { font-size: 18px; }
  .wordmark small { font-size: 8px; }
  .sigil { width: 34px; height: 34px; font-size: 21px; }
  .site-header nav { gap: 10px; }
  .site-header nav a { font-size: 10px; }
  .cover { min-height: 305px; }
  .cover-shade { background: linear-gradient(90deg, #10231df5, #10231db2 55%, #10231d38), linear-gradient(0deg, #10231d80, transparent); }
  .cover-copy { padding: 48px 19px 64px; }
  .cover h1 { font-size: clamp(51px, 12vw, 72px); }
  .cover-copy > p:not(.kicker) { max-width: 330px; font-size: 16px; }
  .cover-caption { left: 19px; right: 19px; font-size: 9px; text-align: left; }
  .match-section { padding: 25px 9px 46px; }
  .section-lead { padding: 0 6px; }
  .section-lead h2 { font-size: 34px; }
  .section-lead > p { font-size: 12px; }
  .match-hud > div { padding: 9px; }
  .match-hud small { font-size: 8px; letter-spacing: .08em; }
  .match-hud strong { font-size: 22px; }
  .stage-frame { padding: 5px; }
  .stage-top, .stage-bottom { font-size: 8px; min-height: 24px; }
  .stage-clock-label { display: none; }
  #battlefield { width: min(100%, calc(70svh * .6)); }
  .command-strip { position: fixed; right: 0; bottom: 0; left: 0; gap: 5px; margin: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-width: 1px 0 0; background: #d8d2bb; box-shadow: 0 -6px 22px #14282054; }
  .command-strip button { min-height: 62px; padding: 6px; }
  .command-num { font-size: 7px; letter-spacing: .05em; }
  .command-strip strong { margin: 4px 0 2px; font-size: clamp(13px, 3.5vw, 17px); }
  .command-strip small { font-size: 9px; }
  .command-desk { margin-top: 14px; }
  .desk-title { min-height: 150px; padding: 18px; }
  .desk-title h3 { font-size: 31px; }
  .match-actions, .world-controls { padding-inline: 15px; }
  .battle-brief { padding-inline: 15px; }
  .readout, .feed { margin-inline: 15px; }
  .desk-footer { padding-inline: 15px; }
}
@media (max-width: 380px) {
  .site-header { align-items: flex-start; flex-direction: column; gap: 8px; }
  .match-actions { grid-template-columns: 1.2fr 1fr 1fr; gap: 4px; }
  .match-actions button { padding-inline: 4px; font-size: 10px; }
  .stage-bottom { letter-spacing: .05em; }
}
@media (max-height: 600px) and (orientation: landscape) and (max-width: 1100px) {
  body { padding-bottom: calc(126px + env(safe-area-inset-bottom)); }
  .cover { min-height: 250px; }
  .cover-copy { padding-block: 29px 45px; }
  .cover h1 { font-size: 53px; }
  .match-section { padding-top: 15px; }
  .section-lead { margin-bottom: 10px; }
  .section-lead h2 { font-size: 26px; }
  .section-lead > p { max-width: none; margin-top: 4px; font-size: 11px; }
  .game-column { display: grid; grid-template-columns: minmax(0, 1fr) minmax(155px, .8fr); grid-template-areas: "stage hud"; align-items: start; gap: 10px; max-width: 780px; }
  .stage-frame { grid-area: stage; justify-self: center; width: fit-content; margin-top: 0; }
  .match-hud { grid-area: hud; grid-template-columns: 1fr; gap: 5px; border: 0; background: transparent; }
  .match-hud > div { padding: 7px 11px; border: 1px solid #50624d; }
  .match-hud strong { margin: 2px 0 4px; font-size: 20px; }
  #battlefield { width: min(100%, calc((100svh - 96px) * .6)); }
  .command-strip { position: fixed; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: none; margin: 0; padding: 5px 8px calc(5px + env(safe-area-inset-bottom)); border-width: 1px 0 0; background: #d8d2bb; }
  .command-strip button { min-height: 54px; padding: 5px 10px; }
  .command-strip strong { margin: 2px 0 0; font-size: 15px; }
  .command-strip small { font-size: 9px; }
  .command-desk { max-width: 780px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .meter > span, .command-strip button { transition: none; }
}
