:root {
  --bg: #0a0912; --panel: #15121f; --panel2: #1d1829; --gold: #d9b45b; --text: #ebe4d3; --dim: #9a93a8;
  --attack: #c8403f; --skill: #3f78c8; --power: #c8a13f; --good: #5fbf7a; --bad: #e0504f;
  --serif: 'Cinzel', Georgia, serif; --body: 'Crimson Text', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 17px; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
#app { height: 100%; display: flex; flex-direction: column; }
.pixel { image-rendering: pixelated; }

/* ---------- shared chrome ---------- */
.topbar { display: flex; align-items: center; gap: 22px; padding: 8px 18px; background: linear-gradient(#000c, #0000); position: relative; z-index: 5; font-family: var(--serif); letter-spacing: .04em; }
.topbar .name { color: var(--gold); font-weight: 700; }
.topbar .grow { flex: 1; }
.chip { color: var(--dim); }
.chip b { color: var(--text); font-weight: 600; }
.btn { background: linear-gradient(#2b2440, #1b1629); border: 1px solid #5a4d78; border-radius: 6px; padding: 9px 20px; font-family: var(--serif); letter-spacing: .06em; transition: .15s; }
.btn:hover:not(:disabled) { border-color: var(--gold); box-shadow: 0 0 14px #d9b45b55; transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: linear-gradient(#7a5a1e, #4d3811); border-color: var(--gold); }
.center { margin: auto; text-align: center; }
h1, h2 { font-family: var(--serif); color: var(--gold); letter-spacing: .12em; margin: 0 0 12px; }
h1 { font-size: 54px; text-shadow: 0 0 30px #d9b45b66; }

/* ---------- title ---------- */
.title-screen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(ellipse at 50% 30%, #2a2050aa, transparent 60%), url(/assets/backdrops/shadow.jpg) center/cover; }
.title-screen::before { content: ''; position: absolute; inset: 0; background: #0009; }
.title-screen > * { position: relative; }
.classes { display: flex; gap: 22px; margin-top: 10px; }
.class-card { width: 230px; padding: 16px; border: 1px solid #4a3f66; border-radius: 10px; background: #15121fd9; text-align: center; transition: .2s; }
.class-card:hover { transform: translateY(-6px); border-color: var(--c); box-shadow: 0 10px 40px var(--c); }
.class-card img { height: 160px; margin-bottom: 6px; }
.class-card h3 { margin: 4px 0 0; font-family: var(--serif); color: var(--c); }
.class-card p { margin: 2px 0; color: var(--dim); }

/* ---------- map ---------- */
.map-screen { flex: 1; display: flex; flex-direction: column; background: url(/assets/backdrops/dungeon.jpg) center/cover; position: relative; }
.map-screen::before { content: ''; position: absolute; inset: 0; background: #000a; }
.map-body { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; gap: 60px; }
.floors { display: flex; flex-direction: column-reverse; gap: 6px; }
.floor-dot { width: 150px; padding: 4px 10px; border-radius: 4px; border: 1px solid #3a3350; color: var(--dim); font-family: var(--serif); font-size: 14px; }
.floor-dot.done { background: #2a4a35; color: #cfe; border-color: #3f7a55; }
.floor-dot.now { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 12px #d9b45b66; }
.options { display: flex; gap: 28px; }
.node { width: 210px; padding: 18px; background: #15121fe6; border: 1px solid #4a3f66; border-radius: 10px; text-align: center; transition: .2s; }
.node:hover { transform: translateY(-6px); border-color: var(--gold); }
.node .ico { font-size: 44px; }
.node h3 { margin: 6px 0; font-family: var(--serif); }
.node.elite { border-color: #a43; } .node.boss { border-color: #c3a; }
.node p { color: var(--dim); margin: 4px 0; }

/* ---------- battle ---------- */
.battle { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.stage { --label: 76px; --feet: 2%; --feetline: calc(var(--feet) + var(--label)); --floor: calc(var(--feetline) + 16%); position: relative; flex: 1; min-height: 0; background-image: var(--bd); background-position: center bottom; background-size: cover; overflow: hidden; }
.stage::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 60%, transparent 40%, #000b 100%), linear-gradient(#0000 55%, #000a); pointer-events: none; }
.ground { position: absolute; left: 0; right: 0; bottom: var(--feet, 6%); height: 0; z-index: 2; }
.unit { position: absolute; bottom: 0; display: flex; flex-direction: column; align-items: center; transform: translateX(-50%); z-index: 2; }
.unit .body { position: relative; display: flex; align-items: flex-end; justify-content: center; }
.unit .shadow { position: absolute; bottom: -6px; left: 10%; right: 10%; height: 14px; background: radial-gradient(#000c, transparent 70%); }
.unit.targetable { cursor: crosshair; filter: drop-shadow(0 0 10px #ffd36a); }
.unit.targetable .body { animation: pulse 0.9s infinite alternate; }
.unit.dead { pointer-events: none; }
@keyframes pulse { to { transform: scale(1.04); } }
.hero-img { transform-origin: bottom; }
@keyframes bob { 50% { transform: scaleY(1.025); } }
.sprite { background-repeat: no-repeat; image-rendering: pixelated; }
.hpwrap { margin-top: 12px; width: var(--w, 120px); }
.hpbar { position: relative; height: 13px; background: #170a0d; border: 1px solid #000; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px #4a2a30; }
.hpfill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#e0504f, #8a1f26); transition: width .35s; }
.hpghost { position: absolute; inset: 0 auto 0 0; background: #f2c9a0; transition: width .8s .25s; }
.hpbar.hero .hpfill { background: linear-gradient(#5fbf7a, #2a6e44); }
.hptxt { position: absolute; inset: 0; text-align: center; font-size: 12px; line-height: 13px; color: #fff; text-shadow: 0 1px 2px #000; font-family: var(--serif); }
.blockchip { position: absolute; left: -14px; top: -8px; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%; background: linear-gradient(#5b9bff, #2556b3); border: 2px solid #cfe3ff; font-family: var(--serif); font-size: 14px; line-height: 22px; text-align: center; z-index: 3; box-shadow: 0 0 10px #4a86ff99; }
.statuses { display: flex; gap: 4px; margin-top: 5px; min-height: 20px; }
.status { font-size: 12px; font-family: var(--serif); padding: 1px 6px; border-radius: 10px; background: #000a; border: 1px solid #5a4d78; }
.status.weak { color: #9fd; } .status.vuln { color: #fa6; } .status.str { color: #f88; }
.status.prowl, .status.evade, .status.lives { color: #b8e0f0; } /* Nyx */
.status.bomb { color: #ffb347; border-color: #d9762b; } /* Bart */
.status.notes { color: #a8c8ff; } /* Ozwin */
.status.souls { color: #9ff0d6; border-color: #2f9c7c; }
.status.bleed { color: #ff6a8a; } .status.frail { color: #c9b2ff; } .status.ward { color: #9cc4ff; } .status.taunt { color: #ffd36a; }
.status.ammo { color: #cfe3ff; }
.status.song { color: #8ff0e0; } .status.regen { color: #9dffb6; } /* Fennick */
.intent { margin-bottom: 8px; padding: 2px 10px; background: #000b; border: 1px solid #5a4d78; border-radius: 16px; font-family: var(--serif); font-size: 18px; white-space: nowrap; animation: float 1.8s ease-in-out infinite; }
.intent.atk { color: #ff8a80; border-color: #8a3b3b; } .intent.def { color: #8fc0ff; } .intent.buff { color: #ffe08a; } .intent.debuff { color: #d9a0ff; }
.intent.aoe { color: #ffb36b; border-color: #c26a1f; box-shadow: 0 0 12px #c26a1f88; }
.intent.mark { color: #ff5a5a; border-color: #d02020; box-shadow: 0 0 14px #d02020aa; font-weight: bold; }
@keyframes float { 50% { transform: translateY(-4px); } }
.ename { font-family: var(--serif); font-size: 13px; margin-top: 4px; color: #ddd; text-shadow: 0 1px 3px #000; }
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 10; overflow: hidden; }
.dmg { position: absolute; font-family: var(--serif); font-weight: 700; font-size: 38px; color: #fff; text-shadow: 0 0 6px #000, 0 2px 0 #000, 0 0 18px var(--c, #e0504f); transform: translate(-50%, -50%); z-index: 11; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; z-index: 9; pointer-events: none; }

/* ---------- effects (code-drawn placeholders for the strip sprites) ---------- */
.fx { position: absolute; transform: translate(-50%, -50%); }
.fx-strip { background-repeat: no-repeat; mix-blend-mode: screen; }
.fx-slash { width: 190px; height: 16px; background: linear-gradient(90deg, #fff0, #fff 30%, #ffe9c0 55%, #ff7a5a 80%, #fff0); border-radius: 50%; filter: drop-shadow(0 0 8px #ffb070); }
.fx-fang { width: 20px; height: 70px; background: linear-gradient(#fff, #e9d5d5); clip-path: polygon(0 0, 100% 0, 50% 100%); filter: drop-shadow(0 0 6px #ff3355); }
.fx-orb { width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, #fff 5%, #c79bff 30%, #6a2bd6aa 60%, #0000 72%); }
.fx-ring { width: 40px; height: 40px; border-radius: 50%; border: 6px solid #ffe0a0; box-shadow: 0 0 20px #ffb347, inset 0 0 14px #ffb347; }
.fx-shield { width: 130px; height: 150px; border-radius: 50% 50% 46% 46% / 30% 30% 70% 70%; border: 5px solid #cfe3ff; background: radial-gradient(#5b9bff55, #5b9bff11); box-shadow: 0 0 24px #5b9bff; }
.fx-arrow { width: 90px; height: 5px; background: linear-gradient(90deg, #0000, #cfa 40%, #fff); box-shadow: 0 0 10px #8f8; border-radius: 3px; }
.fx-spark { width: 9px; height: 9px; background: #ffe8a8; border-radius: 50%; box-shadow: 0 0 8px #ffb347; }
.fx-glow { width: 120px; height: 160px; background: linear-gradient(#0000, #ffd36acc); border-radius: 50%; filter: blur(8px); }
.fx-claw { width: 12px; height: 120px; background: linear-gradient(#fff, #ff5050 70%, #0000); border-radius: 6px; filter: drop-shadow(0 0 8px #f33); }

/* ---------- hand ---------- */
.hand-area { position: relative; height: 270px; flex: none; background: linear-gradient(#0000, #07060d 40%); z-index: 4; }
.hand { position: absolute; left: 0; right: 0; bottom: 6px; height: 250px; display: flex; justify-content: center; align-items: flex-end; }
.card { position: relative; width: 150px; height: 214px; margin: 0 -8px; border-radius: 10px; background: linear-gradient(#251f36, #14101f); border: 3px solid var(--tc); box-shadow: 0 6px 18px #000a; transform: rotate(var(--rot, 0deg)) translateY(var(--ty, 0px)); transition: transform .18s, box-shadow .18s; cursor: pointer; flex: none; animation: deal .4s both; animation-delay: var(--d, 0s); user-select: none; }
.card:hover:not(.unplayable), .card.selected { transform: rotate(0deg) translateY(-62px) scale(1.18); z-index: 20; box-shadow: 0 0 24px var(--tc), 0 10px 30px #000; }
.card.selected { outline: 2px solid var(--gold); }
.card.unplayable { filter: saturate(.3) brightness(.7); cursor: not-allowed; }
.card .cost { position: absolute; left: -12px; top: -12px; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(#6aa7ff, #2347a0); border: 2px solid #cfe3ff; font-family: var(--serif); font-weight: 700; font-size: 19px; text-align: center; line-height: 30px; box-shadow: 0 0 10px #4a86ff; }
.card .cname { margin: 8px 6px 0 26px; font-family: var(--serif); font-size: 13.5px; font-weight: 700; text-align: center; letter-spacing: .02em; }
.card .art { margin: 5px 8px; height: 76px; border-radius: 6px; background: radial-gradient(circle at 50% 60%, var(--tc), #120e1c 75%); display: flex; align-items: center; justify-content: center; font-size: 40px; border: 1px solid #0008; }
.card .ctype { text-align: center; font-size: 11px; letter-spacing: .15em; color: var(--tc); text-transform: uppercase; font-family: var(--serif); }
.card .ctext { padding: 4px 9px; text-align: center; font-size: 14px; line-height: 1.15; color: #ddd6c6; }
.card.attack { --tc: var(--attack); } .card.skill { --tc: var(--skill); } .card.power { --tc: var(--power); }
@keyframes deal { from { opacity: 0; transform: translate(-460px, 40px) rotate(-40deg) scale(.5); } }
.pile { position: absolute; bottom: 16px; width: 74px; height: 96px; border-radius: 8px; background: linear-gradient(#2b2440, #15101f); border: 2px solid #5a4d78; text-align: center; font-family: var(--serif); padding-top: 16px; color: var(--dim); font-size: 12px; z-index: 6; }
.pile b { display: block; font-size: 30px; color: var(--text); }
.pile.draw { left: 24px; } .pile.discard { right: 24px; }
.energy { position: absolute; left: 112px; bottom: 120px; width: 76px; height: 76px; border-radius: 50%; background: radial-gradient(#ffd98a, #c2701a 70%); border: 3px solid #fff2c9; box-shadow: 0 0 24px #ffb347aa; font-family: var(--serif); font-size: 30px; font-weight: 700; text-align: center; line-height: 70px; color: #3b1c00; z-index: 6; }
.energy small { font-size: 15px; }
.endturn { position: absolute; right: 120px; bottom: 120px; z-index: 6; padding: 14px 24px; }
.hint { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 6; padding: 4px 16px; background: #000b; border: 1px solid var(--gold); border-radius: 14px; font-family: var(--serif); color: var(--gold); font-size: 14px; }
.turnbanner { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); font-family: var(--serif); font-size: 48px; color: var(--gold); text-shadow: 0 0 30px #000; z-index: 12; pointer-events: none; animation: banner 1.1s both; letter-spacing: .2em; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.7); } 25%, 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); } }

/* ---------- reward / end / overlays ---------- */
.overlay { position: absolute; inset: 0; background: #000c; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; overflow: auto; padding: 20px; }
.rewards { display: flex; gap: 40px; }
.rewards .card { margin: 0; --ty: 0px; }
.rewards .card:hover { transform: translateY(-14px) scale(1.12); }
.deck-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; max-width: 1100px; }
.deck-grid .card { margin: 0; animation: none; }
.deck-grid .card:hover { transform: scale(1.1); }
.toast { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); background: #000d; border: 1px solid var(--gold); padding: 8px 20px; border-radius: 8px; font-family: var(--serif); z-index: 40; }

/* ---------- relics ---------- */
.relics { display: flex; gap: 6px; }
.relic { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; font-size: 19px; cursor: help; border-radius: 6px; background: #1d1829; border: 1px solid #5a4d78; }
.relic:hover { border-color: var(--gold); box-shadow: 0 0 10px #d9b45b66; }
.relic-find { display: flex; align-items: center; gap: 16px; padding: 12px 22px; border: 1px solid var(--gold); border-radius: 10px; background: #2a2210cc; box-shadow: 0 0 30px #d9b45b44; animation: pop .5s both; }
.relic-find .ico { font-size: 42px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* ---------- shop ---------- */
.shop-screen { flex: 1; display: flex; flex-direction: column; background: url(/assets/backdrops/dungeon.jpg) center/cover; position: relative; min-height: 0; }
.shop-screen::before { content: ''; position: absolute; inset: 0; background: linear-gradient(#000b, #1a0f05cc); }
.shop-body { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; gap: 48px; padding: 0 30px; min-height: 0; }
.merchant { display: flex; flex-direction: column; align-items: center; gap: 10px; font-family: var(--serif); color: var(--gold); }
.merchant img { height: 210px; }
.bubble { max-width: 220px; padding: 10px 14px; background: #f4ecd8; color: #2a2118; border-radius: 12px; font-family: var(--body); font-size: 17px; text-align: center; position: relative; }
.bubble::after { content: ''; position: absolute; bottom: -8px; left: 50%; border: 8px solid transparent; border-top-color: #f4ecd8; border-bottom: 0; margin-left: -8px; }
.wares { display: flex; flex-direction: column; gap: 26px; }
.shelf { display: flex; gap: 22px; justify-content: center; }
.ware { position: relative; cursor: pointer; }
.card-ware .card { margin: 0; animation: none; --ty: 0px; }
.card-ware:hover:not(.sold) .card { transform: translateY(-10px) scale(1.06); }
.card-ware.sold .card { filter: grayscale(1) brightness(.4); }
.price { margin-top: 8px; text-align: center; font-family: var(--serif); font-size: 18px; color: #ffe08a; }
.price.poor { color: #e0504f; }
.sold-tag { color: var(--dim); letter-spacing: .2em; }
.relic-ware, .remove-ware, .potion-ware, .sharpen-ware { display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: #15121fe6; border: 1px solid #5a4d78; border-radius: 10px; text-align: left; width: 330px; color: inherit; transition: .15s; }
.relic-ware:hover, .remove-ware:hover, .potion-ware:hover, .sharpen-ware:hover { border-color: var(--gold); }
.relic-ware .ico, .remove-ware .ico, .potion-ware .ico, .sharpen-ware .ico { font-size: 34px; }
.relic-ware .price, .remove-ware .price, .potion-ware .price, .sharpen-ware .price { margin: 0 0 0 auto; white-space: nowrap; }
.poor.relic-ware, .poor.remove-ware, .poor.potion-ware, .poor.sharpen-ware { opacity: .7; }
.sold-out { padding: 18px; color: var(--dim); font-family: var(--serif); }
.shop-leave { position: relative; text-align: center; padding: 10px 0 18px; }

/* ---------- events ---------- */
.event-screen { flex: 1; display: flex; flex-direction: column; background-image: var(--bd); background-position: center; background-size: cover; position: relative; min-height: 0; }
.event-screen::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, #000a, #000e); }
.event-body { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; overflow: auto; }
.event-card { width: min(680px, 100%); padding: 28px 34px; background: #120f1cdd; border: 1px solid #5a4d78; border-radius: 14px; text-align: center; box-shadow: 0 0 60px #000; animation: pop .45s both; }
.event-ico { font-size: 64px; filter: drop-shadow(0 0 18px #d9b45b66); }
.event-card h2 { margin: 6px 0 10px; }
.event-text { font-size: 20px; line-height: 1.35; color: #d8d0c0; margin: 0 0 22px; font-style: italic; }
.event-choices { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.choice { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 18px; }
.choice b { font-size: 17px; }
.choice span { font-family: var(--body); letter-spacing: 0; color: var(--dim); font-size: 15px; }
.outcome { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 6px; }
.gain { padding: 5px 14px; border-radius: 16px; background: #1b3a26; border: 1px solid #3f7a55; color: #bff0cc; font-family: var(--serif); }
.gain.bad { background: #3a1b1f; border-color: #7a3f45; color: #f0bfc4; }

.continue { font-size: 18px; padding: 14px 34px; }

/* ---------- pack, stash, end summary ---------- */
.packlist { display: flex; flex-direction: column; gap: 10px; width: min(560px, 100%); }
.packrow { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: #15121fe6; border: 1px solid #5a4d78; border-radius: 10px; text-align: left; }
.packrow .ico { font-size: 32px; }
.packrow .btn { margin-left: auto; white-space: nowrap; }
.safe-line { color: var(--gold); margin: 0; }
.btnrow { display: flex; gap: 14px; }
.stash-btn { margin-top: 6px; }
.stash-body { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.stash-class { width: 260px; padding: 14px 16px; background: #15121fe6; border: 1px solid var(--c, #5a4d78); border-radius: 10px; text-align: left; }
.stash-class h3 { margin: 0 0 4px; color: var(--c, var(--gold)); }
.stash-class p { margin: 2px 0; color: var(--dim); font-size: 15px; }
.slots { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.slots label { display: flex; justify-content: space-between; gap: 8px; text-transform: capitalize; }
.slots select { background: #1b1629; color: inherit; border: 1px solid #5a4d78; border-radius: 4px; max-width: 160px; }
.lootrow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.loot { padding: 4px 12px; border-radius: 14px; background: #1b3a26; border: 1px solid #3f7a55; }
.lostloot + .lootrow .loot { background: #3a1b1f; border-color: #7a3f45; }
.levelup { color: var(--gold); font-family: var(--serif); font-size: 20px; animation: pop .5s both; }

/* ---------- loadout screen ---------- */
.loadout { justify-content: flex-start; align-items: stretch; gap: 12px; background: radial-gradient(ellipse at 50% 30%, #2a2140, #0b0914 75%); }
.lo-tabs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lo-tab { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; background: #15121fe6; border: 1px solid #5a4d78; border-radius: 30px; color: inherit; font-family: var(--serif); }
.lo-tab img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: top; }
.lo-tab.sel { border-color: var(--c); box-shadow: 0 0 16px var(--c); }
.lo-main { display: flex; gap: 16px; justify-content: center; align-items: stretch; flex-wrap: wrap; flex: 1; min-height: 0; }
.lo-slots { display: flex; flex-direction: column; gap: 10px; width: 260px; }
.lo-slot, .lo-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #15121fe6; border: 1px solid #5a4d78; border-radius: 10px; text-align: left; color: inherit; transition: .15s; }
.lo-slot:hover, .lo-item:hover { border-color: var(--gold); }
.lo-slot.sel { border-color: var(--gold); box-shadow: 0 0 16px #d9b45b55; }
.lo-slot .ico, .lo-item .ico { font-size: 30px; width: 38px; text-align: center; }
.lo-slot small { color: var(--dim); text-transform: uppercase; letter-spacing: .12em; }
.lo-slot span, .lo-item span { color: var(--dim); font-size: 14px; }
.lo-stage { position: relative; flex: 1; min-width: 280px; max-width: 520px; min-height: 340px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 54px; border-radius: 14px; background: radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--c, #7a5a9e) 35%, transparent), transparent 65%), #0d0a16cc; border: 1px solid #3a3052; }
.lo-floor { position: absolute; left: 12%; right: 12%; bottom: 40px; height: 22px; border-radius: 50%; background: radial-gradient(ellipse, #000a, transparent 70%); }
.lo-doll { position: relative; transition: filter .3s; }
.lo-sprite { position: absolute; inset: 0; }
@keyframes lo-bob { 50% { translate: 0 -8px; } }
.lo-actions { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.lo-actions .btn { padding: 5px 12px; font-size: 13px; }
.lo-stats { width: 270px; padding: 14px 18px; background: #15121fe6; border: 1px solid #5a4d78; border-radius: 12px; text-align: left; }
.lo-stats h3 { margin: 0; color: var(--gold); }
.lo-level { color: var(--dim); }
.lo-xp { height: 8px; background: #000a; border-radius: 4px; margin: 6px 0; overflow: hidden; }
.lo-xp i { display: block; height: 100%; background: linear-gradient(90deg, #7a5a1e, var(--gold)); }
.lo-stats .perks { color: var(--dim); font-size: 14px; }
.lo-stats table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.lo-stats td { padding: 3px 0; border-bottom: 1px solid #ffffff12; }
.lo-stats td:last-child { text-align: right; }
.lo-stats .up { color: #7ee09a; } .lo-stats .down { color: #f08a8f; }
.lo-items { padding: 0 4px; }
.lo-title { text-align: center; font-family: var(--serif); color: var(--dim); margin-bottom: 6px; }
.lo-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.lo-item { width: 250px; }
.lo-item.worn { border-color: #3f7a55; background: #14261c; }
.lo-empty { color: var(--dim); margin: 6px; }
.lo-close { align-self: center; }

/* ---------- layered sprites, gear badges, character panel ---------- */
/* A drawn 1-art-pixel dark outline round every hero and enemy: the art's own outline has gaps where the magenta key used to be.
   --o is one art pixel in CSS px (set from the sprite's scale); the four chained shadows also fill the corners. */
.sprite { position: relative; --o: 1px; --ink: #0b0a10;
  --outline: drop-shadow(var(--o) 0 0 var(--ink)) drop-shadow(calc(-1 * var(--o)) 0 0 var(--ink)) drop-shadow(0 var(--o) 0 var(--ink)) drop-shadow(0 calc(-1 * var(--o)) 0 var(--ink));
  filter: var(--outline); }
.sprite .layer { position: absolute; inset: 0; background-repeat: no-repeat; }
.gear-shine { position: absolute; inset: 5%; pointer-events: none; background: radial-gradient(ellipse, #fff9, transparent 65%); mix-blend-mode: screen; animation: gear-shine .7s ease-out both; }
@keyframes gear-shine { from { opacity: 1; transform: scale(.6); } to { opacity: 0; transform: scale(1.3); } }
.lo-left { display: flex; flex-direction: column; gap: 12px; width: 260px; }
.lo-left .lo-slots { width: 100%; }
.lo-char { padding: 12px 14px; background: #15121fe6; border: 1px solid #5a4d78; border-radius: 10px; text-align: left; }
.lo-name { display: flex; flex-direction: column; gap: 4px; color: var(--dim); font-size: 13px; text-transform: uppercase; letter-spacing: .12em; }
.lo-name input { background: #0d0a16; color: var(--fg, #eee); border: 1px solid #5a4d78; border-radius: 6px; padding: 7px 10px; font-family: var(--serif); font-size: 17px; text-transform: none; letter-spacing: 0; }
.lo-name input:focus { outline: none; border-color: var(--gold); }
.lo-looks { margin-top: 10px; } .lo-looks small { color: var(--dim); text-transform: uppercase; letter-spacing: .12em; }
.lo-looks div { display: flex; gap: 8px; margin-top: 6px; }
.lo-look { width: 30px; height: 30px; border-radius: 50%; background: var(--s); border: 2px solid #0008; }
.lo-look.sel { border-color: #fff; box-shadow: 0 0 10px var(--s); }
.lo-look:hover { transform: scale(1.12); }
.lo-looks div { flex-wrap: wrap; }
.lo-look.locked { opacity: .35; filter: grayscale(.6); position: relative; }
.lo-look.locked::after { content: '★'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: #fff; }
.stars { color: #f3c84b; letter-spacing: 1px; text-shadow: 0 0 6px #f3c84b88; }
.lo-prestige { margin: 8px 0; } .lo-prestige small { color: var(--dim); }
.prestige-btn { border-color: #f3c84b; color: #f3c84b; }

/* =====================================================================
   POLISH PASS (2026-11-02): atmosphere, lighting, framed cards, motion
   ===================================================================== */
:root { --glass: #120f1ccc; --edge: #5a4d78; --glow: #d9b45b; }
#app > * { animation: screen-in .45s ease-out both; }
@keyframes screen-in { from { opacity: 0; transform: scale(.985); } }
.overlay { backdrop-filter: blur(5px) brightness(.7); }

/* shared chrome */
.topbar { background: linear-gradient(#050309f2, #05030900); border-bottom: 1px solid #ffffff10; padding: 10px 22px; text-shadow: 0 1px 3px #000; }
.chip { padding: 3px 12px; border-radius: 14px; background: #ffffff0a; border: 1px solid #ffffff14; }
.btn { background: linear-gradient(#3a2f58, #1b1629 85%); box-shadow: inset 0 1px 0 #ffffff22, 0 3px 10px #0008; border-color: var(--edge); }
.btn.primary { background: linear-gradient(#b88a2c, #5a3f10 85%); box-shadow: inset 0 1px 0 #fff6, 0 3px 14px #d9b45b44; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.relic { background: linear-gradient(#2a2340, #15101f); box-shadow: inset 0 1px 0 #ffffff1a; }

/* embers drifting up the title and map */
.embers { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.embers i { position: absolute; bottom: -12px; width: 4px; height: 4px; border-radius: 50%; background: #ffd98a; box-shadow: 0 0 8px 2px #ff9d3c; opacity: 0; animation: ember var(--t, 9s) linear infinite; animation-delay: var(--d, 0s); left: var(--x, 50%); }
@keyframes ember { 0% { opacity: 0; transform: translate(0, 0) scale(1); } 10% { opacity: .9; } 100% { opacity: 0; transform: translate(var(--dx, 30px), -75vh) scale(.3); } }

/* title */
.title-screen::after { content: ''; position: absolute; left: 50%; top: 4%; width: 520px; height: 520px; margin-left: -260px; border-radius: 50%; background: radial-gradient(circle, #cfd8ff33, #7a68c422 45%, transparent 70%); pointer-events: none; animation: moonpulse 7s ease-in-out infinite; }
@keyframes moonpulse { 50% { transform: scale(1.07); opacity: .8; } }
.title-screen h1 { font-size: 78px; letter-spacing: .22em; margin: 0; background: linear-gradient(#fff3c8, #d9b45b 55%, #8a5f1c); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 24px #d9b45b88) drop-shadow(0 4px 0 #000); text-shadow: none; }
.title-screen > p { font-size: 21px; letter-spacing: .12em; font-style: italic; color: #cdbfe0 !important; text-shadow: 0 2px 8px #000; }
.classes { gap: 28px; margin-top: 18px; }
.class-card { width: 250px; padding: 14px 14px 16px; background: linear-gradient(#1d1830e6, #0e0b18ee); border: 1px solid var(--edge); border-radius: 12px; box-shadow: 0 10px 36px #000a, inset 0 1px 0 #ffffff14; position: relative; overflow: hidden; }
.class-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 85%, color-mix(in srgb, var(--c) 40%, transparent), transparent 65%); opacity: .55; transition: .3s; }
.class-card:hover::before { opacity: 1; }
.class-card:hover { transform: translateY(-10px) scale(1.03); }
.class-card .stage-sprite { position: relative; height: 230px; display: flex; align-items: flex-end; justify-content: center; margin-bottom: 8px; }
.class-card .stage-sprite::after { content: ''; position: absolute; bottom: -4px; left: 15%; right: 15%; height: 14px; background: radial-gradient(#000c, transparent 70%); }
.class-card h3 { position: relative; font-size: 20px; letter-spacing: .05em; text-shadow: 0 0 14px color-mix(in srgb, var(--c) 60%, transparent); }
.class-card p { position: relative; }

/* map */
.map-screen::before { background: radial-gradient(ellipse at 50% 45%, #0006, #000d); }
.floors { padding: 14px; border-radius: 12px; background: var(--glass); border: 1px solid var(--edge); position: relative; }
.floor-dot { width: 170px; display: flex; align-items: center; gap: 10px; border: 0; border-left: 3px solid #3a3350; border-radius: 0 6px 6px 0; background: #ffffff06; }
.floor-dot::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #3a3350; flex: none; }
.floor-dot.done { border-left-color: #3f7a55; } .floor-dot.done::before { background: #5fbf7a; }
.floor-dot.now { border-left-color: var(--gold); background: #d9b45b14; } .floor-dot.now::before { background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: moonpulse 1.6s infinite; }
.options { gap: 34px; position: relative; }
.options::before { content: ''; position: absolute; left: 8%; right: 8%; top: 50%; border-top: 2px dashed #d9b45b44; z-index: 0; }
.node { position: relative; z-index: 1; width: 230px; padding: 22px 18px 20px; background: linear-gradient(#1f1a33f2, #0f0c1af2); border-radius: 14px; box-shadow: 0 12px 34px #000a, inset 0 1px 0 #ffffff14; animation: pop .5s both; }
.node:nth-child(2) { animation-delay: .08s; } .node:nth-child(3) { animation-delay: .16s; } .node:nth-child(4) { animation-delay: .24s; }
.node .ico { width: 84px; height: 84px; margin: 0 auto 6px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 46px; background: radial-gradient(circle at 50% 40%, #4a3d78, #15101f 70%); border: 2px solid var(--edge); box-shadow: 0 0 24px #7a68c444; }
.node:hover { transform: translateY(-10px) scale(1.04); box-shadow: 0 18px 44px #000, 0 0 30px #d9b45b44; }
.node.elite .ico { border-color: #c4552e; box-shadow: 0 0 26px #c4552e88; } .node.boss .ico { border-color: #d24fb4; box-shadow: 0 0 30px #d24fb499; }
.node.shop .ico { border-color: #d9b45b; } .node.rest .ico { border-color: #ff9d3c; box-shadow: 0 0 26px #ff9d3c66; }

/* battle atmosphere */
.stage::after { background: radial-gradient(ellipse at 50% 58%, transparent 35%, #000c 100%), linear-gradient(#0000 50%, #000b), linear-gradient(#0a0615aa, #0000 30%); }
.ground::before { content: ''; position: absolute; left: -2%; right: -2%; top: -4px; height: 56px; background: linear-gradient(#0000, #05030999 70%); pointer-events: none; }
.unit .shadow { height: 20px; left: 0; right: 0; bottom: -8px; background: radial-gradient(#000e, transparent 70%); }
.hpbar { height: 16px; border-radius: 8px; border: 1px solid #000; background: #0c0508; box-shadow: 0 0 0 1px #5a3a40, 0 2px 8px #000a; }
.hpfill { background: linear-gradient(#ff7a74, #c8403f 45%, #7a1b22); border-radius: 8px; box-shadow: inset 0 1px 0 #ffffff55; }
.hpbar.hero .hpfill { background: linear-gradient(#8fe9a6, #3fa165 45%, #1d5a38); }
.hptxt { font-size: 12px; line-height: 15px; letter-spacing: .06em; }
.ename { font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: #e8e0d2; }
.intent { padding: 3px 14px; background: linear-gradient(#000c, #1a1226cc); border-radius: 18px; box-shadow: 0 4px 14px #000a; }
.blockchip { box-shadow: 0 0 14px #4a86ffcc; }
.status { background: #0009; }
.dmg { font-size: 46px; paint-order: stroke fill; -webkit-text-stroke: 2px #000; }

/* framed cards */
.hand-area { background: linear-gradient(#0000, #05030aee 35%); }
.card { --rx: 0deg; --ry: 0deg; width: 156px; height: 222px; border-radius: 12px; border: 0; padding: 4px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--tc) 85%, #fff 15%), color-mix(in srgb, var(--tc) 35%, #000) 55%, color-mix(in srgb, var(--tc) 70%, #000));
  box-shadow: 0 10px 26px #000b, 0 0 0 1px #000;
  transform: perspective(700px) rotate(var(--rot, 0deg)) translateY(var(--ty, 0px)) rotateX(var(--rx)) rotateY(var(--ry)); }
.card::before { content: ''; position: absolute; inset: 4px; border-radius: 9px; background: linear-gradient(#2c2442, #14101f 60%); box-shadow: inset 0 0 0 1px #ffffff18, inset 0 0 22px #000a; }
.card > * { position: relative; }
.card:hover:not(.unplayable), .card.selected { transform: perspective(700px) rotate(0deg) translateY(-66px) scale(1.2) rotateX(var(--rx)) rotateY(var(--ry)); box-shadow: 0 0 30px var(--tc), 0 16px 38px #000; }
.card .cost { position: absolute; left: -14px; top: -14px; width: 38px; height: 38px; line-height: 34px; font-size: 21px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #a9cdff, #2a52b8 60%, #14286a); border: 2px solid #e4f0ff; box-shadow: 0 0 14px #4a86ff, 0 3px 6px #000; z-index: 3; }
.card .cname { margin: 10px 6px 2px 28px; font-size: 14px; color: #fff4d8; text-shadow: 0 1px 2px #000; }
.card .art { height: 84px; margin: 6px 8px; border-radius: 8px; border: 1px solid #000; box-shadow: inset 0 0 18px #000c, 0 0 0 1px #ffffff14; font-size: 46px; overflow: hidden;
  background: radial-gradient(circle at 50% 65%, color-mix(in srgb, var(--tc) 80%, #fff 10%), color-mix(in srgb, var(--tc) 25%, #0a0710) 55%, #0a0710 90%); }
.card .art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, #ffffff44 50%, transparent 60%); transform: translateX(-120%); }
.card:hover .art::after { transition: transform .7s; transform: translateX(120%); }
.card .ctype { margin-top: 2px; font-size: 10.5px; }
.card .ctext { margin: 2px 7px 0; padding: 6px 6px; border-radius: 6px; background: #00000055; font-size: 14.5px; line-height: 1.18; min-height: 62px; display: flex; align-items: center; justify-content: center; }
.pile, .energy { box-shadow: 0 6px 18px #000a; }
.energy { background: radial-gradient(circle at 35% 30%, #fff0c0, #f2b04a 45%, #a85c10); }

/* shop, event, loadout surfaces share the same glass */
.event-card, .stash-class, .lo-char, .lo-slot, .lo-item, .lo-stats, .packrow { background: linear-gradient(#1d1830ee, #0f0c1aee); box-shadow: 0 8px 26px #0008, inset 0 1px 0 #ffffff12; }
.lo-stage { box-shadow: inset 0 0 60px #000c, 0 10px 30px #000a; }
.card-ware:hover:not(.sold) .card { transform: perspective(700px) translateY(-12px) scale(1.07); }

.pace { color: var(--dim); font-family: var(--serif); font-size: 14px; letter-spacing: .08em; display: flex; gap: 8px; align-items: center; }

/* ---------- overworld, towns, death ---------- */
.world-screen { flex: 1; display: flex; flex-direction: column; position: relative; min-height: 0; }
.world-screen > .world-map, .world-screen > .world-info { position: relative; }
.world-screen { display: grid; grid-template-columns: 1fr 290px; grid-template-rows: auto 1fr; }
.world-screen > .topbar { grid-column: 1 / -1; }
.world-map { margin: 8px 0 14px 14px; border-radius: 16px; border: 1px solid var(--edge); overflow: hidden; min-height: 0;
  background:
    radial-gradient(ellipse 30% 26% at 86% 28%, #dfeaff44, transparent 70%),
    radial-gradient(ellipse 26% 22% at 74% 52%, #3f7a5a55, transparent 70%),
    radial-gradient(ellipse 24% 24% at 62% 72%, #6a3b8a44, transparent 70%),
    radial-gradient(ellipse 30% 26% at 70% 14%, #1b1130cc, transparent 75%),
    radial-gradient(ellipse 32% 30% at 20% 70%, #2f6a3a66, transparent 72%),
    linear-gradient(#0009, #000b), url(/assets/backdrops/forest.jpg) center/cover; box-shadow: inset 0 0 90px #000, 0 12px 40px #000a; }
.roads { position: absolute; inset: 0; width: 100%; height: 100%; }
.roads line { stroke: #d9b45b55; stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; }
.roads line.live { stroke: #ffe08acc; stroke-width: 4; filter: drop-shadow(0 0 6px #d9b45b); }
.place { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0; z-index: 2; cursor: default; }
.place .pico { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; background: radial-gradient(circle at 50% 35%, #3a2f58, #120e1c 75%); border: 2px solid #5a4d78; box-shadow: 0 4px 14px #000a; transition: .2s; }
.place .pname { font-family: var(--serif); font-size: 13px; letter-spacing: .06em; text-shadow: 0 1px 4px #000, 0 0 8px #000; white-space: nowrap; }
.place.town .pico { width: 62px; height: 62px; font-size: 32px; border-color: var(--gold); box-shadow: 0 0 22px #d9b45b66, 0 4px 14px #000a; }
.place.lair .pico { border-color: #c4552e; } .place.boss .pico { border-color: #d24fb4; width: 64px; height: 64px; box-shadow: 0 0 26px #d24fb4aa; }
.place.camp .pico { border-color: #ff9d3c; } .place.site .pico { border-color: #7a8cff; }
.place.quiet .pico { opacity: .55; filter: grayscale(.8); }
.place.camp.spent .pico { border-color: #2a2622; filter: grayscale(1) brightness(.35); }
.ash { color: #9a948c; }
.place.reach { cursor: pointer; }
.place.reach .pico { animation: reach-pulse 1.4s ease-in-out infinite; border-color: #fff3c8; }
.place.reach:hover .pico { transform: scale(1.18); }
@keyframes reach-pulse { 50% { box-shadow: 0 0 0 8px #ffe08a22, 0 0 26px #ffe08aaa; } }
.place.here .pname { color: var(--gold); }
.party { position: absolute; width: 0; height: 0; z-index: 4; pointer-events: none; }
.party .sprite { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); filter: var(--outline) drop-shadow(0 4px 6px #000a); }
.world-info { margin: 8px 14px 14px; padding: 18px 20px; border-radius: 16px; background: linear-gradient(#1d1830ee, #0f0c1aee); border: 1px solid var(--edge); box-shadow: 0 12px 34px #000a, inset 0 1px 0 #ffffff12; text-align: left; overflow: auto; }
.world-info h2 { margin: 0; }
.world-info .kind { color: var(--dim); font-family: var(--serif); letter-spacing: .1em; font-size: 13px; text-transform: uppercase; }
.world-info .facts { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; font-family: var(--serif); color: var(--dim); }
.world-info .facts b { color: var(--text); }
.world-info .risk { padding: 10px 12px; border-radius: 8px; background: #0006; border: 1px solid #ffffff14; font-size: 15px; }
.hint-line { color: var(--dim); font-size: 14px; }
.up { color: #7ee09a; } .down { color: #f08a8f; } .dim { color: var(--dim); }

.town-screen { flex: 1; display: flex; flex-direction: column; background-image: var(--bd); background-position: center; background-size: cover; position: relative; min-height: 0; }
.town-screen::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, #0005, #000d); }
.town-screen > .topbar { position: relative; z-index: 5; }
.town-card { position: relative; margin: auto; width: min(820px, 94%); padding: 26px 30px 24px; text-align: center; border-radius: 18px; background: linear-gradient(#1d1830ee, #0f0c1aee); border: 1px solid var(--edge); box-shadow: 0 16px 60px #000, inset 0 1px 0 #ffffff12; overflow: hidden; }
.town-card > * { position: relative; }
.town-card > .embers { position: absolute; }
.town-card h1 { font-size: 46px; margin-bottom: 4px; }
.blurb { margin: 0 0 6px; color: #cdbfe0; font-style: italic; font-size: 19px; }
.town-note { color: var(--dim); margin: 0 0 12px; font-family: var(--serif); letter-spacing: .06em; font-size: 14px; }
.banked { margin: 8px 0 14px; padding: 10px 14px; border-radius: 10px; background: #1b3a2655; border: 1px solid #3f7a55; }
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 14px 0 18px; }
.service { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 10px; border-radius: 14px; background: linear-gradient(#2a2340, #15101f); border: 1px solid var(--edge); transition: .2s; }
.service span { font-size: 38px; } .service b { font-family: var(--serif); font-size: 18px; letter-spacing: .06em; } .service small { color: var(--dim); font-size: 14px; line-height: 1.2; }
.service:hover { transform: translateY(-6px); border-color: var(--gold); box-shadow: 0 12px 30px #000, 0 0 24px #d9b45b44; }
.service.go { border-color: var(--gold); background: linear-gradient(#5a4214, #2a1d08); }
.retire { opacity: .7; }
.death { background: radial-gradient(ellipse at 50% 40%, #3a0d12ee, #000f); }
.death h1 { color: #e0504f; font-size: 72px; text-shadow: 0 0 40px #c8403f; letter-spacing: .25em; animation: pop .8s both; }
.lostloot { color: #f08a8f; margin: 0; }

/* the armoury */
.lo-slotwrap { display: flex; flex-direction: column; gap: 4px; }
.lo-slotwrap .lo-slot { width: 100%; }
.ins { align-self: stretch; text-align: center; padding: 4px 10px; border-radius: 8px; font-family: var(--serif); font-size: 13px; letter-spacing: .06em; }
.ins.ok { background: #1b3a26; border: 1px solid #3f7a55; color: #bff0cc; }
.ins.buy { background: linear-gradient(#5a4214, #2a1d08); border: 1px solid var(--gold); }
.ins.buy:disabled { opacity: .4; }
.lo-warn { max-width: 640px; margin: 0 auto 8px; padding: 6px 12px; border-radius: 8px; background: #3a1b1f66; border: 1px solid #7a3f45; color: #f0bfc4; font-size: 14px; text-align: center; }

/* armoury layout: let the screen scroll instead of squeezing the stage */
.loadout { justify-content: flex-start; overflow-y: auto; }
.loadout .lo-main { flex: 0 0 auto; }
.loadout .lo-stage { min-height: 400px; align-self: stretch; }
.loadout .lo-items, .loadout .lo-close { flex: none; }
.party .sprite { bottom: 34px; }
.place.locked .pico { filter: grayscale(1) brightness(.7); border-color: #3a3350; box-shadow: none; }

/* ---------- potions, hero power, ultimate, mutators ---------- */
.belt { position: absolute; left: 24px; top: -46px; display: flex; gap: 6px; z-index: 7; }
.potion { width: 38px; height: 38px; border-radius: 50%; font-size: 20px; line-height: 1; border: 2px solid #5a4d78; background: radial-gradient(#3a2f55, #15101f); cursor: pointer; padding: 0; }
.potion:hover:not(:disabled) { border-color: var(--gold); box-shadow: 0 0 12px #ffd36a88; }
.potion:disabled { opacity: .5; cursor: default; }
.heroact { position: absolute; left: 12px; top: 2px; width: 152px; display: flex; flex-direction: column; gap: 5px; z-index: 7; align-items: stretch; }
.heroact .btn { position: relative; overflow: hidden; font-size: 11.5px; line-height: 1.15; padding: 5px 8px; text-align: left; white-space: normal; }
.heroact .btn b { float: right; margin-left: 10px; color: var(--gold); }
.heroact .ultimate i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--c, #ffd36a); }
.heroact .ultimate.ready { border-color: var(--gold); animation: ultpulse 1.1s ease-in-out infinite; }
@keyframes ultpulse { 50% { box-shadow: 0 0 18px var(--gold); } }
.heroact .btn:disabled { opacity: .55; }
.heroact .flee { align-self: flex-start; width: 90px; text-align: center; border-color: #6b4a4a; color: #e7c9c9; } /* Flee: back down the road you came by (src/world.js, flee) */
.mutators { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; color: var(--dim); font-size: 13px; margin: 6px 0 2px; }
.mutators select { margin-left: 6px; }

/* nemeses */
.place.wanted .pico { border-color: #e0344a; box-shadow: 0 0 22px #e0344a99, 0 4px 14px #000a; }
.wanted-list { margin-top: 10px; padding: 8px 10px; border: 1px solid #7a2a36; border-radius: 8px; background: #2a1119aa; font-size: 13px; }
.wanted-row { margin-top: 6px; } .wanted-row small { opacity: .75; } .wlv { color: #ff8da0; font-weight: 700; }
.nemesis-line { color: #ff9aaa; } .nemesis-win { border-color: #b8404f; }

/* ---------- ultimate cutscene ---------- */
.cutscene { position: fixed; inset: 0; z-index: 90; pointer-events: none; transition: opacity .3s; }
.cutscene.out { opacity: 0; }
.cutscene .bar { position: absolute; left: 0; right: 0; height: 0; background: #000; animation: bars .45s ease-out forwards; }
.cutscene .bar.top { top: 0; } .cutscene .bar.bottom { bottom: 0; }
@keyframes bars { to { height: 14vh; } }
.cutscene .glow { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 55%, color-mix(in srgb, var(--c) 60%, transparent), #0009 70%); opacity: 0; animation: glowin .6s .2s ease-out forwards; }
@keyframes glowin { to { opacity: 1; } }
.cutscene .splash { position: absolute; left: 0; right: 0; top: 38%; text-align: center; font-family: var(--serif); opacity: 0; animation: splashin .5s .45s ease-out forwards; }
.cutscene .splash small { display: block; letter-spacing: .4em; text-transform: uppercase; color: #fff9; font-size: 14px; }
.cutscene .splash b { display: block; font-size: clamp(34px, 7vw, 72px); color: #fff; text-shadow: 0 0 28px var(--c), 0 4px 0 #000; letter-spacing: .06em; }
.cutscene .splash i { display: block; color: #ffe9b0; font-size: 18px; margin-top: 6px; }
@keyframes splashin { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }

.card .art .cardimg { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }

/* painted ultimate backdrop, when public/assets/splash/<id>.jpg exists (tools/draw_local.py) */
.cutscene .art { position: absolute; left: 0; top: 10vh; width: 100%; height: 80vh; object-fit: cover; opacity: 0; animation: artin .7s .15s ease-out forwards; -webkit-mask-image: linear-gradient(#0000, #000 22%, #000 78%, #0000); mask-image: linear-gradient(#0000, #000 22%, #000 78%, #0000); }
@keyframes artin { to { opacity: .82; } }

/* painted world map: stretched to the box so the place percentages keep landing on the landmarks */
.world-map { background: linear-gradient(#0006, #0009), url(/assets/map-clean/world.jpg) 0 0 / 100% 100% no-repeat, url(/assets/map/world.jpg) 0 0 / 100% 100% no-repeat; }
.place .pname { text-shadow: 0 1px 3px #000, 0 0 10px #000, 0 0 4px #000; }

/* floor 2, the Tidewrack Coast: the painted coast map (tools/draw_coast_map.mts, ChatGPT app, 2026-11-14), darkened like the floor 1 map and
   stretched the same way; the CSS sea under it (sand on the left, the sea on the right) is the fallback while it loads or if it is missing */
.world-map.coast { background:
  linear-gradient(#0006, #0009),
  url(/assets/map-clean/coast.jpg) 0 0 / 100% 100% no-repeat,
  radial-gradient(ellipse 30% 22% at 93% 12%, #d9f2ff55, #0000 70%),
  radial-gradient(ellipse 60% 70% at 85% 60%, #0d3550, #0000 75%),
  linear-gradient(100deg, #6b5a3e 0%, #4f5745 22%, #24414d 42%, #0f2c40 62%, #0a1f30 100%); }
.world-map.coast.tide-high { box-shadow: inset 0 0 120px #1d6f9a88; }
.world-map.coast.tide-low { box-shadow: inset 0 0 80px #c9a96a33; }
.roads line.tidal { stroke: #6fc3ff66; }
.place.flooded .pico { filter: grayscale(.4) brightness(.6) hue-rotate(160deg); }
.place.flooded .pname::after { content: ' (flooded)'; color: #8fd3ff; }
.tide-high { color: #7fd0ff; } .tide-low { color: #e9cd8c; }
.world-info .floor-name { font-size: .8em; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.crossroads .cross-choices { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; max-width: 760px; }
.crossroads .cross-choices .choice { flex: 1 1 280px; display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 14px 16px; }

/* ====================== co-op ====================== */
.coop .dim { color: var(--dim); max-width: 560px; text-align: center; }
.coop label { display: flex; gap: 8px; align-items: center; }
.coop input, .coop select { background: #120d1c; color: inherit; border: 1px solid #5a4d78; border-radius: 6px; padding: 6px 10px; font: inherit; }
.coop .classes { display: flex; gap: 14px; }
.coop .class-card { min-width: 150px; opacity: .6; }
.coop .class-card.on { opacity: 1; outline: 2px solid var(--gold); }
.coop-row { display: flex; gap: 12px; align-items: center; }
.coop-row .code { width: 90px; text-align: center; letter-spacing: .3em; }
.coop-err { color: #ff8a8a; }
.coop .small { font-size: 12px; }
.relic-strip { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0; }
.pchip.relics { display: inline-flex; gap: 6px; align-items: center; padding: 4px 8px; }
.acct-box { justify-content: center; }
.acct-form { max-width: 560px; text-align: center; }
.acct-form summary { cursor: pointer; color: var(--gold, #d9b45b); margin-bottom: 8px; }
.acct-form .coop-row { justify-content: center; flex-wrap: wrap; }
.acct-form input { min-width: 160px; }
.acct-form .linkish { background: none; border: 0; padding: 0; color: var(--gold, #d9b45b); text-decoration: underline; cursor: pointer; font: inherit; }
.acct-form .linkish:disabled { opacity: 0.5; cursor: default; }
.coop-players { display: flex; gap: 12px; }
.coop-player { border: 2px solid var(--c); border-radius: 10px; padding: 8px 16px; background: #000a; text-align: center; }
.coop-battle .banner-box { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 10; }
.banner { font-family: var(--serif); font-size: 54px; letter-spacing: .2em; color: #fff3c8; text-shadow: 0 0 20px #d9b45b, 0 3px 0 #000; animation: bannerIn 1.4s both; }
@keyframes bannerIn { 0% { opacity: 0; transform: scale(.8); } 20%, 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
.party-strip { display: flex; gap: 8px; padding: 6px 10px; background: #07060d; flex: none; flex-wrap: wrap; font-size: 14px; }
.pchip { border: 1px solid var(--c, #5a4d78); border-radius: 8px; padding: 3px 10px; background: #14101f; }
.pchip.me { box-shadow: 0 0 8px var(--c); }
.pchip.done { opacity: .65; }
.pchip.down { opacity: .4; text-decoration: line-through; }
.pchip.wait { margin-left: auto; border-color: transparent; color: var(--dim); }
.coop-battle .unit.me .ename { color: var(--gold); }
.coop-over { position: absolute; inset: 0; z-index: 30; background: #000c; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.coop-over h2 { font-size: 72px; margin: 0; letter-spacing: .2em; }
.coop-over.win h2 { color: #ffe08a; } .coop-over.lose h2 { color: #ff6b6b; }
.coop-world .coop-members { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.coop-world .party { display: flex; transform: translate(-50%, -85%); }
.reward-cards { display: flex; gap: 22px; margin: 10px 0 20px; }
.reward-cards .card { cursor: pointer; margin: 0; }
.reward-cards .card:hover { transform: translateY(-14px) scale(1.06); }
.card.tribute-opt { outline: 3px solid #ffd36a; box-shadow: 0 0 22px #ffd36a; }
.shop-panel { position: absolute; inset: 14px 304px 14px 14px; z-index: 20; background: #0a0714f2; border: 1px solid var(--gold); border-radius: 14px; padding: 14px 18px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.shop-head { display: flex; align-items: center; gap: 16px; } .shop-head h2 { margin: 0; flex: 1; } .shop-head .gold { color: var(--gold); font-family: var(--serif); font-size: 20px; }
.shop-cards, .shop-deck { display: flex; gap: 16px; flex-wrap: wrap; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.shop-item.sold { opacity: .4; } .shop-item.poor .buy { opacity: .55; }
.shop-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.shop-potions { display: flex; gap: 12px; }
.relic-line { display: flex; flex-direction: column; align-items: center; max-width: 170px; text-align: center; } .relic-line .ricon { font-size: 30px; } .relic-line small { color: var(--dim); }
.shop-deck .card { cursor: pointer; margin: 0; }
.shop-cards .card, .shop-deck .card { zoom: .8; }

.event-screen { background: linear-gradient(#000b, #000d), var(--bd) center / cover; }
.event-icon { font-size: 64px; }
.event-text { max-width: 620px; text-align: center; font-size: 20px; line-height: 1.5; }
.event-body { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.event-choice { display: flex; flex-direction: column; gap: 2px; min-width: 340px; }
.event-choice small { color: var(--dim); }
.event-lines { background: #000a; border: 1px solid var(--gold); border-radius: 10px; padding: 10px 24px; text-align: center; font-family: var(--serif); }
.nem-line { color: #ff9a8a; max-width: 460px; text-align: center; }
.coop-world .wanted-list { margin: 8px 0; font-size: 13px; }

.coop-me { margin: 8px 0; font-size: 14px; }
.gear-slots, .gear-vault { gap: 14px; }
.gear-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 1px solid #5a4d78; border-radius: 10px; padding: 8px 12px; min-width: 150px; background: #14101f; }
.gear-slot > small { text-transform: uppercase; letter-spacing: .1em; color: var(--dim); }

/* ====================== esc menu ====================== */
.pause-menu-btn { position: fixed; right: 8px; bottom: 8px; z-index: 900; padding: 5px 10px; font: 600 12px var(--serif, serif); color: #e8e4f4; background: #14101fcc; border: 1px solid #5a4d78; border-radius: 8px; cursor: pointer; opacity: .55; }
.pause-menu-btn:hover, .pause-menu-btn:focus-visible { opacity: 1; }
.pause-back { position: fixed; inset: 0; z-index: 2000; background: #000b; display: flex; align-items: center; justify-content: center; }
.pause-box { display: flex; flex-direction: column; gap: 12px; min-width: 300px; padding: 22px 28px; background: #120d1c; border: 1px solid var(--gold, #d9b45b); border-radius: 14px; box-shadow: 0 14px 50px #000; text-align: center; }
.pause-box h2 { margin: 0 0 4px; letter-spacing: .2em; }
.pause-box small { color: var(--dim, #9a90b4); }
.pause-sound { display: flex; align-items: center; gap: 10px; justify-content: center; }

/* ---------- loading screen (public/loader.js) ---------- */
.loading-screen { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: radial-gradient(ellipse at 50% 35%, #2a2050, #0a0912 70%); opacity: 1; transition: opacity .3s; }
.loading-screen.out { opacity: 0; pointer-events: none; }
.ld-moon { width: 74px; height: 74px; border-radius: 50%; background: radial-gradient(circle at 36% 34%, #f3ecd2, #c9bd93 60%, #8d8160); box-shadow: 0 0 40px #d9b45b66; animation: ld-pulse 1.8s ease-in-out infinite; }
.ld-label { font-family: var(--serif); color: var(--gold); font-size: 26px; letter-spacing: .14em; }
.ld-track { width: min(340px, 70vw); height: 8px; border-radius: 6px; background: #ffffff18; overflow: hidden; }
.ld-bar { height: 100%; width: 0; background: linear-gradient(90deg, #7a5a1e, var(--gold)); transition: width .2s; }
.ld-count { color: var(--dim); font-size: 14px; min-height: 18px; }
.ld-tip { color: var(--dim); font-style: italic; max-width: min(520px, 80vw); text-align: center; margin-top: 10px; }
@keyframes ld-pulse { 50% { transform: scale(1.06); box-shadow: 0 0 60px #d9b45b99; } }
@media (prefers-reduced-motion: reduce) { .ld-moon { animation: none; } .loading-screen { transition: none; } }

/* ---------- end-of-run summary ---------- */
.run-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 10px 0; }
.run-stats div { min-width: 92px; padding: 10px 14px; background: #ffffff0d; border: 1px solid #5a4d78; border-radius: 8px; display: flex; flex-direction: column; align-items: center; }
.run-stats b { font-family: var(--serif); color: var(--gold); font-size: 24px; }
.run-stats span { color: var(--dim); font-size: 14px; letter-spacing: .06em; }

/* ---------- fixes from player reports (2026-11-03) ---------- */
/* the shield amount sits beside the health bar, not clipped inside it */
.hpbar { overflow: visible; }
.hpbar .hpfill, .hpbar .hpghost { border-radius: inherit; }
.blockchip { left: -38px; top: 50%; transform: translateY(-50%); }
/* a long card text shrinks to fit instead of running off the card */
.card .ctext { max-height: 78px; overflow: hidden; }
.card .ctext.long { font-size: 12.5px; line-height: 1.12; }
.card .ctext.xlong { font-size: 11px; line-height: 1.1; }
.card .ctext.xxlong { font-size: 9.5px; line-height: 1.08; }
.shelf.extras { flex-wrap: wrap; gap: 12px; max-width: 760px; }
.shelf.extras .ware { width: 240px; padding: 10px 14px; font-size: 15px; }

/* ---------- phones and small windows (fit.js scales #app; these make the layout work at the smaller design size) ---------- */
/* the hand shrinks its overlap to fit however many cards are held (fitHand sets --ov) */
.hand .card { margin: 0 calc(var(--ov, 8px) * -1); }
.hand .card:first-child { margin-left: 0; }
.hand .card:last-child { margin-right: 0; }
html.fitted { touch-action: manipulation; }
/* #app is laid out wider than the screen and scaled down; `hidden` still lets a focus or a scrollIntoView slide the page sideways, `clip` does not */
html.fitted, html.fitted body { overflow: clip; }
html.fitted #app > :not(.battle) { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
html.fitted .title-screen, html.fitted .map-screen .map-body, html.fitted .town-screen { justify-content: safe center; }
html.fitted .classes { flex-wrap: wrap; justify-content: center; }
html.fitted .map-body, html.fitted .options, html.fitted .rewards, html.fitted .shelf { flex-wrap: wrap; justify-content: center; }
html.fitted .map-body { gap: 20px; padding: 12px; }
html.portrait .topbar { flex-wrap: wrap; gap: 6px 14px; padding: 6px 10px; }
html.portrait h1 { font-size: 40px; letter-spacing: .06em; }
html.portrait .overlay { padding: 12px; gap: 12px; }
/* ---- phone pass (tools/verify_phone.mjs; docs/PHONE.md): a finger needs about 40 px on the real screen, and #app is drawn at 1/0.7 of that ---- */
html.fitted.portrait .overlay { padding: 14px 20px 80px; justify-content: safe center; }
html.fitted.portrait .btn, html.fitted.portrait .lo-tab, html.fitted.portrait .event-choice { min-height: 64px; }
html.fitted.portrait .topbar .btn { padding: 0 12px; min-height: 64px; }
html.fitted.portrait .lo-actions .btn { padding: 0 14px; font-size: 15px; }
html.fitted.portrait input:not([type=range]):not([type=checkbox]), html.fitted.portrait select { min-height: 64px; font-size: 18px; }
html.fitted.portrait input[type=range] { height: 64px; }
html.fitted.portrait .mutators { font-size: 17px; gap: 4px 20px; color-scheme: dark; }
html.fitted.portrait .mutators label { display: flex; align-items: center; gap: 8px; min-height: 64px; }
html.fitted.portrait .mutators input[type=checkbox] { width: 30px; height: 30px; margin: 0; }
html.fitted.portrait .pace { font-size: 16px; }
html.fitted.portrait .title-screen { padding-bottom: 84px; }
html.fitted.portrait .title-screen.coop { padding-left: 20px; padding-right: 20px; }
html.fitted.portrait .world-info { padding-bottom: 84px; }
html.fitted.portrait .lo-look { width: 62px; height: 62px; flex: none; }
/* the co-op map has no top bar, so its map is the first grid row, not the second */
html.portrait .world-screen.coop-world { grid-template-rows: minmax(0, 1fr) auto; }
/* cards outside the battle (reward, deck, shop) are drawn 1.35x so their small print is about 9-11 px on the screen, not 7-9 */
html.fitted.portrait .deck-grid .card, html.fitted.portrait .rewards .card, html.fitted.portrait .reward-cards .card, html.fitted.portrait .card-ware .card { zoom: 1.35; }
html.fitted.portrait .shelf.cards { max-width: 450px; }
html.fitted.portrait .place .pname { font-size: 15px; }
html.fitted.portrait .lo-name, html.fitted.portrait .world-info .kind { font-size: 15px; }
html.fitted.portrait .reward-cards { flex-wrap: wrap; justify-content: center; }
html.fitted.portrait .topbar [data-snd] { min-width: 62px; }
html.fitted.portrait .coop .small, html.fitted.portrait .coop-me small { font-size: 15px; }
/* the right-most place name ran off the map edge */
html.portrait .place[data-id="shadowkeep"] .pname { transform: translateX(-30px); }
/* a tablet held upright is not scaled (fit.js leaves it alone) but is still portrait: three class cards in a row are wider than it */
html.portrait .classes { flex-wrap: wrap; justify-content: center; }
html.portrait:not(.fitted) .pause-menu-btn, html.portrait:not(.fitted) select, html.portrait:not(.fitted) input:not([type=range]):not([type=checkbox]) { min-height: 40px; }
html.portrait:not(.fitted) .mutators label { display: flex; align-items: center; gap: 8px; min-height: 40px; }
html.portrait:not(.fitted) input[type=checkbox] { width: 24px; height: 24px; }
html.portrait:not(.fitted) input[type=range] { height: 40px; }
html.portrait:not(.fitted) .lo-look { width: 40px; height: 40px; }
html.portrait:not(.fitted) .lo-actions .btn { min-height: 40px; }
@media (max-width: 600px) { .pause-menu-btn { padding: 0 14px; min-height: 40px; font-size: 14px; } }
html.portrait .event-choice { min-width: 0; width: 100%; }
html.portrait .relic-ware, html.portrait .remove-ware, html.portrait .potion-ware, html.portrait .sharpen-ware { width: min(330px, 100%); }
html.portrait .lo-stage { min-width: 0; }
html.portrait .loadout .lo-main { flex-wrap: wrap; justify-content: center; }
/* landscape: keep the cards clear of the End Turn button and the piles (fitHand shrinks the overlap to the row's width) */
html:not(.portrait) .hand { left: 190px; right: 270px; }
/* portrait: the controls sit in a row above the cards instead of on top of them */
html.portrait .hand-area { height: 450px; }
html.portrait .pile { bottom: 246px; }
html.portrait .pile.draw { left: 14px; } html.portrait .pile.discard { right: 14px; }
html.portrait .energy { left: 120px; bottom: 252px; }
html.portrait .endturn { right: 112px; bottom: 258px; }
html.portrait .hand { bottom: 8px; }
html.portrait .world-screen { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) auto; }
html.portrait .world-map { margin: 6px 10px; }
html.portrait .world-info { margin: 0 10px 10px; max-height: 300px; overflow-y: auto; }
/* landscape phone: a shorter hand area gives the stage (and the hero's head) room */
html.fitted:not(.portrait) .hand-area { height: 214px; }
html.fitted:not(.portrait) .hand { height: 200px; bottom: 0; }
html.fitted:not(.portrait) .pile { bottom: 8px; }
html.fitted:not(.portrait) .energy { left: 100px; bottom: 56px; }
html.fitted:not(.portrait) .endturn { bottom: 92px; }
html.fitted:not(.portrait) .topbar { padding: 4px 12px; }
html.fitted:not(.portrait) .pause-menu-btn { bottom: 64px; }
/* shop on a phone: merchant on top, the three cards in a row, the other wares one per row, Leave always in reach */
html.fitted .shop-screen .shop-body { flex: none; min-height: 0; }
html.fitted .shop-leave { position: sticky; bottom: 0; z-index: 6; padding-top: 12px; background: linear-gradient(#0000, #000d 45%); }
html.portrait .shop-body { flex-direction: column; justify-content: flex-start; gap: 12px; padding: 8px 12px 6px; }
html.portrait .merchant { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 4px 14px; }
html.portrait .merchant img { height: 120px; }
html.portrait .merchant b { flex-basis: 100%; text-align: center; }
html.portrait .bubble { max-width: 320px; font-size: 16px; }
html.portrait .bubble::after { display: none; }
html.portrait .wares { width: 100%; gap: 14px; align-items: center; }
html.portrait .shelf.cards { gap: 12px 14px; flex-wrap: wrap; max-width: 350px; margin: 0 auto; }
html.portrait .shelf.extras { flex-direction: column; align-items: stretch; flex-wrap: nowrap; max-width: none; width: 100%; gap: 8px; }
html.portrait .shelf.extras .ware { width: 100%; }

/* layered backdrops (public/backdrops.js, docs/BACKDROPS.md): the floor strip is the bottom --floor of the stage, the units' feet are --feet above the bottom edge */
.bd { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bd > div { position: absolute; }
/* back: the picture once, at the stage's full height (horizon at the bottom), centred; its sides fade into a gradient made from its own edge colours */
.bd-back { -webkit-mask-image: linear-gradient(#000 78%, #0000); mask-image: linear-gradient(#000 78%, #0000); left: -4%; right: -4%; top: 0; bottom: calc(var(--floor) - 5%); background: var(--sky); animation: bd-sway 70s ease-in-out -35s infinite alternate; }
.bd-back i { position: absolute; left: 50%; top: 0; height: 100%; aspect-ratio: 16 / 9; transform: translateX(-50%); background: var(--back) center bottom / 100% 100% no-repeat; -webkit-mask-image: linear-gradient(90deg, #0000, #000 22%, #000 78%, #0000); mask-image: linear-gradient(90deg, #0000, #000 22%, #000 78%, #0000); }
/* mid: the picture at full height, its left half pinned to the left edge and its right half to the right edge (the middle of it is empty anyway) */
.bd-mid { left: -1.2%; right: -1.2%; top: 4%; bottom: calc(var(--floor) - 3%); container-type: size; animation: bd-sway-mid 46s ease-in-out -23s infinite alternate; }
.bd-mid b { -webkit-mask-image: linear-gradient(#000 80%, #0000); mask-image: linear-gradient(#000 80%, #0000); position: absolute; bottom: 0; height: 100%; width: calc(100cqh * 16 / 9 / 2); background: var(--mid) no-repeat; background-size: auto 100%; }
.bd-mid b.l { left: 0; background-position: left bottom; }
.bd-mid b.r { right: 0; background-position: right bottom; }
.bd-floor { left: 0; right: 0; bottom: 0; height: var(--floor); background: var(--floorpic) center top / cover; -webkit-mask-image: linear-gradient(#0000, #000 16%); mask-image: linear-gradient(#0000, #000 16%); }
/* a flame sprite on a spot of the mid picture: 900 picture pixels = the layer's height (cqh), so one picture pixel = 100cqh / 900 */
.bd-flame { position: absolute; left: calc(var(--fx, 0) * 100cqh / 900); bottom: calc(var(--fy) * 100cqh / 900); width: calc(var(--fw) * 100cqh / 900); height: calc(var(--fh) * 100cqh / 900); transform: translateX(-50%); background-repeat: no-repeat; background-size: calc(var(--frames) * 100%) 100%; animation: bd-frames var(--dur) steps(var(--frames)) var(--wait) infinite; }
.bd-flame[style*="--fr"] { left: auto; right: calc(var(--fr) * 100cqh / 900); transform: translateX(50%); }
.bd[data-bd="forest"] .bd-floor { -webkit-mask-image: linear-gradient(#0000, #000 42%); mask-image: linear-gradient(#0000, #000 42%); }
.stage:has(.bd) .unit .shadow { left: -14%; right: -14%; height: 30px; bottom: -14px; background: radial-gradient(ellipse at center, #000f, #000c 38%, #0007 58%, transparent 75%); }
.bd[data-bd="shadow"] .bd-floor { filter: brightness(1.45) contrast(1.06); }
.bd[data-bd="dungeon"] .bd-floor { filter: brightness(1.25); }
.bd-haze { left: 0; right: 0; bottom: calc(var(--floor) - 2%); height: 18%; background: linear-gradient(#0000, color-mix(in srgb, var(--fog) 15%, transparent) 55%, #0000); }
.bd-amb { inset: 0; }
.bd-amb i { position: absolute; background: var(--amb) 0 0 / calc(var(--frames) * 100%) 100% no-repeat; opacity: .95; animation: bd-frames var(--dur) steps(var(--frames)) var(--wait) infinite, bd-drift var(--drift) ease-in-out var(--wait) infinite alternate; }
@keyframes bd-sway { from { transform: translate3d(-0.8%, 0, 0); } to { transform: translate3d(0.8%, 0, 0); } }
@keyframes bd-sway-mid { from { transform: translate3d(-1.2%, 0, 0); } to { transform: translate3d(1.2%, 0, 0); } }
/* the strip steps through its frames: the last frame sits at 100% * N/(N-1) so steps(N) shows each cell once */
@keyframes bd-frames { to { background-position-x: calc(100% * var(--frames) / (var(--frames) - 1)); } }
@keyframes bd-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(var(--dx), var(--dy), 0); } }
@media (prefers-reduced-motion: reduce) { .bd-back, .bd-mid, .bd-amb i, .bd-flame { animation: none; } .bd-amb { display: none; } }
/* a layered scene has a drawn floor, so the old "darken the bottom half" vignette is much lighter on it */
.stage:has(.bd)::after { background: radial-gradient(ellipse at 50% 58%, transparent 55%, #000a 100%), linear-gradient(#0a0615aa, #0000 22%); }
.stage:has(.bd) .ground::before { height: 40px; background: linear-gradient(#0000, #0506 75%); }

/* --- icon pictures (public/icons.js): sized in em from the emoji they replace; the emoji stays as the fallback --- */
.gi { width: 1.2em; height: 1.2em; object-fit: contain; image-rendering: auto; vertical-align: -.25em; display: inline-block; pointer-events: none; }
.intent .gi { width: 1.1em; height: 1.1em; vertical-align: -.2em; }
.event-ico .gi, .event-icon .gi { width: 1.7em; height: 1.7em; vertical-align: middle; }
.place .pico .gi { width: 1.5em; height: 1.5em; vertical-align: middle; }
.btn .gi, .pause-menu-btn .gi { width: 1.7em; height: 1.7em; vertical-align: middle; }

/* a phone-width stage: the intent pills are smaller so the outermost ones stay on screen */
@media (max-width: 600px) { .coop-battle .intent { transform: scale(.78); transform-origin: 50% 100%; } .coop-battle .ename { font-size: 11px; letter-spacing: 0; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* layered backdrops on the non-battle screens (title, event, town, shop; docs/BACKDROPS.md "Screens"): back + mid + haze + ambient, no floor.
   The layers sit behind the screen's content AND its dimming ::before (z-index -1 inside an isolated screen); the old JPG stays under them as the fallback. */
.has-bd { isolation: isolate; }
.bd-screen { z-index: -1; --floor: 0%; }
.bd-screen .bd-back { bottom: 0; -webkit-mask-image: linear-gradient(#000 72%, #0000); mask-image: linear-gradient(#000 72%, #0000); }
.bd-screen .bd-mid { top: 0; bottom: -2%; }
.bd-screen .bd-haze { bottom: 0; height: 38%; }
.has-bd.title-screen::before { background: #0004; }
.has-bd.event-screen::before { background: radial-gradient(ellipse at 50% 45%, #0006, #0009); }
.has-bd.town-screen::before { background: radial-gradient(ellipse at 50% 50%, #0002, #0008); }
.has-bd.shop-screen::before { background: linear-gradient(#0006, #1a0f0588); }
.shop-screen.has-bd { background: #0b0810; }   /* the back layer fades into dark, not into the old JPG's cobblestone */
/* co-op: what Zeppo and Old Marrow say to you (memory.js) */
.npc-says { font-style: italic; color: #e9dcc0; margin: 6px 0; line-height: 1.35; }
.npc-says b { font-style: normal; color: #f3c46b; }

/* The world chronicle (src/chronicle.js): what earlier runs changed */
.mark-line { color: #f3d98a; font-size: .92em; line-height: 1.35; margin: 6px 0; }
.shop-mark { text-align: center; width: 100%; }
.place .pmark { position: absolute; top: -6px; right: -6px; color: #f3d98a; font-size: 14px; text-shadow: 0 0 6px #000, 0 0 10px #f3d98a88; pointer-events: none; }
.place.changed .pico { box-shadow: 0 0 0 2px #f3d98a88, 0 0 12px #f3d98a55; border-radius: 50%; }
.since-journey h2 { margin: 0; }
.since-list { list-style: none; padding: 0; margin: 0; max-width: 560px; display: flex; flex-direction: column; gap: 10px; }
.since-list li { background: #ffffff10; border: 1px solid #f3d98a44; border-radius: 10px; padding: 10px 14px; line-height: 1.4; }
.since-list b { color: #f3d98a; }

/* The living map (src/roamers.js): roamers on the roads and lairs' threat clocks */
.roamer { position: absolute; transform: translate(-50%, -50%); z-index: 3; width: 30px; height: 30px; border-radius: 50%; background: #0b0d16dd; border: 2px solid #c9d2e6aa; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px #000c; pointer-events: auto; }
.roamer img, .roamer .ico { width: 22px; height: 22px; }
.roamer-pack { border-color: #ff8da0; }
.roamer-hunter { border-color: #ff5a6e; animation: roamer-pulse 1.6s ease-in-out infinite; }
.roamer-caravan { border-color: #f3d98a; }
@keyframes roamer-pulse { 50% { box-shadow: 0 0 14px #ff5a6e; } }
.place .threat { display: block; width: 42px; height: 5px; border-radius: 3px; background: #0008; border: 1px solid #ffffff33; overflow: hidden; }
.place .threat i { display: block; height: 100%; background: linear-gradient(90deg, #f3d98a, #ff5a6e); }
.place .threat.full { border-color: #ff5a6e; box-shadow: 0 0 6px #ff5a6e; }
.roads-list { margin-top: 8px; padding: 8px 10px; border: 1px solid #f3d98a44; border-radius: 8px; background: #ffffff08; font-size: 13px; }
.road-row { margin-top: 6px; } .road-row img, .road-row .ico { width: 18px; height: 18px; vertical-align: middle; } .road-row small { opacity: .75; }

/* Day and night, weather, the walking hero (src/sky.js, docs/WORLD.md The living map) */
.world-map::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 50% 40%, #0a1a4a33, #050a2499 80%); mix-blend-mode: multiply; opacity: 0; transition: opacity .8s; }
.world-map.night::after { opacity: 1; }
.world-map.night { box-shadow: inset 0 0 160px #0b1640cc; }
.world-map.night .place.town .pico, .world-map.night .place.camp .pico { box-shadow: 0 0 26px #ffbf5c99, 0 4px 14px #000a; }
.sky-night { color: #9fb6ff; } .sky-day { color: #f3d98a; }
.wx-fog { color: #c9d2dc; } .wx-snow { color: #e8f4ff; } .wx-clear { color: #f3d98a; }
.fog { position: absolute; width: 0; height: 0; z-index: 3; pointer-events: none; }
.fog i { position: absolute; left: -110px; top: -70px; width: 220px; height: 140px; border-radius: 50%; background: radial-gradient(ellipse, #d8dee6cc, #c8d0da55 45%, transparent 70%); filter: blur(6px); animation: fogdrift 9s ease-in-out infinite alternate; }
.fog i:nth-child(2) { left: -150px; top: -40px; width: 200px; animation-duration: 12s; animation-delay: -4s; opacity: .8; }
.fog i:nth-child(3) { left: -40px; top: -90px; width: 190px; animation-duration: 10s; animation-delay: -7s; opacity: .7; }
@keyframes fogdrift { from { transform: translateX(-18px); } to { transform: translateX(18px); } }
.snowfall { position: absolute; width: 0; height: 0; z-index: 3; pointer-events: none; }
.snowfall i { position: absolute; top: -100px; width: 5px; height: 5px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px #fff; opacity: .9; animation: snowfall 3.2s linear infinite; }
.snowfall::before { content: ''; position: absolute; left: -120px; top: -110px; width: 240px; height: 200px; border-radius: 50%; background: radial-gradient(ellipse, #eef6ff55, #dfeaff22 50%, transparent 72%); }
@keyframes snowfall { from { transform: translate(0, 0); opacity: 0; } 15% { opacity: .9; } to { transform: translate(-18px, 190px); opacity: 0; } }
.party.face-left .sprite { transform: translateX(-50%) scaleX(-1); }
.party.walking .sprite { animation: heroStep .33s ease-in-out infinite; }
.party.face-left.walking .sprite { animation-name: heroStepLeft; }
@keyframes heroStep { 0%, 100% { transform: translateX(-50%) translateY(0) rotate(0); } 25% { transform: translateX(-50%) translateY(-5px) rotate(-3deg); } 75% { transform: translateX(-50%) translateY(-5px) rotate(3deg); } }
@keyframes heroStepLeft { 0%, 100% { transform: translateX(-50%) scaleX(-1) translateY(0) rotate(0); } 25% { transform: translateX(-50%) scaleX(-1) translateY(-5px) rotate(-3deg); } 75% { transform: translateX(-50%) scaleX(-1) translateY(-5px) rotate(3deg); } }
.stage.night { box-shadow: inset 0 0 0 4000px #08103a66, inset 0 0 200px #000c; } /* an inset shadow paints over the backdrop and under every unit */
.service.shut { opacity: .75; } .service.shut b { color: #9fb6ff; }

/* ---- talents (src/talents.js) and Renown (src/renown.js), stage 4 of the world rework ---- */
.talents { justify-content: flex-start; gap: 10px; z-index: 45; background: #0b0914f2; }
.talents h2 { margin: 0; color: var(--gold); }
.talents > p { margin: 0; max-width: 820px; text-align: center; }
.tree { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; max-width: 1100px; }
.branch { flex: 1 1 300px; max-width: 350px; background: #15121fe6; border: 1px solid #5a4d78; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.branch.wayfarer { border-color: #6f8f6a; }
.branch h3 { margin: 0; color: var(--gold); display: flex; justify-content: space-between; }
.branch h3 small { color: var(--dim); font-weight: normal; }
.branch > p { margin: 0 0 4px; font-size: 13px; }
.trow { display: flex; gap: 6px; align-items: stretch; }
.trow > i { font-style: normal; width: 18px; flex: none; color: var(--dim); font-size: 12px; align-self: center; text-align: center; }
.talent { flex: 1; text-align: left; background: #ffffff08; border: 1px solid #ffffff22; border-radius: 8px; padding: 6px 8px; color: var(--dim); display: flex; flex-direction: column; gap: 2px; font: inherit; font-size: 12.5px; line-height: 1.3; cursor: default; }
.talent b { color: #cfc6e4; font-size: 13.5px; }
.talent small { color: #b9a6ff; }
.talent.held { background: #3a2c5ccc; border-color: var(--gold); color: #e9e2f8; }
.talent.held b { color: var(--gold); }
.talent.open { border-color: #9be09b; color: #e9e2f8; cursor: pointer; box-shadow: 0 0 10px #9be09b44; }
.talent.open:hover { background: #2a3a2acc; }
.talent.planned { border-style: dashed; border-color: #b9a6ff88; }
.talent.locked { opacity: .55; }
.talent.capstone { border-width: 2px; }
.ult-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.talents-btn .dot { color: #9be09b; }
.renown .since-list li.dim { opacity: .6; }
@media (max-width: 700px) { .branch { max-width: none; } }
.talents-chip { position: relative; }
.talents-chip b { position: absolute; right: -4px; bottom: -6px; font-size: 11px; color: var(--gold); text-shadow: 0 0 3px #000; }

/* ---------- start screen and hero select (main menu, 2026-11-15) ---------- */
.start-screen { gap: 0; justify-content: center; }
.start-head { display: flex; flex-direction: column; align-items: center; margin-bottom: 34px; }
.start-screen h1 { font-size: 96px; }
.start-screen .tagline { font-size: 21px; letter-spacing: .12em; font-style: italic; color: #cdbfe0; text-shadow: 0 2px 8px #000; margin: 4px 0 0; }
.start-menu { display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: min(440px, 92vw); }
.start-menu .btn.big { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 22px; font-size: 22px; background: linear-gradient(#2b2440f2, #1b1629f2); }
.start-menu .btn.big.primary { background: linear-gradient(#7a5a1e, #4d3811); box-shadow: 0 0 26px #d9b45b44; }
.start-menu .btn.big small { font-family: var(--body); font-size: 15px; letter-spacing: .02em; color: #cdbfe0; text-transform: none; }
.start-row { display: flex; gap: 10px; margin-top: 6px; }
.start-row .btn { flex: 1; padding: 9px 8px; font-size: 14px; background: linear-gradient(#211b33e6, #15111fe6); }
.start-row .btn b { color: var(--gold); margin-left: 4px; }
.start-row .btn small { display: block; font-size: 11px; color: var(--dim); letter-spacing: .04em; }
.start-settings { display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--edge); border-radius: 8px; background: #120f1cd9; }
.start-settings[hidden] { display: none; }
.btn.link, .acct-btn.link { background: none; border: 0; color: #b9aed0; font-family: var(--body); font-size: 16px; margin-top: 22px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.acct-btn.link:hover { color: var(--gold); }
.acct-btn.link b { color: var(--gold); font-weight: 600; }
.btn:focus-visible, .class-card:focus-visible, .acct-btn.link:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.hero-select { gap: 14px; }
.hs-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: min(860px, 94vw); }
.hs-head h2 { margin: 0; font-size: 40px; letter-spacing: .14em; text-align: center; text-shadow: 0 0 20px #d9b45b66, 0 3px 0 #000; }
.hs-head .back { justify-self: start; }
.hero-select .ctitle { font-style: italic; color: #cdbfe0; }
.hero-select .mutators { padding: 10px 18px; border: 1px solid var(--edge); border-radius: 8px; background: #120f1cd9; font-size: 15px; color: #cdbfe0; color-scheme: dark; }
.hero-select .mutators select { background: #1b1629; color: inherit; border: 1px solid var(--edge); border-radius: 6px; padding: 4px 8px; font-family: var(--serif); }
.hs-warn { color: #e8a87c; font-style: italic; margin: 0; text-shadow: 0 2px 6px #000; }
html.portrait .start-screen h1 { font-size: 46px; }
html.portrait .start-row { flex-wrap: wrap; }
html.portrait .start-row .btn { flex: 1 1 40%; }
html.portrait .hs-head h2 { font-size: 26px; letter-spacing: .08em; }
html.fitted.portrait .start-menu .btn.big { min-height: 84px; }

/* review fixes (Eclipse visual review with ChatGPT, Gemini and Grok, 2026-11-15) */
.start-menu { width: min(480px, 92vw); }
.start-row .btn { white-space: nowrap; font-size: 13px; letter-spacing: .04em; }
.start-screen .tagline { color: #e2d8f2; text-shadow: 0 0 12px #000, 0 2px 6px #000; }
.start-head { position: relative; }
.start-head::before { content: ''; position: absolute; inset: -30px -80px; background: radial-gradient(ellipse, #0009, transparent 70%); z-index: -1; pointer-events: none; }
.start-menu .btn.big small { color: #ddd2ee; font-size: 16px; }
.acct-btn.link { color: #d8cdea; font-size: 17px; text-shadow: 0 1px 6px #000; }
.settings-btn[aria-expanded="true"] { border-color: var(--gold); color: var(--gold); }
.hs-head .back { padding: 10px 22px; font-size: 16px; }
.hero-select .class-card { display: flex; flex-direction: column; align-items: center; cursor: pointer; background: linear-gradient(#1a1529f2, #0c0a14f5); border-width: 2px; }
.hero-select .class-card:focus-visible { outline: none; }
.hero-select .class-card.on { border-color: var(--c); box-shadow: 0 0 0 2px var(--c), 0 0 40px color-mix(in srgb, var(--c) 70%, transparent), 0 10px 36px #000a; transform: translateY(-8px); }
.hero-select .class-card.on::before { opacity: 1; }
.hero-select .class-card:not(.on) { filter: saturate(.75) brightness(.85); }
.hero-select .class-card:not(.on):hover { filter: none; }
.hero-select .class-card h3 { min-height: 2.5em; display: flex; align-items: center; justify-content: center; line-height: 1.2; margin-top: 2px; }
.hero-select .class-card .stage-sprite .layer { clip-path: inset(2px 0 0 0); } /* the sheet's row above bleeds a dark line onto the frame's top edge when scaled */
.hero-select .ctitle { margin: 0; }
.hs-role { position: relative; align-self: center; padding: 2px 12px; border: 1px solid var(--c); border-radius: 999px; font-family: var(--serif); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--c); background: #0008; }
.hero-select .hook { color: #e4dbf0 !important; font-size: 16px; line-height: 1.25; margin: 6px 0 4px !important; min-height: 2.5em; }
.hero-select .stats { color: #c9bedb !important; font-size: 15px; }
/* five or six heroes: still one row on a wide screen, with narrower cards and smaller stages; rows of three on a phone */
.hero-select .classes:has(> .class-card:nth-child(5)) { gap: 14px; }
.hero-select .classes:has(> .class-card:nth-child(5)) .class-card { width: 190px; padding: 12px 10px 14px; }
.hero-select .classes:has(> .class-card:nth-child(5)) .stage-sprite { height: 160px; }
.hero-select .classes:has(> .class-card:nth-child(5)) .hook { font-size: 14px; }
.diff { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 13px; color: #b9aed0 !important; }
.diff i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--c); }
.diff i.on { background: var(--c); }
.diff span { margin-left: 6px; }
.hs-foot { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 6px; }
.hero-select .mutators { align-items: center; }
.hero-select .mutators label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.hero-select .mutators small { color: #b9aed0; }
.hero-select .mutators input[type=checkbox] { accent-color: var(--gold); width: 18px; height: 18px; }
.hero-select .mutators select:disabled { opacity: .6; }
.asc-note { width: 100%; text-align: center; color: #a99fc0; font-style: italic; }
.btn.begin { min-width: 320px; display: flex; flex-direction: column; align-items: center; padding: 12px 30px; font-size: 22px; box-shadow: 0 0 30px color-mix(in srgb, var(--c, #d9b45b) 50%, transparent); }
.btn.begin small { font-family: var(--body); font-size: 15px; color: #f1e6c8; letter-spacing: .03em; }
/* phones: bigger words, the run options stacked */
html.portrait .hero-select .classes { gap: 12px; }
html.portrait .hero-select .class-card { width: 46%; min-width: 0; padding: 10px 8px 12px; }
html.portrait .hero-select .stage-sprite { height: 170px; }
html.portrait .hero-select .mutators { flex-direction: column; gap: 6px; width: 92%; }
html.fitted.portrait .start-row .btn { font-size: 17px; }
html.fitted.portrait .start-menu .btn.big span { font-size: 26px; }
html.fitted.portrait .start-menu .btn.big small, html.fitted.portrait .start-screen .tagline { font-size: 18px; }
html.fitted.portrait .acct-btn.link { font-size: 19px; }
html.fitted.portrait .start-settings { font-size: 18px; }
html.fitted.portrait .hero-select .class-card h3 { font-size: 22px; }
html.fitted.portrait .hero-select .hook, html.fitted.portrait .hero-select .stats { font-size: 18px; }
html.fitted.portrait .hero-select .ctitle { font-size: 17px; }
html.fitted.portrait .btn.begin { width: 92%; min-height: 96px; font-size: 26px; }
.hs-role { z-index: 2; }
html.portrait .hs-head { grid-template-columns: auto 1fr; gap: 10px; }
html.portrait .hs-head .hs-pad { display: none; }
html.portrait .hs-head .back { padding: 8px 14px; white-space: nowrap; }
/* short windows (a laptop): the cards and the Begin button fit without scrolling */
@media (max-height: 820px) {
  html:not(.portrait) .hero-select { gap: 8px; }
  html:not(.portrait) .hero-select .stage-sprite { height: 180px; }
  html:not(.portrait) .hero-select .hook { min-height: 0; }
  html:not(.portrait) .hero-select .mutators { padding: 6px 14px; }
  html:not(.portrait) .hs-foot { gap: 8px; margin-top: 0; }
}
/* phones: three small cards in one row; the picked hero's line shows under them instead of inside each card */
.hs-detail { display: none; }
html.portrait .hero-select .classes { flex-wrap: nowrap; gap: 8px; width: 96%; }
html.portrait .hero-select .class-card { width: 33%; flex: 1 1 0; padding: 8px 4px 10px; }
html.portrait .hero-select .stage-sprite { height: 150px; }
html.portrait .hero-select .hook, html.portrait .hero-select .diff, html.portrait .hero-select .ctitle { display: none; }
html.portrait .hs-role { font-size: 11px; padding: 1px 6px; letter-spacing: .06em; }
html.fitted.portrait .hero-select .class-card h3 { font-size: 17px; min-height: 2.6em; }
html.fitted.portrait .hero-select .stats { font-size: 15px; }
html.portrait .hs-detail { display: block; margin: 0; width: 92%; text-align: center; font-size: 19px; color: #e4dbf0; line-height: 1.3; text-shadow: 0 2px 6px #000; }
html.portrait .hs-detail span { display: block; font-size: 16px; color: #b9aed0; font-style: italic; }
html.portrait .hs-head h2 { font-size: 24px; }
html.portrait .hero-select .mutators label small { display: block; }
/* five or six heroes on a phone: rows of three */
html.portrait .hero-select .classes:has(> .class-card:nth-child(5)) { flex-wrap: wrap; justify-content: center; row-gap: 8px; }
html.portrait .hero-select .classes:has(> .class-card:nth-child(5)) .class-card { flex: 0 0 31%; width: 31%; }
html.portrait .hero-select .classes:has(> .class-card:nth-child(5)) .stage-sprite { height: 120px; }
.status.ammo.empty { color: #8a96a6; opacity: .75; }

/* Hero battle lines (src/herolines.js) and the once-only hero intro */
.herobark { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 240px; font-size: 15px; z-index: 6; pointer-events: none; animation: barkIn .25s ease-out; transition: opacity .4s; }
.herobark.out { opacity: 0; }
@keyframes barkIn { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
.hero-intro { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(6, 8, 14, .92); padding: 16px; }
.hero-intro .hi-card { max-width: 620px; width: 100%; border: 2px solid var(--c); border-radius: 12px; background: #141a26; padding: 22px 24px; color: #e9e2cf; }
.hero-intro small { color: var(--c); letter-spacing: .08em; text-transform: uppercase; }
.hero-intro .hi-set { font-style: italic; color: #9fb0c8; min-height: 3em; }
.hero-intro .hi-line { font-size: 21px; min-height: 2.6em; }
.hero-intro .hi-line b { color: var(--c); margin-right: 8px; }
.hero-intro .hi-nav { display: flex; justify-content: space-between; gap: 12px; }

/* the impact frame of a hit: one tick of pure white over the sprite (src/poses.js impactFlashMs) */
.sprite.impact .layer { filter: brightness(0) invert(1); }

/* the necromancer's thralls: smaller units beside the hero */
.unit.thrall .ename { font-size: 11px; opacity: .85; white-space: nowrap; }
.unit.thrall .statuses { display: none; }
