:root{color-scheme:dark;--gold:#d4b67a;--edge:#d4b67a80;--panel:#101d25f2}*{box-sizing:border-box}body{margin:0;color:#fff0d2;font:15px/1.4 system-ui;background:#0b1621}button,input,select{font:inherit}button{background:#182a34ef;color:#fff0d2;border:1px solid var(--edge);padding:10px 16px;min-height:44px;cursor:pointer;border-radius:3px}button:hover,button.active{background:#806434}button:disabled{opacity:.5;cursor:wait}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #ffe5a3}input,select{padding:9px;color:white;background:#152a38;border:1px solid var(--edge);max-width:100%;min-height:44px}h1,h2,h3{font-family:Georgia,serif;font-weight:400}h1{font-size:38px}h2{font-size:26px;margin-top:0}p{margin:.5em 0}small{font-size:11px;display:block;color:#dac79c}#game{height:100dvh;position:relative;overflow:hidden;isolation:isolate}.scenery{position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,#07111bc0,transparent 35%,#07111bbf),url('/assets/fortress-v2.png') center/cover}header{height:68px;display:flex;align-items:center;gap:20px;padding:10px 20px;background:#08151baf}header strong{letter-spacing:2px;font-size:16px}#resources{flex:1;text-align:right}#welcome{margin:35px;max-width:420px;text-shadow:0 2px 6px black}#auth{background:var(--panel);padding:20px;border:1px solid var(--edge)}label{display:inline-flex;flex-direction:column;gap:4px;margin:5px}#auth label{display:flex}#auth button{margin:5px 2px}#view{position:absolute;inset:84px 26px 100px;overflow:auto}nav{position:absolute;bottom:24px;left:50%;transform:translateX(-50%);display:flex;gap:6px;background:#08141bbf;padding:8px;border-bottom:1px solid var(--gold)}nav button{min-width:85px}#notice{position:absolute;bottom:0;left:16px;right:16px;font-size:12px;background:#07111bd9;min-height:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.panel{background:var(--panel);padding:20px;border:1px solid var(--edge);max-width:850px;border-left:3px solid var(--gold)}.grid{display:flex;flex-wrap:wrap;gap:12px}.card{padding:14px;background:#19303a;border:1px solid #84734f;min-width:165px;flex:1}.card button{margin:5px 3px}.castle-title{margin:10px 0 35px;font-size:42px;text-shadow:0 3px 8px #000}.hotspot{position:absolute;box-shadow:0 3px 15px black}.keep{left:60%;top:28%}.forge{left:25%;top:59%}.army{left:76%;top:65%}.quest{position:absolute;left:10px;bottom:0;max-width:310px}canvas{display:block;width:100%;touch-action:none;background:#0b202a;border:1px solid var(--edge)}#puzzle{max-width:min(900px,74vw);max-height:calc(100dvh - 218px)}.puzzle-tools{display:flex;gap:8px;align-items:center;margin:8px 0}.chat-line{border-bottom:1px solid #40505b;padding:8px;overflow-wrap:anywhere}.chat-line button{min-height:36px;padding:5px 9px}.chat-history{height:150px;overflow:auto}#rotate{display:none}pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}.tutorial{padding:8px;background:#273a42;border:1px solid var(--gold);margin-bottom:10px}#map{height:calc(100dvh - 270px);min-height:150px}.map-tools{display:flex;gap:6px;flex-wrap:wrap}.map-tools input{width:85px}@media(max-height:500px){header{height:48px;font-size:12px;padding:4px 12px;gap:10px}header strong{font-size:12px}header button{min-height:36px;padding:5px 10px}#view{inset:55px 16px 82px}nav{bottom:20px;padding:4px}nav button{min-width:65px;padding:8px;font-size:12px}#welcome{margin:10px 24px}#welcome h1{font-size:26px;margin:0}#auth{padding:8px;max-width:620px}#auth label{display:inline-flex;width:44%}#auth details label{display:inline-flex}#auth details{display:inline-block}.panel{padding:12px}.castle-title{font-size:28px;margin:0}#puzzle{max-height:calc(100dvh - 185px)}#map{height:calc(100dvh - 230px)}.quest{max-width:240px}.quest h2{font-size:21px}.hotspot{padding:6px 9px}.chat-history{height:85px}}@media(orientation:portrait){#rotate{display:block;position:absolute;inset:0;background:#0c1a25f5;z-index:100;padding:40vh 20px;text-align:center}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important}}
/* Immersive scene pass, shared iron/gold HUD across every system. */
header{padding-left:max(20px,env(safe-area-inset-left));padding-right:max(20px,env(safe-area-inset-right));border-bottom:1px solid #d4b67a30}#resources{color:#f7d68e;font-variant-numeric:tabular-nums}nav button{background:linear-gradient(#26353ee6,#0e1d27f5);box-shadow:inset 0 1px #ffffff0d}nav button.active{background:linear-gradient(#b89b61,#74572d);color:white;border-color:#f7d68e;transform:translateY(-4px)}.panel{box-shadow:0 16px 60px #0007;background:linear-gradient(135deg,#142630f5,#0a151eee)}.card{background:linear-gradient(145deg,#263b43,#10202a);box-shadow:inset 0 1px #f1ce7020}.card h3{color:#f3d18b}.rule-strip{font-size:13px;color:#d8c6a4;padding:10px;border-bottom:1px solid #d4b67a40}.hotspot{display:flex;flex-direction:column;border-color:#d4b67a;background:linear-gradient(#273741ed,#111f2bed);padding:12px 22px;font-family:Georgia,serif;font-size:18px}.hotspot:before{content:'◆';color:#e5c580;font-size:27px;line-height:1}.hotspot.keep{transform:translate(-50%,-50%)}body[data-screen=castle] .tutorial{display:inline-block;max-width:55%;background:#0c1923d9}body[data-screen=castle] .scenery{filter:saturate(.95)}body[data-screen=heroes] .scenery{background:linear-gradient(180deg,#06131b70,transparent 25%,#06131be0),url('/assets/heroes-v2.png') center/cover}.hero-scene{height:100%;position:relative}.hero-intro{text-shadow:0 2px 8px black;max-width:470px}.hero-intro h1{margin:8px 0;font-size:36px}.hero-roster{position:absolute;bottom:0;left:0;right:0;display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.hero-card{padding:12px 20px;background:linear-gradient(135deg,#0d1e29e8,#0b1723b8);border-top:2px solid var(--gold);text-align:center}.hero-card h2{margin:4px 0}.hero-card p{font-size:13px}.map-panel{max-width:none;height:100%;padding:10px}.map-tools h2{font-size:22px;margin:10px 20px 5px 0}.map-tools label{font-size:11px}.map-tools #march-amount{width:65px}.map-tools #map-detail{font-size:12px;align-self:center}.map-panel canvas{background:radial-gradient(ellipse,#38564b,#172f36)}.alliance-panel{max-width:920px}.alliance-panel h3{margin:12px 0 6px}.scoreboard{display:flex;gap:16px;padding:18px 0}.scoreboard>div{border:1px solid var(--gold);padding:20px 38px;text-align:center;background:#253c43}.scoreboard strong{font:42px Georgia;display:block;color:#f2d797}.scoreboard span{font-size:12px}.battle-report{margin:8px 0;padding:16px;background:#213640;border-left:3px solid #d4b67a}.battle-report p{font-size:13px}body[data-screen=puzzle] .panel{max-width:1100px;margin:auto}body[data-screen=puzzle] #puzzle{max-width:100%;width:auto;margin:auto}body[data-screen=puzzle] h2{margin-bottom:8px}body[data-screen=puzzle] #puzzle-hint{font-size:12px}body[data-screen=puzzle] .puzzle-tools{margin:0}body[data-screen=puzzle] label{font-size:12px}body[data-screen=puzzle] label input{width:90px;min-height:36px;padding:4px}#welcome{background:linear-gradient(90deg,#06121dd9,transparent);padding:14px 20px}#welcome h1{color:#ffebbb}@media(max-height:500px){.hero-intro h1{font-size:24px}.hero-intro p{font-size:12px}.hero-card{padding:6px}.hero-card h2{font-size:20px}.hero-card small{font-size:9px}.hero-card button{padding:7px;min-height:44px}.hero-card p{margin:2px}.hero-roster{gap:8px}.hotspot{font-size:13px;padding:5px 12px}.hotspot:before{font-size:20px}.tutorial{font-size:11px;padding:4px}.tutorial button{padding:5px;min-height:44px}body[data-screen=puzzle] .panel{padding:6px}body[data-screen=puzzle] h2{font-size:21px}body[data-screen=puzzle] #puzzle{max-height:calc(100dvh - 235px);min-height:110px}body[data-screen=puzzle] label{margin:0 4px}body[data-screen=puzzle] .puzzle-tools button{padding:7px}.map-tools label{margin:0}.map-tools button{padding:6px;min-height:44px}.map-tools h2{display:none}.map-panel #map{height:calc(100dvh - 240px)}.alliance-panel{font-size:12px}.alliance-panel h2{font-size:22px}.alliance-panel .grid{gap:4px}.alliance-panel input{padding:5px}.alliance-panel label{margin:2px}.alliance-panel button{padding:6px;min-height:44px}.chat-history{height:75px}.scoreboard>div{padding:8px 20px}.scoreboard strong{font-size:28px}}@media(prefers-reduced-motion:no-preference){nav button{transition:transform .18s,background .18s}.hotspot{animation:beacon 5s ease-in-out infinite}@keyframes beacon{50%{box-shadow:0 0 20px #dfb96566}}}
/* Geometry stays fully visible; controls form a compact upper rail. */
body[data-screen=puzzle] #view{overflow:hidden}body[data-screen=puzzle] .panel{height:100%;position:relative;display:grid;grid-template-rows:28px 48px 20px minmax(0,1fr) 0;gap:3px;padding:10px 16px;background:linear-gradient(90deg,#0a1723ed,#0e2031cc)}body[data-screen=puzzle] h2{font-size:24px;margin:0}body[data-screen=puzzle] .puzzle-tools{gap:6px}body[data-screen=puzzle] #puzzle-hint{margin:0}body[data-screen=puzzle] #puzzle{height:100%;width:auto;max-height:100%;max-width:100%;min-height:0;object-fit:contain;background:linear-gradient(#132a36bb,#0c202ac9),url('/assets/battlefield-v1.png') center/cover}body[data-screen=puzzle] .panel>label{position:absolute;right:18px;top:16px;font-size:11px}body[data-screen=puzzle] .panel>label:last-child{right:125px}body[data-screen=puzzle] .panel>label input{width:78px}body[data-screen=map] #view{overflow:hidden}.map-panel{display:grid;grid-template-rows:66px minmax(0,1fr) 48px 18px;gap:2px}.map-panel #map{height:100%;min-height:0;width:100%}.map-tools{flex-wrap:nowrap;align-items:center;gap:5px}.map-tools h2{display:none}.map-tools label{font-size:10px;gap:0;margin:0}.map-tools input{width:64px}.map-tools button{padding:8px;white-space:nowrap}.map-tools #ma{width:50px}.map-tools #map-detail{font-size:11px}.map-panel #marches{margin:0;font-size:11px;overflow:hidden;white-space:nowrap}@media(max-height:600px){header{height:48px;padding:4px 12px;gap:12px;font-size:12px}header strong{font-size:12px}header button{min-height:44px;padding:6px}#view{inset:56px 16px 82px}#resources{font-size:11px}#realm{max-width:185px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}nav{padding:4px;bottom:20px}nav button{padding:8px 12px;min-width:68px;font-size:12px}body[data-screen=puzzle] .panel{grid-template-rows:24px 46px 16px minmax(0,1fr) 0;padding:6px 10px}body[data-screen=puzzle] h2{font-size:21px}body[data-screen=puzzle] .panel>label{top:7px}.map-panel{grid-template-rows:58px minmax(0,1fr) 44px 0;padding:6px}.map-tools button{font-size:11px;padding:7px}.map-tools input,.map-tools select{padding:5px;font-size:11px}.map-tools label{font-size:9px}.hero-roster{gap:8px}.hero-card{padding:6px}.hero-card h2{font-size:20px}.hero-intro h1{font-size:26px}.hotspot{font-size:13px;padding:6px 12px}.castle-title{font-size:29px}.tutorial{font-size:11px}}
body[data-screen=heroes] .scenery{background:linear-gradient(180deg,#07121d80,#07121dc0),url('/assets/fortress-v2.png') center/cover}.hero-roster{height:100%;align-items:end;gap:4%}.hero-card{height:78%;position:relative;display:flex;flex-direction:column;justify-content:end;background:linear-gradient(0deg,#0b1c2bf2,transparent 48%);border:0;padding:14px;isolation:isolate}.hero-figure{position:absolute;inset:-20% 0 15%;z-index:-1;background-image:url('/assets/heroes-atlas-v1.png');background-size:300% 100%;background-repeat:no-repeat;filter:drop-shadow(0 12px 12px #000b)}.hero-0{background-position:0% 50%}.hero-1{background-position:50% 50%}.hero-2{background-position:100% 50%}.hero-card small{color:#f4d185;text-shadow:0 2px 6px black}.hero-card h2,.hero-card p{text-shadow:0 2px 8px black}.hero-intro{position:absolute;top:0;left:0;z-index:2;pointer-events:none}.fine-aim{position:absolute;right:16px;top:10px;z-index:3;background:#10222ced;border:1px solid #d4b67a60;padding:5px 8px;font-size:11px}.fine-aim label{font-size:10px}.fine-aim input{width:75px;padding:5px}.fine-aim summary{min-height:30px;cursor:pointer;padding:5px}.fine-aim[open]{max-width:210px}.hero-roster .hero-card button{background:linear-gradient(#b39962,#6b512a);border-color:#e3c68a}@media(max-height:600px){.hero-card{height:80%;padding:7px}.hero-figure{inset:-18% -4% 12%}.hero-card h2{font-size:18px}.hero-card small{font-size:10px}.hero-card p{font-size:11px}.hero-intro h1{font-size:24px;margin:0}.hero-intro p{font-size:11px}.fine-aim{right:10px;top:5px}}
.hero-figure{inset:auto;top:-20%;bottom:15%;height:105%;width:auto;aspect-ratio:1/2;left:50%;transform:translateX(-50%);background-size:300% 100%}.hero-0{background-position:0% 50%}.hero-1{background-position:50% 50%}.hero-2{background-position:100% 50%}.hero-card{overflow:visible}.hero-card small{position:relative}.hero-card h2,.hero-card p,.hero-card button{position:relative}#view:has(.hero-scene){overflow:hidden}@media(max-height:600px){.hero-figure{top:-16%;height:103%;bottom:auto}}
.hero-figure{background:none!important;height:105%;width:100%;aspect-ratio:auto}.hero-1{width:115%}.hero-2{width:85%}.tutorial{max-width:340px!important;display:flex!important;flex-direction:column;gap:5px}.tutorial span{font-size:13px}.tutorial button{font-size:12px}.quest{left:0;bottom:0;max-width:280px}.forge{left:32%;top:63%}.army{left:76%;top:65%}body[data-screen=puzzle] #puzzle{background:linear-gradient(#11233055,#0a1a2555),url('/assets/puzzle-arena-v1.png') center/cover}@media(max-height:600px){.tutorial{max-width:240px!important;padding:6px;font-size:11px}.tutorial span{font-size:10px}.tutorial button{min-height:44px;padding:5px}.quest{max-width:220px;padding:8px;bottom:0;left:0}.quest h2{font-size:19px}.quest p{font-size:11px}.quest small{font-size:9px}.quest button{font-size:11px;padding:7px}.forge{left:37%;top:62%}.army{left:75%;top:62%}.keep{left:62%;top:27%}}
body[data-screen=puzzle] #view{inset:56px 12px 80px}body[data-screen=puzzle] .panel{display:block;padding:0;border:0;background:none;max-width:none;overflow:hidden}body[data-screen=puzzle] #puzzle{position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;object-fit:fill;background:url('/assets/puzzle-arena-v1.png') center/cover;border:1px solid #708692}body[data-screen=puzzle] h2{position:absolute;z-index:2;left:14px;top:9px;font-size:25px;text-shadow:0 2px 6px black;pointer-events:none}body[data-screen=puzzle] .puzzle-tools{position:absolute;z-index:3;left:14px;bottom:9px;background:#0b1d2bed;padding:5px;border:1px solid #8092a0;gap:6px}body[data-screen=puzzle] #puzzle-hint{position:absolute;z-index:2;left:14px;top:41px;font-size:12px;text-shadow:0 1px 4px black;pointer-events:none}body[data-screen=puzzle] .fine-aim{top:8px;right:10px}body[data-screen=puzzle] #shoot{background:linear-gradient(#c4a76d,#6e5128);font-weight:600;min-width:170px}body[data-screen=puzzle] .puzzle-tools label{flex-direction:row;align-items:center}.hero-intro{top:3px}@media(max-height:500px){body[data-screen=puzzle] h2{font-size:20px;top:6px}body[data-screen=puzzle] #puzzle-hint{top:31px;font-size:10px}body[data-screen=puzzle] .puzzle-tools{padding:2px;bottom:5px;left:9px}body[data-screen=puzzle] .puzzle-tools button{min-height:44px;padding:6px 9px;font-size:11px}body[data-screen=puzzle] #shoot{min-width:135px}body[data-screen=puzzle] .puzzle-tools select{min-height:44px;padding:6px}body[data-screen=puzzle] .fine-aim{font-size:10px}}
.economy{left:48%;top:76%}.economy-card{min-height:220px;border-top:3px solid #d4b67a}.economy-card strong{display:block;font:25px Georgia;color:#f3d58d}.economy-card:before{content:'♜';font:58px Georgia;color:#d0ba81;display:block;text-align:center}.economy-0:before{content:'❦'}.economy-1:before{content:'♧'}.economy-2:before{content:'◆'}@media(max-height:600px){.economy{left:48%;top:78%}.economy-card{min-height:160px}.economy-card:before{font-size:38px}}
