
:root{--bg:#eeece5;--ink:#22332f;--muted:#7b8177;--gold:#b28a46;--line:#d7d5c9;--paper:#faf9f3;--red:#923d35}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:"Microsoft YaHei","PingFang SC",sans-serif;font-size:13px}button,input,select{font:inherit}button{cursor:pointer;border:1px solid var(--line);background:transparent;color:inherit;padding:9px 13px;border-radius:4px;transition:.15s}button:hover{background:#e6e1d3;border-color:var(--gold)}button:disabled{opacity:.35;cursor:not-allowed}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #b28a46;outline-offset:3px}header{height:85px;background:#182b29;color:#f5f1e4;display:flex;align-items:center;justify-content:space-between;padding:0 30px;border-bottom:3px solid #b28a46;gap:20px}.brand{display:flex;gap:13px;align-items:center;text-decoration:none;color:inherit;font:36px Georgia,serif}.brand span{font-size:23px;letter-spacing:2px}.brand small{display:block;font:9px sans-serif;letter-spacing:3px;margin-top:7px;color:#c4b597}.rounds{display:flex;gap:16px}.round{display:flex;align-items:center;gap:7px;color:#8c9b91;font-size:11px}.round b{display:grid;place-items:center;width:29px;height:29px;border:1px solid #5d6d5d;border-radius:50%;font:15px Georgia}.round.current{color:#e3c893}.round.current b{background:#b28a46;color:#fff;border-color:#b28a46}.round.done b{background:#40554a}.header-actions{display:flex;gap:9px;align-items:center}.header-actions span{font-size:10px;color:#a0aea2}.header-actions button{border-color:#536052}.layout{display:grid;grid-template-columns:210px minmax(520px,1fr) 250px;max-width:1900px;margin:auto;min-height:calc(100vh - 85px)}.ledger{border-right:1px solid var(--line);padding:27px 18px;background:#f6f4ed}main{min-width:0;padding:24px}.right{padding:24px 18px 24px 0}.eyebrow{font-size:9px;letter-spacing:2px;color:var(--gold);font-weight:700}h1,h2,h3,p{margin:0}h2{font-family:Georgia,"Microsoft YaHei",serif;font-size:20px;margin:8px 0}h3{font-size:14px}.muted{color:var(--muted)}.small{font-size:10px;line-height:1.8;margin-top:16px}.ledger>p{font-size:11px;margin-bottom:25px}.resource{display:flex;align-items:center;gap:8px;padding:7px 0}.token{width:25px;height:25px;display:grid;place-items:center;border-radius:50%;font-size:15px;background:var(--token);color:var(--text,#fff);box-shadow:inset 0 0 0 2px #ffffff45}.resource .name{flex:1;font-size:11px}.counter{display:flex;align-items:center;gap:7px}.counter button{border:0;padding:2px 5px;color:#868676}.counter b{min-width:17px;text-align:center;font:17px Georgia}.aside-title{display:flex;justify-content:space-between;align-items:center;font-size:11px;font-weight:700;border-top:1px solid var(--line);padding-top:17px;margin:20px 0 10px}.aside-title span{font-size:9px;color:var(--muted);font-weight:400}.text-btn{border:0;padding:0;color:var(--gold);font-size:10px}.prod-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}.prod-item{font-size:10px;text-align:center;background:#eae8dd;padding:6px 2px;border-radius:3px}.prod-item b{display:block;font-size:14px;margin-top:3px}.score{border-top:1px solid var(--line);margin-top:17px;padding:18px 0;display:flex;align-items:center;justify-content:space-between}.score strong{font:33px Georgia;color:var(--gold)}.wide{display:block;width:100%;margin-top:10px;font-size:11px}.hero{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:5px 3px 22px;overflow:hidden}.hero h1{font:25px Georgia,"Microsoft YaHei",serif;margin:11px 0}.hero p{font-size:11px;color:var(--muted);line-height:1.8}.hero img{height:103px;width:67px;object-fit:cover;border:3px solid #bca46e;transform:rotate(5deg);border-radius:3px}.phase-bar{background:#263e35;color:#f1f1e5;padding:19px 22px;display:flex;justify-content:space-between;align-items:center;gap:15px;border-radius:5px;margin-bottom:20px}.phase-bar h2{font-size:20px}.phase-bar p{font-size:11px;color:#bac6b6;line-height:1.8}.primary{background:var(--gold);color:#fff;border-color:var(--gold);white-space:nowrap}.primary:hover{background:#967136;color:#fff}.panel{background:var(--paper);border:1px solid var(--line);border-radius:5px;padding:17px;margin-bottom:18px}.section-head{display:flex;justify-content:space-between;align-items:center;gap:9px;margin-bottom:15px}.section-head h3 span{font-size:8px;letter-spacing:1.5px;color:var(--muted);font-weight:400;margin-left:7px}.section-head>span{font-size:10px;color:var(--muted)}.castles{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:11px}.castle{text-align:center;position:relative}.castle>button{padding:0;border:0;background:none;width:100%}.castle img{display:block;width:100%;aspect-ratio:638/1016;object-fit:contain;border-radius:4px;box-shadow:0 3px 7px #0002}.castle.past img{filter:sepia(.7) brightness(.6)}.castle.current img{outline:2px solid var(--gold);outline-offset:3px}.castle-label{font-size:10px;margin-top:11px;color:var(--muted)}.tent{position:absolute;bottom:28px;left:8px;background:#284f69;color:#fff;padding:4px 7px;border-radius:3px;font-size:10px}.rival{background:#944e43;left:auto;right:4px;bottom:52px}.card-row{display:flex;gap:12px;min-height:130px;align-items:center}.card-small{width:min(15%,100px);padding:0;border:0;background:none;position:relative}.card-small img{width:100%;display:block;border-radius:4px;box-shadow:0 3px 7px #0002}.card-small span{display:block;font-size:9px;margin-top:7px;color:var(--muted)}.card-small.resolved{opacity:.35}.tabs{display:flex;border-bottom:1px solid var(--line);gap:17px;margin-bottom:15px}.tabs button{border:0;border-radius:0;padding:11px 4px;font-size:12px;color:#7c8478}.tabs button.active{color:var(--ink);border-bottom:3px solid var(--gold);font-weight:700}.workspace{min-height:280px}.toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}.toolbar .tools{display:flex;gap:5px;flex-wrap:wrap}.toolbar button{padding:6px 10px;font-size:11px}.toolbar button.selected{background:#263e35;color:#fff}.toolbar small{font-size:10px;color:var(--muted)}.sheet-scroll{max-height:700px;overflow:auto;background:#e4dac4;border-radius:4px}.sheet-wrap{position:relative;min-width:100%;line-height:0}.sheet-wrap img{width:100%;display:block;user-select:none}.sheet-wrap canvas{position:absolute;inset:0;width:100%;height:100%;cursor:crosshair;touch-action:pan-y}.right .eyebrow{margin-bottom:10px}.right h3{margin-bottom:10px}.council-text{font-size:11px;line-height:1.95;color:#717b6c;border-bottom:1px solid var(--line);padding:0 0 14px;margin-top:12px}.right ol{list-style:none;padding:0;margin:0;max-height:480px;overflow:auto}.right li{font-size:11px;line-height:1.8;border-left:1px solid #d3c5a7;padding:0 0 17px 12px;position:relative;color:#727b70}.right li::before{content:'';height:5px;width:5px;border-radius:50%;background:#b28a46;position:absolute;left:-3px;top:6px}.right li b{display:block;font-size:9px;color:#a39c89;font-weight:400}.credits{font-size:9px;color:#92958c;line-height:2;text-align:center;padding:12px}.empty{color:var(--muted);font-size:12px;line-height:2}.domain-cards,.path-cards{display:flex;gap:16px;flex-wrap:wrap;margin-top:16px}.domain-cards img{width:130px;border-radius:4px}.path-cards>div{width:130px}.path-cards img{width:100%}.path-cards label{display:flex;align-items:center;gap:6px;font-size:10px;margin-top:8px}.path-cards input{width:47px}.defense-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px}.fortress{position:relative;aspect-ratio:1;background:url('assets/atlas-43.webp') center/contain no-repeat;max-width:360px;margin:auto;width:100%}.fort-row{background:#fbf7eadf;padding:5px;position:absolute;border-radius:4px;display:flex;align-items:center;gap:4px;font-size:10px;box-shadow:0 2px 7px #0003}.fort-row input{width:36px;padding:2px}.fort-row.north{top:5%;left:23%}.fort-row.east{top:44%;right:0}.fort-row.south{bottom:3%;left:23%}.fort-row.west{top:44%;left:0}.fort-center{position:absolute;left:27%;top:37%;width:46%;text-align:center;background:#f9f4e6ed;border-radius:4px;padding:10px;font-size:11px;line-height:2}.field{display:flex;gap:10px;align-items:center;justify-content:space-between;margin:11px 0;font-size:12px}.field input{width:65px;padding:5px;border:1px solid var(--line);border-radius:3px}.field select{padding:6px;max-width:70%}.notice{font-size:11px;line-height:1.9;padding:12px 15px;background:#eee9d9;border-left:3px solid var(--gold);margin:12px 0}.columns{display:grid;grid-template-columns:1fr 1fr;gap:20px}.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:0 22px}dialog{border:1px solid #bcb6a3;background:#faf8ee;color:var(--ink);border-radius:8px;max-width:840px;width:90vw;padding:30px;box-shadow:0 25px 100px #0006}dialog::backdrop{background:#10201cc2;backdrop-filter:blur(3px)}dialog h2{margin-top:0;margin-bottom:16px}dialog p{font-size:12px;line-height:2;margin-bottom:12px}dialog .close{position:absolute;right:12px;top:10px;border:0;font-size:25px;padding:0 6px}dialog .full-card{display:block;max-height:70vh;max-width:100%;margin:auto;border-radius:5px}dialog .draft{display:flex;justify-content:center;gap:22px}.draft button{padding:8px;max-width:45%}.draft img{width:100%;max-height:55vh;object-fit:contain}.draft span{display:block;padding:8px;font-size:12px}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%) translateY(100px);background:#263e35;color:#fff;padding:14px 24px;border:1px solid #b28a46;border-radius:5px;z-index:10;transition:.2s;font-size:12px;max-width:90vw}#toast.show{transform:translateX(-50%) translateY(0)}a{color:#8f6a2b}input,select{border:1px solid var(--line);background:#fffdf7;color:var(--ink);border-radius:3px}#zoom{width:90px}.results{text-align:center;padding:20px}.results strong{font:80px Georgia;color:var(--gold);display:block;margin:15px}.results h2{font-size:28px}.resolve-box{padding:12px;background:#ece6d8;margin-top:15px}.help-list{padding-left:20px;line-height:2;font-size:12px}@media(min-width:1550px){.layout{grid-template-columns:235px minmax(520px,1fr) 285px}main{padding:28px 35px}.hero h1{font-size:30px}.card-small{max-width:115px}}@media(max-width:1100px){.layout{grid-template-columns:185px minmax(400px,1fr)}.right{grid-column:1/-1;padding:15px;display:grid;grid-template-columns:1fr 1fr;gap:15px}.right .credits{grid-column:1/-1}.round span{display:none}.header-actions>span{display:none}main{padding:20px 15px}.hero h1{font-size:21px}}@media(max-width:650px){header{padding:12px;height:76px}.brand span{font-size:15px}.brand{font-size:27px;gap:5px}.brand small{font-size:7px;letter-spacing:1px}.rounds{gap:4px}.round b{width:22px;height:22px;font-size:11px}.header-actions button:first-of-type{display:none}.layout{display:flex;flex-direction:column}.ledger{padding:14px;border-right:0;border-bottom:1px solid var(--line)}.ledger>.eyebrow,.ledger>h2,.ledger>p,.ledger>.aside-title,.ledger>#production,.ledger>#attributes,.ledger>.score,.ledger>.wide{display:none}#resources{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.resource{flex-wrap:wrap;justify-content:center;padding:3px}.resource .name{flex:0;white-space:nowrap;font-size:10px}.token{width:18px;height:18px;font-size:11px}.counter{gap:3px}.hero{padding:5px 0 18px}.hero h1{font-size:19px}.hero img{height:85px;width:56px}.hero p{font-size:10px}.phase-bar{padding:15px}.phase-bar h2{font-size:17px}.phase-bar p{font-size:10px}.phase-bar button{padding:10px;font-size:11px}.castles{gap:7px}.castle-label{font-size:8px}.tent{font-size:8px;padding:2px;left:1px}.rival{right:1px;left:auto;bottom:42px}.section-head h3 span{display:none}.panel{padding:12px}.tabs{gap:10px}.tabs button{font-size:11px}.defense-grid,.columns{grid-template-columns:1fr}.right{display:block;padding:0 15px}dialog{padding:23px 17px}.card-row{gap:8px;min-height:90px}.card-small{width:16%}}

@media(max-width:650px){.ledger>.aside-title,.ledger>#production,.ledger>.score,.ledger>.wide{display:flex}.ledger>#attributes{display:grid;grid-template-columns:repeat(3,1fr)}.ledger>#production{display:block}.ledger .prod-grid{grid-template-columns:repeat(8,1fr)}.ledger>.aside-title{margin:10px 0 5px;padding-top:10px}.ledger>.score{margin-top:10px;padding:8px 0}.ledger>.wide{justify-content:center}.ledger .score strong{font-size:24px}.ledger>#attributes .resource{flex-wrap:nowrap}.ledger .prod-item{font-size:8px}}

/* Keep the resource ledger and chronicle beside the sheet while the page moves.
   Each rail scrolls independently when its contents exceed the viewport. */
@media(min-width:651px){
 .layout{align-items:start}
 .ledger,.right{position:sticky;top:12px;align-self:start;max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);overflow-y:auto;scrollbar-width:thin;overscroll-behavior:contain}
 .ledger{padding-top:20px;padding-bottom:20px}
 .right{display:flex;flex-direction:column;grid-column:auto;padding-top:0;margin-top:24px}
 .right>.panel{flex:none}
 .right>.panel:nth-of-type(2){display:flex;flex-direction:column;min-height:180px;flex:1}
 .right #log{max-height:clamp(150px,calc(100dvh - 400px),480px);overflow-y:auto;scrollbar-width:thin;overscroll-behavior:contain}
 .right .credits{flex:none}
}
@media(min-width:651px) and (max-width:1100px){
 .layout{grid-template-columns:155px minmax(0,1fr) 185px}
 .ledger{padding:18px 10px}
 .right{padding:0 10px 0 0;gap:0}
 .right .panel{padding:12px}
 .right .section-head{flex-wrap:wrap}
 .right .section-head>span{font-size:8px}
 .ledger h2{font-size:17px}
 .ledger .resource{gap:4px}
 .ledger .counter{gap:3px}
 .ledger .token{width:21px;height:21px;font-size:12px}
 main{padding:20px 12px}
 .hero h1{font-size:20px;line-height:1.5}
 .hero img{width:48px;height:76px}
 .phase-bar{padding:15px;flex-wrap:wrap}
 .section-head h3 span{display:none}
 .tabs{gap:8px;flex-wrap:wrap}
 .tabs button{font-size:11px}
}
/* On phones, pin the eight resources in a compact strip above the board. */
.mobile-chronicle{display:none}
@media(max-width:650px){
 .ledger{position:sticky;top:0;z-index:6;max-height:34dvh;overflow-y:auto;box-shadow:0 3px 12px #182b2918;scrollbar-width:thin;overscroll-behavior:contain}
 .right{position:static;max-height:none}
 .right #log{max-height:260px}
 .mobile-chronicle{display:block;position:fixed;right:12px;bottom:12px;z-index:7;max-width:85vw;background:var(--paper);border:1px solid var(--gold);border-radius:5px;box-shadow:0 4px 20px #182b2926}
 .mobile-chronicle summary{cursor:pointer;padding:10px 15px;font-size:12px;color:var(--ink)}
 .mobile-chronicle[open]{width:280px}
 #mobile-log{max-height:32vh;overflow-y:auto;padding:0 15px 12px 30px;margin:0;overscroll-behavior:contain}
 #mobile-log li{font-size:11px;line-height:1.8;margin:8px 0}
 #mobile-log b{display:block;font-size:9px;font-weight:400;color:var(--muted)}
}
.campaign-reward{border:1px solid #cbb991;background:#efe5cd;border-radius:4px;padding:7px 5px;margin-bottom:11px;min-height:100px}
.campaign-prestige{display:flex;justify-content:space-around;gap:3px;font-size:10px;margin-bottom:6px;color:#685337}
.campaign-prestige b{color:#923d35;font-size:13px}
.castle .plunder-tile{display:block;width:100%;border:0;padding:0;border-radius:3px;background:#d9bf8d;overflow:hidden}
.castle .plunder-tile .plunder-art{display:block;width:100%;height:auto;aspect-ratio:2;object-fit:contain;box-shadow:none;outline:none;border-radius:0;filter:none}
.plunder-label{display:block;margin-top:5px;color:#756547;font-size:9px}
.plunder-symbols{display:flex;align-items:center;justify-content:center;gap:8px;aspect-ratio:2;width:100%;background:#e8cf9f}
.plunder-resource{font-size:17px;color:#6b4c2b;text-align:center}
.plunder-resource small{display:block;font-size:9px;margin-top:3px}
.plunder-resource.silver{color:#5c625b}.plunder-resource.food{color:#a35e2d}
.plunder-preview{width:220px;max-width:100%;margin:14px auto;background:#e8cf9f;border:1px solid #cbb991;border-radius:4px;overflow:hidden}
.plunder-preview .plunder-art{width:100%;display:block}
.castle.past .campaign-reward{background:#e2ddd0;border-color:#cbc7bd}
@media(max-width:850px){.campaign-prestige{flex-direction:column;gap:2px;font-size:9px}.campaign-prestige b{font-size:11px}.campaign-reward{padding:5px 3px;min-height:100px}.plunder-resource{font-size:12px}.plunder-symbols{gap:3px}.plunder-resource small{font-size:8px}.plunder-label{font-size:8px}}
