@charset "UTF-8";
/* R9: restrained campaign framing; the battlefield owns the screen. */
:root{--r9-ink:#153e3b;--r9-paper:#f5f0de;--r9-gold:#c5a568}
.r9-icon{width:26px;height:28px;display:inline-block;vertical-align:middle;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.entry-icon .r9-icon{width:30px;height:32px}.ranked-emblem .r9-icon{width:56px;height:60px}
.startup-crest .r9-icon{width:72px;height:77px;stroke-width:1.2;color:#d7bd7f;filter:drop-shadow(0 2px 3px #1e443d44)}
#map-world .building-badge .r9-icon{width:14px;height:15px;stroke-width:1.5}
#map-world .allegiance-own .building-count{background:#246d5b}
#map-world .allegiance-ally .building-count{background:#3e6e8e}
#map-world .allegiance-enemy .building-count{background:#a64e41}
.settings-actions .icon-button{display:flex;flex-direction:column;gap:5px;min-height:64px;min-width:80px}
.settings-actions .icon-button>span{font-size:12px}
.startup-content{align-items:center;text-align:center;margin:clamp(30px,8vh,90px) auto 60px;gap:14px;width:min(620px,90vw)}
.startup-content h1{font-size:clamp(44px,6vw,80px);color:#f9edcc;text-shadow:0 2px 12px #173e3b99;letter-spacing:10px}
#startup-screen:before{background:linear-gradient(#123b3e33,#123b3e44 45%,#123b3ed9)}
.startup-content .r8-kicker,.startup-tagline,.startup-content>small{color:#f1e4c0}
.startup-tagline{font-size:14px;letter-spacing:7px}.startup-loading{margin-top:20px}.startup-loading p{color:#f1e4c0}
#enter-continent{background:#d7b978;color:#183e3b;border:1px solid #f0d79f;border-radius:2px;box-shadow:0 3px 14px #103b3944}
.startup-footer{left:0;right:0;text-align:center;color:#e1d4ae}
body[data-page="prepare"]{background:#ecebdc;color:#234b43}
body[data-page="prepare"] #app{max-width:1320px;padding:0 28px 24px}
body[data-page="prepare"] .site-header{height:70px;margin-bottom:20px}
body[data-page="prepare"] .selection-intro{margin-bottom:18px}
body[data-page="prepare"] .selection-intro h1{font-size:28px;line-height:1.3;margin-top:5px}
body[data-page="prepare"] .session-badge{display:none}
body[data-page="prepare"] .selection-layout{display:grid;grid-template-columns:250px minmax(0,1fr);gap:24px}
body[data-page="prepare"] .race-spotlight{display:flex;flex-direction:column;min-height:0;border-radius:2px;border-color:#b7ab89;background:#173e3b;box-shadow:none}
body[data-page="prepare"] .spotlight-image-wrap{height:245px}
body[data-page="prepare"] .spotlight-content{padding:0 18px 18px}
body[data-page="prepare"] .spotlight-name{font-size:25px}.spotlight-title{letter-spacing:1px}
body[data-page="prepare"] .spotlight-trait{margin-top:12px;padding-top:10px}
body[data-page="prepare"] .race-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
body[data-page="prepare"] .race-card{border-radius:2px;background:#f9f6e9;border-color:#c1baa3;box-shadow:none}
body[data-page="prepare"] .race-card-image{height:118px}
body[data-page="prepare"] .race-card.active{border-color:#246754;box-shadow:inset 0 0 0 2px #246754;background:#e1ead9}
body[data-page="prepare"] .race-card-name{font-size:13px;padding:8px 8px 4px}
body[data-page="prepare"] .race-card-trait{font-size:10px;padding:0 8px 9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
body[data-page="prepare"] .mode-panel{border-radius:2px;background:#f9f6e9;padding:14px;margin-top:20px}
body[data-page="prepare"] .mode-buttons button{min-height:48px;border-radius:2px}
body[data-page="prepare"] .selection-launch{position:static;bottom:auto;left:auto;right:auto;transform:none;width:auto;margin-top:16px;padding-top:16px}
body[data-page="prepare"] .primary-button{border-radius:2px;background:#246754;box-shadow:none}
body[data-page="prepare"] .menu-utilities .icon-button{min-width:64px;border-radius:2px;gap:5px}
body[data-page="prepare"] .menu-utilities .icon-button .r9-icon{width:18px;height:20px}
body[data-page="prepare"] .menu-utilities .icon-button>span{font-size:11px}
.ranked-content{max-width:800px}.ranked-content h1{font-size:28px;color:#173e3b}
.ranked-card{border-radius:2px;background:#f9f6e9;border:1px solid #c1ad7f;box-shadow:0 6px 24px #163e3f26}
.r8-modal-card,.overview-card,.result-card,.rules-card,.pause-overlay>div{border-radius:3px}
.r8-dialog .overview-card{width:min(1100px,100%);max-height:calc(100dvh - max(24px,var(--r3-safe-top)) - max(24px,var(--r3-safe-bottom)))}
.result-card{border-top:3px solid #b89b65}.result-kicker{letter-spacing:2px;font-size:11px}
.result-card .result-emblem{font-size:32px;line-height:1.2;color:#b49656}
.result-card .result-emblem .r9-icon{width:44px;height:48px}
.result-race{border-radius:2px}.result-mvp{border-radius:2px}.result-card .primary-button,.result-card .quiet-button{border-radius:2px}
.r8-primary,.r8-secondary,.r8-nav{border-radius:3px}
#lobby-screen:before{background:linear-gradient(90deg,#183e3e75,transparent 58%),linear-gradient(0deg,#123839d9,transparent 55%)}
.r8-wordmark{color:var(--r9-paper);text-shadow:0 2px 8px #153e3b80}
.r8-wordmark small{display:none}
.lobby-body{display:block;max-width:none;margin:0;padding:0}
.lobby-character{position:absolute;left:8vw;bottom:10vh;width:clamp(250px,30vw,400px);height:70vh;min-height:0;border:1px solid #dcc895;border-radius:2px;background:#153e3b;box-shadow:0 12px 40px #082e3a66;clip-path:polygon(0 0,100% 0,100% 95%,50% 100%,0 95%)}
.lobby-character>div{padding:35px 22px 42px;background:linear-gradient(transparent,#173e3bf5 35%)}
.lobby-character h2{font-size:32px;letter-spacing:5px}
.lobby-character .r8-kicker{color:#d3bb83;letter-spacing:2px}
.lobby-content{position:absolute;right:7vw;bottom:12vh;width:280px;color:#f5f0de}
.lobby-entries{display:flex;flex-direction:column;gap:12px}
.lobby-entry{border-radius:2px;min-height:64px;padding:12px 20px;gap:15px;box-shadow:0 4px 18px #153e3b33}
.lobby-entry.casual{background:linear-gradient(#e7d19d,#c8a566);color:#183e3b;border:1px solid #f2dfb2}
.lobby-entry.casual b{font-size:28px;letter-spacing:8px}
.lobby-entry.ranked{min-height:48px;background:#173e3be8;color:#eee3c8;border:1px solid #c5a56880}
.lobby-entry .entry-icon{font-size:24px;color:inherit}
.lobby-record{color:#e7ddc1;border-top:1px solid #e3ce9c50;padding-top:15px;font-size:12px}
.lobby-footer{color:#eee3c8;opacity:.65}
#battle-screen{--dock-height:56px}
#battle-screen .battle-status{height:calc(48px + var(--r3-safe-top));padding-top:var(--r3-safe-top);padding-bottom:0;gap:20px;background:#f5f0de;border-bottom:1px solid #b6bba1}
#battle-screen .battle-status .status-stat>b,#battle-screen .battle-status .battle-clock>b{font-size:20px}
#battle-screen .battle-status .icon-button{border:0;border-left:1px solid #b6bba1;border-radius:0;background:transparent}
#battle-screen .territory-track{top:calc(47px + var(--r3-safe-top))}
#battle-screen .dispatch-panel{height:calc(56px + var(--r3-safe-bottom));padding:6px max(12px,var(--r3-safe-right)) calc(6px + var(--r3-safe-bottom)) max(12px,var(--r3-safe-left));background:#f5f0de}
#battle-screen .dispatch-actions{width:65%;max-width:560px;margin-left:auto;margin-right:0}
#battle-screen .dispatch-heading{position:absolute;left:max(14px,var(--r3-safe-left));top:19px;max-width:30%;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#battle-screen .dispatch-heading h2,#battle-screen .selected-building-info{display:none}
#battle-screen .dispatch-heading>span{font-size:12px}
#battle-screen .ratio-buttons button{min-height:44px;font-size:18px;border-radius:2px}
#battle-screen .select-all-button{border-radius:2px}
#battle-screen .battle-scoreboard{top:calc(58px + var(--r3-safe-top));width:112px}
#battle-screen .battle-scoreboard .rank-heading{border-radius:2px;background:#f5f0de}
#battle-screen .map-controls,#battle-screen .minimap-panel,.tactics-drawer>summary{border-radius:2px;background:#f5f0deed}
#battle-screen .map-controls{display:flex;flex-direction:row;align-items:center;width:auto;height:auto;padding:2px}
#battle-screen .map-controls #map-zoom{width:38px;font-size:11px}
#battle-screen .tutorial-card{left:max(12px,var(--r3-safe-left));top:calc(58px + var(--r3-safe-top));bottom:auto;width:230px;max-width:calc(100vw - 155px);padding:10px 12px;background:#f5f0def5;border:1px solid #b6bba1;border-radius:2px;box-shadow:0 3px 12px #153e3b22}
#battle-screen .tutorial-progress,#battle-screen .tutorial-step{display:none}
#battle-screen .tutorial-card h2{font-size:14px;margin:0 0 5px}
#battle-screen .tutorial-copy{font-size:12px;line-height:1.5;margin:0}
#battle-screen .tutorial-skip{min-height:44px;margin-top:3px;padding:5px 0}
#battle-screen .battle-heading{position:static;max-width:none;margin:10px 0}
#battle-screen .player-trait{background:transparent;border:0;padding:0;font-size:12px;max-width:100%}
#map-world .r8-ground-tile{filter:saturate(.52) brightness(.94)}
#map-world .r8-tree{filter:saturate(.65) drop-shadow(6px 8px 3px #31593630)}
#map-world .r9-rock{position:absolute;pointer-events:none;filter:saturate(.7)}
#map-world .r9-clearings{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
#map-world .city-art{transform:scale(1.15);transform-origin:50% 85%}
#map-world .road-center{stroke:url(#r9-path-stone);stroke-width:.65}
#map-world .direct-road .road-center{stroke:#2d9b83}
#map-world .reachable-road .road-center{stroke:#c59b49}
#map-world .building.illegal-target{opacity:1}
#map-world .building-count{font-size:18px;line-height:1.1;min-width:28px;padding:2px 5px;border-width:1px;border-radius:3px;transform:translateX(-50%) scale(var(--label-scale,1));transform-origin:50% 50%;box-shadow:0 1px 3px #153e3b44}
#map-world .building-owner-mark{font-size:11px;letter-spacing:0;transform:translateX(-50%) scale(var(--label-scale,1));transform-origin:50% 0}
#map-world .building .building-owner-mark,#map-world .building.capital .building-owner-mark{top:calc(100% + 12px * var(--label-scale,1));font:600 11px/1.3 "Microsoft YaHei",sans-serif;text-shadow:none;color:#244d43;background:#f5f0deeb;padding:1px 4px;border-radius:2px}
#map-world .building-name{display:none;font-size:12px;transform:scale(var(--label-scale,1));transform-origin:50% 0}
#map-world .building.selected .building-name{display:block}
#map-world .building{--city-base-height:98px}
#map-world .building.capital{--city-base-height:110px}
#map-world .building .building-name{position:absolute;top:calc(var(--city-base-height) + 33px * var(--label-scale,1));left:50%;margin:0;transform:translateX(-50%) scale(var(--label-scale,1));transform-origin:50% 0}
#map-world .building-order{display:none}
#battle-screen .dispatch-heading{top:10px;white-space:normal;line-height:1.4;max-height:36px}
#battle-screen .dispatch-heading>span{font-size:11px}
#battle-screen .tutorial-copy{padding-right:0}
#battle-screen .tutorial-skip{position:static;margin:3px 0 0 auto}
#battle-screen .trait-toast{left:50%;right:auto;top:calc(58px + var(--r3-safe-top));bottom:auto;transform:translateX(-50%);max-width:min(320px,calc(100vw - 510px));font-size:11px;padding:6px 10px;border-radius:2px}
#battle-screen .battle-message{left:50%;top:calc(58px + var(--r3-safe-top));bottom:auto;max-width:min(340px,calc(100vw - 320px));font-size:11px;border-radius:2px}
#battle-screen:has(.tutorial-card:not([hidden])) .battle-message{left:calc(50% + 54px);max-width:calc(100vw - 390px)}
@media(max-height:520px) and (orientation:landscape){#battle-screen:has(.tutorial-card:not([hidden])) .trait-toast{display:none}#battle-screen .trait-toast{max-width:calc(100vw - 300px)}}
#map-world .building-order,#map-world .garrison-count{font-size:12px;transform:translateX(-50%) scale(var(--label-scale,1));transform-origin:50% 0}
#overview-svg .overview-viewport{fill:#fff6c711;stroke:#fff7d9;stroke-width:1.4;stroke-dasharray:3 2;pointer-events:none;vector-effect:non-scaling-stroke}
#overview-svg .overview-selected-route{stroke:#e1b957;stroke-width:1.5;stroke-dasharray:2 1}
#overview-svg .overview-army{stroke:#fff5dc;stroke-width:.3;pointer-events:none}
#overview-svg .overview-battle{fill:none;stroke:#c45b3d;stroke-width:.8;pointer-events:none}
#overview-svg{background:#d1d9ad}
.overview-legend{display:flex;gap:14px;flex-wrap:wrap;font-size:11px;color:#4c665a;margin:6px 0}
.overview-legend i{display:inline-block;width:8px;height:8px;margin-right:5px;background:var(--mark);border-radius:50%}
@media(max-height:520px) and (orientation:landscape){
 .startup-content{margin:16px auto 32px;gap:8px}.startup-crest .r9-icon{width:36px;height:40px}.startup-content h1{font-size:42px}.startup-content .r8-kicker{font-size:10px}.startup-loading{margin-top:8px}.startup-footer{bottom:8px;font-size:9px}.startup-content>small{font-size:10px}#enter-continent{min-height:44px;padding:10px 20px}
 body[data-page="prepare"] #app{padding:0 max(16px,var(--r3-safe-right)) 20px max(16px,var(--r3-safe-left))}
 body[data-page="prepare"] .site-header{height:58px;margin-bottom:12px;gap:8px}.brand small{display:none}
 body[data-page="prepare"] .brand{gap:7px}.brand b{font-size:18px}.brand-mark{width:32px;height:36px;font-size:18px}
 body[data-page="prepare"] .selection-intro{margin-bottom:12px}.selection-intro .eyebrow{display:none}
 body[data-page="prepare"] .selection-intro h1{font-size:22px;margin:0}.intro-copy{font-size:11px}
 body[data-page="prepare"] .selection-layout{grid-template-columns:160px minmax(0,1fr);gap:16px}
 body[data-page="prepare"] .spotlight-image-wrap{height:150px;min-height:0;flex-shrink:0}
 body[data-page="prepare"] .spotlight-content{padding:0 10px 12px}.spotlight-title{display:none}
 body[data-page="prepare"] .spotlight-name{font-size:20px}.spotlight-trait .trait-name{font-size:10px;letter-spacing:0}
 body[data-page="prepare"] .spotlight-trait p{font-size:11px;line-height:1.65;min-height:0}.selection-tactic{display:none}
 body[data-page="prepare"] .race-roster{min-width:0}
 body[data-page="prepare"] .race-grid{grid-template-columns:none;grid-template-rows:repeat(2,132px);grid-auto-flow:column;grid-auto-columns:92px;overflow-x:auto;padding:2px 2px 9px;gap:8px;scrollbar-width:thin;scroll-snap-type:x proximity}
 body[data-page="prepare"] .race-card{scroll-snap-align:start;min-height:0}.race-card-name>span{display:none}
 body[data-page="prepare"] .race-card-image{height:82px}
 body[data-page="prepare"] .race-card-name{padding:5px 7px 3px;font-size:12px}
 body[data-page="prepare"] .race-card-trait{font-size:10px;padding:0 7px 6px}
 body[data-page="prepare"] .section-heading{margin-bottom:8px}.section-heading>span{font-size:10px}
 body[data-page="prepare"] .roster-footnote{font-size:10px;line-height:1.5;margin-top:6px}
 body[data-page="prepare"] .mode-panel{margin-top:14px;padding:10px}
 body[data-page="prepare"] .mode-buttons{gap:6px}.mode-buttons button{font-size:11px}
 body[data-page="prepare"] .selection-launch{margin-top:12px;padding-top:12px}
 .ranked-content{margin:12px auto 25px}.ranked-content h1{font-size:22px;margin:8px 0}.ranked-content>p{font-size:11px}
 .ranked-cards{margin-top:14px;gap:16px}.ranked-card{padding:14px 18px}.ranked-emblem .r9-icon{width:30px;height:32px}.ranked-card h2{font-size:19px;margin:5px 0 8px}.ranked-reward b{font-size:22px;margin:4px}.ranked-card .r8-secondary{margin-top:10px}.ranked-card .r8-primary{margin-top:8px}
 .r8-lobby-header{padding-top:12px}.r8-wordmark{font-size:24px}
 .lobby-character{left:9vw;bottom:7vh;width:28vw;height:73vh}.lobby-character>div{padding:20px 15px 25px}.lobby-character h2{font-size:22px}.lobby-character>div p:last-child{font-size:10px;line-height:1.45}
 .lobby-content{right:8vw;bottom:10vh;width:220px}.lobby-entry{min-height:60px}.lobby-entry.casual b{font-size:24px}.lobby-record{margin-top:12px;padding-top:10px}.lobby-footer{font-size:9px;bottom:8px}
 #battle-screen{--dock-height:56px}#battle-screen .battle-status{gap:14px}
 #battle-screen .map-controls{bottom:calc(68px + var(--r3-safe-bottom))}
 #battle-screen .tactics-drawer{bottom:calc(68px + var(--r3-safe-bottom))}
 #battle-screen .minimap-panel{display:none}
 #battle-screen .tutorial-card{display:grid;grid-template-columns:minmax(0,1fr) 60px;gap:2px 8px;padding:8px 10px}
 #battle-screen .tutorial-card h2{grid-column:1;font-size:13px;margin:0;line-height:1.35}
 #battle-screen .tutorial-copy{grid-column:1;font-size:11px;line-height:1.4}
 #battle-screen .tutorial-skip{grid-column:2;grid-row:1 / span 2;align-self:center;min-width:60px;margin:0;font-size:10px}
}
.music-toggle:before,.sfx-toggle:before{display:none}.music-toggle,.sfx-toggle{padding-bottom:0}
/* Keep the primary action in the first desktop viewport. Small landscape
   retains normal page scrolling so the full race trait never sits under it. */
@media(min-height:521px) and (max-height:800px){
 body[data-page="prepare"] .site-header{height:60px;margin-bottom:12px}
 body[data-page="prepare"] .selection-intro{margin-bottom:10px}
 body[data-page="prepare"] .spotlight-image-wrap{height:210px}
 body[data-page="prepare"] .race-card-image{height:100px}
 body[data-page="prepare"] .mode-panel{margin-top:12px;padding:10px}
 body[data-page="prepare"] .selection-launch{margin-top:12px;padding-top:12px}
}
.lobby-entry.ranked small{white-space:nowrap;font-size:10px}
