/* Go up the wizard steps: dark-fantasy pixel look. Everything uses a chunky monospace font and hard-edged boxes. */
:root { --ink: #14081f; --panel: #2a1440; --panel2: #3d1f5c; --edge: #ffd84a; --gold: #ffd84a; --gem: #aef0ff; --red: #e8404e; --txt: #f4eaff; --muted: #a58ac4; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--txt); font-family: "Courier New", ui-monospace, monospace; font-weight: 700; overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
#app { display: flex; flex-direction: column; height: 100%; height: 100dvh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
#cv { image-rendering: pixelated; image-rendering: crisp-edges; width: min(100%, calc((100dvh - 96px) * 16 / 9)); height: auto; max-height: 100%; aspect-ratio: 16 / 9; background: #000; touch-action: none; cursor: crosshair; }
#overlay { position: absolute; inset: 0; z-index: 5; }
#overlay[hidden] { display: none; }
.scrim { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(10, 4, 24, 0.55); padding: 8px; overflow: auto; }
.scrim.top { align-items: flex-start; background: rgba(10, 4, 24, 0.25); }
.panel { width: min(520px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--panel); border: 4px solid var(--edge); box-shadow: 0 0 0 4px var(--ink), 6px 6px 0 4px rgba(0,0,0,.45); }
.panel h1 { margin: 0; text-align: center; font-size: clamp(20px, 5vw, 34px); line-height: 1.05; color: var(--gold); text-shadow: 3px 3px 0 #7a1020; letter-spacing: 2px; }
.panel h2 { margin: 0; text-align: center; font-size: clamp(14px, 3vw, 20px); color: var(--gold); text-shadow: 2px 2px 0 #000; letter-spacing: 1px; }
.sub, .muted { color: var(--muted); font-size: 12px; text-align: center; }
.muted { text-align: left; }
.goldline { text-align: center; color: var(--gold); letter-spacing: 1px; }
.goldline b { font-size: 1.15em; }
.btn { font: inherit; font-weight: 900; color: var(--ink); background: var(--gold); border: 3px solid var(--ink); box-shadow: 0 4px 0 #9a6a10, 0 0 0 2px var(--edge); padding: 9px 12px; letter-spacing: 1px; cursor: pointer; text-transform: uppercase; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #9a6a10, 0 0 0 2px var(--edge); }
.btn.big { font-size: 20px; padding: 12px; }
.btn.small { font-size: 12px; padding: 6px 10px; background: var(--panel2); color: var(--txt); box-shadow: 0 3px 0 #1a0a2a, 0 0 0 2px #6a4a90; }
.btn.danger { background: #7a1020; color: #fff; box-shadow: 0 3px 0 #3a0610, 0 0 0 2px #c04050; }
.btn.off { filter: grayscale(0.85) brightness(0.6); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.list { overflow: auto; display: flex; flex-direction: column; gap: 6px; max-height: calc(100dvh - 190px); padding-right: 2px; }
.row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--panel2); border: 2px solid #1a0a2a; }
.row.sel { border-color: var(--gold); }
.row .grow { flex: 1; min-width: 0; font-size: 13px; }
.row .btn { font-size: 13px; padding: 6px 9px; white-space: nowrap; }
.lv { color: var(--gem); font-size: 12px; }
.tag { color: var(--gold); font-size: 12px; text-align: center; }
.foot { display: flex; gap: 8px; justify-content: space-between; }
.foot .btn { flex: 1; }
.input { font: inherit; padding: 8px; background: #14081f; color: var(--txt); border: 3px solid #6a4a90; text-transform: uppercase; user-select: text; -webkit-user-select: text; }
.dusk { margin-top: 4px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; margin: 4px 0; }
.card { font: inherit; color: var(--txt); background: var(--panel2); border: 3px solid #b070f0; padding: 8px; text-align: left; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.card b { color: var(--gold); font-size: 13px; text-transform: uppercase; }
.card span { font-size: 12px; color: #e0d0f8; }
.card:active { background: #5a2a80; }
.stats { display: flex; flex-direction: column; gap: 4px; text-align: center; font-size: 15px; }
.stats b { color: var(--gem); }
.stats .gain b { color: var(--gold); font-size: 1.3em; }
#toast { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); z-index: 9; background: rgba(10,4,24,.85); border: 3px solid var(--gold); color: var(--gold); padding: 6px 12px; font-size: 13px; text-align: center; opacity: 0; transition: opacity .25s; pointer-events: none; max-width: 92%; letter-spacing: 1px; }
#toast.on { opacity: 1; }
#bar { display: flex; gap: 4px; padding: 4px; background: #0a0414; border-top: 3px solid var(--edge); overflow-x: auto; }
#bar[hidden] { display: none; }
.shop { flex: 1 0 64px; min-width: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 3px 2px; font: inherit; color: var(--txt); background: var(--panel2); border: 2px solid #6a4a90; cursor: pointer; }
.shop:active { background: #5a2a80; }
.shop.off { filter: grayscale(0.8) brightness(0.6); }
.shop .ic { display: flex; align-items: flex-end; gap: 4px; height: 38px; }
.shop .cnt { font-size: 10px; color: var(--gem); }
.shop .lb { font-size: 10px; }
.shop .cl { display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--gem); }
.shop .big { font-size: 20px; color: var(--gold); line-height: 38px; }
.shop.ctl { flex: 0 0 52px; min-width: 52px; }
.ico { image-rendering: pixelated; }
#legal { position: fixed; right: 6px; bottom: 2px; font-size: 10px; opacity: .45; z-index: 1; }
#legal a { color: var(--muted); }
@media (max-height: 420px) { .shop .ic { height: 26px; } .shop .ic canvas { transform: scale(.75); } #cv { width: min(100%, calc((100dvh - 72px) * 16 / 9)); } .list { max-height: calc(100dvh - 130px); } }
.shop.spell { flex: 1 0 86px; border-color: #b070f0; background: #4a2070; }
.shop.spell .big { font-size: 26px; line-height: 38px; color: #ffe27a; }
.shop.spell.ready { animation: glow 0.9s infinite alternate; filter: none; }
.shop.spell.off { filter: brightness(0.75); }
@keyframes glow { from { box-shadow: 0 0 0 0 #b070f0; } to { box-shadow: 0 0 10px 3px #ffe27a; } }
