/* Ember & Empire game UI. Mobile first, desktop first-class. No inline styles anywhere (CSP): every look is a class here.
   Layers: tokens > base > kit (frames, buttons, pills, bars, chips) > shell (stage, HUD, dock, windows) > city scene > pages. */
@font-face{font-family:"Cinzel";font-style:normal;font-weight:500 900;font-display:swap;src:url(../fonts/cinzel.woff2) format("woff2")}
@font-face{font-family:"Hanken Grotesk";font-style:normal;font-weight:400 800;font-display:swap;src:url(../fonts/hanken-grotesk.woff2) format("woff2")}
@font-face{font-family:"JetBrains Mono";font-style:normal;font-weight:500 700;font-display:swap;src:url(../fonts/jetbrains-mono.woff2) format("woff2")}
:root{
  --ink:#0a0705;--s0:#110c08;--s1:#1a130e;--s2:#251b13;--s3:#33261a;--s4:#46341f;
  --line:#3e2f20;--line2:#5a4428;
  --text:#f6ebd5;--muted:#b9a88e;--dim:#9a8b74;
  --gold-hi:#fff0b8;--gold:#f0b93e;--gold-lo:#a8741b;--brass:#8a6a2c;
  --green:#58c13f;--green-lo:#2f8a22;--red:#e5493b;--red-lo:#a3281d;--blue:#4f93e6;--blue-lo:#2a579f;
  --ember:#ee7b2c;
  --r-gold:#f0b93e;--r-food:#9fd96a;--r-ore:#b7c9de;--r-timber:#d29a62;--r-mana:#9db4ff;--r-citizens:#f0cfa9;
  /* aliases used by the landing page stylesheet */
  --bg:var(--ink);--panel:var(--s1);--panel2:var(--s2);--accent:var(--ember);--ok:var(--green);--bad:var(--red);--warn:var(--gold);--fg:var(--text);
  --radius:14px;--hud-h:86px;--dock-h:76px;
  --serif:"Cinzel","Palatino Linotype",Palatino,Georgia,serif;
  --sans:"Hanken Grotesk",system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --ui:var(--sans);--mono:"JetBrains Mono",ui-monospace,Consolas,monospace;
  --frame:url(../ui/frame.svg);--stone:url(../ui/stone.svg);
  --safe-b:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{margin:0;background:var(--ink);color:var(--text);font:16px/1.5 var(--ui);min-height:100vh;overflow-x:hidden;-webkit-font-smoothing:antialiased}
img,svg{max-width:100%}
a{color:var(--gold);text-decoration-thickness:1px;text-underline-offset:2px}
a:hover{color:var(--gold-hi)}
:focus-visible{outline:2px solid var(--gold-hi);outline-offset:2px;border-radius:8px}
h1,h2,h3{font-family:var(--serif);font-weight:700;line-height:1.2;letter-spacing:.01em;margin:0}
h1{font-size:1.7rem;margin:.2em 0 .5em}
h2{font-size:1.2rem;margin:1.4rem 0 .7rem;display:flex;align-items:center;gap:.5rem;color:var(--gold-hi);text-shadow:0 2px 0 rgba(0,0,0,.6)}
h3{font-size:1.05rem;margin:.1rem 0 .3rem}
p{margin:.5rem 0}
.muted{color:var(--muted)}
.small-text{font-size:.85rem}
code{background:var(--s2);padding:.1em .35em;border-radius:4px;font-size:.9em}
pre{background:var(--s1);padding:.7rem;border-radius:8px;overflow:auto}
hr{border:0;border-top:1px solid var(--line);margin:1.2rem 0}
.sprite{position:absolute;width:0;height:0;overflow:hidden}
.i{width:1.2em;height:1.2em;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;vertical-align:-.2em}
.i.ci{stroke:none;filter:drop-shadow(0 1px 0 rgba(0,0,0,.45))}
.i.lg{width:1.8em;height:1.8em}.i.xl{width:2.6em;height:2.6em}
.hp{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden}
.art{display:block;width:100%;height:auto;background:var(--s2)}
.skip{position:absolute;left:-999px}.skip:focus{left:.5rem;top:.5rem;z-index:99;background:var(--gold);color:#000;padding:.5rem .8rem;border-radius:8px}

/* ================= UI KIT ================= */
/* ---- buttons: chunky, bevelled, colour = meaning (green build/confirm, gold collect, red attack, blue info) ---- */
button,.button{--b1:#7fd44f;--b2:#3f9a2b;--b3:#2c7a1e;--edge:#17400f;--glow:rgba(88,193,63,.35);
  display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:2.8rem;padding:.5rem 1.15rem;margin:0;
  font:800 1rem/1.1 var(--ui);letter-spacing:.02em;color:#fff;text-decoration:none;cursor:pointer;border:2px solid #0d1a08;border-radius:11px;
  background:linear-gradient(180deg,var(--b1) 0%,var(--b2) 52%,var(--b3) 100%);
  box-shadow:inset 0 2px 0 rgba(255,255,255,.55),inset 0 -3px 0 rgba(0,0,0,.28),0 4px 0 var(--edge),0 8px 14px rgba(0,0,0,.45);
  text-shadow:0 2px 0 rgba(0,0,0,.45),0 0 3px rgba(0,0,0,.5);-webkit-tap-highlight-color:transparent;
  transition:transform .06s,box-shadow .06s,filter .15s}
button:hover,.button:hover{filter:brightness(1.1) saturate(1.05);color:#fff}
button:active,.button:active{transform:translateY(3px);box-shadow:inset 0 2px 0 rgba(255,255,255,.4),inset 0 -2px 0 rgba(0,0,0,.28),0 1px 0 var(--edge),0 3px 6px rgba(0,0,0,.45)}
button.gold,.button.gold{--b1:#ffe27a;--b2:#f0b93e;--b3:#c28617;--edge:#6e4a0c;color:#3a2205;text-shadow:0 1px 0 rgba(255,255,255,.55);border-color:#4a2f06}
button.red,.button.red,button.danger{--b1:#ff8a74;--b2:#e0483a;--b3:#a3281d;--edge:#5a1710;border-color:#2a0a06;color:#fff}
button.blue,.button.blue{--b1:#8cc2ff;--b2:#4f93e6;--b3:#2a579f;--edge:#12305d;border-color:#08162b}
button.secondary-btn,.button.secondary,button.secondary{--b1:#4a3a2a;--b2:#33261a;--b3:#241a11;--edge:#0d0805;color:var(--gold-hi);border-color:#0d0805;box-shadow:inset 0 1px 0 rgba(255,255,255,.22),inset 0 0 0 1px #6f5628,0 4px 0 var(--edge),0 8px 14px rgba(0,0,0,.4)}
button.link{background:none;border:0;box-shadow:none;color:var(--gold);padding:0;min-height:0;font-weight:500;text-decoration:underline;display:inline;text-shadow:none;transform:none}
button[disabled],.button[disabled]{filter:grayscale(.85) brightness(.7);cursor:not-allowed;transform:none}
button.choice{display:block;width:100%;text-align:left;margin:.4rem 0;--b1:#4a3a2a;--b2:#33261a;--b3:#241a11;--edge:#0d0805;color:var(--text);box-shadow:inset 0 0 0 1px #6f5628,0 3px 0 #0d0805}
.button.big{min-height:3.3rem;padding:.7rem 1.6rem;font-size:1.08rem;border-radius:13px}
.small-btn{min-height:2.2rem;padding:.25rem .8rem;font-size:.85rem;border-radius:9px}
form>button,form>.button{margin-top:.9rem}
.actions button,.row-form button,.inline-form button,.card form button,.stack-form button{margin-top:0}
.actions{display:flex;gap:.55rem;flex-wrap:wrap;align-items:center}.actions form{margin:0}
.inline-form{display:inline;margin:0}

/* ---- forms ---- */
label{display:block;margin:.9rem 0 .25rem;font-weight:700;color:var(--gold-hi)}
label.inline{font-weight:400;margin:.35rem 0;color:var(--text)}
input,select,textarea{width:100%;min-height:2.8rem;padding:.55rem .8rem;background:linear-gradient(180deg,#0a0705,#17100b);color:var(--text);border:2px solid #0a0705;border-radius:10px;font:inherit;font-size:1rem;box-shadow:inset 0 2px 5px rgba(0,0,0,.7),0 0 0 1px var(--line2)}
input:focus,select:focus,textarea:focus{outline:0;box-shadow:inset 0 2px 5px rgba(0,0,0,.7),0 0 0 2px var(--gold)}
/* the open list of a dropdown is drawn by the browser: give it the game's colours (it used to inherit pale text on a white list) */
select{color-scheme:dark}
select option,select optgroup{background:var(--s1);color:var(--text);font-weight:600}
select optgroup{color:var(--gold);font-style:normal;font-weight:800}
select option:checked,select option:hover{background:var(--s4) linear-gradient(0deg,var(--s4),var(--s4));color:var(--gold-hi)}
input[type=checkbox],input[type=radio]{accent-color:var(--gold);color-scheme:dark}
input[type=radio],input[type=checkbox]{width:auto;min-height:0;margin-right:.5rem;accent-color:var(--gold)}
input.tiny{width:5.5rem;display:inline-block;min-height:2.6rem;padding:.3rem .5rem}
select{appearance:none;-webkit-appearance:none;background-image:linear-gradient(180deg,#0a0705,#17100b),url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f0b93e' stroke-width='2'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:0 0,right .8rem center;padding-right:2.2rem}
.row{display:flex;gap:.75rem;flex-wrap:wrap}.row label{flex:1;min-width:10rem}.row label.small{flex:0 0 7rem}
.row-form{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;margin:.4rem 0}.row-form input,.row-form select{width:auto;flex:1;min-width:7rem}.row-form .tiny{max-width:5rem;min-width:4rem;flex:0 0 auto}
.mini-select{width:auto;min-height:2.2rem;padding:.15rem .4rem;font-size:.85rem}
fieldset{border:1px solid var(--line2);border-radius:12px;margin:1rem 0;padding:.6rem 1rem;background:rgba(0,0,0,.2)}
legend{padding:0 .4rem;color:var(--gold);font-weight:800}
.err{display:block;color:#ff9a8c;font-weight:400;font-size:.9rem}
.rate{margin-top:.8rem}

/* ---- framed surfaces (cards, panels): double gold hairline over stone ---- */
.card,.panel,.mini,.stat,.res-tile,.boss-card,.auth-card{
  position:relative;background:var(--stone),linear-gradient(180deg,var(--s2),var(--s1));border:1px solid #000;border-radius:var(--radius);
  box-shadow:inset 0 0 0 1px var(--brass),inset 0 0 0 3px #000,inset 0 4px 0 3px rgba(255,255,255,.04),0 6px 14px rgba(0,0,0,.45)}
.card,.panel,.mini{padding:1rem}
.panel{margin:1rem 0}.mini .actions{margin-top:.4rem}
.cards,.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(15rem,1fr));gap:1rem}
.cards.tight{grid-template-columns:repeat(auto-fill,minmax(11rem,1fr));gap:.8rem}
.card.art-card{padding:0;overflow:hidden;display:flex;flex-direction:column}
.card.art-card .card-art{aspect-ratio:16/9;object-fit:cover;border-bottom:2px solid #000}
.card.art-card.portrait .card-art{aspect-ratio:4/5;max-height:16rem;object-position:center top}
.card.art-card .card-body{padding:.9rem 1rem 1rem;display:flex;flex-direction:column;gap:.35rem;flex:1}
.card.art-card .card-body .actions,.card.art-card .card-body form{margin-top:auto}
.card.art-card .card-art.square{aspect-ratio:1;max-height:14rem}
.forge-card .gear-icon{float:right;width:3.5rem;height:3.5rem;margin:0 0 .4rem .6rem;border-radius:.4rem;border:1px solid #000;object-fit:cover}
.forge-card.forge-foreign{opacity:.65}
.forge-card .chip.short{border-color:#a33;color:#e9b3a8}
.forge-others>summary{cursor:pointer;margin:1rem 0 .6rem}
.card.locked .card-art{filter:grayscale(.85) brightness(.6)}
.card h3{display:flex;align-items:center;justify-content:space-between;gap:.5rem}
.herald{border-color:var(--ember)}
.lvl{display:inline-flex;align-items:center;justify-content:center;min-width:2.4rem;font:800 .8rem var(--ui);color:#3a2205;background:linear-gradient(180deg,#ffe27a,#f0b93e 60%,#c28617);border:2px solid #4a2f06;border-radius:99px;padding:.05rem .6rem;white-space:nowrap;box-shadow:inset 0 1px 0 rgba(255,255,255,.6)}
.tag{display:inline-flex;align-items:center;gap:.3rem;font-size:.74rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--gold-hi);background:rgba(240,185,62,.12);border:1px solid rgba(240,185,62,.4);border-radius:99px;padding:.1rem .6rem}
.alert{padding:.7rem .9rem;border-radius:12px;border:1px solid;border-left-width:5px;margin:.8rem 0;display:flex;gap:.6rem;align-items:flex-start}
.alert.error{background:#2e1517;border-color:#6b2a2c;border-left-color:var(--red)}
.alert.warn{background:#2b2210;border-color:#6a5321;border-left-color:var(--gold)}
.alert.ok{background:#112619;border-color:#26573a;border-left-color:var(--green)}
.warn-text{color:#f5c26b}

/* ---- pills, chips, bars ---- */
.chip{display:inline-flex;align-items:center;gap:.3rem;background:linear-gradient(180deg,#2b2016,#1a130d);border:1px solid #000;box-shadow:inset 0 0 0 1px var(--line2);border-radius:99px;padding:.12rem .7rem .12rem .5rem;font-size:.86rem;font-weight:700;margin:.1rem .1rem .1rem 0;white-space:nowrap}
.chip.win{background:#112619;color:#7fe298}.chip.loss{background:#2e1517;color:#ff9a8c}
.chip.res .i{width:1.15em;height:1.15em}
.chip.short{color:#ff9a8c;box-shadow:inset 0 0 0 1px #8a2e26}
.badge{display:inline-block;min-width:5.2rem;text-align:center;font-size:.75rem;font-weight:700;padding:.1rem .4rem;border-radius:6px}
.badge.ok{background:#12301d;color:#6fdc84}.badge.warn{background:#32290f;color:#f5c26b}.badge.fail{background:#33181a;color:#ff8a7a}
.hpbar,.bar{position:relative;height:16px;background:linear-gradient(180deg,#07050a,#1b140f);border:2px solid #000;border-radius:99px;overflow:hidden;margin:.4rem 0;box-shadow:inset 0 2px 4px rgba(0,0,0,.8),0 0 0 1px var(--line2)}
.hpbar div,.bar div{height:100%;border-radius:99px;box-shadow:inset 0 2px 0 rgba(255,255,255,.45),inset 0 -2px 0 rgba(0,0,0,.25)}
.hpbar div{background:linear-gradient(180deg,#ff8a74,#e0483a 55%,#a3281d)}
.bar div{background:linear-gradient(180deg,#a6ec6c,#58c13f 55%,#2f8a22)}
.bar.warn div,.bar.gold div{background:linear-gradient(180deg,#ffe27a,#f0b93e 55%,#c28617)}
.bar.mana div{background:linear-gradient(180deg,#a8c8ff,#4f93e6 55%,#2a579f)}
.meter{height:6px;background:#2a231d;border-radius:3px;margin-top:.4rem}.meter div{height:100%;width:0;border-radius:3px;background:#e5484d;transition:width .15s}
.stats{display:grid;grid-template-columns:repeat(auto-fill,minmax(9.5rem,1fr));gap:.7rem;margin:1rem 0}
.stat{padding:.7rem .85rem;display:flex;flex-direction:column;gap:.1rem}
.stat .label{color:var(--muted);font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;display:flex;align-items:center;gap:.35rem}
.stat .value{font-size:1.45rem;font-weight:800;font-family:var(--serif);color:var(--gold-hi)}
.stat small{font-size:.8rem;color:var(--muted);font-weight:400}
.small-value{font-size:1rem!important}
.cost-row{display:flex;flex-wrap:wrap;gap:.2rem;align-items:center}
.sep{color:var(--line2)}

/* ---- tables ---- */
.grid-table,table.checks{width:100%;border-collapse:collapse;margin:.8rem 0}
.grid-table th,.grid-table td,.checks td{padding:.55rem .6rem;border-bottom:1px solid #2a1f15;text-align:left;vertical-align:top}
.grid-table th{color:var(--gold);font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;background:rgba(0,0,0,.25)}
.grid-table tbody tr:hover td{background:rgba(240,185,62,.05)}
tr.unread td{font-weight:700}
@media (max-width:700px){.grid-table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}}
details.opts{margin-top:.2rem}
details.opts summary{cursor:pointer;color:var(--gold);font-weight:700;list-style:none;padding:.3rem 0}
details.opts summary::-webkit-details-marker{display:none}
details.opts summary::before{content:"\25B8\00a0"}
details.opts[open] summary::before{content:"\25BE\00a0"}
ul.plain{list-style:none;padding:0;margin:.4rem 0}ul.plain li{padding:.35rem 0;border-bottom:1px solid #261f19}
.lead{font-size:1.1rem;color:#d8cbb7;max-width:42rem}

/* ================= SHELL: stage, HUD, dock, windows ================= */
body.game{height:100vh;height:100dvh;overflow:hidden}
.stage{position:fixed;inset:0;z-index:0;overflow:hidden;background:radial-gradient(ellipse at 50% 28%,#34471f 0,#1a2611 48%,#090d06 100%)}
.stage::after{content:"";position:absolute;inset:0;background:radial-gradient(ellipse at 50% 40%,rgba(0,0,0,0) 20%,rgba(0,0,0,.55) 100%)}

.hud-top{position:fixed;top:0;left:0;right:0;z-index:60;display:flex;gap:8px;align-items:flex-start;padding:8px 8px 0;pointer-events:none;background:linear-gradient(180deg,rgba(6,4,2,.85),rgba(6,4,2,0))}
.hud-top>*{pointer-events:auto}
.medal{position:relative;flex:none;width:68px;height:68px;border-radius:50%;padding:4px;background:linear-gradient(180deg,#fff0b8,#e4b049 45%,#8d6220);box-shadow:0 0 0 2px #000,0 6px 12px rgba(0,0,0,.6),inset 0 2px 0 rgba(255,255,255,.7);display:block}
.medal .art,.medal .crest-ph{width:100%;height:100%;border-radius:50%;object-fit:cover;background:#1b1410;border:2px solid #000}
.medal .art{aspect-ratio:1}
.medal .lv{position:absolute;left:50%;bottom:-8px;transform:translateX(-50%);min-width:30px;text-align:center;font:900 .8rem var(--ui);color:#fff;background:linear-gradient(180deg,#e0483a,#a3281d);border:2px solid #000;border-radius:99px;padding:0 .4rem;box-shadow:inset 0 1px 0 rgba(255,255,255,.5);-webkit-text-stroke:2px rgba(0,0,0,.7);paint-order:stroke fill}
.hud-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
.medal{position:fixed;left:8px;top:calc(var(--hud-h) + 6px);z-index:61}
.fabs{position:fixed;right:8px;top:calc(var(--hud-h) + 6px);z-index:61}
body.win-open .medal,body.win-open .fabs{display:none}
.pills{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px 6px}
.pill{position:relative;display:flex;align-items:center;gap:.25rem;height:32px;min-width:0;padding:0 .4rem 0 32px;color:#fff;text-decoration:none;font:800 .82rem/1 var(--ui);
  background:linear-gradient(180deg,#30241a,#150f0a);border:2px solid #000;border-radius:99px;box-shadow:inset 0 0 0 1px var(--brass),inset 0 2px 0 rgba(255,255,255,.14),0 3px 6px rgba(0,0,0,.5);
  -webkit-text-stroke:2.5px rgba(0,0,0,.85);paint-order:stroke fill;white-space:nowrap}
.pill:hover{color:#fff;filter:brightness(1.15)}
.pill .tok{position:absolute;left:-4px;top:50%;transform:translateY(-50%);width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle at 35% 25%,#5a4630,#1c130c);border:2px solid #000;box-shadow:inset 0 0 0 2px var(--brass),0 2px 4px rgba(0,0,0,.6)}
.pill .tok .i{width:20px;height:20px}
.pill b{font-weight:900;overflow:hidden;text-overflow:ellipsis}
.pill small{font-weight:700;color:var(--dim);-webkit-text-stroke:0;font-size:.7rem}
.pill.turns{grid-column:span 2;background:linear-gradient(180deg,#3c2412,#1a0e07)}
.pill.turns .fill{position:absolute;left:30px;right:8px;bottom:3px;height:5px;border-radius:9px;background:#07050a;box-shadow:inset 0 1px 2px rgba(0,0,0,.8)}
.pill.turns .fill i{display:block;height:100%;border-radius:9px;background:linear-gradient(180deg,#ffe27a,#f0b93e 55%,#c28617)}
.power{display:none}
.fabs{display:flex;flex-direction:column;gap:10px;margin-top:2px}
.fab{position:relative;width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle at 35% 25%,#fff0b8,#e4b049 50%,#8d6220);border:2px solid #000;box-shadow:inset 0 2px 0 rgba(255,255,255,.7),0 5px 10px rgba(0,0,0,.6);text-decoration:none}
.fab .in{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle at 35% 25%,#4b3827,#17100a);border:2px solid #000}
.fab .i{width:22px;height:22px}
.fab:hover{filter:brightness(1.12);transform:translateY(-1px)}
.badge-n{position:absolute;top:-4px;right:-4px;min-width:20px;height:20px;padding:0 5px;display:grid;place-items:center;font:900 .72rem var(--ui);color:#fff;background:linear-gradient(180deg,#ff6a58,#c9301f);border:2px solid #000;border-radius:99px;box-shadow:inset 0 1px 0 rgba(255,255,255,.5);-webkit-text-stroke:2px rgba(0,0,0,.6);paint-order:stroke fill}
.badge-dot{position:absolute;top:-2px;right:-2px;width:14px;height:14px;border-radius:50%;background:#ff4a3a;border:2px solid #000;animation:pulse 1.6s infinite}
@keyframes pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.25)}}

.dock{position:fixed;left:0;right:0;bottom:0;z-index:65;display:flex;justify-content:center;padding:0 0 var(--safe-b);pointer-events:none}
.dock-bar{pointer-events:auto;display:grid;grid-template-columns:repeat(6,1fr);width:100%;max-width:760px;height:var(--dock-h);align-items:stretch;
  background:var(--stone),linear-gradient(180deg,#3a2c1d,#1b130c 40%,#0f0a06);border:2px solid #000;border-bottom:0;border-radius:18px 18px 0 0;box-shadow:inset 0 2px 0 var(--brass),inset 0 4px 0 rgba(255,255,255,.06),0 -8px 20px rgba(0,0,0,.6)}
.dock-btn{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--text);text-decoration:none;font:800 .68rem/1 var(--ui);letter-spacing:.03em;list-style:none;cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-text-stroke:2.5px rgba(0,0,0,.85);paint-order:stroke fill;padding-top:4px}
.dock-btn::-webkit-details-marker{display:none}
.dock-btn .tok{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle at 35% 25%,#5a4630,#1c130c);border:2px solid #000;box-shadow:inset 0 0 0 2px var(--brass),0 3px 6px rgba(0,0,0,.6);transition:transform .12s}
.dock-btn .tok .i{width:28px;height:28px}
.dock-btn:hover{color:#fff}.dock-btn:hover .tok{transform:translateY(-4px) scale(1.06)}
.dock-btn.active .tok{background:radial-gradient(circle at 35% 25%,#fff0b8,#e4b049 55%,#8d6220);box-shadow:inset 0 0 0 2px #fff0b8,0 0 14px rgba(240,185,62,.7),0 3px 6px rgba(0,0,0,.6)}
.dock-btn.active::before{content:"";position:absolute;top:0;left:22%;right:22%;height:3px;border-radius:0 0 4px 4px;background:var(--gold)}
.dock .badge-n{top:2px;right:calc(50% - 30px)}
.dock details{display:contents}
.drawer{position:fixed;left:50%;transform:translateX(-50%);width:min(760px,100%);bottom:calc(var(--dock-h) + var(--safe-b));max-height:min(72dvh,640px);overflow:auto;z-index:70;padding:.6rem .8rem 1rem;
  background:var(--stone),linear-gradient(180deg,#2a2016,#140e09);border:2px solid #000;border-radius:18px 18px 0 0;box-shadow:inset 0 2px 0 var(--brass),0 -20px 50px rgba(0,0,0,.7);-webkit-overflow-scrolling:touch}
.drawer h4{margin:.8rem .3rem .3rem;font:800 .72rem var(--ui);letter-spacing:.14em;text-transform:uppercase;color:var(--gold)}
.drawer .grab{width:2.6rem;height:4px;border-radius:4px;background:var(--line2);margin:.1rem auto .4rem}
.tiles-menu{display:grid;grid-template-columns:repeat(4,1fr);gap:.5rem}
.tm{position:relative;display:flex;flex-direction:column;align-items:center;gap:.25rem;padding:.55rem .2rem;border-radius:12px;text-decoration:none;color:var(--text);font:700 .72rem/1.1 var(--ui);text-align:center;background:linear-gradient(180deg,#2c2118,#17100b);border:1px solid #000;box-shadow:inset 0 0 0 1px var(--line2)}
.tm .i{width:32px;height:32px}
.tm:hover{box-shadow:inset 0 0 0 1px var(--gold);color:#fff}
.tm.active{box-shadow:inset 0 0 0 2px var(--gold)}
.drawer-user{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.2rem .3rem .6rem;border-bottom:1px solid var(--line);margin-bottom:.2rem}
.drawer-user form{margin:0}

/* ---- window: ribbon + framed body, over the dimmed city ---- */
.win-wrap{position:fixed;z-index:50;left:0;right:0;top:var(--hud-h);bottom:calc(var(--dock-h) + var(--safe-b));display:flex;justify-content:center;align-items:flex-start;padding:6px 8px 8px;pointer-events:none}
.win{pointer-events:auto;position:relative;display:flex;flex-direction:column;width:min(1080px,100%);max-height:100%;border:18px solid transparent;border-image:var(--frame) 32 fill / 18px / 0 stretch;
  background:var(--stone),linear-gradient(180deg,#2a2016,#16100b);background-clip:padding-box;filter:drop-shadow(0 18px 30px rgba(0,0,0,.7));animation:winIn .22s ease-out}
@keyframes winIn{from{opacity:0;transform:translateY(14px) scale(.985)}to{opacity:1;transform:none}}
.win-ribbon{position:relative;z-index:2;flex:none;margin:-34px 20px 0;min-height:56px;display:flex;align-items:center;justify-content:center;text-align:center;
  background:linear-gradient(180deg,#c4382c,#8d1f17 60%,#6a140e);border:2px solid #000;border-radius:6px;box-shadow:inset 0 2px 0 rgba(255,255,255,.35),inset 0 0 0 2px #e4b049,0 6px 10px rgba(0,0,0,.6)}
.win-ribbon::before,.win-ribbon::after{content:"";position:absolute;top:0;bottom:0;width:18px;background:linear-gradient(90deg,rgba(0,0,0,.45),transparent)}
.win-ribbon::after{right:0;transform:scaleX(-1)}.win-ribbon::before{left:0}
.win-ribbon .hero-img{position:absolute;inset:2px;width:calc(100% - 4px);height:calc(100% - 4px);object-fit:cover;opacity:.2;mix-blend-mode:luminosity;border-radius:4px;background:none}
.win-ribbon .rt{position:relative;padding:.35rem 3.2rem}
.win-ribbon h1{margin:0;font-size:1.35rem;color:var(--gold-hi);text-shadow:0 2px 0 rgba(0,0,0,.7),0 0 12px rgba(0,0,0,.6);-webkit-text-stroke:3px rgba(40,6,2,.9);paint-order:stroke fill;letter-spacing:.04em}
.win-ribbon p{margin:0;font-size:.78rem;color:#ffe3c4;text-shadow:0 1px 0 rgba(0,0,0,.8)}
.win-close{position:absolute;z-index:3;right:12px;top:-20px;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;text-decoration:none;color:#fff;background:radial-gradient(circle at 35% 25%,#ff8a74,#c9301f 60%,#7a140c);border:2px solid #000;box-shadow:inset 0 2px 0 rgba(255,255,255,.5),0 4px 8px rgba(0,0,0,.6)}
.win-close:hover{filter:brightness(1.15);color:#fff}.win-close .i{width:20px;height:20px;stroke:#fff;stroke-width:3.2}
.win-body{position:relative;flex:1;min-height:0;overflow:auto;padding:1rem 1.1rem 1.2rem;-webkit-overflow-scrolling:touch;scrollbar-color:var(--brass) transparent}
.win-body>*:first-child{margin-top:0}
.win-body::-webkit-scrollbar{width:10px}.win-body::-webkit-scrollbar-thumb{background:var(--brass);border-radius:9px;border:2px solid #1a130e}

/* ---- guest / auth pages ---- */
.guestbar{display:flex;align-items:center;justify-content:space-between;gap:.7rem;padding:.6rem 1rem;position:sticky;top:0;z-index:40;background:linear-gradient(180deg,rgba(6,4,2,.95),rgba(6,4,2,.75));border-bottom:2px solid #000;box-shadow:0 1px 0 var(--brass)}
.brand{display:flex;align-items:center;gap:.5rem;color:var(--text);text-decoration:none;font-family:var(--serif);font-weight:700;font-size:1.1rem;white-space:nowrap}
.brand:hover{color:#fff}.brand .i{width:1.5em;height:1.5em}.brand b{color:var(--ember)}
.nav{display:flex;gap:.4rem 1rem;align-items:center;flex-wrap:wrap;margin-left:auto}
.nav a{text-decoration:none}.nav a.active{color:var(--text);border-bottom:2px solid var(--ember)}
.guestbar .nav{margin:0;flex-wrap:nowrap;gap:.7rem}
.guestbar .button{min-height:2.4rem;padding:.3rem .9rem;font-size:.92rem;--b1:#ffe27a;--b2:#f0b93e;--b3:#c28617;--edge:#6e4a0c;color:#3a2205;text-shadow:0 1px 0 rgba(255,255,255,.55);border-color:#4a2f06}
body.guest{background:var(--ink) url(../art/island/backdrop.jpg) center/cover fixed}
body.guest::before{content:"";position:fixed;inset:0;background:radial-gradient(ellipse at 50% 30%,rgba(10,7,5,.62),rgba(10,7,5,.94));-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);z-index:0}
body.guest>*:not(.sprite){position:relative;z-index:1}
.container{max-width:62rem;margin:0 auto;padding:1.2rem .9rem}.container.wide{max-width:76rem}.narrow{max-width:38rem}
.auth-wrap{display:grid;gap:1rem;max-width:62rem;margin:0 auto}
.auth-art{border-radius:var(--radius);overflow:hidden;border:2px solid #000;box-shadow:0 0 0 1px var(--brass);display:none}
.auth-card{padding:1.4rem 1.3rem;max-width:30rem;width:100%;margin:0 auto}
.auth-card h1{margin-top:0}
@media (min-width:860px){.auth-wrap{grid-template-columns:1.1fr 1fr;align-items:center}.auth-art{display:block}.auth-card{margin:0}}
.dyn-pick{display:grid;gap:.7rem}
.dyn-pick label{display:block;margin:0;cursor:pointer;color:var(--text);font-weight:400}
.dyn-pick input{position:absolute;opacity:0;pointer-events:none}
.dyn-opt{display:flex;gap:.8rem;align-items:center;padding:.6rem;border:1px solid #000;box-shadow:inset 0 0 0 1px var(--line2);border-radius:14px;background:linear-gradient(180deg,#2a2016,#17100b)}
.dyn-opt .art{width:5.2rem;aspect-ratio:1;object-fit:cover;border-radius:10px;flex:none}
.dyn-opt strong{display:block;font-family:var(--serif)}
.dyn-pick input:checked+.dyn-opt{box-shadow:inset 0 0 0 2px var(--gold),0 0 18px rgba(240,185,62,.25);background:linear-gradient(180deg,#3a2c17,#1f160d)}
.dyn-pick input:focus-visible+.dyn-opt{outline:2px solid var(--gold-hi)}

/* ---- install / admin (simple chrome, same tokens) ---- */
.site-header{display:flex;align-items:center;flex-wrap:wrap;gap:.5rem 1.1rem;padding:.7rem 1rem;border-bottom:2px solid #000;background:linear-gradient(180deg,#2a2016,#17100b);box-shadow:0 1px 0 var(--brass)}
body.admin .nav{margin-left:0;width:100%}
@media (max-width:700px){body.admin .nav{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding-bottom:.2rem}body.admin .nav a{white-space:nowrap}}
.steps{display:flex;gap:.5rem;list-style:none;padding:0;margin:0 0 1rem;color:var(--muted);font-size:.9rem;flex-wrap:wrap}
.steps li{padding:.2rem .7rem;border-radius:99px;border:1px solid var(--line)}.steps li.current{color:var(--text);border-color:var(--ember)}
.badge-fail{color:#ff8a7a}
.menu{position:relative;display:inline-block}.menu summary{cursor:pointer;color:var(--gold);list-style:none}.menu summary::-webkit-details-marker{display:none}
.menu-list{position:absolute;right:0;top:1.8rem;background:var(--s1);border:1px solid var(--line);border-radius:10px;padding:.4rem .2rem;display:flex;flex-direction:column;min-width:11rem;z-index:5}
.menu-list a{padding:.3rem .8rem;white-space:nowrap}

.sheet-art{display:block;width:min(420px,100%);max-width:none;margin:0 auto;aspect-ratio:512/400;object-fit:cover;object-position:50% 100%;background:none;filter:drop-shadow(0 12px 14px rgba(0,0,0,.55))}
.sheet-box{overflow:visible;padding:.5rem}
.sheet{display:grid;gap:1rem}
@media (min-width:800px){.sheet{grid-template-columns:minmax(0,380px) 1fr;align-items:center}}
.lot-head{display:flex;align-items:center;gap:.7rem;margin-bottom:.4rem}
.lot-head .i{width:2.2rem;height:2.2rem}

/* ---- shared page parts (kingdom, barracks, boss, etc.) ---- */
.page-hero{position:relative;border-radius:var(--radius);overflow:hidden;margin:0 0 1.2rem;min-height:7rem;display:flex;align-items:flex-end;background:linear-gradient(135deg,#2a1c12,#120d0a);border:2px solid #000;box-shadow:0 0 0 1px var(--brass)}
.page-hero .hero-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:68% 50%}
.page-hero::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(10,8,6,.88) 0%,rgba(10,8,6,.55) 48%,rgba(10,8,6,.05) 100%)}
.page-hero-text{position:relative;z-index:1;padding:1rem 1.2rem}
.page-hero h1{margin:0;font-size:1.5rem;text-shadow:0 2px 12px rgba(0,0,0,.8)}
.page-hero p{margin:.25rem 0 0;color:#e3d6c1;font-size:.95rem}
.res-tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:.55rem;margin:.8rem 0}
@media (min-width:700px){.res-tiles{grid-template-columns:repeat(6,1fr)}}
.res-tile{padding:.6rem .5rem;text-align:center}
.res-tile .i{width:1.9rem;height:1.9rem}
.res-tile b{display:block;font-family:var(--serif);font-size:1.15rem;color:var(--gold-hi)}
.res-tile span{display:block;color:var(--muted);font-size:.72rem;text-transform:uppercase;letter-spacing:.06em}
.turn-card{display:flex;align-items:center;gap:1rem;background:linear-gradient(135deg,#3c2412,#1a0e07);border:2px solid #000;box-shadow:inset 0 0 0 1px var(--ember),0 6px 14px rgba(0,0,0,.45);border-radius:var(--radius);padding:.9rem 1.1rem;margin:.8rem 0}
.turn-card .i{width:2.6rem;height:2.6rem}
.turn-card b{font-family:var(--serif);font-size:1.8rem;line-height:1;color:var(--gold-hi)}
.turn-card .meta{flex:1}
.action-card{display:flex;flex-direction:column;gap:.5rem}
.action-head{display:flex;align-items:center;gap:.7rem}
.action-head .i{width:2.1rem;height:2.1rem}.action-head h3{margin:0}.action-head p{margin:0}
.unit-stat{display:flex;gap:.8rem;font-weight:800}.unit-stat span{display:inline-flex;align-items:center;gap:.25rem}
.tiles{display:grid;grid-template-columns:repeat(2,1fr);gap:.7rem}
@media (min-width:640px){.tiles{grid-template-columns:repeat(4,1fr)}}
.tile{position:relative;display:flex;flex-direction:column;justify-content:flex-end;min-height:6.5rem;border-radius:var(--radius);overflow:hidden;border:2px solid #000;box-shadow:0 0 0 1px var(--brass);text-decoration:none;color:var(--text);background:var(--s1)}
.tile .art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.tile::after{content:"";position:absolute;inset:0;background:linear-gradient(0deg,rgba(8,6,4,.92),rgba(8,6,4,.25) 70%)}
.tile span{position:relative;z-index:1;padding:.6rem .8rem;font-weight:800;display:flex;align-items:center;gap:.4rem}
.boss-card{overflow:hidden}
.boss-card .art{aspect-ratio:2/1;object-fit:cover}.boss-card .art.wide{aspect-ratio:3/1}
.boss-card .boss-body{padding:1rem}
.big-num{font-family:var(--serif);font-size:1.6rem;font-weight:800;color:var(--gold-hi)}
.dynasty{padding:.5rem 0;border-bottom:1px solid #2a231d}
.commander{margin:.8rem 0}
.chronicle p{margin:.55rem 0;font-style:italic;color:#e8dcc7;font-family:var(--serif);font-size:1.02rem}
.chat{max-height:20rem;overflow:auto;border:1px solid #000;box-shadow:inset 0 0 0 1px var(--line2);border-radius:12px;padding:.6rem .9rem;background:#0b0907}.chat p{margin:.3rem 0}
.card-body h2{margin-top:.2rem}

/* ---- toasts (flash messages float over the scene) ---- */
.toast-zone{position:fixed;left:50%;transform:translateX(-50%);top:calc(var(--hud-h) + 6px);z-index:90;width:min(520px,calc(100vw - 20px));pointer-events:none}
.toast{display:flex;gap:.6rem;align-items:center;padding:.65rem .9rem;border-radius:14px;font-weight:700;background:linear-gradient(180deg,#2d2318,#140e09);border:2px solid #000;box-shadow:inset 0 0 0 2px var(--brass),0 10px 24px rgba(0,0,0,.65);animation:toastIn .35s cubic-bezier(.2,1.4,.4,1),toastOut .4s ease-in 5.5s forwards}
.toast.error{box-shadow:inset 0 0 0 2px var(--red),0 10px 24px rgba(0,0,0,.65)}
.toast .i{width:1.7rem;height:1.7rem}
@keyframes toastIn{from{opacity:0;transform:translateY(-16px) scale(.92)}to{opacity:1;transform:none}}
@keyframes toastOut{to{opacity:0;transform:translateY(-10px)}}

/* ================= RESPONSIVE ================= */
@media (min-width:900px){
  :root{--hud-h:98px;--dock-h:84px}
  .hud-top{padding:10px 18px 0;gap:14px}
  .medal{position:relative;left:auto;top:auto;z-index:auto}
  .fabs{position:static}
  body.win-open .medal,body.win-open .fabs{display:flex}
  body.win-open .medal{display:block}
  .medal{width:76px;height:76px}
  .pills{display:flex;flex-wrap:nowrap;gap:12px;grid-template-columns:none}
  .pill{height:36px;padding-left:44px;font-size:1rem;min-width:118px}
  .pill .tok{width:42px;height:42px;left:-6px}.pill .tok .i{width:26px;height:26px}
  .pill.turns{min-width:190px}
  .pill.turns .fill{left:36px}
  .hud-main{flex-direction:column;gap:8px;align-items:center}
  .power{display:flex;align-items:center;gap:.5rem;padding:.1rem 1.1rem .1rem .6rem;font:900 1.15rem/1.4 var(--serif);color:var(--gold-hi);background:linear-gradient(180deg,#30241a,#150f0a);border:2px solid #000;border-radius:99px;box-shadow:inset 0 0 0 1px var(--brass),0 3px 6px rgba(0,0,0,.5);-webkit-text-stroke:3px rgba(0,0,0,.85);paint-order:stroke fill}
  .power .i{width:26px;height:26px}
  .power small{font:700 .7rem var(--ui);color:var(--muted);-webkit-text-stroke:0;letter-spacing:.1em;text-transform:uppercase}
  .fabs{flex-direction:row;margin-top:4px;gap:12px}
  .fab{width:52px;height:52px}.fab .in{width:38px;height:38px}.fab .i{width:26px;height:26px}
  .dock{padding-bottom:10px}
  .dock-bar{border:2px solid #000;border-radius:20px;box-shadow:inset 0 2px 0 var(--brass),inset 0 4px 0 rgba(255,255,255,.06),0 10px 24px rgba(0,0,0,.7);max-width:700px}
  .dock-btn{font-size:.74rem}
  .dock-btn .tok{width:48px;height:48px}.dock-btn .tok .i{width:32px;height:32px}
  .drawer{bottom:calc(var(--dock-h) + 22px);border-radius:18px;max-width:700px}
  .tiles-menu{grid-template-columns:repeat(5,1fr)}
  .win-wrap{padding:26px 24px 20px;bottom:calc(var(--dock-h) + 22px)}
  .win-body{padding:1.2rem 1.5rem 1.4rem}
  .win-ribbon h1{font-size:1.6rem}
  .toast-zone{top:calc(var(--hud-h) + 10px)}
}
@media (min-width:1500px){
  :root{--hud-h:106px}
  html{font-size:17px}
  .win{width:min(1180px,100%)}
}
@media (max-width:640px){
  h1{font-size:1.45rem}
  .cards,.grid{grid-template-columns:1fr}
  .cards.tight{grid-template-columns:repeat(2,1fr)}
  .stats{grid-template-columns:repeat(2,1fr)}
  .actions>*{flex:1 1 auto}.actions button,.actions .button{width:100%}
  .row-form button{flex:1 1 auto}
  .win-wrap{padding:14px 0 0}
  .win{width:100%;max-height:100%;border-width:12px;border-image-width:12px}
  .win-ribbon{margin:-14px 14px 0;min-height:48px}
  .win-ribbon .rt{padding:.3rem 2.6rem}.win-ribbon h1{font-size:1.15rem}
  .win-close{right:6px;top:-10px;width:36px;height:36px}
  .win-body{padding:.8rem .7rem 1rem}
  .card.art-card.portrait{flex-direction:row;align-items:stretch}
  .card.art-card.portrait .card-art{width:6.5rem;min-width:6.5rem;aspect-ratio:auto;max-height:none;height:auto;object-fit:cover;border-bottom:0;border-right:2px solid #000}
  .card.art-card.portrait .card-body{padding:.7rem .8rem}
  .card.art-card .card-art{aspect-ratio:21/9}
  .card.art-card .card-art.square{aspect-ratio:1;max-height:9rem}
  .cards.tight .card.art-card .card-art.square{max-height:7rem}
  .alert{flex-wrap:wrap}
  .auth-card{padding:1.1rem}
  .container{padding:1rem .8rem}
}
@media (max-width:700px){
  .grid-table.stack{display:block;overflow:visible}
  .grid-table.stack thead{display:none}
  .grid-table.stack tbody,.grid-table.stack tr,.grid-table.stack td{display:block}
  .grid-table.stack tr{background:linear-gradient(180deg,var(--s2),var(--s1));border:1px solid #000;box-shadow:inset 0 0 0 1px var(--line2);border-radius:12px;padding:.55rem .8rem;margin:.6rem 0}
  .grid-table.stack td{border:0;padding:.18rem 0;display:flex;justify-content:space-between;align-items:center;gap:1rem;text-align:right}
  .grid-table.stack td::before{content:attr(data-label);color:var(--muted);font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;text-align:left;flex:none}
  .grid-table.stack td[data-label=""]{justify-content:flex-start;flex-wrap:wrap;gap:.4rem;padding-top:.45rem}
  .grid-table.stack td[data-label=""]::before{content:none}
  .grid-table.stack td:first-child{font-weight:700;font-family:var(--serif);font-size:1.05rem;justify-content:flex-start;text-align:left}
  .grid-table.stack td:first-child::before{content:none}
}
@media (hover:none){button:hover,.button:hover{filter:none}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* bar widths (no inline styles allowed) */
.hpbar .w0,.bar .w0,.fill .w0{width:0%}.hpbar .w5,.bar .w5,.fill .w5{width:5%}.hpbar .w10,.bar .w10,.fill .w10{width:10%}.hpbar .w15,.bar .w15,.fill .w15{width:15%}.hpbar .w20,.bar .w20,.fill .w20{width:20%}.hpbar .w25,.bar .w25,.fill .w25{width:25%}.hpbar .w30,.bar .w30,.fill .w30{width:30%}.hpbar .w35,.bar .w35,.fill .w35{width:35%}.hpbar .w40,.bar .w40,.fill .w40{width:40%}.hpbar .w45,.bar .w45,.fill .w45{width:45%}.hpbar .w50,.bar .w50,.fill .w50{width:50%}.hpbar .w55,.bar .w55,.fill .w55{width:55%}.hpbar .w60,.bar .w60,.fill .w60{width:60%}.hpbar .w65,.bar .w65,.fill .w65{width:65%}.hpbar .w70,.bar .w70,.fill .w70{width:70%}.hpbar .w75,.bar .w75,.fill .w75{width:75%}.hpbar .w80,.bar .w80,.fill .w80{width:80%}.hpbar .w85,.bar .w85,.fill .w85{width:85%}.hpbar .w90,.bar .w90,.fill .w90{width:90%}.hpbar .w95,.bar .w95,.fill .w95{width:95%}.hpbar .w100,.bar .w100,.fill .w100{width:100%}
.abilities{margin:.2rem 0}.ability-tag{display:inline-block;padding:.05rem .5rem;margin:.1rem .15rem .1rem 0;border-radius:99px;border:1px solid var(--brass);background:rgba(240,185,62,.1);color:var(--gold-hi);font-size:.72rem;font-weight:700;cursor:help}

/* Dungeons: the chance of winning and the expedition ticker */
.odds{margin:.6rem 0;padding:.6rem .8rem;border:1px solid var(--line2);border-radius:10px;background:rgba(0,0,0,.28)}
.odds-head{display:flex;align-items:baseline;gap:.5rem;flex-wrap:wrap;margin:0 0 .4rem}
.odds-verdict{font-family:var(--serif);font-weight:900;font-size:1.05rem}
.odds-pct{font:900 1.3rem var(--serif);color:var(--gold-hi)}
.tone-good{color:#a8f09a}.tone-warn{color:#ffd98a}.tone-bad{color:#ffb0a4}
.odds-floors{display:grid;gap:.25rem;margin:.3rem 0}
.odds-floor{display:grid;grid-template-columns:4.2rem 1fr 2.6rem;gap:.5rem;align-items:center;font-size:.8rem}
.odds-bar{height:.55rem;border-radius:99px;background:#0a0705;border:1px solid #000;overflow:hidden;display:block}
.odds-fill{display:block;height:100%;border-radius:99px;background:currentColor}
.odds-fill.tone-good{background:linear-gradient(180deg,#7ee265,#2f8a22)}.odds-fill.tone-warn{background:linear-gradient(180deg,#ffd25a,#a8741b)}.odds-fill.tone-bad{background:linear-gradient(180deg,#ff7a6a,#a3281d)}
.odds-floor-pct{text-align:right;color:var(--muted)}
.odds-note{margin:.2rem 0 0}
.ticker{margin:.8rem 0;border:1px solid #000;border-radius:var(--radius);background:linear-gradient(180deg,#0c0806,#17100b);box-shadow:inset 0 0 0 1px var(--brass),0 6px 14px rgba(0,0,0,.45);overflow:hidden}
.ticker-head{display:flex;justify-content:space-between;align-items:center;gap:.5rem;flex-wrap:wrap;padding:.5rem .8rem;border-bottom:1px solid var(--line);background:rgba(0,0,0,.35)}
.ticker-log{list-style:none;margin:0;padding:.5rem .8rem;max-height:13rem;overflow-y:auto;font-family:ui-monospace,"Cascadia Mono",Consolas,monospace;font-size:.86rem;line-height:1.5;scroll-behavior:smooth}
.ticker-log li{padding:.12rem 0 .12rem .6rem;border-left:3px solid var(--line);margin:.1rem 0;animation:tickin .35s ease-out}
.ticker-log li.tone-info{color:var(--muted)}
.ticker-log li.tone-boss{color:var(--gold-hi);font-weight:800;border-left-color:var(--gold);margin-top:.5rem}
.ticker-log li.tone-good{color:#a8f09a;border-left-color:#2f8a22}
.ticker-log li.tone-bad{color:#ffb0a4;border-left-color:#a3281d}
.ticker-log li.tone-loot{color:#ffe08a;border-left-color:var(--gold-lo)}
.ticker-log li.tone-rare{color:#c9b3ff;border-left-color:#8a64f0;font-weight:800}
.ticker.playing .ticker-log::after{content:"\25AE";color:var(--gold);animation:blink 1s steps(2) infinite;padding-left:.6rem}
@keyframes tickin{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes blink{50%{opacity:0}}
@media (prefers-reduced-motion:reduce){.ticker-log li{animation:none}.ticker-log{scroll-behavior:auto}}
/* Banner trims (Deeds) */
.banner-chip{display:inline-flex;align-items:center;padding:.05rem .5rem;border-radius:.4rem;font:700 .7rem/1.5 var(--ui);letter-spacing:.04em;border:1px solid;vertical-align:middle}
.banner-ember{color:#ffb070;border-color:#c0561c;background:#3a1a0b}
.banner-wyrm{color:#9be3b0;border-color:#2f8a4a;background:#0e2a17}
.banner-blade{color:#d6dbe6;border-color:#8a93a8;background:#1d2230}
.banner-anvil{color:#e0c9a6;border-color:#8b6b3a;background:#2a1f12}
.banner-delver{color:#9fc2ff;border-color:#3f6fcf;background:#101c3a}
.banner-laurel{color:#c9e58a;border-color:#6b8f2a;background:#1c2a0c}
.banner-podium{color:#ffe27a;border-color:#c28617;background:#33260a}
.banner-crown{color:#ffd36b;border-color:#f0b93e;background:#3a2a06}
/* Locked things: what is needed, how far along, and the shortcut (U6) */
.lock-note{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin:.4rem 0;padding:.45rem .6rem;border:1px dashed var(--line2,#6b4d24);border-radius:.5rem;background:rgba(0,0,0,.22);font-size:.82rem}
.lock-note .i{width:1rem;height:1rem;flex:none}
.lock-note .bar{flex:1 1 5rem;min-width:4rem;margin:0;height:10px}
/* Ads on public pages: small, calm, clearly labelled */
.ad{display:block;max-width:46rem;margin:1rem auto;padding:.6rem .9rem;border:1px solid var(--line2,#6b4d24);border-radius:.6rem;background:rgba(0,0,0,.25);text-align:center;font-size:.9rem}
.ad a{display:flex;flex-direction:column;gap:.15rem;color:inherit;text-decoration:none}.ad a b{color:var(--gold-hi,#ffd36b)}.ad a span{color:var(--muted)}
.ad small{display:block;margin-top:.3rem;font-size:.65rem;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.ad ins{display:block;min-height:90px}
.ad-choices{text-align:center;margin:0}
.ad-consent{max-width:46rem;margin:.6rem auto;padding:.7rem 1rem;border:1px solid var(--line2,#6b4d24);border-radius:.6rem;background:rgba(0,0,0,.35);font-size:.85rem;text-align:center}
.banner-season{color:#ffd6e0;border-color:#c0456b;background:#3a0f1c}
.banner-moon{color:#f3e3a6;border-color:#9a8a3e;background:#2a2610}
.hearth{margin:.5rem 0 1rem}
.hearth-flames{display:inline-flex;gap:.1rem;vertical-align:middle;margin-right:.4rem}
.hearth-flames .flame{opacity:.3;filter:grayscale(1)}
.hearth-flames .flame.lit{opacity:1;filter:none;color:#ffb347}

/* U7 mobile and U8 accessibility passes (enhancements.md): symbols beside colour cues, text-only helpers, bigger tap targets on touch screens, a stronger palette on request. */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.chip.short::after{content:"\2717";margin-left:.2rem;font-weight:900}
.chip.win::before{content:"\2713\00a0"}.chip.loss::before{content:"\2717\00a0"}
.badge.ok::before{content:"\2713\00a0"}.badge.fail::before{content:"\2717\00a0"}.badge.warn::before{content:"!\00a0"}
.studio-balance.tone-good::before{content:"\2713\00a0"}.studio-balance.tone-warn::before{content:"!\00a0"}.studio-balance.tone-bad::before{content:"\2717\00a0"}
.hearth-flames{display:flex;flex-wrap:wrap}
@media (pointer:coarse),(max-width:700px){
  button,.button,select,input[type=text],input[type=number],input[type=search],input[type=password],input[type=email],input[type=datetime-local]{min-height:44px}
  .small-btn,.mini-select{min-height:44px;padding-inline:.9rem}
  button.link{min-height:44px;padding:.6rem .5rem}
  .win-close{width:44px;height:44px}
  .pill::after{content:"";position:absolute;inset:-6px 0} /* a 44px hit area around the 32px status chips without changing how they look */
  label.inline{display:flex;align-items:center;gap:.6rem;min-height:44px}
  input[type=checkbox],input[type=radio]{width:22px;height:22px;flex:none}
  .grid-table a{display:inline-block;padding:.5rem .25rem}
}
@media (prefers-contrast:more){:root{--muted:#dccfb6;--dim:#cbbda3;--line2:#8a6a44}.chip,.badge{outline:1px solid currentColor}}
.crest-art{width:56px;height:56px;object-fit:contain;vertical-align:middle;margin-right:.4rem}
