:root{--ink:#f1e8d7;--muted:#bdc8bb;--gold:#dbbd83;--gold2:#f2d49d;--sea:#112b31;--sea2:#18383d;--card:#172f34;--line:#4f6963;--deep:#081b21;--bad:#f0a09d;--good:#bde5aa;--font-family-base:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;--font-family-display:Georgia,'Times New Roman',serif}*{box-sizing:border-box}html,body{margin:0;min-height:100%;width:100%;background:var(--deep);color:var(--ink);font-family:var(--font-family-base)}button,input{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.38}.screen-menu #game-screen,.screen-menu #encyclopedia-screen,.screen-menu #modal-mask,.screen-game #home-screen,.screen-game #encyclopedia-screen,.screen-encyclopedia #home-screen,.screen-encyclopedia #game-screen,.screen-encyclopedia #modal-mask{display:none!important}
/* Title / main menu */
.home-screen{position:relative;width:100%;height:100dvh;min-height:600px;overflow:auto;display:flex;flex-direction:column;background:#101f23 url('assets/terrain.png') center 45%/cover no-repeat}.hero-shade{position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,rgba(6,20,23,.97) 4%,rgba(9,29,32,.91) 34%,rgba(9,29,32,.40) 80%),linear-gradient(0deg,#081a1ddc,transparent 60%)}.home-top,.home-copy,.home-gallery,.home-footer{position:relative;z-index:1}.home-top{display:flex;align-items:center;justify-content:space-between;padding:24px 4.5%;color:var(--gold2);border-bottom:1px solid #d7c29335}.home-brand{font-weight:800;letter-spacing:3px;font-size:17px}.home-ver{color:#b6c7c2;font-size:10px;letter-spacing:1.5px}.home-ver b{color:#edce98;margin-left:8px}.home-copy{margin:4vh 0 0 7%;max-width:620px}.eyeline{color:#dcc397;font-size:11px;font-weight:750;letter-spacing:3px}.home-copy h1{font-family:var(--font-family-display);font-size:clamp(64px,9vw,126px);line-height:1.02;letter-spacing:5px;margin:14px 0 12px;text-shadow:0 10px 28px #000a;color:#f7e4bd}.home-motto{font-family:var(--font-family-display);font-style:italic;color:#d7d3bc;letter-spacing:.2px;font-size:clamp(16px,2.2vw,25px);margin:0}.gold-rule{height:1px;width:265px;background:linear-gradient(90deg,#cbb17b,transparent);margin:26px 0}.home-actions{display:flex;flex-direction:column;width:min(410px,85vw);gap:9px}.main-cta,.secondary-cta{display:flex;align-items:center;justify-content:space-between;border-radius:8px;border:1px solid #8c876c;min-height:51px;padding:10px 18px;text-align:left;color:#f1e7d4;background:#182f34cf;font-weight:700;font-size:14px;backdrop-filter:blur(6px)}.main-cta{color:#14292c;background:linear-gradient(90deg,#f0d49a,#c9a76f);border-color:#f3dda5}.main-cta:hover{filter:brightness(1.13)}.secondary-cta:hover{background:#304b4dcf;border-color:#dbc289}.main-cta span,.secondary-cta span{font-size:25px;font-weight:300}.home-gallery{margin:auto 5% 15px 7%;padding-top:25px}.gallery-kicker{font-size:10px;font-weight:800;letter-spacing:2px;color:#d6c298;margin-bottom:10px}.menu-flags{display:flex;gap:7px;flex-wrap:wrap}.menu-nation{display:flex;align-items:center;gap:7px;border:1px solid #b7a37b6b;background:#162a31bd;border-radius:6px;padding:4px 9px 4px 4px}.menu-nation img{width:47px;height:28px;object-fit:cover;border:1px solid #e2c68b;border-radius:3px}.menu-nation span{font-size:9px;color:#e0dfcc;max-width:120px}.home-footer{padding:12px 5%;color:#abbcb2;font-size:10px;border-top:1px solid #b5ad8e3b}
/* Main game screen */
.game-screen{width:100%;height:100dvh;min-height:560px;overflow:hidden;display:flex;flex-direction:column;background:linear-gradient(145deg,#102a30,#091a20)}.top{height:61px;flex:0 0 61px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 17px;background:#13292f;border-bottom:1px solid #8f7c55}.brand{font-family:var(--font-family-display);color:#f3e4c4;letter-spacing:2px;font-size:21px;font-weight:700;white-space:nowrap}.brand em{color:#d5b776;font-family:var(--font-family-base);font-style:normal;font-size:9px;letter-spacing:1px}.top-right{display:flex;align-items:center;gap:5px;flex-wrap:nowrap}.turnchip{font-size:11px;color:#dbddc7;padding:9px;border:1px solid #6a7260;border-radius:7px;white-space:nowrap;max-width:240px;overflow:hidden;text-overflow:ellipsis}.control{background:#233c42;border:1px solid #657268;border-radius:7px;padding:9px 10px;color:#eedcba;font-size:11px;white-space:nowrap}.control:hover{background:#345157}.file-load{cursor:pointer}.layout{min-height:0;flex:1;display:grid;grid-template-columns:minmax(188px,18%) minmax(0,1fr) minmax(228px,23%);gap:7px;padding:7px}.pane{background:#192f35;border:1px solid #53645a;border-radius:9px;overflow:auto;scrollbar-color:#778171 transparent;box-shadow:0 8px 30px #03111540}.pane-inner{padding:14px}.pane-title{font-size:10px;font-weight:850;letter-spacing:1.7px;color:#d7bf8c;margin-bottom:13px}.country-roster{display:flex;flex-direction:column;gap:5px}.country{display:flex;align-items:center;gap:8px;cursor:pointer;min-height:50px;padding:6px;border-radius:7px;border:1px solid #425a5699;background:#20393e}.country:hover{background:#365057}.country.selected{background:#464a3b;border-color:#cdb781}.country.active{box-shadow:inset 3px 0 #f0d497}.country-flag{width:48px;height:31px;flex-shrink:0;object-fit:cover;border:1px solid #d6be8e;border-radius:3px;box-shadow:0 2px 9px #0006}.country>div{min-width:0;flex:1}.country-name{font-size:10px;line-height:1.3;color:#f1e4ca;font-weight:750}.country-role{font-size:9px;color:#b2c7b9;margin-top:3px}.country-stat{font-weight:800;font-size:11px;color:#e2c388;white-space:nowrap}.rule{height:1px;background:#577064;margin:13px 0}.status{font-size:11px;line-height:1.7;color:#c4d1c6}.status strong{color:#eecf96}.ledger{font-size:10px;line-height:1.5;max-height:175px;overflow:auto;color:#c2cdc1}.log-entry{border-bottom:1px solid #3e5750;padding:7px 0}.log-entry .time{font-size:9px;color:#d8c28e;margin-bottom:3px}.map-pane{display:flex;flex-direction:column;overflow:hidden;position:relative;background:#0c2b36}.map-utilities{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 13px;background:#1c373b;border-bottom:1px solid #8c8763}.map-head{font-size:12px;color:#f3dfb7;letter-spacing:1.2px;font-weight:850}.map-head span{font-size:9px;margin-left:8px;color:#aebcae}.map-flag{font-size:10px;color:#acbfb6;margin-top:3px}.map-controls{display:flex;gap:5px}.sm{border:1px solid #65766c;background:#29444a;border-radius:6px;color:#f7e4ba;padding:6px 10px;min-width:32px;font-size:13px}.sm:hover{background:#3b5b60}.map-viewport{flex:1;min-height:0;position:relative;overflow:hidden;background:#143644;display:flex;align-items:center;justify-content:center}.world-map{display:block;width:100%;height:100%;min-width:0;min-height:0;max-height:100%;touch-action:none;background:#143644}.province-shape{cursor:pointer;vector-effect:non-scaling-stroke;stroke-linejoin:round;transition:fill-opacity .12s,stroke-width .12s}.province-shape.is-selected{filter:brightness(1.2) drop-shadow(0 0 5px #ffde9b)}.province-shape:hover{fill-opacity:.32!important}.province-label{fill:#fff2d5;font-size:10px;font-weight:760;pointer-events:none;paint-order:stroke;stroke:#0b1822;stroke-width:2px;stroke-linejoin:round}.army-label{fill:#fff0c2;font-size:14px;stroke:#152529;stroke-width:3px;paint-order:stroke;pointer-events:none}.map-marker{pointer-events:none}.rightpane .pane-inner{padding:14px}.rightpane h2{color:#f4e4c1;font-family:var(--font-family-display);font-size:22px;line-height:1.1;margin:0}.rightpane .inline{display:flex;align-items:center;gap:10px}.muted{color:#b4c8bc}.tiny{font-size:10px}.resources{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:13px 0}.resource{text-align:center;border:1px solid #52695e;background:#294048;padding:8px 4px;border-radius:7px}.resource .lbl{font-size:9px;color:#c4d1c4}.resource .val{font-size:20px;font-weight:850;color:#ffe1a9;margin:3px 0}.plus{color:#b6e3b0}.minus{color:#f09d95}.mini-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.mini-stats>div{background:#263e43;color:#b8caba;padding:8px 4px;text-align:center;font-size:9px;border-radius:7px}.mini-stats strong{display:block;font-size:16px;color:#f2d9ad;margin-bottom:4px}.stats-table{border-collapse:collapse;width:100%;font-size:11px;color:#c8d3c6}.stats-table td{padding:6px 3px;border-bottom:1px solid #43564d}.stats-table td:last-child{text-align:right;color:#f1d6a4;font-weight:700}.sideblock{padding:13px;border-top:1px solid #52665a}.area-name{font-family:var(--font-family-display);font-size:21px;color:#f2dfbc;font-weight:700}.area-owner{font-size:11px;color:#bbd0c1;margin:5px 0 10px}.yield{display:flex;gap:5px;flex-wrap:wrap;margin:6px 0 10px}.yield span{font-size:10px;background:#354745;border:1px solid #5d7263;padding:5px 7px;border-radius:5px}.actions{display:grid;gap:5px}.actions button{display:flex;flex-direction:column;align-items:flex-start;gap:3px;width:100%;padding:10px 11px;color:#f5e4c7;background:#2a4445;border:1px solid #596a5e;border-radius:7px;text-align:left;font-size:11px;font-weight:750}.actions button:hover:not(:disabled){background:#395858}.actions button small{font-size:9px;color:#b8c8bd;font-weight:400}.btn-end{width:100%;background:linear-gradient(90deg,#e8c887,#c0a06c);border:1px solid #ffe1a7;color:#183033;font-size:12px;padding:12px;border-radius:7px;font-weight:850}.footer-note{font-size:9px;line-height:1.6;color:#aebbad;margin:9px 0 0}.field{display:flex;flex-direction:column;gap:6px;margin:13px 0}.field label{font-size:11px;font-weight:750;color:#c1cabb}.field input,.field select{width:100%;padding:11px;border:1px solid #688077;background:#e9e4d4;border-radius:6px;color:#1b3438}.inline{display:flex;align-items:center;gap:8px}.secondary,.primary,.modal button,.modal select{cursor:pointer}.secondary,.primary{border-radius:7px;border:1px solid #bba578;padding:10px 15px;font-size:12px;font-weight:800}.primary{background:#cbb17d;color:#14272c}.secondary{background:#344d4e;color:#f4e2c4}.control:hover,.secondary:hover,.primary:hover{filter:brightness(1.08)}.modal-mask{position:fixed;z-index:99;inset:0;display:grid;place-items:center;padding:14px;background:#041218c9;backdrop-filter:blur(7px)}.modal{background:linear-gradient(155deg,#203c40,#12282d);border:1px solid #bda778;border-radius:15px;padding:25px 28px;color:#eadfc9;box-shadow:0 20px 60px #0009;width:min(590px,95vw);max-height:88dvh;overflow:auto;scrollbar-color:#879183 transparent}.modal .eyebrow{font-size:10px;color:#dbbd82;letter-spacing:1.8px;font-weight:800}.modal h2{font-family:var(--font-family-display);font-size:27px;color:#f7e6c1;margin:11px 0 13px}.modal p{font-size:13px;line-height:1.7;color:#d7dfd1}.modal .big-sigil{display:grid;place-items:center;font-size:33px;width:65px;height:65px;border:1px solid #bca46e;border-radius:9px}.modal .btnrow{display:flex;flex-wrap:wrap;gap:7px;justify-content:flex-end;margin-top:17px}.modal .scrollbox{max-height:42dvh;overflow:auto}.modal .event-note{padding:12px;border-left:2px solid #ddc48e;background:#344944;margin:10px 0;font-size:12px}.modal .listline{display:flex;justify-content:space-between;gap:15px;border-bottom:1px solid #445c53;padding:8px 0;font-size:12px}.modal .listline strong{color:#efcf8e}.modal .notice{border:1px solid #b09e7b;background:#2c4240;color:#e7d8b2;padding:10px;font-size:12px}.modal .start-list{display:grid;grid-template-columns:1fr 1fr;gap:8px;font-size:11px}.modal .start-list>div{background:#314744;padding:10px;border-radius:7px}.modal .selections{display:grid;gap:7px}.modal .selected-op{outline:2px solid #e4c891}.modal button:disabled{opacity:.4}.modal .danger{color:#e9938d}.turn-banner{display:block;width:100%;max-height:180px;object-fit:cover;border-radius:9px;border:1px solid #ceb682;margin:0 0 18px;box-shadow:0 10px 25px #0008}.country-flag{width:65px;height:42px}
/* Full-page atlas with natural scrolling */
.encyclopedia-screen{width:100%;height:100dvh;display:flex;flex-direction:column;background:#0b2028;color:#efdfbf;overflow:hidden}.codex-header{display:flex;align-items:center;gap:30px;flex-shrink:0;background:#122c34;border-bottom:1px solid #816f55;padding:13px 25px;min-height:72px}.nav-back{color:#efdaac;background:#263f42;border:1px solid #637064;border-radius:8px;padding:10px 15px;font-size:12px}.codex-header small{color:#cdb17d;font-size:10px;letter-spacing:2px}.codex-header h1{font-family:var(--font-family-display);font-size:25px;margin:3px 0 0;line-height:1.1}.codex-scroll{flex:1;overflow-y:auto;scrollbar-color:#87928a transparent;padding:26px max(5vw,25px) 80px;scroll-behavior:smooth}.era-card{background:linear-gradient(100deg,#39463e,#263f40);border:1px solid #ae996e;display:flex;gap:18px;align-items:center;border-radius:14px;padding:18px 25px;max-width:1300px;margin:auto}.era-mark{color:#f2d79b;font-size:42px}.era-card small{color:#e6cb92;letter-spacing:2px;font-size:10px}.era-card h2{font-family:var(--font-family-display);margin:5px 0;font-size:27px}.era-card p{color:#cbd9c9;font-size:13px;line-height:1.65;margin:0}.codex-intro{max-width:1300px;margin:30px auto 12px}.codex-intro h2{font-size:22px;font-family:var(--font-family-display);margin:0 0 4px}.codex-intro p{font-size:12px;color:#b5c5b8;line-height:1.6}.lore-picks{max-width:1300px;margin:auto;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.lore-picker{display:flex;align-items:center;gap:10px;text-align:left;border:1px solid #526c60;border-radius:9px;color:#e2ddc4;background:#1c373d;padding:8px}.lore-picker.active,.lore-picker:hover{background:#404a3f;border-color:#ddc085}.lore-picker img{width:62px;height:42px;border:1px solid #d1bb8a;border-radius:4px;object-fit:cover;flex-shrink:0}.lore-picker strong{font-size:11px}.lore-picker span{font-size:9px;color:#b4c2b5;display:block;margin-top:2px}.lore-content{max-width:1300px;margin:15px auto 0;background:linear-gradient(110deg,#203a3d,#142b32);border:1px solid #5b6b5e;border-radius:14px;padding:24px 34px}.lore-hero{display:flex;gap:24px;align-items:center;padding-bottom:20px;border-bottom:1px solid #5c6c5e}.lore-hero img{width:225px;height:136px;object-fit:cover;border:2px solid #d4bd8d;border-radius:8px;box-shadow:0 9px 30px #0006}.lore-hero small{color:#d1b77b;letter-spacing:2px;font-size:10px}.lore-hero h2{font-family:var(--font-family-display);font-size:clamp(26px,3vw,40px);margin:5px 0}.lore-hero em{font-size:17px;font-family:var(--font-family-display);color:#e1d19f}.lore-hero p{color:#c8d6c9;font-size:12px}.lore-event{display:flex;align-items:center;gap:15px;padding:15px 18px;margin:18px 0;background:#3b4a41;border-left:4px solid #e2c48c;border-radius:6px}.lore-event span{font-size:10px;color:#d1d4b5;letter-spacing:1.3px}.lore-event strong{display:block;font-family:var(--font-family-display);font-size:19px;color:#f6deb0;margin-top:4px}.lore-chapter{margin:26px 0}.lore-chapter h3{font-family:var(--font-family-display);color:#f3dba8;font-size:24px;margin:0 0 12px}.lore-chapter p{font-size:15px;line-height:1.9;color:#e3e5d6;max-width:94ch;margin:0}.timeline{max-width:1300px;margin:35px auto 0}.timeline h2{font-family:var(--font-family-display);font-size:23px}.timeline-list{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}#timeline-list{display:grid;grid-template-columns:1fr 1fr;gap:8px}.timeline-row{display:flex;align-items:center;gap:12px;background:#1b343a;border:1px solid #52665e;border-radius:7px;padding:10px;font-size:12px}.timeline-row strong{width:72px;color:#ddc38b}.timeline-row span{color:#f2dbaa}.codex-caveat{font-size:11px;color:#a9bcb2;max-width:1300px;margin:25px auto 0}
@media(max-width:1170px){.layout{grid-template-columns:185px minmax(0,1fr) 230px}.pane-inner{padding:10px}.sideblock{padding:10px}.rightpane h2{font-size:17px}.country-flag{width:40px;height:27px}.country-name{font-size:9px}.country-role{font-size:8px}.country-stat{font-size:9px}.turnchip{max-width:170px}.control{padding:8px;font-size:10px}.brand{font-size:16px}.top{gap:7px;padding:6px 8px}.lore-picks{grid-template-columns:repeat(4,1fr)}.lore-picker img{width:47px;height:35px}}
@media(max-width:900px) and (orientation:landscape){.layout{grid-template-columns:142px minmax(0,1fr) 202px;gap:4px;padding:4px}.top{height:49px;flex-basis:49px}.brand{font-size:14px}.turnchip{font-size:9px;max-width:130px}.control{font-size:9px;padding:7px 5px}.country{min-height:38px;padding:4px;gap:5px}.country-flag{width:34px;height:23px}.country-stat{display:none}.pane-title{font-size:9px}.resource .val{font-size:16px}.resources{gap:3px}.resource .lbl{font-size:8px}.mini-stats strong{font-size:13px}.actions button{padding:7px 8px;font-size:10px}.actions button small{font-size:8px}.map-head{font-size:10px}.map-flag{font-size:9px}.map-utilities{padding:6px}}
@media(max-width:720px) and (orientation:portrait){.game-screen{min-height:100dvh;height:auto;overflow:auto}.layout{display:flex;flex-direction:column;min-height:0}.map-pane{height:60vh;min-height:430px;order:0}.leftpane{order:2;max-height:350px}.rightpane{order:1;max-height:none}.country-roster{display:grid;grid-template-columns:1fr 1fr}.top{height:auto;flex-wrap:wrap}.top-right{flex-wrap:wrap}.brand{font-size:16px}.home-copy{margin:6vh 7% 45px}.home-screen{min-height:100dvh}.home-gallery{margin-top:25px}.home-copy h1{font-size:64px}.lore-picks{grid-template-columns:1fr 1fr}.lore-content{padding:14px}.lore-hero{flex-direction:column;align-items:flex-start}.lore-hero img{width:100%;max-width:300px}.codex-header{padding:11px;gap:12px}.codex-header h1{font-size:17px}.era-card{padding:12px}.era-card h2{font-size:20px}#timeline-list{grid-template-columns:1fr}}
@keyframes handoffWave{0%,100%{transform:perspective(850px) rotateY(-4deg) skewY(-.3deg) scaleX(.98)}35%{transform:perspective(850px) rotateY(6deg) skewY(.9deg) scaleX(.95)}67%{transform:perspective(850px) rotateY(-3deg) skewY(-.7deg) scaleX(.99)}}
.turn-banner{transform-origin:left center;animation:handoffWave 3.6s ease-in-out infinite}
