:root {
  color-scheme: dark;
  font: 16px/1.45 "Segoe UI", system-ui, sans-serif;
  --canvas: #101e31;
  --panel: #192a3b;
  --raised: #263b50;
  --border: #394e63;
  --type: #f5f5ee;
  --muted: #bacbd4;
  --signal: #ffca68;
  --army: #ffca68;
  --army-dark: #4d412c;
  --gold: #ffca68;
  --mint: #9bdac0;
  --dock-height: 4.75rem;
  --bottom-safe: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px));
  background: var(--canvas);
  color: var(--type);
}
[data-army="beacon"] { --army: #a2dcff; --army-dark: #204667; }
[data-army="watch"] { --army: #ffcf6c; --army-dark: #55432a; }
[data-army="caravan"] { --army: #c2c7ff; --army-dark: #394569; }
[data-army="ru"] { --army: #c5d8ff; --army-dark: #364467; }
[data-army="ua"] { --army: #ffde78; --army-dark: #29485a; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 75% -22%, #304c6d, transparent 52rem), var(--canvas);
}
.shell { width: min(calc(100% - 2rem), 62rem); margin-inline: auto; }
.topbar { background: var(--canvas); border-bottom: 1px solid #2d424b; }
.header {
  display: flex; align-items: center; gap: .65rem; min-height: 3.65rem;
  padding-block: max(.48rem, env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px)) .48rem;
}
.brand { font-size: 1.05rem; font-weight: 800; letter-spacing: -.035em; white-space: nowrap; }
.brand-mark {
  display: grid; align-content: center; justify-items: center; gap: .14rem;
  flex: 0 0 1.85rem; height: 1.88rem; padding-bottom: .15rem;
  background: var(--army); clip-path: polygon(0 0,100% 0,100% 66%,50% 100%,0 66%);
}
.brand-mark i { width: 1rem; height: .32rem; background: #1a292e; clip-path: polygon(50% 0,100% 50%,100% 100%,50% 55%,0 100%,0 50%); }
.army-mark { margin-left: auto; display: inline-flex; align-items: center; gap: .48rem; font-size: .86rem; font-weight: 650; color: var(--type); }
.header .quiet { margin-left: auto; }
main { padding-block: .9rem 1.5rem; }
body.docked main { padding-bottom: calc(var(--dock-height) + var(--bottom-safe) + 1.25rem); }
button, .link-button, input {
  min-width: 0; min-height: 2.8rem; font: inherit; padding: .6rem .82rem;
  border: 1px solid #48606a; border-radius: .6rem;
}
button, .link-button {
  color: var(--type); background: #263843; font-weight: 650; cursor: pointer;
  overflow-wrap: anywhere; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: border-color .14s ease, background-color .14s ease, transform .14s ease;
}
@media (hover: hover) { button:hover, .link-button:hover { background-color: #344a55; border-color: #9aa9a0; } }
button:active, .link-button:active { transform: translateY(1px); }
button:disabled { cursor: progress; opacity: .7; }
button.primary, .link-button { background: var(--gold); color: #222923; border: 1px solid #ffe0a4; box-shadow: 0 2px 0 #795d2f; }
button.primary:hover, .link-button:hover { background: #ffcf79; }
:focus-visible { outline: 3px solid #fff2ba; outline-offset: 2px; }
#scene-title:focus:not(:focus-visible) { outline: none; }
.quiet, .back { background: transparent; font-size: .85rem; }
.back { font-size: 1.7rem; width: 2.75rem; padding: 0; line-height: 1; color: var(--army); }
.link-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.status {
  display: grid; grid-template-columns: minmax(8rem,1.5fr) repeat(3,minmax(0,1fr));
  margin-bottom: .8rem; padding: .65rem 0; border: 1px solid var(--border); border-radius: .85rem;
  background: #18252f; font-variant-numeric: tabular-nums;
}
.status-summary, .stat { min-width: 0; display: grid; align-content: center; gap: .17rem; padding: 0 .83rem; }
.stat { border-left: 1px solid #34454e; grid-template-columns: 1fr; }
.status-summary { grid-template-columns: 1fr auto; align-items: baseline; }
.status-summary .stat-label, .status-summary .stat-value { grid-row: auto; }
.status-summary .stat-value { text-align: right; }
.stat-label { font-size: .75rem; color: var(--muted); }
.stat-value { font-size: .95rem; font-weight: 750; }
progress {
  width: 100%; height: .29rem; display: block; margin: .25rem 0 0; border: 0; overflow: hidden;
  appearance: none; color: var(--meter,var(--army)); background: #33454e; border-radius: 8px;
}
progress::-webkit-progress-bar { background: #33454e; border-radius: 8px; }
progress::-webkit-progress-value { background: var(--meter,var(--army)); border-radius: 8px; transition: width .25s ease; }
progress::-moz-progress-bar { background: var(--meter,var(--army)); border-radius: 8px; }
.status-summary progress { grid-column: 1/-1; --meter: #9bbddd; }
.stat-energy { --meter: #9fce98; } .stat-health { --meter: #eba694; } .stat-ammo { --meter: #efbf72; }
.status .status-summary { min-height: 0; text-align: left; background: none; border: 0; border-radius: 0; }
.status .status-summary:hover { background: #20333d; }
.stat-recovery { font-size: .7rem; color: var(--muted); white-space: nowrap; }

.scene, .panel { border: 1px solid var(--border); border-radius: 1rem; background: var(--panel); box-shadow: 0 .5rem 1.5rem #08131844; }
.scene { overflow: clip; }
.scene-intro {
  padding: clamp(1rem,4vw,1.7rem); position: relative; isolation: isolate;
  background: linear-gradient(100deg,#253740,#1d2d38); border-bottom: 1px solid #40545b;
}
.scene-intro.illustrated {
  display: grid; align-items: center; grid-template-columns: minmax(0,1fr) minmax(0,.9fr);
  gap: .75rem; min-height: 10.5rem; overflow: hidden;
  background:
    linear-gradient(110deg,#24343d 0%,#24343dbd 43%,transparent 78%),
    repeating-linear-gradient(0deg,transparent 0 23px,#c5d8c319 23px 24px),
    repeating-linear-gradient(90deg,transparent 0 23px,#c5d8c319 23px 24px),
    radial-gradient(ellipse at 82% 58%,var(--army-dark),#263b44 76%);
}
.scene-intro.illustrated::after {
  content: ""; position: absolute; z-index: -1; right: 6%; top: 50%; width: 34%; aspect-ratio: 1;
  transform: translateY(-50%); border: 1px dashed #b3c2b540; outline: 1px solid #b3c2b51e;
  outline-offset: 1.2rem; border-radius: 50%; pointer-events: none;
}
.scene-info { min-width: 0; }
h1,h2,p { margin: 0; }
h1,h2 { line-height: 1.08; overflow-wrap: anywhere; text-wrap: balance; }
h1 { font-weight: 840; letter-spacing: -.045em; font-size: clamp(1.65rem,4.5vw,2.9rem); }
h2 { font-size: clamp(1.13rem,3vw,1.5rem); letter-spacing: -.03em; }
.copy { margin-top: .65rem; color: #d9e2dc; line-height: 1.48; white-space: pre-line; overflow-wrap: anywhere; }
.copy:empty { display: none; }
.scene-art { display: block; min-width: 0; width: 100%; height: clamp(9rem,27vw,15rem); object-fit: contain; filter: drop-shadow(0 .45rem .35rem #0c172677); }
.scene[data-section="home"] .scene-intro.illustrated,
.scene[data-section="factions"] .scene-intro.illustrated,
.entry .scene-intro.illustrated { background-color: #34483e; }
.entry-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }
.scene-controls,.panel { padding: clamp(.8rem,2vw,1.3rem); }
.actions,.plain-actions { display: grid; gap: .6rem; }
.gallery { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .65rem; }
.scene:is([data-section="operations"],[data-section="home"]) .gallery { grid-template-columns: repeat(2,minmax(0,1fr)); }
.buttons { display: grid; gap: .5rem; grid-template-columns: minmax(0,1fr); }
.buttons.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.buttons.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
button.art-card {
  display: flex; flex-direction: column; align-items: stretch; position: relative; isolation: isolate; overflow: hidden;
  padding: 0; text-align: left; border-radius: .75rem; border-color: #435961;
  background: radial-gradient(ellipse at 64% 15%,#34494c,transparent 78%),#21323c;
}
@media (hover:hover) {
  button.art-card:hover { transform: translateY(-2px); border-color: var(--army); background-color: #29404b; }
  button.art-card:hover img { transform: translateY(-2px) scale(1.035); }
}
.art-window { position: relative; display: grid; place-items: center; width: 100%; min-width: 0; height: clamp(6.5rem,16vw,10.5rem); padding: .6rem .7rem 0; }
.art-window img { width: 100%; height: 100%; min-height: 0; object-fit: contain; filter: drop-shadow(0 .22rem .2rem #0b172699); transition: transform .2s ease-out; }
.art-description { display: grid; gap: .28rem; width: 100%; padding: .65rem .8rem .85rem; }
.art-title { font-size: 1.07rem; font-weight: 800; line-height: 1.15; }
.art-summary { font-size: .87rem; font-weight: 400; line-height: 1.36; color: #bfcdca; }
.art-detail { font-size: .8rem; color: var(--army); font-weight: 700; }
.art-card.is-locked img { opacity: .66; }
.art-card.is-locked .art-detail { color: #e3b88a; }
.lock { position: absolute; right: .7rem; top: .87rem; width: .67rem; height: .54rem; background: #d8c4a5; border-radius: 2px; }
.lock::before { content: ""; position: absolute; left: .1rem; bottom: .3rem; width: .3rem; height: .42rem; border: 1.5px solid #d8c4a5; border-radius: 5px 5px 0 0; }
.stars { position: absolute; left: .45rem; top: .4rem; padding: .06rem .32rem; border: 1px solid #667260; border-radius: 1rem; color: var(--gold); background: #1b2a32ed; font-size: .73rem; letter-spacing: .08em; }
.art-card[data-army] { border-top: 3px solid var(--army); background: linear-gradient(165deg,var(--army-dark),#233640 70%); }
.art-card[data-army] .art-detail { color: var(--army); }
.scene[data-section="home"] .art-card {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: center;
}
.scene[data-section="home"] .art-window { grid-column: 2; grid-row: 1; height: clamp(5.1rem,11vw,7.4rem); padding: .35rem; }
.scene[data-section="home"] .art-description { grid-column: 1; grid-row: 1; }

.objective {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .85rem;
  padding: 1rem; border: 1px solid #667352; border-left: 3px solid var(--army);
  border-radius: .7rem; background: linear-gradient(110deg,var(--army-dark),#243740 85%);
}
.objective-content { flex: 1; min-width: 0; }
.objective-label { font-weight: 700; font-size: .76rem; margin-bottom: .35rem; color: var(--army); }
#objective-detail { margin-top: .32rem; font-size: .87rem; color: #d3ded7; }
#objective-progress { max-width: 19rem; margin-top: .55rem; }
.objective button { flex: none; max-width: 47%; }
.objective:has(.objective-art:not([hidden])) { position: relative; display: grid; grid-template-columns: minmax(0,1.5fr) minmax(7rem,1fr); gap: .6rem .9rem; }
.objective-art { grid-column: 2; grid-row: 1/3; width: 100%; max-height: 9rem; object-fit: contain; }
.objective:has(.objective-art:not([hidden])) button { grid-column: 1; grid-row: 2; justify-self: start; max-width: 100%; }
.unit-stats,.battle-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .45rem; }
.unit-stats { margin-bottom: .85rem; }
.specs { margin-bottom: 1rem; padding: .85rem; border-radius: .65rem; border: 1px solid #495c60; background: #23343d; }
.specs h2,.stats-title { font-size: 1rem; }
.specs dl { display: grid; grid-template-columns: repeat(auto-fit,minmax(8rem,1fr)); gap: .6rem; margin: .7rem 0; }
.specs dt { color: var(--muted); font-size: .76rem; }
.specs dd { margin: .14rem 0 0; font-weight: 700; overflow-wrap: anywhere; }
.specs a { color: var(--army); text-underline-offset: .18rem; font-size: .83rem; overflow-wrap: anywhere; }
.specs summary { padding: .15rem 0; cursor: pointer; font-weight: 700; }
.specs:not([open]) { background: transparent; }
.scene:is([data-section="unit"],[data-section="league_rival"]) .scene-intro.illustrated { background: #23333c; }
.scene:is([data-section="unit"],[data-section="league_rival"]) .scene-intro.illustrated::after { display: none; }
.scene[data-section="factions"] { border: 0; box-shadow: none; background: transparent; overflow: visible; }
.scene[data-section="factions"] .scene-intro { border: 0; background: transparent; padding: .65rem 0 1.25rem; }
.scene[data-section="factions"] .scene-intro h1 { font-size: clamp(2rem,5vw,3.4rem); }
.scene[data-section="factions"] .copy { max-width: 42rem; margin-top: .4rem; color: #bbcedb; }
.scene[data-section="factions"] .scene-controls { padding: 0; }
.scene[data-section="factions"] .plain-actions { justify-self: start; }
.scene[data-section="factions"] .plain-actions button { background: transparent; border-color: var(--border); font-size: .84rem; padding: .42rem .9rem; }
.country-flag { display: inline-block; position: relative; flex: none; width: 2.65rem; aspect-ratio: 5/3; overflow: hidden;
  border-radius: 2px; outline: 1px solid #ffffff50; box-shadow: 0 2px 4px #09132255; forced-color-adjust: none; }
.country-flag[data-code="US"] { aspect-ratio: 19/10; background: linear-gradient(#bf354a 50%,#fff 50%); background-size: 100% 15.384615%; }
.country-flag[data-code="DE"] { background: linear-gradient(#151515 0 33.333%, #d1323e 33.333% 66.666%, #f8c642 66.666%); }
.country-flag[data-code="FR"] { aspect-ratio: 3/2; background: linear-gradient(90deg,#133c8c 0 33.333%,#fff 33.333% 66.666%,#e64c55 66.666%); }
.country-flag[data-code="RU"] { aspect-ratio: 3/2; background: linear-gradient(#fff 0 33.333%,#0039a6 33.333% 66.666%,#d52b1e 66.666%); }
.country-flag[data-code="UA"] { aspect-ratio: 3/2; background: linear-gradient(#0057b7 0 50%,#ffd700 50%); }
.flag-canton { position: absolute; inset: 0 auto auto 0; width: 40%; height: 53.846%; display: grid; grid-template-rows: repeat(9,1fr); padding: 1% .8%; background: #293a73; }
.flag-star-row { display: flex; justify-content: space-around; align-items: center; min-height: 0; }
.flag-star-row:nth-child(even) { margin-inline: 8%; }
.flag-star-row i { display: block; height: 100%; aspect-ratio: 1; background: #fff; clip-path: polygon(50% 0,62% 34%,99% 37%,69% 60%,80% 96%,50% 75%,20% 96%,31% 60%,1% 37%,38% 34%); }
.army-mark .country-flag { width: 1.65rem; }
.country-card { --ink: #b4deff; --surface: #244663; --edge: #4b779a;
  position: relative; display: grid; grid-template-rows: auto auto minmax(6.5rem,1fr) auto auto; align-content: start; gap: .65rem;
  text-align: left; padding: 1rem; border: 1px solid var(--edge); border-top: 3px solid var(--ink);
  border-radius: .9rem; background: linear-gradient(155deg,var(--surface),#1d3040 75%);
  box-shadow: 0 .3rem .75rem #09132a35; }
.country-card[data-country="DE"] { --ink: #ffcf70; --surface: #51452e; --edge: #87734a; }
.country-card[data-country="FR"] { --ink: #c5c9ff; --surface: #363e69; --edge: #6875a5; }
.country-card[data-country="RU"] { --ink: #c5d8ff; --surface: #3f4967; --edge: #6e83a8; }
.country-card[data-country="UA"] { --ink: #ffe391; --surface: #20577c; --edge: #7c966e; }
.country-card:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
@media (hover:hover) { .country-card:hover { border-color: var(--ink); transform: translateY(-2px); } }
.country-heading { display: flex; align-items: center; gap: .65rem; }
.country-name { font-size: clamp(1.25rem,2.5vw,1.7rem); font-weight: 820; letter-spacing: -.035em; line-height: 1.1; }
.country-perk { color: var(--ink); font-size: .93rem; font-weight: 740; }
.country-vehicle { justify-self: center; align-self: center; width: 100%; height: clamp(7rem,15vw,10rem); object-fit: contain; }
.country-loadout { display: grid; gap: .18rem; min-width: 0; overflow-wrap: anywhere; }
.country-starter { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .4rem; line-height: 1.2; }
.country-starter small { color: #ced8de; font-weight: 500; font-size: .77rem; }
.country-starter strong { color: var(--type); font-size: .91rem; }
.country-models { color: #cfdae2; font-size: .78rem; line-height: 1.32; font-weight: 450; }
.country-enter { display: flex; justify-content: center; align-items: center;
  padding: .47rem .7rem; background: var(--ink); border-radius: .4rem; color: #122435; font-size: .86rem; font-weight: 800; }
.hq-shortcuts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; margin: 0 0 .85rem; }
.hq-shortcut { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.85rem; line-height: 1.15; background: #2a4050; }
.hq-shortcut .nav-icon { flex: none; color: var(--army); }
.ico-book { background: currentColor; clip-path: polygon(0 8%,15% 4%,47% 17%,47% 97%,15% 85%,0 88%,0 8%,53% 17%,85% 4%,100% 8%,100% 88%,85% 85%,53% 97%,53% 17%); }
.academy-panel,.shop-panel,.journal-panel { display: grid; gap: .85rem; min-width: 0; margin-bottom: .95rem; }
.screen-filters { display: flex; flex-wrap: wrap; gap: .35rem; }
.screen-filters button { min-height: 2.6rem; background: #192c39; color: #c8d8dd; padding: .43rem .72rem; border-radius: 2rem; font-size: .85rem; }
.screen-filters button[aria-pressed="true"] { background: var(--army); color: #132633; border-color: var(--army); }
.academy-overview,.journal-empty,.catalog-empty { background: linear-gradient(110deg,var(--army-dark),#243744); padding: .85rem 1rem; border-radius: .7rem; border: 1px solid var(--border); }
.academy-overview { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: baseline; gap: .6rem; }
.academy-overview span { color: var(--army); font-weight: 700; }
.academy-overview progress { grid-column: 1/-1; width: 100%; }
.academy-steps,.catalog-list,.journal-entries,.journal-rounds { display: grid; gap: .5rem; list-style: none; padding: 0; margin: 0; min-width: 0; }
.academy-steps li { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: start; gap: .7rem; padding: .8rem; border: 1px solid #425767; border-radius: .64rem; background: #223541; }
.academy-steps li[data-state="next"] { border-color: var(--army); }
.academy-number { display: grid; place-items: center; width: 1.85rem; height: 1.85rem; border-radius: 50%; background: #344b57; color: #d1dde1; font-weight: 800; font-variant-numeric: tabular-nums; }
[data-state="next"] .academy-number { color: #142936; background: var(--army); }
[data-state="done"] .academy-number { color: #abebc4; background: #304b43; }
.academy-step-content h3 { margin: .1rem 0 .15rem; font-size: 1rem; }
.academy-step-content p,.journal-empty p,.catalog-empty { color: #c7d5d8; line-height: 1.4; font-size: .88rem; }
.academy-step-content button { margin-top: .5rem; }
.academy-upgrades,.catalog-controls { display: flex; flex-wrap: wrap; gap: .4rem; }
.academy-upgrades > button { flex: 1 1 8rem; }
.catalog-list { grid-template-columns: repeat(auto-fit,minmax(min(100%,20rem),1fr)); align-items: stretch; }
.catalog-item { display: grid; grid-template-columns: clamp(5rem,23vw,7rem) minmax(0,1fr); grid-template-rows: 1fr auto auto; gap: .45rem .75rem; padding: .75rem; background: linear-gradient(120deg,#263e4b,#1b2d39); border: 1px solid #49616b; border-radius: .72rem; }
.catalog-vehicle { width: 100%; height: 4.4rem; object-fit: contain; align-self: center; }
.catalog-heading { align-self: center; min-width: 0; overflow-wrap: anywhere; }
.catalog-heading h2 { font-size: 1.04rem; line-height: 1.2; }
.catalog-heading p { font-size: .81rem; line-height: 1.3; color: #ccd8d9; margin: .18rem 0; }
.catalog-stock { font-size: .76rem; color: #a6bec3; }
.catalog-offer { grid-column: 1/-1; display: flex; justify-content: space-between; align-items: baseline; gap: .33rem .5rem; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.catalog-offer strong { color: var(--gold); }
.catalog-offer small { color: #d8c4ab; font-size: .78rem; }
.catalog-controls { grid-column: 1/-1; }
.catalog-controls button { flex: 1; }
.journal-entry { display: grid; width: 100%; gap: .4rem; align-content: start; min-width: 0; padding: .72rem .83rem; border: 1px solid #485e6a; border-radius: .65rem; background: #233642; text-align: left; font-weight: 500; }
.journal-meta,.journal-title,.journal-metrics,.journal-pages { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .55rem; }
.journal-meta,.journal-title { justify-content: space-between; }
.journal-meta { font-size: .75rem; color: #b3c7cd; }
.journal-meta time { font-variant-numeric: tabular-nums; }
.journal-title strong { font-size: 1.08rem; line-height: 1.24; overflow-wrap: anywhere; }
.journal-outcome { font-weight: 750; color: #e0d5bc; }
.journal-outcome[data-result="win"] { color: #a5e5bb; }
.journal-outcome[data-result="loss"] { color: #ffb4a5; }
.journal-metrics { color: #e0d4b0; font-size: .84rem; }
.journal-metrics span { white-space: normal; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.journal-metrics:empty { display: none; }
.journal-more { justify-self: end; color: var(--army); font-size: .82rem; font-weight: 650; }
.journal-empty h2 { margin-bottom: .3rem; }
.journal-empty button { margin-top: .65rem; }
.journal-pages { justify-content: center; align-items: center; }
.journal-pages span { font-variant-numeric: tabular-nums; color: var(--muted); }
.journal-notes { margin: 0; padding: .75rem .85rem .75rem 1.9rem; border-left: 2px solid var(--army); background: #1d303c; line-height: 1.42; }
.journal-notes li + li { margin-top: .4rem; }
.journal-rounds li { display: flex; flex-wrap: wrap; gap: .3rem .65rem; align-items: baseline; padding: .55rem; border-bottom: 1px solid #435a64; }
.journal-rounds span,.journal-rounds small { color: #c4d3d7; }
.hq-services { border-top: 1px solid var(--border); }
.hq-services summary { width: fit-content; cursor: pointer; padding: .72rem .2rem; color: var(--muted); font-weight: 650; font-size: .9rem; }
.hq-links { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,8rem),1fr)); gap: .4rem; }
.hq-links button { font-size: .85rem; }
.scene[data-section="home"] .scene-intro { display: flex; align-items: baseline; padding-block: .85rem; }
.scene[data-section="home"] .scene-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .8rem; }
.scene[data-section="home"] .scene-info .copy { margin: 0; color: var(--muted); }
.scene[data-section="home"] .objective { border-radius: .85rem; padding: clamp(.85rem,2.5vw,1.3rem); border-left: 4px solid var(--army);
  background: linear-gradient(120deg,var(--army-dark),#213c50 84%); }
.scene[data-section="home"] .objective h2 { max-width: 26rem; font-size: clamp(1.3rem,3.7vw,2rem); }
.scene[data-section="home"] .league-card { background: #293745; border-color: #596063; }
.scene[data-section="home"] .league-crest { min-width: 2.6rem; height: 2.9rem; }
.scene[data-section="home"] .league-crest strong { font-size: 1.05rem; }
.scene[data-section="home"] .league-info h2 { font-size: 1rem; }
.scene[data-section="home"] .league-info p { font-size: .8rem; }
.scene[data-section="home"] .art-card[data-command="operations"] { background: linear-gradient(115deg,#284a55,#213844); border-color: #476b77; }
.scene[data-section="home"] .art-card[data-command="battles"] { background: linear-gradient(115deg,#4e3c43,#322f40); border-color: #78565b; }
.scene[data-section="home"] .art-card[data-command="equipment"] { background: linear-gradient(115deg,#3e485c,#293749); border-color: #596781; }
.scene[data-section="home"] .art-card[data-command="base"] { background: linear-gradient(115deg,#344d40,#283c3c); border-color: #4e6d5d; }
.campaign-panel,.garage-panel { margin-bottom: 1rem; }
.campaign-panel h2,.garage-panel h2 { font-size: 1.04rem; margin-bottom: .48rem; }
.route-list,.career-list { list-style: none; padding: 0; margin: 0; }
.route-list li + li { border-top: 1px solid var(--border); }
.route-stop { display: flex; align-items: center; gap: .85rem; width: 100%; text-align: left; border: 0; border-radius: 0; background: transparent; padding: .75rem .25rem; }
.route-stop:hover { background: #263a43; }
.route-number { display: grid; place-items: center; width: 2rem; height: 2rem; flex: none; font-variant-numeric: tabular-nums; border: 1px solid currentColor; border-radius: 50%; color: var(--army); }
.route-stop[data-state="open"] .route-number { background: var(--army); color: #1b292d; }
.route-stop[data-state="locked"] .route-number,.route-stop[data-state="locked"] .route-info { color: var(--muted); }
.route-info,.mission-plan,.onward { display: grid; gap: .18rem; }
.route-info small,.mission-plan span,.career-list span,.onward small { font-weight: 450; font-size: .84rem; }
.route-info small { color: var(--muted); }
.mission-plans { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,11rem),1fr)); gap: .45rem; }
.mission-plan,.onward { text-align: left; padding: .75rem .9rem; }
.mission-plan small { font-size: .82rem; }
.onward { width: 100%; border: 0; border-top: 1px solid #4f615e; border-radius: 0; background: transparent; color: var(--type); padding: .72rem .1rem .25rem; }
.onward strong { color: var(--army); }
.career-list li { display: grid; grid-template-columns: 4.2rem minmax(0,1fr); gap: .5rem; padding: .72rem .35rem; border-bottom: 1px solid var(--border); }
.career-list li strong { color: var(--army); font-variant-numeric: tabular-nums; }
.crew-order,.garage-order { border-top: 1px solid var(--border); padding-block: .7rem; }
.garage-panel p,.loadout { font-size: .89rem; }
.garage-panel .condition { color: var(--muted); padding-top: .24rem; }
.garage-buttons { display: flex; flex-wrap: wrap; gap: .4rem; }
.garage-buttons:not(:empty) { margin-top: .6rem; }
.loadout { display: grid; grid-template-columns: auto minmax(0,1fr); gap: .4rem .75rem; margin: .6rem 0; }
.loadout dd { margin: 0; overflow-wrap: anywhere; } .loadout dt { color: var(--muted); }
.stats-title { margin: .2rem 0 .5rem; }
.unit-price { display: block; margin-top: .5rem; color: var(--gold); font-weight: 700; }
.starter { color: #e8e6cc; font-size: .78rem; font-weight: 550; }
.league-card {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .8rem;
  padding: .85rem 1rem; margin-bottom: .78rem; border: 1px solid #847454; border-radius: .82rem;
  background: linear-gradient(115deg,#423e31,#25353d 74%);
}
.league-crest {
  display: grid; align-content: center; justify-items: center; min-width: 3.7rem; height: 4rem; padding: 0 .38rem .3rem;
  color: #302e23; background: linear-gradient(125deg,#f8dfa0,#d2a755); clip-path: polygon(0 0,100% 0,100% 70%,50% 100%,0 70%);
}
.league-crest span { font-size: .64rem; font-weight: 800; }
.league-crest strong { font-size: 1.43rem; font-variant-numeric: tabular-nums; line-height: 1.03; }
.league-info { min-width: 0; }
.league-info h2 { font-size: clamp(1.05rem,3vw,1.35rem); }
.league-info p,.league-info small { display: block; margin-top: .18rem; color: #d8ddce; font-size: .82rem; }
.league-actions,.duel-options,.share-controls { display: flex; flex-wrap: wrap; gap: .5rem; }
.league-actions { justify-content: end; }
.league-actions button,.duel-options button,.share-controls :is(button,.link-button) { font-size: .88rem; }
.league-boards { display: grid; gap: .85rem; margin-bottom: .85rem; }
.rivals,.standings { display: grid; gap: .48rem; }
.rivals h2,.standings h2 { font-size: 1.1rem; }
.rival { display: flex; align-items: center; gap: .65rem; padding: .53rem .65rem; min-height: 3rem; border-radius: .58rem; border: 1px solid #405762; background: #23343e; text-align: left; }
.rival-mark { flex: 0 0 1.9rem; height: 2rem; display: grid; place-items: center; font-weight: 800; background: var(--army-dark); color: var(--army); clip-path: polygon(0 0,100% 0,100% 77%,50% 100%,0 77%); }
.rival-info { display: grid; gap: .05rem; min-width: 0; }
.rival-info strong,.standing-name { overflow-wrap: anywhere; }
.rival-info small,.round-log small { color: var(--muted); font-size: .8rem; }
.rival-vehicle { width: clamp(3.3rem,15vw,6rem); height: 3.7rem; object-fit: contain; }
.rival-style { font-size: .86rem; font-weight: 550; color: var(--type); }
.rival-info .rival-stakes { color: var(--gold); }
.commander-profile { display: grid; gap: .8rem; margin-bottom: .8rem; padding: .9rem; border: 1px solid #526773; border-radius: .75rem; background: linear-gradient(125deg,#2a4149,#1b2e39); }
.commander-heading h2 { font-size: 1.17rem; }
.commander-heading p { margin-top: .35rem; color: #d4dfd7; }
.commander-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,8.1rem),1fr)); gap: .4rem; }
.commander-facts div { min-width: 0; padding: .45rem .55rem; background: #15262e90; border-radius: .4rem; }
.commander-facts dt { color: var(--muted); font-size: .74rem; }
.commander-facts dd { margin: .12rem 0 0; font-weight: 680; overflow-wrap: anywhere; }
.commander-lineup h3 { margin: 0 0 .34rem; font-size: .91rem; }
.commander-lineup ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.commander-lineup li { background: #30464a; border: 1px solid #516360; padding: .22rem .45rem; border-radius: .38rem; font-size: .83rem; }
.commander-stakes { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.commander-stakes span { color: var(--gold); font-weight: 700; font-size: .87rem; }
.rival-arrow { margin-left: auto; font-size: 1.2rem; color: var(--army); }
.standings ol,.round-log { margin: 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.standings li { border-bottom: 1px solid #344951; }
.standing-line,.standing-link { width: 100%; display: grid; grid-template-columns: 2rem 1fr auto; min-height: 2.8rem; align-items: center; gap: .4rem; padding: .42rem .55rem; text-align: left; }
.standing-link { border: 0; border-radius: .38rem; background: transparent; font-weight: 400; }
.standing-link:hover { background: #2e424b; }
.standings li.own-standing { background: var(--army-dark); border-radius: .4rem; }
.standing-rank { color: var(--muted); text-align: center; }
.standing-self { margin-left: .45rem; color: var(--army); font-size: .7rem; font-weight: 700; }
.duel-panel {
  display: grid; gap: .65rem; margin-bottom: .9rem; padding: .9rem; border: 1px solid #6c897a; border-radius: .82rem;
  background: linear-gradient(115deg,#2a4544,#22353f 80%);
}
.duel-panel h2 { font-size: clamp(1.16rem,4vw,1.5rem); }
.duel-panel p { color: #d4dfd8; line-height: 1.42; font-size: .9rem; white-space: pre-line; overflow-wrap: anywhere; }
.duel-score { display: grid; grid-template-columns: 1fr auto 1fr; gap: .7rem; align-items: center; text-align: center; border: 1px solid #50656a; border-radius: .64rem; background: #192d35; padding: .65rem; }
.duel-score div { min-width: 0; display: grid; }
.duel-score small { color: var(--muted); overflow-wrap: anywhere; }
.duel-score strong { font-variant-numeric: tabular-nums; font-size: 1.85rem; line-height: 1.15; }
.score-separator { color: var(--army); font-size: 1.4rem; }
.round-log { display: grid; gap: .25rem; }
.round-log li { display: flex; gap: .4rem .65rem; flex-wrap: wrap; align-items: baseline; border-bottom: 1px solid #485a5b; padding: .3rem .12rem; font-size: .84rem; }
.round-log small { margin-left: auto; }
.round-prompt { font-weight: 750; }
.duel-options > button { flex: 1 1 4.2rem; }
.share-controls :is(.share-feedback,input) { flex: 1 0 100%; }
.share-feedback:empty { display: none; }
.navigation:has(#league-tab:not([hidden])) { grid-template-columns: repeat(5,minmax(0,1fr)); }
.ico-league { background: currentColor; clip-path: polygon(4% 0,96% 0,90% 46%,65% 68%,59% 71%,59% 81%,77% 89%,77% 100%,23% 100%,23% 89%,41% 81%,41% 71%,35% 68%,10% 46%); }
.choices { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,13rem),1fr)); gap: .65rem; }
.choice-card { display: grid; align-content: start; gap: .62rem; border: 1px solid #465c61; background: #20333d; padding: .85rem; border-radius: .73rem; }
.choice-card.is-selected { border-color: #7d8c66; background: linear-gradient(120deg,var(--army-dark),#23363e); }
.choice-card h2 { font-size: 1.08rem; }
.choice-heading { display: flex; align-items: center; justify-content: space-between; gap: .35rem; }
.choice-count { color: var(--army); font-weight: 700; font-size: .8rem; white-space: nowrap; }
.choice-card p { font-size: .88rem; color: var(--muted); }
.choice-loot { color: var(--gold); font-size: .86rem; font-weight: 700; }
.reward { display: grid; align-content: start; gap: .52rem; margin-bottom: .8rem; background: linear-gradient(120deg,#405143,#253e40); border: 1px solid #84976f; border-left: 4px solid var(--army); border-radius: .75rem; padding: .85rem; animation: arrive .24s ease-out; }
.reward-values { display: flex; flex-wrap: wrap; gap: .42rem; }
.reward-values strong { color: #fcdda0; padding: .3rem .5rem; border-radius: .4rem; background: #1c2c31; font-size: .96rem; }
.reward p { color: #e1eadc; white-space: pre-line; font-size: .9rem; }
.unit-stat,.battle-stat { display: grid; align-content: center; gap: .14rem; padding: .62rem; background: #172630; border: 1px solid #394d54; border-radius: .5rem; }
.unit-stat span,.battle-stat span { font-size: .78rem; color: #becbc8; }
.unit-stat strong,.battle-stat strong { font-variant-numeric: tabular-nums; }
.notice,.error {
  margin: 0 0 .8rem; padding: .72rem .85rem; line-height: 1.47; white-space: pre-line;
  background: #273f3e; border-left: 3px solid #a5d9b7; border-radius: .3rem; scroll-margin: 1rem;
}
.error { background: #4e3436; color: #ffd1be; border-color: #ef9b8d; }
.report { margin-bottom: .85rem; padding: .9rem; background: linear-gradient(110deg,#304a43,#273c41); border: 1px solid #759780; border-radius: .75rem; animation: arrive .28s ease-out both; }
.report[data-result="loss"] { background: linear-gradient(115deg,#4b3939,#34333b); border-color: #b18378; }
.report-header { display: flex; align-items: center; gap: .65rem; }
.report-crest { display: grid; place-items: center; width: 2.8rem; height: 3rem; color: #29313a; font-size: 1.3rem; background: var(--gold); clip-path: polygon(0 0,100% 0,100% 68%,50% 100%,0 68%); }
.report[data-result="loss"] .report-crest { background: #d6aa9e; }
.report p { color: #d6e0d9; font-size: .9rem; white-space: pre-line; }
.battle-stats { margin-block: .75rem; }
.report .battle-stat { background: #16272e99; }
.report > button { margin-top: .65rem; }
.scores { margin-bottom: .9rem; }
.scores ol { margin: .7rem 0 1rem; padding-left: 1.5rem; color: var(--muted); }
.scores li { padding: .25rem 0; }
form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .45rem; margin-bottom: .7rem; }
form label { grid-column: 1/-1; color: var(--muted); }
input { background: #13212b; color: var(--type); }
.navigation {
  position: fixed; bottom: max(.55rem,var(--bottom-safe)); left: 50%; z-index: 5;
  width: min(calc(100% - 1rem), 34rem); transform: translateX(-50%);
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .25rem;
  padding: .3rem; background: #17232df5; border: 1px solid #485d61; border-radius: 1rem;
  box-shadow: 0 .35rem 1.1rem #08101588;
}
.navigation button { display: grid; justify-items: center; align-content: center; gap: .27rem; min-height: 3.08rem; padding: .2rem .25rem; color: #bfcecc; background: transparent; border-color: transparent; font-size: .75rem; line-height: 1.12; }
.navigation button[aria-current="page"] { color: var(--army); background: var(--army-dark); border-color: #657166; }
.nav-icon { display: block; position: relative; width: 1.15rem; height: 1.05rem; }
.nav-icon::before,.nav-icon::after { content: ""; position: absolute; }
.ico-home { background: currentColor; clip-path: polygon(0 42%,50% 0,100% 42%,88% 52%,88% 100%,60% 100%,60% 66%,40% 66%,40% 100%,12% 100%,12% 52%); }
.ico-map { border: 1.6px solid currentColor; border-radius: 2px; transform: skewY(-8deg); }
.ico-map::before,.ico-map::after { width: 1.5px; height: 90%; top: 5%; background: currentColor; left: 32%; }
.ico-map::after { left: 66%; }
.ico-battle { width: 1.05rem; border: 1.6px solid currentColor; border-radius: 50%; }
.ico-battle::before,.ico-battle::after { background: currentColor; inset: 40% -25%; height: 2px; }
.ico-battle::after { transform: rotate(90deg); }
.ico-hangar { background: currentColor; clip-path: polygon(0 36%,50% 0,100% 36%,100% 100%,84% 100%,84% 46%,50% 20%,16% 46%,16% 100%,0 100%); }
@keyframes arrive { from { opacity: .4; transform: translateY(.4rem); } to { opacity: 1; transform: none; } }
@media (max-width:650px) {
  .league-card { grid-template-columns: auto 1fr; gap: .6rem; padding: .7rem; }
  .league-actions { grid-column: 1/-1; justify-content: stretch; }
  .league-actions button,.share-controls :is(button,.link-button) { flex: 1 1 7rem; }
  .league-crest { min-width: 3.2rem; height: 3.45rem; }
  .shell { width: calc(100% - 1.2rem); }
  .header { min-height: 3.12rem; gap: .48rem; }
  .brand-mark { flex-basis: 1.45rem; height: 1.55rem; }
  .army-mark { max-width: 39%; font-size: .7rem; line-height: 1.16; }
  .header .quiet { font-size: .72rem; min-height: 2.4rem; padding: .34rem .43rem; }
  main { padding-top: .65rem; }
  .status { grid-template-columns: repeat(3,minmax(0,1fr)); padding: .5rem .62rem .58rem; row-gap: .45rem; }
  .status-summary { grid-column: 1/-1; grid-template-columns: auto auto minmax(1.2rem,1fr) auto auto; align-items: center; gap: .4rem; padding: 0; }
  .status-summary progress { grid-column: 3; grid-row: 1; margin: 0 .1rem; }
  .status-summary .credits-label { grid-column: 4; }
  .status-summary .stat-value:last-of-type { grid-column: 5; }
  .stat { padding: 0 .5rem; }
  .stat-energy { padding-left: 0; border: 0; }
  .stat-ammo { padding-right: 0; }
  .stat-label { font-size: .72rem; }
  .stat-value { font-size: .88rem; line-height: 1.1; }
  .stat progress { margin-top: .07rem; }
  .gallery { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .48rem; }
  .gallery:has(> .country-card) { grid-template-columns: 1fr; gap: .6rem; }
  .scene[data-section="factions"] .scene-intro { padding: .3rem .1rem .85rem; }
  .scene[data-section="factions"] .copy { font-size: .88rem; line-height: 1.38; }
  .country-card { grid-template-columns: minmax(0,1fr) clamp(5.9rem,29vw,9rem); grid-template-rows: auto auto auto auto;
    gap: .38rem .5rem; padding: .8rem; border-top-width: 1px; border-left: 3px solid var(--ink); }
  .country-heading { grid-column: 1; grid-row: 1; gap: .5rem; }
  .country-name { font-size: clamp(1.22rem,5.3vw,1.6rem); }
  .country-perk { grid-column: 1; grid-row: 2; font-size: .84rem; line-height: 1.26; }
  .country-vehicle { grid-column: 2; grid-row: 2/4; width: 100%; height: 4.45rem; }
  .country-loadout { display: contents; }
  .country-starter { grid-area: 3/1; align-self: start; }
  .country-models { grid-area: 4/1/auto/-1; }
  .country-enter { grid-area: 1/2; justify-self: stretch; align-self: center; padding: .32rem .48rem; font-size: .78rem; }
  .country-heading .country-flag { width: 2.4rem; }
  .scene[data-section="home"] .league-card { grid-template-columns: auto minmax(0,1fr) auto; }
  .scene[data-section="home"] .league-actions { grid-column: auto; }
  .scene[data-section="home"] .league-actions button { font-size: .76rem; padding: .35rem .48rem; }
  .scene[data-section="home"] .league-crest { min-width: 2.2rem; height: 2.5rem; }
  .scene-intro.illustrated { min-height: 8.7rem; grid-template-columns: minmax(0,1.15fr) minmax(0,.85fr); gap: .25rem; }
  .scene-art { height: clamp(6.7rem,29vw,10rem); }
  .scene-info .copy { font-size: .91rem; line-height: 1.38; }
  .scene[data-section="unit"] .scene-intro.illustrated { grid-template-columns: minmax(0,1fr); }
  .scene[data-section="unit"] .scene-art { grid-row: 1; justify-self: center; height: 9.3rem; max-width: 85%; }
  .scene[data-section="unit"] .scene-info .copy { font-size: .87rem; }
  .scene[data-section="home"] .art-card { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.85fr); }
  .scene[data-section="home"] .art-window { height: 3.65rem; padding: .3rem .23rem .3rem 0; }
  .scene[data-section="home"] .art-description { padding: .45rem .05rem .45rem .55rem; }
  .scene[data-section="home"] .art-title { font-size: .88rem; }
  .art-description { padding: .56rem .6rem .69rem; }
  .art-title { font-size: .99rem; } .art-summary { font-size: .83rem; }
  .unit-stats,.battle-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:400px) {
  h1 { font-size: 1.58rem; }
  .objective { gap: .5rem; align-items: stretch; flex-direction: column; padding: .75rem; }
  .objective button { max-width: none; }
  .scene-intro.illustrated { padding: .85rem; }
  .buttons.three { grid-template-columns: 1fr 1fr; }
  .scene[data-section="home"] .objective:has(.objective-art:not([hidden])) { grid-template-columns: minmax(0,1.45fr) minmax(4.8rem,.85fr); }
  .scene[data-section="home"] .objective button { justify-self: start; }
  .scene[data-section="home"] .league-crest { display: none; }
  .scene[data-section="home"] .league-card { grid-template-columns: minmax(0,1fr) auto; }
  .country-models { font-size: .74rem; }
  .country-starter strong { font-size: .82rem; }
  .country-card { column-gap: .3rem; }
}
@media (max-width:290px) {
  .country-card { grid-template-columns: minmax(0,1fr) 4.1rem; }
  .country-vehicle { grid-row: 1/3; height: 3.5rem; }
  .country-starter { grid-column: 1/-1; }
  .country-enter { grid-column: 1/-1; grid-row: 5; }
  .country-heading .country-flag { width: 1.65rem; }
  .scene[data-section="home"] .league-card { grid-template-columns: 1fr; }
}
@media (max-height:500px) and (orientation:landscape) {
  .navigation { position: static; width: 100%; transform: none; margin-block: .8rem; }
  body.docked main { padding-bottom: var(--bottom-safe); }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
