:root {
  --bg: #140c10; --ink: #fbf1dc; --mute: #c9b89a; --panel: #2a1a16; --panel2: #3a2620; --line: #6a4632; --gold: #ffc94a; --go: #4fbf5a; --go2: #2f8a3a;
  --bad: #ff6a5a; --crys: #8fd8ff; --pixel: "Jersey 15", "Pixelify Sans", monospace; --sans: "IBM Plex Sans", system-ui, sans-serif;
  --common: #c9c3b5; --rare: #5ab0ff; --epic: #c07aff; --legendary: #ffc94a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 19px/1.4 var(--sans); overflow: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
#app { position: fixed; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
[hidden] { display: none !important; }
.screen { position: absolute; inset: 0; }
canvas { image-rendering: pixelated; display: block; }
.ico { width: 20px; height: 20px; image-rendering: pixelated; vertical-align: -4px; object-fit: contain; }
.ico.big { width: 44px; height: 44px; }

/* buttons */
button { background: linear-gradient(#5a3a2c, #3a2620); border: 2px solid #1a0e0a; box-shadow: inset 0 1px 0 #8a6448, 0 2px 0 #0008; border-radius: 8px; padding: 7px 14px; font-family: var(--pixel); font-weight: 400; font-size: 21px; line-height: 1.1; letter-spacing: .03em; transition: transform .08s, filter .15s; }
button:hover { filter: brightness(1.15); } button:active { transform: translateY(1px); }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
button.go { background: linear-gradient(#6ad06a, #2f8a3a); box-shadow: inset 0 1px 0 #b8ffb0, 0 2px 0 #0008; text-shadow: 0 1px 0 #0a3a10; }
button.gem { background: linear-gradient(#6ac0f0, #2a6ab0); box-shadow: inset 0 1px 0 #c8f0ff, 0 2px 0 #0008; }
button.danger { background: linear-gradient(#d0503a, #8a2a1a); }
button.big { font-size: 22px; padding: 12px 22px; }
button:disabled { filter: grayscale(.8) brightness(.7); cursor: default; }
.cost { display: inline-flex; gap: 8px; flex-wrap: wrap; } .c { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; } .c.short { color: var(--bad); }

/* title */
#title-screen { display: grid; place-items: center; }
.title-bg { position: absolute; inset: 0; background: center/cover;   /* the picture: data-asset-bg in index.html (the asset store) */ image-rendering: pixelated; filter: brightness(.55) saturate(1.1); animation: pan 40s ease-in-out infinite alternate; }
@keyframes pan { from { transform: scale(1.15) translate(-3%, 2%); } to { transform: scale(1.25) translate(3%, -2%); } }
.title-box { position: relative; text-align: center; padding: 28px 36px; background: #140c10cc; border: 3px solid var(--line); border-radius: 14px; box-shadow: 0 10px 40px #000a; max-width: 92vw; }
.title-box h1 { font: clamp(44px, 9vw, 84px)/1 var(--pixel); margin: 6px 0; color: var(--gold); text-shadow: 0 4px 0 #8a3a10, 0 8px 18px #000; }
.title-box small { color: var(--mute); letter-spacing: .2em; text-transform: uppercase; font-size: 14px; }
.chapter { font: 22px var(--pixel); margin: 0 0 20px; color: #ffb37a; }
.loadbar { width: 260px; height: 12px; background: #000; border: 2px solid var(--line); border-radius: 6px; overflow: hidden; margin: 0 auto 6px; } .loadbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb13d, #ffe08a); transition: width .2s; }
#title-start { animation: pulse 1.4s ease-in-out infinite; } @keyframes pulse { 50% { transform: scale(1.05); } }

/* town */
#town { width: 100%; height: 100%; touch-action: none; cursor: grab; }

/* HUD */
.hud { position: absolute; top: 0; left: 0; right: 0; display: flex; gap: 8px; align-items: flex-start; padding: max(8px, env(safe-area-inset-top)) 10px 0; pointer-events: none; z-index: 5; }
.res { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; pointer-events: auto; }
.pill { display: inline-flex; align-items: center; gap: 4px; background: #1a0e0ae6; border: 2px solid var(--line); border-radius: 999px; padding: 2px 10px 2px 4px; font: 17px var(--pixel); }
.pill small { color: var(--mute); font-weight: 500; font-size: 14px; } .pill.full b { color: var(--gold); } .pill .regen { color: var(--crys); margin-left: 4px; }
.gear { pointer-events: auto; width: 40px; height: 40px; padding: 0; font-size: 22px; border-radius: 50%; }
.quest { position: absolute; left: 10px; top: 92px; max-width: min(320px, 70vw); background: #1a0e0ae6; border: 2px solid var(--line); border-left: 5px solid var(--gold); border-radius: 8px; padding: 6px 10px; z-index: 4; display: grid; gap: 2px; }
.quest small { color: var(--gold); font: 14px var(--pixel); letter-spacing: .05em; } .quest .qr { display: flex; gap: 8px; align-items: center; color: var(--mute); font-size: 15px; }
.quest.done { border-left-color: var(--go); box-shadow: 0 0 0 2px #4fbf5a66, 0 0 18px #4fbf5a55; }
.claim { background: linear-gradient(#6ad06a, #2f8a3a); padding: 3px 10px; animation: pulse 1s infinite; }
.nav { position: absolute; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 8px; z-index: 5; }
.nav button { display: grid; justify-items: center; gap: 2px; min-width: 76px; padding: 6px 10px; font-size: 16px; }
.nav button img { width: 30px; height: 30px; image-rendering: pixelated; }
.nav .adv { background: linear-gradient(#ff9a4a, #c04a1a); box-shadow: inset 0 1px 0 #ffd0a0, 0 2px 0 #0008; min-width: 110px; font-size: 18px; }
.placebar { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 10px; align-items: center; background: #1a0e0af0; border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; z-index: 6; font-family: var(--pixel); }
.placebar small { color: var(--mute); font-family: var(--sans); }
.bpanel { position: absolute; left: 50%; bottom: max(84px, calc(env(safe-area-inset-bottom) + 76px)); transform: translateX(-50%); width: min(560px, 94vw); background: #23150fef; border: 3px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; z-index: 6; box-shadow: 0 8px 30px #000a; }
.bp-head { display: flex; align-items: center; gap: 10px; } .bp-head h3 { margin: 0; font: 22px var(--pixel); color: var(--gold); } .lvl { color: var(--mute); font-size: 15px; }
.x { margin-left: auto; padding: 0; width: 38px; height: 38px; flex: none; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; line-height: 1; }
.panel > .x { position: absolute; top: 10px; right: 10px; }
.desc { margin: 4px 0; color: var(--mute); font-size: 16px; } .info { margin: 4px 0; font-size: 16px; } .why { color: var(--bad); margin: 4px 0; font-size: 15px; }
.bp-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; } .bp-row.center { justify-content: center; }
.bp-row button { display: inline-flex; align-items: center; gap: 4px; }

/* modals */
.modal { position: absolute; inset: 0; background: #0a0608b0; display: grid; place-items: center; z-index: 20; padding: 12px; backdrop-filter: blur(2px); }
.panel { position: relative; background: linear-gradient(#2e1d17, #22140f); border: 3px solid var(--line); border-radius: 14px; padding: 16px 18px; width: min(520px, 100%); max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); overflow: auto; box-shadow: 0 12px 50px #000c, inset 0 1px 0 #8a644855; animation: popin .18s ease-out; }
.panel.wide { width: min(980px, 100%); }
@keyframes popin { from { transform: scale(.94); opacity: 0; } }
.panel h2 { font: 26px var(--pixel); margin: 0 0 6px; color: var(--gold); } .panel h3 { font: 20px var(--pixel); margin: 16px 0 4px; }
.hint { color: var(--mute); font-size: 15px; margin: 4px 0 10px; }
.blist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.bcard, .dcard { display: grid; gap: 4px; justify-items: center; text-align: center; background: #1a0e0a; border: 2px solid var(--line); border-radius: 10px; padding: 10px; font-family: var(--sans); font-weight: 500; box-shadow: none; }
.bcard > img { width: 150px; height: 140px; object-fit: contain; image-rendering: pixelated; } .bcard b, .dcard b { font: 18px var(--pixel); } .bcard small { color: var(--mute); font-size: 14px; }
.bcard em { color: var(--bad); font-size: 14px; font-style: normal; } .locked { opacity: .55; }
.dlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; } .dcard > img { height: 64px; max-width: 90px; object-fit: contain; image-rendering: pixelated; } .dcard b { font-size: 15px; }

/* library */
.lib-recipe { display: flex; align-items: center; gap: 12px; background: #1a0e0a; border: 2px solid var(--line); border-radius: 10px; padding: 10px; flex-wrap: wrap; } .lib-recipe div { display: grid; flex: 1; } .lib-recipe small { color: var(--mute); }
.queue { display: flex; gap: 8px; } .queue .slot { width: 72px; height: 72px; border: 2px dashed var(--line); border-radius: 10px; display: grid; place-items: center; text-align: center; color: var(--mute); }
.queue .slot.busy { border-style: solid; background: #2a1a40; color: var(--ink); } .queue .slot .ico { width: 32px; height: 32px; }

/* heroes */
.hlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.hcard { display: grid; justify-items: center; gap: 2px; padding: 8px 6px; background: #1a0e0a; border: 2px solid var(--common); border-radius: 10px; font-family: var(--sans); font-weight: 500; box-shadow: none; position: relative; text-align: center; }
.hcard.r-rare { border-color: var(--rare); } .hcard.r-epic { border-color: var(--epic); } .hcard.r-legendary { border-color: var(--legendary); box-shadow: 0 0 12px #ffc94a44; }
.hcard .por { background: radial-gradient(#4a3a30, #1a0e0a); border-radius: 8px; display: block; } .hcard .por canvas { width: 72px; height: 72px; }
.hcard b { font: 18px/1.1 var(--pixel); } .hcard small { color: var(--mute); font-size: 14px; } .hcard .meta { display: flex; gap: 6px; align-items: center; }
.hcard.unowned canvas { filter: brightness(0) drop-shadow(0 0 2px #c9b89a88); } .hcard.unowned { opacity: .7; }
.hcard.picked { outline: 3px solid var(--go); background: #1a2a12; }
.hcard .soul { color: var(--crys); } .hcard .soul.ready { color: var(--go); font-weight: 700; } .pw { color: #ffb37a !important; }
.stars { letter-spacing: -1px; font-size: 15px; } .stars i { font-style: normal; color: #4a3a30; } .stars i.on { color: var(--gold); text-shadow: 0 0 4px #ffb13d; }
.panel.hero { padding-top: 46px; } .back { position: absolute; left: 12px; top: 10px; padding: 4px 10px; }
.hd { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 18px; }
.hd-left { display: grid; gap: 10px; align-content: start; }
.stagebox { background: radial-gradient(ellipse at 50% 85%, color-mix(in srgb, var(--sp) 40%, transparent), transparent 60%), linear-gradient(#3a2a40, #1a1018); border: 2px solid var(--line); border-radius: 12px; display: grid; place-items: center; overflow: hidden; height: 260px; }
.hero-sprite { height: 250px; width: auto; }
.cardart { width: 100%; border-radius: 10px; border: 2px solid var(--line); }
.hd-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; } .hd-title h2 { margin: 0; width: 100%; } .hd-title small { color: var(--mute); }
.rar { font: 15px var(--pixel); padding: 1px 8px; border-radius: 99px; background: #0006; } .rar.r-legendary { color: var(--legendary); } .rar.r-epic { color: var(--epic); } .rar.r-rare { color: var(--rare); }
.lvlrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; } .lvlrow small { color: var(--mute); }
.xp { flex: 1; min-width: 120px; height: 10px; background: #000; border: 2px solid var(--line); border-radius: 5px; overflow: hidden; } .xp i { display: block; height: 100%; background: linear-gradient(90deg, #8a6af0, #c0a8ff); }
.statgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 8px 0; } .statgrid div { background: #1a0e0a; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; display: grid; }
.statgrid small { color: var(--mute); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; } .statgrid b { font: 20px var(--pixel); }
.skill, .abil { background: #1a0e0a; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; } .skill small, .abil > small { color: var(--gold); font: 14px var(--pixel); letter-spacing: .05em; text-transform: uppercase; }
.skill b { display: block; font: 20px var(--pixel); color: #ffe08a; } .skill p, .abil p { margin: 3px 0; font-size: 16px; } .abil b { color: #ffd0a0; } .abil em { color: var(--mute); font-size: 14px; }
.lore { font-style: italic; color: var(--mute); }

/* summon */
.portal { position: relative; display: grid; place-items: center; height: 260px; }
.portal img { height: 250px; image-rendering: pixelated; filter: drop-shadow(0 0 20px #8a6af0); }
.swirl { position: absolute; width: 180px; height: 80px; bottom: 50px; border-radius: 50%; background: conic-gradient(#8a6af0, #4fe0ff, #ff6af0, #8a6af0); filter: blur(14px); opacity: .55; animation: spin 3s linear infinite; mix-blend-mode: screen; }
@keyframes spin { to { transform: rotate(360deg); } }
.reveal { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; perspective: 900px; margin: 6px 0 12px; } .reveal.one { grid-template-columns: 220px; justify-content: center; }
.rcard { position: relative; aspect-ratio: 3/4; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3, 1.4, .5, 1); }
.rcard .back, .rcard .front { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 10px; border: 3px solid var(--common); }
.rcard .back { background: radial-gradient(#5a3a80, #1a0e2a); box-shadow: inset 0 0 20px #8a6af0; animation: shimmer 1s infinite alternate; }
@keyframes shimmer { to { box-shadow: inset 0 0 34px #c0a8ff; } }
.rcard .front { transform: rotateY(180deg); background: #1a0e0a; display: grid; grid-template-rows: 1fr auto auto; overflow: hidden; text-align: center; padding-bottom: 4px; }
.rcard .front > img { width: 100%; height: 100%; object-fit: cover; } .rcard .front b { font: 17px/1.1 var(--pixel); padding: 0 4px; } .rcard .front small { font-size: 13px; color: var(--crys); }
.rcard.flip { transform: rotateY(180deg); }
.rcard.r-rare .front { border-color: var(--rare); } .rcard.r-epic .front { border-color: var(--epic); box-shadow: 0 0 20px var(--epic); } .rcard.r-legendary .front { border-color: var(--legendary); box-shadow: 0 0 30px var(--legendary); }
.rcard.r-legendary.flip { animation: legend 1s .4s; } @keyframes legend { 30% { transform: rotateY(180deg) scale(1.15); } }

/* map */
#map-screen { background: #0e1418; display: grid; place-items: center; }
.map-wrap { position: absolute; inset: 0; display: grid; place-items: center; overflow: auto; }
.map { position: relative; width: min(100vw, 150vh); aspect-ratio: 511/341; }
.map > img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
#map-nodes { position: absolute; inset: 0; }
.road { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.road line { stroke-width: 6; stroke-linecap: round; vector-effect: non-scaling-stroke; } .road .open { stroke: #ffe08acc; stroke-dasharray: 2 10; } .road .shut { stroke: #0008; stroke-dasharray: 2 10; }
.node { position: absolute; transform: translate(-50%, -50%); z-index: 1; width: 46px; height: 46px; border-radius: 50%; padding: 0; display: grid; place-items: center; background: radial-gradient(#ffe08a, #c07a20); border: 3px solid #3a1a08; color: #3a1a08; font: 16px var(--pixel); box-shadow: 0 3px 0 #000a, 0 0 0 3px #ffe08a55; }
.node.boss { width: 62px; height: 62px; background: radial-gradient(#ff8a4a, #8a1a0a); border-color: #2a0a04; overflow: visible; } .node.boss canvas { width: 46px; height: 46px; border-radius: 50%; }
.node.locked { filter: grayscale(1) brightness(.55); }
.node.cleared { background: radial-gradient(#b0ffa0, #3a9a3a); }
.node.next { animation: beacon 1.2s infinite; } @keyframes beacon { 50% { box-shadow: 0 3px 0 #000a, 0 0 0 9px #ffe08a44, 0 0 24px #ffe08a; } }
.nstars { position: absolute; bottom: -28px; z-index: 2; left: 50%; transform: translateX(-50%); white-space: nowrap; background: #1a0e0af0; border: 2px solid #8a6a3a; border-radius: 10px; padding: 0 5px; line-height: 1.1; box-shadow: 0 2px 4px #000a; }
#map-nodes .nstars .stars { font-size: 24px; letter-spacing: 0; } .nstars .stars i { font-size: 24px; line-height: 1; color: #4a3a2e; -webkit-text-stroke: 1px #000; } .nstars .stars i.on { color: #ffd84a; text-shadow: 0 0 6px #ffb02a; }
.node.perfect .nstars { border-color: #ffd84a; box-shadow: 0 0 10px #ffc94a99, 0 2px 4px #000a; }
.node.home { width: auto; height: auto; border-radius: 8px; padding: 4px 10px; background: linear-gradient(#5a3a2c, #3a2620); color: var(--ink); border-color: var(--line); font-size: 15px; }
.map-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 12px; align-items: center; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, #000c); font-family: var(--pixel); }
.map-bar small { color: var(--mute); margin-left: auto; }
.st-head small { color: var(--mute); } .st-head h2 { margin: 0 0 2px; } .lbl { color: var(--gold); font: 15px var(--pixel); display: block; margin-top: 10px; }
.bossinfo { display: flex; gap: 10px; align-items: center; background: #3a1010; border: 2px solid #8a2a1a; border-radius: 10px; padding: 8px; margin: 8px 0; } .bossinfo canvas { border-radius: 8px; background: #000; } .bossinfo p { margin: 2px 0; font-size: 15px; } .bossinfo small { color: var(--mute); }
.foes { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; } .foe { display: grid; justify-items: center; width: 74px; text-align: center; } .foe canvas { background: #1a0e0a; border: 2px solid var(--line); border-radius: 8px; } .foe small { font-size: 13px; line-height: 1.1; color: var(--mute); }
.ok { color: var(--go); font-style: normal; } .warn { color: #ffb37a; font-style: normal; font-size: 14px; }

/* party */
.pslots { display: flex; gap: 8px; justify-content: center; margin: 4px 0 12px; }
.pslot { width: 74px; height: 86px; padding: 4px; display: grid; justify-items: center; align-content: center; border: 2px dashed var(--line); background: #1a0e0a; box-shadow: none; border-radius: 10px; font-family: var(--sans); } .pslot small { color: var(--mute); font-size: 13px; }
.pslot.full { border-style: solid; border-color: var(--go); }

/* results */
.panel.result { text-align: center; } .result h2 { font-size: 40px; } h2.win { color: var(--gold); } h2.lose { color: var(--bad); }
.bigstars .stars { font-size: 48px; letter-spacing: 4px; } .bigstars .stars i.on { animation: starpop .5s backwards; } .bigstars .stars i:nth-child(2) { animation-delay: .25s; } .bigstars .stars i:nth-child(3) { animation-delay: .5s; }
@keyframes starpop { from { transform: scale(2.5); opacity: 0; } }
.rewards { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin: 12px 0; font: 20px var(--pixel); } .rewards .ico { width: 28px; height: 28px; }
.rheroes { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; } .rh { display: grid; justify-items: center; } .rh canvas { background: #1a0e0a; border-radius: 8px; border: 2px solid var(--line); } .rh small { color: var(--mute); font-size: 14px; } .rh em { color: var(--go); font: 14px var(--pixel); font-style: normal; animation: pulse .8s infinite; }

/* story */
.modal.story { place-items: end center; background: linear-gradient(transparent 40%, #000c); backdrop-filter: none; z-index: 30; cursor: pointer; }
.dialog { display: flex; align-items: flex-end; gap: 14px; width: min(860px, 100%); margin-bottom: max(16px, env(safe-area-inset-bottom)); }
.spor canvas { height: min(240px, 34vh); width: auto; filter: drop-shadow(0 6px 10px #000); }
.stext { flex: 1; background: #1a0e0af2; border: 3px solid var(--line); border-radius: 12px; padding: 12px 16px; min-height: 120px; box-shadow: 0 8px 30px #000; }
.stext b { font: 20px var(--pixel); color: var(--gold); } .stext p { font-size: 19px; margin: 4px 0 6px; min-height: 3em; } .stext small { color: var(--mute); float: right; animation: pulse 1.2s infinite; }

/* settings */
.slider { display: flex; align-items: center; gap: 12px; margin: 10px 0; font-family: var(--pixel); } .slider input { flex: 1; accent-color: var(--gold); }
.credits { font-size: 14px; color: var(--mute); } .credits a { color: var(--crys); }

/* toasts */
.toasts { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); display: grid; gap: 6px; z-index: 40; pointer-events: none; justify-items: center; }
.toast { background: #1a0e0af2; border: 2px solid var(--line); border-radius: 8px; padding: 6px 14px; font: 17px var(--pixel); animation: popin .2s; transition: opacity .4s, transform .4s; }
.toast.good { border-color: var(--go); } .toast.bad { border-color: var(--bad); color: #ffd0c8; } .toast.out { opacity: 0; transform: translateY(-10px); }

/* battle */
#battle-screen { background: #000; display: grid; place-items: center; }
.battle-stage { position: relative; width: 100%; height: 100%; overflow: hidden; }
#gl { width: 100%; height: 100%; }
.overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ubar { position: absolute; height: 9px; transform: translate(-50%, -100%); background: #1a0e0a; border: 2px solid #000; border-radius: 3px; overflow: hidden; }
.ubar .hp { display: block; height: 5px; background: linear-gradient(#8aff7a, #3abf3a); transition: width .15s; } .ubar.foe .hp { background: linear-gradient(#ff8a7a, #d03a2a); }
.ubar .ar { display: block; height: 2px; background: #d8dde8; }
.pop { position: absolute; transform: translate(-50%, -50%); font: 22px var(--pixel); color: #fff; text-shadow: 0 2px 0 #000, 0 0 6px #000; white-space: nowrap; }
.pop.hurt { color: #ffb0a0; } .pop.crit { color: #ffe04a; font-size: 30px; } .pop.armor { color: #c8d4e8; font-size: 20px; } .pop.miss { color: #aaa; font-size: 20px; } .pop.heal { color: #8aff7a; } .pop.status { color: #ffd0ff; font-size: 18px; }
.btop { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; align-items: center; gap: 8px; }
.bwave { font: 20px var(--pixel); text-shadow: 0 2px 0 #000; background: #0008; padding: 2px 10px; border-radius: 8px; }
.bctl { margin-left: auto; display: flex; gap: 6px; } .bctl button { padding: 6px 12px; } .bctl .on { background: linear-gradient(#6ad06a, #2f8a3a); }
.bossbar { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); width: min(560px, 80vw); text-align: center; }
.bossbar b { font: 20px var(--pixel); color: #ffb37a; text-shadow: 0 2px 0 #000; } .bossbar .track { height: 14px; background: #1a0e0a; border: 2px solid #000; border-radius: 4px; overflow: hidden; box-shadow: 0 0 12px #ff5a2a88; }
.bossbar .fill { display: block; height: 100%; background: linear-gradient(#ff7a4a, #b0200a); transition: width .2s; }
.bskills { position: absolute; bottom: max(10px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.bskill { position: relative; width: 76px; height: 92px; padding: 0; border-radius: 12px; background: #1a0e0a; display: grid; justify-items: center; align-content: start; overflow: hidden; }
.bskill canvas { width: 64px; height: 64px; margin-top: 4px; border-radius: 8px; }
.bskill .ring { position: absolute; inset: 0; border-radius: 12px; background: conic-gradient(#ffe08a55 var(--p, 0%), #0000 0); pointer-events: none; }
.bskill .mhpw { width: 64px; height: 5px; background: #000; margin-top: 2px; } .bskill .mhp { display: block; height: 100%; background: #6ad06a; }
.bskill .nm { font: 10px/1.1 var(--pixel); padding: 1px 2px; color: var(--mute); text-align: center; }
.bskill.ready { border-color: #ffe08a; box-shadow: 0 0 16px #ffe08a, inset 0 0 12px #ffe08a88; animation: pulse .9s infinite; } .bskill.ready .nm { color: #ffe08a; }
.bskill.dead { filter: grayscale(1) brightness(.4); } .bskill:disabled { filter: none; } .bskill.dead:disabled { filter: grayscale(1) brightness(.4); }
.bbanner { position: absolute; top: 34%; left: 0; right: 0; text-align: center; pointer-events: none; animation: banner 1.7s ease-out forwards; }
.bbanner b { display: block; font: clamp(36px, 7vw, 72px)/1 var(--pixel); color: #fff; text-shadow: 0 4px 0 #000, 0 0 24px #000; } .bbanner span { font: 22px var(--pixel); color: var(--mute); text-shadow: 0 2px 0 #000; }
.bbanner.boss b, .bbanner.warn b { color: #ff7a4a; } .bbanner.win b { color: var(--gold); } .bbanner.lose b { color: var(--bad); } .bbanner.win span { color: var(--gold); font-size: 40px; }
@keyframes banner { 0% { transform: scale(1.6); opacity: 0; } 12% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
.bbanner.win { animation: banner-stay .6s ease-out forwards; } @keyframes banner-stay { 0% { transform: scale(1.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.cutin { position: absolute; top: 24%; left: 0; display: flex; align-items: center; gap: 12px; padding: 8px 40px 8px 16px; background: linear-gradient(90deg, #000d, #0000); pointer-events: none; animation: cutin 1.3s ease-out forwards; }
.cut-por canvas { width: 96px; height: 96px; border: 3px solid #ffe08a; border-radius: 12px; background: #3a2a40; } .cut-txt small { color: var(--mute); font: 16px var(--pixel); } .cut-txt b { display: block; font: 32px var(--pixel); color: #ffe08a; text-shadow: 0 3px 0 #000; }
@keyframes cutin { 0% { transform: translateX(-100%); } 15% { transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(30px); } }

@media (max-width: 760px) {
  .hd { grid-template-columns: 1fr; } .stagebox { height: 200px; } .hero-sprite { height: 190px; } .cardart { max-width: 240px; justify-self: center; }
  .statgrid { grid-template-columns: repeat(3, 1fr); }
  .reveal { grid-template-columns: repeat(3, 1fr); }
  .nav { gap: 5px; } .nav button { min-width: 0; padding: 5px 8px; font-size: 14px; } .nav .adv { min-width: 0; font-size: 15px; } .nav button img { width: 26px; height: 26px; }
  .placebar small { display: none; } .toasts { top: 120px; width: 92vw; }
  .quest { top: auto; bottom: 92px; left: 8px; right: 8px; max-width: none; }
  .pill { font-size: 15px; } .pill small.cap { display: none; }
  .bskill { width: 60px; height: 78px; } .bskill canvas { width: 50px; height: 50px; } .bskills { gap: 6px; }
  .cut-txt b { font-size: 22px; } .cut-por canvas { width: 64px; height: 64px; }
  .bpanel { bottom: 150px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- round 7 ---------- */
h1, h2, h3, .pill, .bp-head h3, .stext b, .bwave, .bbanner b, .cut-txt b { font-weight: 400 !important; }
.panel h2 { font-size: 32px; } .panel h3 { font-size: 22px; }
.node:active, .node:hover { transform: translate(-50%, -50%) scale(1.08); }
.node.next { z-index: 2; }
.hud { z-index: 30; } .tip { z-index: 45; }
.modal { padding: 64px 12px 28px; }   /* clear of the HUD at the top, and ending a little above the bottom edge */
.modal.story { padding-top: 12px; }
.pill { cursor: help; padding-right: 10px; font-size: 20px; box-shadow: none; }
.pill:active { transform: none; }
.tip { position: fixed; max-width: 280px; background: #140c10f5; border: 2px solid var(--gold); border-radius: 10px; padding: 8px 12px; box-shadow: 0 8px 24px #000c; pointer-events: none; }
.tip b { font: 22px var(--pixel); color: var(--gold); display: flex; align-items: center; gap: 4px; } .tip p { margin: 4px 0 0; font-size: 15px; } .tip .how { color: var(--crys); }
.have { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #0006; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; margin: 6px 0; font: 20px var(--pixel); width: fit-content; }
.have small { color: var(--mute); font-family: var(--sans); font-size: 14px; }
.hint.tiny { font-size: 13px; margin: 6px 0 0; }
.dim { filter: grayscale(.6) brightness(.8); }
kbd { font: 14px var(--sans); background: #0006; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 4px; color: var(--mute); }
/* filters */
.filters { display: grid; gap: 4px; margin: 6px 0 10px; } .frow { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { padding: 2px 10px; font-size: 18px; border-radius: 999px; background: #1a0e0a; box-shadow: none; border: 2px solid color-mix(in srgb, var(--c, #6a4632) 70%, transparent); color: var(--ink); }
.chip.on { background: color-mix(in srgb, var(--c, #ffc94a) 35%, #1a0e0a); border-color: var(--c, var(--gold)); }
.chip.locked { opacity: .55; }
.tag { display: inline-block; font: 16px var(--pixel); background: #2a5a8a; color: #fff; border-radius: 6px; padding: 0 6px; }
.tag.red { background: #8a2a1a; }
.hcard .tag { position: absolute; top: 4px; left: 4px; font-size: 14px; background: #6a4a8a; }
.hcard .por { background: radial-gradient(color-mix(in srgb, var(--sp, #4a3a30) 45%, #2a1a14), #1a0e0a 75%); }
/* quests */
.qlist { display: grid; gap: 6px; max-height: 60vh; overflow: auto; padding-right: 4px; }
.qrow { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 8px; align-items: center; background: #1a0e0a; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.qrow .qn { font: 20px var(--pixel); color: var(--mute); text-align: center; } .qrow .qrw { display: flex; gap: 6px; font-size: 15px; } .qrow small { color: var(--mute); }
.qrow.claimed { opacity: .55; } .qrow.claimed .qn { color: var(--go); }
.qrow.current { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); } .qrow.ready { border-color: var(--go); box-shadow: 0 0 12px #4fbf5a66; }
.qrow.later { opacity: .7; } .qrow.later .qt { color: var(--mute); }
.quest { cursor: pointer; }
/* bestiary */
.blist2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 8px; }
.beast { display: flex; gap: 10px; background: #1a0e0a; border: 2px solid var(--line); border-radius: 10px; padding: 8px; }
.beast .por canvas { width: 64px; height: 64px; border-radius: 8px; background: #2a1a20; display: block; }
.beast div { display: grid; gap: 2px; align-content: start; } .beast b { font: 22px var(--pixel); } .beast small { color: var(--mute); font-size: 14px; } .beast .ab { color: #ffd0a0; } .beast .where { color: var(--crys); }
.beast.boss { border-color: #8a2a1a; }
.beast.unknown { opacity: .8; } .beast.unknown canvas { filter: brightness(0) drop-shadow(0 0 1px #e8d8b8) drop-shadow(0 0 4px #8a7a9a); background: #4a3a58; }
/* map worlds */
.map-worlds { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 3; }
.map-worlds .chip { font-size: 20px; padding: 4px 14px; background: #1a0e0ae6; }
/* hero detail extras */
.archive-note { background: #2a1a40; border: 1px solid #6a4a8a; border-radius: 8px; padding: 6px 10px; font-size: 15px; margin: 6px 0; }
.archive-note a { color: var(--crys); }
figure.cardart { margin: 0; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; width: 100%; }
figure.cardart img { width: 100%; display: block; } figure.cardart figcaption { font-size: 13px; color: var(--mute); padding: 3px 8px; background: #0008; }
/* summon reveal: the in-game sprite on a splinter glow */
.rcard .front { grid-template-rows: 1fr auto auto; background: radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--sp) 45%, transparent), transparent 70%), linear-gradient(#3a2a40, #1a1018); }
.rart { display: grid; place-items: center; min-height: 0; overflow: hidden; padding: 6px; }
.rart canvas { max-width: 100%; max-height: 100%; image-rendering: pixelated; }
/* sign-in gate */
.gate { display: grid; place-items: center; }
.title-box.login, .title-box.later { width: min(440px, 92vw); display: grid; gap: 8px; }
.title-box.later p { margin: 4px 0; color: var(--ink); }
.title-box.later h1 { font-size: clamp(36px, 7vw, 60px); }
.field { display: grid; gap: 4px; text-align: left; } .field span { font: 20px var(--pixel); color: var(--mute); }
.field input { font: 20px var(--sans); padding: 10px 12px; border-radius: 8px; border: 2px solid var(--line); background: #0a0608; color: var(--ink); }
.field input:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.msg { min-height: 1.4em; margin: 0; font-size: 16px; color: var(--crys); } .msg.bad { color: var(--bad); }
details.dev { margin: 10px 0; border: 1px dashed var(--line); border-radius: 8px; padding: 6px 10px; } details.dev summary { cursor: pointer; font: 20px var(--pixel); color: var(--mute); }
details.dev .frow { margin: 6px 0; }
#town { cursor: grab; } #town:active { cursor: grabbing; }
@media (max-width: 760px) {
  .nav button { font-size: 15px; padding: 4px 6px; } .nav button img { width: 22px; height: 22px; }
  .pill { font-size: 17px; } .blist2 { grid-template-columns: 1fr; } .qrow { grid-template-columns: 24px 1fr auto; } .qrow .qrw { display: none; }
  .modal { padding-top: 84px; } .map-worlds { top: 70px; }
}

/* ---------- round 8 ---------- */
.pop.poison { color: #8aff4a; font-size: 18px; }
.gear.gift { font-size: 20px; position: relative; }
.gear.gift.ready { animation: pulse 1s infinite; box-shadow: 0 0 14px #ffc94a, inset 0 1px 0 #8a6448; background: linear-gradient(#ffb13d, #c06a10); }
.subtitle { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 35; display: flex; align-items: center; gap: 10px; max-width: min(640px, 92vw); background: #140c10ee; border: 2px solid var(--gold); border-radius: 12px; padding: 6px 14px 6px 6px; font-size: 17px; pointer-events: none; transition: opacity .5s; box-shadow: 0 6px 20px #000a; }
.subtitle .por canvas { width: 40px; height: 40px; border-radius: 8px; display: block; background: #2a1a20; }
.subtitle b { font: 21px var(--pixel); color: var(--gold); }
.subtitle.out { opacity: 0; }
#battle-screen:not([hidden]) ~ .subtitle { bottom: 120px; }
.voices { background: #1a0e0a; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; display: grid; gap: 4px; }
.voices > small { color: var(--gold); font: 16px var(--pixel); letter-spacing: .05em; text-transform: uppercase; }
.vline { text-align: left; font: 16px var(--sans); padding: 4px 8px; background: #2a1a14; box-shadow: none; border: 1px solid var(--line); }
.vline .vk { font: 16px var(--pixel); color: var(--crys); margin-right: 4px; } .vline::before { content: "▶ "; color: var(--gold); }
.picket { display: flex; gap: 10px; align-items: center; background: #1a2a12; border: 1px solid #4a6a2a; border-radius: 10px; padding: 6px 10px; }
.picket canvas { border-radius: 8px; background: #2a1a10; } .picket p { margin: 0; font-style: italic; }
.trade { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #1a0e0a; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.trade .arrow { color: var(--gold); font-size: 22px; } .trade button { margin-left: auto; }
.trade.deal { border-color: var(--gold); box-shadow: 0 0 12px #ffc94a44; }
.synrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.syn { font-size: 15px; color: var(--mute); background: #0006; border: 1px dashed var(--line); border-radius: 8px; padding: 3px 10px; }
.syn.on { color: var(--ink); border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 18%, #1a0e0a); }
@media (max-width: 760px) { .subtitle { bottom: 150px; font-size: 15px; } }
.gear.gift img { width: 24px; height: 24px; image-rendering: pixelated; vertical-align: middle; }

/* ---------- round 9 ---------- */
details.lorebox { background: #14100c; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
details.lorebox summary { cursor: pointer; font: 18px var(--pixel); color: var(--gold); }
details.lorebox p { font-size: 15px; line-height: 1.5; margin: 6px 0 2px; color: #e8dcc4; } details.lorebox small { color: var(--mute); font-size: 13px; }
details.lorebox.small { padding: 2px 6px; margin: 2px 0; } details.lorebox.small summary { font-size: 15px; } details.lorebox.small p { font-size: 14px; }
.chip.rift { background: linear-gradient(#5a2a8a, #2a1040); border-color: #c08aff; }
.qgo { padding: 2px 10px; font-size: 17px; }
@media (max-width: 760px) {
  .map-wrap { place-items: center start; overflow: auto; -webkit-overflow-scrolling: touch; }
  .map { width: max(100vw, calc((100dvh - 150px) * 1.5)); }
  .map-worlds { top: 96px; left: 8px; right: 8px; transform: none; flex-wrap: nowrap; overflow-x: auto; }
  .map-worlds .chip { font-size: 16px; padding: 3px 10px; white-space: nowrap; flex: none; }
  .map-bar b { display: none; }
}

/* ---------- round 10 ---------- */
.gearbox { background: #1a0e0a; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; display: grid; gap: 6px; }
.gearbox > small { color: var(--gold); font: 16px var(--pixel); letter-spacing: .05em; text-transform: uppercase; }
.gslot { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; }
.gslot img { width: 36px; height: 36px; object-fit: contain; image-rendering: pixelated; }
.gslot .gph { width: 36px; height: 36px; display: grid; place-items: center; border: 2px dashed var(--line); border-radius: 8px; color: var(--mute); font: 22px var(--pixel); }
.gslot b { font: 19px var(--pixel); display: block; } .gslot small { color: var(--mute); font-size: 14px; } .gslot.empty b { color: var(--mute); }
.gslot button { display: inline-flex; gap: 6px; align-items: center; font-size: 17px; }
.info-btn { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: #2a5a8a; color: #fff; font: 19px/22px var(--pixel); text-align: center; cursor: pointer; box-shadow: 0 1px 0 #000a; }
.info-btn:hover { filter: brightness(1.2); }
#m-confirm { z-index: 50; } .panel.confirm { width: min(420px, 100%); text-align: center; } .panel.confirm p { font-size: 18px; }
body:has(.modal:not([hidden]):not(#m-story)) .subtitle { bottom: 10px; z-index: 55; }
@media (hover: none) { kbd { display: none; } }
.bounties h3 { margin: 0 0 4px; font-size: 20px; } .bounties { margin-bottom: 10px; }
.nav button canvas { width: 30px; height: 30px; border-radius: 6px; }

/* onboarding: Oshuur's coach bubble, the pointer, NEW badges, locked nav buttons */
.coach { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); width: min(460px, calc(100vw - 24px)); display: flex; gap: 10px; align-items: flex-start; background: #1a0e0af2; border: 2px solid var(--gold); border-radius: 10px; padding: 8px 10px; z-index: 60; box-shadow: 0 6px 24px #000a; pointer-events: auto; }
.coach.top { top: 150px; bottom: auto; }
.coach.pop { animation: coachin .28s ease-out; }
@keyframes coachin { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.coach .cpor canvas { width: 48px; height: 48px; border-radius: 8px; border: 2px solid var(--line); display: block; }
.coach .ctext { flex: 1; min-width: 0; display: grid; gap: 4px; } .coach p { white-space: normal; overflow-wrap: anywhere; } .coach b { color: var(--gold); font: 16px var(--pixel); letter-spacing: .04em; }
.coach p { margin: 0; font-size: 16px; line-height: 1.3; }
.coach .crow { display: flex; gap: 8px; justify-content: flex-end; } .coach .crow button { padding: 3px 10px; font-size: 15px; }
.coach .lnk { background: none; border: 0; box-shadow: none; color: var(--mute); text-decoration: underline; }
.pointer { position: fixed; z-index: 61; width: 0; height: 0; pointer-events: none; }
.pointer::before { content: ""; position: absolute; left: -14px; bottom: 0; border: 14px solid transparent; border-top: 18px solid var(--gold); border-bottom: 0; filter: drop-shadow(0 2px 2px #000a); animation: ptr 0.8s ease-in-out infinite; }
.pointer.up::before { bottom: auto; top: 0; border-top: 0; border-bottom: 18px solid var(--gold); animation-name: ptrup; }
@keyframes ptr { 50% { transform: translateY(-8px); } } @keyframes ptrup { 50% { transform: translateY(8px); } }
.guide-hl { outline: 3px solid var(--gold) !important; outline-offset: 2px; animation: hl 1.2s ease-in-out infinite; }
@keyframes hl { 50% { outline-color: #fff3; } }
.nav button.locked { filter: grayscale(1) brightness(.7); } .nav button.locked::after { content: "🔒"; position: absolute; top: -6px; right: -4px; font-size: 16px; }
.nav button, .hud .gift, .chip { position: relative; }
.nav button.new::after, .hud .gift.new::after, .chip.new::after { content: "NEW"; position: absolute; top: -8px; right: -6px; background: #e8402a; color: #fff; font: 13px var(--pixel); padding: 1px 4px; border-radius: 4px; box-shadow: 0 1px 0 #0008; animation: hl 1.2s infinite; }
#roadmap h3 { margin: 12px 0 4px; } #roadmap small { color: var(--mute); }
label.check { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.gslot img.dragon { filter: hue-rotate(-40deg) saturate(1.6) drop-shadow(0 0 4px #ff6a2a); }

/* scrollbars in the game's own style: a carved wooden track with a gold-capped, grip-lined thumb.
   Chrome and Safari draw the ::-webkit-scrollbar parts; scrollbar-color is only for Firefox (in Chrome it would
   replace the styled parts with a flat bar). */
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: #d8a24a #24150f; } }
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: linear-gradient(90deg, #160c08, #2a1a12 50%, #160c08); border: 2px solid #3a2620; border-radius: 9px; box-shadow: inset 0 0 0 1px #000a, inset 0 0 6px #000c; }
::-webkit-scrollbar-track:horizontal { background: linear-gradient(180deg, #160c08, #2a1a12 50%, #160c08); }
::-webkit-scrollbar-thumb { border: 2px solid #1a0e0a; border-radius: 9px; min-height: 40px;
  background: repeating-linear-gradient(180deg, transparent 0 5px, #6a3e1a55 5px 6px, #ffe0a033 6px 7px) center / 60% 22px no-repeat,
    linear-gradient(90deg, #7a4c22, #e0aa4e 40%, #ffd27a 50%, #c8903e 62%, #7a4c22);
  box-shadow: inset 0 1px 0 #ffe7b0, inset 0 -1px 0 #5a3414, 0 0 0 1px #000; }
::-webkit-scrollbar-thumb:horizontal { min-width: 40px; background: repeating-linear-gradient(90deg, transparent 0 5px, #6a3e1a55 5px 6px, #ffe0a033 6px 7px) center / 22px 60% no-repeat,
    linear-gradient(180deg, #7a4c22, #e0aa4e 40%, #ffd27a 50%, #c8903e 62%, #7a4c22); }
::-webkit-scrollbar-thumb:hover { filter: brightness(1.12); background-color: #ffc94a; }
::-webkit-scrollbar-thumb:active { box-shadow: inset 0 1px 0 #fff2c8, 0 0 6px #ffc94a, 0 0 0 1px #000; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; }
/* hotkey hints */
kbd.hk { display: inline-block; min-width: 1.3em; padding: 0 4px; margin-left: 4px; border: 1px solid #0008; border-bottom-width: 2px; border-radius: 4px; background: #fff2; color: #ffe8b0; font: 13px var(--pixel); line-height: 1.25; text-align: center; vertical-align: 1px; }
.nav kbd.hk { position: absolute; top: 3px; left: 4px; margin: 0; font-size: 12px; opacity: .85; }
@media (hover: none) { kbd.hk { display: none; } }
/* the claim dialog: only claiming closes it */
.modal.claim .panel { text-align: center; max-width: 420px; border-color: var(--gold); box-shadow: 0 0 0 3px #ffc94a55, 0 0 40px #ffc94a44; }
.modal.claim h2 { color: var(--gold); margin: 4px 0; } .modal.claim .unl { color: #9ff0a8; font: 20px var(--pixel); margin: 8px 0 4px; }
.modal.claim .rw { display: flex; gap: 12px; justify-content: center; font-size: 20px; margin: 10px 0 14px; }
.result .x { position: absolute; top: 8px; right: 10px; }
.bskill { position: relative; } .bskill kbd.hk.sk { position: absolute; top: 2px; left: 2px; margin: 0; }

.hero-sprite { max-width: 100%; object-fit: contain; }
a.vlink { display: inline-block; color: #8fd8ff; font-size: 15px; margin: 2px 0 6px; } a.vlink.small { font-size: 14px; margin: 2px 0 0; }
.hd-acts { display: grid; gap: 4px; margin: 4px 0 8px; } .hd-acts .bp-row { margin: 0; }
p.saved { color: #9ff0a8; }
.pop.bond { color: #ffb0e0; font-size: 18px; }
.syn.bond { --c: #ff8ac8; } .syn.bond:not(.on) { opacity: .75; }
.bonds { display: grid; gap: 6px; background: #ff8ac814; border: 1px solid #ff8ac855; border-radius: 8px; padding: 8px 10px; }
.bonds > small { color: #ffb0e0; } .bondrow { display: flex; gap: 10px; align-items: center; } .bondrow b { color: #ffb0e0; }
.bondrow p { margin: 2px 0 0; font-size: 15px; } .bpor { display: flex; gap: 3px; flex: none; } .bpor canvas { width: 34px; height: 34px; border-radius: 6px; border: 1px solid #ff8ac855; }
.bpor .unowned canvas { filter: grayscale(1) brightness(.6); }
.ally-art { display: grid; place-items: center; height: 170px; } .ally-art canvas { max-height: 170px; width: auto; image-rendering: pixelated; }
#btn-collect { background: linear-gradient(#ffd56a, #c88a1a); color: #2a1408; text-shadow: none; position: relative; }
#btn-collect::after { content: attr(data-n); position: absolute; top: -8px; right: -6px; min-width: 20px; padding: 0 5px; border-radius: 10px; background: #e8402a; color: #fff; font: 13px var(--pixel); line-height: 20px; }
.xrow { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.xrow.done { opacity: .6; } .xrow.cur { border-color: var(--gold); box-shadow: 0 0 0 1px #ffc94a55; } .xrow.later { opacity: .8; }
.xrow p { margin: 2px 0 0; color: var(--mute); } .bcard.expand { border-color: var(--gold); }
.abrow { display: flex; gap: 10px; align-items: flex-start; } .abrow p { margin: 2px 0; }
.abico { width: 34px; height: 34px; flex: none; image-rendering: pixelated; object-fit: contain; filter: drop-shadow(0 1px 1px #000a); }
.skill ul.facts { margin: 6px 0 0; padding-left: 18px; color: #ffd84a; font-size: 15px; } .skill ul.facts li { margin: 2px 0; }
.beast.click { cursor: pointer; } .beast.click:hover { filter: brightness(1.12); outline: 2px solid var(--gold); } .beast .more { color: var(--gold); }
.lorebox.open { background: #0003; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; } .lorebox.open p { margin: 4px 0; }
/* lists that filter keep one height, so the panel doesn't jump as the list shrinks */
#m-heroes .panel, #m-party .panel, #m-hero .panel, #m-beast .panel, #m-bestiary .panel { height: min(860px, calc(100dvh - 96px)); }
#m-heroes .hlist { align-content: start; }
.navarrows { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; z-index: 2; }
.navarrows button { padding: 4px 12px; } .navarrows small { color: var(--mute); font-size: 14px; min-width: 64px; text-align: center; }
.tip[data-pinned] { pointer-events: auto; } .manabuy { display: grid; gap: 6px; margin-top: 8px; } .manabuy button { justify-content: flex-start; font-size: 17px; padding: 5px 10px; display: flex; gap: 4px; align-items: center; }
.pill.buy { cursor: pointer; } .pill.buy::after { content: "+"; margin-left: 4px; color: #9ff0a8; font: 18px var(--pixel); }
.gr { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 15px; }

.guide-link { color: #ffcb4a; font-weight: 600; text-decoration: none; border-bottom: 1px dotted #ffcb4a; }
.guide-link:hover { color: #fff; }

/* ultimates: a second, slower skill for legendary and epic heroes, above their skill button */
.bcol { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bult { position: relative; width: 76px; min-height: 22px; padding: 2px 3px; border-radius: 8px; border: 2px solid #5a3a8a; background: #1a0e1e; color: #c9a8ff; font: 10px/1.05 var(--pixel); overflow: hidden; }
.bult span:last-child { position: relative; } .bult .ring { position: absolute; inset: 0; border-radius: 6px; background: linear-gradient(90deg, #a06aff66 var(--p, 0%), #0000 0); pointer-events: none; }
.bult.none { visibility: hidden; border: 0; background: none; }
.bult.ready { border-color: #ffd86a; color: #fff2c0; background: #3a1e4a; box-shadow: 0 0 14px #c08aff, inset 0 0 10px #ffd86a88; animation: pulse .9s infinite; }
.bult:disabled { cursor: default; } .bult.dead { filter: grayscale(1) brightness(.4); }
@media (max-width: 700px) { .bult { width: 60px; font-size: 9px; } }
.skill.ult { border-color: #6a4a9a; background: #1a0e20; } .skill.ult small { color: #c9a8ff; }

/* Dark Mode on the map */
#map-screen.dark .map::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 50%, transparent 45%, #12001aaa 100%); }
#map-screen.dark .node { filter: hue-rotate(250deg) saturate(1.3); }
.chip.darkmode { background: #1e0a28; border-color: #8a4aff; color: #d8b8ff; } .chip.darkmode.on { background: #ffe6a0; color: #2a1408; border-color: #ffc94a; }
.gslot img.void { filter: hue-rotate(230deg) saturate(1.6) drop-shadow(0 0 4px #b06aff); }

/* party screen: Back and Fight sit at the top, beside the title */
#m-party .party-top { display: flex; align-items: center; gap: 10px; padding-right: 44px; flex-wrap: wrap; }
#m-party .party-top h2 { margin: 0 auto 0 0; }
#m-party .party-top .bp-row { margin: 0; }
/* Archive dossiers (character sheets from vinnie.ink) on hero and Bestiary pages; tap for full size */
figure.cardart { cursor: zoom-in; } figure.cardart.dossier { background: #e9dcc0; } figure.cardart.dossier img { aspect-ratio: 2 / 3; object-fit: cover; }
.artview { position: fixed; inset: 0; z-index: 90; background: #000d; display: grid; place-items: center; align-content: center; gap: 8px; cursor: zoom-out; animation: fadein .15s ease-out; }
.artview img { max-width: 96vw; max-height: 88vh; border-radius: 10px; box-shadow: 0 10px 40px #000; } .artview small { color: var(--mute); font: 16px var(--pixel); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
/* build menu by kind of building (round 17) */
.bcard .tag.count { justify-self: center; font-size: 13px; padding: 0 8px; border-radius: 99px; background: #0006; color: var(--gold); }
/* Expand the Hollow: the plan of the land and what the next expansion clears (round 17) */
.xnext { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: start; background: #1a0e0a; border: 2px solid var(--gold); border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.xnext .k { color: var(--mute); display: block; } .xnext .xname { font: 24px var(--pixel); color: var(--gold); } .xnext .facts { margin: 4px 0 8px; padding-left: 18px; font-size: 15px; }
.landplan { width: 150px; height: 150px; } .landplan .wild { fill: #16301a; } .landplan .later { fill: none; stroke: #ffd84a44; stroke-dasharray: 3 3; }
.landplan .next { fill: #ffd84a55; stroke: #ffd84a; stroke-width: 1.2; stroke-dasharray: 4 2; } .landplan .held { fill: #4a7a3a; stroke: #f2e2b8aa; } .landplan .bld { fill: #c89a5a; stroke: #1a0e0a; stroke-width: .6; }
@media (max-width: 520px) { .xnext { grid-template-columns: 1fr; justify-items: center; } }
button.foe { background: none; border: 0; padding: 0; box-shadow: none; font: inherit; color: inherit; cursor: pointer; } button.foe:hover canvas, button.foe:focus-visible canvas { border-color: var(--gold); } button.foe:hover small { color: var(--gold); }
/* battle: the enemies you're facing (round 17) */
.bfoes { position: absolute; top: 56px; right: 10px; display: flex; flex-direction: column; gap: 5px; z-index: 3; }
.bfoe { position: relative; padding: 0; width: 46px; height: 50px; display: grid; justify-items: center; align-content: start; background: #1a0e0acc; border: 2px solid #8a3a3a; border-radius: 8px; box-shadow: 0 2px 6px #000a; cursor: pointer; }
.bfoe canvas { width: 40px; height: 40px; } .bfoe.boss { border-color: var(--gold); box-shadow: 0 0 10px #ffb13d88; }
.bfoe .fhp { display: block; width: 38px; height: 4px; background: #000a; border-radius: 2px; overflow: hidden; } .bfoe .fhp i { display: block; height: 100%; background: linear-gradient(#ff8a7a, #d03a2a); }
.bfoe.dead { opacity: .35; filter: grayscale(1); } .bfoe:hover, .bfoe:focus-visible { border-color: var(--gold); transform: translateX(-2px); }
.ftipbox { position: absolute; z-index: 4; width: min(260px, 70vw); pointer-events: none; }
.ftip { display: grid; gap: 2px; background: #140c10f2; border: 2px solid var(--gold); border-radius: 10px; padding: 8px 10px; box-shadow: 0 6px 20px #000a; }
.ftip b { font: 20px var(--pixel); color: var(--gold); } .ftip small { color: #f2e2b8; font-size: 13px; } .ftip .ab { color: var(--crys); } .ftip .sp { color: #ffb0a0; } .ftip em { color: var(--mute); font-size: 12px; } .ftip .tag { justify-self: start; }
@media (max-width: 760px) { .bfoes { top: 52px; right: 6px; gap: 3px; } .bfoe { width: 38px; height: 42px; } .bfoe canvas { width: 32px; height: 32px; } .bfoe .fhp { width: 30px; } .bossbar { width: min(560px, 68vw); } }
/* promotion ceremony (round 17) */
.promo { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; background: radial-gradient(circle at 50% 42%, #3a2440, #0a060e 65%); cursor: pointer; animation: fadein .25s ease-out; overflow: hidden; }
.promo.out { animation: promo-out .25s ease-in forwards; } @keyframes promo-out { to { opacity: 0; transform: scale(1.04); } }
.promo-rays { position: absolute; left: 50%; top: 42%; width: 160vmax; height: 160vmax; transform: translate(-50%, -50%); background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--sp) 40%, transparent) 0 6deg, transparent 6deg 18deg); mask: radial-gradient(circle, #000 0, #0008 25%, transparent 55%); animation: rays 14s linear infinite, rays-in .8s ease-out; opacity: .45; }
@keyframes rays { to { transform: translate(-50%, -50%) rotate(360deg); } } @keyframes rays-in { from { opacity: 0; } }
.promo-sparks { position: absolute; left: 50%; top: 40%; } .promo-sparks i { position: absolute; width: 6px; height: 6px; background: var(--c); box-shadow: 0 0 8px var(--c); transform: rotate(var(--a)) translateY(0); opacity: 0; animation: spark var(--t) ease-out .45s infinite; }
@keyframes spark { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1.4); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--r))) scale(.4); } }
.promo-card { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; padding: 16px; animation: promo-in .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes promo-in { from { transform: scale(.6); opacity: 0; } }
.promo-k { font: 20px var(--pixel); color: var(--mute); letter-spacing: 1px; } .promo-title { margin: 0; font: 56px var(--pixel); color: #ffe08a; text-shadow: 0 4px 0 #6a3a10, 0 0 24px #ffb13d; animation: promo-title 1.2s ease-out; }
@keyframes promo-title { 0% { letter-spacing: 18px; opacity: 0; } 60% { letter-spacing: 2px; opacity: 1; } 100% { letter-spacing: 0; } }
.promo-stage { width: 220px; height: 210px; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 85%, color-mix(in srgb, var(--sp) 55%, transparent), transparent 62%); }
.promo-hero { height: 200px; width: auto; image-rendering: pixelated; animation: promo-hero 1.6s ease-in-out infinite alternate; filter: drop-shadow(0 0 12px #ffe08a88); }
@keyframes promo-hero { from { transform: translateY(2px); } to { transform: translateY(-6px); } }
.promo-stars { display: flex; gap: 4px; min-height: 48px; } .pstar { font-size: 38px; color: #ffd84a; text-shadow: 0 3px 0 #6a3a10; opacity: 0; transform: scale(2.4) rotate(-30deg); animation: pstar .35s cubic-bezier(.2,1.8,.4,1) var(--d) forwards; }
.pstar.new { font-size: 50px; color: #fff4c0; text-shadow: 0 3px 0 #6a3a10, 0 0 18px #ffd84a, 0 0 36px #ffb13d; animation: pstar-new .7s cubic-bezier(.2,1.8,.4,1) var(--d) forwards; }
@keyframes pstar { to { opacity: 1; transform: none; } } @keyframes pstar-new { 0% { opacity: 0; transform: scale(5) rotate(-120deg); } 70% { opacity: 1; transform: scale(.9) rotate(8deg); } 100% { opacity: 1; transform: none; } }
.promo-stats { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: 6px; margin-top: 6px; opacity: 0; animation: fadein .4s ease-out 1.6s forwards; }
.prow { display: grid; grid-template-columns: auto auto auto; gap: 4px; align-items: baseline; justify-content: center; background: #0008; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; }
.prow small { grid-column: 1 / -1; color: var(--mute); font-size: 12px; } .prow span { color: var(--mute); } .prow i { color: var(--gold); font-style: normal; } .prow b { color: #8dff7a; font: 20px var(--pixel); }
.promo-tap { color: var(--mute); opacity: 0; animation: fadein .4s ease-out 2.2s forwards; }
@media (max-width: 520px) { .promo-title { font-size: 40px; } .promo-stats { grid-template-columns: repeat(2, minmax(110px, 1fr)); } .promo-stage { width: 180px; height: 170px; } .promo-hero { height: 165px; } }
@media (prefers-reduced-motion: reduce) { .promo-rays, .promo-sparks i, .promo-hero { animation: none; } }
/* cutscenes: a pixel painting and the Narrator (round 17) */
.cutscene { position: fixed; inset: 0; z-index: 88; background: #000; display: grid; place-items: center; cursor: pointer; animation: cs-in .9s ease-out; overflow: hidden; }
.cutscene.out { animation: cs-out .4s ease-in forwards; } @keyframes cs-in { from { opacity: 0; } } @keyframes cs-out { to { opacity: 0; } }
.cs-frame { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.cs-img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; animation: kenburns 22s ease-out forwards; transform-origin: 60% 45%; }
@keyframes kenburns { from { transform: scale(1.12) translateX(1.5%); } to { transform: scale(1) translateX(0); } }
.cs-bars { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(#000e 0, transparent 22%, transparent 58%, #000e 100%); }
.cs-title { position: absolute; top: max(18px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); text-align: center; display: grid; gap: 0; animation: cs-title 1.4s ease-out .4s both; }
.cs-title small { font: 16px var(--pixel); color: #f2e2b8aa; letter-spacing: 3px; text-transform: uppercase; } .cs-title b { font: 40px var(--pixel); color: #ffe08a; text-shadow: 0 3px 0 #000, 0 0 20px #000; }
@keyframes cs-title { from { opacity: 0; letter-spacing: 8px; } }
.cs-text { position: absolute; bottom: max(36px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(820px, 92vw); margin: 0; font: 26px/1.3 var(--pixel); color: #fff4d6; text-shadow: 0 2px 0 #000, 0 0 12px #000; text-align: center; min-height: 3.9em; }
.cutscene.full .cs-text::after { content: "  ▸"; color: var(--gold); animation: blink 1s steps(2) infinite; } @keyframes blink { 50% { opacity: 0; } }
.cs-skip { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; background: #0008; border: 1px solid #fff4; color: #fff; padding: 4px 12px; font: 16px var(--pixel); box-shadow: none; }
@media (max-width: 600px) { .cs-title b { font-size: 28px; } .cs-text { font-size: 20px; } .cs-img { object-fit: contain; } }
@media (prefers-reduced-motion: reduce) { .cs-img { animation: none; } }
/* round 18: build menu tabs, roads, zoom buttons */
.btabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin: 8px 0 10px; }
.btab { position: relative; font: 18px var(--pixel); padding: 6px 14px 5px; border-radius: 10px 10px 0 0; border: 2px solid var(--line); border-bottom: 0; margin-bottom: -2px; background: #1a0e0a; color: var(--mute); box-shadow: none; }
.btab.on { background: #2e1c14; color: var(--gold); border-color: var(--gold); border-bottom: 2px solid #2e1c14; }
.btab .bdot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 4px; border-radius: 99px; background: #3a9a4a; color: #fff; font: 13px var(--sans); vertical-align: 2px; }
.bpane { min-height: 340px; } .bpane > .hint:first-child { margin-top: 0; }
.bcard.expand.wide { grid-template-columns: 90px 1fr; display: grid; text-align: left; justify-items: start; align-items: center; width: 100%; max-width: 560px; margin-bottom: 10px; } .bcard.expand.wide img { width: 80px; height: 90px; }
.bcard.expand.wide > div { display: grid; gap: 2px; }
.dcard.roadcard .rtile { width: 86px; height: 48px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background-size: 70px; image-rendering: pixelated; filter: drop-shadow(0 2px 0 #000); }
.dcard.roadcard .rtile.erase { background: #4a2a20; color: #ff9a7a; display: grid; place-items: center; font: 24px var(--pixel); }
.dlist.roads { margin-bottom: 8px; }
@media (max-width: 760px) { .btab { font-size: 15px; padding: 5px 9px 4px; } }
.bpane h3.sub { margin: 4px 0 4px; font: 22px var(--pixel); color: var(--gold); }
/* round 18: hero cards, polished; splinter glyphs; party effect chips with tooltips */
.spl-ico { width: 24px; height: 24px; image-rendering: pixelated; vertical-align: middle; }
.hcard { background: linear-gradient(180deg, color-mix(in srgb, var(--sp, #4a3a30) 16%, #2a1a14) 0%, #1a0e0a 62%); border-radius: 12px; padding: 10px 6px 8px; gap: 3px;
  box-shadow: inset 0 1px 0 #ffffff18, 0 3px 0 #000a; transition: transform .12s ease-out, box-shadow .12s, filter .12s; overflow: hidden; }
.hcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--common); opacity: .9; }
.hcard.r-rare::before { background: var(--rare); } .hcard.r-epic::before { background: var(--epic); } .hcard.r-legendary::before { background: linear-gradient(90deg, #ffe08a, var(--legendary), #ffe08a); }
.hcard:hover, .hcard:focus-visible { transform: translateY(-3px); box-shadow: inset 0 1px 0 #ffffff22, 0 6px 0 #000a, 0 0 16px color-mix(in srgb, var(--sp) 45%, transparent); }
.hcard .por { width: 80px; height: 80px; display: grid; place-items: center; border-radius: 12px; border: 2px solid #0009; box-shadow: inset 0 0 12px #0008, 0 0 0 1px color-mix(in srgb, var(--sp) 40%, transparent);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--sp) 50%, #2a1a14), #140a08 78%); }
.hcard .por canvas { width: 72px; height: 72px; }
.hcard b { font: 17px/1.05 var(--pixel); margin-top: 2px; text-shadow: 0 2px 0 #000; }
.hcard .meta { gap: 5px; } .hcard .meta .stars { font-size: 12px; } .hcard .lv { font: 14px var(--pixel); color: var(--ink); background: #0007; border-radius: 99px; padding: 0 7px; }
.hcard .pw { font: 15px var(--pixel); color: #ffb37a; }
.spl-badges { position: absolute; top: 6px; left: 5px; display: flex; flex-direction: column; gap: 1px; filter: drop-shadow(0 1px 0 #000); z-index: 1; }
.spl-badges .spl-ico { width: 22px; height: 22px; }
.hcard .tag { top: 6px; left: auto; right: 5px; font-size: 12px; padding: 0 6px; border-radius: 99px; } .hcard:has(.info-btn) .tag { top: 32px; }
.soulbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px; width: 100%; padding: 0 4px; } .soulbar .ico { width: 16px; height: 16px; }
.soulbar .sb { height: 6px; background: #0009; border-radius: 3px; overflow: hidden; } .soulbar .sb i { display: block; height: 100%; background: linear-gradient(90deg, #4a9aff, var(--crys)); }
.soulbar small { font-size: 12px !important; color: var(--crys) !important; } .soulbar.ready .sb i { background: linear-gradient(90deg, #3a9a4a, var(--go)); } .soulbar.ready small { color: var(--go) !important; font-weight: 700; }
.hcard.picked { outline: none; border-color: var(--go); box-shadow: 0 0 0 3px var(--go), 0 3px 0 #000a; background: linear-gradient(180deg, #2a4a1e, #13200c 70%); }
.hcard.picked::after { content: "✓"; position: absolute; top: 70px; left: calc(50% + 24px); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--go); color: #10200a; font: 700 15px var(--sans); }
.pslot { position: relative; } .pslot .spl-ico.slot { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; }
.syn { position: relative; display: inline-flex; align-items: center; gap: 5px; cursor: help; font-size: 14px; padding: 2px 9px; }
.syn .spl-ico { width: 18px; height: 18px; } .syn:not(.on) .spl-ico { opacity: .55; filter: grayscale(.6); }
.syn.on { box-shadow: 0 0 10px color-mix(in srgb, var(--c) 45%, transparent); animation: synglow 2.4s ease-in-out infinite; } @keyframes synglow { 50% { box-shadow: 0 0 16px color-mix(in srgb, var(--c) 70%, transparent); } }
@media (prefers-reduced-motion: reduce) { .syn.on { animation: none; } .hcard { transition: none; } }
.chip .chipico { width: 16px; height: 16px; margin-right: 4px; vertical-align: -3px; }
/* round 18: the daily gift calendar, polished */
#m-gift .panel { max-width: 760px; }
.ghead { display: flex; gap: 14px; align-items: center; } .ghead .hint { margin: 0; }
.gcount { font: 44px/1 var(--pixel); color: var(--gold); text-shadow: 0 3px 0 #6a3a10; } .ghead small { color: var(--mute); font: 18px var(--pixel); }
.gtrack { position: relative; height: 12px; margin: 14px 10px 30px; background: #0009; border: 2px solid var(--line); border-radius: 99px; }
.gfill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #c07a20, #ffd84a); box-shadow: 0 0 10px #ffc94a66; }
.gmark { position: absolute; top: 50%; transform: translate(-50%, -50%); display: grid; justify-items: center; } .gmark .ico { width: 24px; height: 24px; filter: grayscale(1) brightness(.6) drop-shadow(0 1px 0 #000); }
.gmark small { position: absolute; top: 24px; font: 13px var(--pixel); color: var(--mute); } .gmark.got .ico { filter: drop-shadow(0 0 6px #ffd84a); }
.giftgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 8px 0 12px; }
.gday { position: relative; display: grid; justify-items: center; align-content: start; gap: 2px; min-height: 104px; padding: 22px 4px 8px; text-align: center; overflow: hidden;
  background: linear-gradient(180deg, #3a261c, #1e120d); border: 2px solid var(--line); border-radius: 12px; box-shadow: inset 0 1px 0 #ffffff14, 0 3px 0 #000a; }
.gday-n { position: absolute; top: 0; left: 0; right: 0; font: 15px/20px var(--pixel); color: var(--mute); background: #0006; border-bottom: 1px solid #0008; }
.gmain { display: grid; justify-items: center; } .gmain .ico { width: 36px; height: 36px; filter: drop-shadow(0 2px 0 #000); } .gmain b { font: 20px var(--pixel); color: var(--ink); text-shadow: 0 2px 0 #000; }
.grest { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; font: 13px var(--pixel); color: var(--mute); } .grest .ico { width: 14px; height: 14px; vertical-align: -2px; }
.gday.big { border-color: #c79aff; background: linear-gradient(180deg, #4a2a6a, #22123a); box-shadow: inset 0 1px 0 #ffffff22, 0 3px 0 #000a, 0 0 12px #a46cff44; }
.gday.big .gday-n { background: linear-gradient(90deg, #7a4ab0, #c79aff, #7a4ab0); color: #fff; } .gday.big .gday-n::before { content: "★ "; }
.gday.done { background: linear-gradient(180deg, #24301c, #141a10); border-color: #3a5a30; } .gday.done .gmain, .gday.done .grest { opacity: .55; filter: saturate(.4); }
.gstamp { position: absolute; right: 4px; bottom: 2px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #2f8a3a; border: 2px solid #9ff0a8; font: 700 16px var(--sans); font-style: normal; color: #fff; transform: rotate(-12deg); box-shadow: 0 2px 0 #000a; }
.gday.just { filter: none; animation: gjust .8s ease-out; } .gday.just .gstamp { animation: gstamp .5s cubic-bezier(.2,1.8,.4,1) both; }
@keyframes gstamp { from { transform: rotate(-30deg) scale(3); opacity: 0; } } @keyframes gjust { 0% { box-shadow: 0 0 0 4px var(--gold), 0 0 30px var(--gold); } }
.gday.cur { border-color: var(--gold); background: linear-gradient(180deg, #5a3a14, #2a180a); box-shadow: 0 0 0 2px #ffc94a88, 0 0 22px #ffc94a66; animation: hl 1.4s infinite; }
.gday.cur .gday-n { background: linear-gradient(90deg, #c07a20, #ffd84a, #c07a20); color: #2a1408; }
.gday.cur::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, #fff3 45%, transparent 60%); background-size: 250% 100%; animation: shimmer 2.2s linear infinite; pointer-events: none; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.gday.later { opacity: .92; }
.gclaim { min-width: 240px; }
@media (max-width: 620px) { .giftgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ghead { flex-direction: column; align-items: flex-start; gap: 4px; } }
@media (prefers-reduced-motion: reduce) { .gday.cur, .gday.cur::after { animation: none; } }
.ghead .gclaim, .ghead .later-btn { margin-left: auto; white-space: nowrap; }
.dcard.roadcard .c { font-size: 15px; } .dcard.roadcard b { font-size: 15px; }
/* round 19: one tooltip for the whole game (js/tips.js), the Archive mark */
.gtip { position: fixed; z-index: 120; max-width: min(320px, 86vw); padding: 7px 11px; background: linear-gradient(#2a1a14f6, #160c0af6); color: var(--ink); border: 2px solid var(--gold);
  border-radius: 10px; font: 500 14px/1.4 var(--sans); box-shadow: 0 6px 20px #000b, inset 0 1px 0 #ffffff18; pointer-events: none; animation: tipin .12s ease-out; white-space: pre-line; }
.gtip::before { content: ""; position: absolute; left: 50%; top: -7px; width: 10px; height: 10px; background: #2a1a14; border-left: 2px solid var(--gold); border-top: 2px solid var(--gold); transform: translateX(-50%) rotate(45deg); }
.gtip.above::before { top: auto; bottom: -7px; background: #160c0a; border: 0; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); }
@keyframes tipin { from { opacity: 0; transform: translateY(3px); } }
.archmark { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: #1a0e0acc; border: 1px solid #a46cff88; cursor: help; z-index: 1; }
.archmark .spl-ico { width: 20px; height: 20px; } .hcard:has(.info-btn) .archmark { top: 30px; }
/* performance recorder */
.perfbox { margin: 8px 0; } .perfbox summary { cursor: pointer; font: 18px var(--pixel); color: var(--gold); }
#opt-quality { margin-left: 8px; font: 15px var(--sans); background: #1a0e0a; color: var(--ink); border: 2px solid var(--line); border-radius: 8px; padding: 2px 6px; }
.recbar { position: fixed; left: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 70; display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; background: #1a0e0af0; border: 2px solid #ff5a3a; border-radius: 99px; box-shadow: 0 4px 14px #000a; font: 16px var(--pixel); }
.recbar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5a3a; animation: recblink 1s steps(2) infinite; } .recbar small { color: var(--mute); font: 14px var(--pixel); }
.recbar button { padding: 2px 10px; font-size: 15px; } @keyframes recblink { 50% { opacity: .2; } }
/* round 20: in battle, who's speaking sits bottom left, clear of the hero skill buttons in the middle */
body[data-screen="battle"] .subtitle { left: max(12px, env(safe-area-inset-left)); right: auto; bottom: max(12px, env(safe-area-inset-bottom)); transform: none; max-width: min(380px, calc(50vw - 200px)); font-size: 15px; }
@media (max-width: 760px) { body[data-screen="battle"] .subtitle { bottom: auto; top: 96px; max-width: 70vw; } }
/* round 20: every modal has a fixed height (contents scroll inside), so a panel never jumps as its contents change.
   Wide panels (lists, hero pages) are taller; the three small alerts (confirm, claim, world cleared) are one fixed size. */
.modal > .panel { height: min(720px, calc(100vh - 96px)); height: min(720px, calc(100dvh - 96px)); max-height: none; overflow-y: auto; }
.modal > .panel.wide, #m-heroes .panel, #m-party .panel, #m-hero .panel, #m-beast .panel, #m-bestiary .panel, #m-build .panel, #m-gift .panel { height: min(860px, calc(100vh - 96px)); height: min(860px, calc(100dvh - 96px)); }
#m-result > .panel, #m-stage > .panel, #m-away > .panel { height: min(600px, calc(100dvh - 96px)); }
#m-confirm > .panel, #m-claim > .panel, #m-chapter > .panel { height: min(300px, calc(100dvh - 96px)); display: grid; align-content: center; }
#m-story > .dialog { height: auto; }
#m-build .btabs { position: sticky; top: -16px; z-index: 2; background: linear-gradient(#2e1d17, #2b1b15); padding-top: 6px; margin-top: 2px; }
.pop.ko { font-size: 40px; color: #fff4c0; text-shadow: 0 3px 0 #6a1a0a, 0 0 14px #ff8a3a, 0 0 2px #000; letter-spacing: 2px; animation: kopop .5s cubic-bezier(.2,1.8,.4,1); }
@keyframes kopop { from { font-size: 70px; opacity: 0; } }
/* round 20: summon cards, richer. The back: deep rift-purple with a gold double frame, corner studs, a turning ring and
   the crystal sigil, and a sheen that sweeps across. The front: a metallic frame in the rarity's metal, the hero on their
   splinter's light with a faint pattern, a rarity ribbon and a name plate; epics and legendaries shimmer. */
.rcard .back, .rcard .front { border: 0; border-radius: 12px; }
.rcard .back { --g: #d8a640; display: grid; place-items: center; overflow: hidden; animation: none;
  background: radial-gradient(circle at 50% 42%, #6a3ab0 0, #2a1450 45%, #12081f 80%), #12081f;
  box-shadow: inset 0 0 0 3px #12081f, inset 0 0 0 5px var(--g), inset 0 0 0 7px #12081f, inset 0 0 0 8px #8a6a2a, inset 0 0 30px #8a6af088, 0 6px 16px #000a; }
.rcard .back::before { content: ""; position: absolute; inset: 0; background: repeating-conic-gradient(from 0deg at 50% 42%, #ffffff08 0 6deg, transparent 6deg 18deg); }
.rcard .back::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, #ffffff30 48%, transparent 60%); background-size: 260% 100%; animation: cbsheen 2.6s linear infinite; }
@keyframes cbsheen { from { background-position: 160% 0; } to { background-position: -110% 0; } }
.cb-ring { position: absolute; top: 42%; left: 50%; width: 62%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 2px dashed #d8a64099; box-shadow: 0 0 0 6px #d8a64022, inset 0 0 18px #a46cff88; animation: cbspin 9s linear infinite; }
@keyframes cbspin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.cb-sigil { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%); width: 38%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(#3a2070, #160a2a); border: 2px solid var(--g); box-shadow: 0 0 16px #a46cffaa; }
.cb-sigil .ico { width: 64%; height: 64%; filter: drop-shadow(0 0 6px #8fd8ff); animation: cbpulse 1.6s ease-in-out infinite alternate; } @keyframes cbpulse { to { transform: scale(1.08); filter: drop-shadow(0 0 12px #8fd8ff); } }
.cb-title { position: absolute; bottom: 9%; left: 50%; transform: translateX(-50%); font: 15px var(--pixel); color: var(--g); letter-spacing: 2px; text-shadow: 0 2px 0 #000; white-space: nowrap; }
.rcard .front { --m1: #c8ccd8; --m2: #6a6e7a; padding: 5px; grid-template-rows: auto 1fr auto; gap: 0;
  background: linear-gradient(145deg, var(--m1), var(--m2) 45%, var(--m1) 55%, var(--m2)); box-shadow: 0 6px 18px #000a; }
.rcard.r-rare .front { --m1: #9ad4ff; --m2: #2a5a9a; } .rcard.r-epic .front { --m1: #e2b0ff; --m2: #5a2a9a; box-shadow: 0 0 22px var(--epic); } .rcard.r-legendary .front { --m1: #fff0b0; --m2: #b07a10; box-shadow: 0 0 32px var(--legendary); }
.rcard .front > * { position: relative; }
.rcard .front::before { content: ""; position: absolute; inset: 5px; border-radius: 8px; background:
  radial-gradient(ellipse at 50% 62%, color-mix(in srgb, var(--sp) 60%, transparent), transparent 62%),
  repeating-linear-gradient(135deg, #ffffff06 0 6px, transparent 6px 14px), linear-gradient(#2a1e34, #120a16); box-shadow: inset 0 0 0 1px #0008, inset 0 0 22px #000a; }
.rtop { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 2px auto 0; padding: 1px 10px; border-radius: 99px; background: #000a; font: 13px var(--pixel); color: var(--m1); }
.rtop .spl-ico { width: 16px; height: 16px; }
.rcard .rart { align-self: stretch; } .rcard .rart canvas { filter: drop-shadow(0 4px 0 #0008); }
.rname { display: grid; gap: 0; margin: 0 4px 4px; padding: 3px 4px; border-radius: 6px; background: linear-gradient(#000c, #0008); border-top: 1px solid color-mix(in srgb, var(--m1) 60%, transparent); }
.rname b { font: 16px/1.05 var(--pixel); color: #fff4d6; } .rname small { font-size: 12px; color: var(--crys); } .rname small.new { color: var(--go); font-weight: 700; }
.rnew { position: absolute !important; top: 8px; right: -4px; padding: 1px 8px; background: linear-gradient(#ff7a4a, #c0301a); color: #fff; font: 13px var(--pixel); border-radius: 4px 0 0 4px; box-shadow: 0 2px 0 #000a; transform: rotate(6deg); }
.rcard.r-epic .front::after, .rcard.r-legendary .front::after { content: ""; position: absolute; inset: 5px; border-radius: 8px; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 30%, #ff8ad855 40%, #8ad8ff55 48%, #ffe08a55 56%, transparent 66%); background-size: 260% 100%; animation: cbsheen 2.2s linear infinite; }
@media (prefers-reduced-motion: reduce) { .rcard .back::after, .cb-ring, .cb-sigil .ico, .rcard .front::after { animation: none; } }
/* round 20: either side of the map, the same world, blurred and dimmed, under a soft vignette, instead of flat grey */
#map-screen { background: #120c10; overflow: hidden; }
#map-screen::before { content: ""; position: absolute; inset: -60px; background: var(--mapbg) center / cover no-repeat; filter: blur(18px) brightness(.6) saturate(1.2); transform: scale(1.08); pointer-events: none; }
#map-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, #0a060899 100%); }
#map-screen > .map-wrap, #map-screen > .map-bar { z-index: 1; } #map-screen > .map-worlds { z-index: 3; }
.map img#map-img { box-shadow: 0 0 0 3px #00000088, 0 10px 40px #000c; }
/* round 21: stage rewards, clearly */
.rewards-box { display: grid; gap: 4px; margin: 6px 0; padding: 8px 10px; background: #0006; border: 1px solid var(--line); border-radius: 10px; }
.rwline { display: grid; grid-template-columns: 130px 1fr auto; gap: 8px; align-items: center; font-size: 15px; } .rwline small { color: var(--gold); font: 15px var(--pixel); }
.rwline .c { display: inline-flex; align-items: center; gap: 3px; } .rwline .chance { color: var(--mute); } .rwline.done { opacity: .55; } .rwline.done em { color: var(--go); font-style: normal; font-size: 13px; }
.rwline:nth-child(3):not(.done) { background: linear-gradient(90deg, #ffd84a22, transparent); border-radius: 6px; } .rwline:nth-child(3) small::before { content: "★ "; }
.sweepinfo { font-size: 14px; } .sweepinfo b { color: var(--gold); }
#btn-collect.empty { filter: grayscale(.7) brightness(.8); } #btn-collect.empty::after { display: none; }
@media (max-width: 520px) { .rwline { grid-template-columns: 1fr; gap: 0; } }
/* battle stats on the results screen */
.bstats { margin: 8px 0; } .bstats summary { cursor: pointer; font: 18px var(--pixel); color: var(--gold); }
.bstats table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 4px; }
.bstats th { font: 14px var(--pixel); color: var(--mute); text-align: left; padding: 2px 6px; font-weight: 400; }
.bstats td { padding: 3px 6px; white-space: nowrap; border-top: 1px solid #ffffff10; } .bs-hero { display: flex; align-items: center; gap: 6px; } .bs-hero canvas { border-radius: 6px; background: #0006; }
.bstats td b { font: 15px var(--pixel); margin-left: 6px; } .bsbar { display: inline-block; width: 56px; height: 6px; background: #0008; border-radius: 3px; overflow: hidden; vertical-align: middle; }
.bsbar i { display: block; height: 100%; } .bs-dealt .bsbar i { background: linear-gradient(90deg, #c0501a, #ffb13d); } .bs-healed .bsbar i { background: linear-gradient(90deg, #2a8a3a, #8dff7a); } .bs-taken .bsbar i { background: linear-gradient(90deg, #6a3a8a, #c79aff); }
.bstats td.best b::after { content: " ♛"; color: var(--gold); }
.perfect { text-align: center; color: var(--gold); font: 18px var(--pixel); margin: 6px 0; text-shadow: 0 2px 0 #000; }
@media (max-width: 520px) { .bsbar { width: 34px; } }
/* round 21: the world picker */
.map-worlds { flex-wrap: nowrap; max-width: calc(100vw - 24px); }
.worldsbtn { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 14px; font-size: 18px; border-color: var(--gold); }
.worldsbtn .wb-k { font-size: 13px; color: var(--mute); } .worldsbtn b { font-weight: 400; color: var(--gold); } .worldsbtn .wb-v { color: var(--gold); font-size: 12px; }
.worldsbtn.dark { border-color: #c79aff; } .worldsbtn.dark b { color: #e0c8ff; }
.wtoggle { display: inline-flex; gap: 0; margin: 0 0 10px; border: 2px solid var(--line); border-radius: 99px; overflow: hidden; }
.wtoggle button { border: 0; border-radius: 0; box-shadow: none; background: #1a0e0a; color: var(--mute); padding: 5px 16px; font: 16px var(--pixel); }
.wtoggle button.on { background: linear-gradient(#ffe08a, #e0a030); color: #2a1408; } .wtoggle button.on.dark { background: linear-gradient(#a46cff, #5a2aa0); color: #fff; }
.wtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.wtile { position: relative; display: grid; align-content: end; justify-items: start; gap: 2px; min-height: 140px; padding: 10px 12px; text-align: left; overflow: hidden; border-radius: 12px;
  border: 2px solid var(--line); background: var(--map) center / cover no-repeat, #1a0e0a; box-shadow: inset 0 -80px 60px -20px #000e, 0 4px 0 #000a; transition: transform .12s, box-shadow .12s; }
.wtile:hover { transform: translateY(-3px); box-shadow: inset 0 -80px 60px -20px #000e, 0 7px 0 #000a, 0 0 16px #ffd84a55; }
.wtile .wt-n { font: 13px var(--pixel); color: var(--mute); text-shadow: 0 2px 0 #000; } .wtile b { font: 22px/1.05 var(--pixel); color: #fff4d6; text-shadow: 0 2px 0 #000; font-weight: 400; }
.wt-p { display: grid; gap: 2px; width: 100%; } .wt-p small { font-size: 12px; color: #f2e2b8; } .wt-bar { height: 5px; background: #000a; border-radius: 3px; overflow: hidden; } .wt-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb13d, #ffe08a); }
.wtile.cur { border-color: var(--gold); box-shadow: inset 0 -80px 60px -20px #000e, 0 0 0 2px var(--gold), 0 0 18px #ffd84a66; }
.wtile.dark { border-color: #6a4a8a; } .wtile.dark .wt-bar i { background: linear-gradient(90deg, #6a2aa0, #c79aff); }
.wtile.locked { filter: grayscale(1) brightness(.5); cursor: not-allowed; } .wtile.locked:hover { transform: none; } .wt-lock { color: #f2e2b8; font-size: 13px; }
.wt-boss { position: absolute; top: 8px; right: 8px; } .wt-boss canvas { width: 34px; height: 34px; border-radius: 8px; border: 2px solid #000a; background: #0008; }
.wt-done { position: absolute; top: 8px; left: 10px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--go); color: #10200a; font: 700 14px var(--sans); }

/* round 22: a roomier results window (battle stats fit without a scrollbar) and party picker */
#m-result > .panel { width: min(780px, 100%); height: auto; max-height: calc(100dvh - 48px); }
#m-party > .panel { width: min(1180px, 100%); height: min(940px, calc(100dvh - 64px)); }
/* battle stats: fixed columns, the numbers right-aligned in a column of their own, the crown never moves anything */
.bstats table { table-layout: fixed; }
.bstats th:first-child, .bstats td.bs-hero { width: 30%; }
.bstats th { text-align: left; padding-left: 18px; }
.bstats th:first-child { text-align: left; padding-left: 6px; }
.bstats td { vertical-align: middle; height: 34px; }
.bstats td:not(.bs-hero) { text-align: right; position: relative; padding-left: 18px; padding-right: 24px; }
.bstats td:not(.bs-hero) .bsbar { float: left; margin-top: 6px; width: calc(100% - 64px); min-width: 40px; }
.bstats td b { display: inline-block; min-width: 48px; text-align: right; margin-left: 0; font-variant-numeric: tabular-nums; }
.bstats td.best b::after { content: "♛"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); color: var(--gold); font-size: 13px; }
.bstats td.bs-hero { display: table-cell; }
.bs-who { display: flex; align-items: center; gap: 8px; min-width: 0; } .bs-who canvas { border-radius: 6px; background: #0006; flex: none; }
.bs-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gday.cur { cursor: pointer; } .gday.cur:hover { filter: brightness(1.12); }
#btn-collect.nobadge::after { display: none; }
.bstats .bs-title { font: 18px var(--pixel); color: var(--gold); margin: 6px 0 2px; text-align: center; }
/* a faint divider between stat columns so each number clearly sits with its own bar */
.bstats td:not(.bs-hero) + td, .bstats th + th + th { border-left: 1px solid #ffffff12; }
/* round 23: a roomier stage window */
#m-stage > .panel { width: min(640px, 100%); height: auto; min-height: min(560px, calc(100dvh - 64px)); max-height: calc(100dvh - 48px); }
/* round 24: achievements */
.achheroes { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 6px; }
.achhero { display: flex; align-items: center; gap: 8px; background: #0003; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px 4px 4px; }
.achhero canvas { border-radius: 6px; } .achhero b { display: block; font-size: 14px; } .achhero small { color: var(--mute); }
.qrow .qrw .c canvas { border-radius: 4px; vertical-align: middle; }
#btn-quests.has-ach { position: relative; } #btn-quests.has-ach::after { content: "!"; position: absolute; top: -6px; right: -4px; width: 18px; height: 18px; border-radius: 9px; background: #e8402a; color: #fff; font: 13px/18px var(--pixel); text-align: center; }
.gtip { white-space: pre-line; }
/* round 25: the combined total of an attack that hit several targets */
.pop.total { font-size: 30px; color: #ffe9a8; text-shadow: 0 3px 0 #5a2a0a, 0 0 10px #ff9a3a88, 0 0 2px #000; letter-spacing: 1px; }
.pop.total.hurt { color: #ffb8a8; text-shadow: 0 3px 0 #4a0a0a, 0 0 10px #ff3a3a66, 0 0 2px #000; }
.sigline { margin: 2px 0 6px; font-size: 14px; color: var(--mute); } .sigline b { color: var(--gold); font-family: var(--pixel); font-weight: 400; }
details.lorebox.voices { display: block; } details.lorebox.voices[open] { display: grid; gap: 4px; } details.lorebox.voices .vline { width: 100%; }
/* round 27: the battle's time limit */
.btime { font: 20px var(--pixel); font-weight: 400; text-shadow: 0 2px 0 #000; background: #0008; padding: 2px 10px; border-radius: 8px; margin-left: 8px; font-variant-numeric: tabular-nums; }
.btime::before { content: "⏱ "; font-size: 16px; }
.btime.warn { color: #ffcf6a; } .btime.crit { color: #ff6a5a; animation: btpulse 1s ease-in-out infinite; }
@keyframes btpulse { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .btime.crit { animation: none; } }
/* ---------- round 28: the splinter gauntlets ---------- */
#m-gauntlet .panel { width: min(1040px, 100%); }
.ghead { border: 2px solid var(--sp); border-radius: 12px; padding: 12px 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--sp) 28%, #1a0e0a), #140a08 70%); display: grid; gap: 6px; margin-right: 40px; }
.gh-title { display: flex; align-items: center; gap: 10px; } .gh-title h2 { margin: 0; color: #fff3d8; } .gh-title small { color: var(--mute); } .gh-title .spl-ico { width: 34px; height: 34px; }
.gh-blurb { margin: 0; color: #e8dcc4; font-size: 15px; } .gh-stats { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gchip { background: #0006; border: 1px solid #ffffff22; border-radius: 999px; padding: 3px 10px; font: 15px var(--pixel); color: var(--gold); } .gchip small { color: var(--mute); font-family: inherit; }
.gtabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0 8px; }
.gtab { display: grid; gap: 2px; padding: 6px 4px; border-radius: 8px; background: #1a0e0a; border: 1px solid var(--line); text-align: center; }
.gtab b { font: 22px var(--pixel); color: var(--gold); } .gtab small { font-size: 12px; color: var(--mute); } .gtab.on { border-color: var(--gold); box-shadow: 0 0 0 2px #ffc94a55; } .gtab.locked { opacity: .5; } .gtab.done b { color: #8aff7a; }
.glist { display: grid; gap: 6px; }
.gtrial { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; background: #1a0e0a; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.gtrial.next { border-color: var(--gold); box-shadow: 0 0 12px #ffc94a44; } .gtrial.done { opacity: .8; } .gtrial.locked { opacity: .5; }
.gtrial.champ { background: linear-gradient(90deg, #3a1410, #1a0e0a 60%); border-color: #c0502a; }
.gt-n { display: grid; justify-items: center; } .gt-n b { font: 26px var(--pixel); color: var(--gold); } .gt-n small { font-size: 12px; color: var(--mute); white-space: nowrap; }
.gt-main { display: grid; gap: 4px; min-width: 0; } .gt-name { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .gt-name b { font: 17px var(--pixel); margin-right: 4px; }
.grule { font-size: 12px; padding: 1px 7px; border-radius: 999px; border: 1px solid; white-space: nowrap; cursor: help; }
.grule.good { color: #8aff9a; border-color: #3a8a4a; background: #0f2a14; } .grule.bad { color: #ff9a8a; border-color: #8a3a2a; background: #2a100c; } .grule.odd { color: #c8c0ff; border-color: #5a4a9a; background: #18122a; }
.gt-foes { display: flex; gap: 3px; flex-wrap: wrap; align-items: end; } .gt-foes canvas { border-radius: 5px; background: #2a1a20; } .gt-foes .boss canvas { box-shadow: 0 0 0 2px #ff6a3a; }
.gt-rw { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; font-size: 14px; } .gt-rw .c { display: inline-flex; gap: 3px; align-items: center; } .gt-rw .c canvas, .gt-rw .c img { width: 18px; height: 18px; }
.gt-rw .rr-k { font: 12px var(--pixel); color: var(--gold); opacity: .85; } .gt-rw .rr-k.got { color: #8aff7a; } .gt-rw .rr-k.circle { color: #ffb08a; }
.gtrial button { white-space: nowrap; } .gt-lock { font-size: 20px; }
.gnote { margin: 0 0 6px; padding: 6px 10px; border: 1px solid var(--sp); border-radius: 8px; background: #0005; display: flex; gap: 6px; align-items: center; font-size: 14px; }
@media (max-width: 640px) { .gtrial { grid-template-columns: 40px 1fr; } .gtrial > button, .gt-lock { grid-column: 1 / -1; } .gtabs small { display: none; } }
.brules { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; } .brules .grule { font-size: 12px; background-color: #000a; }
/* round 29: the welcome-back screen */
#m-away > .panel.away { width: min(640px, 100%); height: auto; max-height: calc(100dvh - 48px); background: radial-gradient(120% 80% at 50% 0%, #4a2e1a 0%, #2a1810 55%, #1a0e0a 100%); border-color: var(--gold); box-shadow: 0 0 0 3px #ffc94a33, 0 20px 60px #000c; }
.ahead { display: flex; gap: 14px; align-items: center; padding-right: 36px; }
.aportrait canvas { border-radius: 12px; border: 3px solid var(--gold); box-shadow: 0 0 18px #ffc94a55; background: #2a1a10; }
.ahead h2 { margin: 0 0 4px; font-size: 30px; color: var(--gold); } .aaway { color: var(--mute); font: 14px var(--pixel); letter-spacing: .04em; text-transform: uppercase; }
.abubble { position: relative; margin: 0; background: #fff3dc; color: #3a2414; border-radius: 12px; padding: 8px 12px; font-size: 15px; line-height: 1.4; }
.abubble::before { content: ""; position: absolute; left: -8px; top: 14px; border: 8px solid transparent; border-right-color: #fff3dc; border-left: 0; }
.atiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 16px 0; }
.atile { display: grid; justify-items: center; gap: 2px; padding: 10px 8px; border-radius: 10px; background: #0005; border: 1px solid var(--line); text-align: center; animation: atile .4s ease-out backwards; }
.atile:nth-child(2) { animation-delay: .06s; } .atile:nth-child(3) { animation-delay: .12s; } .atile:nth-child(4) { animation-delay: .18s; } .atile:nth-child(n+5) { animation-delay: .24s; }
.atile canvas, .atile > img:not([src*="town"]) { width: 30px; height: 30px; } .atile.built img { width: 76px; height: 56px; object-fit: contain; image-rendering: pixelated; }
.atile b { font: 22px var(--pixel); color: #fff3d8; } .atile small { color: var(--mute); font-size: 13px; line-height: 1.25; }
.atile.ready { border-color: #c0902a; background: linear-gradient(#3a2810aa, #1a0e0aaa); } .atile.ready b { color: #ffd76a; }
.atile.gift { border-color: #ff8ac8; } .atile.built b { color: #8aff9a; }
@keyframes atile { from { opacity: 0; transform: translateY(8px) scale(.96); } }
@media (prefers-reduced-motion: reduce) { .atile { animation: none; } }
.splbadge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 4px; border-radius: 999px; border: 1px solid var(--sp); background: color-mix(in srgb, var(--sp) 22%, #1a0e0a); color: #fff3d8; font-size: 13px; white-space: nowrap; width: fit-content; } .splbadge .spl-ico { width: 16px; height: 16px; }
/* round 29: tidy costs on build cards: small chips on one wrapping row, numbers shortened (1.5k), short ones in red */
.bcard .cost { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; margin: 2px 0; font-size: 15px; }
.bcard .cost .c { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px 1px 4px; border-radius: 999px; background: #0006; border: 1px solid #ffffff14; font: 16px var(--pixel); line-height: 1.2; white-space: nowrap; }
.bcard .cost .c canvas, .bcard .cost .c img { width: 16px; height: 16px; }
.bcard .cost .c.short { color: #ff8a7a; border-color: #8a3a2a66; }
/* round 39: long descriptions scroll inside their card instead of being cut off after four lines */
.bcard > small:not(.t) { display: block; max-height: calc(4 * 1.35em); line-height: 1.35; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; scrollbar-width: thin; scrollbar-color: #8a6a4a transparent; }
.bcard > small:not(.t)::-webkit-scrollbar { width: 5px; } .bcard > small:not(.t)::-webkit-scrollbar-thumb { background: #8a6a4a; border-radius: 3px; }
.bpanel .desc { max-height: 6.5em; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #8a6a4a transparent; }
.bcard em { font-size: 13px; }
/* a wider build window, so the tabs (with their badges) stay on one row */
#m-build > .panel { width: min(1180px, 100%); }
.rcard.tapme:not(.flip) { cursor: pointer; } .rcard.tapme:not(.flip):hover { transform: translateY(-4px) scale(1.02); transition: transform .15s; } .rcard.tapme:not(.flip):hover .back { box-shadow: 0 0 0 3px #ffc94a88, 0 0 24px #ffc94a66; } .hint.center { text-align: center; }
.gslot img.runic { filter: drop-shadow(0 0 3px #6ac8ff); }
/* round 31/32: Heroes search box, on the right of the resources row, with its own suggestions */
.hhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hhead #hero-count { flex: 1 1 auto; min-width: 0; }
.hsearch { position: relative; margin-left: auto; }
.hsearch input { width: 230px; max-width: 100%; box-sizing: border-box; padding: 6px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.35); color: inherit; font: inherit; }
.hsearch input:focus { outline: 2px solid #ffc94a; outline-offset: 1px; }
.hsugg { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; width: 260px; margin: 0; padding: 4px; list-style: none; background: #241710; border: 1px solid rgba(255,201,74,.45); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.hsugg li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 5px; cursor: pointer; }
.hsugg li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hsugg li small { opacity: .7; }
.hsugg li.unowned { opacity: .6; }
.hsugg li:hover, .hsugg li.on { background: rgba(255,201,74,.18); }
@media (max-width: 600px) { .hsearch { width: 100%; } .hsearch input, .hsugg { width: 100%; } }
/* round 32: Hammerhands pill, Inventory */
.pill.workers.full b { color: #ff7a6a; }
.pill.bagbtn b { font-size: 12px; }
.invn { position: absolute; right: 2px; bottom: 2px; min-width: 22px; padding: 1px 5px; border-radius: 10px; background: #1a110d; border: 1px solid var(--sp); font-size: 13px; text-align: center; }
.stars i.on.asc { color: #ff7ad1; text-shadow: 0 0 5px #ff4fb8, 0 0 1px #fff; }   /* round 32: ascended (pink) stars */
.pinkstar { color: #ff7ad1; text-shadow: 0 0 5px #ff4fb8; }
button.ascend { flex-wrap: wrap; }
button.ascend .c img.ico { max-height: 18px; }
.promo-stars .pstar.asc { color: #ff7ad1; text-shadow: 0 0 10px #ff4fb8, 0 0 2px #fff; }
.noworker { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 6px; background: rgba(255,90,70,.15); border: 1px solid rgba(255,110,90,.5); } .noworker img { max-height: 22px; }
.rr-k.relic img, .relicgot img { max-height: 20px; vertical-align: middle; }
.hhead #hero-count { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hhead #hero-count .have { margin: 0; }
/* round 34: Nightmare */
.chip.nightmode { background: linear-gradient(135deg, #3a1250, #12082a); border-color: #c8a0ff; color: #f0e0ff; box-shadow: 0 0 10px rgba(200,160,255,.35); }
.chip.nightmode.new { animation: nightpulse 1.6s ease-in-out infinite; }
@keyframes nightpulse { 50% { box-shadow: 0 0 18px rgba(220,170,255,.8); } }
.chip.worldsbtn.night, .wtoggle .night.on, .wtile.night { border-color: #c8a0ff; }
.wtoggle button.night { color: #e0c8ff; } .wtoggle button.night.on { background: #2a1240; color: #fff; }
#map-screen.night #map-img { filter: saturate(1.05) contrast(1.05); }
.grule.curse { background: rgba(160,90,255,.22); border-color: #b48aff; color: #ecdcff; }
.st-rules { flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }

/* round 37: the inventory as a grid of slots; a stack fills one slot, its count in the corner */
.invcap { display: flex; align-items: center; gap: 4px; margin: 0 0 10px; } .invcap b { font: 18px var(--pixel); color: var(--gold); } .invcap small { color: var(--mute); }
.invbar { flex: 1; max-width: 220px; height: 6px; margin-left: 10px; border-radius: 3px; background: #0008; border: 1px solid var(--line); overflow: hidden; } .invbar i { display: block; height: 100%; background: var(--gold); }
.invslots { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; max-width: 620px; }
.islot { position: relative; aspect-ratio: 1; border-radius: 6px; border: 2px solid #3a2a20; background: linear-gradient(#120a08, #1c120e); box-shadow: inset 0 2px 6px #000a; display: grid; place-items: center; }
.islot.empty { opacity: .55; }
.islot.full { cursor: help; border-color: color-mix(in srgb, var(--sp) 60%, #3a2a20); background: radial-gradient(circle, color-mix(in srgb, var(--sp) 30%, transparent), transparent 70%), linear-gradient(#120a08, #1c120e); }
.islot.full:hover, .islot.full:focus-visible { border-color: var(--sp); outline: none; transform: translateY(-1px); }
.islot img { max-width: 72%; max-height: 72%; image-rendering: pixelated; }
/* round 37: the build menu lists buildings you have the most of too, greyed out at the bottom */
.bcard.maxed { opacity: .5; filter: grayscale(.6); cursor: default; } .bcard.maxed:hover { opacity: .7; }
.bcard .tag.count.max { color: var(--mute); } .bcard em.maxnote { color: var(--mute); }
/* round 37: what's at stake on the party screen: conditions and rewards */
.stakes { display: grid; gap: 4px; margin: 2px 0 8px; padding: 8px 10px; border-radius: 8px; background: #0005; border: 1px solid var(--line); }
.stk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; }
.stk-row.done > :not(.stk-k) { opacity: .5; }
.stk-k { min-width: 84px; font: 12px var(--pixel); color: var(--gold); opacity: .9; cursor: help; }
.stk-rw { display: grid; gap: 3px; }
.stakes .c, .gt-rw .c.xpc { display: inline-flex; gap: 3px; align-items: center; cursor: help; } .stakes .c img, .stakes .c canvas { width: 18px; height: 18px; }
.stakes .chance { color: var(--mute); cursor: help; border-bottom: 1px dotted var(--line); }
.c.xpc { color: #9ad8ff; font-size: 14px; }
.grule.none { color: var(--mute); border-color: var(--line); background: #0004; }
.islot img.ico { width: 46px; height: 46px; max-width: none; max-height: none; object-fit: contain; }
#m-inv .panel { min-height: 0; height: auto; max-width: 680px; }

/* ------------------------------------------------------------------ round 38: research at the Athenaeum (full screen) */
.modal.full { padding: 0; place-items: stretch; z-index: 40; background: #07040a; }
.panel.research { width: 100%; max-width: none; height: 100%; max-height: none; border: 0; border-radius: 0; padding: 0; overflow-y: auto;
  background: radial-gradient(1200px 600px at 50% -10%, #2b1a3a 0%, transparent 60%), linear-gradient(#150d18, #0c0710 60%, #0a0609); }
.panel.research > .x { position: fixed; top: 14px; right: 16px; z-index: 3; }
.rs-rhead { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; align-items: end; padding: 28px clamp(16px, 4vw, 48px) 18px; min-height: 230px;
  background: linear-gradient(90deg, #0c0710f0 0%, #0c0710b0 45%, #0c071040 100%), linear-gradient(transparent 55%, #0c0710 100%), var(--hall) center 35% / cover no-repeat; border-bottom: 2px solid #c8a24a55; }
.rs-rtitle small { font: 14px var(--pixel); color: #c8a24a; letter-spacing: .08em; text-transform: uppercase; }
.rs-rtitle h2 { font: 54px var(--pixel); margin: 2px 0 4px; color: #ffe6a8; text-shadow: 0 3px 0 #000, 0 0 24px #ffb84a55; }
.rs-rtitle p { margin: 0; color: #e8dccb; max-width: 520px; text-shadow: 0 1px 2px #000; }
.rs-rhave { align-self: start; margin-right: 52px; } .rs-rhave .have { background: #0009; }
.rs-sslots { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rs-sslot { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #120b16d8; border: 1px solid #4a3a5a; min-height: 64px; backdrop-filter: blur(3px); }
.rs-sslot .rs-sico { width: 44px; height: 44px; flex: none; object-fit: contain; image-rendering: pixelated; display: grid; place-items: center; font-size: 20px; }
.rs-sslot .rs-sico.art { border-radius: 8px; background: #000a; border: 1px solid #c8a24a66; }
.rs-sslot b { display: block; font: 15px var(--pixel); color: #ffe6a8; } .rs-sslot small { color: var(--mute); }
.rs-sslot.busy { border-color: #c8a24a; box-shadow: 0 0 0 1px #c8a24a33, 0 0 18px #ffb84a22 inset; } .rs-sslot.busy .rs-sinfo { flex: 1; min-width: 0; }
.rs-sslot.locked { opacity: .55; border-style: dashed; } .rs-sslot.idle { border-color: #6a8a5a; }
.rs-sslot .gem { white-space: nowrap; }
.rs-rbar { display: block; height: 7px; margin: 4px 0 2px; border-radius: 4px; background: #000a; border: 1px solid #ffffff1a; overflow: hidden; }
.rs-rbar i { display: block; height: 100%; background: linear-gradient(90deg, #c8a24a, #ffe08a); box-shadow: 0 0 8px #ffd86a; transition: width .9s linear; }
.rs-rtabs { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px clamp(16px, 4vw, 48px); background: linear-gradient(#0c0710f2, #0c0710e0); border-bottom: 1px solid #ffffff12; backdrop-filter: blur(4px); }
.rs-rtab { display: flex; align-items: center; gap: 12px; text-align: left; padding: 8px 14px; border-radius: 12px; border: 2px solid #3a2e44; background: #160e1c; color: var(--ink); }
.rs-rtab img { width: 52px; height: 52px; object-fit: contain; image-rendering: pixelated; } .rs-rtab b { font: 20px var(--pixel); display: block; } .rs-rtab small { color: var(--mute); }
.rs-rtab.on { border-color: #c8a24a; background: linear-gradient(#2a1c22, #1a1018); box-shadow: 0 0 22px #ffb84a22; } .rs-rtab.on.heroes { border-color: #ff7a8a; box-shadow: 0 0 22px #ff5a7a22; }
.rs-rtree { display: grid; gap: 4px; padding: 10px clamp(16px, 4vw, 48px) 48px; }
.rs-rtier { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px dashed #ffffff14; }
.rs-rtier-k { display: grid; align-content: start; justify-items: center; text-align: center; gap: 4px; padding-top: 6px; position: relative; }
.rs-rtier-k b { font: 34px var(--pixel); color: #ffe6a8; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; border: 2px solid #c8a24a; background: radial-gradient(#3a2614, #160c08); box-shadow: 0 0 16px #ffb84a33; }
.rs-rtier-k small { font-size: 12px; color: var(--mute); } .rs-rtier-k small.need { opacity: .7; }
.rs-rtier.closed .rs-rtier-k b { border-color: #4a3a4a; color: #8a7a8a; box-shadow: none; background: #120c12; }
.rs-rcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.rs-rcard { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px; border-radius: 14px; background: linear-gradient(160deg, #241726, #150d18); border: 2px solid #3d2e46; position: relative; transition: transform .15s, border-color .15s, box-shadow .15s; }
.rs-rcard:hover { transform: translateY(-2px); border-color: #7a6488; }
.rs-rcard.ready { border-color: #c8a24a; box-shadow: 0 0 0 1px #c8a24a22, 0 6px 22px #ffb84a1c; }
.rs-rcard.busy { border-color: #ffd86a; box-shadow: 0 0 26px #ffd86a33; animation: rglow 2.4s ease-in-out infinite; }
@keyframes rglow { 50% { box-shadow: 0 0 34px #ffd86a55; } }
.rs-rcard.maxed { border-color: #5aa86a; background: linear-gradient(160deg, #1a2a1e, #101812); }
.rs-rcard.locked { filter: grayscale(.75) brightness(.8); } .rs-rcard.locked .rs-rart img { opacity: .6; }
.rs-rart { position: relative; width: 96px; height: 96px; border-radius: 12px; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--sp, #c8a24a) 30%, #2a1a2e), #0e0810 75%); border: 1px solid #ffffff1a; box-shadow: inset 0 0 18px #000c; }
.rs-rart img { width: 84px; height: 84px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 3px 4px #000a); }
.rs-rlv { position: absolute; right: -6px; bottom: -6px; min-width: 26px; padding: 1px 6px; border-radius: 10px; background: #1a110d; border: 1px solid #c8a24a; font: 13px var(--pixel); color: #ffe6a8; text-align: center; }
.rs-rbody { display: grid; gap: 3px; align-content: start; min-width: 0; }
.rs-rname { font: 18px var(--pixel); color: #ffe6a8; }
.rs-rpips { display: flex; gap: 3px; } .rs-rpips i { width: 14px; height: 6px; border-radius: 2px; background: #0008; border: 1px solid #ffffff22; } .rs-rpips i.on { background: #ffd86a; border-color: #ffd86a; box-shadow: 0 0 5px #ffd86a88; }
.rs-rdesc { color: var(--mute); font-style: italic; font-size: 13px; }
.rs-rnow, .rs-rnext, .rs-rdone { margin: 0; font-size: 14px; } .rs-rnow small, .rs-rnext small { font: 11px var(--pixel); color: #c8a24a; text-transform: uppercase; } .rs-rnext { color: #9ad8ff; } .rs-rdone { color: #8aff9a; font: 14px var(--pixel); }
.rs-rcost { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; } .rs-rcost .cost { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: 14px; } .rs-rcost .t { color: var(--mute); }
.rs-rcost .c img, .rs-rcost .c canvas { width: 16px; height: 16px; }
.rs-rgo { justify-self: start; margin-top: 4px; } .rs-rcard.locked .rs-rgo { font-size: 12px; opacity: .85; white-space: normal; text-align: left; }
.rs-rbusy small { color: #ffe08a; }
.pill.scholars { gap: 4px; } .pill.scholars.full b { color: var(--mute); }
.gt-btns { display: grid; gap: 4px; justify-items: stretch; } .gt-btns .sweep { font-size: 13px; }
.lib-recipe.locked { opacity: .6; } .lib-auto { margin-top: 12px; padding: 10px; border-radius: 8px; background: #0005; border: 1px solid var(--line); display: grid; gap: 4px; } .lib-auto small { color: var(--mute); }
.stk-row.prov .chip { font-size: 13px; padding: 2px 9px; display: inline-flex; align-items: center; gap: 4px; } .stk-row.prov .chip img { width: 14px; height: 14px; } .stk-row.prov .chip.short { opacity: .5; }
@media (max-width: 720px) {
  .rs-rhead { grid-template-columns: 1fr; min-height: 0; } .rs-rtitle h2 { font-size: 38px; } .rs-sslots { grid-template-columns: 1fr; }
  .rs-rtier { grid-template-columns: 1fr; } .rs-rtier-k { grid-template-columns: auto 1fr; justify-items: start; text-align: left; } .rs-rtier-k b { width: 44px; height: 44px; font-size: 24px; }
  .rs-rcards { grid-template-columns: 1fr; } .rs-blurb { display: none; } .rs-rtabs { padding-right: 64px; } .rs-rhave { margin-right: 0; } .rs-rtab b { font-size: 16px; } .rs-rtab img { width: 36px; height: 36px; }
}

/* round 39: the tomes pill's tooltip lists all three books */
.booktip { display: grid; grid-template-columns: 22px 44px 1fr; align-items: start; gap: 6px; margin: 4px 0; font-size: 14px; } .booktip img { width: 20px; height: 20px; image-rendering: pixelated; } .booktip > b { font: 15px var(--pixel); color: var(--gold); text-align: right; } .booktip small { color: var(--mute); }
.booktip span > b { font: 14px var(--sans, inherit); color: var(--ink); }

/* round 41: the Adventure screen (pick a mode) and the Rift's own world */
.modes-panel { width: min(1100px, 100%); }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.modetile { position: relative; display: grid; align-content: end; gap: 4px; min-height: 260px; padding: 16px; text-align: left; border-radius: 14px; border: 2px solid var(--line); overflow: hidden; color: var(--ink);
  background: linear-gradient(transparent 15%, #0b0608e8 70%), var(--map) center / cover no-repeat; image-rendering: pixelated; transition: transform .15s, border-color .15s, box-shadow .15s; }
.modetile:hover { transform: translateY(-3px); border-color: var(--gold); }
.modetile.go { border-color: var(--gold); box-shadow: 0 0 0 2px #ffd86a44, 0 8px 26px #ffb84a33; background: linear-gradient(transparent 15%, #0b0608e8 70%), var(--map) center / cover no-repeat; }
.modetile.dark:not(.locked):hover, .modetile.dark.go { border-color: #c79aff; } .modetile.night:not(.locked):hover, .modetile.night.go { border-color: #ff8ac8; } .modetile.rift:not(.locked):hover, .modetile.rift.go { border-color: #8ad8ff; }
.modetile.locked { filter: grayscale(.85) brightness(.6); }
.modetile .hk { position: absolute; top: 10px; left: 10px; }
.mt-name { font: 26px var(--pixel); color: #ffe6a8; text-shadow: 0 2px 0 #000; } .mt-blurb { color: #e8dccb; font-size: 14px; }
.mt-prog { font: 15px var(--pixel); color: var(--gold); } .mt-where, .mt-next { color: var(--mute); font-size: 13px; } .mt-lock { color: #ffb0a0; font-size: 13px; }
.mt-tag { position: absolute; top: 10px; right: 10px; font: 12px var(--pixel); padding: 2px 8px; border-radius: 99px; background: var(--gold); color: #2a1a0a; }
.wtoggle button.rift.on { background: #1e3a4a; color: #bfeaff; }
.wtile.riftw { border-color: #4a7a8a; }
#map-screen.riftw .worldsbtn { border-color: #8ad8ff; } #map-screen.riftw .worldsbtn b { color: #bfeaff; }
.road.riftroad line { stroke-dasharray: 2 14; stroke-linecap: round; } .road.riftroad line.open { stroke: #bfeaff; filter: drop-shadow(0 0 4px #8ad8ff); }
.node .rcheck { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: #2a8a3a; border: 1px solid #bfffbf; color: #fff; font-size: 11px; line-height: 1; }
.mt-tag.new { background: #e04a3a; color: #fff; }
.trade.soldout { opacity: .55; filter: grayscale(.4); }
.stk-row.warnrow > span { color: #ffb08a; cursor: help; }

/* ---------------------------------------------------------------- round 46: the splinter wheel */
.lesson { position: fixed; inset: 0; z-index: 89; display: grid; place-items: center; padding: 16px; overflow: auto; outline: none; animation: ls-in .6s ease-out; }
.lesson.out { animation: ls-out .45s ease-in forwards; }
@keyframes ls-in { from { opacity: 0; } } @keyframes ls-out { to { opacity: 0; } }
.ls-bg { position: fixed; inset: -4%; background: #000 center / cover no-repeat; image-rendering: pixelated; filter: saturate(1.05) brightness(.62); animation: ls-pan 38s ease-in-out infinite alternate; }
@keyframes ls-pan { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.1) translate(-1.5%, -1%); } }
.ls-vig { position: fixed; inset: 0; background: radial-gradient(ellipse at 50% 45%, #0000 30%, #0a0508cc 85%), linear-gradient(#0000 60%, #0a0508aa); pointer-events: none; }
.ls-card { position: relative; width: min(1040px, 100%); background: linear-gradient(#24150fee, #160c0af2); border: 2px solid #c8963a; border-radius: 16px; padding: 18px 24px 16px;
  box-shadow: 0 0 0 4px #3a2414, 0 0 0 6px #c8963a55, 0 24px 80px #000c, inset 0 0 40px #ffb04a14; animation: ls-card .7s cubic-bezier(.2, 1.2, .4, 1) both .1s; }
@keyframes ls-card { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.ls-card::before, .ls-card::after { content: ""; position: absolute; width: 22px; height: 22px; border: 3px solid var(--gold); top: 8px; left: 8px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; opacity: .8; }
.ls-card::after { left: auto; right: 8px; border-left: 0; border-right: 3px solid var(--gold); border-radius: 0 6px 0 0; }
.ls-head { text-align: center; margin-bottom: 4px; } .ls-head small { color: #e0b870; letter-spacing: 3px; text-transform: uppercase; font-size: 14px; }
.ls-head h2 { margin: 0; font: 46px/1 var(--pixel); color: #ffe6a8; text-shadow: 0 3px 0 #5a2a0a, 0 0 18px #ffb04a66; letter-spacing: 1px; }
.ls-main { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 18px; align-items: center; }
.ls-tri { position: relative; width: 100%; aspect-ratio: 400 / 360; }
.ls-tri-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ls-arrow { fill: none; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 10 8; animation: ls-flow 1s linear infinite, ls-lit 2.7s ease-in-out infinite; }
.ls-arrow-glow { fill: none; stroke-width: 14; stroke-linecap: round; opacity: 0; filter: blur(5px); animation: ls-glow 2.7s ease-in-out infinite; }
.ls-beats { font: 22px var(--pixel); text-anchor: middle; paint-order: stroke; stroke: #160c0a; stroke-width: 5px; animation: ls-lit 2.7s ease-in-out infinite; }
@keyframes ls-flow { to { stroke-dashoffset: -18; } }
@keyframes ls-lit { 0%, 100% { opacity: .55; } 15%, 30% { opacity: 1; } }
@keyframes ls-glow { 0%, 100% { opacity: 0; } 15%, 30% { opacity: .55; } }
.ls-node { position: absolute; width: 30%; display: grid; justify-items: center; transform: translate(-50%, -50%); animation: ls-pop .6s cubic-bezier(.2, 1.8, .4, 1) both; }
.ls-node.n0 { left: 50%; top: 17.2%; } .ls-node.n1 { left: 84.5%; top: 82.8%; } .ls-node.n2 { left: 15.5%; top: 82.8%; }
@keyframes ls-pop { from { opacity: 0; transform: translate(-50%, -50%) scale(.4); } }
.ls-emb { width: 100%; max-width: 112px; image-rendering: pixelated; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--sp, #fff) 70%, transparent)) drop-shadow(0 4px 0 #0008); animation: ls-bob 3.2s ease-in-out infinite; }
.ls-node.n1 .ls-emb { animation-delay: -1s; } .ls-node.n2 .ls-emb { animation-delay: -2s; }
@keyframes ls-bob { 50% { transform: translateY(-4px); } }
.ls-node b { font: 24px/1 var(--pixel); color: var(--sp); text-shadow: 0 2px 0 #000, 0 0 8px #000; margin-top: -2px; }
.ls-rules { display: grid; gap: 10px; }
.ls-rule { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: #0e0806aa; border: 2px solid #6a4632; }
.ls-rule i { font: 36px/1 var(--pixel); font-style: normal; text-align: center; }
.ls-rule b { font: 24px/1.05 var(--pixel); letter-spacing: .3px; } .ls-rule p { margin: 2px 0 0; color: var(--mute); font-size: 17px; line-height: 1.35; }
.ls-rule em { font-style: normal; font-weight: 700; }
.ls-rule.up { border-color: #5fbf5a; background: linear-gradient(90deg, #1a3a14cc, #0e0806aa 70%); } .ls-rule.up i, .ls-rule.up em { color: #8aff7a; }
.ls-rule.down { border-color: #c8503a; background: linear-gradient(90deg, #3a1410cc, #0e0806aa 70%); } .ls-rule.down i, .ls-rule.down em { color: #ff8a6a; }
.ls-rule.neu { border-color: #8a84a0; } .ls-rule.neu i { color: #c8c0e0; } .ls-emb.sm { width: 48px; animation: none; filter: drop-shadow(0 0 6px #b9b4c8aa); }
.ls-note { margin: 0; font-size: 15px; color: #c9b89a; font-style: italic; }
.ls-march { display: grid; grid-template-columns: auto auto 1fr; gap: 18px; margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: #0e0806aa; border: 1px solid #6a4632; align-items: start; }
.ls-col .lbl { display: block; color: #e0b870; margin-bottom: 4px; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; }
.ls-foes { display: flex; flex-wrap: wrap; gap: 8px; }
.ls-foe { position: relative; display: grid; justify-items: center; width: 60px; text-align: center; }
.ls-foe canvas { background: #1a0e0a; border: 2px solid var(--line); border-radius: 8px; } .ls-foe small { font-size: 13px; color: var(--mute); line-height: 1.1; }
.ls-foe.up canvas { border-color: #5fbf5a; box-shadow: 0 0 8px #5fbf5a88; } .ls-foe.down canvas { border-color: #c8503a; box-shadow: 0 0 8px #c8503a88; }
.ls-fsp { position: absolute; top: -4px; right: 0; width: 18px; height: 18px; image-rendering: pixelated; filter: drop-shadow(0 1px 0 #000); }
.ls-mark { position: absolute; top: 28px; left: -2px; font: 20px/1 var(--pixel); text-shadow: 0 2px 0 #000; color: #c9b89a; } .ls-foe.up .ls-mark { color: #8aff7a; } .ls-foe.down .ls-mark { color: #ff8a6a; }
.ls-adv { display: grid; gap: 6px; align-content: center; font-size: 17px; }
.ls-speaker { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin-top: 12px; padding: 10px 14px; background: #0a0506cc; border: 2px solid #c8963a88; border-radius: 12px; }
.ls-por canvas { width: 64px; height: 64px; border: 2px solid #c8963a; border-radius: 10px; background: radial-gradient(#6a3a1a, #1a0e0a); }
.ls-speaker small { color: var(--gold); font: 18px var(--pixel); } .ls-sub { margin: 0; min-height: 2.7em; font-size: 18px; line-height: 1.35; cursor: pointer; }
.ls-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.ls-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .lesson { place-items: start center; } .ls-card { padding: 14px 14px 12px; } .ls-head h2 { font-size: 34px; }
  .ls-main { grid-template-columns: 1fr; } .ls-tri { max-width: 320px; margin: 0 auto; } .ls-march { grid-template-columns: 1fr; gap: 10px; }
  .ls-rule { grid-template-columns: 40px 1fr; padding: 8px 10px; } .ls-rule b { font-size: 21px; } .ls-rule p { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .ls-bg, .ls-arrow, .ls-arrow-glow, .ls-beats, .ls-emb { animation: none; } .ls-arrow { opacity: 1; } }
/* the fight preview's splinter line, hero badges, stage panel, bestiary, battle */
.mu-txt, .mu-bring, .mu-avoid, .mu-party { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mu-bring { color: #8aff7a; font-weight: 600; } .mu-avoid { color: #ff8a6a; font-weight: 600; } .mu-g { color: var(--mute); }
.mu-party em { font-style: normal; font-weight: 600; } .mu-party em.up { color: #8aff7a; } .mu-party em.down { color: #ff8a6a; } .mu-party:not(:has(em)) { color: var(--mute); }
.murow { gap: 10px; align-items: center; flex-wrap: wrap; } .mu-how { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.mu-how .ico { width: 22px; height: 22px; }
.mu-badge { position: absolute; top: 4px; right: 6px; font: 22px/1 var(--pixel); text-shadow: 0 2px 0 #000; z-index: 2; }
.mu-badge.up { color: #8aff7a; } .mu-badge.down { color: #ff8a6a; }
.pslot .mu-badge { top: 2px; left: 4px; right: auto; font-size: 20px; }
.hcard .mu-badge { right: 30px; }
.st-match { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 4px 0 8px; padding: 6px 10px; border-radius: 10px; background: #1a0e0a; border: 1px solid var(--line); font-size: 17px; }
.foe { position: relative; } .foesp { position: absolute; top: -4px; right: 6px; width: 18px; height: 18px; image-rendering: pixelated; filter: drop-shadow(0 1px 0 #000); }
.pop.elem-up { color: #b8ff8a; } .pop.elem-up.crit { color: #ffe04a; } .pop.elem-down { color: #b8b0c8; opacity: .9; }
