:root{--ink:#111c28;--cream:#fff1cb;--gold:#f4ce7d;--muted:#b9c4c3;--line:#695c44;--tint:#58baff;color-scheme:dark;font:clamp(14px,1.8vh,19px) 'Segoe UI',sans-serif;color:var(--cream)}
*{box-sizing:border-box}body{margin:0;background:#101c25} [hidden]{display:none!important}
button{font:600 .94rem 'Segoe UI',sans-serif;cursor:pointer;color:inherit;background:linear-gradient(#314451,#202f3d);border:1px solid #586569;border-bottom:2px solid #485259;border-radius:4px;padding:.45rem .7rem;white-space:nowrap}
button:hover:not(:disabled){filter:brightness(1.25);border-color:var(--gold)}button:active:not(:disabled){transform:translateY(1px)}:focus-visible{outline:2px solid white;outline-offset:1px}
button:disabled{color:#95a4ab;cursor:default;background:#1d2935;border-color:#39464e}
button.active{color:var(--gold);border-color:#d4af65;background:#40372c}
.bare{background:none;border-color:transparent}
.primary{background:linear-gradient(#ffe9a2,#d6a555);color:#342419;border-color:#ffefbc #e3b674 #a76e30;box-shadow:inset 0 0 0 2px #fbd992,0 3px 0 #090f16;font: bold 1.13rem Georgia;padding:.63rem}
.primary:disabled{box-shadow:none}
.large{padding:.82rem 2.6rem;letter-spacing:.04em;font-size:1.35rem}
canvas{image-rendering:pixelated;display:block}
svg{width:1.65em;height:1.05em;vertical-align:middle}
.row,header,footer{display:flex;align-items:center;gap:.45rem}.center{justify-content:center}.flex{flex:1;min-width:0}.spread{justify-content:space-between}.full{width:100%}
.dim,small{color:var(--muted)}small{font-size:.87rem}.gold,#gold,h2,h3{color:var(--gold)}
.eyebrow{font-size:.76rem;letter-spacing:.17em;text-transform:uppercase;font-weight:700;color:var(--gold)}
#titleScreen{height:100dvh;display:grid;overflow:auto}
#backdrop{position:fixed;width:100%;height:100%;object-fit:cover;z-index:-2}
#titleScreen:before{content:"";position:fixed;inset:0;background:radial-gradient(ellipse,#071528d9 19%,#0717279c 66%,#06111fba);z-index:-1}
#titleScreen:has(#conquestMenu:not([hidden])):before{background:radial-gradient(ellipse,#071528d9 17%,#0717278c 57%,#06111f40)}
#conquestMenu .settings{flex-wrap:wrap}
.realmPicker{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:.45rem}
#viewRealm{font-size:.85rem}
dialog:has(#realmAtlas){width:min(94vw,75rem);padding:.8rem}
#realmAtlas{width:100%;max-height:calc(88dvh - 6.5rem);object-fit:contain}
#titleBox{margin:auto;width:min(94vw,55rem);padding:1rem 0;text-align:center;text-shadow:0 2px 4px #061123}
#mainMenu{max-width:49rem;margin:auto}
.modeChoices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.7rem}
.modeCard{display:grid;grid-template-rows:auto auto 1fr;padding:0;text-align:left;white-space:normal;overflow:hidden;border:1px solid #a59369;border-bottom:3px solid #796446;background:linear-gradient(150deg,#233643,#112330);box-shadow:0 .4rem .85rem #06122185}
.modeCard canvas{width:100%;aspect-ratio:2;border-bottom:1px solid #9a885b}
.modeCard strong{padding:.8rem .85rem .28rem;font:700 1.48rem Georgia;color:#ffe0a1}
.modeCard small{padding:0 .85rem .85rem;color:#d0d9d4;line-height:1.4}
.continueGame{display:flex;align-items:center;justify-content:space-between;gap:.65rem;width:100%;margin:0 auto .75rem;padding:.68rem 1rem;background:linear-gradient(95deg,#57482e,#2d3433);border-color:#b39a62;white-space:normal;text-align:left}
.continueGame strong{font:700 1.25rem Georgia;color:#ffe6a9}
#titleBox>.menuLinks{margin-top:1.1rem;flex-wrap:wrap}
@media(max-width:580px){.modeChoices{grid-template-columns:1fr;gap:.42rem}.modeCard{grid-template-columns:34% 1fr;grid-template-rows:auto auto;align-items:end}.modeCard canvas{grid-row:span 2;align-self:stretch;height:100%;border:0;border-right:1px solid #9a885b}.modeCard strong{padding:.55rem .72rem .12rem}.modeCard small{align-self:start;padding:0 .72rem .5rem}.continueGame{flex-wrap:wrap}}
.flourish{display:flex;align-items:center;justify-content:center;gap:1rem;font-size:2rem}
.flourish:before,.flourish:after{content:"";height:1px;width:16%;background:linear-gradient(90deg,transparent,#ddb864)}.flourish:after{transform:rotate(180deg)}
h1{font:small-caps bold clamp(2.5rem,min(7.7vh,8vw),4.65rem)/1 Georgia;letter-spacing:.045em;margin:0 0 1.6rem;color:#ffebae;text-shadow:0 3px #b77b38,0 6px #51372a,0 10px 12px #00101b}
#choices{display:flex;justify-content:center;gap:1.2%;margin:1.45rem 0 1rem}
.house{padding:0 0 .85rem;width:18%;border:2px solid #9a8b69;border-radius:50% 50% 4px 4px / 31% 31% 4px 4px;background:radial-gradient(ellipse at 50% 20%,color-mix(in srgb,var(--tint) 38%,#162636),#142331 68%);box-shadow:inset 0 0 0 4px #101b27,inset 0 0 0 5px #756a50,0 6px 15px #0008;overflow:hidden;transition:transform .16s}
.house canvas{width:min(100%,21vh);margin:.4rem auto 0}
.house strong{display:block;border-top:2px solid var(--tint);padding:.6rem 0 .24rem;font:bold clamp(14px,1.45vw,1.24rem) Georgia}
.house small{color:var(--tint);font-size:clamp(11px,1.1vw,.86rem)}
.house.chosen{transform:translateY(-.55rem);border-color:#ffe7a3;box-shadow:inset 0 0 0 4px #201f23,inset 0 0 0 6px #e6b962,0 0 18px #ffc54c46}
#trait{font:1.17rem Georgia;min-height:1.3em}#levels{margin:1.4rem 0 .85rem}#levels button{min-width:5.4rem}#titleBox>.row:last-child{margin-top:.6rem}
main{height:100dvh;display:grid;grid-template-columns:1fr clamp(272px,21.5vw,400px);grid-template-rows:auto minmax(0,1fr) auto}
header,footer,aside,dialog{background:linear-gradient(135deg,#223443,#111c28 80%)}
header,footer{padding:.55rem .9rem;grid-column:1/-1;border-bottom:2px solid var(--line)}
.brand{font:bold small-caps 1.55rem Georgia;color:var(--gold);margin-right:1rem}
#gold:before{content:"";display:inline-block;width:.78em;height:.78em;border:2px solid #ffe088;background:#e6a744;box-shadow:inset 0 0 0 2px #b67627;border-radius:50%;margin-right:.32em}
#income,#clock{color:var(--muted);font-variant-numeric:tabular-nums}
#stage{min-width:0;display:grid;place-items:center;container-type:size;background:repeating-linear-gradient(45deg,#101b24,#101b24 5px,#14202a 5px,#14202a 6px)}
#frame{width:min(100cqw,160cqh);aspect-ratio:8/5;position:relative;box-shadow:0 0 0 2px #a78c58,0 0 0 5px #242522,0 4px 25px #060b10}
#frame canvas{position:absolute;width:100%;height:100%}#overlay{image-rendering:auto}
aside{overflow:auto;border-left:2px solid var(--line);z-index:1;scrollbar-width:thin}
#panel{padding:.92rem;display:grid;gap:.62rem}
h2,h3,p{margin:.35rem 0}h2{font: bold 1.65rem Georgia;color:var(--cream)}h3{font:bold 1.16rem Georgia}
.section{padding-top:.58rem;border-top:1px solid var(--line)}
.unit{min-height:3rem}.unit canvas{width:2.1rem;height:2.45rem}.unit small{display:block}.unit button{padding:.35rem .45rem;min-width:1.7rem}
.tip,.report{background:#0917239c;border-left:3px solid var(--gold);padding:.6rem .75rem;line-height:1.35}
.bar{height:4px;background:#09131b;margin-top:.4rem}.bar i{display:block;height:100%;background:var(--tint)}
.build{white-space:normal;text-align:left;width:100%;margin:.25rem auto}.build small{display:block;font-weight:400}
footer{border-top:1px solid var(--line);border-bottom:none;padding:.35rem .8rem;gap:1rem}
#news{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
dialog{border:2px solid #b9995f;width:min(92vw,36rem);max-height:88vh;padding:1.4rem;color:inherit;box-shadow:0 8px 60px #0009}
dialog::backdrop{background:#08131dbb}#sheet{display:grid;gap:.82rem;line-height:1.45}#sheet .row:first-child{position:sticky;top:-1.4rem;background:#20313f;padding:.3rem;z-index:1}
@media(max-height:710px){h1{margin-bottom:.65rem}#levels{margin:.75rem 0}#panel{gap:.38rem;padding:.65rem}.unit{min-height:2.7rem}header,footer{padding:.25rem .6rem}.house canvas{width:min(100%,18vh)}}
@media(max-width:1000px){.brand{font-size:0;margin:0}.brand svg{width:32px;height:25px}:root{font-size:14px}header{gap:.25rem}}
@media(max-width:800px){main{grid-template-columns:1fr 245px}#income,.brand{display:none}.house strong{font-size:12px}.house small{white-space:normal}header button{padding:.4rem}}
