@font-face { font-family: "Grenze Gotisch"; font-weight: 100 900; font-display: swap; src: url(fonts/grenzegotisch-latin.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url(fonts/inter-latin.woff2) format("woff2"); }
/* Base reset (the page is standalone, so it carries its own). */
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html, body { margin: 0; }
img { max-width: 100%; }
/* Design system: Coinhold design kit v1 (Claude Design). HUD header, cards on a soft lilac ground, royal + gold accents.
   Chart series colours (--s1..--s8) stay on the validated colour-blind-safe palette. */
:root {
  --bg: #F1F0F6; --surface: #FFFFFF; --surface2: #F6F5FA; --track: #E6E3EF; --ink: #1A1726; --ink2: #4A4560; --muted: #625C78;
  --line: #E1DEEA; --base: #C6C1D6; --input-line: #8C869E; --ring: rgba(26,18,64,.10);
  --gold: #855600; --gold-fill: #EDB035; --gold-deep: #D3961C; --gold-soft: #FCF1D8; --on-gold: #2A1A00;
  --royal: #4A2C9B; --royal-ink: #FFFFFF; --royal-text: #4A2C9B; --royal-soft: #ECE7FA; --royal-deep: #36207A;
  --good: #1B7444; --good-bg: #E1F3E8; --good-fill: #1B9A55; --warn: #F2A93B; --warn-text: #94510A; --warn-bg: #FCEDD6; --serious: #C8530A;
  --crit: #B42318; --crit-fill: #D23B30; --over-bg: #FDE6E3;
  --hp-violet: #6C58CF; --hp-orange: #B9620F; --hp-red: #D23B30;
  --hud1: #211845; --hud2: #2E2360; --on-hud-2: #C9C0EC; --glow-bg: #E3DEF3;
  --e1: 0 1px 2px rgba(26,18,64,.06), 0 1px 1px rgba(26,18,64,.04); --e2: 0 8px 20px rgba(26,18,64,.10), 0 2px 4px rgba(26,18,64,.06); --e3: 0 24px 56px rgba(16,10,44,.28), 0 4px 12px rgba(16,10,44,.14);
  --wood: #8a5a32; --leaf: #3F8F3A; --stone: #CFCBDB; --stone2: #A9A4BC; --win: #F2BC45; --hill1: #9BC48A; --hill2: #6FA163; --sky1: #BFD3F2;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --f-display: "Grenze Gotisch", Georgia, serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0F0D17; --surface: #1A1726; --surface2: #221E31; --track: #2C2740; --ink: #F3F0FB; --ink2: #C2BBD8; --muted: #9F98B8;
  --line: #2D2840; --base: #443D5E; --input-line: #7A7398; --ring: rgba(255,255,255,.10);
  --gold: #F4C866; --gold-fill: #F2BC45; --gold-deep: #D9A12B; --gold-soft: #3A2D12;
  --royal: #A78DFF; --royal-ink: #150B36; --royal-text: #BBA7FF; --royal-soft: #2A2247; --royal-deep: #8E70F2;
  --good: #5BD594; --good-bg: #12301F; --warn-text: #F5AB45; --warn-bg: #36250E; --crit: #FF8075; --crit-fill: #E5483C; --over-bg: #3C1714;
  --hp-violet: #9A87F2; --hp-orange: #F09A45; --hp-red: #FF6A5C;
  --hud1: #17112E; --hud2: #251C48; --glow-bg: #1C1636;
  --e1: 0 1px 2px rgba(0,0,0,.4); --e2: 0 10px 24px rgba(0,0,0,.45); --e3: 0 28px 64px rgba(0,0,0,.6);
  --stone: #4A4560; --stone2: #3A3550; --hill1: #2C4A2A; --hill2: #213A20; --sky1: #262048;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0F0D17; --surface: #1A1726; --surface2: #221E31; --track: #2C2740; --ink: #F3F0FB; --ink2: #C2BBD8; --muted: #9F98B8;
  --line: #2D2840; --base: #443D5E; --input-line: #7A7398; --ring: rgba(255,255,255,.10);
  --gold: #F4C866; --gold-fill: #F2BC45; --gold-deep: #D9A12B; --gold-soft: #3A2D12;
  --royal: #A78DFF; --royal-ink: #150B36; --royal-text: #BBA7FF; --royal-soft: #2A2247; --royal-deep: #8E70F2;
  --good: #5BD594; --good-bg: #12301F; --warn-text: #F5AB45; --warn-bg: #36250E; --crit: #FF8075; --crit-fill: #E5483C; --over-bg: #3C1714;
  --hp-violet: #9A87F2; --hp-orange: #F09A45; --hp-red: #FF6A5C;
  --hud1: #17112E; --hud2: #251C48; --glow-bg: #1C1636;
  --e1: 0 1px 2px rgba(0,0,0,.4); --e2: 0 10px 24px rgba(0,0,0,.45); --e3: 0 28px 64px rgba(0,0,0,.6);
  --stone: #4A4560; --stone2: #3A3550; --hill1: #2C4A2A; --hill2: #213A20; --sky1: #262048;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
  color-scheme: dark; }
.night-art { display: none !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .night-art { display: block !important; } :root:not([data-theme="light"]) .day-art { display: none !important; } }
:root[data-theme="dark"] .night-art { display: block !important; } :root[data-theme="dark"] .day-art { display: none !important; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: radial-gradient(1100px 420px at 50% -160px, var(--glow-bg), transparent 70%) no-repeat, var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 0 48px;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
h1, h2 { font-family: var(--f-display); font-weight: 700; letter-spacing: .01em; }
h2 { font-size: 1.6rem; line-height: 1.05; }
h3 { font-family: var(--f-body); font-size: 1rem; font-weight: 700; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--royal); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.label { font-size: .75rem; letter-spacing: .02em; color: var(--muted); font-weight: 600; }

/* header */
header.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 16px; padding: 14px 18px; border-radius: 18px; color: #fff;
  background: radial-gradient(500px 160px at 15% 0%, rgba(255,255,255,.16), transparent 70%), linear-gradient(135deg, var(--hud1), var(--hud2));
  box-shadow: 0 10px 30px -12px rgba(30,25,100,.55), inset 0 1px 0 rgba(255,255,255,.15); }
header.top .muted { color: rgba(255,255,255,.78); }
header.top .chip { background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); color: #fff; }
header.top .btn:disabled { background: rgba(255,255,255,.12); color: #fff; opacity: .8; box-shadow: none; }
.lvl-badge { position: relative; width: 46px; height: 52px; flex: none; filter: drop-shadow(0 3px 6px rgba(0,0,0,.3)); }
.lvl-badge svg { width: 100%; height: 100%; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 1.6rem; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.brand .crest { width: 42px; height: 42px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.crest { width: 38px; height: 38px; flex: none; }
.rank { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rankbox { min-width: 220px; display: flex; flex-direction: column; gap: 4px; }
.rankline { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; }
.rankline b { font-family: var(--f-display); font-size: .98rem; }
.xpbar { height: 12px; background: rgba(255,255,255,.16); border-radius: 99px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--ring); }
.xpbar i { display: block; height: 100%; background: linear-gradient(180deg, #ffe58a, var(--gold-fill) 55%, #d99a14); box-shadow: 0 0 10px rgba(242,182,50,.6); border-radius: 99px; transition: width .6s ease; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--ring); font-size: .85rem; white-space: nowrap; }
.chip svg { width: 16px; height: 16px; }

nav.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px; background: var(--surface); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--ring); scrollbar-width: none; }
nav.tabs a { flex: 1 0 auto; text-align: center; padding: 8px 14px; min-height: 56px; font-size: .9rem; touch-action: manipulation; border-radius: 9px; color: var(--ink2); text-decoration: none; font-weight: 500; white-space: nowrap; }
nav.tabs a:hover { background: var(--surface2); }
nav.tabs a[aria-current="page"] { background: var(--royal); color: var(--royal-ink); }
@media (max-width: 560px) { nav.tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; } nav.tabs a { padding: 8px 1px; font-size: .66rem; white-space: normal; line-height: 1.2; } }

.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border-radius: 10px; background: var(--royal-soft); color: var(--ink); font-size: .9rem; }
.banner .btns { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.span2 { grid-column: 1 / -1; }
@media (max-width: 820px) { .grid, .grid3 { grid-template-columns: minmax(0, 1fr); } .rank { margin-left: 0; width: 100%; } .rankbox { flex: 1; } }

.panel { background: var(--surface); border-radius: 14px; box-shadow: 0 0 0 1px var(--ring); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.panel-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 820px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px var(--ring); padding: 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat .v { font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; }
.stat .d { font-size: .82rem; color: var(--muted); }
.up { color: var(--good); } .down { color: var(--crit); }

/* buttons */
.btn { border: 0; cursor: pointer; min-height: 44px; touch-action: manipulation; padding: 10px 16px; border-radius: 9px; background: var(--surface2); box-shadow: inset 0 0 0 1px var(--ring); font-weight: 500; white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn { transition: transform .06s ease, box-shadow .06s ease, filter .12s; }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--royal) 86%, #fff), var(--royal)); color: var(--royal-ink); box-shadow: 0 3px 0 var(--royal-deep); }
.btn.primary:active:not(:disabled), .btn.gold:active:not(:disabled) { transform: translateY(2px); }
.btn.primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--royal-deep); }
.btn.gold:active:not(:disabled) { box-shadow: 0 1px 0 var(--gold-deep); }
.btn:not(.primary):not(.gold):active:not(:disabled) { transform: translateY(1px); }
.btn.gold { background: linear-gradient(180deg, #ffd668, var(--gold-fill)); color: #1b1505; box-shadow: 0 3px 0 var(--gold-deep); font-weight: 700; }
.btn.danger { color: var(--crit); }
.btn.sm { min-height: 40px; padding: 8px 12px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--royal); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* scene */
.scene { position: relative; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--ring); background: var(--sky2); }
.scene svg { display: block; width: 100%; height: auto; }
.scene .cap { position: absolute; left: 12px; top: 10px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 24px); }
.scene .cap span { background: color-mix(in srgb, var(--surface) 86%, transparent); padding: 3px 9px; border-radius: 99px; font-size: .78rem; box-shadow: 0 0 0 1px var(--ring); }
.dragon-g { cursor: pointer; }
@media (prefers-reduced-motion: no-preference) {
  .dragon-g .bob { animation: bob 3.2s ease-in-out infinite; }
  .flag { animation: wave 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: left center; }
}
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
@keyframes wave { 0%,100% { transform: skewY(0) } 50% { transform: skewY(-8deg) } }

/* dragons */
.dragons { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.dragon { border-radius: 12px; padding: 14px; background: var(--surface2); display: flex; flex-direction: column; gap: 8px; position: relative; }
.dragon.slain { opacity: .75; }
.dragon.hot { background: color-mix(in srgb, var(--crit-fill) 7%, var(--surface2)); }
.stat .ico { width: 42px; height: 42px; border-radius: 12px; }
.stat .ico svg { width: 22px; height: 22px; }
.panel { box-shadow: 0 0 0 1px var(--ring), 0 6px 18px -12px rgba(30,30,80,.25); }
.ribbon { position: absolute; right: 14px; bottom: 12px; padding: 6px 14px 6px 12px; font-family: var(--f-display); font-weight: 700; color: #1b1505; background: linear-gradient(180deg, #ffd668, var(--gold-fill)); clip-path: polygon(0 0, 100% 0, 92% 50%, 100% 100%, 0 100%); box-shadow: 0 2px 0 var(--gold-deep); font-size: .9rem; }
.dragon .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.dragon .portrait { width: 96px; height: 48px; flex: none; margin: -6px -6px 0 0; }
.hp { height: 12px; border-radius: 99px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--ring); overflow: hidden; }
.hp i { display: block; height: 100%; background: var(--crit-fill); border-radius: 99px; transition: width .7s cubic-bezier(.2,.8,.2,1); }
.dragon .row { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inline-form input { width: 110px; }

input[type="text"], input[type="number"], input[type="date"], input[type="password"], select, textarea {
  background: var(--surface); border: 1px solid var(--base); border-radius: 8px; padding: 9px 10px; min-height: 44px; min-width: 0; font-size: 16px; }
textarea { width: 100%; min-height: 110px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field span { font-size: .8rem; color: var(--muted); font-weight: 500; }

/* lists & tables */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
td.num, th.num { text-align: right; }
td select { padding: 3px 6px; font-size: .85rem; }
details summary { cursor: pointer; color: var(--royal); font-size: .88rem; }
details[open] summary { margin-bottom: 8px; }

/* quests */
.quests { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.quest { border-radius: 12px; padding: 14px; background: var(--surface2); display: flex; flex-direction: column; gap: 8px; }
.quest .qtop { display: flex; justify-content: space-between; gap: 8px; }
.quest .xp { font-weight: 700; color: var(--gold); white-space: nowrap; font-size: .9rem; }
.qbar { height: 8px; border-radius: 99px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--ring); overflow: hidden; }
.qbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--royal), color-mix(in srgb, var(--royal) 60%, var(--gold-fill))); border-radius: 99px; }
.qbar { height: 10px; }
.qhead { display: flex; gap: 10px; align-items: center; }
.medal { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #1b1505; background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold-fill) 60%, #c48a10); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15), 0 2px 6px rgba(184,131,12,.35); }
.medal svg { width: 20px; height: 20px; }
.quest.done-not .medal { filter: grayscale(.6); }
.quest.ready { box-shadow: 0 0 0 2px var(--gold-fill), 0 6px 22px -6px rgba(242,182,50,.7); }
@media (prefers-reduced-motion: no-preference) { .quest.ready { animation: glow 1.8s ease-in-out infinite; } }
@keyframes glow { 50% { box-shadow: 0 0 0 3px var(--gold-fill), 0 8px 30px -4px rgba(242,182,50,.9); } }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; background: var(--royal-soft); color: var(--ink); }
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.trophy { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 12px 8px; border-radius: 12px; background: var(--surface2); font-size: .85rem; }
.trophy svg { width: 40px; height: 40px; }
.trophy.locked svg { opacity: .45; }
.trophy.locked b { color: var(--ink2); }

/* budgets */
.bud { display: grid; grid-template-columns: 130px minmax(0, 1fr) 150px; gap: 10px; align-items: center; font-size: .9rem; }
@media (max-width: 560px) { .bud { grid-template-columns: minmax(0,1fr) auto; } .bud .bar { grid-column: 1 / -1; grid-row: 2; } }
.bud .bar { position: relative; height: 14px; background: var(--surface2); border-radius: 4px; }
.bud .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.bud .bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink2); }
.status { display: inline-flex; gap: 5px; align-items: center; font-size: .8rem; font-weight: 700; justify-self: end; white-space: nowrap; }
.status svg { width: 14px; height: 14px; }

/* charts */
.chart { width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--f-body); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; color: var(--ink2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { display: grid; grid-template-columns: minmax(160px, 240px) minmax(0, 1fr); gap: 18px; align-items: center; }
@media (max-width: 560px) { .donut-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; } .donut-wrap .catlist { width: 100%; } }
.catlist { display: flex; flex-direction: column; gap: 4px; font-size: .95rem; max-width: 520px; width: 100%; }
.catlist .row { display: grid; grid-template-columns: 12px minmax(0,1fr) 72px 40px; gap: 4px 10px; align-items: center; padding: 6px 8px; border-radius: 8px; }
.catlist .row:hover, .catlist .row.on { background: var(--surface2); }
.catlist .row > i { width: 12px; height: 12px; border-radius: 3px; }
.catlist .row b { text-align: right; }
.catlist .pct { color: var(--muted); text-align: right; font-size: .85rem; }
.catlist .share { grid-column: 2 / -1; height: 4px; border-radius: 99px; background: var(--surface2); overflow: hidden; }
.catlist .share span { display: block; height: 100%; border-radius: 99px; }
.donut path { transition: opacity .15s; }
.donut.dim path:not(.on) { opacity: .28; }
.upk { display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.upk:last-child { border-bottom: 0; }
.upk .ic { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: var(--ink); }
.upk .ln { display: flex; justify-content: space-between; gap: 4px 10px; flex-wrap: wrap; align-items: baseline; }
.upk .ln b { font-size: 1rem; }
.upk .amt { font-size: .9rem; color: var(--ink2); margin-right: auto; }
.upk .track { position: relative; height: 12px; border-radius: 99px; background: var(--surface2); box-shadow: inset 0 0 0 1px var(--ring); }
.upk .track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.upk .track .pace { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink2); border-radius: 2px; }
.upk .track .over { position: absolute; top: 0; bottom: 0; right: 0; border-radius: 0 99px 99px 0; background: repeating-linear-gradient(135deg, var(--crit-fill) 0 4px, transparent 4px 8px); }
.headline { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--ring); font-size: 1.08rem; }
.headline .ic { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--royal-soft); color: var(--royal); }
.headline .ic svg { width: 24px; height: 24px; }
.headline p { min-width: 0; }
.headline b.up { color: var(--good); } .headline b.down { color: var(--crit); }
.spark { display: block; width: 100%; height: 34px; margin-top: 6px; }
.mini { height: 8px; border-radius: 99px; background: var(--surface2); margin-top: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--ring); position: relative; }
.mini i { display: block; height: 100%; border-radius: 99px; }
.mini b { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink2); }
.nets { display: grid; gap: 4px; margin-top: -4px; }
.nets span { text-align: center; font-size: .78rem; font-weight: 700; padding: 3px 0; border-radius: 6px; background: var(--surface2); }
.bignum { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
#tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: var(--bg); padding: 7px 10px; border-radius: 8px; font-size: .82rem; line-height: 1.35; max-width: 240px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }

/* advisor */
.moves { display: flex; flex-direction: column; gap: 10px; }
.move { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px; border-radius: 12px; background: var(--surface2); }
.move .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--royal-soft); color: var(--royal); }
.move .ic svg { width: 20px; height: 20px; }
.move .impact { text-align: right; font-weight: 700; color: var(--good); white-space: nowrap; }
.move .impact small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
@media (max-width: 560px) { .move { grid-template-columns: 34px minmax(0,1fr); } .move .impact { grid-column: 2; text-align: left; } }
.compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .compare { grid-template-columns: minmax(0, 1fr); } }
.compare > div { padding: 12px; border-radius: 12px; background: var(--surface2); display: flex; flex-direction: column; gap: 3px; }
.compare .best { box-shadow: 0 0 0 2px var(--good-fill); }
.compare .big { font-size: 1.3rem; font-weight: 700; }
.slider { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.slider input { flex: 1; min-width: 160px; accent-color: var(--royal); }
.slider output { font-weight: 700; min-width: 70px; }
.note { font-size: .8rem; color: var(--muted); }

.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--base); border-radius: 12px; }
.welcome { display: flex; flex-direction: column; gap: 12px; }
.welcome ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* overlays */
.toast-zone { position: fixed; z-index: 60; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; gap: 10px; align-items: center; background: linear-gradient(135deg, var(--hud1), var(--hud2)); color: #fff; padding: 10px 14px; border-radius: 12px; font-size: .9rem; box-shadow: 0 8px 24px rgba(0,0,0,.22); max-width: 320px; }
.toast b { color: var(--gold-fill); }
.coin { position: fixed; z-index: 70; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2b8, var(--gold-fill) 55%, #b8830c); pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.dmg { position: absolute; right: 14px; top: 8px; font-weight: 800; color: var(--crit); font-size: 1.2rem; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { .dmg { animation: rise 1.1s ease-out forwards; } }
@keyframes rise { from { transform: translateY(0); opacity: 1 } to { transform: translateY(-34px); opacity: 0 } }
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(10,12,20,.5); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); color: var(--ink); border-radius: 16px; padding: 22px; max-width: 460px; width: 100%; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.35); max-height: 90vh; overflow: auto; }
.modal .btns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.levelup { text-align: center; }
.levelup .big { font-family: var(--f-display); font-size: 1.8rem; color: var(--gold); }
.levelup .burst { width: 160px; height: 160px; margin: -10px auto 0; display: block; }
@media (prefers-reduced-motion: no-preference) { .levelup .rays { animation: spin 14s linear infinite; transform-origin: 80px 80px; } }
@keyframes spin { to { transform: rotate(360deg); } }
.toast .tc { width: 22px; height: 22px; flex: none; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.lock { max-width: 420px; margin: 40px auto; align-items: center; text-align: center; }
.lockform { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.lockform input { font-size: 1.6rem; text-align: center; letter-spacing: .4em; padding: 12px; }
.btn.big { min-height: 52px; font-size: 1.05rem; }
nav.tabs a svg { width: 22px; height: 22px; display: block; margin: 0 auto 2px; }
.stat .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 6px; }
.stat .ico svg { width: 20px; height: 20px; }
footer { color: var(--muted); font-size: .8rem; text-align: center; padding-top: 8px; }

/* realm */
.resbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; border-radius: 16px; overflow: hidden; color: #fff; background: linear-gradient(135deg, var(--hud1), var(--hud2)); box-shadow: 0 10px 30px -14px rgba(30,25,100,.55); }
.res { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: rgba(255,255,255,.04); min-width: 0; }
.res .label { color: rgba(255,255,255,.75); }
.res .ric { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.14); margin-bottom: 4px; }
.res .ric svg { width: 20px; height: 20px; color: #ffd668; }
.res .rv { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; }
.res .rv small { font-size: .8rem; font-weight: 500; opacity: .8; }
.res .rv.neg { color: #ffb4a8; }
.res .rd { font-size: .8rem; color: rgba(255,255,255,.75); }
@media (max-width: 820px) { .resbar { grid-template-columns: repeat(2, minmax(0, 1fr)); } .res:last-child { grid-column: 1 / -1; } }
.holdings { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.holding { padding: 14px; border-radius: 14px; background: var(--surface2); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.holding .bld { width: 100%; height: auto; background: linear-gradient(180deg, color-mix(in srgb, var(--sky1) 55%, var(--surface2)), var(--surface2)); border-radius: 10px; }
.holding .bld.unbuilt { filter: grayscale(1); opacity: .45; }
.holding .hh { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.holding .kv { font-size: .88rem; padding: 4px 0; }
.chart .sk-name { fill: var(--ink); font-weight: 700; font-size: 12px; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; paint-order: stroke; }
.chart .sk-val { fill: var(--ink2); font-size: 11px; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; paint-order: stroke; }
.chart .rib { transition: opacity .15s; }
.chart .rib:hover { opacity: .6; }
.credit { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.credit .ln { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.credit .ln .status { margin-left: auto; }
.credit .track { position: relative; height: 12px; border-radius: 99px; background: var(--surface2); box-shadow: inset 0 0 0 1px var(--ring); }
.credit .track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.credit .track .pace { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink2); }

/* installed app */
.install { display: flex; flex-direction: column; gap: 10px; }
.install ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.install .os { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .install .os { grid-template-columns: minmax(0, 1fr); } }
.install .os > div { background: var(--surface2); border-radius: 12px; padding: 12px; }
@media (display-mode: standalone) { body { -webkit-user-select: none; user-select: none; } input, textarea, td, .v { -webkit-user-select: text; user-select: text; } }

/* ===== Design kit layer (overrides the prototype styles above) ===== */
body { background: var(--bg); font-size: 15px; line-height: 1.45; }
.panel { border-radius: 16px; box-shadow: var(--e1); border: 1px solid var(--line); background: var(--surface); }
.stat, .headline { box-shadow: var(--e1); border: 1px solid var(--line); border-radius: 16px; }
.stat .v { font-size: 1.6rem; font-weight: 800; letter-spacing: -.015em; }
.stat .ico, .headline .ic { background: var(--gold-soft); color: var(--gold); }
.headline { font-size: 1.05rem; font-weight: 500; }
.headline b { font-weight: 800; }
.dragon, .quest, .holding, .move, .compare > div, .trophy { background: var(--surface2); border: 1px solid var(--line); border-radius: 14px; }
/* HUD header: solid night-purple band, Grenze Gotisch brand and rank */
header.top { background: var(--hud1); box-shadow: var(--e2); border-radius: 18px; }
header.top .chip { background: var(--hud2); box-shadow: none; font-weight: 700; min-height: 36px; padding: 0 12px; }
.brand h1 { font-size: 2rem; line-height: 1; text-shadow: none; }
.rankline b { font-family: var(--f-display); font-size: 1.35rem; font-weight: 700; color: #fff; }
.rankline { color: var(--on-hud-2, #C9C0EC); align-items: baseline; }
.xpbar { height: 8px; }
.xpbar i { background: var(--gold-fill); box-shadow: none; }
/* buttons per kit: solid, with a 3px press */
.btn { font-weight: 700; border-radius: 12px; }
.btn.primary { background: var(--royal); color: var(--royal-ink); box-shadow: 0 3px 0 var(--royal-deep); }
.btn.primary:active:not(:disabled) { background: var(--royal-deep); transform: translateY(3px); box-shadow: none; }
.btn.gold { background: var(--gold-fill); color: #2A1A00; box-shadow: 0 3px 0 var(--gold-deep), inset 0 1px 0 rgba(255,255,255,.5); }
.btn.gold:active:not(:disabled) { background: var(--gold-deep); transform: translateY(3px); box-shadow: inset 0 2px 3px rgba(0,0,0,.18); }
.btn:not(.primary):not(.gold) { background: transparent; box-shadow: inset 0 0 0 1.5px var(--input-line); }
header.top .btn:not(.primary):not(.gold) { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); color: #fff; }
.btn.danger { color: var(--crit); }
/* tabs per kit: quiet bar, active tab gets a royal-soft pill behind its icon */
nav.tabs { background: var(--surface); box-shadow: var(--e1); border: 1px solid var(--line); border-radius: 16px; padding: 6px; }
nav.tabs a { color: var(--muted); font-weight: 600; border-radius: 12px; }
nav.tabs a svg { width: 46px; height: 30px; padding: 4px 12px; border-radius: 999px; box-sizing: border-box; }
nav.tabs a:hover { background: transparent; color: var(--ink); }
nav.tabs a[aria-current="page"] { background: transparent; color: var(--royal-text); }
nav.tabs a[aria-current="page"] svg { background: var(--royal-soft); }
/* phones: bottom tab bar, like a native app */
@media (max-width: 720px) {
  body { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  nav.tabs { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; border-radius: 0; border: 0; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(26,18,64,.08);
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; padding: 6px max(4px, env(safe-area-inset-left, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-right, 0px)); }
  nav.tabs a { min-height: 54px; padding: 2px 0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  nav.tabs a svg { margin-bottom: 2px; }
  header.top { margin-top: 12px; }
}
/* kingdom scene built from the kit art */
.scene { background: var(--surface2); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--e1); }
.scene .backdrop { display: block; width: 100%; height: auto; }
.scene .layer { position: absolute; inset: 0; }
.scene .sdragon { position: absolute; cursor: pointer; transform: translate(-50%, -50%); width: var(--w); }
.scene .sdragon img { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 8px rgba(0,0,0,.18)); }
@media (prefers-reduced-motion: no-preference) { .scene .sdragon > img { animation: bob 3.2s ease-in-out infinite; animation-delay: var(--d); } }
.scene .hpmini { height: 7px; border-radius: 99px; background: rgba(255,255,255,.9); margin: 0 18%; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.scene .hpmini i { display: block; height: 100%; background: var(--hp-red); }
.scene .tree { position: absolute; width: 9%; bottom: 8%; transform: translateX(-50%); }
.scene .tree img { width: 100%; display: block; }
.scene .orchard-label { position: absolute; bottom: 3%; font-size: .78rem; font-weight: 700; color: #1A1726; background: rgba(255,255,255,.85); padding: 2px 8px; border-radius: 99px; transform: translateX(-50%); white-space: nowrap; }
.scene .cap span { background: rgba(18,12,40,.82); color: #fff; box-shadow: none; font-weight: 600; }
.scene .cap span a { color: #F2BC45; }
.ribbon { font-family: var(--f-display); font-size: 1.05rem; }
@media (max-width: 560px) { .scene .orchard-label, .ribbon { font-size: .7rem; } .scene .cap span { font-size: .7rem; } }
.portrait-img { width: 104px; height: 72px; object-fit: contain; flex: none; margin: -8px -6px -4px 0; }
.dragon.hit .portrait-img, .sdragon.hit img { animation: shake .35s ease; }
@keyframes shake { 20% { transform: translateX(-5px) } 50% { transform: translateX(5px) } 80% { transform: translateX(-2px) } }
.holding .bld-img { display: block; width: 100%; height: 132px; object-fit: contain; background: linear-gradient(180deg, color-mix(in srgb, var(--sky1) 70%, var(--surface2)), var(--surface2)); border-radius: 10px; padding: 8px 0 2px; }
.holding .bld-img.unbuilt { filter: grayscale(1); opacity: .4; }
.holding .stars { display: flex; gap: 2px; color: var(--base); font-size: 15px; line-height: 1; }
.holding .stars b { color: var(--gold-fill); }
.levelup .keep { width: 150px; height: 180px; display: block; margin: 0 auto; object-fit: contain; }
@media (max-width: 720px) {
  header.top { padding: 12px 14px; gap: 10px 12px; }
  .brand h1 { font-size: 1.6rem; }
  .brand .crest { width: 34px; height: 34px; }
  .rank { gap: 8px 8px; }
  .rankbox { min-width: 0; flex: 1 1 calc(100% - 60px); }
  .lvl-badge { width: 40px; height: 45px; }
  header.top .chip { min-height: 34px; padding: 0 10px; font-size: .8rem; }
  #checkin { margin-left: auto; min-height: 42px; padding: 8px 14px; }
  #checkin .long { display: none; }
}

/* ===================== Game shell (game-first redesign) =====================
   Layout: fixed HUD on top, a full-width living kingdom (sticky, so the sheet slides up over it),
   a rounded sheet holding the current view, and a dock of chunky icon buttons at the bottom.
   Visual language: "sticker" UI that echoes the art: 2px #2B2140 outlines, hard 4px drop, glossy fills. */
:root { --outline: #2B2140; --sheet: #EFEDF6; --sky0: #86BDEB; --skyH: #C4DFF4; --grassH: #9CC67A; --grass1: #6CA650; --world-h: clamp(360px, 56vh, 600px); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --outline: #3A3356; --sheet: #14111F; --sky0: #0E1033; --skyH: #2B235C; --grassH: #2A3452; --grass1: #1C2440; } }
:root[data-theme="dark"] { --outline: #3A3356; --sheet: #14111F; --sky0: #0E1033; --skyH: #2B235C; --grassH: #2A3452; --grass1: #1C2440; }
body[data-view]:not([data-view="kingdom"]) { --world-h: clamp(240px, 36vh, 400px); }
body { padding: 0; background: var(--sky0); }
body[data-view="lock"] { background: var(--sheet); }

/* HUD */
.hud { position: fixed; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px)); transition: background .2s, box-shadow .2s; }
.hud.solid { background: #211845; box-shadow: 0 3px 0 var(--outline); }
.hud-l { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; max-width: 420px; }
.hud .lvl-badge { width: 44px; height: 50px; filter: drop-shadow(0 3px 0 rgba(43,33,64,.55)); }
.hud .rankbox { flex: 1; min-width: 0; padding: 5px 10px 7px; background: rgba(26,18,52,.82); border: 2px solid var(--outline); border-radius: 12px; box-shadow: 0 3px 0 var(--outline); }
.hud .rankline { display: flex; justify-content: space-between; gap: 8px; font-size: .72rem; font-weight: 700; color: #C9C0EC; align-items: baseline; }
.hud .rankline b { font-family: var(--f-display); font-size: 1.15rem; color: #fff; line-height: 1; letter-spacing: .02em; text-shadow: 0 2px 0 var(--outline); }
.hud .xpbar { height: 10px; margin-top: 4px; background: #120C26; border: 0; box-shadow: inset 0 1px 2px rgba(0,0,0,.6); }
.hud .xpbar i { background: linear-gradient(180deg, #FFE48F, #F2BC45 55%, #D9961C); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
.hud-r { display: flex; gap: 6px; align-items: center; flex: none; }
.res-pill { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 10px 0 4px; border-radius: 999px; background: rgba(26,18,52,.82); border: 2px solid var(--outline); box-shadow: 0 3px 0 var(--outline); color: #fff; font-size: .9rem; white-space: nowrap; }
.res-pill b { font-weight: 800; }
.res-pill small { font-size: .7rem; color: #C9C0EC; font-weight: 600; }
.res-pill .ri { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--outline); }
.res-pill .ri svg { width: 15px; height: 15px; }
.ri.gold { background: #FFE48F; } .ri.red { background: #FF9C8F; color: #5A1610; } .ri.fire { background: #FFD3A8; }
@media (max-width: 420px) { .hide-xs { display: none !important; } .res-pill { padding-right: 8px; } .hud .lvl-badge { width: 38px; height: 44px; } }

/* World */
.world { position: sticky; top: 0; z-index: 0; height: var(--world-h); overflow: hidden; --hz: 70%;
  background: linear-gradient(180deg, var(--sky0) 0, var(--skyH) calc(var(--hz) - 1px), var(--grassH) var(--hz), var(--grass1) 100%); }
.world .art { position: absolute; }
.world .art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.world .art.blend img { -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.world .sdragon { position: absolute; transform: translate(-50%, -50%) scale(var(--sz)); width: clamp(92px, 21vw, 190px); padding: 0; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.world .sdragon img { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 6px rgba(20,10,40,.22)); }
@media (prefers-reduced-motion: no-preference) { .world .sdragon > img { animation: bob 3.2s ease-in-out infinite; animation-delay: var(--d); } }
.world .hpmini { width: 64%; height: 9px; border-radius: 99px; background: #fff; border: 2px solid var(--outline); overflow: hidden; }
.world .hpmini i { display: block; height: 100%; background: linear-gradient(180deg, #FF8A7E, #D23B30); }
.world .dname { font-size: .7rem; font-weight: 800; color: #fff; background: rgba(26,18,52,.8); padding: 1px 7px; border-radius: 99px; white-space: nowrap; }
.world .sdragon:hover img, .world .sdragon:focus-visible img { filter: drop-shadow(0 0 10px rgba(255,214,102,.9)); }
.pin { position: absolute; transform: translate(-50%, -100%); display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 5px; border-radius: 999px; background: #fff; color: var(--outline);
  border: 2px solid var(--outline); box-shadow: 0 3px 0 var(--outline); font-size: .78rem; font-weight: 800; text-decoration: none; cursor: pointer; white-space: nowrap; }
.pin svg { width: 18px; height: 18px; padding: 2px; border-radius: 50%; background: #FFE48F; }
.pin::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 10px; height: 10px; background: #fff; border-right: 2px solid var(--outline); border-bottom: 2px solid var(--outline); transform: translateX(-50%) rotate(45deg); }
.pin:active { transform: translate(-50%, calc(-100% + 2px)); box-shadow: 0 1px 0 var(--outline); }
.world-actions { position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); bottom: 46px; display: flex; gap: 10px; align-items: flex-end; }
.orb { width: 70px; height: 70px; border-radius: 50%; border: 3px solid var(--outline); box-shadow: 0 4px 0 var(--outline); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: radial-gradient(circle at 35% 28%, #fff 0 8%, transparent 9%), linear-gradient(180deg, #8C6CF0, #4A2C9B); color: #fff; font-size: .68rem; font-weight: 800; text-decoration: none; cursor: pointer; position: relative; padding: 0; }
.orb svg { width: 26px; height: 26px; }
.orb.gold { background: radial-gradient(circle at 35% 28%, #fff 0 8%, transparent 9%), linear-gradient(180deg, #FFE48F, #EDB035 60%, #D3961C); color: #2A1A00; }
.orb.done { background: linear-gradient(180deg, #E9E6F2, #C6C1D6); color: var(--outline); opacity: 1; }
.orb b { position: absolute; top: -6px; right: -6px; min-width: 24px; height: 24px; border-radius: 99px; background: #D23B30; color: #fff; border: 2px solid var(--outline); display: grid; place-items: center; font-size: .75rem; }
.orb:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--outline); }
@media (prefers-reduced-motion: no-preference) { .orb.gold { animation: pulse 2.2s ease-in-out infinite; } }
@keyframes pulse { 50% { box-shadow: 0 4px 0 var(--outline), 0 0 0 8px rgba(242,188,69,.35); } }

/* Sheet */
.sheet { position: relative; z-index: 2; margin-top: -30px; background: var(--sheet); border-radius: 28px 28px 0 0; border-top: 3px solid var(--outline);
  padding: 14px max(14px, env(safe-area-inset-left, 0px)) calc(110px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-right, 0px)); min-height: 60vh; box-shadow: 0 -6px 0 rgba(43,33,64,.12); }
body[data-view="lock"] .sheet { margin-top: 0; border-top: 0; padding-top: calc(30px + env(safe-area-inset-top, 0px)); }
.grab { display: block; width: 46px; height: 6px; border-radius: 99px; background: var(--base); margin: -2px auto 12px; }
.sheet > .wrap { max-width: 1080px; margin: 0 auto; }

/* Sticker cards */
.panel, .stat, .headline { background: var(--surface); border: 2px solid var(--outline); border-radius: 20px; box-shadow: 0 4px 0 var(--outline); }
.dragon, .quest, .holding, .move, .compare > div, .trophy, .install .os > div { background: var(--surface2); border: 2px solid var(--outline); border-radius: 16px; box-shadow: 0 3px 0 var(--outline); }
.dragon.hot { background: color-mix(in srgb, #FF6A5C 10%, var(--surface2)); }
.banner { border: 2px solid var(--outline); border-radius: 16px; box-shadow: 0 3px 0 var(--outline); background: var(--gold-soft); }
/* Plaque headings: section titles sit on a royal banner plate */
.panel-head h2, .welcome h2, .lock h2 { display: inline-block; padding: 6px 16px 7px; font-size: 1.35rem; line-height: 1; color: #fff; background: linear-gradient(180deg, #6A4BD0, #4A2C9B);
  border: 2px solid var(--outline); border-radius: 12px; box-shadow: 0 3px 0 var(--outline); text-shadow: 0 2px 0 var(--outline); margin: -2px 0 0 -4px; }
.panel-head { align-items: center; }
/* Chunky buttons */
.btn { border: 2px solid var(--outline) !important; box-shadow: 0 4px 0 var(--outline) !important; border-radius: 14px; font-weight: 800; background: var(--surface) !important; color: var(--ink); }
.btn.primary { background: linear-gradient(180deg, #7B5CE0, #4A2C9B) !important; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn.gold { background: linear-gradient(180deg, #FFE48F, #EDB035 60%, #D9A12B) !important; color: #2A1A00; }
.btn.danger { color: var(--crit); }
.btn:active:not(:disabled) { transform: translateY(3px) !important; box-shadow: 0 1px 0 var(--outline) !important; }
.btn:disabled { opacity: .55; }
.btn.big { min-height: 52px; font-size: 1rem; gap: 8px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn.big svg { width: 20px; height: 20px; }
.actions-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .actions-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .actions-row > :first-child { grid-column: 1 / -1; } }
.linkbtn, details summary { color: var(--royal-text); font-weight: 700; }
/* Glossy bars */
.hp, .qbar, .mini, .track, .upk .track, .credit .track, .bud .bar { height: 14px !important; border: 2px solid var(--outline) !important; box-shadow: none !important; background: var(--track) !important; border-radius: 99px; }
.hp i, .qbar i, .mini i, .track i, .bud .bar i { background-image: linear-gradient(180deg, rgba(255,255,255,.45), rgba(255,255,255,0) 55%) !important; background-color: currentColor; }
.hp i { background-color: var(--hp-red) !important; }
.qbar i { background-color: #7B5CE0 !important; }
/* inputs */
input[type="text"], input[type="number"], input[type="date"], input[type="password"], select, textarea { border: 2px solid var(--outline); border-radius: 12px; background: var(--surface); }
/* tiles */
.stat .ico, .headline .ic, .move .ic, .medal { border: 2px solid var(--outline); }
.stat .ico, .headline .ic { background: #FFE48F; color: var(--outline); }
.stat .v { font-size: 1.7rem; }
.headline { align-items: center; }

/* Dock */
nav.tabs.dock { position: fixed; z-index: 35; left: 50%; right: auto; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(560px, calc(100% - 20px));
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; padding: 6px; background: #211845; border: 3px solid var(--outline); border-radius: 22px; box-shadow: 0 5px 0 var(--outline), 0 12px 30px rgba(20,10,40,.35); }
nav.tabs.dock a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; padding: 4px 0; border-radius: 15px; color: #C9C0EC; font-size: .68rem; font-weight: 800; text-decoration: none; white-space: nowrap; overflow: hidden; }
nav.tabs.dock a svg { width: 26px; height: 26px; padding: 0; margin: 0; background: none !important; border-radius: 0; }
nav.tabs.dock a:hover { color: #fff; background: rgba(255,255,255,.06); }
nav.tabs.dock a[aria-current="page"] { color: #2A1A00; background: linear-gradient(180deg, #FFE48F, #EDB035); border: 2px solid var(--outline); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.toast-zone { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.toast { border: 2px solid var(--outline); box-shadow: 0 4px 0 var(--outline); }
.modal { border: 3px solid var(--outline); box-shadow: 0 6px 0 var(--outline), 0 30px 80px rgba(0,0,0,.45); border-radius: 24px; }
footer { padding-top: 18px; }

/* fixes after first look */
.hud .rankbox { max-width: 220px; }
.hud .rankline span { white-space: nowrap; font-size: .68rem; }
.world .sdragon { width: clamp(80px, 21vw, 180px); }
nav.tabs.dock a { position: relative; }
nav.tabs.dock .count { position: absolute; top: 2px; right: 6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: #D23B30; color: #fff; border: 2px solid var(--outline); font-size: .62rem; display: grid; place-items: center; line-height: 1; }
@media (max-width: 520px) { :root { --world-h: clamp(400px, 60vh, 560px); } .world .dname { font-size: .62rem; } }
