/* Idle Dungeon v2 — tabbed, mobile-first layout on top of style.css tokens. */
:root { --gold: #ffd24a; --dia: #7de3ff; --ember: #ff9d3c; --rare: #5fb8ff; --epic: #c77dff; --leg: #ffb347; --blood: #ff3b5c; }
body.dungeon { background: radial-gradient(1200px 600px at 50% -200px, #2a1a3a 0%, var(--bg) 60%); }
.boot { position: fixed; inset: 0; display: grid; place-items: center; font-size: 40px; background: var(--bg); z-index: 200; animation: bob 1.2s ease-in-out infinite; }
.boot[hidden] { display: none; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.dlogo { font-family: 'Cinzel', 'Inter', serif; letter-spacing: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: 'JetBrains Mono', monospace; }
.btn.tiny { padding: 6px 10px; font-size: 12px; }
.landing-links { text-align: center; margin: 18px 0; font-size: 12px; }
.landing-links a { color: var(--muted); text-decoration: none; }
.hero-points li b, .hero-tagline b { color: var(--gold); }

/* ── Top bar ── */
.dview { max-width: 1120px; margin: 0 auto; padding: 8px 12px 90px; }
.dtop { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0 8px; flex-wrap: wrap; }
.dbrand { display: flex; align-items: center; gap: 8px; }
.devbar { display: inline-flex; gap: 4px; margin-left: 6px; }
.devbar[hidden] { display: none; }
.devbar .btn { border-color: rgba(255,157,60,.5); color: var(--ember); padding: 3px 7px; font-size: 11px; }
.lvl-pill { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 800; color: var(--gold); }
.dwallet { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wchip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; font-size: 12.5px; font-family: 'JetBrains Mono', monospace; white-space: nowrap; transition: transform .15s; }
.wchip.dia { border-color: rgba(125,227,255,.35); color: var(--dia); }
.wchip.gold { border-color: rgba(255,210,74,.35); color: var(--gold); }
.wchip.runes { color: #d6a8ff; }
.wchip.bump { animation: chipBump .35s ease; }
@keyframes chipBump { 30% { transform: scale(1.12); } }

/* ── Blood Moon strip ── */
.moon-strip { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; background: linear-gradient(90deg, rgba(255,59,92,.12), rgba(40,20,60,.4)); border: 1px solid rgba(255,59,92,.25); border-radius: 12px; padding: 7px 12px; margin-bottom: 8px; }
.moon-strip.peak { border-color: var(--blood); box-shadow: 0 0 22px rgba(255,59,92,.25); }
.moon-strip.surge { border-color: var(--gold); box-shadow: 0 0 22px rgba(255,210,74,.3); background: linear-gradient(90deg, rgba(255,210,74,.16), rgba(40,20,60,.4)); }
.moon-left { display: flex; align-items: center; gap: 8px; }
.moon-ico { font-size: 22px; }
.moon-t { font-weight: 800; font-size: 13px; }
.moon-s { font-size: 11.5px; color: var(--muted); }
.moon-bar { height: 6px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; min-width: 60px; }
.moon-bar > div { height: 100%; background: linear-gradient(90deg, #7a2540, var(--blood)); width: 0; transition: width .6s; }
.bazaar { display: flex; gap: 6px; font-size: 11px; font-family: 'JetBrains Mono', monospace; }
.bazaar span { background: rgba(0,0,0,.3); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.bazaar .up { color: #7dffb0; } .bazaar .dn { color: #ff8a8a; }
@media (max-width: 640px) {
  .moon-strip { grid-template-columns: 1fr; padding: 6px 10px; gap: 6px; }
  .moon-bar { display: none; }
  .moon-t { font-size: 12px; } .moon-s { font-size: 11px; }
  .bazaar { overflow-x: auto; }
  .dtop { flex-direction: column; align-items: stretch; gap: 6px; }
  .dwallet { justify-content: space-between; flex-wrap: nowrap; }
  .wchip { padding: 4px 8px; font-size: 11.5px; }
  .btn.tiny { padding: 5px 8px; }
  .chests .chest { width: 58px; height: 58px; font-size: 28px; }
  .chests { gap: 6px; }
  .row-head h3 { font-size: 14px; }
}
.combat-log { min-height: 0; margin-top: 4px; }

/* ── Tabs ── */
.dtabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 10px; position: sticky; top: 6px; z-index: 20; }
.dtab { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; background: transparent; border: 0; color: var(--muted); font: inherit; font-weight: 700; font-size: 13px; padding: 9px 6px; border-radius: 10px; cursor: pointer; }
.dtab.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.dtab .badge { position: absolute; top: 3px; right: 8px; min-width: 17px; height: 17px; border-radius: 999px; background: var(--ember); color: #1a0c00; font-size: 10.5px; font-weight: 800; font-style: normal; display: grid; place-items: center; padding: 0 4px; }
.dtab .badge[hidden] { display: none; }
@media (max-width: 640px) {
  .dtabs { position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto; margin: 0; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
  .dtab { flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 2px; }
  .dtab .badge { right: 10px; }
}
.dpanel { display: none; }
.dpanel.on { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Coach ── */
.coach { display: flex; align-items: center; gap: 12px; background: linear-gradient(90deg, rgba(255,157,60,.16), rgba(255,210,74,.06)); border: 1px solid var(--ember); border-radius: 14px; padding: 10px 14px; margin-bottom: 8px; box-shadow: 0 0 24px rgba(255,157,60,.12); }
.coach-ico { font-size: 28px; flex: none; animation: bob 2s ease-in-out infinite; }
.coach-body { flex: 1; min-width: 0; }
.coach-text { font-weight: 700; font-size: 14px; line-height: 1.35; }
.coach-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.coach .btn { flex: none; }

/* ── Stage ── */
.stage-wrap { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #000; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
#rpg-fight.stage { display: block; width: 100%; height: clamp(220px, 42vw, 400px); background: #0e0b14; }
.stage-hud { position: absolute; inset: 0; pointer-events: none; }
/* Bottom-left: the renderer paints the hero HP bar top-left, so the biome box sits below. */
.hud-biome { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); border-radius: 10px; padding: 6px 10px; min-width: 180px; max-width: 60%; }
.hud-name { font-family: 'Cinzel', serif; font-weight: 900; font-size: 13px; letter-spacing: .3px; text-shadow: 0 1px 2px #000; }
.hud-lvl { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #ddd; margin-top: 3px; }
.hud-bar { flex: 1; height: 6px; background: rgba(255,255,255,.12); border-radius: 4px; overflow: hidden; }
.hud-bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--ember), var(--gold)); transition: width .3s; }
.hud-bar > div.wall { background: #c8443c; }
.hud-chest { position: absolute; right: 10px; top: 10px; width: 46px; height: 46px; }
.hud-chest svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.hud-chest .ring-bg { fill: rgba(0,0,0,.45); stroke: rgba(255,255,255,.15); stroke-width: 3; }
.hud-chest .ring-fg { fill: none; stroke: var(--gold); stroke-width: 3; stroke-dasharray: 100.5; stroke-dashoffset: 100.5; stroke-linecap: round; transition: stroke-dashoffset .3s; }
.hud-chest span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; }
.hud-chest.full span { animation: chestWobble 1s ease-in-out infinite; }
.boss-banner { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); background: rgba(20,0,0,.8); border: 2px solid var(--blood); border-radius: 12px; padding: 8px 18px; text-align: center; animation: bossIn .6s ease; box-shadow: 0 0 30px rgba(255,59,92,.5); }
.boss-banner b { display: block; font-family: 'Cinzel', serif; color: var(--blood); font-size: 18px; letter-spacing: 2px; }
.boss-banner span { font-size: 12px; color: #fcc; }
.boss-banner[hidden] { display: none; }
@keyframes bossIn { from { transform: translateX(-50%) scale(1.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.moon-tint { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 50% at 50% 0%, rgba(255,59,92,.35), transparent 70%); opacity: 0; transition: opacity 1.5s; mix-blend-mode: screen; }
.readout { background: var(--panel); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; padding: 8px 12px 10px; margin: -6px 0 12px; }
.cf-top { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; }
.cf-hpbar { height: 7px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; margin: 4px 0 6px; }
.cf-hpbar > div { height: 100%; background: linear-gradient(90deg, #c8443c, #ff7a6b); width: 100%; transition: width .12s; }
.bl-line { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.combat-log { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 1px; max-height: 64px; overflow: hidden; }
.combat-log .g { color: var(--gold); } .combat-log .d { color: var(--dia); } .combat-log .r { color: #ff8a8a; }

/* ── Chests ── */
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 6px; }
.row-head h3 { margin: 0; font-size: 15px; }
.row-head small { color: var(--muted); font-weight: 400; font-size: 12px; }
.row-hint { font-size: 11.5px; color: var(--muted); text-align: right; }
.row-actions { display: flex; gap: 6px; }
.chests { display: flex; gap: 8px; flex-wrap: wrap; min-height: 76px; }
.chest { position: relative; width: 72px; height: 72px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer; font-size: 34px; transition: transform .12s, box-shadow .2s; }
.chest:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 0 18px rgba(255,210,74,.35); border-color: var(--gold); }
.chest:active { transform: scale(.95); }
.chest .biome { position: absolute; bottom: 3px; right: 5px; font-size: 9px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.chest.wob { animation: chestWobble 1.4s ease-in-out infinite; }
.chest.new { animation: chestDrop .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes chestWobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes chestDrop { from { transform: translateY(-40px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.chest.slot { border-style: dashed; opacity: .35; cursor: default; font-size: 20px; color: var(--muted); }
.chest.slot:hover { transform: none; box-shadow: none; border-color: var(--line); }
.chests-empty { color: var(--muted); font-size: 12.5px; align-self: center; padding: 8px 0; }
.porter { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 8px 0 4px; font-size: 12.5px; flex-wrap: wrap; }
.porter.on { border-color: var(--gold); }
.porter b { color: var(--gold); }

/* ── Relics ── */
.satchel-how { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.relics { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; min-height: 40px; }
.relic { display: grid; grid-template-columns: 56px 1fr; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px; position: relative; overflow: hidden; }
.relic canvas { width: 56px; height: 56px; border-radius: 10px; background: #0a0812; }
.relic .rn { font-weight: 800; font-size: 13px; line-height: 1.25; }
.relic .rq { font-size: 11px; color: var(--muted); margin: 2px 0 6px; }
.relic .rq b { color: var(--dia); font-family: 'JetBrains Mono', monospace; }
.relic .racts { display: flex; gap: 5px; flex-wrap: wrap; }
.relic .racts .btn { padding: 5px 8px; font-size: 11.5px; }
.relic[data-r="rare"] { border-color: rgba(95,184,255,.5); }
.relic[data-r="epic"] { border-color: rgba(199,125,255,.6); box-shadow: 0 0 16px rgba(199,125,255,.2); }
.relic[data-r="legendary"] { border-color: var(--leg); box-shadow: 0 0 22px rgba(255,179,71,.35); }
.relic[data-r="legendary"]::before { content: ''; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent 70%, rgba(255,179,71,.25), transparent); animation: spin 4s linear infinite; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.rtag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.08); }
.rtag.rare { color: var(--rare); } .rtag.epic { color: var(--epic); } .rtag.legendary { color: var(--leg); background: rgba(255,179,71,.15); }
.r-rare { color: var(--rare); font-style: normal; } .r-epic { color: var(--epic); font-style: normal; } .r-leg { color: var(--leg); font-style: normal; }
.relics-empty { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; padding: 8px 0; }

/* Relic reveal modal */
.relic-card-m { max-width: 380px; }
.relic-reveal { display: grid; place-items: center; margin: 6px 0 8px; }
.relic-reveal canvas { width: 160px; height: 160px; border-radius: 20px; background: radial-gradient(circle, #1d1430, #0a0812); animation: revealPop .55s cubic-bezier(.2,1.5,.4,1); }
@keyframes revealPop { from { transform: scale(.3) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
.relic-rar { font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.relic-acts { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.relic-acts .btn { width: 100%; }

/* ── Map ── */
.map-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.map-head h3 { margin: 0; font-family: 'Cinzel', serif; font-size: 18px; }
.map-head p { margin: 2px 0 0; font-size: 12.5px; }
.map-stats { display: flex; gap: 6px; }
.map-stats span { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 11.5px; }
.map-stats b { color: var(--gold); }
.map { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; position: relative; }
.node { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; position: relative; cursor: pointer; transition: transform .12s, box-shadow .2s; }
.node:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.node canvas { display: block; width: 100%; height: 96px; }
.node.future canvas { filter: grayscale(1) brightness(.35); }
.node.next canvas { filter: brightness(.7); }
.node .nb { padding: 7px 9px 9px; }
.node .nt { font-weight: 800; font-size: 12.5px; line-height: 1.2; }
.node .ns { font-size: 11px; color: var(--muted); margin-top: 2px; }
.node .ns b { color: var(--gold); }
.node .tag { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,.6); }
.node.active { border-color: var(--ember); box-shadow: 0 0 20px rgba(255,157,60,.3); }
.node.active .tag { background: var(--ember); color: #1a0c00; }
.node.mastered { border-color: rgba(255,210,74,.6); }
.node.mastered .tag { background: var(--gold); color: #1a1200; }
.node.next { border-color: rgba(255,255,255,.25); border-style: dashed; }
.node .hud-bar { margin-top: 5px; height: 4px; }
.node .nact { margin-top: 6px; }
.node .nact .btn { width: 100%; padding: 5px 6px; font-size: 11.5px; }
.region-h { grid-column: 1 / -1; font-family: 'Cinzel', serif; font-size: 13px; letter-spacing: 2px; color: var(--muted); margin: 8px 0 -2px; display: flex; align-items: center; gap: 10px; }
.region-h::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ── Hero ── */
.hero-grid { display: grid; grid-template-columns: 280px 1fr; gap: 12px; }
@media (max-width: 760px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.hero-card .hero-portrait { display: block; width: 100%; height: 260px; border-radius: 12px; background: radial-gradient(circle at 50% 80%, #2a1a3a, #0e0b14); }
.hero-xp { margin: 10px 0; font-size: 12.5px; font-weight: 700; }
.hero-xp .hud-bar { margin: 4px 0; height: 7px; }
.hero-xp small { color: var(--muted); font-weight: 400; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.hero-stats .hs { background: var(--panel-2); border-radius: 8px; padding: 5px 8px; display: flex; justify-content: space-between; font-size: 12px; }
.hero-stats .hs .k { color: var(--muted); } .hero-stats .hs .v { font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.hero-bonus { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.hero-bonus b { color: var(--gold); }
.shop { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px; min-width: 0; }
.stabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.stab { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.stab.on { background: var(--panel-2); color: var(--text); border-color: var(--ember); }
.gtabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 10px; padding-bottom: 2px; }
.gtab { flex: none; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; display: flex; gap: 5px; align-items: center; }
.gtab.on { color: var(--text); border-color: var(--gold); }
.gtab[data-tier="-1"] .gtab-ic { opacity: .4; }
/* STORY transition card: black screen + white text, fading in/out between beats. */
.story-fade { position: fixed; inset: 0; z-index: 400; background: #05030a; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 28px 20px; text-align: center; opacity: 0; transition: opacity .9s ease; cursor: pointer; }
.story-fade.show { opacity: 1; }
.story-fade[hidden] { display: none; }
.story-fade p { max-width: 32em; margin: 0; color: #f5edd8; font-family: Cinzel, Georgia, serif; font-size: clamp(16px, 2.6vw, 22px); line-height: 1.65; }
.story-fade .story-skip { color: #6a6376; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
/* Inline pixel icons (chest / gold chest) — replace 📦/🧰 in headings, coach + log. */
.pix-ico { width: 18px; height: 18px; object-fit: contain; image-rendering: pixelated; vertical-align: -3px; }
/* Sprite tab icons (equipped item / grey silhouette) — replace the emoji set. */
.gtab-ic .icimg { display: block; margin: 0 auto; width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.item { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.item.on { border-color: var(--gold); }
.item.locked { opacity: .55; }
.item.rune { border-color: rgba(214,168,255,.4); }
.item .ih { display: flex; gap: 8px; align-items: center; }
.item .ic { font-size: 22px; }
/* Real item-sprite card icons (window.__itemIcon data-URIs) — crisp pixels, no blur. */
.item .ic .icimg { display: block; width: 34px; height: 34px; object-fit: contain; image-rendering: pixelated; }
.item .in { font-weight: 800; font-size: 12.5px; line-height: 1.2; }
.item .il { font-size: 10.5px; color: var(--muted); }
.item .ib { font-size: 12px; }
.item .ib b { color: var(--gold); }
.item .im { font-size: 11px; color: var(--muted); }
.item .ia { display: flex; gap: 4px; margin-top: auto; padding-top: 4px; }
.item .ia .btn { flex: 1; padding: 5px 6px; font-size: 11.5px; }
.item .tier { position: absolute; top: 6px; right: 8px; font-size: 9.5px; color: var(--muted); }

/* ── Earn ── */
.earn-grid, .vault-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .earn-grid, .vault-grid { grid-template-columns: 1fr; } }
.ecard { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-width: 0; }
.ecard h3 { margin: 0 0 4px; font-size: 15px; }
.ecard > p.muted { margin: 0 0 10px; font-size: 12.5px; }
.missions { display: flex; flex-direction: column; gap: 6px; }
.mission { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.mission.done { opacity: .5; }
.mission.claimable { border-color: var(--gold); box-shadow: 0 0 16px rgba(255,210,74,.18); }
.mission .ico { font-size: 20px; flex: none; }
.mission .body { flex: 1; min-width: 0; }
.mission .t { font-weight: 700; font-size: 12.5px; }
.mission .d { color: var(--muted); font-size: 11px; line-height: 1.3; }
.mission .hud-bar { margin-top: 4px; height: 4px; }
.mission .r { flex: none; text-align: right; font-size: 12px; color: var(--gold); font-weight: 800; }
.mission .r .btn { display: block; margin-top: 3px; }
.earn-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.earn-row:first-of-type { border-top: 0; }
.earn-row .mono { color: var(--gold); font-size: 12px; }

/* ── Vault ── */
.vault-main { grid-column: 1 / -1; }
.vault-bal { font-family: 'JetBrains Mono', monospace; font-size: 26px; font-weight: 700; color: var(--dia); margin: 4px 0; }
.vault-bal span { font-size: 14px; color: var(--muted); }
.vault-bar { height: 8px; margin: 8px 0 10px; }
.vault-bar > div { background: linear-gradient(90deg, #2a8ba8, var(--dia)); }
.claims { margin-top: 10px; font-size: 12px; }
.claims table { width: 100%; border-collapse: collapse; }
.claims td { padding: 4px 0; border-top: 1px solid var(--line); }
.claims td:last-child { text-align: right; color: var(--muted); }
.lb { margin: 0; padding: 0 0 0 20px; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }
.lb li.mine { color: var(--gold); font-weight: 700; }
.lb .mono { float: right; color: var(--dia); }
.feed { display: flex; flex-direction: column; gap: 4px; font-size: 12px; max-height: 260px; overflow: auto; }
.feed div { display: flex; gap: 6px; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 4px; }
.feed .who { color: var(--muted); font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.feed .what { flex: 1; }
.feed .when { color: var(--muted); font-size: 11px; white-space: nowrap; }
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.trophy { text-align: center; font-size: 10px; color: var(--muted); }
.trophy canvas { width: 56px; height: 56px; border-radius: 10px; background: #0a0812; display: block; margin: 0 auto 2px; }
.trophy[data-r="legendary"] canvas { box-shadow: 0 0 12px rgba(255,179,71,.5); }

/* Support (compact) */
.sup-ticket { border-top: 1px solid var(--line); padding: 8px 0; font-size: 12.5px; }
.sup-ticket .msg { background: var(--panel-2); border-radius: 8px; padding: 6px 8px; margin: 4px 0; white-space: pre-wrap; }
.sup-ticket .msg.op { border-left: 3px solid var(--ember); }

/* Offerwall modal */
.ow-card { max-width: 980px; width: 96vw; padding: 12px; }
.ow-frame { width: 100%; height: 70vh; border: 0; border-radius: 10px; background: #fff; }

/* Help */
.help-card { max-width: 560px; text-align: left; }
.help-steps { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.help-steps li { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.45; }
.help-steps li > span { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--ember); color: #1a0c00; font-weight: 800; display: grid; place-items: center; }
.help-tips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 12px; color: var(--muted); background: var(--panel-2); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.help-tips b { color: var(--text); }

/* Ads */
.ad-space { margin: 14px 0 0; text-align: center; }
.ad-space-label { font-size: 10px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.ad-728 iframe { margin: 0 auto; }

/* ── Tooltips + tab explainers ── */
.tip { position: fixed; z-index: 300; max-width: 280px; background: #1c1826; border: 1px solid var(--gold); border-radius: 10px; padding: 8px 11px; font-size: 12px; line-height: 1.45; color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,.55); pointer-events: none; }
.tip[hidden] { display: none; }
.tip b { color: var(--gold); }
.tipt { text-decoration: underline dotted; text-decoration-color: rgba(255,255,255,.35); text-underline-offset: 3px; cursor: help; }
[data-tip] { cursor: help; }
button[data-tip], .chest[data-tip] { cursor: pointer; }
.tabhelp { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; width: 22px; height: 22px; font-size: 11px; cursor: pointer; vertical-align: middle; padding: 0; }
.tabhelp:hover { border-color: var(--gold); color: var(--gold); }
.tabintro-body { text-align: left; font-size: 13.5px; line-height: 1.5; }
.tabintro-body ul { padding-left: 18px; margin: 8px 0 12px; display: flex; flex-direction: column; gap: 6px; }
.tabintro-body b { color: var(--gold); }
.tabintro-body .lead { color: var(--muted); margin: 4px 0 8px; }
/* Mission tracks */
.mtrack { display: flex; align-items: center; gap: 8px; font-family: 'Cinzel', serif; font-size: 12px; letter-spacing: 1.5px; color: var(--muted); margin: 8px 0 2px; }
.mtrack::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.mtrack b { color: var(--gold); }
.mission.locked { opacity: .4; }
.mission .step { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); font-size: 10.5px; font-weight: 800; display: grid; place-items: center; color: var(--muted); }
.mission.current .step { background: var(--ember); color: #1a0c00; border-color: var(--ember); }
.mission.current { border-color: var(--ember); }
.mission .tabgo { font-size: 10.5px; color: var(--muted); }

/* FX / toast */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 90; }
.toast { position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%); z-index: 130; background: var(--panel); border: 1px solid var(--ember); border-radius: 12px; padding: 10px 16px; font-weight: 600; font-size: 13px; box-shadow: 0 10px 34px rgba(0,0,0,.5); max-width: 90vw; text-align: center; }
.toast.err { border-color: var(--danger); }
.dfoot { margin-top: 24px; font-size: 11.5px; }
.dfoot a { color: var(--muted); }
/* Pixel treasure chests (CC0 Tiny Dungeon tiles) */
.chest-cv { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.chest .chest-cv { width: 52px; height: 52px; }
.hud-chest span .chest-cv { width: 26px; height: 26px; }
.relic-chest { display: block; margin: 0 auto 4px; width: 48px; height: 48px; image-rendering: pixelated; }

/* ── Gold Chest (passive-Gold storage cap) ─────────────────────────────────── */
.goldchest { background: var(--panel); border: 1px solid rgba(255,210,74,.25); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.goldchest .gc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 700; font-size: 14px; }
.goldchest .gc-head small { color: var(--muted); font-weight: 600; margin-left: 4px; }
.goldchest #gc-amount { font-size: 13px; color: var(--gold, #ffd24a); }
.goldchest .gc-bar { height: 8px; background: rgba(255,255,255,.12); border-radius: 5px; overflow: hidden; margin: 7px 0 8px; }
.goldchest .gc-bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--ember, #ff9d3c), var(--gold, #ffd24a)); transition: width .5s; }
.goldchest .gc-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.goldchest .gc-hint { font-size: 12px; color: var(--muted); }
.goldchest.full { border-color: #c8443c; }
.goldchest.full .gc-bar > div { background: #c8443c; }
.goldchest.full .gc-hint { color: #ff8a7a; font-weight: 700; }
.goldchest.full #gc-claim { animation: gc-pulse 1.2s ease-in-out infinite; }
@keyframes gc-pulse { 50% { transform: scale(1.08); filter: brightness(1.25); } }

/* Tutorial tab-gating: freshly revealed tabs sparkle until first visited */
.dtab.newtab { position: relative; }
.dtab.newtab::after { content: '✨'; position: absolute; top: 2px; right: 6px; font-size: 11px; animation: gc-pulse 1.4s ease-in-out infinite; }

/* ── Tutorial spotlight ────────────────────────────────────────────────────── */
#tut-overlay .tsh { position: fixed; background: rgba(6,4,12,.62); z-index: 880; pointer-events: none; }
#tut-overlay[hidden] { display: none; }
#tring { position: fixed; z-index: 881; pointer-events: none; border: 2px solid var(--gold, #ffd24a);
  border-radius: 12px; box-shadow: 0 0 0 3px rgba(255,210,74,.25), 0 0 18px rgba(255,210,74,.55);
  animation: tring-pulse 1.3s ease-in-out infinite; }
@keyframes tring-pulse { 50% { box-shadow: 0 0 0 6px rgba(255,210,74,.12), 0 0 26px rgba(255,210,74,.8); } }
#tlabel { position: fixed; z-index: 882; pointer-events: none; max-width: 260px;
  background: var(--panel, #1c1826); border: 1px solid var(--gold, #ffd24a); border-radius: 12px;
  padding: 9px 12px; font-size: 13.5px; line-height: 1.4; box-shadow: 0 6px 24px rgba(0,0,0,.5); }
#tlabel::before { content: '🧙 '; }

/* ── Juice pass ────────────────────────────────────────────────────────────── */
/* Full-screen colour flash (chest drops, legendary reveals, boss kills, moon peak). */
#fx-flash { position: fixed; inset: 0; z-index: 870; pointer-events: none; opacity: 0; }
#fx-flash.go { animation: fxflash .5s ease-out; }
@keyframes fxflash { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }
/* Chest-opening suspense: the card rattles and hides its payoff for half a second. */
.modal-card.suspense #relic-rar, .modal-card.suspense h2, .modal-card.suspense .modal-sub,
.modal-card.suspense .relic-acts, .modal-card.suspense .error { visibility: hidden; }
.modal-card.suspense .relic-reveal { animation: rattle .14s linear infinite; }
@keyframes rattle { 0% { transform: translate(-2px,1px) rotate(-1.6deg); } 33% { transform: translate(2px,-1px) rotate(1.4deg); } 66% { transform: translate(-1px,-2px) rotate(-0.8deg); } 100% { transform: translate(1px,2px) rotate(1.2deg); } }
/* A freshly dropped chest slams in and glows for a beat. */
.chest.new { animation: chestland .55s cubic-bezier(.2,1.6,.4,1); box-shadow: 0 0 16px rgba(255,210,74,.55); }
@keyframes chestland { 0% { transform: translateY(-46px) scale(1.25); opacity: 0; } 55% { transform: translateY(4px) scale(.96); opacity: 1; } 100% { transform: none; } }
/* ── Dungeon Pass (VIP) ─────────────────────────────────────────────────────── */
.vip-card { border-color: var(--gold); background: linear-gradient(135deg, rgba(255,210,74,.07), var(--panel) 55%); margin-bottom: 12px; }
.vip-card.active { box-shadow: 0 0 14px rgba(255,210,74,.25); }
.vip-card-row { display: flex; align-items: center; gap: 12px; }
.vip-card-row > div { flex: 1; min-width: 0; }
.vip-card h3 { margin: 0 0 4px; color: var(--gold); }
.vip-card h3 small { font-size: 11px; color: var(--muted); font-weight: 400; }
.vip-card p { margin: 0; font-size: 12.5px; }
/* The checkout itself reuses the scrapper mem-* styles that live in style.css
   (pass cards, gradients, ribbons, coin tabs, fields, payment tracker, history) —
   only the RPG-specific pieces are defined here. */
.vip-mcard { max-width: 640px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.vip-perks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin: 10px 0 12px; padding: 0; list-style: none; font-size: 12.5px; line-height: 1.45; text-align: left; }
.vip-perks li { padding: 4px 0; border-bottom: 1px dashed rgba(255,255,255,.06); }
@media (max-width: 460px) { .vip-perks { grid-template-columns: 1fr; gap: 5px; } }
/* Rune packs join the scrapper card grid with their own arcane gradient. */
.mem-card.rune-card { background: linear-gradient(160deg, #6a2fd0, #a12fb8); }
.mem-card.rune-card.is-best { box-shadow: 0 0 0 2px #e2b8ff, 0 12px 30px rgba(199,125,255,.45); }
.mem-manual { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.6; text-align: left; }
#vip-shot[hidden] { display: none; }
.lb-vip { filter: drop-shadow(0 0 3px rgba(255,210,74,.7)); }

/* ✨ Skills tab: rank pips + spell-skin swatches. */
.pips { font-size: 11px; color: var(--gold); letter-spacing: 1px; margin-left: 4px; }
.skin { width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); cursor: pointer; font-size: 10px; line-height: 1; padding: 0; vertical-align: middle; margin-right: 4px; }
.skin.on { border-color: #fff; box-shadow: 0 0 6px rgba(255,255,255,.5); }
.item.locked { opacity: .55; }
.spv-wrap { margin: 6px 0 4px; }
canvas.spv { width: 150px; height: 64px; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); display: block; }
.vchips { display: flex; flex-wrap: wrap; gap: 7px; }
.vchip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; font-size: 12px; font-weight: 700; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-family: inherit; }
.vchip:hover { border-color: var(--gold); }
.vchip.on { border-color: var(--gold); background: rgba(255,210,74,.1); color: var(--gold); }
.adot { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 5px currentColor; }
/* Boss Rush result rows. */
.aw { display: flex; justify-content: space-between; gap: 8px; padding: 6px 2px; font-size: 13px; border-bottom: 1px dashed var(--line); }
.aw.ko { color: var(--muted); }
.aw.sum { font-weight: 700; border-bottom: 0; margin-top: 4px; }
.aw .ok { color: var(--gold); } .aw .ko { color: #ff6b6b; }

/* Tutorial pause ✕ on the spotlight label (the label itself is pointer-events:none,
   so the button opts back in). */
#tlabel { padding-right: 26px; }
.tut-x { position: absolute; top: -9px; right: -9px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #0e0b14; background: #e0384d; color: #fff; font-size: 11px; font-weight: 900; line-height: 1; cursor: pointer; padding: 0; box-shadow: 0 2px 6px rgba(0,0,0,.5); pointer-events: auto; }
.tut-x:hover { filter: brightness(1.15); }
.tut-go { display: block; margin-top: 8px; pointer-events: auto; }
.eff-badge { font-size: .72em; color: #ffcf4a; margin-top: 2px; }
.item .iab { font-size: .74em; color: #c9b8ff; margin: 2px 0 4px; }
/* Hero bonuses as labeled chips instead of one dense text row. */
#hero-bonus { display: flex; flex-wrap: wrap; gap: 6px; }
#hero-bonus > span { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 999px; padding: 3px 10px; font-size: .85em; }
/* Relic source region — a highlighted badge on the relic card, colored per region. */
.rregion { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: .82em; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.rregion.surface { color: #8fe08f; border-color: rgba(143,224,143,.35); background: rgba(143,224,143,.1); }
.rregion.depths { color: #7de3ff; border-color: rgba(125,227,255,.35); background: rgba(125,227,255,.1); }
.rregion.abyss { color: #c77dff; border-color: rgba(199,125,255,.35); background: rgba(199,125,255,.1); }
/* ── Collection log (Vault) ──────────────────────────────────────────────── */
.coll-grid { display: flex; flex-direction: column; gap: 3px; margin: 8px 0; }
.coll-row { display: grid; grid-template-columns: 1fr repeat(4, 34px); gap: 4px; align-items: center; }
.coll-kind { font-size: .85em; color: var(--muted, #aab); text-transform: capitalize; }
.coll-cell { text-align: center; font-size: .78em; padding: 3px 0; border-radius: 6px; background: rgba(255,255,255,.04); color: rgba(255,255,255,.25); }
.coll-cell.got.common { background: rgba(170,180,200,.18); color: #cfd6e4; }
.coll-cell.got.rare { background: rgba(125,227,255,.16); color: #7de3ff; }
.coll-cell.got.epic { background: rgba(199,125,255,.16); color: #c77dff; }
.coll-cell.got.legendary { background: rgba(255,179,71,.18); color: #ffb347; }
.coll-stats { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .82em; color: var(--muted, #aab); }
.pity-hint { font-size: .82em; color: var(--muted, #aab); margin: -2px 0 6px; }
.pity-hint.hot { color: #ffd24a; }
.boss-retry { margin: 6px 0 2px; border-color: rgba(255,59,92,.45); color: #ff8fa3; }
.boss-retry:hover { background: rgba(255,59,92,.12); }
/* ── Loot guide (what to do with relics) ─────────────────────────────────── */
.lg-card { max-width: 860px; text-align: left; }
.lg-card > h2, .lg-card > .modal-sub, .lg-card > .btn.primary { text-align: center; }
.lg-card > .btn.primary { display: block; margin: 12px auto 0; }
.lg-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
@media (max-width: 720px) { .lg-cards { grid-template-columns: 1fr; } }
.lg-opt { background: var(--panel-2, rgba(255,255,255,.04)); border: 1px solid rgba(255,255,255,.09); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; }
.lg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.lg-head h3 { margin: 0; font-size: 1.05em; }
.lg-ico { font-size: 1.5em; }
.lg-opt p { margin: 4px 0 6px; font-size: .92em; }
.lg-opt ul { margin: 0 0 8px; padding-left: 17px; font-size: .85em; color: var(--muted, #aab); }
.lg-opt li { margin: 3px 0; }
/* The continue button during a tutorial hold ("▶ Next lesson" / "✔ Understood") is
   the only way forward — a soft pulse makes it unmissable without being annoying. */
@keyframes tut-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 157, 60, .55); }
  50% { transform: scale(1.07); box-shadow: 0 0 0 10px rgba(255, 157, 60, 0); }
}
.tut-pulse, .tut-go { animation: tut-pulse 1.1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .tut-pulse, .tut-go { animation: none; } }

/* First-run welcome. */
.start-card { max-width: 430px; text-align: center; }
.start-ico { font-size: 46px; line-height: 1; margin-bottom: 4px; filter: drop-shadow(0 0 14px rgba(255,210,74,.45)); }
.start-card h2 { font-family: 'Cinzel', serif; color: var(--gold); }
.start-flavor { font-size: 14.5px; line-height: 1.6; margin: 8px 0; }
.start-flavor.muted { font-size: 13px; margin-bottom: 16px; }

/* Vector Gold coin icon (replaces the 🪙 emoji in the visible spots). */
.coin-ico { width: 15px; height: 15px; vertical-align: -2px; }
.coin-ico.sm { width: 13px; height: 13px; }
.coin-ico.hdr { width: 16px; height: 16px; vertical-align: -3px; }

/* Daily Hunt strip (Dungeon tab, under the Gold Chest). */
.hunt { display: flex; align-items: center; gap: 10px; margin: 10px 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.hunt-ico { font-size: 22px; }
.hunt-body { flex: 1; min-width: 0; }
.hunt-body b { font-size: 13.5px; }
.hunt-bar { height: 6px; margin: 4px 0 3px; }
#hunt-fill { height: 100%; width: 0; background: linear-gradient(90deg, #ff9d3c, var(--gold)); border-radius: 4px; transition: width .4s; }
.hunt.done { border-color: var(--gold); box-shadow: 0 0 12px rgba(255,210,74,.35); }

/* Hero name (Hero tab) + Trophy Hall set collection (Vault). */
.hero-name-row { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px 0 2px; }
.hero-name { font-family: 'Cinzel', serif; font-weight: 900; font-size: 17px; color: var(--gold); letter-spacing: .5px; }
.hero-name.unnamed { color: var(--muted); font-style: italic; }
.kindchips { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.kindchip { width: 30px; height: 30px; display: grid; place-items: center; font-size: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); opacity: .28; filter: grayscale(1); }
.kindchip.got { opacity: 1; filter: none; border-color: var(--gold); box-shadow: 0 0 6px rgba(255,210,74,.35); }
.settiers { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.settier { font-size: 11.5px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.settier.on { color: var(--gold); border-color: var(--gold); background: rgba(255,210,74,.08); }

/* GILDED chest: gold-rimmed, breathing glow, gold-tinted art — reads as special at a glance. */
.chest.gilded { border-color: var(--gold); }
.chest.gilded:not(.new) { animation: gildpulse 1.6s ease-in-out infinite; } /* let the drop-slam play first */
.chest.gilded .chest-cv { filter: sepia(1) saturate(2.6) hue-rotate(-12deg) brightness(1.18); }
.chest.gilded .biome { color: var(--gold); }
@keyframes gildpulse { 0%, 100% { box-shadow: 0 0 8px rgba(255,210,74,.45); } 50% { box-shadow: 0 0 20px rgba(255,210,74,.85); } }
@media (prefers-reduced-motion: reduce) {
  #fx-flash.go, .modal-card.suspense .relic-reveal, .chest.new, .chest.gilded { animation: none; }
  .chest.gilded { box-shadow: 0 0 12px rgba(255,210,74,.6); }
}

/* ── Withdrawal progress strip (Dungeon tab) ───────────────────────────────── */
.wd-strip { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 8px 0 4px; font-size: 12.5px; }
.wd-strip[hidden] { display: none; }
.wd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.wd-bar { height: 6px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.wd-bar > div { height: 100%; width: 0; background: linear-gradient(90deg, #5fb8ff, var(--dia)); border-radius: 999px; transition: width .6s; }
.wd-strip.ready { border-color: var(--dia); box-shadow: 0 0 12px rgba(125,227,255,.25); }

/* ── The Fair: Lucky Spin + daily streak (Earn tab) ────────────────────────── */
.fair-grid { margin-bottom: 14px; }
.fair-card, .streak-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.wheel-wrap { position: relative; width: 240px; max-width: 100%; aspect-ratio: 1; }
.wheel-wrap canvas { width: 100%; height: 100%; display: block; }
.wheel-pin { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); color: var(--gold); font-size: 22px; text-shadow: 0 2px 4px #000; }
.streak-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; width: 100%; }
.streak-day { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 2px; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.streak-day b { font-size: 12px; }
.streak-day.done { border-color: var(--ember); background: rgba(255,157,60,.12); }
.streak-day.next { border-color: var(--gold); box-shadow: 0 0 10px rgba(255,210,74,.35); }
.streak-day.jackpot { background: linear-gradient(180deg, rgba(255,210,74,.18), transparent); }

/* ── Mimic + legendary reveal ──────────────────────────────────────────────── */
.mimic-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0; }
.mimic-stage canvas { image-rendering: pixelated; cursor: pointer; animation: mimic-shake .18s infinite; }
@keyframes mimic-shake { 0%,100% { transform: translate(0,0) rotate(0) } 25% { transform: translate(-3px,1px) rotate(-3deg) } 75% { transform: translate(3px,-1px) rotate(3deg) } }
.relic-legendary .modal-card { animation: leg-glow 1.2s ease-in-out infinite alternate; }
@keyframes leg-glow { from { box-shadow: 0 0 20px rgba(255,179,71,.35) } to { box-shadow: 0 0 60px rgba(255,179,71,.85), 0 0 120px rgba(255,210,74,.35) } }

/* Next big goal (Dungeon tab) */
.goal-line { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 10px; padding: 7px 12px; margin: 8px 0 4px; font-size: 12.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.goal-line[hidden] { display: none; }

/* VIP offers at friction points */
.vip-up { border-color: var(--gold) !important; color: var(--gold) !important; }
.vip-up:hover { background: rgba(255,210,74,.12); }

/* ── Story: Mark Codex, fragment + finale modals ──────────────────────────── */
.codex-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.frag { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-size: 12.5px; line-height: 1.45; }
.frag.got { border-color: rgba(159,232,255,.45); font-style: italic; }
.seal-box { margin-top: 12px; }
.seal-box[hidden] { display: none; }
.story-modal { text-align: center; max-width: 520px; }
.story-frag { font-family: Cinzel, Georgia, serif; font-size: 16px; line-height: 1.6; color: #f5edd8; margin: 12px 0; }
.finale-choices { display: grid; gap: 10px; margin-top: 12px; }
.finale-choices .btn { white-space: normal; text-align: left; padding: 10px 14px; line-height: 1.35; }
.finale-choices small { display: block; font-weight: 400; opacity: .85; margin-top: 3px; }

/* New Rune skill popup: the live preview, larger */
.spell-new { display: flex; justify-content: center; margin: 8px 0; }
.spell-new canvas { width: 300px; max-width: 100%; height: 128px; border-radius: 10px; image-rendering: pixelated; }

/* Trophy swap picker */
.keep-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 10px; text-align: left; }
.kp { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--text); font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.kp:hover { border-color: var(--gold); }
.kp small { font-size: 11px; opacity: .85; }
.kp .up { color: #7dff9b; } .kp .down { color: #ff7a8a; }

/* Explainer checklists: one feature per line, one gold check each */
ul.checks { list-style: none; padding-left: 0 !important; margin: 8px 0 12px; display: flex; flex-direction: column; gap: 6px; text-align: left; }
ul.checks li { position: relative; padding-left: 24px; line-height: 1.4; }
ul.checks li::before { content: '✔'; position: absolute; left: 2px; top: 0; color: var(--gold); font-weight: 800; }

/* 🎯 Goals board */
.goal-line.goal-board { display: block; padding: 8px 10px; }
.gb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.gb-tease { font-size: 11.5px; color: var(--muted); }
.gb-row { display: grid; grid-template-columns: 70px 22px 1fr auto auto; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); }
.gb-row.done .gb-text { color: var(--gold); }
.gb-slot { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.gb-ico { font-size: 16px; text-align: center; }
.gb-text { font-size: 12.5px; }
.gb-bar { height: 5px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.gb-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ffe9a0); }
.gb-prog { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gb-rew { font-size: 11px; color: var(--muted); white-space: nowrap; }
.gb-gate { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; font-size: 12.5px; }
@media (max-width: 560px) { .gb-row { grid-template-columns: 22px 1fr auto; } .gb-slot, .gb-prog { display: none; } }
.gear-sets { margin: 6px 0 8px; }
/* 📜 Journal */
.jr-wide { grid-column: 1 / -1; }
.beast-regions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.beast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.beast { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 12px; }
.beast img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; }
.beast .gb-bar { width: 100%; }
.beast.bronze { border-color: #b8773a; box-shadow: inset 0 0 0 1px rgba(184,119,58,.35); }
.beast.gold { border-color: var(--gold); box-shadow: 0 0 10px rgba(255,210,74,.25); }
.beast.ready { border-color: var(--gold); }
.deeds { display: flex; flex-direction: column; gap: 8px; }
.deed { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; }
.deed.ready b { color: var(--gold); }
.collsets { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.cset-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 6px; }
.cset { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.cset.claimed span { opacity: .6; }
.records { display: flex; flex-direction: column; gap: 6px; }
.rec { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 5px; font-size: 13px; }
.gold { color: var(--gold); }
.beast-regions .chip { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 11.5px; }
.porter > span { flex: 1; } /* text takes the room — buttons hug the right edge */
/* Treasure chests: one framed box (header, chests, Porter) */
.chest-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px 10px; margin: 8px 0 4px; }
.chest-box .row-head { margin-top: 0; }
.chest-box .porter { margin-bottom: 0; }
.chests.empty { min-height: 0; }
.chests.empty .chests-empty { padding: 2px 0 4px; }
.satchel-box .satchel-how { margin-top: 0; } .satchel-box .relics { margin-bottom: 0; }
/* Relic cards stand out from the satchel frame (lighter panel, faint rarity tint) */
.satchel-box .relic { background: linear-gradient(160deg, rgba(255,255,255,.07), transparent 65%), var(--panel-2); }
.satchel-box .relic[data-r="rare"] { background: linear-gradient(160deg, rgba(95,184,255,.15), transparent 65%), var(--panel-2); }
.satchel-box .relic[data-r="epic"] { background: linear-gradient(160deg, rgba(199,125,255,.17), transparent 65%), var(--panel-2); }
.satchel-box .relic[data-r="legendary"] { background: linear-gradient(160deg, rgba(255,179,71,.18), transparent 65%), var(--panel-2); }

/* 📜 Biome relic collections */
.coll-btn { margin-top: 6px; }
.coll-btn.t1 { border-color: #b8773a; } .coll-btn.t2 { border-color: #c9d2e0; } .coll-btn.t3 { border-color: var(--gold); color: var(--gold); }
.coll-card { max-width: 560px; }
.coll-kinds { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 10px 0; }
.ck { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; }
.ck canvas { width: 64px; height: 64px; border-radius: 10px; }
.ck.missing canvas { filter: grayscale(1) brightness(.35); }
.ck.missing b { opacity: .55; }
.coll-tiers li.done b { color: var(--gold); }
.coll-tiers li:not(.done) { opacity: .75; }
.coll-now { font-size: 13px; margin: 6px 0 12px; }
@media (max-width: 480px) { .coll-kinds { grid-template-columns: repeat(3, 1fr); } }
.coll-tiers { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.coll-tiers li { position: relative; padding-left: 24px; }
.coll-tiers li::before { content: '○'; position: absolute; left: 3px; color: var(--muted); }
.coll-tiers li.done::before { content: '✔'; color: var(--gold); font-weight: 800; }
.deed-rew { font-size: 11px; color: var(--muted); white-space: nowrap; }
