@charset "UTF-8";
/* Approved R4 art. Geometry and safe-area reservations from R3 remain in force. */
:root { --paper:#f5eedc; --panel:#fff9e7; --ink:#253b3c; --teal:#356b67; --teal-deep:#173e43; --gold:#bd9550; --line:#ceba8c; --r4-dark:#153237; --r4-gold:#d9ba75; }
#battle-screen,#map-world { user-select:none; -webkit-user-select:none; }
#battle-screen img { -webkit-user-drag:none; }
#battle-screen .trait-toast { top:calc(138px + var(--r3-safe-top)); bottom:auto; left:max(14px,var(--r3-safe-left)); right:auto; transform:none; width:200px; max-width:calc(100% - 154px - var(--r3-safe-left) - var(--r3-safe-right)); }
#battle-screen .tutorial-card:not([hidden]) ~ .trait-toast { display:none; }
body { background:radial-gradient(ellipse at 0 0,#e6dfbf66,transparent 55%),repeating-linear-gradient(125deg,#b99c5b04 0 1px,transparent 1px 7px),#f5eedc; }
.site-header { border-bottom:2px solid #b79854; position:relative; }
.site-header:after { content:""; position:absolute; bottom:-5px; left:0; right:0; border-bottom:1px solid #d7c395; pointer-events:none; }
.brand b,.selection-intro h1,.section-heading h2,.difficulty-panel h2,.dispatch-heading h2,.result-card h2,.rules-heading h2 { font-family:"Songti SC",SimSun,"Microsoft YaHei",serif; }
.brand-mark { background:#173e43; color:#f6d78d; filter:drop-shadow(0 2px 0 #9a7134); }
.brand b { color:#1b4143; }.brand small { color:#8a795b; }
.selection-intro h1 em { color:#9e3a29; }
.selection-intro .eyebrow { color:#92713b; }
.eyebrow>span { background:#a34430; }
.icon-button,.quiet-button,.tactics-drawer>summary,.map-controls { color:#e8d49c; border:1px solid #bb934a; background:linear-gradient(#25494c,#16373c); border-radius:5px; box-shadow:inset 0 0 0 2px #142d32,0 2px 0 #9e7a3e33; }
.icon-button:hover,.quiet-button:hover { background:#315d5d; }
.help-button>span { border-color:#bd9d60; }
.music-toggle[aria-pressed="false"],.sfx-toggle[aria-pressed="false"] { color:#b8b49e; background:#314549; }
.primary-button { position:relative; color:#fff0c8; background:linear-gradient(#b25136,#8b3024); border:1px solid #d3aa58; border-radius:5px; box-shadow:inset 0 0 0 3px #7c2e22,inset 0 0 0 4px #d3aa5866,0 4px 0 #652e23; }
.primary-button:before,.primary-button:after { content:""; position:absolute; width:7px; height:7px; border:1px solid #e1bd72; pointer-events:none; }
.primary-button:before { top:5px; left:5px; border-right:0; border-bottom:0; }.primary-button:after { bottom:5px; right:5px; border-left:0; border-top:0; }
.primary-button:hover { background:linear-gradient(#bc6240,#963a27); }.primary-button:active { box-shadow:inset 0 0 0 3px #7c2e22,0 2px 0 #652e23; }
.race-spotlight { background:#193c40; border:2px solid #be9855; border-radius:7px; box-shadow:inset 0 0 0 3px #e3c48033,0 6px 18px #27434319; }
.spotlight-image-wrap:after { background:linear-gradient(180deg,transparent 65%,#193c40); }
.spotlight-content { color:#fff2ce; }.spotlight-title,.selection-tactic { color:#c4c7ab; }.spotlight-trait .trait-name { color:#e0bd78; }.spotlight-trait { border-color:#c3a56355; }.spotlight-trait p { color:#fff0c9; }
.spotlight-index { color:#fff1c8; text-shadow:0 1px 4px #14282e; }
.race-card { border:1px solid #b89b65; border-radius:5px; background:#fff9e8; box-shadow:0 2px 0 #c5ab79; }
.race-card.active { border-color:#af7134; box-shadow:0 0 0 2px #d9b769,0 3px 0 #987140; background:#f4e4bb; }
.race-card-name { color:#324c48; }.race-card-trait { color:#887044; }.race-check { background:#8e382a; color:#fff4cd; border:1px solid #e0b35c; }
.race-card-image img { object-position:50% 25%; }
.race-card[data-race="ghost"] .race-card-image img,.spotlight-image[src*="ghost.webp"],.faction img[src*="ghost.webp"],.trait-row img[src*="ghost.webp"],.result-race img[src*="ghost.webp"] { object-position:50% 0%!important; }
.difficulty-panel { border:1px solid #c8b077; border-radius:5px; background:linear-gradient(#fff9e8,#eee3c4); }
.difficulty-panel h2 { color:#4c5445; }.difficulty-panel p { color:#8c7957; }.difficulty-buttons button { color:#736044; border-color:#bfaa7e; border-radius:4px; background:#f4ecd7; }
.difficulty-buttons button[aria-pressed="true"] { background:#244b4c; border-color:#bfa16b; color:#f6e4b4; box-shadow:inset 0 0 0 2px #bda26d55,0 2px 0 #183538; }
.selection-launch { border-color:#bfa46c; }.launch-note b { color:#4b5848; }.launch-note small { color:#8d7a59; }.local-record { color:#958261; }.roster-footnote { color:#8a7a5d; }
/* The reference's dark lacquer, gold double rims and banner-shaped plates. */
#battle-screen .battle-status { background:linear-gradient(#29494a,#142f35); border-bottom:2px solid #b9934e; box-shadow:inset 0 3px #e6c88755,inset 0 -5px #081e24aa,0 3px 12px #152e3d38; }
#battle-screen .battle-status:after { content:""; position:absolute; bottom:5px; left:0; right:0; height:7px; pointer-events:none; background:repeating-linear-gradient(90deg,transparent 0 22px,#d9b36a66 22px 24px,transparent 24px 29px,#d9b36a44 29px 36px,transparent 36px 48px); opacity:.45; }
.battle-status .status-stat>span { color:#d0c095; }.battle-status .status-stat>b { color:#ffdf98; text-shadow:0 2px #071f27; }
.battle-status .battle-clock>b { color:#fce6b1; }.battle-status .battle-clock small { color:#baa97a; }
.battle-status .battle-clock { padding:2px 12px; border-left:1px solid #b7934a77; border-right:1px solid #b7934a77; }
#battle-screen .battle-status .icon-button { color:#eed6a1; border-color:#ac8848; border-radius:4px; background:linear-gradient(#304c4b,#173339); box-shadow:inset 0 0 0 2px #b3965625; }
.battle-instruction { color:#224b45; text-shadow:0 1px 2px #fff9de,0 0 5px #fff9de; }
.player-trait { border:1px solid #bd9c58; border-left:3px solid var(--trait-color,#b79854); color:#3c5848; border-radius:4px; background:#fff8e5ef; box-shadow:0 2px 3px #60462615; }
#battle-screen .battle-scoreboard .faction { background:linear-gradient(90deg,#fff6ddf5,#e9dcbbe8); border:1px solid #b59c67; border-left:3px solid var(--race-color); border-radius:3px; }
#battle-screen .battle-scoreboard .faction img { display:block; flex-shrink:0; width:24px; height:31px; border:1px solid #b79a59; border-radius:3px; object-fit:cover; object-position:50% 25%; }
.rank-heading { color:#526a52; text-shadow:0 1px #fff8df; }.faction-name { color:#374b40; }.faction-stats { color:#8b7753; }
#battle-screen .dispatch-panel { background:linear-gradient(#274a49,#142f35); border:2px solid #b08c4c; border-bottom:0; border-radius:9px 9px 0 0; box-shadow:inset 0 0 0 3px #081f2599,inset 0 0 0 4px #d1af6255,0 -3px 14px #13333330; }
.dispatch-heading h2 { color:#eed7a0; }.dispatch-panel .dispatch-heading>span { color:#d6c08b; }.dispatch-panel .selected-building-info { color:#bcbca3; }
.dispatch-actions .ratio-buttons button { position:relative; color:#f6dfaa; border:1px solid #bba264; border-radius:4px; background:linear-gradient(#355b59,#1a3e43); box-shadow:inset 0 0 0 2px #0d2e34,inset 0 0 0 3px #ba9b5755,0 3px 0 #0b232a; }
.dispatch-actions .ratio-buttons button:after { content:""; position:absolute; left:50%; bottom:3px; transform:translateX(-50%); width:14px; height:3px; border-top:1px solid #c5a25a; border-bottom:1px solid #c5a25a; opacity:.6; pointer-events:none; }
.dispatch-actions .ratio-buttons button.active { background:linear-gradient(#b24d32,#8c3025); border-color:#f2cd79; color:#fff1bd; box-shadow:inset 0 0 0 2px #762c24,inset 0 0 0 3px #e8c47788,0 3px 0 #572321; }
.select-all-button { color:#ecd69e; border:1px solid #be9d58; border-radius:4px; background:linear-gradient(#695e34,#4d4b2b); box-shadow:inset 0 0 0 2px #e4be6122,0 3px 0 #273a28; }
.select-all-button[aria-pressed="true"] { background:linear-gradient(#a08945,#75622c); border-color:#efd091; }
#battle-screen .map-controls,#battle-screen .minimap-panel,.tactics-drawer>summary { color:#edd7a0; border-color:#b18d4d; background:linear-gradient(#294b4b,#19363c); border-radius:5px; box-shadow:inset 0 0 0 2px #102b33,0 3px 8px #15343722; }
#battle-screen .map-controls button { color:#f2ddaa; border-radius:3px; }#battle-screen .map-controls #map-zoom { color:#d2c69f; }#battle-screen .map-controls button:hover { background:#4a6961; }
.minimap-panel button { color:#eddbad; }#minimap { border-color:#a78e5b; border-radius:3px; background:#adb98f; }
.tactics-drawer[open]>summary { color:#ffedbc; border-color:#d9b266; background:#3a5b55; }
.tactics-content { border:2px solid #ad8d4f; border-radius:6px; background:#faf0d9fa; box-shadow:inset 0 0 0 3px #d4bb8622,0 10px 35px #203c3538; }
.tactics-title { border-color:#cfbc91; }.route-buttons button,.rematch-races button { color:#40594c; background:#f1e5c9; border:1px solid #bea679; border-radius:4px; }.route-buttons button.active { background:#254e4c; color:#fce8b0; border-color:#bfa162; }
.tutorial-card,.trait-toast { border-color:#b6995b; border-radius:5px; background:#fff5dcf5; box-shadow:0 4px 12px #2645331c; }
.result-card,.rules-card,.pause-overlay>div { border:2px solid #bb9451; border-radius:7px; background:linear-gradient(135deg,#fff9e8,#efe2c4); box-shadow:inset 0 0 0 4px #f8edcd,inset 0 0 0 5px #d2b77f,0 15px 55px #0d2b3355; }
.result-card h2,.rules-card h2,.pause-overlay h2 { color:#254c48; }.result-kicker { color:#ab8246; }.result-copy { color:#807256; }.result-mvp { border-color:#d0b37a; border-radius:4px; background:#eadcba; }.result-race img { width:42px; height:48px; border:1px solid #bba269; border-radius:4px; }.result-stats { border-color:#d0b782; }.result-stats b { color:#8d3d2c; }.result-stats small { color:#8b7855; }.rules-note { background:#e9dec1; }.how-to li { border-color:#cdb989; }.how-to li>span { color:#af8245; }.rules-note b { color:#4b6048; }
/* Approved islands and a real pennant. No opaque placeholders are drawn while loaded. */
#map-world { background:#bfd0a6; }
#map-world .map-terrain { background:#bccca6 url('../img/map.webp') center/100% 100% no-repeat; }
#map-world .city-art { object-fit:contain; filter:drop-shadow(0 4px 3px #334b383b); }
#map-world .building .town-flag { display:block; position:absolute; left:72%; top:2%; width:31px; height:51px; transform-origin:2px 95%; z-index:2; pointer-events:none; }
#map-world .building .town-flag:before { content:""; position:absolute; top:0; left:0; width:3px; height:48px; border-radius:2px; background:linear-gradient(90deg,#5a492b,#e6c989,#80623d); box-shadow:1px 1px 1px #173b3144; }
#map-world .building .town-flag:after { content:""; position:absolute; top:-4px; left:-2px; width:7px; height:7px; border-radius:50%; background:#ffe2a2; border:1px solid #9e7745; }
#map-world .building .town-flag i { display:block; position:absolute; top:1px; left:3px; width:27px; height:24px; clip-path:polygon(0 0,100% 7%,84% 51%,98% 96%,0 87%); background:var(--faction); border-top:2px solid #ffe7ad; filter:drop-shadow(1px 2px 1px #33493055); transform-origin:0 50%; animation:r4-banner 2.2s ease-in-out infinite; }
#map-world .building .town-flag i:after { content:""; position:absolute; inset:5px 9px 5px 6px; border:1px solid #fff2bfcc; transform:rotate(45deg); }
#map-world .building.just-captured .town-flag { animation:r4-flag-claim 1.35s cubic-bezier(.15,.8,.25,1) both; }
#map-world .city-fallback { display:none; position:absolute; inset:14px; font:52px/1.1 serif; text-shadow:0 1px #fff2c5; color:var(--faction-deep); }
#map-world .city-art.art-missing { visibility:hidden; }#map-world .city-art.art-missing~.city-fallback { display:block; }
#map-world .building-count { border-color:#f4d68b; border-radius:5px; min-width:38px; background:var(--faction-deep); box-shadow:inset 0 0 0 1px #fff4be44,0 2px 0 #725c38; font-size:26px; }
#map-world .building-name { border:1px solid #d0b876aa; color:#46573b; background:#fff4d5ed; border-radius:3px; padding:2px 6px; letter-spacing:.5px; box-shadow:0 2px 0 #6a7b3920; }
#map-world .building-owner-mark { color:#304d42; text-shadow:0 1px #fff4cf,1px 0 #fff4cf,-1px 0 #fff4cf; }
.r4-battle-canvas { position:absolute; inset:0; z-index:4; pointer-events:none; }
@keyframes r4-banner { 0%,100% { transform:skewY(-3deg) scaleX(.96); }50% { transform:skewY(4deg) scaleX(1); } }
@keyframes r4-flag-claim { 0% { transform:translateY(16px) rotateY(88deg) scale(.65); opacity:.2; }30% { transform:translateY(-6px) rotateY(-25deg) scale(1.15); opacity:1; }70% { transform:rotateY(20deg); }100% { transform:none; } }
/* A compact desktop war table: all twelve approved portraits visible together. */
@media(min-width:1000px) {
  #app { max-width:1320px; padding-left:max(30px,var(--r3-safe-left)); padding-right:max(30px,var(--r3-safe-right)); }
  .site-header { height:66px; margin-bottom:16px; }.brand b { font-size:23px; }
  .selection-intro { margin-bottom:16px; }.selection-intro h1 { font-size:30px; margin-top:3px; line-height:1.3; }.selection-intro .eyebrow { font-size:10px; }.selection-intro .intro-copy { font-size:12px; margin-top:3px; }
  .session-badge b { font-size:36px; }
  .selection-layout { grid-template-columns:250px minmax(0,1fr); gap:24px; }
  .race-spotlight { min-height:342px; }.spotlight-image-wrap { height:205px; }.spotlight-content { padding:0 17px 14px; }.spotlight-name { font-size:25px; }.spotlight-title { font-size:10px; }.spotlight-trait { margin-top:10px; padding-top:8px; }.spotlight-trait p { font-size:12px; min-height:0; }.selection-tactic { font-size:10px; padding-top:8px; }
  .race-grid { grid-template-columns:repeat(6,minmax(0,1fr)); gap:12px; }.race-card { min-height:137px; }.race-card-image { height:91px; }.race-card-name { font-size:13px; padding-top:6px; }.race-card-trait { font-size:10px; padding-top:3px; padding-bottom:6px; }.section-heading { margin-bottom:10px; }.roster-footnote { margin-top:10px; font-size:11px; }
  .difficulty-panel { margin-top:16px; padding:9px 16px; min-height:62px; }.difficulty-panel h2 { font-size:14px; }.difficulty-panel p { margin-top:3px; font-size:11px; }.difficulty-buttons button { min-height:44px; }
  .selection-launch { margin-top:14px; padding-top:14px; }.launch-button { min-height:50px; }.local-record { margin-top:12px; font-size:10px; }
}
@media(max-width:700px) {
  .spotlight-image-wrap:after { background:linear-gradient(90deg,transparent 75%,#193c40); }
  .selection-launch { background:linear-gradient(#f5eedcf5,#f5eedc); }
  .race-grid { gap:9px; }.race-card { border-radius:4px; }
}
@media(max-height:520px) and (orientation:landscape) {
  #battle-screen .trait-toast { top:calc(124px + var(--r3-safe-top)); max-width:200px; }
  #battle-screen .battle-scoreboard .faction img { display:none; }
  .battle-status .battle-clock { padding:0 10px; }.battle-status .status-stat { gap:5px; }
  #battle-screen .dispatch-panel { border-radius:6px 6px 0 0; }
  .dispatch-panel .dispatch-heading h2 { font-size:11px; }.dispatch-panel .dispatch-heading>span { font-size:10px; }
  .dispatch-panel .selected-building-info { font-size:9px; margin-top:7px; }
  .dispatch-actions .ratio-buttons { gap:5px; }.dispatch-actions .ratio-buttons button { font-size:21px; padding:0; }.dispatch-actions .ratio-buttons button>span { font-size:10px; }
  .result-card .result-race img { width:34px; height:42px; }
}
@media(orientation:portrait) {
  #battle-screen .trait-toast { top:calc(180px + var(--r3-safe-top)); }
  .selection-screen:after { content:attr(data-orientation); display:block; text-align:center; font-size:10px; color:#8f7a51; margin-top:9px; }
}
@media(prefers-reduced-motion:reduce) { #map-world .building .town-flag,#map-world .building .town-flag i { animation:none!important; } }
#map-world .city-fallback:not([hidden]) { display:block; }
#map-world .map-backdrop { display:block; object-fit:fill; background:#bfd0a6; }
/* Extend the approved landscape beyond the finite rule-space, softly, under HUD. */
#battle-screen #battle-map { background:#b8c8a4 url('../img/map.webp') center/cover no-repeat; }
#battle-screen #battle-map:before { content:""; position:absolute; inset:-18px; z-index:-1; background:inherit; filter:blur(10px) saturate(.72) brightness(1.08); pointer-events:none; }
