:root { color-scheme:dark; font:16px/1.45 system-ui,sans-serif; --ink:#f3efdb; --muted:#c1cebd; --panel:#1c352c; --line:#48624e; --gold:#efb66a; background:#10231c; color:var(--ink); }
* { box-sizing:border-box; } body { margin:0; } [hidden] { display:none!important; }
button { font:inherit; cursor:pointer; border:1px solid #718164; border-radius:7px; background:#2c4838; color:var(--ink); min-height:44px; padding:9px 13px; touch-action:manipulation; }
button:hover:enabled { border-color:var(--gold); background:#3b5940; } button:focus-visible { outline:3px solid #ffcf83; outline-offset:2px; } button:disabled { opacity:.45; cursor:default; }
button[aria-pressed="true"] { border-color:#efb66a; background:#546047; } .primary { background:var(--gold); color:#2a2114; border-color:#ffd697; font-weight:750; } .primary:hover:enabled { background:#ffd092; }
#game-shell { height:100dvh; min-height:560px; display:grid; grid-template-columns:minmax(0,1fr) 340px; grid-template-rows:68px minmax(0,1fr) auto; max-width:1800px; margin:auto; }
.topbar { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:10px 18px; border-bottom:1px solid var(--line); background:#163126; }
.brand { display:grid; } .brand strong { font-family:Georgia,serif; font-size:24px; letter-spacing:.08em; } .brand span { font-size:13px; color:var(--muted); }
.kingdom { display:flex; gap:22px; font-size:14px; } .kingdom b { margin-left:4px; color:#ffe0a7; }
.arena { min-width:0; min-height:0; position:relative; overflow:hidden; isolation:isolate; background:#243b2c; touch-action:none; }
#map { display:block; width:100%; height:100%; object-fit:contain; touch-action:none; }
.combat-hud { position:absolute; z-index:2; inset:10px 12px auto; display:flex; gap:10px; align-items:start; justify-content:space-between; pointer-events:none; }
.combat-hud>div { display:grid; gap:4px; padding:7px 10px; background:#152a22e8; border:1px solid #a0ad7b; border-radius:6px; }
.combat-hud span { font-size:13px; color:#e0e9cc; } .combat-hud .combat-meters { display:flex; gap:10px; flex-wrap:wrap; } .combat-hud button { pointer-events:auto; }
.drawer { background:var(--panel); border-left:1px solid var(--line); min-height:0; overflow:auto; }
.tabs { display:flex; gap:5px; position:sticky; top:0; z-index:2; background:#1c352cf5; padding:10px; border-bottom:1px solid var(--line); }
.tabs button { flex:1; font-size:14px; padding:7px; } .panel { padding:16px; }
h2 { font:700 28px/1.1 Georgia,serif; margin:5px 0 12px; } h3 { font-size:16px; margin:16px 0 8px; } p { margin:7px 0 14px; } .secondary,.panel small { color:var(--muted); font-size:14px; }
.kicker { color:#efc78a; font-size:12px; letter-spacing:.12em; font-weight:750; text-transform:uppercase; }
.card { padding:12px; border:1px solid #62734d; background:#263f2e; border-radius:7px; margin:10px 0; }
.options { display:grid; gap:8px; } .options button { text-align:left; width:100%; } .options small { display:block; font-size:13px; color:#d6e0c5; margin-top:3px; }
.two { display:grid; grid-template-columns:1fr 1fr; gap:8px; } .two button { font-size:14px; padding:9px; } .two small { display:block; font-size:12px; }
.roster { display:flex; flex-wrap:wrap; gap:7px; margin:12px 0; } .roster span { font-size:14px; background:#102a22; padding:5px 8px; border-radius:4px; }
.metrics { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:12px 0; } .metrics>div { border:1px solid #647455; padding:9px; border-radius:6px; } .metrics strong { display:block; color:#f5ce91; font-size:21px; } .metrics span { font-size:13px; color:var(--muted); }
.actionbar { grid-column:1/-1; display:flex; gap:14px; align-items:center; justify-content:space-between; padding:10px 16px max(10px,env(safe-area-inset-bottom)); background:#163126; border-top:1px solid var(--line); z-index:3; }
.actionbar p { margin:0; font-size:14px; color:var(--muted); } .actionbar .primary { min-width:240px; } .battle-actions { display:flex; gap:7px; flex-wrap:wrap; justify-content:center; } .battle-actions button { padding:8px 11px; font-size:14px; }
.notification { position:absolute; z-index:3; bottom:115px; left:50%; transform:translateX(-50%); max-width:90%; width:max-content; border:1px solid #e0b16d; border-radius:6px; padding:8px 12px; background:#243023f0; font-size:14px; text-align:center; pointer-events:none; }
#minimap { position:absolute; top:106px; right:10px; width:128px; height:80px; border:1px solid #e5cb8d; background:#203729; pointer-events:none; z-index:2; }
.touch-pads { position:absolute; bottom:max(14px,env(safe-area-inset-bottom)); inset-inline:16px; display:none; justify-content:space-between; pointer-events:none; z-index:2; }
.pad { position:relative; width:82px; height:82px; border-radius:50%; background:#142c229e; border:2px solid #b4c096a3; pointer-events:auto; touch-action:none; user-select:none; }
.pad i { display:block; position:absolute; width:24px; height:24px; border-radius:50%; background:#edd8a5a8; top:24px; left:27px; transform:translate(var(--dx,0px),var(--dy,0px)); }
.pad span { position:absolute; bottom:8px; left:0; right:0; font-size:11px; font-weight:750; } .pad.fire { border-color:#efba8f; background:#4831288f; }
.selection-label { position:absolute; bottom:12px; left:50%; transform:translateX(-50%); padding:7px 12px; max-width:88%; background:#10291fe8; border:1px solid #e9c58c; border-radius:5px; font-size:14px; pointer-events:none; }
.welcome { position:fixed; inset:0; z-index:8; display:flex; align-items:center; padding:6vw; background:linear-gradient(90deg,#0d211af5 10%,#10291ad4 40%,#12251b33),url('./siege-cover.webp') center/cover; }
.welcome-inner { max-width:650px; } h1 { font:700 clamp(45px,6vw,88px)/1.04 Georgia,serif; margin:16px 0 23px; letter-spacing:-.04em; } .welcome p { font-size:19px; line-height:1.6; color:#e2e8d1; } .welcome-buttons { display:flex; flex-wrap:wrap; gap:10px; margin:28px 0 18px; } .welcome small { color:#c4d4b9; font-size:13px; }
dialog { width:min(92vw,420px); border:1px solid #c3ad7a; border-radius:10px; background:#1d382b; color:var(--ink); padding:24px; max-height:92dvh; overflow:auto; } dialog::backdrop { background:#08160dd9; } .menu-buttons { display:grid; gap:9px; }
#game-shell[data-mode="battle"] { grid-template-columns:minmax(0,1fr); } #game-shell[data-mode="battle"] .drawer { display:none; } #game-shell[data-mode="battle"] .actionbar>p { display:none; } #game-shell[data-mode="battle"] .actionbar { justify-content:center; }
@media (pointer:coarse), (max-width:700px) { .touch-pads:not([hidden]) { display:flex; } }
@media (max-width:760px) {
 #game-shell { min-height:0; grid-template-columns:minmax(0,1fr); grid-template-rows:62px minmax(160px,1fr) minmax(0,41dvh) auto; }
 .topbar { gap:7px; padding:6px 9px; } .brand strong { font-size:18px; } .brand span { font-size:11px; max-width:130px; } .kingdom { gap:9px; font-size:11px; } .kingdom span { display:grid; } .kingdom b { font-size:14px; margin:0; }
 .topbar button { font-size:13px; padding:7px 9px; } .drawer { border-left:0; border-top:1px solid var(--line); } .tabs { padding:6px 9px; } .tabs button { min-height:39px; } .panel { padding:10px 13px; } h2 { font-size:24px; }
 .actionbar { gap:6px; padding:8px 10px max(8px,env(safe-area-inset-bottom)); } .actionbar p { font-size:12px; flex:1; } .actionbar .primary { min-width:0; width:57%; font-size:14px; padding:8px 10px; }
 #game-shell[data-mode="battle"] { grid-template-rows:62px minmax(0,1fr) auto; } #game-shell[data-mode="battle"] .arena { grid-row:2; }
 .battle-actions { gap:5px; } .battle-actions button { font-size:12px; min-height:42px; padding:6px 8px; }
 .combat-hud { inset:8px 8px auto; flex-wrap:wrap; gap:5px; } .combat-hud>div { padding:5px 7px; } .combat-hud>div:first-child { max-width:calc(100% - 95px); } .combat-hud span { font-size:12px; } .combat-hud b { font-size:13px; } .combat-hud .combat-meters { order:3; } .combat-hud button { margin-left:auto; font-size:12px; min-height:39px; padding:6px 8px; }
 .notification { font-size:12px; bottom:112px; } #minimap { top:111px; width:100px; height:63px; }
 .welcome { padding:25px; } .welcome p { font-size:17px; } .welcome small { font-size:12px; }
}
@media (orientation:landscape) and (max-height:540px) {
 #game-shell { min-height:0; grid-template-columns:minmax(0,1fr) 310px; grid-template-rows:48px minmax(0,1fr) auto; } .drawer { border-left:1px solid var(--line); border-top:0; } .brand strong { font-size:19px; } .brand span { display:none; } .topbar { padding:4px 12px; } .kingdom { display:flex; font-size:13px; } .kingdom span { display:block; } .kingdom b { margin-left:3px; }
 #game-shell[data-mode="battle"] { grid-template-columns:minmax(0,1fr); grid-template-rows:48px minmax(0,1fr) auto; } .touch-pads { inset-inline:12px; bottom:9px; } .pad { width:70px; height:70px; } .pad i { top:18px; left:21px; } .combat-hud .combat-meters { order:0; } #minimap { top:65px; width:96px; height:60px; } .combat-hud>div:first-child { max-width:45%; }
 .actionbar { padding:6px 10px; } .battle-actions button { min-height:36px; } .notification { bottom:85px; }
}
@media (orientation:landscape) and (max-height:540px) { .touch-pads:not([hidden]) { display:flex; } }
