:root {
  --ink: #f3ead6;
  --muted: #b8b09f;
  --gold: #e8b53c;
  --gold-2: #ffd56e;
  --panel: rgba(17, 21, 42, 0.92);
  --panel-2: rgba(30, 35, 66, 0.92);
  --edge: rgba(232, 181, 60, 0.38);
  --heart: #ff5ad0;
  --gate: #d0904c;
  --hp: #e5493a;
  --mana: #3f9bff;
  --aether: #c79bff;
  --good: #7fd36b;
  --bad: #ff6b5a;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #141a33; color: var(--ink); font-family: var(--sans); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
button, select, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(10, 6, 20, 0.45) 100%); transition: background 0.3s; }
body.hurt #vignette { background: radial-gradient(ellipse at center, transparent 40%, rgba(160, 10, 10, 0.45) 100%); }

/* ---------------------------------------------------------------- crosshair */
#crosshair { position: fixed; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; pointer-events: none; display: none; }
body.playing #crosshair { display: block; }
#crosshair i { position: absolute; background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 3px #000; }
#crosshair i:nth-child(1), #crosshair i:nth-child(2) { width: 2px; height: 7px; left: 12px; }
#crosshair i:nth-child(1) { top: 0; }
#crosshair i:nth-child(2) { bottom: 0; }
#crosshair i:nth-child(3), #crosshair i:nth-child(4) { height: 2px; width: 7px; top: 12px; }
#crosshair i:nth-child(3) { left: 0; }
#crosshair i:nth-child(4) { right: 0; }
#crosshair.on i { background: #ffd56e; }

/* ---------------------------------------------------------------- floaters */
#floaters { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
#floaters span { position: absolute; left: 0; top: 0; font: 700 15px var(--sans); color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; white-space: nowrap; will-change: transform, opacity; }
#floaters span.gold { color: var(--gold-2); font-size: 13px; }
#floaters span.big { color: #ffb347; font-size: 19px; }
#floaters span.ally { color: #c9d0dc; font-size: 12px; }

/* ---------------------------------------------------------------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud button { pointer-events: auto; }
.bar { display: flex; align-items: center; gap: 8px; }
.bar .track { position: relative; height: 12px; flex: 1; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 7px; overflow: hidden; }
.bar .track i { position: absolute; inset: 0; transform-origin: left; background: var(--hp); transition: transform 0.15s; border-radius: 6px; }
.bar b { font: 700 12px var(--sans); min-width: 70px; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.bar .ico { font-size: 18px; filter: drop-shadow(0 1px 1px #000); }
.hud-tl { position: absolute; left: max(14px, env(safe-area-inset-left)); top: 14px; width: min(320px, 40vw); display: grid; gap: 7px; }
.hud-tl .heart .track i { background: linear-gradient(90deg, #b8269a, var(--heart)); }
.hud-tl .gate .track i { background: linear-gradient(90deg, #8a5a2a, var(--gate)); }
.hud-tl .gate.broken b { color: var(--bad); }
.hud-top { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); text-align: center; width: min(460px, 60vw); }
.hud-top > #wave-label, .hud-top > #wave-sub { background: radial-gradient(ellipse at center, rgba(10, 12, 28, 0.45), transparent 70%); }
#wave-label { font: 700 24px var(--serif); letter-spacing: 0.04em; text-shadow: 0 2px 6px #000; }
#wave-sub { font-size: 13px; color: #e6dfcf; font-weight: 600; text-shadow: 0 1px 3px #000, 0 0 6px #000; min-height: 16px; }
#boss-bar { margin-top: 8px; }
#boss-bar .name { display: block; font: 700 15px var(--serif); color: #ff9a7a; text-shadow: 0 1px 3px #000; margin-bottom: 3px; }
#boss-bar .track { height: 14px; background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(255, 140, 100, 0.5); border-radius: 8px; overflow: hidden; position: relative; }
#boss-bar .track i { position: absolute; inset: 0; transform-origin: left; background: linear-gradient(90deg, #7a1010, #e0402a); }
.hud-tr { position: absolute; right: max(14px, env(safe-area-inset-right)); top: 12px; display: grid; justify-items: end; gap: 8px; }
#gold, .gold-big { display: flex; align-items: center; gap: 7px; font: 700 22px var(--serif); color: var(--gold-2); text-shadow: 0 2px 4px #000; font-variant-numeric: tabular-nums; }
.coin { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2b0, #e8b53c 45%, #9a6a10); box-shadow: 0 0 0 1px #6a4a0a, 0 1px 3px #000; display: inline-block; }
#gold.pulse { animation: pulse 0.3s; }
@keyframes pulse { 50% { transform: scale(1.12); } }
#minimap { width: 168px; height: 200px; border-radius: 10px; background: rgba(10, 14, 28, 0.6); border: 1px solid var(--edge); }
#btn-pause { position: absolute; right: 196px; top: 14px; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--edge); background: rgba(16, 20, 40, 0.7); display: flex; gap: 5px; align-items: center; justify-content: center; cursor: pointer; }
#btn-pause i { width: 4px; height: 14px; background: var(--ink); border-radius: 2px; }

.hud-bottom { position: absolute; left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.mage-bars { width: min(300px, 34vw); display: grid; gap: 5px; padding: 10px 12px; border-radius: 12px; background: rgba(12, 15, 32, 0.55); border: 1px solid rgba(232, 181, 60, 0.2); }
#spells { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); }
.mage-bars .bar b { min-width: 64px; }
.mage-bars .mana .track i { background: linear-gradient(90deg, #2050c0, var(--mana)); }
.mage-bars .hp .track i { background: linear-gradient(90deg, #a01e1e, var(--hp)); }
#spells { display: flex; gap: 8px; }
.spell { position: relative; width: 56px; height: 56px; border-radius: 12px; background: rgba(16, 20, 40, 0.85); border: 1px solid var(--edge); display: grid; place-items: center; font-size: 26px; overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.spell .k { position: absolute; left: 4px; top: 2px; font: 700 10px var(--sans); color: var(--muted); }
.spell .c { position: absolute; right: 4px; bottom: 2px; font: 700 10px var(--sans); color: #9cc8ff; }
.spell .cd { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.62); transform-origin: bottom; }
.spell .t { position: absolute; inset: 0; display: grid; place-items: center; font: 700 16px var(--sans); text-shadow: 0 1px 2px #000; }
.spell.nomana { filter: saturate(0.3) brightness(0.7); }
.spell.locked { opacity: 0.28; }
.spell.ready { border-color: rgba(255, 213, 110, 0.75); }

#prep { position: absolute; left: 50%; bottom: 168px; transform: translateX(-50%); display: flex; gap: 10px; }
#respawn { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); font: 700 22px var(--serif); text-shadow: 0 2px 6px #000; }
#banner { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); text-align: center; width: min(640px, 90vw); animation: banner 3.2s forwards; }
#banner h2 { font: 700 44px var(--serif); margin: 0; color: var(--gold-2); text-shadow: 0 3px 12px #000, 0 0 30px rgba(232, 181, 60, 0.35); letter-spacing: 0.03em; }
#banner p { margin: 6px 0 0; font-size: 16px; text-shadow: 0 2px 6px #000; color: var(--ink); }
#banner.boss h2 { color: #ff7a5a; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, 10px) scale(0.96); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
#toasts { position: absolute; left: 50%; top: 122px; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; }
.toast { padding: 7px 14px; border-radius: 999px; background: rgba(16, 20, 40, 0.88); border: 1px solid var(--edge); font-size: 14px; animation: toast 3.4s forwards; text-shadow: 0 1px 2px #000; }
.toast.bad { border-color: rgba(255, 107, 90, 0.6); color: #ffd0c8; }
.toast.good { border-color: rgba(127, 211, 107, 0.6); }
@keyframes toast { 0% { opacity: 0; transform: translateY(-6px); } 10% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }

/* ---------------------------------------------------------------- buttons */
button { cursor: pointer; border: 0; }
.primary, .ghost, .ascend, .danger { padding: 10px 18px; border-radius: 11px; font-weight: 700; transition: transform 0.08s, filter 0.15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.primary { background: linear-gradient(180deg, #ffd56e, #d6962a); color: #2a1a05; box-shadow: 0 3px 0 #8a5a10, 0 6px 14px rgba(0, 0, 0, 0.4); }
.ghost { background: rgba(255, 255, 255, 0.08); color: var(--ink); border: 1px solid rgba(255, 255, 255, 0.18); }
.ascend { background: linear-gradient(180deg, #b48bff, #6a3fd0); color: #fff; box-shadow: 0 3px 0 #3a1f80, 0 6px 14px rgba(0, 0, 0, 0.4); }
.danger { background: rgba(255, 90, 70, 0.14); color: #ffb3a8; border: 1px solid rgba(255, 107, 90, 0.4); }
.big { padding: 13px 26px; font-size: 18px; }
button:hover:not(:disabled), a.ghost:hover { filter: brightness(1.12); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { filter: grayscale(0.8) brightness(0.6); cursor: default; }
.k { font: 700 11px var(--sans); padding: 1px 6px; border-radius: 5px; background: rgba(0, 0, 0, 0.25); opacity: 0.8; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }

/* ---------------------------------------------------------------- panels */
.panel { background: var(--panel); border: 1px solid var(--edge); border-radius: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); }
.panel h2, .screen h2 { font: 700 28px var(--serif); margin: 0; color: var(--gold-2); }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

#shop { position: fixed; right: max(12px, env(safe-area-inset-right)); top: 12px; bottom: 12px; width: min(560px, calc(100vw - 24px)); display: flex; flex-direction: column; padding: 16px 16px 12px; z-index: 5; }
#shop header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
#preview { margin: 10px 0 2px; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
#preview .chip { padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); }
#preview .chip.boss { border-color: rgba(255, 120, 90, 0.6); color: #ffb3a0; }
#preview .chip.new { border-color: rgba(127, 211, 107, 0.6); }
#preview .lbl { color: var(--muted); padding: 3px 2px; }
.tabs { display: flex; gap: 4px; margin: 10px 0 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); overflow-x: auto; }
.tabs button { background: none; padding: 8px 12px; color: var(--muted); font-weight: 700; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--gold-2); border-color: var(--gold); }
.items { flex: 1; overflow-y: auto; display: grid; gap: 8px; align-content: start; padding-right: 4px; }
.item { display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid rgba(255, 255, 255, 0.07); }
.item .ico { font-size: 26px; text-align: center; }
.item h3 { margin: 0; font-size: 15px; display: flex; gap: 8px; align-items: baseline; }
.item h3 .lv { font-size: 11px; color: var(--muted); font-weight: 700; }
.item p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.item p .up { color: var(--good); font-weight: 700; }
.item .buy { min-width: 92px; padding: 8px 10px; border-radius: 10px; background: linear-gradient(180deg, #ffd56e, #d6962a); color: #2a1a05; font-weight: 800; display: flex; gap: 5px; align-items: center; justify-content: center; }
.item .buy .coin { width: 13px; height: 13px; }
.item .buy.cant { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.item .buy.done { background: none; color: var(--muted); }
.item.choose { grid-template-columns: 42px 1fr; }
.kinds { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; }
.kinds button { padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); text-align: left; font-size: 12px; }
.kinds button b { display: block; font-size: 13px; }
.kinds button .cost { color: var(--gold-2); font-weight: 700; }
.section-title { font: 700 13px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 8px 2px 0; }
#shop footer { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
#shop footer .ascend { margin-right: auto; }

/* ---------------------------------------------------------------- screens */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; z-index: 10; }
.screen.dim { background: rgba(8, 10, 22, 0.6); backdrop-filter: blur(3px); z-index: 20; }
#menu { background: linear-gradient(90deg, rgba(10, 14, 32, 0.78), rgba(10, 14, 32, 0.35) 38%, transparent 60%); align-items: flex-start; padding-left: max(6vw, 24px); }
#menu .title { text-align: left; }
#menu .menu-buttons { width: min(300px, 80vw); }
#menu .stats { max-width: 340px; }
@media (max-width: 720px) {
  #menu { align-items: center; padding-left: 24px; background: linear-gradient(180deg, rgba(10, 14, 32, 0.25), rgba(10, 14, 32, 0.7)); }
  #menu .title { text-align: center; }
}
.title { text-align: center; }
.title h1 { font: 700 clamp(48px, 9vw, 96px) var(--serif); margin: 0; color: var(--gold-2); letter-spacing: 0.04em; text-shadow: 0 4px 0 #6a4510, 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 60px rgba(98, 220, 255, 0.25); }
.title p { margin: 6px 0 0; font: italic 18px var(--serif); text-shadow: 0 2px 6px #000; }
.menu-buttons { display: grid; gap: 10px; min-width: 260px; }
.menu-buttons.row { display: flex; justify-content: center; gap: 10px; }
.stats { color: var(--ink); text-shadow: 0 1px 3px #000; font-size: 14px; min-height: 18px; }
#loading { display: grid; gap: 6px; justify-items: center; width: 260px; font-size: 13px; color: var(--muted); }
#loading .track { width: 100%; height: 6px; border-radius: 4px; background: rgba(0, 0, 0, 0.4); overflow: hidden; }
#loading .track i { display: block; height: 100%; width: 0; background: var(--gold); transition: width 0.2s; }
.narrow { width: min(460px, 92vw); padding: 22px; display: grid; gap: 14px; }
.narrow label { display: grid; grid-template-columns: 1fr 1.3fr; align-items: center; gap: 12px; font-size: 14px; }
.narrow label.check { grid-template-columns: auto 1fr; }
.narrow select { background: var(--panel-2); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; padding: 6px; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.help ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
.help p { margin: 0; font-size: 14px; }
#over { background: radial-gradient(ellipse at center, rgba(40, 10, 30, 0.55), rgba(8, 8, 20, 0.85)); }
#over h2 { font-size: 44px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: 10px; }
.stat-grid div { background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; padding: 10px 14px; text-align: center; }
.stat-grid b { display: block; font: 700 24px var(--serif); color: var(--gold-2); }
.stat-grid span { font-size: 12px; color: var(--muted); }
.aether-gain { font: 700 22px var(--serif); color: var(--aether); text-shadow: 0 0 20px rgba(199, 155, 255, 0.5); }

/* ---------------------------------------------------------------- tree */
#tree { background: radial-gradient(ellipse at 50% 45%, rgba(60, 30, 110, 0.75), rgba(8, 8, 22, 0.94)); justify-content: flex-start; padding-top: 18px; }
#tree header { width: min(1100px, 100%); display: flex; justify-content: space-between; align-items: center; }
.aether-big { font: 700 30px var(--serif); color: var(--aether); display: flex; gap: 8px; align-items: center; text-shadow: 0 0 18px rgba(199, 155, 255, 0.6); }
#tree-wrap { flex: 1; min-height: 0; width: min(1100px, 100%); overflow: auto; position: relative; border-radius: 16px; }
#tree-canvas { position: relative; width: 760px; height: 760px; margin: 0 auto; }
#tree-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
#tree-lines line { stroke: rgba(199, 155, 255, 0.22); stroke-width: 3; }
#tree-lines line.on { stroke: rgba(255, 213, 110, 0.7); }
.node { position: absolute; width: 78px; height: 78px; margin: -39px 0 0 -39px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #3a2f63, #17142b); border: 2px solid rgba(199, 155, 255, 0.35); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); font-size: 28px; padding: 0; }
.node .r { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); font: 700 11px var(--sans); background: #17142b; border: 1px solid rgba(199, 155, 255, 0.4); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.node .nm { position: absolute; top: 82px; left: 50%; transform: translateX(-50%); font: 600 11.5px var(--sans); color: var(--ink); white-space: nowrap; text-shadow: 0 1px 3px #000; }
.node.locked { filter: grayscale(1) brightness(0.45); }
.node.buyable { border-color: var(--gold-2); box-shadow: 0 0 18px rgba(255, 213, 110, 0.45); animation: glow 1.6s infinite; }
.node.owned { border-color: rgba(255, 213, 110, 0.7); background: radial-gradient(circle at 35% 30%, #6a4fc0, #2a1f55); }
.node.maxed { border-color: var(--gold); }
.node.sel { outline: 3px solid #fff; outline-offset: 3px; }
@keyframes glow { 50% { box-shadow: 0 0 30px rgba(255, 213, 110, 0.75); } }
#tree-info { position: fixed; right: 18px; top: 110px; width: min(300px, 90vw); padding: 16px; display: grid; gap: 8px; z-index: 11; }
#tree-info h3 { margin: 0; font: 700 20px var(--serif); color: var(--gold-2); }
#tree-info p { margin: 0; font-size: 14px; }
#tree-info .meta { color: var(--muted); font-size: 12.5px; }
#tree footer { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
#march select { margin-left: 6px; background: var(--panel-2); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; padding: 6px; }

/* ---------------------------------------------------------------- boons */
#hud-boons, #shop-boons { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 168px; font-size: 18px; }
#hud-boons span, #shop-boons span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: rgba(16, 20, 40, 0.75); border: 1px solid var(--edge); pointer-events: auto; cursor: help; }
#shop-boons { justify-content: flex-start; max-width: none; margin-top: 6px; }
#boons { z-index: 22; }
#boons h2 { font-size: 34px; }
#boon-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 230px)); gap: 14px; justify-content: center; width: min(1000px, 100%); }
.boon { position: relative; display: grid; justify-items: center; gap: 6px; padding: 20px 16px 16px; border-radius: 16px; text-align: center; background: linear-gradient(180deg, rgba(40, 46, 86, 0.96), rgba(18, 22, 44, 0.96)); border: 2px solid rgba(255, 255, 255, 0.18); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5); transition: transform 0.12s, box-shadow 0.12s; }
.boon:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(255, 213, 110, 0.3); }
.boon .ico { font-size: 40px; }
.boon b { font: 700 19px var(--serif); color: var(--ink); }
.boon em { font: 700 11px var(--sans); letter-spacing: 0.1em; text-transform: uppercase; font-style: normal; color: var(--muted); }
.boon p { margin: 0; font-size: 13.5px; color: #d9d2c2; }
.boon.rare { border-color: rgba(98, 160, 255, 0.7); }
.boon.rare em { color: #8fc0ff; }
.boon.epic { border-color: rgba(199, 155, 255, 0.85); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5), 0 0 26px rgba(199, 155, 255, 0.35); }
.boon.epic em { color: var(--aether); }
#floaters span.react { z-index: 2; font: 800 18px var(--serif); letter-spacing: 0.02em; text-shadow: 0 2px 3px #000, 0 0 10px rgba(0, 0, 0, 0.6); }
#floaters span.shatter { color: #bff3ff; }
#floaters span.thermal { color: #ffc89a; }
#floaters span.overload { color: #ff9cff; }
#floaters span.superconduct { color: #9ad0ff; }
#floaters span.steam { color: #f0f4f8; }

/* ---------------------------------------------------------------- touch */
#touch { position: fixed; inset: 0; pointer-events: none; }
#stick { position: absolute; left: 40px; bottom: 60px; width: 110px; height: 110px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); background: rgba(0, 0, 0, 0.15); }
#stick i { position: absolute; left: 35px; top: 35px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.tbtns { position: absolute; right: 18px; bottom: 30px; display: grid; grid-template-columns: repeat(3, 58px); gap: 10px; pointer-events: auto; }
.tbtns button { width: 58px; height: 58px; border-radius: 50%; background: rgba(16, 20, 40, 0.7); border: 1px solid var(--edge); font-size: 24px; touch-action: none; }
.tbtns button.fire { background: rgba(98, 220, 255, 0.25); }
.tbtns button.on { background: rgba(255, 213, 110, 0.35); }

@media (max-width: 720px), (max-height: 520px) {
  #minimap { width: 120px; height: 143px; }
  #btn-pause { right: 146px; }
  .spell { width: 44px; height: 44px; font-size: 20px; }
  #wave-label { font-size: 19px; }
  .hud-tl { width: 34vw; }
  .bar b { min-width: 0; font-size: 10px; }
  #banner h2 { font-size: 30px; }
  body.touch .mage-bars { width: 30vw; padding: 6px 8px; }
  body.touch .hud-bottom { left: 50%; transform: translateX(-50%); right: auto; bottom: 8px; }
  body.touch #spells { display: none; }
  #prep { bottom: auto; top: 46%; }
}
