/* Rogue Wordle — styles */
:root {
  --bg: #0b0912;
  --bg2: #15111f;
  --panel: #1a1526;
  --panel2: #221c31;
  --line: #3a3150;
  --line2: #574a78;
  --text: #ece6d8;
  --dim: #9a90ad;
  --gold: #f2c14e;
  --hp: #e0484f;
  --block: #6aa9ff;
  --accent: #b48cff;
  --good: #3f9a4a;
  --warn: #c9a227;
  --bad: #2b2736;
  --fog: #4d3f73;
  --glow: rgba(180, 140, 255, .18);
  --head: "Press Start 2P", monospace;
  --body: "VT323", ui-monospace, monospace;
  --px: 3px;
}
body[data-theme="ice"]   { --bg: #070d16; --bg2: #0e1a2a; --panel: #122133; --panel2: #18304a; --line: #2b4766; --line2: #3f6a95; --accent: #7cc7ff; --glow: rgba(124, 199, 255, .18); }
body[data-theme="abyss"] { --bg: #0d0508; --bg2: #1c0910; --panel: #220c13; --panel2: #2e1019; --line: #57202f; --line2: #7c2c41; --accent: #ff6b7d; --glow: rgba(255, 90, 110, .18); }
body.cb { --good: #f5793a; --warn: #85c0f9; }

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--body); font-size: 20px; line-height: 1.15;
  overflow: hidden; user-select: none; -webkit-user-select: none;
  transition: background .6s;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- background ---------- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% -10%, var(--glow), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 2px, transparent 2px 32px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 2px, transparent 2px 64px),
    linear-gradient(var(--bg2), var(--bg)); }
.bg__glow { position: absolute; left: 50%; bottom: -30vh; width: 120vw; height: 60vh; transform: translateX(-50%); background: radial-gradient(closest-side, var(--glow), transparent); }
.bg__embers i { position: absolute; bottom: -10px; width: 3px; height: 3px; background: var(--accent); opacity: .5; animation: ember linear infinite; }
@keyframes ember { to { transform: translate(var(--dx), -105vh); opacity: 0; } }

.crt { position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .35;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.35) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; }
body.no-crt .crt { display: none; }
.vignette { position: fixed; inset: 0; z-index: 80; pointer-events: none; opacity: 0; box-shadow: inset 0 0 120px 30px rgba(220, 30, 50, .65); transition: opacity .25s; }
.vignette.on { opacity: 1; transition: none; }

/* ---------- app shell ---------- */
#app { position: relative; z-index: 1; height: 100dvh; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom)); }
.screen { display: none; flex: 1; min-height: 0; flex-direction: column; }
.screen.is-active { display: flex; }

/* pixel panel */
.px { background: var(--panel); box-shadow: 0 0 0 var(--px) var(--line), 0 var(--px) 0 var(--px) #000; }

/* ---------- buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--head); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; line-height: 1.4;
  padding: 14px 16px; background: var(--panel2); color: var(--text);
  box-shadow: inset 0 calc(var(--px) * -1) 0 rgba(0,0,0,.4), 0 0 0 var(--px) var(--line2), 0 var(--px) 0 var(--px) #000;
  transition: transform .08s, filter .15s; }
.btn:hover { filter: brightness(1.18); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 calc(var(--px) * -1) 0 rgba(0,0,0,.4), 0 0 0 var(--px) var(--line2), 0 1px 0 var(--px) #000; }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn--primary { background: var(--accent); color: #120c1c; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 0 0 var(--px) #000, 0 var(--px) 0 var(--px) #000; }
.btn--gold { background: var(--gold); color: #1c1305; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 0 0 var(--px) #000, 0 var(--px) 0 var(--px) #000; }
.btn--danger { background: #8f2633; }
.btn--sm { font-size: 9px; padding: 10px 12px; }
.btn--block { width: 100%; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; font-size: 18px; background: var(--panel2); box-shadow: 0 0 0 2px var(--line2); }

/* ---------- title ---------- */
.screen--title { justify-content: center; align-items: center; }
.title { width: 100%; max-width: 380px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.title__tiles { display: flex; gap: 6px; margin-bottom: 4px; }
.t { width: 46px; height: 46px; display: grid; place-items: center; font-family: var(--head); font-size: 20px; color: #fff; box-shadow: inset 0 -4px 0 rgba(0,0,0,.25), 0 4px 0 #000; animation: bob 2.4s ease-in-out infinite; }
.t:nth-child(2) { animation-delay: .15s } .t:nth-child(3) { animation-delay: .3s } .t:nth-child(4) { animation-delay: .45s } .t:nth-child(5) { animation-delay: .6s }
.t--g { background: var(--good); } .t--y { background: var(--warn); } .t--x { background: var(--bad); color: var(--dim); }
@keyframes bob { 50% { transform: translateY(-6px); } }
.title__name { font-family: var(--head); font-size: 24px; line-height: 1.3; color: var(--gold); text-shadow: 0 4px 0 #000, 0 0 24px rgba(242, 193, 78, .35); text-transform: uppercase; }
.title__sub { color: var(--dim); font-size: 22px; margin-top: -6px; }
.title__menu { width: 100%; display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.title__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.title__meta { margin-top: 8px; color: var(--dim); font-size: 18px; min-height: 1em; }
.title__meta b { color: var(--gold); font-weight: 400; }
.title__back { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: var(--dim); font-size: 18px; text-decoration: none; }
.title__back:hover { color: var(--text); }

/* ---------- camp ---------- */
.screen--camp { gap: 12px; }
.camp__head { display: flex; align-items: center; gap: 12px; padding: 4px 3px 0; }
.camp__title { flex: 1; font-family: var(--head); font-size: 15px; color: var(--gold); text-shadow: 0 3px 0 #000; text-transform: uppercase; }
.chip--ink { color: #c9b8ff; font-size: 22px; }
.camp__scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 4px 12px; scrollbar-width: thin; }
.heroes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.hero { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px 8px; background: var(--panel); box-shadow: 0 0 0 2px var(--line), 0 4px 0 2px #000; transition: transform .1s; }
.hero:hover { transform: translateY(-2px); }
.hero.is-sel { box-shadow: 0 0 0 3px var(--gold), 0 0 16px rgba(242, 193, 78, .35), 0 4px 0 3px #000; }
.hero.is-locked { opacity: .5; }
.hero__icon { font-size: 28px; }
.hero__name { font-family: var(--head); font-size: 7px; text-transform: uppercase; }
.hero__stats { font-size: 15px; color: var(--dim); text-align: center; line-height: 1; }
.camp__info { padding: 10px 12px; background: #0b0910; box-shadow: 0 0 0 2px var(--line); font-size: 19px; color: var(--dim); }
.camp__info b { color: var(--text); font-weight: 400; }
.camp__foot { display: grid; grid-template-columns: auto 1fr 1fr; gap: 12px; padding: 0 3px; }
.camp__foot #campContinue[hidden] + #campEmbark { grid-column: 2 / 4; }
.pips { display: flex; gap: 4px; margin-top: 6px; }
.pips i { width: 14px; height: 6px; background: #0b0910; box-shadow: 0 0 0 1px var(--line2); }
.pips i.on { background: var(--gold); box-shadow: 0 0 0 1px #000; }
.card.up:disabled { opacity: .6; }
.hist { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.hist__row { display: grid; grid-template-columns: 28px 1fr 70px 60px 60px; gap: 6px; padding: 4px 8px; background: #0b0910; font-size: 18px; color: var(--dim); }
.hist__row .win { color: #7be07b; } .hist__row .loss { color: #ff7a8a; } .hist__row .inkc { color: #c9b8ff; text-align: right; }
.ink { padding: 12px; background: #0b0910; box-shadow: 0 0 0 2px #5a4a8a; display: flex; flex-direction: column; gap: 4px; }
.ink__head { font-family: var(--head); font-size: 10px; color: #c9b8ff; display: flex; justify-content: space-between; margin-bottom: 4px; }
.ink__head b { font-weight: 400; color: #fff; }
.ink__row { display: flex; justify-content: space-between; font-size: 18px; color: var(--dim); }
.ink__row b { font-weight: 400; color: var(--text); }
.ink__total { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 2px; color: var(--text); }
.unlock { padding: 10px 12px; text-align: center; background: rgba(242, 193, 78, .12); box-shadow: 0 0 0 2px var(--gold); color: var(--gold); font-size: 20px; animation: flash 1s; }
.unlock b { font-weight: 400; color: #fff; }

/* ---------- HUD ---------- */
.hud { padding: 8px 10px; margin: 3px 3px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--panel); box-shadow: 0 0 0 var(--px) var(--line), 0 var(--px) 0 var(--px) #000; }
.hud__top { display: flex; align-items: center; gap: 8px; }
.hud__hp { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.hud__heart { color: var(--hp); font-size: 20px; }
.hud__bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.hud__floor { font-family: var(--head); font-size: 9px; color: var(--dim); text-transform: uppercase; }
.hud__status { display: flex; gap: 6px; }
.bar { position: relative; flex: 1; height: 18px; background: #07060b; box-shadow: 0 0 0 2px var(--line2); overflow: hidden; }
.bar__fill { position: absolute; inset: 0 auto 0 0; width: 100%; transition: width .35s steps(12); }
.bar__fill--hp { background: linear-gradient(#ff6a6f, var(--hp) 55%, #a32a33); }
.bar__fill--foe { background: linear-gradient(#c57bff, #8c3fd6 55%, #5e2394); }
body[data-theme="ice"] .bar__fill--foe { background: linear-gradient(#9de0ff, #3c95d6 55%, #22618f); }
body[data-theme="abyss"] .bar__fill--foe { background: linear-gradient(#ff8a7a, #d63c4a 55%, #8f1f2c); }
.bar__txt { position: relative; z-index: 1; display: block; text-align: center; font-size: 17px; line-height: 18px; text-shadow: 0 1px 0 #000, 1px 0 0 #000; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: #0b0910; box-shadow: 0 0 0 2px var(--line); font-size: 19px; white-space: nowrap; }
.chip b { font-weight: 400; }
.chip--gold { color: var(--gold); }
.chip--block { color: var(--block); }
.chip--bad { color: #ff8a8a; }
.chip--poison { color: #7be07b; }
.relics, .items { display: flex; gap: 6px; flex-wrap: nowrap; padding: 2px; }
.relics { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 85%, transparent); }
.relics::-webkit-scrollbar { display: none; }
.relic, .item, .slot { flex: none; }
.relic, .item, .slot { width: 30px; height: 30px; display: grid; place-items: center; font-size: 17px; background: #0b0910; box-shadow: 0 0 0 2px var(--line); }
.relic--r { box-shadow: 0 0 0 2px var(--gold); }
.relic--u { box-shadow: 0 0 0 2px var(--accent); }
.item { box-shadow: 0 0 0 2px var(--line2); }
.item:hover, .relic:hover { filter: brightness(1.3); }
.slot { opacity: .35; }
.relic.flash { animation: flash .6s; }
@keyframes flash { 30% { transform: scale(1.35); filter: brightness(2); } }

/* ---------- map ---------- */
.map__head { text-align: center; margin-bottom: 8px; }
.map__act { font-family: var(--head); font-size: 10px; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; }
.map__name { font-family: var(--head); font-size: 15px; margin-top: 6px; text-shadow: 0 3px 0 #000; }
.map__scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; padding: 6px 0; }
.map { position: relative; width: 100%; margin: 0 auto; }
.map__lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.map__lines line { stroke: var(--line2); stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; }
.map__lines line.done { stroke: var(--gold); stroke-dasharray: none; opacity: .8; }
.map__lines line.open { stroke: var(--accent); stroke-dasharray: 2 5; }
.node { position: absolute; width: 50px; height: 50px; transform: translate(-50%, -50%); display: grid; place-items: center; font-size: 24px;
  background: var(--panel); box-shadow: 0 0 0 3px var(--line), 0 4px 0 3px #000; transition: transform .15s; }
.node.boss { width: 76px; height: 76px; font-size: 38px; box-shadow: 0 0 0 3px #8f2633, 0 5px 0 3px #000; }
.node.done { opacity: .5; box-shadow: 0 0 0 3px var(--gold), 0 4px 0 3px #000; }
.node.done::after { content: "✓"; position: absolute; right: -6px; top: -8px; font-family: var(--head); font-size: 10px; color: #000; background: var(--gold); padding: 3px; }
.node.here { opacity: 1; box-shadow: 0 0 0 3px var(--gold), 0 0 22px var(--gold), 0 4px 0 3px #000; }
.node.open { cursor: pointer; box-shadow: 0 0 0 3px var(--accent), 0 4px 0 3px #000; animation: pulse 1.2s ease-in-out infinite; }
.node.open:hover { transform: translate(-50%, -50%) scale(1.12); animation: none; }
.node.locked { opacity: .45; filter: saturate(.4); }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px var(--accent), 0 0 20px var(--accent), 0 4px 0 3px #000; } }
.map__legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; padding-top: 8px; color: var(--dim); font-size: 17px; }

/* ---------- battle ---------- */
.screen--battle { gap: 10px; }
.stage { margin: 0 3px; }
.foe { position: relative; display: flex; gap: 12px; padding: 10px; background: var(--panel); box-shadow: 0 0 0 var(--px) var(--line), 0 var(--px) 0 var(--px) #000; }
.foe.elite { box-shadow: 0 0 0 var(--px) #b0532a, 0 var(--px) 0 var(--px) #000; }
.foe.boss { box-shadow: 0 0 0 var(--px) #c4253a, 0 0 26px rgba(196, 37, 58, .35), 0 var(--px) 0 var(--px) #000; }
.foe__sprite { width: 72px; height: 72px; display: grid; place-items: center; font-size: 46px; background: radial-gradient(circle at 50% 60%, var(--glow), transparent 70%), #0b0910; box-shadow: 0 0 0 2px var(--line2); }
.foe__sprite span { display: inline-block; animation: idle 1.6s ease-in-out infinite; filter: drop-shadow(0 4px 0 rgba(0,0,0,.6)); }
@keyframes idle { 50% { transform: translateY(-4px) scale(1.04); } }
.foe__sprite.hit span { animation: hit .35s; }
@keyframes hit { 0%, 100% { transform: none; filter: none; } 20% { transform: translateX(-6px); filter: brightness(3) saturate(0); } 50% { transform: translateX(6px); } }
.foe__sprite.lunge span { animation: lunge .35s; }
@keyframes lunge { 40% { transform: translateY(14px) scale(1.25); } }
.foe__sprite.dead span { animation: die .7s forwards; }
@keyframes die { to { transform: translateY(20px) scale(.2) rotate(40deg); opacity: 0; filter: grayscale(1); } }
.foe__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-right: 64px; }
.foe__name { font-family: var(--head); font-size: 11px; line-height: 1.5; }
.tag { display: inline-block; font-size: 8px; padding: 3px 5px; margin-left: 4px; vertical-align: 2px; background: #0b0910; color: var(--dim); box-shadow: 0 0 0 1px var(--line2); }
.tag.elite { color: #ffb36b; box-shadow: 0 0 0 1px #b0532a; }
.tag.boss { color: #ff7a8a; box-shadow: 0 0 0 1px #c4253a; }
.foe__row { display: flex; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.foe__status { display: flex; gap: 6px; flex-wrap: wrap; }
.foe__status .chip { font-size: 17px; padding: 0 6px; }
.foe__lore { color: var(--dim); font-size: 17px; line-height: 1.05; }
.intent { position: absolute; right: 10px; top: 10px; width: 58px; padding: 6px 0 4px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #0b0910; box-shadow: 0 0 0 2px var(--line2); animation: bob 1.4s ease-in-out infinite; cursor: help; }
.intent__icon { font-size: 22px; }
.intent__val { font-family: var(--head); font-size: 10px; min-height: 10px; }
.intent.atk { box-shadow: 0 0 0 2px #c4253a; } .intent.atk .intent__val { color: #ff7a8a; }
.intent.def { box-shadow: 0 0 0 2px var(--block); } .intent.def .intent__val { color: var(--block); }
.intent.debuff { box-shadow: 0 0 0 2px var(--accent); } .intent.debuff .intent__val { color: var(--accent); }

.board-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 14px 0 4px; }
.board { --tile: 44px; display: grid; gap: 6px; }
.row { display: grid; grid-template-columns: repeat(5, var(--tile)); gap: 6px; }
.row.shake { animation: rshake .35s; }
@keyframes rshake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.tile { position: relative; width: var(--tile); height: var(--tile); display: grid; place-items: center;
  font-family: var(--head); font-size: calc(var(--tile) * .38); text-transform: uppercase;
  background: rgba(10, 8, 14, .7); box-shadow: inset 0 0 0 2px var(--line); }
.tile.filled { box-shadow: inset 0 0 0 2px var(--line2); animation: pop .1s; }
.tile.cur-row { box-shadow: inset 0 0 0 2px var(--line2); }
.tile.hint::before { content: attr(data-hint); position: absolute; color: var(--good); opacity: .45; }
.tile.filled.hint::before { content: none; }
@keyframes pop { 50% { transform: scale(1.08); } }
.tile.correct, .tile.present, .tile.absent, .tile.fog { color: #fff; box-shadow: inset 0 -4px 0 rgba(0,0,0,.25); }
.tile.correct { background: var(--good); }
.tile.present { background: var(--warn); }
.tile.absent { background: var(--bad); color: #8a8298; }
.tile.fog { background: var(--fog); }
.tile.fog::after { content: "?"; position: absolute; right: 3px; top: 2px; font-size: 9px; color: #d6c8ff; }
.tile.flip { animation: flip .42s ease both; }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.tile .dmg { position: absolute; bottom: -3px; right: 2px; font-family: var(--body); font-size: 16px; color: #fff; text-shadow: 0 1px 0 #000; }
.tile.crit { animation: flip .42s ease both, critglow 1s .42s; }
@keyframes critglow { 30% { box-shadow: 0 0 0 3px #fff, 0 0 18px #fff; } }
.board.solved .row.win .tile { animation: winjump .5s ease both; }
.board.solved .row.win .tile:nth-child(2) { animation-delay: .06s } .board.solved .row.win .tile:nth-child(3) { animation-delay: .12s }
.board.solved .row.win .tile:nth-child(4) { animation-delay: .18s } .board.solved .row.win .tile:nth-child(5) { animation-delay: .24s }
@keyframes winjump { 40% { transform: translateY(-14px); } }

.log { min-height: 24px; text-align: center; font-size: 19px; color: var(--dim); padding: 0 4px; }
.log b { color: var(--text); font-weight: 400; }
.log .g { color: var(--good); } .log .y { color: var(--warn); } .log .r { color: #ff7a8a; } .log .gold { color: var(--gold); }

/* keyboard */
.kb { display: flex; flex-direction: column; gap: 6px; padding-bottom: 2px; }
.kb__row { display: flex; justify-content: center; gap: 5px; }
.key { flex: 1; max-width: 46px; height: 52px; display: grid; place-items: center; position: relative;
  font-family: var(--head); font-size: 12px; background: #3a3350; color: var(--text);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.3), 0 2px 0 #000; transition: background .2s; }
body[data-theme="ice"] .key { background: #2a4563; }
body[data-theme="abyss"] .key { background: #4a1e2a; }
.key:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgba(0,0,0,.3); }
.key--wide { flex: 1.6; max-width: 72px; font-size: 9px; }
.key.correct { background: var(--good); }
.key.present { background: var(--warn); }
.key.absent { background: #1e1a27; color: #8a8298; box-shadow: inset 0 0 0 2px #2c2738; }
.key.purged { background: #120f18; color: #3a3446; text-decoration: line-through; pointer-events: none; }
.key.locked { background: #120f18; color: #5c566a; pointer-events: none; }
.key.locked::after { content: "🔒"; position: absolute; font-size: 14px; right: 1px; top: 0; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(4, 3, 8, .78); backdrop-filter: blur(3px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal__box { width: 100%; max-width: 440px; max-height: calc(100dvh - 32px); overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px;
  background: var(--panel); box-shadow: 0 0 0 var(--px) var(--line2), 0 0 0 calc(var(--px) * 2) #000, 0 10px 0 6px #000; animation: rise .25s steps(5); }
@keyframes rise { from { transform: translateY(16px); } }
.m__icon { font-size: 44px; text-align: center; filter: drop-shadow(0 4px 0 rgba(0,0,0,.6)); }
.m__title { font-family: var(--head); font-size: 14px; line-height: 1.5; text-align: center; text-transform: uppercase; color: var(--gold); text-shadow: 0 3px 0 #000; }
.m__title.bad { color: #ff7a8a; }
.m__text { text-align: center; color: var(--text); font-size: 21px; }
.m__text.dim { color: var(--dim); }
.m__list { display: flex; flex-direction: column; gap: 12px; }
.m__sect { font-family: var(--head); font-size: 9px; color: var(--dim); text-transform: uppercase; margin-top: 4px; }
.card { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; text-align: left; background: var(--panel2);
  box-shadow: 0 0 0 2px var(--line2), 0 4px 0 2px #000; transition: transform .1s, filter .15s; }
.card:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.15); }
.card:disabled { opacity: .45; cursor: default; }
.card__icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-size: 26px; background: #0b0910; box-shadow: 0 0 0 2px var(--line); }
.card__body { flex: 1; min-width: 0; }
.card__name, .card__desc { display: block; }
.card__name { font-family: var(--head); font-size: 10px; line-height: 1.5; }
.card__desc { color: var(--dim); font-size: 19px; line-height: 1.05; margin-top: 3px; }
.card__price { flex: none; font-family: var(--head); font-size: 10px; color: var(--gold); }
.card--r { box-shadow: 0 0 0 2px var(--gold), 0 4px 0 2px #000; }
.card--r .card__name { color: var(--gold); }
.card--u { box-shadow: 0 0 0 2px var(--accent), 0 4px 0 2px #000; }
.card--u .card__name { color: var(--accent); }
.rar { font-family: var(--head); font-size: 7px; margin-left: 4px; color: var(--dim); vertical-align: 1px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { padding: 8px 10px; background: #0b0910; box-shadow: 0 0 0 2px var(--line); }
.stat span { display: block; font-family: var(--head); font-size: 8px; color: var(--dim); text-transform: uppercase; }
.stat b { display: block; font-weight: 400; font-size: 26px; color: var(--gold); margin-top: 2px; }
.m__row { display: flex; gap: 12px; }
.m__row > * { flex: 1; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: #0b0910; box-shadow: 0 0 0 2px var(--line); }
.toggle { font-family: var(--head); font-size: 9px; padding: 8px 10px; min-width: 56px; background: var(--bad); color: var(--dim); box-shadow: 0 0 0 2px var(--line2); }
.toggle.on { background: var(--good); color: #fff; }
.codex { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 8px; }
.codex__cell { aspect-ratio: 1; display: grid; place-items: center; font-size: 22px; background: #0b0910; box-shadow: 0 0 0 2px var(--line); }
.codex__cell.unknown { color: var(--line2); font-family: var(--head); font-size: 12px; }
.how { display: flex; flex-direction: column; gap: 10px; font-size: 20px; }
.how p { color: var(--dim); }
.how b { color: var(--text); font-weight: 400; }
.sw { display: inline-block; width: 14px; height: 14px; vertical-align: -1px; margin-right: 4px; box-shadow: 0 0 0 1px #000; }

/* ---------- tooltip / toast / fx ---------- */
.tip { position: fixed; z-index: 75; max-width: 260px; padding: 10px 12px; background: #0b0910; box-shadow: 0 0 0 2px var(--line2), 0 6px 0 2px #000; font-size: 19px; line-height: 1.05; }
.tip__t { font-family: var(--head); font-size: 9px; line-height: 1.5; color: var(--gold); margin-bottom: 4px; }
.tip .btn { margin-top: 10px; width: 100%; }
.toast { position: fixed; z-index: 76; left: 50%; top: 22%; transform: translate(-50%, -10px); padding: 10px 14px; font-family: var(--head); font-size: 11px; line-height: 1.5; text-align: center;
  background: #0b0910; color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 6px 0 2px #000; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 86vw; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.big { font-size: 18px; padding: 16px 20px; color: #fff; background: var(--accent); box-shadow: 0 0 0 3px #000, 0 8px 0 3px #000; }
.fx { position: fixed; inset: 0; z-index: 77; pointer-events: none; overflow: hidden; }
.float { position: absolute; font-family: var(--head); font-size: 16px; text-shadow: 0 3px 0 #000, 2px 0 0 #000, -2px 0 0 #000; animation: floatup 1.1s ease-out forwards; white-space: nowrap; }
.float.big { font-size: 24px; }
@keyframes floatup { 0% { transform: translate(-50%, 0) scale(.6); opacity: 0; } 15% { transform: translate(-50%, -8px) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -70px) scale(1); opacity: 0; } }

body.shake-l #app { animation: shakeL .3s; }
body.shake-h #app { animation: shakeH .45s; }
@keyframes shakeL { 25% { transform: translate(-3px, 2px); } 50% { transform: translate(3px, -2px); } 75% { transform: translate(-2px, -1px); } }
@keyframes shakeH { 15% { transform: translate(-8px, 4px); } 30% { transform: translate(7px, -5px); } 45% { transform: translate(-6px, 3px); } 60% { transform: translate(5px, -2px); } 80% { transform: translate(-2px, 1px); } }

@media (min-width: 700px) {
  body { font-size: 21px; }
  .key { height: 56px; font-size: 13px; }
}
@media (max-height: 700px) {
  .foe__lore { display: none; }
  .key { height: 44px; }
  .hud { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
