/* ===================== Fonts (bundled for offline / app builds) ===================== */
@font-face { font-family: 'Unifraktur'; src: url('../assets/fonts/unifrakturmaguntia-latin-400-normal.woff2') format('woff2'); font-display: block; }
@font-face { font-family: 'Cinzel'; src: url('../assets/fonts/cinzel-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cinzel'; src: url('../assets/fonts/cinzel-latin-ext-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; } /* Romanian, Polish ... */
@font-face { font-family: 'Alegreya Sans'; src: url('../assets/fonts/alegreya-sans-latin-500-normal.woff2') format('woff2'); size-adjust: 108%; font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Alegreya Sans'; src: url('../assets/fonts/alegreya-sans-cyrillic-500-normal.woff2') format('woff2'); size-adjust: 108%; font-weight: 500; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Alegreya Sans'; src: url('../assets/fonts/alegreya-sans-latin-ext-500-normal.woff2') format('woff2'); size-adjust: 108%; font-weight: 500; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Alegreya Sans'; src: url('../assets/fonts/alegreya-sans-latin-800-normal.woff2') format('woff2'); size-adjust: 108%; font-weight: 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Alegreya Sans'; src: url('../assets/fonts/alegreya-sans-cyrillic-800-normal.woff2') format('woff2'); size-adjust: 108%; font-weight: 800; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Alegreya Sans'; src: url('../assets/fonts/alegreya-sans-latin-ext-800-normal.woff2') format('woff2'); size-adjust: 108%; font-weight: 800; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* numbers: the heavy cut of the body font, scaled so the old sizes of the numeric styles still fit */
@font-face { font-family: 'DHNum'; src: url('../assets/fonts/alegreya-sans-latin-800-normal.woff2') format('woff2'); size-adjust: 150%; font-weight: 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DHNum'; src: url('../assets/fonts/alegreya-sans-cyrillic-800-normal.woff2') format('woff2'); size-adjust: 150%; font-weight: 800; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'DHNum'; src: url('../assets/fonts/alegreya-sans-latin-ext-800-normal.woff2') format('woff2'); size-adjust: 150%; font-weight: 800; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }


:root {
  --bg: #0a070d;
  --bg2: #120c16;
  --panel: #1a1220;
  --panel2: #231829;
  --panel3: #2e2034;
  --line: #4b3a2a;
  --bronze: #8a6a3e;
  --bronze-hi: #c89a58;
  --gold: #f0c860;
  --gold-hi: #ffe7a0;
  --blood: #b01e2c;
  --blood-hi: #e2384a;
  --text: #ece2cf;
  --muted: #a39581;
  --dim: #6f6352;
  --good: #58c860;
  --gem: #ff6ae0;
  --energy: #ff9a3c;
  --ad: #2e9a4c;
  --r0: #b8b2a7; --r1: #5fd06a; --r2: #4aa3ff; --r3: #b366ff; --r4: #ffb52e; --r5: #ff4a4a; --r6: #ff7ab8; --r7: #7affe0;
  --rainbow: linear-gradient(90deg, #ff4a4a, #ffb52e, #fff35a, #5fd06a, #4aa3ff, #b366ff, #ff7ab8);
  --title: 'Cinzel', 'Alegreya Sans', Georgia, serif;
  --body: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;
  --num: 'DHNum', 'Alegreya Sans', sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--body); font-weight: 500; overflow: hidden; overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button { font-family: inherit; color: inherit; }
img.px, .px { image-rendering: pixelated; image-rendering: crisp-edges; }
.hidden { display: none !important; }

#app { position: fixed; inset: 0; overflow: hidden; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#world { position: absolute; left: 0; top: 0; display: block; image-rendering: crisp-edges; image-rendering: pixelated; pointer-events: none; background: #000; }

/* ===================== Boot ===================== */
@keyframes bootpulse { 0%,100% { filter: drop-shadow(0 0 14px rgba(226,56,74,.25)); } 50% { filter: drop-shadow(0 0 26px rgba(226,56,74,.55)); } }

/* ===================== Menu shell ===================== */
#menu { position: absolute; inset: 0; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; padding-top: var(--safe-t); }
#menu.hidden { display: none; }
.menu-bg { position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(ellipse at 50% 0%, rgba(120,20,30,.25), transparent 60%),
  linear-gradient(180deg, rgba(10,7,13,.2) 0%, rgba(10,7,13,.0) 30%, rgba(10,7,13,.7) 100%); }

.topbar { position: relative; z-index: 2; display: flex; gap: 6px; align-items: center; padding: 8px 10px 6px; }
.avatar { position: relative; width: 44px; height: 44px; flex: none; border: 2px solid var(--bronze); background: #1c1420; border-radius: 8px; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 10px #000; }
.avatar img { width: 36px; height: 36px; }
.avatar .lvl { position: absolute; bottom: -6px; right: -6px; background: var(--blood); border: 2px solid var(--gold); border-radius: 10px; font: 8px var(--num); padding: 3px 4px; color: #fff; }
.acct { flex: 1; min-width: 0; }
.acct .xpbar { max-width: 90px; }
.acct .xpbar { height: 5px; background: #2a1c24; border-radius: 3px; overflow: hidden; margin-top: 3px; }
.acct .xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #6a9aff, #b8e0ff); }
.acct .name { font-family: var(--title); font-size: 12px; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: clip; }
@media (max-width: 430px) { .acct .name { display: none; } .pill { padding-right: 3px; } .pill .plus { width: 16px; height: 16px; line-height: 16px; } }
.pill { display: flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 2px; background: rgba(8,5,10,.85); border: 1px solid var(--line); border-radius: 14px; font: 9px var(--num); color: var(--text); flex: none; cursor: pointer; }
.pill img { width: 22px; height: 22px; margin-left: -2px; }
.pill .plus { width: 18px; height: 18px; border-radius: 50%; background: var(--good); color: #0a1a0a; font: 800 14px/18px var(--body); text-align: center; }
.pill .sub { font: 7px var(--num); color: var(--muted); }

.content { position: relative; z-index: 1; flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 12px 16px; -webkit-overflow-scrolling: touch; touch-action: pan-y; scrollbar-width: none; }
.content::-webkit-scrollbar { display: none; }

/* bottom navigation */
.nav { position: relative; z-index: 2; display: flex; background: linear-gradient(180deg, #1d1422, #0d090f); border-top: 2px solid var(--bronze); padding-bottom: var(--safe-b); box-shadow: 0 -8px 24px rgba(0,0,0,.6); }
.nav button { flex: 1; background: none; border: 0; padding: 6px 0 7px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 800; color: var(--muted); position: relative; cursor: pointer; letter-spacing: .03em; text-transform: uppercase; }
.nav button img { width: 30px; height: 30px; filter: grayscale(.6) brightness(.8); transition: transform .15s; }
.nav button.on { color: var(--gold); background: radial-gradient(ellipse at 50% 100%, rgba(240,200,96,.18), transparent 70%); }
.nav button.on img { filter: none; transform: translateY(-3px) scale(1.15); }
.nav button.battle img { width: 36px; height: 36px; }
.badge { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--blood-hi); color: #fff; font: 800 10px/16px var(--body); text-align: center; box-shadow: 0 0 0 2px #0d090f; animation: pulse 1.6s infinite; }
.badge.dot { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 4px; right: 4px; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* ===================== Generic components ===================== */
h2.title { font-family: var(--title); font-size: 20px; color: var(--gold); text-align: center; margin: 8px 0 10px; letter-spacing: .06em; text-shadow: 0 2px 0 #000, 0 0 12px rgba(240,200,96,.25); }
h3.sect { font-family: var(--title); font-size: 14px; color: var(--bronze-hi); margin: 18px 2px 8px; letter-spacing: .08em; display: flex; align-items: center; gap: 8px; }
h3.sect::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
h3.sect .timer { font: 8px var(--num); color: var(--muted); letter-spacing: 0; }

.panel { position: relative; background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: 10px; box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 4px 14px rgba(0,0,0,.45); padding: 10px; }
.panel.gold { border-color: var(--bronze-hi); box-shadow: inset 0 0 18px rgba(240,200,96,.08), 0 0 0 1px #000, 0 6px 18px rgba(0,0,0,.5); }
.frame { border: 2px solid var(--bronze); border-radius: 12px; box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #000, inset 0 0 24px rgba(0,0,0,.7); }

.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 9px; border: 0; cursor: pointer; font-weight: 800; font-size: 15px; letter-spacing: .03em; color: #fff; background: linear-gradient(180deg, #4a3a52, #2c2032); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 -3px 0 rgba(0,0,0,.35), 0 2px 0 #000; text-shadow: 0 1px 0 rgba(0,0,0,.6); transition: transform .06s, filter .15s; white-space: nowrap; }
.btn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -1px 0 rgba(0,0,0,.35); }
.btn img { width: 20px; height: 20px; }
.btn.gold { color: #2a1604; text-shadow: 0 1px 0 rgba(255,255,255,.35); background: linear-gradient(180deg, #ffe39a, #e0a93e 55%, #b07a26); }
.btn.red { background: linear-gradient(180deg, #e2384a, #9c1624); }
.btn.green, .btn.ad { background: linear-gradient(180deg, #4ec060, #22803a); }
.btn.gem { background: linear-gradient(180deg, #c050c8, #7a2490); }
.btn.blue { background: linear-gradient(180deg, #4a8ae8, #2450a0); }
.btn.ghost { background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px var(--line); }
.btn.small { min-height: 32px; font-size: 13px; padding: 0 10px; border-radius: 7px; }
.btn.tiny { min-height: 26px; font-size: 12px; padding: 0 8px; border-radius: 6px; }
.btn.block { display: flex; width: 100%; }
.btn[disabled], .btn.off { filter: grayscale(1) brightness(.6); pointer-events: none; }
.btn .adtag { font: 7px var(--num); background: rgba(0,0,0,.35); padding: 3px 4px; border-radius: 3px; }
.btn .num { font: 10px var(--num); }
.btn.big { min-height: 58px; font-family: var(--title); font-size: 22px; border-radius: 12px; letter-spacing: .1em; }
.btn.shine::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 45%, transparent 60%); background-size: 250% 100%; animation: shine 2.6s infinite; pointer-events: none; }
@keyframes shine { 0% { background-position: 150% 0; } 60%,100% { background-position: -100% 0; } }

.row { display: flex; gap: 8px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-family: var(--num); font-size: 10px; }
.good { color: var(--good); }
.bad { color: var(--blood-hi); }
.goldtxt { color: var(--gold); }
.gap { height: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.bar { height: 10px; background: #1a1016; border: 1px solid #000; border-radius: 6px; overflow: hidden; box-shadow: inset 0 1px 3px #000; }
.bar i { display: block; height: 100%; background: linear-gradient(180deg, #ffe39a, #d09030); border-radius: 5px; transition: width .3s; }
.bar.blue i { background: linear-gradient(180deg, #9ad0ff, #3a7ad8); }
.bar.green i { background: linear-gradient(180deg, #9af0a0, #2e9a4c); }

.tabs { display: flex; gap: 4px; background: rgba(0,0,0,.45); border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin: 6px 0 8px; }
.tabs button { flex: 1; min-height: 34px; background: none; border: 0; border-radius: 7px; font-weight: 800; font-size: 13px; color: var(--muted); position: relative; cursor: pointer; }
.tabs button.on { background: linear-gradient(180deg, #4a3a52, #2c2032); color: var(--gold); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.tabs .badge { top: -4px; right: 4px; }

/* rarity */
.rar0 { --rc: var(--r0); } .rar1 { --rc: var(--r1); } .rar2 { --rc: var(--r2); } .rar3 { --rc: var(--r3); } .rar4 { --rc: var(--r4); } .rar5 { --rc: var(--r5); } .rar6 { --rc: var(--r6); } .rar7 { --rc: var(--r7); }
.slot { position: relative; aspect-ratio: 1; border-radius: 3px; border: 2px solid var(--rc, var(--line)); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc, #333) 35%, #150e18), #120c16 75%); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: inset 0 0 12px rgba(0,0,0,.8), 0 2px 0 #000; }
.slot img { width: 62%; height: 62%; filter: drop-shadow(0 2px 0 rgba(0,0,0,.6)); }
.slot .lv { position: absolute; bottom: 3px; right: 4px; font: 7px var(--num); color: #fff; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.slot .eq { position: absolute; top: 3px; left: 4px; font: 800 9px var(--body); color: var(--gold); text-shadow: 0 1px 0 #000; }
.slot .upb { position: absolute; top: 2px; right: 2px; z-index: 2; min-width: 18px; height: 16px; padding: 0 3px; background: var(--blood-hi); color: #fff; font: 800 10px/16px var(--body); text-align: center; box-shadow: 0 0 0 2px #050308; pointer-events: none; }
.slot .newdot { position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--blood-hi); box-shadow: 0 0 0 2px #000; }
.slot.empty { border-style: dashed; border-color: #3a2c40; background: rgba(0,0,0,.35); }
.slot.empty img { opacity: .2; filter: grayscale(1); }
.slot.rar4, .slot.rar5, .slot.rar6, .slot.rar7 { animation: glowr 2s infinite; }
/* the last rank: a rainbow frame and a rainbow name */
.slot.rar7 { border-color: transparent; background: radial-gradient(circle at 50% 52%, rgba(255,255,255,.16) 0 24%, rgba(255,255,255,.09) 24% 38%, rgba(255,255,255,.04) 38% 54%, transparent 54%) padding-box,
    conic-gradient(from 200deg, #ff4a4a40, #ffb52e40, #fff35a40, #5fd06a40, #4aa3ff40, #b366ff40, #ff7ab840, #ff4a4a40) padding-box,
    var(--tex-dark, none) 0 0 / 64px 64px padding-box, linear-gradient(#120c16, #120c16) padding-box,
    conic-gradient(from 0deg, #ff4a4a, #ffb52e, #fff35a, #5fd06a, #4aa3ff, #b366ff, #ff7ab8, #ff4a4a) border-box; }
.rar7 .rtxt, .rtxt.rar7 { background: var(--rainbow); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* a rank's step: a diamond with its number */
.slot .rstar { position: absolute; bottom: 2px; left: 3px; font: 800 9px var(--body); color: var(--rc, #fff); text-shadow: 0 1px 0 #000, 0 0 3px #000; pointer-events: none; }
.rankbox { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid #4a3a52; border-radius: 8px; background: rgba(0,0,0,.25); }
.rankbox-h { text-align: center; font-size: 14px; }
@keyframes glowr { 0%,100% { box-shadow: inset 0 0 12px rgba(0,0,0,.8), 0 0 4px var(--rc); } 50% { box-shadow: inset 0 0 12px rgba(0,0,0,.8), 0 0 14px var(--rc); } }
.rtxt { color: var(--rc); font-weight: 800; }

/* ===================== Home ===================== */
.home { display: flex; flex-direction: column; min-height: 100%; }
.home .side { position: absolute; top: 6px; display: flex; flex-direction: column; gap: 10px; z-index: 3; }
.home .side.l { left: 10px; } .home .side.r { right: 10px; }
.sidebtn { position: relative; width: 52px; display: flex; flex-direction: column; align-items: center; gap: 1px; background: none; border: 0; cursor: pointer; }
.sidebtn .ic { width: 46px; height: 46px; border-radius: 12px; background: radial-gradient(circle at 50% 35%, #3a2a40, #140e18); border: 2px solid var(--bronze); display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 #000, inset 0 0 10px #000; }
.sidebtn .ic img { width: 32px; height: 32px; }
.sidebtn .ic .sym { font-size: 24px; color: var(--gold); }
.sidebtn span.l { font-size: 10px; font-weight: 800; color: var(--text); text-shadow: 0 1px 2px #000, 0 0 4px #000; line-height: 1.05; text-align: center; }
.sidebtn .badge { top: -4px; right: -2px; }
.sidebtn.hot .ic { border-color: var(--gold); animation: hot 1.4s infinite; }
@keyframes hot { 0%,100% { box-shadow: 0 3px 0 #000, 0 0 0 rgba(240,200,96,0); } 50% { box-shadow: 0 3px 0 #000, 0 0 14px rgba(240,200,96,.8); } }
.sidebtn .tm { font: 6px var(--num); color: var(--gold); text-shadow: 0 1px 0 #000; }

.hero-stage { flex: 1; min-height: 190px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 6px; }
.hero-name { font-family: var(--title); font-size: 20px; color: var(--gold); text-shadow: 0 2px 0 #000, 0 0 10px #000; }
.power { display: inline-flex; align-items: center; gap: 6px; font: 9px var(--num); color: #fff; background: rgba(0,0,0,.6); padding: 5px 10px; border-radius: 12px; border: 1px solid var(--line); margin-top: 4px; }
.power b { color: var(--blood-hi); font-family: var(--body); font-weight: 800; font-size: 13px; }

.vigil { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; }
.vigil > img { width: 40px; height: 40px; }
.vigil .row img { width: 22px; height: 22px; }
.vigil .full { color: var(--blood-hi); font-weight: 800; }

.stagecard { position: relative; overflow: hidden; padding: 0; }
.stagecard canvas, .stagecard .thumb { display: block; width: 100%; height: 120px; object-fit: cover; image-rendering: pixelated; }
.stagecard .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 8px; background: linear-gradient(transparent, rgba(0,0,0,.92)); }
.stagecard .sname { font-family: var(--title); font-size: 18px; color: #fff; text-shadow: 0 2px 0 #000; }
.stagecard .sdiff { font-size: 12px; color: var(--muted); }
.stagecard .arrow { position: absolute; top: 40px; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,.6); border: 1px solid var(--line); color: var(--gold); font-size: 18px; cursor: pointer; z-index: 3; }
.stagecard .arrow.l { left: 6px; } .stagecard .arrow.r { right: 6px; }
.stagecard .lock { position: absolute; inset: 0; background: rgba(0,0,0,.7); display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; color: var(--muted); gap: 4px; z-index: 2; padding: 0 48px; text-align: center; }
.stagecard .lock b { font-size: 28px; }
.stagecard .cleared { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); font: 8px var(--num); color: var(--good); background: rgba(0,0,0,.7); padding: 4px 8px; border-radius: 6px; }

/* ===================== Cards / lists ===================== */
.item { display: flex; gap: 10px; align-items: center; padding: 9px; }
.item + .item { margin-top: 8px; }
.item .ico { width: 48px; height: 48px; flex: none; border-radius: 10px; background: radial-gradient(circle, #33243a, #140e18); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; position: relative; }
.item .ico img { width: 36px; height: 36px; }
.item .t { font-weight: 800; font-size: 15px; }
.item .d { font-size: 12.5px; color: var(--muted); line-height: 1.25; }
.item .prog { margin-top: 5px; }
.item .prog .bar { height: 8px; }
.item .prog .v { font: 7px var(--num); color: var(--muted); margin-top: 3px; }
.item.done { border-color: var(--good); }
.item.claimed { opacity: .5; }
.rewards { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.rw { display: inline-flex; align-items: center; gap: 2px; font: 8px var(--num); color: var(--text); background: rgba(0,0,0,.4); padding: 2px 5px 2px 2px; border-radius: 5px; }
.rw img { width: 18px; height: 18px; }
.rw .word { font: 800 11px var(--body); }

.hero-card { display: flex; gap: 10px; padding: 10px; cursor: pointer; }
.hero-card.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 16px rgba(240,200,96,.25); }
.hero-card .pic { width: 64px; height: 64px; flex: none; border-radius: 10px; background: radial-gradient(circle at 50% 60%, #3a2a24, #120c10); display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.hero-card .pic img { width: 54px; height: 54px; }
.hero-card.locked .pic img { filter: grayscale(1) brightness(0.45); }

.shrine-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* the profile: avatar, name and id above three tabs; the avatars in round frames */
.prof-head { display: flex; gap: 12px; align-items: center; background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.prof-av { position: relative; width: 78px; height: 78px; flex: none; border-radius: 50%; border: 3px solid var(--gold); box-shadow: 0 0 0 2px #050308, 0 0 14px rgba(240,200,96,.25); overflow: visible; }
.prof-av img { width: 100%; height: 100%; border-radius: 50%; }
.prof-av .lvl { position: absolute; bottom: -4px; right: -6px; background: var(--blood); border: 2px solid var(--gold); border-radius: 10px; font: 9px var(--num); padding: 3px 5px; color: #fff; }
.prof-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.prof-name { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.prof-name b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prof-id { display: flex; align-items: center; gap: 8px; justify-content: space-between; font: 11px var(--num); letter-spacing: 1px; user-select: text; -webkit-user-select: text; }
.prof-tabs { margin-top: 10px; }
.prof-body { height: min(50vh, 440px); overflow-y: auto; display: flex; flex-direction: column; } /* one height for every tab: the window never jumps */
.prof-body > .avtab { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.avgrid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(5, 1fr); align-content: start; gap: 8px; overflow-y: auto; padding: 4px 2px 8px; }
.avsec { grid-column: 1 / -1; font-weight: 800; font-size: 12px; color: var(--gold); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.av { position: relative; aspect-ratio: 1; border-radius: 50%; padding: 0; border: 3px solid #2a2030; background: #140e18; cursor: pointer; box-shadow: 0 0 0 2px #050308; }
.av img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.av.on { border-color: #60e070; box-shadow: 0 0 0 2px #050308, 0 0 12px rgba(96,224,112,.6); }
.av.locked img { filter: grayscale(1) brightness(.35); }
.av .avlock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.av .avlock img { width: 42%; height: 42%; filter: none; border-radius: 0; }
.avpick { margin: 2px 0 8px; }
.avapply { margin-top: 10px; flex: none; }
/* the keepers of the camp: a word from them, or where they are lost */
.keeper .ico img { width: 44px; height: 44px; }
.keeper .ico { overflow: hidden; }
.keeper .ico img.portrait { width: auto; height: 68px; margin-top: 6px; image-rendering: pixelated; }
.keeperline { font-style: italic; }
.keeper.sealed { opacity: 0.85; }
/* Tributes before the Reliquary: a list of pacts, each a boon and a hardship */
.trib-list { display: flex; flex-direction: column; gap: 6px; max-height: 58vh; overflow-y: auto; }
.trib { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; padding: 8px 10px; cursor: pointer; font: inherit; color: inherit; }
.trib > img { width: 40px; height: 40px; flex: none; }
.trib .tx { flex: 1; min-width: 0; }
.trib .t { font-weight: 800; font-size: 14px; }
.trib .tick { flex: none; min-width: 44px; text-align: right; }
.trib .tick img { width: 22px; height: 22px; }
.trib.on { border-color: var(--gold, #e8b840); box-shadow: 0 0 0 1px var(--gold, #e8b840) inset; }
.trib-foot { justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.trib-foot img { width: 18px; height: 18px; vertical-align: -3px; margin: 0 2px; }
.shrine { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 8px; gap: 4px; }
.shrine img { width: 36px; height: 36px; }
.shrine .btn img { width: 20px; height: 20px; } /* the price coin: button size, not the Blessing's picture size */
.shrine .t { font-weight: 800; font-size: 14px; }
.shrine .d { font-size: 12px; color: var(--muted); min-height: 30px; }
.pips { display: flex; gap: 2px; justify-content: center; flex-wrap: wrap; }
.pips i { width: 7px; height: 7px; border-radius: 2px; background: #2c2032; box-shadow: inset 0 0 0 1px #000; }
.pips i.on { background: var(--gold); box-shadow: 0 0 4px rgba(240,200,96,.6); }

/* shop */
.offer { position: relative; overflow: hidden; padding: 12px; border: 2px solid var(--gold); background: radial-gradient(ellipse at 20% 0%, rgba(255,106,224,.25), transparent 60%), linear-gradient(160deg, #3a1c3c, #1a0f1e); }
.offer.red { background: radial-gradient(ellipse at 20% 0%, rgba(226,56,74,.35), transparent 60%), linear-gradient(160deg, #3c141c, #1a0a0e); }
.offer.blue { background: radial-gradient(ellipse at 20% 0%, rgba(80,150,255,.35), transparent 60%), linear-gradient(160deg, #142040, #0a0e1a); }
.offer .ot { font-family: var(--title); font-size: 18px; color: var(--gold-hi); text-shadow: 0 2px 0 #000; }
.offer .ribbon { position: absolute; top: 12px; right: -30px; transform: rotate(35deg); background: var(--blood-hi); color: #fff; font: 800 12px var(--body); padding: 3px 34px; box-shadow: 0 2px 6px #000; }
.offer .contents { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.offer .contents .rw { font-size: 9px; padding: 4px 7px 4px 3px; }
.offer .contents .rw img { width: 24px; height: 24px; }

.pack { display: flex; flex-direction: column; align-items: center; padding: 10px 6px 8px; gap: 2px; position: relative; cursor: pointer; }
.pack > img, .pack > div > img { width: 48px; height: 48px; }
.pack .amt { font: 10px var(--num); color: #fff; }
.pack .x2 { position: absolute; top: -6px; left: -4px; background: var(--blood-hi); color: #fff; font: 800 11px var(--body); padding: 2px 6px; border-radius: 6px; transform: rotate(-8deg); box-shadow: 0 2px 0 #000; }
.pack .tag { position: absolute; top: -6px; right: -4px; background: var(--gold); color: #2a1604; font: 800 10px var(--body); padding: 2px 6px; border-radius: 6px; }
.pack .bonus { font-size: 11px; color: var(--good); font-weight: 800; }
.pack .btn { margin-top: 6px; width: 100%; }

.chest { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; gap: 4px; text-align: center; }
.chest > img { width: 64px; height: 64px; animation: float 2.4s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.chest .t { font-weight: 800; font-size: 14px; }
.chest .btn { width: 100%; }

/* pass */
.passhead { padding: 12px; }
.pass-row { display: grid; grid-template-columns: 1fr 44px 1fr; gap: 6px; align-items: center; margin-bottom: 6px; }
.pass-row .tier { width: 40px; height: 40px; border-radius: 50%; background: #1c1420; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font: 10px var(--num); margin: 0 auto; }
.pass-row.reached .tier { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 8px rgba(240,200,96,.4); }
.pass-cell { display: flex; align-items: center; gap: 6px; padding: 6px; min-height: 52px; border-radius: 9px; border: 1px solid var(--line); background: rgba(0,0,0,.35); cursor: pointer; position: relative; }
.pass-cell img { width: 30px; height: 30px; }
.pass-cell .v { font: 8px var(--num); }
.pass-cell.prem { background: linear-gradient(135deg, rgba(240,200,96,.12), rgba(0,0,0,.35)); border-color: #6a5030; }
.pass-cell.can { border-color: var(--good); box-shadow: 0 0 10px rgba(88,200,96,.4); animation: pulse 1.4s infinite; }
.pass-cell.got { opacity: .45; }
.pass-cell.got::after { content: ''; position: absolute; right: 6px; top: 50%; width: 20px; height: 20px; margin-top: -10px; background: var(--ic-check) center / contain no-repeat; image-rendering: pixelated; }
.pass-cell .lockic { position: absolute; right: 6px; top: 4px; font-size: 12px; }

/* ===================== Modals ===================== */
#modals { position: absolute; inset: 0; pointer-events: none; z-index: 50; }
#modals > * { pointer-events: auto; }
.modal-bg { position: absolute; inset: 0; background: rgba(4,2,6,.78); display: flex; align-items: center; justify-content: center; padding: calc(14px + var(--safe-t)) 14px calc(14px + var(--safe-b)); animation: fadein .18s; backdrop-filter: blur(2px); }
@keyframes fadein { from { opacity: 0; } }
.modal { position: relative; width: 100%; max-width: 440px; max-height: 100%; overflow-y: auto; background: linear-gradient(180deg, #2a1e30, #150f18); border: 2px solid var(--bronze); border-radius: 14px; box-shadow: 0 0 0 2px #000, 0 20px 60px rgba(0,0,0,.8), inset 0 0 30px rgba(0,0,0,.6); padding: 16px 14px 14px; animation: pop .22s cubic-bezier(.2,1.4,.4,1); touch-action: pan-y; scrollbar-width: none; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.modal .mt { font-family: var(--title); font-size: 22px; color: var(--gold); text-align: center; margin-bottom: 10px; text-shadow: 0 2px 0 #000; }
.modal .x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.5); border: 1px solid var(--line); color: var(--muted); font-size: 16px; cursor: pointer; z-index: 2; }
.modal .btns { display: flex; gap: 8px; margin-top: 14px; }
.modal .btns .btn { flex: 1; }
.modal .note { font-size: 11.5px; color: var(--dim); text-align: center; margin-top: 8px; }
.modal.wide { max-width: 520px; }

.toastbox { position: absolute; top: calc(70px + var(--safe-t)); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 80; }
.toast { background: rgba(10,6,12,.94); border: 1px solid var(--bronze); color: var(--text); padding: 8px 16px; border-radius: 20px; font-weight: 800; font-size: 14px; box-shadow: 0 6px 20px #000; animation: toast 2.4s forwards; max-width: 90vw; text-align: center; }
.toast.bad { border-color: var(--blood-hi); color: #ffb0b8; }
.toast.good { border-color: var(--good); color: #c8ffd0; }
@keyframes toast { 0% { transform: translateY(-20px); opacity: 0; } 10%,80% { transform: none; opacity: 1; } 100% { transform: translateY(-10px); opacity: 0; } }

/* reward popup */
.reward-list { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 6px 0; }
.reward { width: 78px; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: rewardIn .4s backwards; }
.reward .slot { width: 64px; }
.reward .n { font: 8px var(--num); text-align: center; line-height: 1.4; }
.results .reward-list { gap: 7px; margin: 4px 0; } .results .reward { width: 62px; gap: 3px; } .results .reward .slot { width: 48px; } /* compact so the whole results card fits on one screen */
.reward .rn { font-size: 11px; font-weight: 800; text-align: center; line-height: 1.1; }
@keyframes rewardIn { from { transform: scale(.2) rotate(-20deg); opacity: 0; } }
.rays { position: absolute; left: 50%; top: 90px; width: 360px; height: 360px; margin: -180px 0 0 -180px; background: repeating-conic-gradient(rgba(240,200,96,.12) 0 10deg, transparent 10deg 20deg); border-radius: 50%; animation: spin 12s linear infinite; pointer-events: none; mask-image: radial-gradient(circle, #000 20%, transparent 70%); -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 70%); }
@keyframes spin { to { transform: rotate(360deg); } }

/* login calendar */
.cal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cal .day { position: relative; border-radius: 9px; border: 1px solid var(--line); background: rgba(0,0,0,.35); padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cal .day .dn { font-size: 11px; font-weight: 800; color: var(--muted); }
.cal .day img { width: 30px; height: 30px; }
.cal .day .v { font: 7px var(--num); text-align: center; }
.cal .day .v.word, .pass-cell .v.word, .reward .n.word { font: 800 11px/1.1 var(--body); }
.cal .day.today { border-color: var(--gold); box-shadow: 0 0 12px rgba(240,200,96,.4); background: rgba(240,200,96,.08); }
.cal .day.got { opacity: .45; }
.cal .day.got::after { content: ''; position: absolute; inset: 0; background: var(--ic-check) center / 34px 34px no-repeat; image-rendering: pixelated; }
.cal .day.big { grid-column: span 2; }

/* settings */
.setrow { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid rgba(255,255,255,.05); }
.setrow label { flex: 1; font-weight: 800; }
.setrow input[type=range] { width: 140px; accent-color: var(--gold); }
/* account + cloud save */
.field { display: block; width: 100%; box-sizing: border-box; margin: 0 0 8px; padding: 10px 12px; background: #120c16; color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: 500 15px var(--body); user-select: text; -webkit-user-select: text; touch-action: manipulation; }
.field:focus { outline: none; border-color: var(--gold); }
.cf-state { text-align: center; margin: 2px 0 8px; }
.cf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cf-card { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.cf-title { font-weight: 800; color: var(--gold); }
.cf-stats { font-size: 12px; line-height: 1.5; flex: 1; }
.btn:disabled { opacity: .5; pointer-events: none; }
.switch { width: 48px; height: 26px; border-radius: 13px; background: #2c2032; border: 1px solid var(--line); position: relative; cursor: pointer; flex: none; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #6f6352; transition: .15s; }
.switch.on { background: #2e7a3c; }
.switch.on::after { left: 24px; background: #dfffe0; }
select { background: #1c1420; color: var(--text); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font-family: inherit; font-weight: 800; font-size: 14px; }

/* ===================== HUD (in run) ===================== */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; padding-top: var(--safe-t); }
#hud .xp { position: absolute; top: var(--safe-t); left: 0; right: 0; height: 12px; background: rgba(0,0,0,.75); border-bottom: 1px solid #000; }
#hud .xp i { display: block; height: 100%; background: linear-gradient(180deg, #9af0ff, #2e8ad0); box-shadow: 0 0 10px rgba(80,180,255,.6); transition: width .12s; }
#hud .xp span { position: absolute; left: 6px; top: 1px; font: 9px/10px var(--num); color: #fff; text-shadow: 0 1px 0 #000; }
#hud .top { position: absolute; top: calc(16px + var(--safe-t)); left: 8px; right: 8px; display: flex; align-items: flex-start; gap: 8px; }
#hud .timer { font: 20px var(--num); color: #fff; text-shadow: 0 2px 0 #000, 0 0 8px #000; position: absolute; left: 50%; transform: translateX(-50%); top: 2px; }
#hud .timer.boss { color: var(--blood-hi); }
#hud .stats { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font: 11px var(--num); color: #fff; text-shadow: 0 1px 0 #000, 0 0 4px #000; }
#hud .stats div { display: flex; align-items: center; gap: 4px; }
#hud .stats img { width: 16px; height: 16px; }
#hud .pause { pointer-events: auto; width: 38px; height: 38px; border-radius: 10px; background: rgba(10,6,12,.7); border: 1px solid var(--bronze); color: var(--gold); font-size: 16px; font-weight: 800; cursor: pointer; }
#hud .build { position: absolute; top: calc(60px + var(--safe-t)); left: 8px; display: flex; flex-direction: column; gap: 3px; }
#hud .build .r { display: flex; gap: 3px; }
#hud .build .b { position: relative; width: 22px; height: 22px; background: rgba(0,0,0,.6); border: 1px solid #3a2c40; border-radius: 5px; display: flex; align-items: center; justify-content: center; }
#hud .build .b img { width: 18px; height: 18px; }
#hud .build .b i { position: absolute; bottom: -3px; right: -3px; font: 6px/1 var(--num); color: var(--gold); background: #000; padding: 1px 2px; border-radius: 2px; font-style: normal; }
/* the boss bar: at the top, just under the abilities (runui.js stackBoss places it), the quest tracker moving down under it.
   Plain and fine: the name above, a thin bronze frame with spear-tip ends, a thin line of dark blood, a filigree under it. */
#hud .bossbar { position: absolute; top: calc(92px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(84%, 420px); text-align: center; pointer-events: none; }
#hud .bossbar .n { font-family: var(--title); color: #ece0c8; font-size: 13px; letter-spacing: .08em; text-shadow: 0 1px 0 #000, 0 0 6px rgba(0,0,0,.9); white-space: nowrap; margin-bottom: -6px; position: relative; z-index: 1; } /* close over the rail (the frame's top rows are empty) */
#hud .bossbar .bb-cv { display: block; margin: 0 auto; image-rendering: pixelated; filter: drop-shadow(0 2px 2px rgba(0,0,0,.8)); }
#hud .bossbar.enraged .n { color: #ffb0a0; text-shadow: 0 1px 0 #000, 0 0 8px rgba(255,40,30,.8); }
/* the level-up footer: potions on the left, Stats and Reroll on the right, wrapping to a second line when narrow */
.lvfoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.lvfoot .lvacts { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.banner { position: absolute; top: 30%; left: 0; right: 0; text-align: center; font-family: var(--title); font-size: clamp(22px, 7vw, 40px); color: var(--blood-hi); text-shadow: 0 3px 0 #000, 0 0 24px rgba(226,56,74,.8); animation: banner 3s forwards; pointer-events: none; letter-spacing: .06em; padding: 0 10px; }
.banner.warn { color: var(--gold); font-size: clamp(16px, 5vw, 26px); text-shadow: 0 2px 0 #000, 0 0 16px rgba(240,200,96,.6); }
.banner small { display: block; font-family: var(--body); font-size: 14px; color: var(--text); letter-spacing: .3em; text-transform: uppercase; }
@keyframes banner { 0% { transform: scale(2.2); opacity: 0; } 12% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }
.tutorial { position: absolute; bottom: calc(18% + var(--safe-b)); left: 0; right: 0; text-align: center; pointer-events: none; animation: breathe 2s infinite; }
.tutorial div { display: inline-block; background: rgba(0,0,0,.7); border: 1px solid var(--bronze); border-radius: 12px; padding: 10px 16px; font-weight: 800; font-size: 16px; }
.tutorial .hand { font-size: 34px; display: block; animation: swipe 1.6s infinite; }
@keyframes breathe { 50% { opacity: .75; } }
@keyframes swipe { 0%,100% { transform: translateX(-24px); } 50% { transform: translateX(24px); } }

/* level-up */
.lvl-title { font-family: var(--title); font-size: 30px; text-align: center; color: var(--gold-hi); text-shadow: 0 0 20px rgba(240,200,96,.7), 0 3px 0 #000; margin-bottom: 4px; }
.choice { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; border: 2px solid var(--line); background: linear-gradient(180deg, #2c2034, #1a121e); cursor: pointer; animation: rewardIn .35s backwards; transition: transform .1s, border-color .1s; }
.choice + .choice { margin-top: 8px; }
.choice:hover, .choice:active { border-color: var(--gold); transform: scale(1.02); }
.choice .ico { width: 54px; height: 54px; flex: none; border-radius: 10px; background: radial-gradient(circle, #43304a, #150f18); border: 1px solid var(--bronze); display: flex; align-items: center; justify-content: center; }
.choice .ico img { width: 40px; height: 40px; }
.choice .t { font-weight: 800; font-size: 16px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.choice .t .new { font: 7px var(--num); background: var(--blood-hi); color: #fff; padding: 3px 4px; border-radius: 3px; }
.choice .t .lv { font: 8px var(--num); color: var(--gold); }
.choice .d { font-size: 13px; color: var(--muted); line-height: 1.25; margin-top: 2px; }
.choice.weapon .ico { border-color: #6a8ad0; }
.buildrow { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin: 6px 0 0; }
.buildrow .b { position: relative; width: 28px; height: 28px; background: rgba(0,0,0,.5); border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.buildrow .b img { width: 22px; height: 22px; }
.buildrow .b i { position: absolute; bottom: -3px; right: -3px; font: 6px/1 var(--num); color: var(--gold); background: #000; padding: 1px 2px; font-style: normal; }
.buildrow .b.empty { opacity: .3; }

/* results */
/* Victory / Defeat: a metallic gradient title (gold / blood) with a glow that breathes */
.results .big { font-family: var(--title); font-size: 30px; text-align: center; margin: 1px 0 2px; letter-spacing: .05em; line-height: 1.04;
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.results .big.win { background-image: linear-gradient(180deg, #fff6d8 0%, #ffd766 44%, #e3a636 72%, #fff0c0 100%); animation: resWin 2.6s ease-in-out infinite; }
.results .big.lose { background-image: linear-gradient(180deg, #ff9090 0%, #e8384a 46%, #8c1018 100%); animation: resLose 3.6s ease-in-out infinite; }
@keyframes resWin { 0%, 100% { filter: drop-shadow(0 2px 0 #3a2400) drop-shadow(0 0 11px rgba(255,210,100,.7)); } 50% { filter: drop-shadow(0 2px 0 #3a2400) drop-shadow(0 0 22px rgba(255,228,140,1)); } }
@keyframes resLose { 0%, 100% { opacity: 1; filter: drop-shadow(0 2px 0 #1a0003) drop-shadow(0 0 10px rgba(220,30,40,.55)); } 50% { opacity: .96; filter: drop-shadow(0 2px 0 #1a0003) drop-shadow(0 0 18px rgba(240,40,50,.85)); } }
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 6px 0; }
.statgrid div { background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; display: flex; justify-content: space-between; font-size: 12px; }
.statgrid b { font: 9px var(--num); color: var(--gold); align-self: center; }
.goldline { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding: 1px 4px; }
.goldline b { font: 9px var(--num); color: var(--text); }
.goldtotal { display: flex; align-items: center; justify-content: center; gap: 8px; font: 16px var(--num); color: var(--gold); margin: 5px 0 2px; }
.goldtotal img { width: 26px; height: 26px; }
.dmgrow { display: flex; align-items: center; gap: 6px; font-size: 12px; margin: 2px 0; }
.dmgrow img { width: 20px; height: 20px; }
.dmgrow .bar { flex: 1; height: 6px; }
.dmgrow b { font: 7px var(--num); width: 52px; text-align: right; }

/* ad placeholder */
.ad-wait { position: absolute; inset: 0; z-index: 95; background: rgba(5,3,8,.72); display: flex; align-items: center; justify-content: center; animation: fadein .25s; }
.ad-wait-t { font-weight: 800; color: var(--text); letter-spacing: .03em; animation: adwait 1.2s ease-in-out infinite alternate; }
@keyframes adwait { from { opacity: .45; } to { opacity: 1; } }
.ad-layer { position: absolute; inset: 0; z-index: 90; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ad-tag { position: absolute; top: calc(12px + var(--safe-t)); left: 12px; font: 8px var(--num); background: #ffd35a; color: #000; padding: 4px 6px; border-radius: 3px; }
.ad-body { text-align: center; padding: 20px; max-width: 360px; }
.ad-art { width: 120px; height: 120px; margin: 0 auto 16px; border-radius: 24px; background: radial-gradient(circle, #5a2a60, #1a0a1e); border: 3px solid var(--gold); display: flex; align-items: center; justify-content: center; animation: float 2s infinite; }
.ad-art img { width: 80px; height: 80px; }
.ad-title { font-family: var(--title); font-size: 24px; color: var(--gold); }
.ad-sub { color: var(--text); margin-top: 6px; }
.ad-note { color: var(--dim); font-size: 12px; margin-top: 20px; }
.ad-count { position: absolute; top: calc(12px + var(--safe-t)); right: 60px; font: 9px var(--num); color: #ccc; padding-top: 8px; }
.ad-close { position: absolute; top: calc(8px + var(--safe-t)); right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; background: rgba(255,255,255,.1); color: #fff; font-size: 18px; cursor: pointer; }

@media (min-width: 700px) {
  .content { padding-left: 16px; padding-right: 16px; }
}
@media (max-height: 640px) {
  .hero-stage { min-height: 120px; }
  .stagecard canvas, .stagecard .thumb { height: 96px; }
}

/* ===================== v2 additions ===================== */
img.ic { image-rendering: auto; }
.pill img.ic { width: 24px; height: 24px; }
.chips { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; }
.chip { font: 800 12px var(--body); color: var(--text); background: rgba(0,0,0,.7); border: 1px solid var(--line); border-radius: 12px; padding: 4px 10px; cursor: pointer; }
.chip.on { background: linear-gradient(180deg, #a01828, #5a0a14); border-color: var(--blood-hi); color: #fff; box-shadow: 0 0 10px rgba(226,56,74,.5); }
.chip.off { color: var(--dim); cursor: default; }
.chip.dread { background: rgba(60,10,20,.85); border-color: #ff5060; color: #ffb0b8; }
.seg { display: flex; background: rgba(0,0,0,.4); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 6px 12px; font-weight: 800; color: var(--muted); cursor: pointer; }
.seg button.on { background: linear-gradient(180deg, #ffe39a, #d09030); color: #2a1604; }
.setnote { font-size: 11.5px; color: var(--dim); margin: -4px 2px 4px; }
.tabs.small button { font-size: 11px; min-height: 30px; }
.slot.mark { border-radius: 50%; }
.slot.mark img { width: 80%; height: 80%; }

/* level-up cards */
.choice .tg { font: 800 10px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.choice.aff0 .tg { color: #b89a7a; } .choice.aff2 .tg { color: #7df08a; }
.choice.cls { border-color: #8a6a2a; background: linear-gradient(180deg, #3a2a1a, #1a1210); }
.choice.cls .tg { color: var(--gold); }
.choice.elev { border-color: #8a5a20; } .choice.elev .tg { color: #ffb050; }
.choice.abt { border-color: #3a5a9a; } .choice.abt .tg { color: #8ab8ff; }
.choice .note2 { font-size: 11.5px; color: #ff9aa4; margin-top: 3px; }
.choice .note2.mem { color: #9ad0ff; }
.choice.remembered { box-shadow: 0 0 0 1px #60a0ff, 0 0 14px rgba(96,160,255,.4); }
.choice.targeting { border-style: dashed; border-color: #9ad0ff; }
.choice.noecho { opacity: .45; filter: grayscale(.6); border-style: solid; border-color: var(--line); }
.choice .ico img { width: 44px; height: 44px; }
.lvfoot { margin-top: 12px; }
.pots { gap: 6px; }
.potbtn { display: flex; align-items: center; gap: 3px; padding: 3px 8px 3px 4px; border-radius: 18px; border: 1px solid var(--line); background: rgba(0,0,0,.4); color: var(--text); font: 10px var(--num); cursor: pointer; }
.potbtn img { width: 26px; height: 26px; }
.potbtn.on { border-color: #9ad0ff; box-shadow: 0 0 10px rgba(154,208,255,.6); background: rgba(40,80,140,.4); }
.potbtn.off { opacity: .35; pointer-events: none; }
.potionhint { color: #9ad0ff; font-weight: 800; font-size: 13px; margin-top: 6px; }
.buildrow.traits .b.elev { border-color: #b07020; } .buildrow.traits .b.cls { border-color: #e8c050; border-radius: 50%; }
.statgrid.three { grid-template-columns: 1fr 1fr 1fr; }
.statgrid.three div { font-size: 11px; padding: 5px 6px; }
.deedsdone { background: rgba(240,200,96,.08); border: 1px solid #6a5030; border-radius: 8px; padding: 6px 9px; margin: 5px 0; }
.item .ico .cnt { position: absolute; bottom: -4px; right: -4px; font: 8px var(--num); background: #000; color: #fff; border-radius: 6px; padding: 2px 4px; }
.herbs { gap: 6px; margin: 8px 0; }
.herbs .herb { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 6px; gap: 2px; }
.herbs .herb img { width: 30px; height: 30px; }
.herbs .herb b { font: 11px var(--num); }
/* every herb tile the same size, so the row reads as a clean grid whatever the label length (a 2-line name
   like "Grave Moss" no longer makes its tile taller than a 1-line one). Not the materials row (its own layout). */
.herbs:not(.mats) { align-items: stretch; }
.herbs:not(.mats) .herb { min-width: 0; }
.herbs:not(.mats) .herb span { min-height: 2.2em; display: flex; align-items: flex-start; justify-content: center; text-align: center; line-height: 1.1; }
.mats .herb { flex-direction: row; justify-content: center; gap: 4px; padding: 4px 2px; flex-wrap: wrap; }
.mats .herb img { width: 26px; height: 26px; }
.mats .herb span { width: 100%; text-align: center; }
.gms { margin-top: 10px; padding: 8px 10px; background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.08); }
.gms-h { font-weight: bold; color: var(--gold, #ffd35a); margin-bottom: 4px; font-size: 13px; }
.gms-row { color: #6e685e; display: flex; align-items: baseline; gap: 6px; }
.gms-row.on { color: var(--good); }
.gms-row .gms-lock { color: var(--rc); width: 16px; height: 16px; flex: none; align-self: center; display: flex; }
.gms-row .gms-lock .emb { width: 16px; height: 16px; filter: drop-shadow(0 1px 0 #000); opacity: .55; }
.gms-row .gms-lock .emb.on { opacity: 1; filter: drop-shadow(0 1px 0 #000) drop-shadow(0 0 3px var(--rc)); }
.gms-row .gms-v { flex: 1; }
.gms-row .gms-rng { color: #6e685e; font-size: 11px; white-space: nowrap; }
/* Might: a bar from 0 to 100% */
.might { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.might-l { font-weight: bold; color: var(--gold, #ffd35a); font-size: 13px; }
.might-bar { flex: 1; height: 8px; background: #0a070c; border: 1px solid #3a2c40; position: relative; overflow: hidden; }
.might-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #a8401c, #ff8a3a); box-shadow: 0 0 6px #ff8a3a80; }
.might-v { font: 12px var(--num); color: #ffb070; min-width: 46px; text-align: right; }
.gcost { display: flex; justify-content: center; gap: 22px; margin: 4px 0 2px; }
.gcost-i { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.gcost-box { width: 56px; height: 44px; display: flex; align-items: center; justify-content: center; background: linear-gradient(#1c181e, #0e0c10); border: 2px solid #8a6a2c; box-shadow: inset 0 0 0 1px #000; }
.gcost-box img { width: 32px; height: 32px; }
.gcost-i b { font: 13px var(--num); }
.gcost-i.ok b { color: var(--good); }
.gcost-i.bad b { color: var(--blood-hi); }
.pack-forge { gap: 4px; }
.pack-forge.soldout { opacity: 0.55; }
.pack-forge .pf-in { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; font: 11px var(--num); min-height: 16px; }
.pack-forge .pf-in span { display: inline-flex; align-items: center; gap: 2px; font: 12px var(--num); color: var(--text, #e8e0d0); }
.pack-forge .pf-in img { width: 16px; height: 16px; }
.sb-row { display: flex; gap: 12px; justify-content: center; margin-top: 6px; }
.sb-card { flex: 1; max-width: 150px; background: linear-gradient(#26222a, #121014); border: 2px solid #3a3440; cursor: pointer; display: flex; flex-direction: column; transition: transform .12s; }
.sb-card.on { border-color: var(--gold); box-shadow: 0 0 14px rgba(240,200,96,.45); transform: translateY(-2px); }
.sb-art { position: relative; height: 128px; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: radial-gradient(ellipse at 50% 78%, rgba(255,200,80,.5) 0, rgba(255,190,60,.12) 30%, transparent 55%), radial-gradient(circle at 50% 50%, #2e2a30 0, #16141a 70%); }
.sb-ray { position: absolute; left: 50%; top: 0; width: 8px; height: 62%; margin-left: -4px; background: linear-gradient(rgba(255,210,90,0), rgba(255,210,90,.75)); filter: blur(2px); }
.sb-art img { position: relative; width: 72px; height: 72px; animation: sbFloat 2.4s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(255,200,80,.55)); }
.sb-card:not(.on) .sb-art img { filter: grayscale(.4) brightness(.8); }
.sb-t { padding: 8px 4px; text-align: center; font-weight: 800; font-size: 14px; background: rgba(0,0,0,.55); color: #f0e8d8; }
@keyframes sbFloat { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(3px); } }
.acttrack { display: flex; align-items: center; gap: 10px; padding: 10px 14px 22px; margin-bottom: 6px; }
.act-pts { display: flex; flex-direction: column; align-items: center; flex: none; min-width: 58px; }
.act-pts b { display: inline-flex; align-items: center; gap: 3px; font: 22px var(--num); color: var(--gold-hi); }
.act-pts b img { width: 20px; height: 20px; }
.act-line { position: relative; flex: 1; height: 44px; margin: 0 22px 0 8px; }
.act-bar { position: absolute; left: 0; right: 0; top: 19px; height: 6px; background: #1a1418; border: 1px solid #3a2e30; }
.act-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7a1420, #d8323e); }
.act-chest { position: absolute; top: 0; transform: translateX(-50%); width: 40px; height: 40px; padding: 0; border: 0; background: none; cursor: pointer; }
.act-chest img { width: 40px; height: 40px; filter: grayscale(.7) brightness(.7); }
.act-chest.ready img { filter: drop-shadow(0 0 6px rgba(255,200,80,.9)); animation: sbFloat 1.4s ease-in-out infinite; }
.act-chest.got img { filter: grayscale(.3) brightness(.9); }
.act-tick { position: absolute; right: -6px; top: -6px; }
.act-tick img { width: 18px !important; height: 18px !important; filter: none !important; animation: none !important; }
.act-at { position: absolute; left: 50%; top: 42px; transform: translateX(-50%); font: 11px var(--num); color: var(--gold); white-space: nowrap; }
.panel.item .ico .mpts { position: absolute; right: -4px; bottom: -4px; display: inline-flex; align-items: center; gap: 1px; font: 11px var(--num); color: var(--gold-hi); background: rgba(0,0,0,.75); padding: 0 3px; }
.panel.item .ico .mpts img { width: 12px; height: 12px; }
.mini-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; padding: 6px 0; }
.mini-chips span { display: inline-flex; align-items: center; gap: 2px; font: 13px var(--num); }
.mini-chips img { width: 26px; height: 26px; }
.vigil-mat { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 2px 0 4px; }
.vigil-mat img { width: 26px; height: 26px; }
.item.deed .t { font-size: 14px; }
.item.deed .d { font-size: 11.5px; }

/* HUD agony gauge */
#hud .agony { position: absolute; top: calc(92px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 11px; color: #ffb0b8; text-shadow: 0 1px 0 #000; }
#hud .agony .agbar { width: 90px; height: 6px; background: rgba(0,0,0,.6); border: 1px solid #5a1018; border-radius: 3px; overflow: hidden; }
#hud .agony .agbar i { display: block; height: 100%; background: linear-gradient(90deg, #ff9030, #e02838, #8a0a3a); }
#hud .agony b { font: 10px var(--num); color: #ff5060; }
#hud .build .b img { width: 20px; height: 20px; }

/* v3: buffs, main quest, secrets, archive */
#hud .buffs { position: absolute; top: calc(118px + var(--safe-t)); left: 8px; display: flex; gap: 4px; }
#hud .buffs .bf { display: flex; align-items: center; gap: 2px; background: rgba(0,0,0,.65); border: 1px solid #3a2c40; border-radius: 6px; padding: 2px 4px 2px 2px; }
#hud .buffs .bf img { width: 18px; height: 18px; }
#hud .buffs .bf b { font: 8px/1 var(--num); color: #fff; }
.mainq { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 7px 10px; font-size: 12px; cursor: pointer; }
.mainq .mqt { color: var(--gold); font-weight: 800; white-space: nowrap; }
.mainq .mqd { color: #e8dcc8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mainq .mqr { gap: 3px; font-weight: 800; } .mainq .mqr img { width: 16px; height: 16px; }
.mainq.done { border-color: #5fd06a; box-shadow: 0 0 12px rgba(95,208,106,.35); }
.chip.secret { background: rgba(120,40,160,.55); border-color: #c060ff; color: #f0d0ff; }
.shardcount { display: flex; align-items: center; gap: 4px; font: 14px/1 var(--num); color: #ff9ad8; }
.shardcount img { width: 22px; height: 22px; }
.shrine.arch .btn img { width: 14px; height: 14px; }


/* ===================== Classic pixel skin =====================
 * Hard-edged pixel frames: square corners, black outline, bronze inner ring, 2px bevel (lit top-left),
 * banded (hard-stop) gradients instead of smooth ones, and a dithered stone texture (--tex-*, generated
 * at boot from the game palette in ui.js). Icons and thumbnails scale with nearest-neighbour. */
html { image-rendering: pixelated; }
#menu *:not(.rays), #modals *:not(.rays), #hud *, .toastbox * { border-radius: 0 !important; }
#modals .av, #modals .av img, #modals .prof-av, #modals .prof-av img { border-radius: 50% !important; } /* avatars are round portraits */
:root { --ring: #5a4630; --ring-gold: #b08a48; --hi: rgba(255,226,170,.13); --lo: rgba(0,0,0,.5);
  --notch: polygon(2px 0, calc(100% - 2px) 0, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 0 calc(100% - 2px), 0 2px); }

.panel { border: 2px solid #050308; background: var(--tex-panel, none) 0 0 / 64px 64px, #1b1320;
  box-shadow: inset 0 0 0 2px var(--ring), inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 3px 0 #000; }
.panel.gold, .frame { border-color: #050308; box-shadow: inset 0 0 0 2px var(--ring-gold), inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 3px 0 #000; }
.item.done { box-shadow: inset 0 0 0 2px var(--good), inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 3px 0 #000; }
.mainq.done { box-shadow: inset 0 0 0 2px #5fd06a, inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 0 0 2px rgba(95,208,106,.35); }
.hero-card.sel { box-shadow: inset 0 0 0 2px var(--gold), inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 3px 0 #000; }

.btn { border: 2px solid #050308; clip-path: var(--notch); text-shadow: 1px 1px 0 rgba(0,0,0,.7);
  background: linear-gradient(180deg, #6a5872 0 8%, #4e3e58 8% 50%, #3a2c42 50% 86%, #281e2e 86%);
  box-shadow: inset 2px 2px 0 0 rgba(255,255,255,.18), inset -2px -2px 0 0 rgba(0,0,0,.35); }
.btn:active { transform: translateY(2px); box-shadow: inset 2px 2px 0 0 rgba(0,0,0,.35); }
.btn.gold { color: #2a1604; text-shadow: 1px 1px 0 rgba(255,240,190,.5); background: linear-gradient(180deg, #fff0b8 0 8%, #ffd76a 8% 42%, #eab044 42% 72%, #c08428 72% 88%, #8a5a18 88%); }
.btn.red { background: linear-gradient(180deg, #ff6a70 0 8%, #e2384a 8% 50%, #b4202e 50% 86%, #7c1018 86%); }
.btn.green, .btn.ad { background: linear-gradient(180deg, #8af08a 0 8%, #4ec060 8% 50%, #2e9a44 50% 86%, #1c6a2c 86%); }
.btn.gem { background: linear-gradient(180deg, #f090f0 0 8%, #c050c8 8% 50%, #9a34a8 50% 86%, #62186e 86%); }
.btn.blue { background: linear-gradient(180deg, #9ac8ff 0 8%, #4a8ae8 8% 50%, #3066c0 50% 86%, #1c3a80 86%); }
.btn.ghost { background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 2px var(--ring), inset 2px 2px 0 2px var(--hi); }
.btn.shine::after { background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,.3) 40% 47%, transparent 47%); background-size: 250% 100%; }

.tabs { background: #0c080e; border: 2px solid #050308; box-shadow: inset 0 0 0 2px var(--ring); padding: 4px; }
.tabs button.on { background: linear-gradient(180deg, #5a4862 0 10%, #3e3046 10% 80%, #2a2030 80%); box-shadow: inset 2px 2px 0 0 rgba(255,255,255,.14), inset 0 0 0 1px #000; }

/* a slot: a soft glow of the rank's colour behind the piece in stepped (pixel) rings and a tint lighter at the top,
 * laid over the dark stone texture */
.slot { border: 2px solid var(--rc, #3a2c40);
  background: radial-gradient(circle at 50% 52%, color-mix(in srgb, var(--rc, #333) 34%, transparent) 0 24%, color-mix(in srgb, var(--rc, #333) 24%, transparent) 24% 38%, color-mix(in srgb, var(--rc, #333) 14%, transparent) 38% 54%, transparent 54%),
    linear-gradient(180deg, color-mix(in srgb, var(--rc, #333) 34%, transparent) 0 10%, color-mix(in srgb, var(--rc, #333) 22%, transparent) 10% 55%, color-mix(in srgb, var(--rc, #333) 12%, transparent) 55%),
    var(--tex-dark, none) 0 0 / 64px 64px, #120c16;
  box-shadow: inset 0 0 0 2px #050308, inset 4px 4px 0 0 rgba(255,255,255,.07), inset -4px -4px 0 0 rgba(0,0,0,.45), 0 2px 0 #000; }
.slot.empty { background: rgba(0,0,0,.4); box-shadow: inset 0 0 0 2px #050308; }
@keyframes glowr { 0%,100% { outline: 2px solid transparent; } 50% { outline: 2px solid var(--rc); } }

.pill { border: 2px solid #050308; background: #0c080e; box-shadow: inset 0 0 0 1px var(--ring); clip-path: var(--notch); }
.pill .plus { box-shadow: inset -2px -2px 0 rgba(0,0,0,.35), inset 2px 2px 0 rgba(255,255,255,.3); }
.badge { box-shadow: 0 0 0 2px #050308, inset -2px -2px 0 rgba(0,0,0,.3); }
.avatar, .sidebtn .ic, .item .ico, .hero-card .pic, .pass-row .tier { border: 2px solid #050308; background: var(--tex-dark, none) 0 0 / 64px 64px, #1a1220;
  box-shadow: inset 0 0 0 2px var(--ring-gold), inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 3px 0 #000; }
.sidebtn.hot .ic { box-shadow: inset 0 0 0 2px var(--gold), inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 3px 0 #000; }
@keyframes hot { 0%,100% { outline: 2px solid transparent; } 50% { outline: 2px solid rgba(240,200,96,.9); } }

.nav { background: var(--tex-dark, none) 0 0 / 64px 64px, #140e18; border-top: 2px solid var(--ring-gold); box-shadow: 0 -2px 0 #050308, inset 0 2px 0 var(--hi); }
.nav button.on { background: linear-gradient(180deg, transparent 0 60%, rgba(240,200,96,.12) 60%); }
.nav button.on::before { content: ''; position: absolute; top: 0; left: 20%; right: 20%; height: 2px; background: var(--gold); }

.modal { border: 2px solid #050308; background: var(--corner-tl, none) 0 0 / 26px 26px no-repeat, var(--corner-tr, none) 100% 0 / 26px 26px no-repeat, var(--corner-bl, none) 0 100% / 26px 26px no-repeat, var(--corner-br, none) 100% 100% / 26px 26px no-repeat, var(--tex-panel, none) 0 0 / 64px 64px, #1f1624;
  box-shadow: inset 0 0 0 2px var(--ring-gold), inset 0 0 0 4px #050308, inset 6px 6px 0 0 var(--hi), inset -6px -6px 0 0 var(--lo), 0 0 0 2px #000, 0 12px 0 rgba(0,0,0,.5); }
.modal-bg { backdrop-filter: none; }
.modal .x { border: 2px solid #050308; background: #2a2030; box-shadow: inset 0 0 0 1px var(--ring), inset 2px 2px 0 1px var(--hi); color: var(--gold); }
.toast { border: 2px solid var(--bronze); box-shadow: 0 0 0 2px #050308, 0 4px 0 #000; }

.bar { border: 2px solid #050308; background: #1a1016; box-shadow: none; }
.bar i { background: linear-gradient(180deg, #ffe39a 0 30%, #e0a93e 30% 75%, #a8741c 75%); }
.bar.blue i { background: linear-gradient(180deg, #b8e0ff 0 30%, #5a9ae8 30% 75%, #2a5ab0 75%); }
.bar.green i { background: linear-gradient(180deg, #b8f8b8 0 30%, #4ec060 30% 75%, #227a34 75%); }
.acct .xpbar { border: 1px solid #050308; }
.acct .xpbar i { background: linear-gradient(180deg, #c8e8ff 0 40%, #6a9aff 40%); }
.pips i { box-shadow: inset 0 0 0 1px #000; } .pips i.on { box-shadow: inset -1px -1px 0 rgba(0,0,0,.4), inset 1px 1px 0 rgba(255,255,255,.4); }
.stagecard .arrow { border: 2px solid #050308; background: #1f1624; box-shadow: inset 0 0 0 2px var(--ring-gold), inset 4px 4px 0 0 var(--hi); }
.chip { border-width: 2px; }
.power { border: 2px solid #050308; box-shadow: inset 0 0 0 1px var(--ring); }
.rw { box-shadow: inset 0 0 0 1px rgba(0,0,0,.6); }
.switch { box-shadow: inset 0 0 0 2px #050308; }
#hud .build .b, #hud .buffs .bf { border: 2px solid #050308; box-shadow: inset 0 0 0 1px var(--ring); }
#hud .agony .agbar { border: 2px solid #050308; }
.switch, .switch::after { border-radius: 0 !important; }
.switch::after { box-shadow: inset -2px -2px 0 rgba(0,0,0,.35), inset 2px 2px 0 rgba(255,255,255,.3); }
input[type=range] { accent-color: var(--gold); }

/* item icons: large and crisp (no filters, which make browsers resample smoothly) */
.slot img { width: 80%; height: 80%; filter: none; image-rendering: pixelated; }
.slot.empty img { filter: grayscale(1); }

/* ability upgrade cards (level III / VI / IX) */
.choice.upg { border-color: #b0602a; background: linear-gradient(180deg, #3a1e12, #1a0e0a); box-shadow: inset 0 0 0 2px #e08a3a, inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 0 12px rgba(255,140,60,.35); }
.choice.upg .tg { color: #ffb070; }

/* hall rules */
#hud .lordk { position: absolute; top: calc(var(--safe-t) + 110px); left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: #d8ff90; text-shadow: 0 1px 0 #000, 0 0 6px #000; white-space: nowrap; pointer-events: none; }
.srule { font-size: 11.5px; line-height: 1.25; color: #e8c26a; margin: 1px 0 2px; }
.stagecard .info { padding-left: 48px; padding-right: 48px; }
#hud .agony + .lordk, #hud .lordk.below { top: calc(var(--safe-t) + 110px); }
/* sealed Blessings */
.panel.shrine.sealed > img { filter: grayscale(1) brightness(.55); }
.panel.shrine.sealed .t { color: var(--muted); }
.sealnote { display: flex; gap: 6px; align-items: flex-start; font-size: 11.5px; line-height: 1.25; color: var(--muted); margin-top: 6px; text-align: left; }
.sealnote img { width: 16px; height: 16px; flex: none; image-rendering: pixelated; }
/* per-hero Archive and loadouts */
.heropick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.heropick .hp { width: 40px; height: 40px; padding: 2px; background: #1a1220; border: 2px solid #050308; box-shadow: inset 0 0 0 1px var(--ring); cursor: pointer; }
.heropick .hp.on { box-shadow: inset 0 0 0 2px var(--ring-gold); background: #2a1c10; }
.heropick .hp img { width: 100%; height: 100%; image-rendering: pixelated; }
.archhead { align-items: center; gap: 8px; margin: 2px 0 8px; }
.h3sect, h3.sect.herosect { display: flex; align-items: center; gap: 6px; }
h3.sect.herosect img { width: 22px; height: 22px; image-rendering: pixelated; }
/* inline pixel icons (replace emoji) */
img.ic.ci { width: 1.15em; height: 1.15em; vertical-align: -0.22em; image-rendering: pixelated; margin: 0 .18em; }
img.ic.bigic { width: 34px; height: 34px; image-rendering: pixelated; }
.chip img.ic.ci:first-child { margin-left: 0; }
.stagecard .arrow { display: flex; align-items: center; justify-content: center; padding: 0; }
.stagecard .arrow img.ic.ci { width: 22px; height: 22px; margin: 0; }
button.x img.ic.ci, .ad-close img.ic.ci { width: 16px; height: 16px; margin: 0; }
#hud .lordk img.ic.ci { width: 16px; height: 16px; vertical-align: -3px; }

/* ---------- the battle plaque ---------- */
.bbwrap { margin-top: 10px; filter: drop-shadow(0 4px 0 #050308) drop-shadow(0 8px 14px rgba(0,0,0,.55)); }
.bbwrap.agony { filter: drop-shadow(0 4px 0 #050308) drop-shadow(0 0 14px rgba(230,30,40,.55)); animation: bbpulse 2.4s ease-in-out infinite; }
@keyframes bbpulse { 50% { filter: drop-shadow(0 4px 0 #050308) drop-shadow(0 0 22px rgba(255,50,40,.8)); } }
.bbwrap.off { opacity: .5; pointer-events: none; filter: grayscale(.8); }
.battlebtn { position: relative; width: 100%; display: grid; grid-template-columns: 64px 1fr 76px; align-items: stretch; min-height: 72px; padding: 0; border: 0; cursor: pointer; color: #2e1804;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  background:
    radial-gradient(circle at 14px 50%, #7a4c14 0 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 14px) 50%, #7a4c14 0 2px, transparent 2.5px),
    linear-gradient(180deg, #fff4c4 0 3px, #ffdc7a 3px 38%, #efb54a 38% 70%, #c98a2c 70% calc(100% - 5px), #7e5214 calc(100% - 5px));
  box-shadow: inset 0 0 0 3px #3a2208, inset 0 0 0 5px #f6d27a, inset 0 0 0 6px #8a5a18; }
.battlebtn:active { transform: translateY(3px); }
.battlebtn .bb-medal { display: flex; align-items: center; justify-content: center; }
.battlebtn .bb-medal img { width: 40px; height: 40px; padding: 5px; border-radius: 50%; image-rendering: pixelated;
  background: radial-gradient(circle at 40% 35%, #5a3a1a, #1e1006 70%); box-shadow: 0 0 0 2px #2a1604, 0 0 0 4px #e8b850, 0 0 0 5px #6a4210, inset 0 2px 4px rgba(0,0,0,.7); }
.bbwrap.agony .battlebtn .bb-medal img { background: radial-gradient(circle at 40% 35%, #c42030, #5a0610 72%); box-shadow: 0 0 0 2px #2a0406, 0 0 0 4px #e8b850, 0 0 0 5px #6a4210, 0 0 12px rgba(255,40,40,.8); }
.battlebtn .bb-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; }
.battlebtn .bb-title { font-family: var(--title); font-size: 27px; letter-spacing: .14em; line-height: 1; color: #3a1e04;
  text-shadow: 0 1px 0 rgba(255,244,196,.85), 0 -1px 0 rgba(110,60,10,.55); }
.battlebtn .bb-sub { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #6e4412; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.battlebtn .bb-sub b { color: #a0141e; }
.battlebtn .bb-cost { display: flex; align-items: center; justify-content: center; gap: 3px; margin: 9px 9px 9px 0; border-radius: 6px;
  background: linear-gradient(180deg, #1e1208, #3a2410); box-shadow: inset 0 3px 5px rgba(0,0,0,.75), inset 0 -1px 0 rgba(255,220,140,.3), 0 1px 0 rgba(255,244,196,.6);
  color: #ffe6a0; font: 15px var(--num); text-shadow: 0 1px 0 #000; }
.battlebtn .bb-cost img { width: 20px; height: 20px; image-rendering: pixelated; }
.battlebtn.shine::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,.28) 40% 46%, transparent 46%); background-size: 250% 100%; animation: shine 3.2s infinite; }

/* stage card: the picture is a backdrop; chips and info flow in a column so long rules never overlap */
.stagecard { display: flex; flex-direction: column; min-height: 150px; }
.stagecard .thumb, .stagecard canvas { position: absolute; inset: 0; width: 100%; height: 100% !important; }
.stagecard .chips { position: relative; z-index: 1; top: auto; left: auto; display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 8px 0; }
.stagecard .chip { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; padding: 3px 8px; font-size: 11.5px; line-height: 1.2; }
.stagecard .chip.dread { margin-left: auto; }
.stagecard .info { position: relative; margin-top: auto; padding-top: 26px; }
.stagecard .arrow { top: auto; bottom: 34px; }

/* the Well: the picked item glows; its details sit below the grid */
.slot.picked { outline: 2px solid var(--gold); outline-offset: 2px; box-shadow: 0 0 12px rgba(255,200,80,.55); }
.wellinfo .slot img { width: 100%; height: 100%; }

/* the Curse countdown */
#hud .cursed { position: absolute; top: calc(142px + var(--safe-t)); left: 8px; display: flex; align-items: center; gap: 4px; padding: 3px 8px 3px 4px; border-radius: 6px; background: rgba(40,0,50,.85); border: 1px solid #a040ff; box-shadow: 0 0 10px rgba(160,64,255,.6); animation: bbpulse 1s infinite; }
#hud .cursed b { font: 9px/1 var(--num); color: #f0c0ff; }
/* narrow phones (360-400 px): the three currency pills must fit beside the avatar */
@media (max-width: 400px) {
  .topbar { gap: 4px; padding: 8px 6px 6px; }
  .topbar .pill { gap: 2px; font-size: 8px; }
  .topbar .pill img, .topbar .pill img.ic { width: 18px; height: 18px; }
  .topbar .pill .plus { width: 14px; height: 14px; line-height: 14px; font-size: 12px; }
}
/* in-run Character screen: equipment, the 4-slot bag, base vs total stats, damage per ability */
#hud .hbtns { display: flex; gap: 6px; }
#hud .bagbtn { position: relative; padding: 0; display: flex; align-items: center; justify-content: center; }
#hud .bagbtn img { width: 26px; height: 26px; image-rendering: pixelated; }
#hud .bagbtn i { position: absolute; bottom: -6px; right: -8px; font: 7px var(--num); font-style: normal; color: #fff; background: rgba(10,6,12,.9); border: 1px solid var(--line); border-radius: 6px; padding: 2px 3px; }
#hud .bagbtn i:empty { display: none; }
#hud .bagbtn i.full { color: #ffd060; border-color: var(--gold); }
.modal.charsheet { max-width: 460px; }
.charsheet .cs-sec { font-family: var(--title); color: var(--gold); font-size: 14px; margin: 12px 0 6px; border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.charsheet .grid4 .small { font-size: 10px; margin-top: 2px; }
.charsheet .slot .found { position: absolute; top: 3px; left: 3px; width: 8px; height: 8px; border-radius: 2px; background: var(--gold); box-shadow: 0 0 0 2px #000; transform: rotate(45deg); }
.charsheet .cs-bag .bagslot { border-style: solid; }
.charsheet .cs-bag.over .slot { box-shadow: 0 0 0 2px var(--blood-hi); }
.charsheet .wellinfo { margin-top: 10px; }
.charsheet .cs-stats { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.charsheet .cs-head, .charsheet .cs-row { display: grid; grid-template-columns: 1fr 64px 64px; align-items: center; gap: 6px; }
.charsheet .cs-head { color: var(--dim); font-size: 11px; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.charsheet .cs-head span:not(:first-child), .charsheet .cs-row b { text-align: right; font: 9px var(--num); }
.charsheet .cs-head span:not(:first-child) { font: 11px var(--body); }
.charsheet .cs-row b:nth-child(2) { color: var(--dim); }
.charsheet .cs-row b.good { color: #7ee89a; }
.charsheet .cs-row b.bad { color: var(--blood-hi); }
.stattap { cursor: pointer; }
.stattap .nw { white-space: nowrap; }
.stattap .qm { font-style: normal; display: inline-block; width: 11px; height: 11px; margin-left: 4px; border: 1px solid var(--line); border-radius: 50%; font-size: 8px; line-height: 11px; text-align: center; color: var(--dim); vertical-align: 1px; font-weight: 400; }
.stattap:active { filter: brightness(1.3); }
.charsheet .cs-tip { text-align: center; margin-top: 4px; }
.statinfo p { margin: 4px 0 8px; line-height: 1.45; }
.statinfo .src { margin: 6px 0 4px; border-top: 1px solid var(--line); padding-top: 6px; }
.statinfo .src-h { font-family: var(--title); color: var(--gold); font-size: 14px; margin-bottom: 4px; }
.statinfo .src-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 2px 0; border-bottom: 1px solid rgba(75,58,42,.35); }
.statinfo .src-row b { color: var(--good, #8fe08f); white-space: nowrap; }
.statinfo .src-row b.bad { color: #ff8a80; }
.charsheet .cs-row span { display: flex; align-items: center; gap: 4px; min-width: 0; }
.charsheet .cs-row .ci { width: 18px; height: 18px; }

/* slot picker: the worn item on top, every fitting item below as a tappable row */
.pickhead { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold, #e8c26a); margin: 0 0 6px 2px; }
.panel.item.pick { cursor: pointer; gap: 10px; align-items: center; margin-bottom: 6px; }
.panel.item.pick:active { transform: scale(0.985); }
.panel.item.pick .d { font-size: 12px; }
.picklist { gap: 0; }
button.btn.infob, .btn.small.infob { width: 30px; min-width: 30px; height: 30px; min-height: 30px; padding: 0; flex: none; align-self: center; font-family: Georgia, 'Times New Roman', serif; font-size: 16px; font-weight: 900; font-style: italic; color: var(--gold); } /* every info button: the Pit's square with a handwritten gold i */
.wornpill { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 1px 8px 1px 5px; border-radius: 6px; font-size: 12px; font-weight: 800; color: var(--gold-hi); background: rgba(240,200,96,.1); border: 1px solid rgba(240,200,96,.45); }
.wornpill img.ci { width: 14px; height: 14px; }
.slot .mergeb { position: absolute; bottom: 3px; left: 4px; font-size: 11px; line-height: 1; color: #f0a8ff; text-shadow: 0 0 4px #c040ff, 0 1px 0 #000; }
.stagecard img.thumb.art { image-rendering: auto; object-fit: cover; object-position: 60% 50%; }

/* ================= forged UI (v1.28): dark iron and gilt instead of flat yellow ================= */
.btn.dim { filter: grayscale(1) brightness(.6); } /* looks unavailable but still answers a tap (it explains why) */

/* gilded primary buttons: dark bronze with a gilt edge and an ember glow from below */
.btn.gold { color: #ffe3a0; text-shadow: 0 1px 0 #000, 0 0 8px rgba(255,170,70,.35);
  background: radial-gradient(120% 110% at 50% 135%, rgba(255,140,40,.42), transparent 62%), linear-gradient(180deg, #7a5226 0 7%, #54361a 7% 48%, #3c2410 48% 88%, #24140a 88%);
  box-shadow: inset 0 0 0 2px #d6a446, inset 0 0 0 3px #2a1606, inset 3px 3px 0 1px rgba(255,226,160,.22), inset -3px -3px 0 1px rgba(0,0,0,.35); }
.btn.gold img { filter: drop-shadow(0 1px 0 #000); }

/* stage chips: smoked glass in a bronze frame */
.stagecard .chip { background: rgba(10,6,12,.72); border: 1px solid rgba(214,164,70,.55); border-radius: 4px; color: #e8dcc8; box-shadow: 0 2px 6px rgba(0,0,0,.5); backdrop-filter: blur(2px); }
.stagecard .chip.on { background: linear-gradient(180deg, rgba(150,20,34,.9), rgba(70,6,14,.9)); border-color: #ff6070; color: #fff; box-shadow: 0 0 12px rgba(226,56,74,.55); }
.stagecard .chip.off { color: #8a7e8e; border-color: rgba(120,100,120,.4); }
.stagecard .chip.dread { background: rgba(50,6,14,.8); border-color: #ff5060; color: #ffc0c6; }
.stagecard .info { background: linear-gradient(transparent, rgba(6,4,8,.55) 30%, rgba(6,4,8,.92)); }
.stagecard .sname { font-size: 20px; letter-spacing: .02em; text-shadow: 0 2px 0 #000, 0 0 12px rgba(0,0,0,.8); }

/* side buttons with news: a soft gilt glow, not a flashing yellow frame */
@keyframes hot { 0%,100% { filter: drop-shadow(0 0 0 rgba(240,190,90,0)); } 50% { filter: drop-shadow(0 0 7px rgba(240,190,90,.85)); } }
.sidebtn.hot .ic { outline: none; }

/* the battle plaque: a forged iron slab with a gilt rim, embers glowing behind a gold-lettered title */
.bbwrap { filter: drop-shadow(0 5px 0 #050308) drop-shadow(0 10px 18px rgba(0,0,0,.6)); }
.battlebtn { grid-template-columns: 66px 1fr 72px; min-height: 76px; color: #ffe3a0; overflow: hidden;
  clip-path: polygon(20px 0, calc(100% - 20px) 0, 100% 50%, calc(100% - 20px) 100%, 20px 100%, 0 50%);
  background: linear-gradient(180deg, #fff0b8 0%, #e2b458 22%, #a8742a 55%, #6a4414 80%, #3a220a 100%);
  box-shadow: none; }
.battlebtn .bb-face { position: absolute; inset: 3px; z-index: 0; pointer-events: none;
  clip-path: polygon(19px 0, calc(100% - 19px) 0, 100% 50%, calc(100% - 19px) 100%, 19px 100%, 0 50%);
  background:
    radial-gradient(60% 120% at 50% 118%, rgba(255,120,30,.55), rgba(255,80,20,.18) 45%, transparent 70%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #3e2e34 0%, #241820 38%, #160e14 70%, #0e080c 100%);
  box-shadow: inset 0 2px 0 rgba(255,230,170,.25), inset 0 -2px 0 rgba(0,0,0,.6); }
.battlebtn .bb-face::after { content: ''; position: absolute; inset: 0; background: radial-gradient(50% 90% at 50% 110%, rgba(255,150,50,.35), transparent 70%); animation: embers 2.6s ease-in-out infinite; }
@keyframes embers { 50% { opacity: .35; } }
.battlebtn > span:not(.bb-face) { position: relative; z-index: 1; }
.battlebtn .bb-medal img { width: 42px; height: 42px; padding: 6px;
  background: radial-gradient(circle at 40% 30%, #4a3440, #140a10 72%);
  box-shadow: 0 0 0 2px #1a0e08, 0 0 0 4px #d6a446, 0 0 0 5px #4a2c0c, inset 0 2px 5px rgba(0,0,0,.8), 0 0 14px rgba(255,150,60,.35); }
.battlebtn .bb-title { font-size: 29px; letter-spacing: .2em; padding-left: .2em; color: transparent;
  background: linear-gradient(180deg, #fff6d0 0%, #ffd97a 45%, #d8962e 58%, #fff0b0 100%); -webkit-background-clip: text; background-clip: text;
  text-shadow: none; filter: drop-shadow(0 2px 0 #000) drop-shadow(0 0 10px rgba(255,150,50,.5)); }
.battlebtn .bb-sub { color: #c8a878; letter-spacing: .16em; font-size: 10.5px; text-shadow: 0 1px 0 #000; }
.battlebtn .bb-sub b { color: #ff7080; }
.battlebtn .bb-cost { margin: 12px 14px 12px 0; border-radius: 4px; background: linear-gradient(180deg, #0a0608, #1e1418); color: #ffe3a0;
  box-shadow: inset 0 0 0 1px #d6a446, inset 0 3px 6px rgba(0,0,0,.8), 0 1px 0 rgba(255,230,170,.25); }
.battlebtn:active .bb-face { filter: brightness(1.25); }
.bbwrap.agony .battlebtn { background: linear-gradient(180deg, #ffc0b0 0%, #e05048 25%, #9a1a20 60%, #4a060a 100%); }
.bbwrap.agony .battlebtn .bb-face { background: radial-gradient(60% 120% at 50% 118%, rgba(255,40,40,.6), rgba(200,20,20,.2) 45%, transparent 70%), linear-gradient(180deg, #3a1c20 0%, #200a0e 45%, #10040a 100%); }
.bbwrap.agony .battlebtn .bb-title { background-image: linear-gradient(180deg, #fff0e0 0%, #ffb0a0 45%, #e03030 60%, #ffd0c0 100%); filter: drop-shadow(0 2px 0 #000) drop-shadow(0 0 12px rgba(255,40,40,.6)); }
.stagecard { min-height: 150px; }
.battlebtn { grid-template-columns: 78px 1fr 84px; }
.battlebtn .bb-cost { margin-right: 20px; }
.battlebtn .bb-medal { padding-left: 10px; }

/* v1.28.1: gold buttons as the battle plaque (dark iron, gilt rim, gold letters), no brown */
.btn.gold { color: #ffdc8a; text-shadow: 0 1px 0 #000, 0 0 8px rgba(255,190,90,.3);
  background: linear-gradient(180deg, rgba(255,220,150,.16) 0 2px, transparent 2px), radial-gradient(90% 120% at 50% 130%, rgba(255,170,70,.28), transparent 60%), linear-gradient(180deg, #3a2c38 0%, #221824 50%, #150d16 100%);
  box-shadow: inset 0 0 0 2px #e0b050, inset 0 0 0 3px #1a0e08, inset 0 4px 6px -2px rgba(255,220,140,.25), 0 0 10px rgba(224,176,80,.15); }
/* the battle plaque's medal and cost: no boxes, the icons stand on their own with a warm glow */
.battlebtn .bb-medal img { width: 40px; height: 40px; padding: 0; background: none; box-shadow: none; filter: drop-shadow(0 2px 0 #000) drop-shadow(0 0 8px rgba(255,170,70,.55)); }
.bbwrap.agony .battlebtn .bb-medal img { background: none; box-shadow: none; filter: drop-shadow(0 2px 0 #000) drop-shadow(0 0 10px rgba(255,40,40,.8)); }
.battlebtn .bb-cost { background: none; box-shadow: none; margin: 0 22px 0 0; gap: 4px; font-size: 17px; }
.battlebtn .bb-cost img { width: 22px; height: 22px; filter: drop-shadow(0 0 6px rgba(255,150,50,.7)); }

/* the stage card keeps one height: long descriptions are clamped, so the battle plaque never moves */
.stagecard { height: 176px; min-height: 0; }
.stagecard .srule { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* the Agony tag sits on its own line under the hall; the line is kept (hidden) when Agony is off */
.battlebtn .bb-main { gap: 2px; }
.battlebtn .bb-tag { font-size: 10px; font-weight: 900; letter-spacing: .24em; text-transform: uppercase; color: #ff8a90; text-shadow: 0 1px 0 #000, 0 0 8px rgba(255,40,40,.7); line-height: 1; }
.battlebtn .bb-tag.hide { visibility: hidden; }
.battlebtn .bb-title { line-height: .95; }
/* the reward rays stay behind the modal's content (an absolute layer otherwise paints over static siblings) */
.modal > .rays { z-index: 0; }
.modal > *:not(.rays):not(.raysbox):not(.x):not(.mhead):not(.mfoot):not(.mdock) { position: relative; z-index: 1; }
.modal > .x { z-index: 2; }

/* the language drop-down: dark iron with a gilt rim, a gold chevron, options in a forged panel */
.dd { position: relative; min-width: 150px; }
.dd-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; padding: 0 12px; cursor: pointer;
  font: 800 14px var(--body); color: #ffdc8a; text-shadow: 0 1px 0 #000; border: 2px solid #050308; clip-path: var(--notch);
  background: linear-gradient(180deg, rgba(255,220,150,.14) 0 2px, transparent 2px), linear-gradient(180deg, #3a2c38 0%, #221824 55%, #150d16 100%);
  box-shadow: inset 0 0 0 2px #c9953a, inset 0 0 0 3px #1a0e08; }
.dd-arrow { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid #e8c050; filter: drop-shadow(0 1px 0 #000); transition: transform .15s; }
.dd.open .dd-arrow { transform: rotate(180deg); }
.dd-list { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; padding: 4px; border: 2px solid #050308;
  background: var(--tex-panel, none) 0 0 / 64px 64px, #1a1220; box-shadow: inset 0 0 0 2px #c9953a, 0 8px 18px rgba(0,0,0,.7); }
.dd.open .dd-list { display: block; }
.dd-opt { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; padding: 0 10px; cursor: pointer; border: 0; background: transparent; font: 800 14px var(--body); color: var(--text); text-shadow: 0 1px 0 #000; }
.dd-opt + .dd-opt { border-top: 1px solid rgba(201,149,58,.25); }
.dd-opt:active, .dd-opt:hover { background: rgba(240,200,96,.12); color: #ffdc8a; }
.dd-opt.on { color: #ffdc8a; }
.dd-opt img.ci { width: 16px; height: 16px; }

/* Relics inventory filters: one forged tab per kind, with its count */
.gfilters { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 6px 0 2px; }
.gf { position: relative; height: 42px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px solid #050308; clip-path: var(--notch);
  background: linear-gradient(180deg, #2a2030, #150e18); box-shadow: inset 0 0 0 1px var(--ring, #3a2c40); }
.gf img { width: 28px; height: 28px; image-rendering: pixelated; opacity: .8; filter: saturate(.7); }
.gf .gf-all { font-size: 18px; color: #c8b8a0; line-height: 1; }
.gf i { position: absolute; right: 3px; bottom: 1px; font: 7px var(--num); font-style: normal; color: #d8ccb8; text-shadow: 0 1px 0 #000; }
.gf.on { background: radial-gradient(90% 120% at 50% 130%, rgba(255,170,70,.3), transparent 60%), linear-gradient(180deg, #3a2c38, #1a1018); box-shadow: inset 0 0 0 2px #e0b050; }
.gf.on img { opacity: 1; filter: drop-shadow(0 0 4px rgba(255,200,100,.6)); }
.gf i { font-size: 8px; }
.gf.on .gf-all, .gf.on i { color: #ffdc8a; }
.gf.empty { opacity: .45; }
.gf-name { margin: 4px 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
/* each modal keeps its layers to itself, so a modal opened on top (e.g. the account over Settings) is never pierced
   by the content of the one below it */
.modal-bg { isolation: isolate; }

/* ===================== v1.36: forged HUD buttons, pinned quest, settings sections ===================== */
#hud .pause { position: relative; width: 40px; height: 40px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 9px;
  background: radial-gradient(ellipse at 50% 30%, #8a1826 0%, #4a0810 55%, #1e0206 100%); border: 2px solid #120604;
  box-shadow: inset 0 0 0 1.5px #d8a848, inset 0 0 0 3px #3a1806, inset 0 3px 8px rgba(255,150,140,.28), inset 0 -4px 8px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.75); }
#hud .pause::before { content: ''; position: absolute; inset: 1px; border-radius: 7px; pointer-events: none;
  background: radial-gradient(circle at 5px 5px, #ffe8a0 0 1.4px, #7a5010 1.6px 2.4px, transparent 2.6px), radial-gradient(circle at calc(100% - 5px) 5px, #ffe8a0 0 1.4px, #7a5010 1.6px 2.4px, transparent 2.6px),
    radial-gradient(circle at 5px calc(100% - 5px), #ffe8a0 0 1.4px, #7a5010 1.6px 2.4px, transparent 2.6px), radial-gradient(circle at calc(100% - 5px) calc(100% - 5px), #ffe8a0 0 1.4px, #7a5010 1.6px 2.4px, transparent 2.6px); }
#hud .pause:active { transform: translateY(1px); filter: brightness(1.2); }
#hud .pause > img { width: 24px; height: 24px; image-rendering: pixelated; filter: drop-shadow(0 1px 0 #000); }
#hud .bagbtn > img { width: 26px; height: 26px; }
#hud .pause .key { position: absolute; left: -4px; bottom: -5px; min-width: 12px; padding: 1px 2px; font: 7px/9px var(--num); color: #ffe8b0; background: #140a06; border: 1px solid #8a6424; border-radius: 3px; }
#hud .tracker { position: absolute; top: calc(142px + var(--safe-t)); left: 8px; width: min(46vw, 210px); padding: 4px 7px 5px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(20,10,8,.82), rgba(20,10,8,.5)); border-left: 2px solid var(--gold); box-shadow: 0 1px 4px rgba(0,0,0,.6); color: #f4e8d0; text-shadow: 0 1px 0 #000; }
#hud .tracker .trh { font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); display: flex; align-items: center; gap: 3px; }
#hud .tracker .trh img { width: 12px; height: 12px; }
#hud .tracker .trt { font-size: 10.5px; line-height: 1.25; margin: 1px 0 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#hud .tracker .trp { display: flex; align-items: center; gap: 6px; }
#hud .tracker .trbar { flex: 1; height: 4px; background: rgba(0,0,0,.7); border-radius: 2px; overflow: hidden; }
#hud .tracker .trbar i { display: block; height: 100%; background: linear-gradient(90deg, #b07a20, #ffd060); transition: width .3s; }
#hud .tracker .trp b { font: 8px var(--num); color: #fff; white-space: nowrap; }
#hud .tracker.off { opacity: .6; } #hud .tracker.off .trp b { font: 9px var(--body); color: var(--muted); }
#hud .tracker.done { border-left-color: #7ae070; } #hud .tracker.done .trbar i { background: linear-gradient(90deg, #3a9a30, #9af070); }
#hud .buffs { top: calc(88px + var(--safe-t)); }
#hud .cursed { top: calc(114px + var(--safe-t)); }
.pinbtn { flex: none; width: 34px; height: 34px; padding: 0; border-radius: 8px; background: rgba(10,6,12,.6); border: 1px solid var(--line); cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: .55; filter: grayscale(.7); }
.pinbtn img { width: 22px; height: 22px; }
.pinbtn.on { opacity: 1; filter: none; border-color: var(--gold); box-shadow: 0 0 8px rgba(240,190,90,.45); }
.setsec { margin: 12px 0 4px; padding-bottom: 3px; font-family: var(--title); font-size: 13px; letter-spacing: .06em; color: var(--gold); border-bottom: 1px solid rgba(200,154,72,.3); }
.setsec:first-child { margin-top: 0; }
.sethint { margin: -4px 0 8px; }
/* v1.36.1: the HUD buttons in the game's dark style (as the home side buttons): textured iron, dim bronze ring, no studs */
#hud .pause { border: 2px solid #050308; border-radius: 10px; background: var(--tex-dark, none) 0 0 / 64px 64px, rgba(26,18,32,.88);
  box-shadow: inset 0 0 0 2px var(--ring), inset 3px 3px 0 0 var(--hi), inset -3px -3px 0 0 var(--lo), 0 2px 0 #000; }
#hud .pause::before { content: none; }
#hud .pause > img { opacity: .85; filter: drop-shadow(0 1px 0 #000) saturate(.7) brightness(.85); }
#hud .pause:active { filter: brightness(1.15); }
#hud .pause .key { color: #b8a888; background: #0c080e; border-color: var(--ring); }

/* v1.36.2: a pinned window header (title + X stay while the content scrolls); the X in dark blood-red with a bronze rim */
.modal > .mhead { position: sticky; top: -16px; z-index: 3; margin: -16px -10px 10px; padding: 14px 46px 8px; min-height: 48px;
  background: var(--tex-panel, none) 0 0 / 64px 64px, #1f1624; border-bottom: 1px solid rgba(176,138,72,.25);
  box-shadow: inset 0 2px 0 0 var(--ring-gold), inset 0 4px 0 0 #050308, 0 6px 8px -6px rgba(0,0,0,.8); } /* it covers the frame's top edge, so it draws it again */
.modal > .mhead.bare { min-height: 0; height: 0; padding: 0; margin: -16px -10px 16px; border: 0; box-shadow: none; background: none; }
.modal > .mhead .x { top: 10px; }
.modal > .mhead.bare .x { top: 4px; }
.modal > .mhead .mt { margin: 0; line-height: 1.2; }
.modal .x { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; padding: 0; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  border: 2px solid #050308; background: radial-gradient(ellipse at 50% 30%, #5a1018, #2a060a 70%, #160306);
  box-shadow: inset 0 0 0 1.5px #8a6232, inset 2px 2px 0 1px rgba(255,190,150,.12), inset -2px -2px 0 1px rgba(0,0,0,.45), 0 2px 0 #000; }
.modal .x img.ic.ci, .modal .x img { width: 20px; height: 20px; }
.modal .x:active { filter: brightness(1.2); }
/* v1.36.3: the bottom mirrors the sides: a pinned strip as wide as the side margin, redrawing the frame's bottom edge */
.modal > .mdock { position: sticky; bottom: 0; z-index: 3; margin: 6px -10px 0; padding: 8px 10px 2px;
  background: var(--tex-panel, none) 0 0 / 64px 64px, #1f1624; border-top: 1px solid rgba(176,138,72,.25); box-shadow: 0 -6px 8px -6px rgba(0,0,0,.8); }
.modal > .mdock > .btns, .modal > .mdock > .btn, .modal > .mdock > * { margin-top: 0; }
.modal > .mfoot { position: sticky; bottom: -14px; z-index: 3; height: 14px; margin: 0 -10px -14px; pointer-events: none;
  background: var(--tex-panel, none) 0 0 / 64px 64px, #1f1624; box-shadow: inset 0 -2px 0 0 var(--ring-gold), inset 0 -4px 0 0 #050308, 0 -6px 8px -6px rgba(0,0,0,.8); }
/* v1.36.4: the rays sit in a clipping box, so a window that fits never scrolls */
.modal > .raysbox { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
/* v1.36.5: every button is cut from the same old stone: the texture under a tint that sets its kind */
.btn { background: linear-gradient(180deg, rgba(255,240,220,.12) 0 2px, transparent 2px calc(100% - 3px), rgba(0,0,0,.45) calc(100% - 3px)),
    linear-gradient(180deg, rgba(60,44,70,.3), rgba(22,14,26,.55)), var(--tex-stone, none) 0 0 / 64px 64px, #3a2c42; }
.btn.gold { background: radial-gradient(120% 110% at 50% 135%, rgba(255,140,40,.34), transparent 62%), linear-gradient(180deg, rgba(255,220,150,.14) 0 2px, transparent 2px),
    linear-gradient(180deg, rgba(58,40,40,.22) 0%, rgba(26,16,20,.42) 55%, rgba(10,6,8,.64) 100%), var(--tex-stone, none) 0 0 / 64px 64px, #2a1e22; }
.btn.ghost { background: linear-gradient(180deg, rgba(20,14,22,.42), rgba(8,5,10,.66)), var(--tex-stone, none) 0 0 / 64px 64px, #151018; }
.btn.red { background: linear-gradient(180deg, rgba(255,110,110,.5) 0 2px, rgba(190,36,48,.55) 2px 50%, rgba(130,14,26,.66) 50% calc(100% - 3px), rgba(60,4,10,.9) calc(100% - 3px)), var(--tex-stone, none) 0 0 / 64px 64px, #7c1018; }
.btn.green, .btn.ad { background: linear-gradient(180deg, rgba(150,240,150,.45) 0 2px, rgba(46,150,64,.6) 2px 50%, rgba(26,100,44,.74) 50% calc(100% - 3px), rgba(10,50,20,.9) calc(100% - 3px)), var(--tex-stone, none) 0 0 / 64px 64px, #1c6a2c; }
.btn.gem { background: linear-gradient(180deg, rgba(240,150,240,.45) 0 2px, rgba(170,60,180,.6) 2px 50%, rgba(120,36,140,.74) 50% calc(100% - 3px), rgba(60,12,70,.9) calc(100% - 3px)), var(--tex-stone, none) 0 0 / 64px 64px, #62186e; }
.btn.blue { background: linear-gradient(180deg, rgba(160,200,255,.45) 0 2px, rgba(60,120,210,.6) 2px 50%, rgba(40,86,170,.74) 50% calc(100% - 3px), rgba(16,40,100,.9) calc(100% - 3px)), var(--tex-stone, none) 0 0 / 64px 64px, #1c3a80; }
.dd-btn { background: linear-gradient(180deg, rgba(255,220,150,.14) 0 2px, transparent 2px), linear-gradient(180deg, rgba(58,40,40,.25), rgba(10,6,8,.66)), var(--tex-stone, none) 0 0 / 64px 64px, #221824; }
.battlebtn .bb-face { background: radial-gradient(60% 120% at 50% 118%, rgba(255,120,30,.5), rgba(255,80,20,.16) 45%, transparent 70%),
    linear-gradient(180deg, rgba(62,46,52,.28) 0%, rgba(36,24,32,.45) 38%, rgba(14,8,12,.7) 100%), var(--tex-stone, none) 0 0 / 64px 64px, #160e14; }
.bbwrap.agony .battlebtn .bb-face { background: radial-gradient(60% 120% at 50% 118%, rgba(255,40,40,.55), rgba(200,20,20,.2) 45%, transparent 70%),
    linear-gradient(180deg, rgba(70,24,30,.5) 0%, rgba(34,8,14,.7) 45%, rgba(14,4,8,.85) 100%), var(--tex-stone, none) 0 0 / 64px 64px, #10040a; }
#hud .pause, .pinbtn { background: linear-gradient(180deg, rgba(34,24,40,.35), rgba(12,8,14,.62)), var(--tex-stone, none) 0 0 / 64px 64px, #1a1220; }
.modal .x { background: linear-gradient(180deg, rgba(120,20,30,.62), rgba(40,4,8,.82)), var(--tex-stone, none) 0 0 / 64px 64px, #2a060a; }
/* v1.36.6: offer banners in the same old stone under their colour; the tag is a blood-red pennant beside the title */
.offer { border: 2px solid #050308; box-shadow: inset 0 0 0 2px #c9953a, inset 0 0 0 3px #1a0e08, 0 3px 0 #000;
  background: radial-gradient(ellipse at 20% 0%, rgba(255,106,224,.22), transparent 60%), linear-gradient(160deg, rgba(70,30,74,.72), rgba(26,15,30,.86)), var(--tex-stone, none) 0 0 / 64px 64px, #1a0f1e; }
.offer.red { background: radial-gradient(ellipse at 20% 0%, rgba(226,56,74,.28), transparent 60%), linear-gradient(160deg, rgba(76,22,32,.72), rgba(26,10,14,.86)), var(--tex-stone, none) 0 0 / 64px 64px, #1a0a0e; }
.offer.blue { background: radial-gradient(ellipse at 20% 0%, rgba(80,150,255,.26), transparent 60%), linear-gradient(160deg, rgba(22,38,76,.74), rgba(10,14,26,.88)), var(--tex-stone, none) 0 0 / 64px 64px, #0a0e1a; }
.offer .ohead { display: flex; align-items: flex-start; gap: 8px; }
.offer .ohead .ot { flex: 1; min-width: 0; }
.offer .ribbon { position: relative; top: auto; right: auto; transform: none; flex: none; margin: -9px -9px 0 0; padding: 5px 10px 6px 18px; white-space: nowrap;
  font: 800 11px var(--body); letter-spacing: .04em; color: #ffe0c8; text-shadow: 0 1px 0 #000;
  background: linear-gradient(180deg, rgba(160,24,36,.8), rgba(90,8,16,.92)), var(--tex-stone, none) 0 0 / 64px 64px, #6a0c14;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%); box-shadow: inset 0 -2px 0 #c9953a, inset 0 2px 0 rgba(255,200,170,.18); }
/* v1.36.7: equal columns everywhere (content no longer widens one), equal chest buttons, promo tags inside the gem cards,
   and the old stone on tabs, the power plate and the relic filters */
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chest > button:first-of-type { margin-top: auto; }
.chest .btn { min-height: 34px; padding: 0 4px; gap: 4px; font-size: 13px; }
.chest .btn img { width: 18px; height: 18px; }
.pack .ptags { display: flex; flex-direction: column; gap: 2px; width: 100%; min-height: 34px; margin: -4px 0 2px; }
.pack .ptags span { position: static; transform: none; display: block; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font: 800 9.5px/14px var(--body); letter-spacing: .05em; text-transform: uppercase; padding: 1px 4px; border: 1px solid #050308; border-radius: 0; box-shadow: none; }
.pack .ptags .x2 { color: #ffe0c8; text-shadow: 0 1px 0 #000; background: linear-gradient(180deg, rgba(170,26,40,.82), rgba(90,8,16,.92)), var(--tex-stone, none) 0 0 / 64px 64px, #6a0c14; }
.pack .ptags .tag { color: #ffdc8a; text-shadow: 0 1px 0 #000; background: linear-gradient(180deg, rgba(90,62,24,.7), rgba(36,22,8,.9)), var(--tex-stone, none) 0 0 / 64px 64px, #2a1a08; box-shadow: inset 0 0 0 1px #c9953a; }
.tabs { background: linear-gradient(180deg, rgba(10,6,12,.55), rgba(6,4,8,.75)), var(--tex-stone, none) 0 0 / 64px 64px, #0c080e; }
.tabs button.on { background: linear-gradient(180deg, rgba(255,240,220,.12) 0 2px, transparent 2px), linear-gradient(180deg, rgba(70,54,80,.4), rgba(30,22,36,.6)), var(--tex-stone, none) 0 0 / 64px 64px, #3e3046; }
.power { background: linear-gradient(180deg, rgba(20,12,18,.5), rgba(8,4,8,.75)), var(--tex-stone, none) 0 0 / 64px 64px, #120c10; }
.gfilters { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.gf { min-width: 0; padding: 0; background: linear-gradient(180deg, rgba(34,24,40,.45), rgba(12,8,14,.72)), var(--tex-stone, none) 0 0 / 64px 64px, #150e18; }
.gf img { width: min(28px, 70%); height: auto; }
.gf.on { background: radial-gradient(90% 120% at 50% 130%, rgba(255,170,70,.3), transparent 60%), linear-gradient(180deg, rgba(58,40,40,.3), rgba(20,12,16,.6)), var(--tex-stone, none) 0 0 / 64px 64px, #1a1018; }
.gf-name { clear: both; margin-top: 6px; }
.pack > .btn { margin-top: auto; }
.pack .ptags .x2 { text-transform: none; }
/* v1.36.8: home side icons: one plate of old stone with a single bronze rim (no double frame);
   important ones (offers, rewards waiting, events) get a soft pulsing ember glow */
.sidebtn .ic { width: 46px; height: 46px; border: 2px solid #050308;
  background: radial-gradient(circle at 50% 38%, rgba(70,52,64,.25), transparent 70%), linear-gradient(180deg, rgba(30,22,34,.45), rgba(10,6,12,.72)), var(--tex-stone, none) 0 0 / 64px 64px, #1a1220;
  box-shadow: inset 0 0 0 1.5px #7a5c34, inset 0 2px 0 1.5px rgba(255,220,170,.08), 0 3px 0 #000; outline: none; animation: none; filter: none; }
.sidebtn .ic img { filter: drop-shadow(0 1px 0 #000); }
.sidebtn.hot .ic { box-shadow: inset 0 0 0 1.5px #d6a446, inset 0 2px 0 1.5px rgba(255,220,170,.12), 0 3px 0 #000; outline: none;
  animation: sideglow 2.4s ease-in-out infinite; }
@keyframes sideglow { 0%, 100% { filter: drop-shadow(0 0 2px rgba(255,170,70,.25)); } 50% { filter: drop-shadow(0 0 9px rgba(255,170,70,.75)); } }
/* the picture inside carries the class .ic too: it must not get a second frame of its own */
.sidebtn .ic > img, .sidebtn.hot .ic > img { border: 0; background: none; box-shadow: none; animation: none; outline: none; filter: drop-shadow(0 1px 0 #000); width: 32px; height: 32px; }
.sidebtn > .ic { border: 2px solid #050308; }
.sidebtn.hot > .ic { border-color: #050308; }

/* ===================== v1.37: The Seven Nights (newcomer event) ===================== */
.modal.nights { max-width: 520px; }
.nb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.nb-medal { flex: none; position: relative; width: 58px; display: flex; flex-direction: column; align-items: center; }
.nb-medal img { width: 46px; height: 46px; filter: drop-shadow(0 0 8px rgba(255,120,50,.45)); }
.nb-medal b { margin-top: -4px; min-width: 44px; text-align: center; font: 10px var(--num); color: #fff; padding: 3px 4px; background: #0a0608; border: 1px solid #050308; box-shadow: inset 0 0 0 1px #7a5c34; }
.nb-track { padding: 8px 6px 4px; margin-bottom: 8px; border: 2px solid #050308;
  background: linear-gradient(180deg, rgba(20,14,22,.5), rgba(8,5,10,.75)), var(--tex-stone, none) 0 0 / 64px 64px, #151018; box-shadow: inset 0 0 0 1px #7a5c34; }
.nb-ms-row, .nb-at-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.nb-ms { position: relative; aspect-ratio: 1; min-width: 0; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; border: 2px solid #050308;
  background: linear-gradient(180deg, rgba(40,30,46,.4), rgba(10,6,12,.75)), var(--tex-stone, none) 0 0 / 64px 64px, #1a1220; box-shadow: inset 0 0 0 1px #5a4630; }
.nb-ms img.ic:not(.ci) { width: 70%; height: auto; filter: drop-shadow(0 1px 0 #000); }
.nb-ms > b { position: absolute; right: 2px; bottom: 1px; font: 7px var(--num); color: #fff; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.nb-ms.rar3 { box-shadow: inset 0 0 0 1px #b060ff; } .nb-ms.rar4 { box-shadow: inset 0 0 0 1px #ffb040; }
.nb-ms.big { box-shadow: inset 0 0 0 2px #d6a446; animation: sideglow 2.4s ease-in-out infinite; }
.nb-ms.ready { box-shadow: inset 0 0 0 2px #ffd060; animation: sideglow 1.4s ease-in-out infinite; }
.nb-ms.got { filter: grayscale(.6) brightness(.6); }
.nb-ms .nb-lock, .nb-ms .nb-tick { position: absolute; top: -5px; right: -5px; font-style: normal; }
.nb-ms .nb-lock img, .nb-ms .nb-tick img { width: 12px; height: 12px; margin: 0; }
.nb-bar { height: 8px; margin: 6px 0 3px; background: #0a0406; border: 1px solid #050308; box-shadow: inset 0 0 0 1px #3a2418; }
.nb-bar i { display: block; height: 100%; background: linear-gradient(180deg, #ff7a6a, #b0182a 60%, #6a0810); box-shadow: 0 0 6px rgba(255,60,60,.5); transition: width .4s; }
.nb-at-row span { text-align: center; font: 7px var(--num); color: #9a8a78; }
.nb-at-row span.on { color: #ffd060; }
.nb-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin-bottom: 8px; }
.nb-day { position: relative; min-width: 0; min-height: 34px; padding: 0 2px; cursor: pointer; font: 800 11px var(--body); color: #d8ccb8; text-shadow: 0 1px 0 #000; white-space: nowrap; border: 2px solid #050308;
  background: linear-gradient(180deg, rgba(34,24,40,.45), rgba(12,8,14,.72)), var(--tex-stone, none) 0 0 / 64px 64px, #151018; box-shadow: inset 0 0 0 1px #5a4630; }
.nb-day.on { color: #ffdc8a; background: radial-gradient(90% 120% at 50% 130%, rgba(255,150,60,.35), transparent 60%), linear-gradient(180deg, rgba(58,40,40,.3), rgba(20,12,16,.6)), var(--tex-stone, none) 0 0 / 64px 64px, #1a1018; box-shadow: inset 0 0 0 2px #d6a446; }
.nb-day.shut { color: #6a6058; }
.nb-day .nb-lock { position: absolute; top: -6px; right: -4px; font-style: normal; } .nb-day .nb-lock img { width: 12px; height: 12px; margin: 0; }
.nb-day .badge { top: -7px; right: -5px; }
.nb-list { display: flex; flex-direction: column; gap: 5px; }
.nb-row { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 5px 8px; border: 2px solid #050308;
  background: linear-gradient(180deg, rgba(34,24,40,.4), rgba(12,8,14,.7)), var(--tex-stone, none) 0 0 / 64px 64px, #151018; box-shadow: inset 0 0 0 1px #4a3a2a; }
.nb-row.ready { background: linear-gradient(90deg, rgba(120,18,28,.55), rgba(60,8,14,.7)), var(--tex-stone, none) 0 0 / 64px 64px, #3a0810; box-shadow: inset 0 0 0 2px #d6a446; }
.nb-row.claimed, .nb-row.shut { opacity: .6; }
.nb-seal { flex: none; position: relative; width: 34px; height: 34px; }
.nb-seal img { width: 34px; height: 34px; }
.nb-seal b { position: absolute; right: -3px; bottom: -3px; font: 8px var(--num); color: #fff; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.nb-tx { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; line-height: 1.25; color: #f0e4cc; }
.nb-tx .nb-p { color: #b8a890; font-weight: 800; white-space: nowrap; } .nb-tx .nb-p.ok { color: #9af070; }
.nb-rw { flex: none; display: flex; flex-direction: column; align-items: center; width: 40px; padding: 2px 0; background: #0a0608; border: 1px solid #050308; box-shadow: inset 0 0 0 1px #3a2c20; }
.nb-rw img { width: 20px; height: 20px; }
.nb-rw b { font: 7px var(--num); color: #fff; }
.nb-row .btn { flex: none; min-width: 64px; }
.nb-got, .nb-lockt { flex: none; min-width: 64px; text-align: center; font-size: 11px; font-weight: 800; color: #9a8a78; }
.nb-got { color: #9af070; }

/* forged iron corners on the gilded panels */
.panel.gold::after { content: ''; position: absolute; inset: -3px; pointer-events: none; background: var(--corner-tl, none) 0 0 / 22px 22px no-repeat, var(--corner-tr, none) 100% 0 / 22px 22px no-repeat, var(--corner-bl, none) 0 100% / 22px 22px no-repeat, var(--corner-br, none) 100% 100% / 22px 22px no-repeat; image-rendering: pixelated; }
.modal { background-origin: border-box; }
/* the modal's header and footer are sticky and cover its own corners: they carry the forged corners instead */
.modal > .mhead::before, .modal > .mhead::after, .modal > .mfoot::before, .modal > .mfoot::after { content: ''; position: absolute; width: 26px; height: 26px; pointer-events: none; image-rendering: pixelated; z-index: 4; }
.modal > .mhead::before { left: -4px; top: 0; background: var(--corner-tl, none) 0 0 / 26px 26px no-repeat; }
.modal > .mhead::after { right: -4px; top: 0; background: var(--corner-tr, none) 0 0 / 26px 26px no-repeat; }
.modal > .mfoot::before { left: -4px; bottom: 0; background: var(--corner-bl, none) 0 0 / 26px 26px no-repeat; }
.modal > .mfoot::after { right: -4px; bottom: 0; background: var(--corner-br, none) 0 0 / 26px 26px no-repeat; }

/* ---------------- Title screen ---------------- */
#title { position: absolute; inset: 0; z-index: 45; overflow: hidden; background: #07050a; color: #e8dcc0; transition: opacity .7s; }
#title::before { content: ''; position: absolute; inset: -20px; background: url('../assets/boot-bg.svg') center / cover no-repeat; filter: blur(12px) brightness(.35); }
/* the nave in its own frame, so the candles and the window can be lit where the drawing has them */
.t-stage { position: absolute; top: 0; left: 50%; height: 100%; aspect-ratio: 390 / 844; transform: translateX(-50%); transform-origin: 50% 41.5%; animation: tbreathe 18s ease-in-out infinite alternate; }
.t-bg { position: absolute; inset: 0; background: url('../assets/boot-bg.svg') center / 100% 100% no-repeat; }
.t-rose { position: absolute; left: 50%; top: 41.5%; width: 115%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(255,90,50,.42) 0%, rgba(170,20,34,.2) 34%, transparent 62%); mix-blend-mode: screen; animation: trose 4.6s ease-in-out infinite; }
.t-candle { position: absolute; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(255,200,110,.6), rgba(255,110,30,.2) 45%, transparent 70%); mix-blend-mode: screen; animation: tflicker 1.3s ease-in-out infinite alternate, tlight .9s ease-out both; }
.t-fog { position: absolute; left: -40%; right: -40%; bottom: 4%; height: 38%; background: radial-gradient(ellipse at 30% 60%, rgba(130,95,120,.18), transparent 60%), radial-gradient(ellipse at 72% 40%, rgba(100,65,90,.15), transparent 55%); animation: tfog 26s ease-in-out infinite alternate; pointer-events: none; }
.t-fog.b { bottom: 32%; opacity: .55; animation-duration: 38s; animation-direction: alternate-reverse; }
.t-embers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.t-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 41.5%, #fff4dc 0%, #ffb070 14%, #e0382a 38%, #5a0610 75%, #1a0206 100%); }
/* language and sound */
.t-top { position: absolute; top: calc(10px + var(--safe-t, 0px)); left: 12px; right: 12px; display: flex; justify-content: space-between; transition: opacity .6s 1.1s; }
.t-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; background: rgba(8,5,10,.62); border: 1px solid rgba(200,144,44,.55); box-shadow: 0 0 0 1px #050308, inset 0 1px 0 rgba(255,230,170,.12); color: #e8d4a8; font: 800 13px var(--body); cursor: pointer; }
.t-chip.round { width: 34px; padding: 0; justify-content: center; }
.ti { display: inline-flex; width: 18px; height: 18px; flex: none; } .ti svg { width: 100%; height: 100%; }
/* the emblem over the rose window, the name below it */
.t-mid { position: absolute; left: 0; right: 0; top: 27%; display: flex; flex-direction: column; align-items: center; pointer-events: none; transition: opacity 1.1s cubic-bezier(.2,.8,.2,1) .15s, transform 1.3s cubic-bezier(.2,.8,.2,1) .15s, filter 1.1s .15s; }
.t-emblem { width: clamp(86px, 25vw, 124px); height: auto; margin-bottom: 12px; border-radius: 22%; box-shadow: 0 0 0 2px #050308, 0 0 0 3px #8a6a2a, 0 10px 30px rgba(0,0,0,.7); animation: bootpulse 2.6s infinite ease-in-out; }
.t-logo { font-family: 'Unifraktur', var(--title); font-size: clamp(54px, 16.5vw, 96px); line-height: 1; color: #f0c860;
  background: linear-gradient(105deg, transparent 42%, rgba(255,255,240,.85) 50%, transparent 58%) 160% 0 / 260% 100% no-repeat, linear-gradient(180deg, #fff6c8 0%, #f4cc58 38%, #c8902c 62%, #7a5214 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 #1a0406) drop-shadow(0 0 1px #000) drop-shadow(0 0 20px rgba(226,56,74,.6)); animation: tshine 7s ease-in-out 2s infinite; }
.t-sub { font-family: var(--title); color: #d8c8a8; margin-top: 6px; letter-spacing: .34em; text-transform: uppercase; font-size: 12px; text-shadow: 0 2px 0 #000, 0 0 10px rgba(0,0,0,.9); display: flex; align-items: center; gap: 10px; }
.t-sub::before, .t-sub::after { content: ''; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, #c8902c); }
.t-sub::after { transform: scaleX(-1); }
/* the ways in */
.t-low { position: absolute; left: 50%; bottom: calc(44px + var(--safe-b, 0px)); width: min(340px, 86vw); transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; transition: opacity .8s ease .75s, transform .8s ease .75s; }
#title .btn { gap: 10px; border-radius: 0; } /* crisp square-cut corners, same as the in-game buttons */
#title .btn .ti { width: 22px; height: 22px; }
#title .t-main { min-height: 60px; animation: tglow 2.4s ease-in-out infinite; }
/* Google's brand "G" keeps its colours; the button itself wears the same old stone as the rest */
#title .btn.t-google .ti { background: #fff; border-radius: 3px; padding: 2px; box-sizing: border-box; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.t-or { display: flex; align-items: center; gap: 10px; color: rgba(232,220,192,.7); font-size: 12.5px; margin: 2px 0; }
.t-or::before, .t-or::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(200,144,44,.6), transparent); }
.t-note { text-align: center; font-size: 12px; line-height: 1.4; color: rgba(232,220,192,.62); text-shadow: 0 1px 0 #000; }
.t-tap { text-align: center; font-family: var(--title); font-size: 19px; letter-spacing: .2em; text-transform: uppercase; color: #f4d07a; text-shadow: 0 2px 0 #000, 0 0 14px rgba(255,120,60,.55); animation: tpulse 1.9s ease-in-out infinite; margin-bottom: 6px; }
.t-who { text-align: center; font-size: 13px; color: rgba(232,220,192,.75); text-shadow: 0 1px 0 #000; }
.t-link { background: none; border: 0; color: #f0c860; font: 800 13px var(--body); text-decoration: underline; cursor: pointer; margin-left: 8px; padding: 6px 2px; }
.t-foot { position: absolute; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b, 0px)); display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: rgba(232,220,192,.45); transition: opacity .6s 1.1s; }
.t-legal a { color: inherit; margin-left: 12px; }
/* arriving from the loading screen: the name settles, the buttons rise */
#title.intro .t-mid { opacity: 0; transform: scale(1.25); filter: blur(6px); }
#title.intro .t-low { opacity: 0; transform: translateX(-50%) translateY(26px); }
#title.intro .t-top, #title.intro .t-foot { opacity: 0; }
/* entering: the camera flies into the burning window */
#title.entering { animation: tshake .4s linear; }
#title.entering .t-stage { animation: none; transform: translateX(-50%) scale(3.8); filter: brightness(1.7) saturate(1.35); transition: transform 1.75s cubic-bezier(.55,0,.85,.35), filter 1.75s ease-in; }
#title.entering .t-mid { opacity: 0; transform: scale(1.5); filter: blur(8px); transition: opacity .5s ease-in, transform .6s ease-in, filter .5s; }
#title.entering .t-low { opacity: 0; transform: translateX(-50%) translateY(40px); transition: opacity .35s, transform .45s ease-in; }
#title.entering .t-top, #title.entering .t-foot { opacity: 0; transition: opacity .3s; }
#title.entering .t-flash { animation: tflash 1.75s ease-in forwards; }
/* diving into the window: the floor, its light shafts and the lower arcs sit just below the zoom
   origin, so they barely move and read as a bright ghost wheel under the real one. A vignette locked
   to the window (it lives inside .t-stage, so it scales with the zoom) sinks that periphery into the
   dark as the dive accelerates, leaving only the glass flying at the camera. */
.t-stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 41.5%, transparent 13%, rgba(5,3,8,.7) 25%, #050308 42%); }
#title.entering .t-stage::after { opacity: 1; transition: opacity .35s ease-out; }
#title.gone { opacity: 0; pointer-events: none; }
@keyframes tbreathe { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.045); } }
@keyframes trose { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@keyframes tflicker { 0% { opacity: .8; } 30% { opacity: 1; } 55% { opacity: .7; } 80% { opacity: .95; } 100% { opacity: .85; } }
@keyframes tlight { from { transform: translate(-50%, -50%) scale(.2); filter: brightness(3); } to { transform: translate(-50%, -50%) scale(1); filter: none; } }
@keyframes tfog { from { transform: translateX(-8%); } to { transform: translateX(8%); } }
@keyframes tshine { 0%, 70% { background-position: 160% 0, 0 0; } 100% { background-position: -60% 0, 0 0; } }
@keyframes tglow { 0%, 100% { filter: drop-shadow(0 0 4px rgba(255,150,60,.25)); } 50% { filter: drop-shadow(0 0 14px rgba(255,150,60,.6)); } }
@keyframes tpulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes tflash { 0% { opacity: 0; } 55% { opacity: .18; } 85% { opacity: .9; } 100% { opacity: 1; } }
@keyframes tshake { 0%, 100% { transform: none; } 20% { transform: translate(-3px, 2px); } 40% { transform: translate(3px, -2px); } 60% { transform: translate(-2px, -1px); } 80% { transform: translate(2px, 1px); } }
@media (prefers-reduced-motion: reduce) {
  .t-stage, .t-rose, .t-candle, .t-fog, .t-logo, #title .t-main, .t-tap { animation: none; }
  #title.entering .t-stage { transform: translateX(-50%); transition: none; }
}
/* a short or wide screen: the name moves up so the buttons below never cover it */
@media (max-height: 760px) and (min-aspect-ratio: 3/4), (min-aspect-ratio: 1/1) {
  .t-mid { top: 9%; }
  .t-emblem { width: clamp(64px, 11vh, 96px); margin-bottom: 8px; }
  .t-logo { font-size: clamp(48px, 10vh, 80px); }
}
@media (max-height: 700px) and (max-aspect-ratio: 3/4) {
  .t-mid { top: 14%; }
  .t-emblem { width: 76px; margin-bottom: 8px; }
  .t-logo { font-size: 54px; }
  .t-low { gap: 8px; }
  #title .t-main { min-height: 52px; }
}
/* the terms and the privacy policy, read inside the game */
.modal.legal { width: min(560px, 94vw); }
.legal-frame { display: block; width: 100%; height: min(68vh, 620px); border: 0; background: #0b080d; }
/* home: side columns and the hero in one band, so nothing below can slide under the buttons;
   every button takes the same height (a timer sits on the icon's lower rim), so the rows line up left and right */
.home-top { display: grid; grid-template-columns: 64px 1fr 64px; align-items: start; column-gap: 2px; margin: 0 -6px; }
.home .home-top .side { position: static; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 4px; z-index: 3; }
.home-top .hero-stage { align-self: stretch; min-height: 190px; }
.home .sidebtn { width: 64px; height: 66px; justify-content: flex-start; gap: 3px; }
.home .sidebtn span.l { max-width: 64px; font-size: 10px; line-height: 1.1; }
.home .sidebtn .tm { position: absolute; top: 37px; left: 50%; transform: translateX(-50%); z-index: 2; padding: 1px 4px; white-space: nowrap; font-size: 8px; line-height: 10px; color: #ffd98a; background: rgba(8,5,10,.92); border: 1px solid #7a5c34; }
.home .sidebtn .badge { right: 2px; }
/* a short screen: smaller buttons, so the battle plaque stays in view */
@media (max-height: 780px) {
  .home-top { grid-template-columns: 56px 1fr 56px; }
  .home .home-top .side { gap: 5px; padding-top: 2px; }
  .home .sidebtn { width: 56px; height: 56px; gap: 2px; }
  .home .sidebtn .ic, .sidebtn .ic { width: 40px; height: 40px; }
  .home .sidebtn .ic > img { width: 28px; height: 28px; }
  .home .sidebtn span.l { font-size: 9px; max-width: 56px; }
  .home .sidebtn .tm { top: 31px; }
  .home-top .hero-stage { min-height: 160px; }
}
@media (max-height: 700px) {
  .home-top { grid-template-columns: 50px 1fr 50px; }
  .home .home-top .side { gap: 3px; padding-top: 0; }
  .home .sidebtn { width: 50px; height: 48px; gap: 1px; }
  .home .sidebtn .ic, .sidebtn .ic { width: 34px; height: 34px; }
  .home .sidebtn .ic > img { width: 24px; height: 24px; }
  .home .sidebtn span.l { font-size: 8.5px; max-width: 50px; }
  .home .sidebtn .tm { top: 25px; font-size: 7px; line-height: 9px; }
  .home .sidebtn .badge { transform: scale(.85); }
  .home-top .hero-stage { min-height: 130px; }
}
@media (max-height: 700px) {
  .home-top .hero-stage { min-height: 116px; }
  .stagecard { min-height: 118px; }
  .stagecard .info { padding-top: 6px; }
  .stagecard .chips { padding-top: 5px; }
}
/* the battle plaque stays in view: on a screen too short for the whole home page it rests on the bottom edge
   while the rest scrolls behind it (when everything fits, nothing moves) */
.home .bbwrap { position: sticky; bottom: 0; z-index: 4; filter: drop-shadow(0 -6px 10px rgba(0,0,0,.65)); }
/* shop: the chest buttons rest on the bottom of each card, so the rows line up across the three chests
   (bottom row: gold, gems, gems); the gem packs keep two tag rows, red first-purchase tag on top */
.chest .cbtns { margin-top: auto; width: 100%; display: flex; flex-direction: column; gap: 4px; }
.pack .ptags { min-height: 36px; }
.pack .ptags span { height: 17px; }
.pack .ptags .tag { letter-spacing: 0; padding: 1px 2px; }
/* the account block: the player's name over a framed experience bar with the numbers inside; the whole block opens the profile */
.acct { cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding-left: 2px; }
.acct .name { display: block; font-family: var(--title); font-size: 12.5px; line-height: 1.1; color: #f0c860; text-shadow: 0 1px 0 #000, 0 0 6px rgba(0,0,0,.8); overflow: hidden; text-overflow: ellipsis; }
.acct .xpbar { position: relative; max-width: 132px; height: 12px; margin-top: 0; border-radius: 0; overflow: hidden;
  background: linear-gradient(180deg, #0c0810, #1d1522); border: 1px solid #050308; box-shadow: 0 0 0 1px #7a5c34, inset 0 1px 3px rgba(0,0,0,.8); }
.acct .xpbar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #d8f0ff 0%, #8cc4ff 35%, #3a78e0 70%, #24509a 100%); box-shadow: inset -1px 0 0 rgba(255,255,255,.55), 0 0 6px rgba(120,180,255,.6); transition: width .5s ease-out; }
.acct .xpbar span { position: relative; display: block; text-align: center; font: 9px/11px var(--num); color: #fff; text-shadow: 0 1px 0 #000, 0 0 2px #000, 0 0 3px #000; white-space: nowrap; }
@media (max-width: 430px) { .acct .name { display: block; } }
/* profile and the name window */
.pname { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; }
.pname b { font-family: var(--title); font-size: 20px; color: var(--gold); text-shadow: 0 2px 0 #000; }
.namerow { display: flex; gap: 8px; align-items: stretch; }
.nameinp { flex: 1; min-width: 0; height: 44px; padding: 0 12px; font: 800 18px var(--body); color: #f4e6c4; background: #0e0a12; border: 1px solid #050308; box-shadow: inset 0 0 0 1px #7a5c34, inset 0 2px 6px rgba(0,0,0,.7); outline: none; }
.nameinp:focus { box-shadow: inset 0 0 0 1px #f0c860, inset 0 2px 6px rgba(0,0,0,.7); }
.btn.dice { width: 48px; padding: 0; }
.btn.dice svg { width: 24px; height: 24px; }
.nameerr { min-height: 18px; margin-top: 4px; color: var(--blood-hi); text-align: center; }
/* v1.60.46 the level and the experience bar in the same dress as the currency pills beside them:
   dark iron, a black edge, a thin bronze line inside and notched corners */
.topbar .avatar { overflow: visible; }
.topbar .avatar .lvl { right: -8px; bottom: -8px; min-width: 22px; height: 18px; padding: 0 4px; border: 2px solid #050308; border-radius: 0;
  display: flex; align-items: center; justify-content: center; background: #0c080e; box-shadow: inset 0 0 0 1px var(--ring); clip-path: var(--notch);
  font: 9px/1 var(--num); color: #ffd98a; text-shadow: 0 1px 0 #000; }
.topbar .acct .xpbar { position: relative; height: 16px; padding: 3px; border: 2px solid #050308; border-radius: 0; background: #0c080e;
  box-shadow: inset 0 0 0 1px var(--ring); clip-path: var(--notch); overflow: hidden; }
.topbar .acct .xpbar i { position: absolute; left: 3px; top: 3px; bottom: 3px; max-width: calc(100% - 6px); background: linear-gradient(180deg, #d8f0ff 0%, #8cc4ff 40%, #3a78e0 100%); box-shadow: 0 0 6px rgba(120,180,255,.5); }
.topbar .acct .xpbar span { position: relative; display: block; text-align: center; font: 8.5px/8px var(--num); color: #fff; text-shadow: 0 1px 0 #000, 0 0 2px #000, 0 0 3px #000; white-space: nowrap; }
/* the bar's lower edge on the same line as the pills' */
.topbar .acct { position: relative; top: -2px; }
/* the home page fits the screen exactly, so it never slides under a finger: the hall card takes whatever height is left
   (down to what its text needs), and on a tall screen the hero band shares the spare room; only a screen too short even
   for that scrolls, with the battle plaque resting on the bottom edge */
.home { height: 100%; min-height: 0; }
.home > * { flex-shrink: 0; }
.home > .home-top { flex: 1 0 auto; }
.home > .stagecard { flex: 100 1 0; min-height: min-content; max-height: 240px; } /* never shorter than its own text */
.stagecard .info { padding-top: 18px; }
@media (max-height: 780px) { .home .stagecard .srule { -webkit-line-clamp: 2; } }
.home .enote { margin-top: 6px; }
/* a very short screen (a small phone with the browser bars showing): tighter panels; the hall card keeps its name and record */
@media (max-height: 660px) {
  .home .vigil { padding-top: 6px; padding-bottom: 6px; }
  .home > .stagecard { margin-top: 6px !important; }
  .home .stagecard .srule { display: none; }
  .home .stagecard .chips { padding-top: 4px; }
  .home .bbwrap { margin-top: 6px; }
  .home .enote { margin-top: 2px; font-size: 11px; }
}
@media (max-height: 610px) {
  .home .home-top .side { gap: 1px; }
  .home .sidebtn { height: 42px; }
  .home .sidebtn span.l { font-size: 8px; }
  .home .sidebtn .ic, .sidebtn .ic { width: 32px; height: 32px; }
  .home .sidebtn .ic > img { width: 22px; height: 22px; }
  .home .sidebtn .tm { top: 23px; }
  .home .enote { display: none; }
  .home > .stagecard { margin-top: 4px !important; }
}
/* title: on a screen wider than the nave drawing, its sides melt into black instead of ending on a hard edge;
   the soft backdrop behind them sinks to near black, so there are no bands at the sides */
#title { background: #030205; }
#title::before { filter: blur(14px) brightness(.16); }
:root { --nave-fade: linear-gradient(90deg, transparent 0, rgba(0,0,0,.06) 3%, rgba(0,0,0,.18) 6%, rgba(0,0,0,.36) 9%, rgba(0,0,0,.56) 12%, rgba(0,0,0,.74) 15%, rgba(0,0,0,.88) 18%, rgba(0,0,0,.97) 21%, #000 24%,
  #000 76%, rgba(0,0,0,.97) 79%, rgba(0,0,0,.88) 82%, rgba(0,0,0,.74) 85%, rgba(0,0,0,.56) 88%, rgba(0,0,0,.36) 91%, rgba(0,0,0,.18) 94%, rgba(0,0,0,.06) 97%, transparent 100%); }
.t-stage { -webkit-mask-image: var(--nave-fade); mask-image: var(--nave-fade); }
/* the frame-rate readout (Settings): small, under the timer, green / amber / red */
#hud .fps { position: absolute; left: 50%; top: calc(46px + var(--safe-t)); transform: translateX(-50%); padding: 1px 6px; font: 700 10px var(--body); letter-spacing: .04em; white-space: nowrap; color: #8fe08a; background: rgba(0,0,0,.55); pointer-events: none; }
#hud .fps.mid { color: #f0c860; } #hud .fps.bad { color: #ff6a6a; }
/* graphics effects: the three-stop slider with its step named beside it */
.setrow .fxstep { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.setrow .fxname { font-size: 11.5px; line-height: 1.15; color: var(--gold); white-space: nowrap; }
/* the Vigil before the first victory: dimmed, with a lock where the gold would be */
.vigil.locked { filter: grayscale(.7); opacity: .72; }
.vigil.locked .row img, .vigil.locked > img.ic:last-child { width: 22px; height: 22px; }
/* results: completed deeds wrap under their own text, not under the check mark; each damage bar carries its ability's name */
.deedsdone .dd { display: flex; align-items: flex-start; gap: 6px; }
.deedsdone .dd > img { flex: none; margin-top: 2px; }
.dmgrow .dmgcol { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dmgrow .dn { font-size: 10.5px; line-height: 1.1; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dmgrow .dmgcol .bar { flex: none; }
.dmgrow img { width: 20px; height: 20px; }
/* live events: the event window, its balance and its shop */
.modal.event .evtime { color: #8fe08a; font-weight: 800; margin-bottom: 8px; }
.modal.event .evtime.closing { color: #f0c860; }
.evbal { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 8px; }
.evbal img { width: 40px; height: 40px; }
.evad { display: flex; justify-content: center; margin: 0 0 10px; }
.evad .btn { width: auto; display: inline-flex; align-items: center; gap: 4px; }
.evad .btn img.ci { width: 20px; height: 20px; }
.evbal b { font-size: 22px; color: #f0e0ff; }
.evbal span { color: var(--muted); font-weight: 800; }
.evshop { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.evitem { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; background: rgba(0,0,0,.28); border: 1px solid rgba(200,144,44,.35); }
.evitem .reward-list { margin: 0; gap: 6px; }
.evitem .reward .slot { width: 52px; }
.evitem .evdesc { text-align: center; line-height: 1.3; color: #bcd8ea; font-size: 11px; }
.evitem.wide { grid-column: 1 / -1; }
.evitem .btn { min-width: 96px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.evitem .btn img { width: 20px; height: 20px; }
.evitem.sold { opacity: .55; }
.evitem .evsold { font-weight: 800; padding: 6px 0; }
/* leaderboards */
.lbtabs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 10px; }
.lbtabs .chip { padding: 5px 10px; font-size: 12px; background: rgba(10,6,12,.72); border: 1px solid rgba(214,164,70,.55); color: #e8dcc8; }
.lbtabs .chip.on { background: linear-gradient(180deg, #6a4a14, #3a2408); color: #fff0c0; border-color: #f0c860; }
.lbhead { text-align: center; margin-bottom: 8px; }
.lbhead .lbt { font-family: var(--title); color: var(--gold); font-size: 16px; }
.lbsign { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 10px; margin-bottom: 8px; background: rgba(240,200,96,.08); border: 1px solid #6a5030; }
.lblist { display: flex; flex-direction: column; gap: 3px; }
.lbrow { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.05); }
.lbrow .lbrank { width: 30px; text-align: center; font: 700 12px var(--num); color: var(--muted); }
.lbrow img, .lbrow .lbnohero { width: 26px; height: 26px; flex: none; }
.lbrow .lbname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.lbrow .lbscore { font: 700 12px var(--num); color: #f0e0c0; }
.lbrow.top1 .lbrank { color: #ffd35a; } .lbrow.top2 .lbrank { color: #d8dce8; } .lbrow.top3 .lbrank { color: #e0955a; }
.lbrow.top1 { border-color: rgba(255,211,90,.45); }
.lbrow.me { background: rgba(120,200,110,.14); border-color: rgba(143,224,138,.55); }
.lbgap { text-align: center; color: var(--muted); line-height: 1; }
.lbnote { padding: 10px 0; }

/* Send feedback, What's new, the developer's overview (js/ui/insights.js) */
.fb-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.fb-text { width: 100%; box-sizing: border-box; resize: vertical; min-height: 110px; background: rgba(0,0,0,.45); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; line-height: 1.4; user-select: text; -webkit-user-select: text; }
.fb-text:focus { outline: none; border-color: var(--gold); }
.fb-count { text-align: right; margin: 2px 0 10px; }
.news-ver { margin-bottom: 10px; }
.news-v { color: var(--gold); font-weight: 800; margin-bottom: 4px; }
.news-list { margin: 0; padding-left: 18px; line-height: 1.45; font-size: 14px; }
.news-list li { margin-bottom: 4px; }
.adm-range { justify-content: flex-start; margin: 0 0 8px; }
.adm-day { display: grid; grid-template-columns: 44px 1fr; gap: 2px 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.adm-day > span { grid-column: 2; color: var(--muted); }
.adm-bar { height: 8px; background: rgba(0,0,0,.4); border-radius: 4px; overflow: hidden; }
.adm-bar i { display: block; height: 100%; background: linear-gradient(90deg, #6a4a20, var(--gold)); }
.adm-row { padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.adm-who { font-weight: 800; word-break: break-all; }
.adm-text { white-space: pre-wrap; line-height: 1.4; margin-top: 3px; user-select: text; -webkit-user-select: text; }
/* an ability's damage types under its name: each in its own colour, small; what an upgrade can still add is fainter, in brackets */
.abtypes { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 8px; margin: 1px 0 3px; font: 800 9.5px var(--body); letter-spacing: .05em; line-height: 1.25; }
.abtypes .dt { color: var(--dc, #ddd); text-transform: uppercase; text-shadow: 0 1px 0 #000, 0 0 6px rgba(0,0,0,.6); }
.abtypes .dt.later { opacity: .5; font-weight: 600; text-transform: none; letter-spacing: .01em; }
.abtypes .dt.gain { text-shadow: 0 1px 0 #000, 0 0 7px var(--dc); }
.dt-physical { --dc: #d6dae4; } .dt-magic { --dc: #c792ff; } .dt-fire { --dc: #ff8c3e; } .dt-lightning { --dc: #ffe14d; } .dt-ice { --dc: #80d8ff; }
.hero-card .abtypes { margin: 1px 0 0; font-size: 8.5px; }
.abtypes .dt.later { color: #b8aea0; } .abtypes .dt.later > span { color: var(--dc); }
.abtypes .dt.notype { --dc: #9a9088; text-transform: none; letter-spacing: .01em; font-weight: 700; }
/* the hero card: its action on top, the "i" (details) in the bottom-right corner */
.hero-card .hc-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; flex: none; }
/* the hero details window */
.modal.heroinfo .hi-top { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.modal.heroinfo .hi-top .pic { width: 56px; height: 56px; flex: none; display: flex; align-items: center; justify-content: center; }
.modal.heroinfo .hi-top .pic img { width: 48px; height: 48px; }
.modal.heroinfo .hi-row { display: flex; gap: 10px; padding: 7px 2px; border-top: 1px solid rgba(176,138,72,.22); font-size: 13.5px; line-height: 1.35; }
.modal.heroinfo .hi-k { flex: 0 0 34%; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding-top: 1px; }
.modal.heroinfo .hi-v { flex: 1; min-width: 0; }
.modal.heroinfo img.wi { width: 22px; height: 22px; }
/* turning a tome down: gold or half a level, under the offers */
.tome-decline { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(176,138,72,.22); }
.tome-decline > span { flex: 1 1 auto; }
.tome-decline .btn img { width: 16px; height: 16px; }
/* settings: tabs over a framed panel; quick tiles on top, compact rows with the game's icons; account, feedback and links below */
.modal.settings .set-tabs { margin: 0 0 8px; }
.modal.settings .set-panel { border: 2px solid #050308; background: var(--tex-panel, none) 0 0 / 64px 64px, #1a1220; padding: 8px 10px 2px;
  box-shadow: inset 0 0 0 2px var(--ring), inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo); }
.set-tiles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; } /* the tiles share the row; the quality band takes a row of its own */
.set-tile { flex: 1 1 0; min-width: 62px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 3px; padding: 6px 4px 7px; border: 2px solid #050308; clip-path: var(--notch);
  background: linear-gradient(180deg, rgba(255,220,150,.16) 0 2px, transparent 2px), linear-gradient(180deg, rgba(120,90,50,.32), rgba(40,26,18,.62)), var(--tex-stone, none) 0 0 / 64px 64px, #2a1e22;
  box-shadow: inset 0 0 0 1px #b08a48; }
/* the quality tile: one full-width band (icon and name, then the three-stop slider), so the tiles stay one short row */
.set-tile.wide { flex-basis: 100%; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 6px 12px; }
.set-tile.wide .st-l { white-space: nowrap; }
.set-tile.wide .fxstep { flex: 1; flex-direction: row; align-items: center; gap: 10px; } /* the slider in the band's middle, its step named at its right */
.set-tile.wide .fxstep input { flex: 1; width: auto; margin: 0; }
.set-tile.wide .fxname { min-width: 48px; text-align: right; }
.set-tile img.sti { width: 26px; height: 26px; }
.set-tile .st-l { font: 800 12px var(--body); color: #f4d07a; text-shadow: 0 1px 0 #000; text-align: center; line-height: 1.1; }
.set-tile .fxstep { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 100%; }
.set-tile .fxstep input { width: 92%; accent-color: var(--gold); }
.set-tile .fxname { font-size: 11px; line-height: 1.1; color: var(--gold); white-space: nowrap; }
.setrow img.sri { width: 22px; height: 22px; flex: none; }
.modal.settings .setrow { padding: 7px 2px; }
.modal.settings .setrow label { font-size: 14px; line-height: 1.2; }
.modal.settings .setrow input[type=range] { width: 118px; }
@media (max-width: 420px) { .modal.settings .setrow input[type=range] { width: 96px; } .modal.settings .setrow label { font-size: 13.5px; } }
.modal.settings .sethint { margin: -4px 0 6px 32px; font-size: 11.5px; line-height: 1.3; }
.set-div { height: 1px; margin: 6px 0; background: linear-gradient(90deg, transparent, rgba(200,154,72,.45), transparent); }
.modal.settings .set-lang { border-bottom: 0; }
.set-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.set-btns .set-rate { grid-column: 1 / -1; }
.set-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; margin-top: 10px; }
.set-link { background: none; border: 0; padding: 4px 2px; color: #d8c8a8; font: 700 12.5px var(--body); text-decoration: underline; cursor: pointer; }
.set-link.danger { color: #ff8a80; }
.modal.settings .admin-slot:not(:empty) { margin-top: 8px; }
.modal.settings .note { text-align: center; }
/* settings fit the screen without scrolling: compact on phones, and scaled down by script (zoom) if still too tall */
.modal.settings { max-height: none; overflow: visible; }
.modal.settings .set-tabs { margin: 0 0 6px; }
.modal.settings .set-tabs button { min-height: 30px; }
.modal.settings .set-panel { padding: 6px 8px 2px; }
.modal.settings .set-tile { padding: 4px 4px 5px; gap: 2px; }
.modal.settings .set-tile img.sti { width: 22px; height: 22px; }
.modal.settings .set-tile .st-l { font-size: 11.5px; }
.modal.settings .set-tile.wide { padding: 4px 10px; }
.modal.settings .setrow { padding: 5px 2px; gap: 9px; }
.modal.settings .setrow img.sri { width: 20px; height: 20px; }
.modal.settings .sethint { margin: -3px 0 4px 31px; font-size: 11px; line-height: 1.25; }
.modal.settings .set-div { margin: 4px 0; }
.modal.settings .set-btns { margin-top: 8px; }
.modal.settings .set-links { margin-top: 6px; }
.modal.settings .note { margin-top: 4px; }
.modal.settings .set-lang .dd-list { top: auto; bottom: calc(100% + 4px); } /* it sits at the bottom: the list opens upward */

/* ===================== Armory: relics (the hero among their gear) ===================== */
.doll { display: grid; grid-template-columns: 62px minmax(0, 1fr) 62px; gap: 8px; margin: 4px 0 8px; }
.doll .dcol { display: flex; flex-direction: column; gap: 6px; }
.doll .dcol .slot { width: 62px; }
.doll .dcol .slot .lv { font-size: 6px; }
.doll .dmid { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; padding: 6px 4px 8px; cursor: pointer; overflow: hidden;
  border: 2px solid #050308; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), inset 0 0 30px #000;
  background: radial-gradient(ellipse 46% 9% at 50% 70%, rgba(0,0,0,.7), transparent 100%), radial-gradient(ellipse at 50% 60%, rgba(255,130,50,.22), transparent 62%), var(--tex-panel, none) 0 0 / 64px 64px, #1a1220; }
.doll .dhero { flex: 1; min-height: 0; width: auto; max-width: 100%; height: 180px; object-fit: contain; image-rendering: pixelated; animation: dbreathe 2.8s ease-in-out infinite; transform-origin: 50% 100%; filter: drop-shadow(0 3px 0 rgba(0,0,0,.6)); }
@keyframes dbreathe { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(1.025); } }
.doll .dname { font-weight: 800; font-size: 14px; color: var(--gold); text-shadow: 0 1px 0 #000, 0 0 6px #000; text-align: center; line-height: 1.1; }
.doll .power { margin-top: 0; }
.matline { display: flex; align-items: center; gap: 4px; margin: 0 0 8px; }
.matline .mchip { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 3px 4px; background: rgba(0,0,0,.45); border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.matline .mchip img { width: 20px; height: 20px; flex: none; }
.matline .mchip b { font: 10px var(--num); color: #fff; overflow: hidden; text-overflow: ellipsis; }
.matline .btn { flex: none; }
.invbar { gap: 6px; margin-bottom: 6px; }
.grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.grid5.inv { margin-top: 6px; grid-template-columns: repeat(auto-fill, 62px); justify-content: space-between; row-gap: 6px; } /* the same size as the worn pieces: more to a row on a wider screen */
.grid5 .slot { border-radius: 3px; }
.grid5 .slot .lv { font-size: 6px; bottom: 2px; right: 3px; }

/* the forge scene when relics merge */
.ffx { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(4,2,6,.975); animation: ffxin .25s ease-out; cursor: pointer; user-select: none; -webkit-user-select: none; }
.ffx.out { opacity: 0; transition: opacity .2s; }
@keyframes ffxin { from { opacity: 0; } to { opacity: 1; } }
.ffx-title { font-family: var(--title, inherit); font-size: 24px; font-weight: 800; color: var(--gold); text-shadow: 0 2px 0 #000, 0 0 12px rgba(255,140,40,.6); letter-spacing: 1px; }
.ffx-stage { position: relative; width: 360px; height: 400px; max-width: 100vw; border: 2px solid #050308; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 2px var(--bronze, #8a6a3a), 0 0 40px rgba(255,120,40,.25); zoom: var(--ffxz, 1); }
.ffx-cv { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.ffx-stage .slot { position: absolute; left: 0; top: 0; width: 68px; opacity: 0; will-change: transform; transform-origin: 50% 50%; }
.ffx-stage .slot.ffx-out { box-shadow: 0 0 22px var(--rc), inset 0 0 12px rgba(0,0,0,.8); animation: none; }
.ffx-name { text-align: center; font-weight: 800; font-size: 17px; color: #fff; text-shadow: 0 1px 0 #000; opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; min-height: 2.6em; }
.ffx-name .rtxt { font-size: 13px; }
.ffx-name.on { opacity: 1; transform: none; }
.ffx-hint { font-size: 12px; color: var(--muted); animation: ffxblink 1.6s ease-in-out infinite; }
@keyframes ffxblink { 0%,100% { opacity: .45; } 50% { opacity: 1; } }

/* the resource store: its button in the corner of the hero's panel, its window of daily rewards */
.doll .resbtn { position: absolute; top: 4px; right: 4px; z-index: 2; width: 46px; display: flex; flex-direction: column; align-items: center; gap: 1px; background: none; border: 0; padding: 0; cursor: pointer; }
.doll .resbtn > .ic { width: 38px; height: 38px; border-radius: 10px; background: radial-gradient(circle at 50% 35%, #3a2a40, #140e18); border: 2px solid var(--bronze); display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 0 #000, inset 0 0 8px #000; }
.doll .resbtn > .ic img { width: 28px; height: 28px; }
.doll .resbtn .l { font-size: 9px; font-weight: 800; color: var(--text); text-shadow: 0 1px 2px #000, 0 0 4px #000; line-height: 1; }
.doll .resbtn .badge { top: -4px; right: -2px; }
.doll .resbtn.statbtn { right: auto; left: 4px; width: auto; min-width: 46px; }
.modal.herostats .ssheet { margin: 6px 0 4px; }
.rs-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 6px; }
.rs-row.done { opacity: .6; }
.rs-row.locked { opacity: .5; }
.rs-t { font-weight: 800; font-size: 13px; color: var(--gold); margin-bottom: 3px; }
.rs-items { display: flex; gap: 6px; flex-wrap: wrap; }
.rs-it { display: flex; align-items: center; gap: 3px; background: rgba(0,0,0,.4); border: 1px solid var(--line); border-radius: 7px; padding: 2px 6px 2px 3px; }
.rs-it img { width: 22px; height: 22px; }
.rs-it b { font: 10px var(--num); color: #fff; }
.rs-row .btn { flex: none; min-width: 92px; }
.rs-timer { margin-top: 2px; }
.rs-sect { margin: 12px 0 6px; }
.rs-pack { display: flex; align-items: center; gap: 8px; padding: 7px 8px; margin-bottom: 6px; cursor: pointer; }
.rs-pack .rs-pico { width: 44px; flex: none; }
.rs-pack .rs-t { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rs-pack .rs-t .tag { font-size: 9px; padding: 1px 5px; background: var(--blood, #a02020); color: #fff; border-radius: 3px; }
.rs-pack .bonus { font-size: 10px; margin-top: 2px; color: var(--good); font-weight: 800; }
.rs-pack .btn { flex: none; min-width: 72px; }
.rs-pack .rs-items { gap: 4px; }
.rs-pack .rs-it img { width: 18px; height: 18px; }

/* ===================== Shop: one category at a time ===================== */
.shop-tabs { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 0 -2px 6px; padding: 5px;
  border: 2px solid #050308; background: var(--tex-panel, none) 0 0 / 64px 64px, #1a1220; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 4px 10px rgba(0,0,0,.6); }
.shop-tabs .stab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 46px; padding: 3px 2px; cursor: pointer;
  border: 2px solid #050308; background: linear-gradient(180deg, #2c2232, #18101c); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); color: var(--muted); font-weight: 800; font-size: 10px; line-height: 1.05; }
.shop-tabs .stab img { width: 24px; height: 24px; image-rendering: pixelated; opacity: .75; filter: saturate(.7); }
.shop-tabs .stab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.shop-tabs .stab.on { color: var(--gold); background: radial-gradient(90% 120% at 50% 130%, rgba(255,170,70,.3), transparent 60%), linear-gradient(180deg, #4a3a52, #2c2032); box-shadow: inset 0 0 0 2px #e0b050; }
.shop-tabs .stab.on img { opacity: 1; filter: drop-shadow(0 0 4px rgba(255,200,100,.5)); }
.shop-tabs .sdot { position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; background: var(--blood-hi); box-shadow: 0 0 0 2px #000; }
.shop-sec > h3.sect:first-child { margin-top: 6px; }
.offer { padding: 9px 10px; }
.offer .ot { font-size: 16px; }
.offer .odesc { font-size: 12px; line-height: 1.25; margin-top: 2px; opacity: .9; }
.offer .obody { display: flex; align-items: flex-end; gap: 8px; margin-top: 6px; }
.offer .obody .contents { flex: 1; min-width: 0; margin: 0; gap: 4px; }
.offer .obody .grow { flex: 1; }
.offer .oprice { flex: none; min-width: 84px; padding-left: 10px; padding-right: 10px; }
/* level-up: the lock in a card's corner (kept through a reroll) */
.levelup .choice { position: relative; }
.levelup .lockb { position: absolute; top: 4px; right: 4px; z-index: 2; width: 26px; height: 26px; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer;
  border: 2px solid #050308; background: linear-gradient(180deg, #2c2232, #18101c); opacity: .7; }
.levelup .lockb img.ci { width: 14px; height: 14px; margin: 0; }
.levelup .lockb.on { opacity: 1; background: linear-gradient(180deg, #6a4a1e, #3a2810); box-shadow: inset 0 0 0 1px #e0b050, 0 0 8px rgba(255,190,80,.5); }
.levelup .choice:has(.lockb.on) { box-shadow: inset 0 0 0 2px #e0b050; }

/* an ability's details: its icons on the HUD and in the level-up window open them */
#hud .build .b { pointer-events: auto; cursor: pointer; }
.levelup .buildrow .b { cursor: pointer; }
.modal.abinfo .ai-head { display: flex; gap: 10px; align-items: flex-start; }
.modal.abinfo .ai-ico { width: 52px; flex: none; }
.modal.abinfo .ai-head .small { margin-top: 3px; line-height: 1.3; }
.modal.abinfo .ai-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 10px 0 4px; padding: 8px 10px; border: 2px solid #050308; background: rgba(0,0,0,.35); }
.modal.abinfo .ai-st { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; }
.modal.abinfo .ai-st span { color: var(--muted); }
.modal.abinfo .ai-st b { color: var(--text); font-family: var(--num); font-size: 10px; font-weight: 400; }
.modal.abinfo .ai-sect { font-family: var(--title); color: var(--bronze-hi); font-size: 13px; margin: 10px 0 4px; letter-spacing: .06em; }
.modal.abinfo .ai-tr { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.modal.abinfo .ai-tr b { color: var(--gold); }
.modal.abinfo .ai-tr.up b { color: #9ad0ff; }
.modal.abinfo .ai-tr span { color: var(--muted); text-align: right; }

/* ===================== Sign-in: a week or a month of days, free and premium ===================== */
.modal.signin .si-tabs { margin-top: 0; }
.si-prog { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 12px; font-weight: 800; color: var(--gold); }
.si-prog .bar { flex: 1; }
.si-head { display: grid; grid-template-columns: 76px 1fr 1fr; gap: 6px; padding: 3px 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.si-head span { text-align: center; } .si-head span:first-child { text-align: left; } .si-head .prem { color: #e8b8ff; }
.si-list { max-height: min(46vh, 380px); overflow-y: auto; display: flex; flex-direction: column; gap: 5px; padding: 2px; }
.si-row { display: grid; grid-template-columns: 76px 1fr 1fr; gap: 6px; align-items: stretch; padding: 4px 6px; border: 2px solid #050308; background: linear-gradient(180deg, rgba(60,44,30,.55), rgba(30,22,16,.6)); }
.si-row.today { background: linear-gradient(180deg, rgba(120,90,40,.6), rgba(60,40,18,.7)); box-shadow: inset 0 0 0 1px var(--gold); }
.si-row.missedrow { opacity: .62; }
.si-day { display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.si-day b { font: 11px var(--num); color: var(--text); }
.si-stamp { font-size: 10px; font-weight: 800; transform: rotate(-8deg); transform-origin: left; width: max-content; padding: 0 4px; border: 1px solid currentColor; border-radius: 3px; }
.si-stamp.ok { color: #8fe08a; } .si-stamp.miss { color: #ff7a7a; } .si-stamp.now { color: var(--gold); transform: none; }
.si-rw { position: relative; display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; padding: 3px; border: 2px solid #050308; background: rgba(0,0,0,.35); }
.si-rw.prem { background: linear-gradient(180deg, rgba(90,40,120,.55), rgba(40,16,60,.65)); }
.si-rw img { width: 26px; height: 26px; }
.si-rw b { font: 10px var(--num); color: #fff; } .si-rw b.word { font: 800 10px var(--body); }
.si-rw.ready { cursor: pointer; box-shadow: inset 0 0 0 2px #ffd060, 0 0 10px rgba(255,200,80,.55); animation: siglow 1.3s ease-in-out infinite; }
@keyframes siglow { 50% { box-shadow: inset 0 0 0 2px #fff0a0, 0 0 16px rgba(255,210,100,.85); } }
.si-rw.got, .si-rw.missed { filter: grayscale(.7) brightness(.7); }
.si-rw.later { opacity: .8; }
.si-rw.locked { opacity: .75; }
.si-rw .si-ok, .si-rw .si-lock { position: absolute; top: 1px; right: 2px; }
.si-rw .si-ok img.ci, .si-rw .si-lock img.ci { width: 14px; height: 14px; margin: 0; }
.si-buy { margin-top: 8px; }
.si-premon { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; font-weight: 800; color: #e8b8ff; }
.si-timer { margin-top: 6px; }

/* ===================== Battle Pass: a badge, its XP, a track down the levels; the premium perks ===================== */
.passhead .ph-top { display: flex; gap: 10px; align-items: center; }
.ph-badge { position: relative; width: 58px; height: 58px; flex: none; display: flex; align-items: center; justify-content: center; }
.ph-badge img { width: 58px; height: 58px; filter: drop-shadow(0 2px 0 #000); }
.ph-badge b { position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); min-width: 26px; padding: 1px 5px; font: 11px var(--num); color: #fff; text-align: center; background: linear-gradient(180deg, #6a4a1e, #3a2810); border: 2px solid #050308; box-shadow: inset 0 0 0 1px #e0b050; }
.ph-title { font-family: var(--title); color: var(--gold); font-size: 17px; }
.ph-xp { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.ph-xp .bar { flex: 1; height: 12px; }
.ph-xp span { font: 9px var(--num); color: #cfe4ff; white-space: nowrap; }
.ph-acts { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ph-on { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--good); font-size: 12px; }
.pass-headrow { margin: 10px 0 4px; }
.pass-list .pass-row { margin-bottom: 0; padding: 3px 0; }
.pass-list .pass-row .tier { position: relative; width: 44px; height: 100%; min-height: 58px; border: 0; border-radius: 0; background: none; box-shadow: none; }
.pass-list .pass-row .tier .trk { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 6px; margin-left: -3px; background: #120c16; border: 1px solid #050308; border-top: 0; border-bottom: 0; } /* no edge at its ends: one unbroken track down the rows */
.pass-list .pass-row .tier { align-self: stretch; height: auto; } /* as tall as its row, however tall the rewards make it */
.pass-list .pass-row .tier .trk i { display: block; width: 100%; background: linear-gradient(90deg, #ffe08a, #d09030); box-shadow: 0 0 6px rgba(255,200,90,.6); }
.pass-list .pass-row .tier b { position: relative; z-index: 1; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #1c1420; border: 2px solid var(--line); font: 9px var(--num); color: var(--muted); }
.pass-list .pass-row.reached .tier b { border-color: var(--gold); color: #1a1008; background: radial-gradient(circle at 40% 35%, #ffe8a0, #d09030); box-shadow: 0 0 8px rgba(240,200,96,.55); }
.pass-list .pass-row.next .tier b { border-color: var(--gold); color: var(--gold); }
.pass-cell .lockic { position: absolute; top: 3px; right: 4px; }
.pass-cell .lockic img.ci { width: 14px; height: 14px; margin: 0; }
.modal.passperks .pp-hero { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.modal.passperks .pp-hero img { width: 54px; height: 54px; flex: none; }
.modal.passperks .pp-grid { display: flex; flex-direction: column; gap: 6px; }
.modal.passperks .pp-perk { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 2px solid #050308; background: rgba(0,0,0,.35); }
.modal.passperks .pp-ico { width: 40px; flex: none; }
.modal.passperks .pp-perk b { color: var(--good); font-size: 14px; }
.passbonus { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 10px; }
.passbonus.can { box-shadow: inset 0 0 0 2px var(--good), 0 0 10px rgba(88,200,96,.4); cursor: pointer; }
.passbonus .pb-ico { width: 44px; flex: none; }
.passbonus .t { font-weight: 800; color: var(--gold); margin-bottom: 3px; }
.pb-note { margin: 10px 4px 4px; }
/* the abilities on the HUD: larger icons, easy to read and to tap */
#hud .build .r { gap: 4px; flex-wrap: wrap; max-width: calc(100vw - 120px); }
#hud .build .b { width: 32px; height: 32px; }
#hud .build .b img { width: 28px; height: 28px; }
#hud .build .b i { font-size: 7px; bottom: -4px; right: -4px; padding: 1px 3px; }
/* the pause window: larger icons of the abilities and traits, each opening its details */
.modal.pausewin .buildrow { gap: 6px; }
.modal.pausewin .buildrow .b { width: 38px; height: 38px; cursor: pointer; }
.modal.pausewin .buildrow .b img { width: 32px; height: 32px; }
.modal.pausewin .buildrow .b i { font-size: 8px; bottom: -4px; right: -4px; padding: 1px 3px; }
.modal.pausewin .buildrow.traits .b { width: 34px; height: 34px; }
.modal.pausewin .buildrow.traits .b img { width: 28px; height: 28px; }
.modal.pausewin .pstats { max-height: 220px; overflow-y: auto; margin: 6px 0 8px; padding-right: 2px; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent); mask-image: linear-gradient(to bottom, #000 78%, transparent); }
.modal.pausewin .pstats.end { -webkit-mask-image: none; mask-image: none; }

/* ---------- the developer's panel (js/ui/adminpanel.js) ---------- */
.ap { position: absolute; inset: 0; background: var(--bg); display: flex; flex-direction: column; padding: calc(8px + var(--safe-t)) 0 var(--safe-b); font-family: var(--body); color: var(--text); } /* no z-index: a confirm opened over it (a later sibling) must paint on top */
.ap-top { display: flex; align-items: center; gap: 8px; padding: 4px 12px 8px; }
.ap-title { flex: 1; font-family: var(--title); font-size: 20px; color: var(--gold); }
.ap-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 12px 8px; border-bottom: 1px solid var(--line); flex: none; scrollbar-width: none; }
.ap-tabs::-webkit-scrollbar { display: none; }
.ap-tabs button { flex: none; background: var(--panel); color: var(--muted); border: 1px solid var(--line); padding: 7px 11px; font: 600 14px var(--body); cursor: pointer; }
.ap-tabs button.on { color: var(--gold-hi); background: var(--panel3); border-color: var(--bronze-hi); }
.ap-body { flex: 1; overflow-y: auto; padding: 10px 12px 40px; -webkit-overflow-scrolling: touch; }
.ap-body .btn.small, .ap-body .btn.tiny { width: auto; }
.ap-row { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.ap-row.wrap { flex-wrap: wrap; }
.ap-row > .ap-in { flex: 1; }
.ap-in { width: 100%; box-sizing: border-box; background: #0d090f; color: var(--text); border: 1px solid var(--line); padding: 7px 8px; font: 14px var(--body); margin: 3px 0; }
textarea.ap-in { resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.ap-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; margin: 4px 0; }
.ap-form label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.ap-check { display: flex; align-items: center; gap: 6px; font-size: 14px; margin: 6px 0; }
.ap-sect { background: var(--panel); border: 1px solid var(--line); padding: 8px 10px; margin: 10px 0; }
.ap-h { font-family: var(--title); color: var(--gold); font-size: 15px; margin-bottom: 4px; }
.ap-sub { color: var(--muted); font-size: 13px; margin: 8px 0 4px; }
.ap-muted { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.ap-bad { color: #ff8080; background: rgba(176,30,44,.15); border: 1px solid var(--blood); padding: 6px 8px; margin: 8px 0; font-size: 13px; }
.ap-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin: 8px 0; }
.ap-card { background: var(--panel); border: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; }
.ap-card b { font: 800 22px var(--num); color: var(--gold-hi); }
.ap-card span { font-size: 12px; color: var(--muted); }
.ap-card.warn b { color: var(--energy); }
.ap-card.bad b { color: var(--blood-hi); }
.ap-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 6px 0; }
.ap-table th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 4px 3px; }
.ap-table td { border-bottom: 1px solid rgba(75,58,42,.4); padding: 4px 3px; }
.ap-bar { position: relative; min-width: 60px; height: 14px; background: #0d090f; }
.ap-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bronze); }
.ap-bar span { position: relative; padding-left: 4px; font-size: 11px; }
.ap-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ap-chip { background: var(--panel3); border: 1px solid var(--line); padding: 3px 7px; font-size: 12px; }
.ap-list { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.ap-item { background: var(--panel2); border: 1px solid var(--line); padding: 7px 9px; cursor: pointer; }
.ap-item:active { background: var(--panel3); }
.ap-item.flat { cursor: default; }
.ap-name { font-weight: 700; color: var(--text); }
.ap-name.big { font-family: var(--title); font-size: 19px; color: var(--gold-hi); display: inline-block; margin-right: 8px; }
.ap-ptop { margin: 4px 0 8px; }
.ap-ban { background: var(--blood); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 6px; vertical-align: middle; }
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 3px 10px; }
.ap-kv { display: flex; gap: 6px; font-size: 13px; padding: 2px 0; border-bottom: 1px solid rgba(75,58,42,.35); }
.ap-kv .k { color: var(--muted); flex: none; min-width: 92px; }
.ap-kv .v { overflow-wrap: anywhere; }
.ap-text { white-space: pre-wrap; margin: 4px 0; font-size: 14px; }
.ap-pre { max-height: 360px; overflow: auto; background: #0d090f; border: 1px solid var(--line); padding: 6px; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ap details summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 6px; }
.mail-msg { white-space: pre-wrap; line-height: 1.4; margin: 6px 0 10px; }

/* Stat sheet: four groups, two columns of "name: value" */
.ssheet { display: flex; flex-direction: column; gap: 8px; }
.ss-sec { background: rgba(0,0,0,.35); border: 1px solid var(--line); padding: 0 0 6px; }
.ss-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; background: rgba(0,0,0,.45); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.ss-head span { font-weight: 800; color: var(--gold); font-size: 13px; letter-spacing: .3px; }
.ss-head .ss-ic { width: 22px; height: 22px; }
.ss-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; row-gap: 1px; padding: 0 8px; }
.ss-row { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 4px; min-width: 0; font-size: 12px; line-height: 1.3; padding: 2px 0; }
.ss-row > span:first-child { color: #e8dccb; }
.ss-row b { font-weight: 800; color: #f0e2b0; white-space: nowrap; }
.ss-row b.good { color: #7ee89a; }
.ss-row b.bad { color: var(--blood-hi); }
.ss-tip { text-align: center; }
.charsheet .ssheet { margin-top: 4px; }
.modal.altarinfo p { margin: 4px 0 10px; line-height: 1.45; }

/* The account's reward track (profile → Path) */
.acct-track { display: flex; flex-direction: column; gap: 6px; }
.acct-next { text-align: center; font-weight: 800; color: var(--gold); margin: 2px 0 4px; }
.acct-row { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; background: rgba(0,0,0,.35); border: 1px solid var(--line); }
.acct-row.can { border-color: var(--gold); box-shadow: inset 0 0 12px rgba(240,200,90,.18); }
.acct-row.ahead { opacity: .72; }
.acct-lv { font-weight: 800; color: var(--gold); font-size: 13px; }
.acct-rw { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.acct-it { display: flex; align-items: center; gap: 3px; font-size: 11px; }
.acct-it img { width: 20px; height: 20px; }
.topbar .avatar .acctb { top: -6px; right: -6px; }

/* Trials: the modes in arches (ui/trials.js) */
.modal.trials { max-width: 560px; }
.tr-hall { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 6px; align-items: end; margin: 10px 0 6px; padding: 8px 6px 0;
  background: linear-gradient(180deg, #2a2630, #15121a); border: 2px solid #050308; box-shadow: inset 0 0 0 1px #5a5060, inset 0 6px 10px rgba(0,0,0,.6); }
.tr-arch { position: relative; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 999px 999px 0 0 !important; border: 3px solid #4a4450; border-bottom: 0;
  box-shadow: inset 0 0 0 2px #050308, inset 0 10px 18px rgba(0,0,0,.7); background: #0c0a10; cursor: pointer; }
.tr-arch img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tr-arch.mid { border-color: #8a7a60; box-shadow: inset 0 0 0 2px #050308, 0 0 14px rgba(255,120,60,.25); }
.tr-arch.mid img { filter: saturate(1.2) contrast(1.05); }
.tr-arch.side img { filter: brightness(.55) saturate(.8); }
.tr-arch.soon img { filter: grayscale(1) brightness(.22); }
.tr-soon { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--dim); font-weight: 800; font-size: 12px; }
.tr-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; background: linear-gradient(90deg, rgba(90,10,20,.0), rgba(90,10,20,.55), rgba(90,10,20,0)); border-top: 1px solid #4a3a40; border-bottom: 1px solid #4a3a40; }
.tr-name span { font-family: var(--title); font-size: 20px; color: #f4e6d0; text-shadow: 0 2px 0 #000; }
.tr-arrow { background: none; border: 0; color: #c8b8a8; font-size: 18px; padding: 2px 8px; cursor: pointer; }
.tr-desc { margin: 8px 4px 0; line-height: 1.4; color: var(--muted); }
/* The Pit's screen */
.pit-art { position: relative; height: 120px; overflow: hidden; border: 2px solid #050308; box-shadow: inset 0 0 0 1px #5a4a50; }
.pit-art img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.1) brightness(.85); }
.pit-ess { position: absolute; left: 8px; bottom: 6px; display: flex; align-items: center; gap: 4px; background: rgba(0,0,0,.65); padding: 3px 8px; border: 1px solid #5a3030; }
.pit-ess b { color: #ffb070; font-size: 15px; }
.pit-card { background: rgba(0,0,0,.4); border: 1px solid var(--line); padding: 8px 10px; margin-top: 8px; }
.pit-row { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 3px 0; font-size: 14px; }
.pit-row b { color: #f4e6d0; font-size: 15px; }
.pit-gap { height: 6px; }
.pit-fx { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin: 6px 0 0 auto; background: none; border: 0; color: #ff6a5a; font-weight: 800; font-size: 14px; cursor: pointer; }
.pit-fx .pit-i { display: inline-block; width: 16px; height: 16px; line-height: 16px; text-align: center; border: 1px solid #ff6a5a; font-style: italic; font-size: 11px; }
.pit-left { margin: 2px 0 6px; font-weight: 800; }
.pit-btns { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.pit-btns .btn { min-height: 46px; }
.pit-more { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.pitfx-row { padding: 6px 2px; border-top: 1px solid rgba(176,138,72,.22); }
.pitfx-row b { color: #ff8a6a; }
.pitfx-row .small { color: var(--muted); line-height: 1.35; margin-top: 2px; }
#hud .pitw { color: #ffb070; }

/* The Constellation (ui/constellation.js) */
.modal.consw { max-width: 760px; width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 10px; }
.modal.consw > .cons-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.cons-head { display: flex; align-items: center; gap: 8px; }
.cons-ess { display: flex; align-items: center; gap: 4px; padding: 3px 8px; background: rgba(0,0,0,.5); border: 1px solid #5a3030; }
.cons-ess b { color: #ffb070; }
.cons-brs { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.cons-br { padding: 3px 6px; background: rgba(0,0,0,.45); border: 1px solid var(--line); }
.cons-brt { font-size: 12px; } .cons-brt b { font-size: 14px; }
.cons-br.fury .cons-brt b { color: #d0645a; } .cons-br.bastion .cons-brt b { color: #8ab884; } .cons-br.plunder .cons-brt b { color: #d4ab5c; }
.cons-bar { height: 4px; background: #1a1418; margin-top: 2px; } .cons-bar i { display: block; height: 100%; background: currentColor; }
.cons-br.fury .cons-bar i { background: linear-gradient(90deg,#5a1610,#a8352c); } .cons-br.bastion .cons-bar i { background: linear-gradient(90deg,#24401f,#5f8a5a); } .cons-br.plunder .cons-bar i { background: linear-gradient(90deg,#5a4012,#b8913e); }
.cons-map { flex: 1; min-height: 200px; position: relative; border: 2px solid #050308; box-shadow: inset 0 0 0 1px #3a3040; overflow: hidden; }
.cons-cv { display: block; touch-action: none; cursor: grab; }
.cons-foot { display: flex; gap: 6px; align-items: center; }
.cons-kind { text-align: center; font-weight: 800; margin-bottom: 8px; }
.cons-kind.fury { color: #d0645a; } .cons-kind.bastion { color: #8ab884; } .cons-kind.plunder { color: #d4ab5c; }
.cons-line { display: flex; justify-content: space-between; align-items: center; padding: 4px 2px; border-top: 1px solid rgba(176,138,72,.2); }
.cons-bon { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 13px; color: #9cf0a8; }
.cons-spec { display: grid; grid-template-columns: 40px 1fr; gap: 8px; align-items: center; padding: 7px 4px; border-top: 1px solid rgba(176,138,72,.2); color: var(--muted); font-size: 13px; line-height: 1.35; }
.cons-spec.on { color: #f4e6d0; }
.cons-need { text-align: center; font-weight: 800; color: var(--gold); border: 1px solid var(--line); padding: 4px 0; }
.cons-spec.on .cons-need { color: #6ae08a; border-color: #4a8a5a; }
.modal.consspec .tabs button.fury.on { color: #d0645a; } .modal.consspec .tabs button.bastion.on { color: #8ab884; } .modal.consspec .tabs button.plunder.on { color: #d4ab5c; }
.cons-ico { width: 56px; height: 56px; margin: 0 auto 6px; border-radius: 50% !important; border: 3px solid #3a3040; background: #1c1220; display: flex; align-items: center; justify-content: center; }
.cons-ico.fury { border-color: #a8352c; } .cons-ico.bastion { border-color: #5f8a5a; } .cons-ico.plunder { border-color: #b8913e; }
.cons-ico img { width: 44px; height: 44px; }
.pit-pass { position: absolute; right: 8px; bottom: 6px; display: flex; align-items: center; gap: 4px; background: rgba(0,0,0,.65); padding: 3px 8px; border: 1px solid #3a6a3a; color: #7ee89a; font-weight: 800; font-size: 13px; }
.pit-passcard { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 7px 9px; cursor: pointer; background: linear-gradient(90deg, rgba(120,20,30,.55), rgba(40,10,20,.6)); border: 1px solid #8a4a3a; }
.pit-passcard b { color: #ffd0a0; } .pit-passcard .small { color: var(--muted); }
.lbprize { margin: 6px 0; padding: 6px 8px; background: rgba(0,0,0,.35); border: 1px solid var(--line); }
.lbprize-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; margin-top: 4px; font-size: 12px; }
.lbprize-grid div { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.lbprize-grid b { color: var(--gold); }
.lbprize-grid span { display: flex; align-items: center; gap: 2px; }
/* The Pit's Mastery */
.pm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.pm-lv { min-width: 64px; text-align: center; padding: 6px 4px; background: rgba(0,0,0,.45); border: 1px solid var(--gold); }
.pm-lv b { font-size: 22px; color: var(--gold); }
.pm-bar { height: 8px; background: #1a1418; border: 1px solid #050308; } .pm-bar i { display: block; height: 100%; background: linear-gradient(90deg, #c08020, #ffd35a); }
.pm-free { text-align: center; padding: 4px 8px; background: rgba(0,0,0,.45); border: 1px solid var(--line); } .pm-free b { display: block; font-size: 18px; color: #7ee89a; }
.pm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
/* the Mastery's cards: blue, purple, gold and red, dark and worn like the rest; a full card's name turns green */
.pm-card { --c1: #2a2030; --c2: #140e18; --bd: #4a3a50; --gl: rgba(0,0,0,0); position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 5px; cursor: pointer;
  background: radial-gradient(ellipse at 50% 45%, var(--gl), transparent 62%), linear-gradient(180deg, var(--c1), var(--c2)); border: 2px solid var(--bd);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.7), inset 0 0 14px rgba(0,0,0,.6); }
.pm-card::before { content: ''; position: absolute; inset: 3px; border: 1px solid rgba(255,255,255,.07); pointer-events: none; }
.t-blue { --c1: #1e2c46; --c2: #0b111e; --bd: #3e5f92; --gl: rgba(90,140,220,.28); }
.t-purple { --c1: #301c46; --c2: #120a1e; --bd: #74489e; --gl: rgba(160,90,220,.28); }
.t-gold { --c1: #3c2c10; --c2: #160f05; --bd: #b08430; --gl: rgba(230,170,60,.3); }
.t-red { --c1: #461418; --c2: #1a0608; --bd: #a03038; --gl: rgba(220,60,60,.3); }
.pm-card.can { box-shadow: inset 0 0 0 1px rgba(0,0,0,.7), inset 0 0 14px rgba(0,0,0,.6), 0 0 9px var(--gl); }
.pm-card.can::after { content: ''; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; background: #7ee89a; box-shadow: 0 0 5px #7ee89a; }
.pm-card.zero .pm-ic { filter: grayscale(.5) brightness(.75); }
.pm-n { font-size: 11px; font-weight: 800; text-align: center; color: #f4e6d0; min-height: 26px; display: flex; align-items: center; text-shadow: 0 1px 0 #000; }
.pm-card.full .pm-n { color: #7ee89a; }
.pm-icw { padding: 3px; border-radius: 50%; background: radial-gradient(circle, rgba(0,0,0,.6), rgba(0,0,0,0) 70%); }
.pm-ic { width: 46px; height: 46px; display: block; }
.pm-cost { min-width: 20px; padding: 0 4px; font-size: 11px; font-weight: 800; text-align: center; color: #f4e6d0; background: rgba(0,0,0,.6); border: 1px solid var(--bd); margin-top: -8px; position: relative; }
.pm-lvl { font-weight: 800; font-size: 13px; color: #e8d8b8; }
.pm-card.full .pm-lvl { color: #7ee89a; }
.pmcard .modal { border-color: var(--bd); }
.cons-ico.pm-big { background: radial-gradient(circle, var(--gl), transparent 70%); }
.pm-pass { display: flex; align-items: center; gap: 8px; padding: 6px 9px; margin-bottom: 6px; cursor: pointer; background: linear-gradient(90deg, rgba(90,60,14,.6), rgba(30,18,6,.7)); border: 1px solid #b08430; }
.pm-pass .ic { width: 34px; height: 34px; } .pm-pass b { color: #ffd890; } .pm-pass .small { color: var(--muted); }
.pm-pass.on { cursor: default; justify-content: center; background: rgba(20,40,20,.55); border-color: #3a6a3a; } .pm-pass.on b { color: #7ee89a; } .pm-pass.on .ic { width: 22px; height: 22px; }
.cons-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cons-btns .btn { min-width: 0; }
.pit-more { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pit-more .btn { position: relative; min-width: 0; padding: 5px 4px; font-size: 12px; white-space: nowrap; overflow: visible; justify-content: center; }
.pit-more .btn .badge { top: -7px; right: -5px; }

/* the Constellation's zoom: a slider inside the sky, on the right */
.cons-slide { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 58%; min-height: 140px; width: 28px; display: flex; flex-direction: column; align-items: center; gap: 4px; touch-action: none; z-index: 2; }
.cons-slide b { width: 26px; height: 24px; line-height: 22px; text-align: center; font-size: 16px; color: #e8d8b8; background: rgba(10,8,14,.85); border: 1px solid #6a5838; cursor: pointer; user-select: none; }
.cons-track { position: relative; flex: 1; width: 8px; background: linear-gradient(90deg, #0c0a10, #2a2430, #0c0a10); border: 1px solid #6a5838; cursor: pointer; }
.cons-track i { position: absolute; left: 50%; width: 22px; height: 12px; transform: translate(-50%, -50%); background: linear-gradient(180deg, #e8c878, #8a6420); border: 1px solid #050308; box-shadow: 0 1px 3px rgba(0,0,0,.8); }
/* the Pit's shop, top right of its picture */
.pit-shopbtn { position: absolute; right: 6px; top: 6px; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 3px 6px 2px; background: rgba(10,6,10,.75); border: 1px solid #8a6a30; color: #ffd890; font-weight: 800; font-size: 11px; cursor: pointer; }
.pit-shopbtn .ic { width: 30px; height: 30px; }
.pit-shopbtn .badge { top: -6px; right: -6px; }
.pitshop .rs-pack.done { opacity: .6; }
/* Sweep: how many of today's entries at once */
.pit-sweep { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pit-slide { display: flex; align-items: center; gap: 6px; }
.pit-slide b { min-width: 14px; font-size: 14px; color: #ffd890; text-align: right; }
.pit-slide input { --f: 0%; flex: 1; min-width: 0; height: 18px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; }
.pit-slide input::-webkit-slider-runnable-track { height: 8px; background: linear-gradient(90deg, #3e6ea8 var(--f), #1a1418 var(--f)); border: 1px solid #050308; }
.pit-slide input::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; background: linear-gradient(180deg, #e8c878, #8a6420); border: 1px solid #050308; }
.pit-slide input::-moz-range-track { height: 8px; background: #1a1418; border: 1px solid #050308; }
.pit-slide input::-moz-range-progress { height: 8px; background: #3e6ea8; }
.pit-slide input::-moz-range-thumb { width: 16px; height: 16px; border-radius: 0; background: linear-gradient(180deg, #e8c878, #8a6420); border: 1px solid #050308; }
.pit-share { margin-top: 4px; }
.pit-btns { align-items: start; }

/* a Constellation star's panel, standing over the star in its branch's colour */
.cons-pop { --bc: #a8352c; position: absolute; z-index: 3; width: min(270px, calc(100% - 50px)); padding: 6px 8px 7px; background: linear-gradient(180deg, rgba(26,18,22,.97), rgba(12,9,12,.97));
  border: 2px solid var(--bc); box-shadow: 0 0 0 1px #050308, 0 0 14px rgba(0,0,0,.8), inset 0 0 12px rgba(0,0,0,.6); }
.cons-pop.bastion { --bc: #5f8a5a; } .cons-pop.plunder { --bc: #b8913e; }
.cp-head { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #f4e6d0; }
.cp-head .ci { width: 22px; height: 22px; } .cp-head b { flex: 1; min-width: 0; line-height: 1.15; }
.cp-x { width: 22px; height: 22px; padding: 0; background: rgba(0,0,0,.5); border: 1px solid #5a4a3a; color: #e8d8b8; font-size: 15px; line-height: 18px; cursor: pointer; }
.cp-stat { margin-top: 4px; font-size: 13px; color: #f0dcb0; display: flex; align-items: center; gap: 2px; } .cp-stat .ci { width: 13px; height: 13px; }
.cp-stat .muted { font-size: 11px; }
.cp-tot { font-size: 11px; color: #b8a890; margin: 1px 0 6px 16px; }
.cp-row { display: flex; align-items: center; gap: 6px; }
.cp-b { width: 32px; height: 30px; padding: 0; font-size: 19px; font-weight: 800; line-height: 26px; cursor: pointer; border: 1px solid #050308; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), inset 0 -2px 0 rgba(0,0,0,.35); }
.cp-b.minus { background: linear-gradient(180deg, #6a5e62, #3a3236); } .cp-b.plus { background: linear-gradient(180deg, #4e8a3e, #2a5420); } .cp-b.max { background: linear-gradient(180deg, #c8902a, #7a5414); font-size: 16px; }
.cp-b.off { filter: grayscale(.8) brightness(.55); }
.cp-r { min-width: 34px; text-align: center; font-weight: 800; font-size: 15px; color: #f4e6d0; }
.cp-cost { margin-left: auto; display: flex; align-items: center; gap: 3px; font-size: 14px; } .cp-cost b { color: #f4e6d0; } .cp-cost b.bad { color: #e06a5a; } .cp-cost .ci { width: 16px; height: 16px; }

/* the Pit's panel, top right under the counters: Essence, the wave and its kills, the combo */
#hud .pitbar { position: absolute; top: calc(var(--safe-t) + 54px); right: 8px; width: 156px; pointer-events: none; text-shadow: 0 1px 0 #000, 0 0 4px #000; }
#hud .pb-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; font: 700 12px var(--num); color: #f4e6d0; }
#hud .pb-ess { display: flex; align-items: center; gap: 3px; } #hud .pb-ess .ci { width: 15px; height: 15px; } #hud .pb-ess b { color: #ffb070; }
#hud .pb-bar { height: 7px; margin-top: 3px; background: rgba(10,6,8,.8); border: 1px solid #050308; box-shadow: inset 0 0 0 1px #4a3a30; }
#hud .pb-bar i { display: block; height: 100%; background: linear-gradient(180deg, #ffd890, #e08a2a 60%, #a04a10); transition: width .15s; }
#hud .pb-combo { margin-top: 6px; text-align: right; }
#hud .pb-ct { font: italic 800 14px var(--title, serif); color: #f4e6d0; letter-spacing: .5px; }
#hud .pb-n { font: italic 900 24px var(--num); line-height: 1; color: #fff; text-shadow: 0 2px 0 #000, 0 0 8px rgba(200,40,30,.8); }
#hud .pb-cbar { height: 5px; width: 74px; margin: 3px 0 2px auto; background: rgba(10,6,8,.8); border: 1px solid #050308; }
#hud .pb-cbar i { display: block; height: 100%; background: linear-gradient(90deg, #8a1a10, #ff5a30); box-shadow: 0 0 5px #ff5a30; }
#hud .pb-skip { font: 800 12px var(--num); color: #c8b8a0; } #hud .pb-skip.on { color: #7ee89a; }

/* a Mastery card's panel, over the card in its colour, with − and + coming down on the card's top edge */
.pm-root { position: relative; }
.pm-card.sel { outline: 2px solid #f4e6d0; outline-offset: 1px; }
.pm-pop { position: absolute; z-index: 5; filter: drop-shadow(0 4px 10px rgba(0,0,0,.85)); }
.pp-panel { position: relative; padding: 8px 10px 9px; background: linear-gradient(180deg, var(--c1), var(--c2)); border: 2px solid var(--bd); box-shadow: inset 0 0 0 1px rgba(0,0,0,.7), inset 0 0 18px rgba(0,0,0,.55); }
.pp-x { position: absolute; top: -12px; right: -10px; width: 28px; height: 28px; padding: 0; font-size: 20px; font-weight: 900; line-height: 24px; color: #fff; cursor: pointer;
  background: linear-gradient(180deg, #c03030, #7a1418); border: 1px solid #050308; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.pp-t { font: 800 18px var(--title, serif); color: #fff; text-shadow: 0 2px 0 #000; padding-right: 16px; line-height: 1.1; }
.pp-lv { margin-top: 2px; font-weight: 800; font-size: 13px; color: #7ee89a; }
.pp-d { margin-top: 5px; font-size: 14px; line-height: 1.3; color: #f4e6d0; } .pp-d b.good { color: #7ee89a; }
.pp-next { margin-top: 3px; font-size: 12px; color: #b8a890; } .pp-next b.good { color: #a8f0b8; }
.pp-cost { margin-top: 8px; font-weight: 800; font-size: 13px; color: #f08a90; }
.pp-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.pp-b { height: 36px; padding: 0; font-size: 26px; font-weight: 900; line-height: 30px; color: #fff; cursor: pointer; border: 1px solid #050308;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 -3px 0 rgba(0,0,0,.35); text-shadow: 0 2px 0 rgba(0,0,0,.6); }
.pp-b.minus { background: linear-gradient(180deg, #c03a3a, #7a1418); } .pp-b.plus { background: linear-gradient(180deg, #7ab83a, #3e6e18); }
.pp-b.off { filter: grayscale(.85) brightness(.55); }

/* ===== the Trials' own pieces in the game's gothic skin (stone texture, black outline, bronze ring, hard bevel, forged corners) ===== */
.gframe, .pm-pop .pp-panel, .cons-pop, .pm-pass, .pit-passcard, .pm-lv, .pm-free, .pit-shopbtn {
  border: 2px solid #050308; background: var(--tex-panel, none) 0 0 / 64px 64px, #1b1320;
  box-shadow: inset 0 0 0 2px var(--ring), inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 3px 0 #000; }
/* the Mastery's cards: their gothic ground (ui.masteryCardArt), a ring in the tier's colour, forged corners */
.pm-card { background: var(--corner-tl) 0 0 / 14px 14px no-repeat, var(--corner-tr) 100% 0 / 14px 14px no-repeat, var(--corner-bl) 0 100% / 14px 14px no-repeat, var(--corner-br) 100% 100% / 14px 14px no-repeat, var(--art) 0 0 / 100% 100% no-repeat, var(--c2);
  image-rendering: pixelated; border: 2px solid #050308; padding: 5px 4px 6px;
  box-shadow: inset 0 0 0 2px var(--bd), inset 4px 4px 0 0 rgba(255,230,200,.08), inset -4px -4px 0 0 rgba(0,0,0,.45), 0 3px 0 #000; }
.pm-card::before { display: none; }
.pm-card.can { box-shadow: inset 0 0 0 2px var(--bd), inset 4px 4px 0 0 rgba(255,230,200,.08), inset -4px -4px 0 0 rgba(0,0,0,.45), 0 3px 0 #000, 0 0 0 2px rgba(126,232,154,.55); }
.pm-card.can::after { top: 6px; right: 6px; width: 6px; height: 6px; box-shadow: 0 0 0 1px #050308; }
.pm-card.sel { outline: 2px solid #e8c878; outline-offset: 0; }
.pm-n { min-height: 24px; font-family: var(--title, serif); font-size: 11px; letter-spacing: .02em; }
.pm-icw { margin-top: 4px; padding: 0; background: none; }
.pm-ic { width: 44px; height: 44px; }
.pm-cost { margin-top: -6px; min-width: 18px; font: 9px var(--num); line-height: 14px; background: #0c080e; border: 2px solid #050308; box-shadow: inset 0 0 0 1px var(--bd); }
.pm-lvl { margin-top: 4px; font: 10px var(--num); }
.pm-bar { height: 10px; border: 2px solid #050308; background: #0c080e; box-shadow: inset 0 0 0 1px var(--ring); }
.pm-bar i { background: linear-gradient(180deg, #fff0b8 0 20%, #eab044 20% 60%, #a06a18 60%); }
.pm-lv { border-color: #050308; } .pm-lv b { font-family: var(--num); font-size: 16px; }
.pm-free b { font-family: var(--num); font-size: 14px; }
/* a card's panel */
.pm-pop .pp-panel { padding: 9px 10px 10px; box-shadow: inset 0 0 0 2px var(--bd), inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 3px 0 #000;
  background: var(--corner-tl) 0 0 / 14px 14px no-repeat, var(--corner-bl) 0 100% / 14px 14px no-repeat, var(--corner-br) 100% 100% / 14px 14px no-repeat,
    linear-gradient(180deg, color-mix(in srgb, var(--c1) 70%, transparent), color-mix(in srgb, var(--c2) 85%, transparent)), var(--tex-panel, none) 0 0 / 64px 64px, #1b1320; }
.pm-pop .pp-panel .x { top: -14px; right: -12px; }
.pp-t { font-family: var(--title, serif); font-size: 17px; letter-spacing: .02em; }
.pp-lv { font: 10px var(--num); margin-top: 4px; }
.pp-cost { color: #e8848a; }
.pp-btns { gap: 6px; margin-top: 4px; }
.pp-b.btn { min-height: 36px; padding: 0; font-size: 24px; line-height: 1; }
/* the Mastery Pass */
.pm-pass { box-shadow: inset 0 0 0 2px var(--ring-gold), inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 3px 0 #000; }
.pm-pass.on { box-shadow: inset 0 0 0 2px #3a6a3a, inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 3px 0 #000; }
.pit-passcard { box-shadow: inset 0 0 0 2px #8a3a3a, inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 3px 0 #000; }
/* the Constellation's star panel and its zoom */
.cons-pop { padding: 8px 9px 9px; box-shadow: inset 0 0 0 2px var(--bc), inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 3px 0 #000, 0 6px 14px rgba(0,0,0,.7);
  background: var(--corner-tl) 0 0 / 14px 14px no-repeat, var(--corner-bl) 0 100% / 14px 14px no-repeat, var(--corner-br) 100% 100% / 14px 14px no-repeat, var(--tex-panel, none) 0 0 / 64px 64px, #1b1320; }
.cons-pop .x { top: -14px; right: -12px; }
.cp-head b { font-family: var(--title, serif); font-size: 14px; }
.cp-b.btn { width: 34px; min-height: 30px; padding: 0; font-size: 19px; line-height: 1; }
.cp-r { font: 11px var(--num); }
.cons-slide b.btn { width: 28px; min-height: 26px; padding: 0; font-size: 16px; line-height: 1; }
.cons-track { width: 10px; border: 2px solid #050308; background: var(--tex-dark, none) 0 0 / 64px 64px, #0c080e; box-shadow: inset 0 0 0 1px var(--ring); }
.cons-track i { width: 24px; height: 12px; border: 2px solid #050308; box-shadow: inset 2px 2px 0 0 rgba(255,255,255,.3), inset -2px -2px 0 0 rgba(0,0,0,.35);
  background: linear-gradient(180deg, #fff0b8 0 15%, #eab044 15% 60%, #a06a18 60%); }
/* the Pit's shop door and its sweep slider */
.pit-shopbtn { box-shadow: inset 0 0 0 2px var(--ring-gold), inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 3px 0 #000; padding: 4px 7px 3px; }
.pit-slide input::-webkit-slider-runnable-track { height: 10px; border: 2px solid #050308; background: linear-gradient(90deg, #3066c0 var(--f), #0c080e var(--f)); box-shadow: inset 0 0 0 1px var(--ring); }
.pit-slide input::-webkit-slider-thumb { width: 16px; height: 18px; margin-top: -6px; border: 2px solid #050308; background: linear-gradient(180deg, #fff0b8 0 15%, #eab044 15% 60%, #a06a18 60%); box-shadow: inset 2px 2px 0 0 rgba(255,255,255,.3); }
/* the Pit's panel in a fight: hard-banded bars */
#hud .pb-bar { height: 9px; border: 2px solid #050308; box-shadow: inset 0 0 0 1px #6a5030; }
#hud .pb-bar i { background: linear-gradient(180deg, #ffe0a0 0 25%, #e08a2a 25% 65%, #a04a10 65%); transition: none; }
#hud .pb-cbar { height: 6px; border: 2px solid #050308; }
#hud .pb-cbar i { background: linear-gradient(180deg, #ff9a70 0 30%, #e0402a 30% 70%, #8a1a10 70%); box-shadow: none; }
#hud .pb-ct, #hud .pb-n { font-family: var(--title, serif); font-style: normal; }
.pm-n { text-shadow: 1px 1px 0 #000, -1px 0 0 #000, 0 -1px 0 #000, 0 0 4px #000; }
.pm-icw { margin-top: 8px; }
.pit-sweep .btn { font-size: 14px; padding: 0 6px; }

.pit-fx { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin: 6px 0 0 auto; color: #ff6a5a; font-weight: 800; font-size: 14px; }
.pit-more .btn { gap: 3px; padding: 4px 3px; font-size: 11px; letter-spacing: 0; }
.pit-more .btn img.ic.ci { width: 14px; height: 14px; }
.pm-head .infob { align-self: center; }
/* the Pit's shop door: a square, the Essence above its name */
.pit-shopbtn { width: 62px; height: 62px; padding: 4px 2px 3px; justify-content: center; gap: 1px; box-sizing: border-box; }
.pit-shopbtn .ic { width: 32px; height: 32px; }
.pit-shopbtn span { font-size: 11px; line-height: 1; }

/* the Constellation: its loadouts row and the full-width buttons below */
.cons-load { display: flex; align-items: center; gap: 5px; margin: 6px 0; }
.cons-ll { font: 800 11px var(--title, serif); letter-spacing: .06em; text-transform: uppercase; color: var(--gold); flex: none; }
.cons-sel { flex: 1; min-width: 0; height: 32px; padding: 0 6px; border: 2px solid #050308; background: var(--tex-dark, none) 0 0 / 64px 64px, #120c16; color: #f4e6d0;
  box-shadow: inset 0 0 0 1px var(--ring); font-weight: 800; font-size: 13px; }
.cl-b.btn { width: 32px; min-width: 32px; min-height: 32px; padding: 0; font-size: 16px; line-height: 1; flex: none; }
.cons-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cons-foot .btn { width: 100%; min-width: 0; }
.consren .field { margin-bottom: 10px; }

/* the Trials' arches: square stone frames with forged corners, the picture in big pixels */
.tr-arch { border: 2px solid #050308 !important; background: #0b080d; image-rendering: pixelated;
  box-shadow: inset 0 0 0 2px var(--ring), 0 3px 0 #000 !important; }
.tr-arch.mid { box-shadow: inset 0 0 0 2px var(--ring-gold), 0 0 12px rgba(255,120,60,.3), 0 3px 0 #000 !important; }
.tr-arch img { image-rendering: pixelated; }
.tr-arch::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: var(--corner-tl) 0 0 / 14px 14px no-repeat, var(--corner-tr) 100% 0 / 14px 14px no-repeat, var(--corner-bl) 0 100% / 14px 14px no-repeat, var(--corner-br) 100% 100% / 14px 14px no-repeat; }
.tr-soon { z-index: 2; }
/* the Pit's picture on its own screen: the same, in a stone frame with forged corners */
.pit-art { image-rendering: pixelated; border: 2px solid #050308; box-shadow: inset 0 0 0 2px var(--ring-gold), 0 3px 0 #000; }
.pit-art img { image-rendering: pixelated; object-position: 50% 62%; filter: none; }
.pit-art::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: var(--corner-tl) 0 0 / 14px 14px no-repeat, var(--corner-tr) 100% 0 / 14px 14px no-repeat, var(--corner-bl) 0 100% / 14px 14px no-repeat, var(--corner-br) 100% 100% / 14px 14px no-repeat; }

/* the Pit's start screen */
.modal.pitintro { text-align: center; }
.pi-art { display: flex; justify-content: center; }
.pi-art .tr-arch { width: 92px; aspect-ratio: 2 / 3; position: relative; overflow: hidden; }
.pi-t { margin-top: 6px; font: 900 26px var(--title, serif); color: var(--gold); text-shadow: 0 2px 0 #000, 0 0 10px rgba(255,120,60,.35); }
.pi-wave { font: 800 20px var(--title, serif); color: #f4e6d0; text-shadow: 0 2px 0 #000; }
.pi-sub { margin-top: 10px; font: 800 13px var(--title, serif); letter-spacing: .08em; text-transform: uppercase; color: #e8848a; }
.pi-fx { display: flex; justify-content: center; gap: 10px; margin: 6px 0 4px; }
.pi-f { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 92px; padding: 6px 4px; cursor: pointer; color: #f4e6d0; font-weight: 800; font-size: 11px;
  border: 2px solid #050308; background: var(--tex-panel, none) 0 0 / 64px 64px, #1b1320; box-shadow: inset 0 0 0 2px #8a2a2a, inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 3px 0 #000; }
.pi-f img { width: 40px; height: 40px; }
.pi-go { margin-top: 10px; }
.pitfx-row { display: flex; gap: 8px; align-items: flex-start; } .pitfx-row > img.ci { width: 28px; height: 28px; flex: none; }

/* the Constellation's corner: the shop and the stats, square stone buttons in the sky */
.cons-corner { position: absolute; right: 6px; bottom: 4px; display: flex; gap: 8px; z-index: 2; align-items: flex-start; }
.cons-cbw { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.cons-cbl { color: #f4e6d0; font-weight: 800; font-size: 11px; line-height: 1.1; text-align: center; white-space: nowrap; text-shadow: 0 1px 0 #000, 0 0 4px #000, 0 0 8px #000; pointer-events: none; }
.cons-cb { position: relative; width: 54px; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 3px 2px; cursor: pointer;
  color: #f4e6d0; font-weight: 800; font-size: 10px; line-height: 1; border: 2px solid #050308; background: var(--tex-panel, none) 0 0 / 64px 64px, #1b1320;
  box-shadow: inset 0 0 0 2px var(--ring-gold), inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 3px 0 #000; }
.cons-cb img { width: 36px; height: 36px; } .cons-cb .badge { top: -6px; right: -6px; }
.cons-slide { top: 42%; height: 46%; }

/* the Specialties: icons of the branches; every tab's list in one cell so the window keeps its height */
.cons-sls { display: grid; }
.cons-sls > .cons-sl { grid-area: 1 / 1; }
.cons-sls > .cons-sl.hid { visibility: hidden; }
.cons-spec { grid-template-columns: 22px 40px 1fr; }
.cons-spec > img.ci { width: 22px; height: 22px; }
.cons-spec:not(.on) > img.ci { filter: grayscale(.8) brightness(.6); }
.cons-spent img.ci, .modal.consspec .tabs img.ci { width: 18px; height: 18px; vertical-align: -4px; }
.cons-brt img.ci { width: 16px; height: 16px; vertical-align: -3px; margin-right: 3px; }

/* the boards' tabs as the game's buttons: black outline, cut corners, banded faces; the chosen one gold */
.lbtabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.lbtabs .chip { min-height: 34px; padding: 4px 6px; font: 800 12px var(--body); line-height: 1.15; color: #f4e6d0; text-shadow: 1px 1px 0 rgba(0,0,0,.7);
  border: 2px solid #050308 !important; clip-path: var(--notch); background: linear-gradient(180deg, #6a5872 0 8%, #4e3e58 8% 50%, #3a2c42 50% 86%, #281e2e 86%);
  box-shadow: inset 2px 2px 0 0 rgba(255,255,255,.18), inset -2px -2px 0 0 rgba(0,0,0,.35); }
.lbtabs .chip.on { color: #2a1604; text-shadow: 1px 1px 0 rgba(255,240,190,.5); background: linear-gradient(180deg, #fff0b8 0 8%, #ffd76a 8% 42%, #eab044 42% 72%, #c08428 72% 88%, #8a5a18 88%); }
.lbtabs .chip:active { transform: translateY(2px); }

/* the pass: the head's buttons in one row; the price to buy the next level on its node */
.ph-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
.ph-acts > * { min-width: 0; } .ph-acts .btn { width: 100%; padding: 0 6px; }
.pass-list .pass-row .tier { overflow: visible; }
.pass-buy { position: absolute; z-index: 2; top: -19px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 2px 6px 2px 3px; cursor: pointer; white-space: nowrap;
  border: 2px solid #050308; clip-path: var(--notch); color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,.7);
  background: linear-gradient(180deg, #f090f0 0 8%, #c050c8 8% 50%, #9a34a8 50% 86%, #62186e 86%); box-shadow: inset 2px 2px 0 0 rgba(255,255,255,.18), inset -2px -2px 0 0 rgba(0,0,0,.35); }
.pass-buy img.ci { width: 13px; height: 13px; } .pass-buy .pb-c { font: 9px var(--num); line-height: 1; }
/* badges always on top, never clipped: the Mastery button drops its cut corners (they clipped the badge), the Pit's
   picture lets its shop door's badge out over its frame and corners */
.pit-more .btn { clip-path: none; }
.pit-more .btn .badge, .pit-shopbtn .badge, .cons-cb .badge { z-index: 5; }
.pit-art { overflow: visible; }
.pit-shopbtn { z-index: 3; }

/* a Mastery card the level has not reached: grey, a lock over it, the level it needs under the lock */
.pm-card.locked { filter: grayscale(1) brightness(.62); }
.pm-card.locked .pm-ic { filter: none; }
.pm-lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; pointer-events: none; background: rgba(0,0,0,.35); }
.pm-lock img { width: 34px; height: 34px; filter: drop-shadow(0 2px 0 #000); }
.pm-lock b { font: 800 13px var(--title, serif); color: #f4e6d0; text-shadow: 0 1px 0 #000, 0 0 4px #000; background: rgba(0,0,0,.65); padding: 1px 6px; border: 1px solid #050308; }
.pp-cost img.ci { width: 14px; height: 14px; vertical-align: -2px; }
.pp-b .pp-gem { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; font: 9px var(--num); } .pp-b .pp-gem img.ci { width: 12px; height: 12px; }
.pm-card.locked .pm-cost { visibility: hidden; }
/* the Pit's 3-2-1 before the fight */
.pit-count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 40; background: radial-gradient(circle, rgba(0,0,0,0) 30%, rgba(0,0,0,.45) 100%); }
.pit-count b { font-family: var(--title); font-size: clamp(90px, 34vw, 180px); color: var(--blood-hi); text-shadow: 0 5px 0 #000, 0 0 40px rgba(226,56,74,.9), 0 0 90px rgba(255,120,40,.5); animation: pitcount .8s ease-out forwards; }
@keyframes pitcount { 0% { transform: scale(2.2); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 75% { transform: scale(.92); opacity: 1; } 100% { transform: scale(.7); opacity: 0; } }
/* the Pit's AUTO button (level-ups and tomes chosen by themselves), under the wave bar */
.pb-autorow { display: flex; justify-content: flex-end; margin-top: 4px; }
#hud .pause.autobtn { width: auto; height: 26px; padding: 0 8px 0 4px; gap: 3px; clip-path: none; border-radius: 7px; } /* (the size it had before the stone: small, out of the way) */
#hud .pause.autobtn > img { width: 18px; height: 18px; opacity: .6; filter: drop-shadow(0 1px 0 #000) grayscale(.75) brightness(.8); }
#hud .autobtn b { font-family: var(--title); font-size: 12px; letter-spacing: .08em; color: #8a7c6a; text-shadow: 0 1px 0 #000, 0 -1px 0 rgba(0,0,0,.6); }
#hud .pause.autobtn.on { box-shadow: inset 0 0 0 2px #e0b050, inset 3px 3px 0 0 var(--hi), inset -3px -3px 0 0 var(--lo), 0 0 10px rgba(240,190,90,.4), 0 2px 0 #000;
  background: radial-gradient(90% 120% at 50% 125%, rgba(255,170,70,.32), transparent 62%), linear-gradient(180deg, rgba(34,24,40,.35), rgba(12,8,14,.62)), var(--tex-stone, none) 0 0 / 64px 64px, #1a1220; }
#hud .pause.autobtn.on > img { opacity: 1; filter: drop-shadow(0 1px 0 #000) drop-shadow(0 0 3px rgba(255,200,90,.6)); }
#hud .autobtn.on b { color: var(--gold); }
.autotag i { width: 8px; height: 8px; transform: rotate(45deg); background: #b8f080; border: 1px solid #e0ffc0; box-shadow: 0 0 6px #9ae070; flex: none; }
/* the AUTO window: each half a stone row, gold-ringed when on */
.automenu .auto-rows { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
.automenu .gf.auto-row { height: auto; min-height: 58px; justify-content: flex-start; gap: 10px; padding: 8px 12px; text-align: left; width: 100%; color: inherit; font: inherit; }
/* the Settings' switch, not the filter's corner mark */
.automenu .auto-row .switch { position: relative; right: auto; bottom: auto; }
.automenu .auto-row .t { font-family: var(--title); font-size: 15px; color: #d8c8a8; }
.automenu .auto-row .d { font-size: 12px; color: #9a8c7c; }
.automenu .auto-row.on .t { color: var(--gold); }
.autopick { gap: 6px; }
.autotag { display: inline-flex; align-items: center; gap: 5px; font-family: var(--title); font-size: 11px; letter-spacing: .1em; color: var(--gold); text-shadow: 0 1px 0 #000;
  padding: 2px 7px; margin-right: 6px; background: linear-gradient(180deg, #2a2030, #120c14); box-shadow: inset 0 0 0 1px #e0b050; }
/* the Deeds' categories: the name, its count under it (five tabs fit a phone) */
.tabs.small.dcat button { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; padding: 4px 2px; min-width: 0; }
.tabs.small.dcat button small { font-size: 10px; opacity: .8; }
/* a call to the server on its way (ui.act, after a quarter of a second) */
body.srvbusy::after { content: ''; position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px); left: 50%; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; border: 3px solid rgba(240,200,96,.25); border-top-color: var(--gold); box-shadow: 0 0 8px rgba(0,0,0,.8); animation: srvspin .7s linear infinite; z-index: 9999; pointer-events: none; }
@keyframes srvspin { to { transform: rotate(360deg); } }
/* the sign-in calendar: a day's whole row takes what it has ready; a tab with something to take carries a red dot */
.si-row.can { cursor: pointer; box-shadow: inset 0 0 0 2px #ffd060, 0 0 10px rgba(255,200,80,.45); }
.si-row.can:active { filter: brightness(1.15); }
.modal.signin .si-tabs button { position: relative; }
/* the runes' buffs: exactly the ability icons' box (32 x 32, 4 apart); the frame that runs out with the time takes the place
   of their thin gold ring, inside the same black 2 px border, so both rows show the same size; the seconds inside */
#hud .buffs { top: calc(118px + var(--safe-t)); gap: 4px; }
#hud .buffs .bf { position: relative; box-sizing: border-box; width: 32px; height: 32px; padding: 2px; border: 2px solid #050308; border-radius: 0; box-shadow: none; background: conic-gradient(var(--bfc, #e8c870) var(--p, 360deg), rgba(0,0,0,.6) 0); }
#hud .buffs .bf .bfi { position: relative; box-sizing: border-box; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background: #120c16; border: 0; }
#hud .buffs .bf .bfi img { width: 20px; height: 20px; margin-top: -5px; filter: brightness(1.35) saturate(1.2); }
#hud .buffs .bf .bfi b { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; font: 9px/1 var(--num); color: #fff; text-shadow: 0 0 2px #000, 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000; }
#hud .buffs .bf.fury { --bfc: #ff3a30; } #hud .buffs .bf.haste { --bfc: #ffd040; } #hud .buffs .bf.wraith { --bfc: #80e8ff; }
.modal.startbonus .sb-no { margin-top: 8px; }
.sb-art img { image-rendering: auto; }
/* the Dungeon, during a fight: its bar (a vault turns it gold), the clock standing still, the fade down the stairs */
#hud .dunbar.vault .pb-bar i { background: linear-gradient(90deg, #8a5a10, #ffd35a); }
#hud .dunbar.vault .pb-wave { color: #ffd35a; }
#hud .timer.paused { color: #b8c4d8; opacity: .8; }
.dun-fade { position: absolute; inset: 0; z-index: 45; background: #000; opacity: 0; transition: opacity .4s ease; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.dun-fade.on { opacity: 1; }
.dun-fade-t { font-family: var(--title); font-size: 24px; color: #d8c8b0; text-shadow: 0 2px 0 #000, 0 0 18px rgba(200,40,30,.6); letter-spacing: 1px; text-align: center; padding: 0 20px; }
.dun-rule { margin: 8px 0 4px; color: #c8b898; }
#hud .dunbar { width: 176px; }
/* the Dungeon's window */
.dun-art { height: 132px; }
.dun-art img { object-position: 50% 58%; }
.dun-fx { position: absolute; top: 6px; right: 8px; text-align: right; color: #f4e6d0; text-shadow: 0 1px 0 #000, 0 0 4px #000; z-index: 2; }
.dun-fxi { display: flex; gap: 4px; justify-content: flex-end; margin-top: 2px; }
.dun-fxi button { width: 30px; height: 30px; padding: 2px; background: #1a0608; border: 2px solid #b02a2a; cursor: pointer; }
.dun-fxi img { width: 100%; height: 100%; image-rendering: pixelated; }
.dun-far { position: absolute; right: 8px; bottom: 6px; z-index: 2; width: 44px; height: 30px; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer;
  border: 2px solid #050308; background: linear-gradient(rgba(255,230,200,.06), rgba(0,0,0,.45)), var(--tex-stone, none) center / 40px 40px, #3a3036;
  box-shadow: inset 0 0 0 1px var(--ring-gold), inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo), 0 2px 0 #000; }
.dun-far img.ic.ci { width: 16px; height: 16px; margin: 0 -3px; }
/* the levels' strip: a slab of dark stone in a gold ring with the corner pieces; each level a small lancet of carved stone
   in a bronze frame, the chosen one glowing like an ember, the next to enter with a gold number, the shut ones sunk in shadow */
.dun-strip { position: relative; display: flex; align-items: center; gap: 4px; margin: 8px 0 0; padding: 8px 6px 7px;
  border: 2px solid #050308; background: radial-gradient(ellipse at 50% 0%, rgba(160,40,30,.16), rgba(0,0,0,0) 70%), var(--tex-dark, none) 0 0 / 64px 64px, #120c14;
  box-shadow: inset 0 0 0 2px var(--ring-gold), inset 4px 4px 0 0 var(--hi), inset -4px -4px 0 0 var(--lo), 0 3px 0 #000; }
.dun-strip::after { content: ''; position: absolute; inset: -3px; pointer-events: none; image-rendering: pixelated;
  background: var(--corner-tl, none) 0 0 / 18px 18px no-repeat, var(--corner-tr, none) 100% 0 / 18px 18px no-repeat, var(--corner-bl, none) 0 100% / 18px 18px no-repeat, var(--corner-br, none) 100% 100% / 18px 18px no-repeat; }
.dun-arr { width: 28px; height: 40px; flex: none; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 1;
  border: 2px solid #050308; background: linear-gradient(rgba(255,230,200,.06), rgba(0,0,0,.45)), var(--tex-stone, none) center / 40px 40px, #3a3036;
  box-shadow: inset 0 0 0 1px var(--ring-gold), inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo), 0 2px 0 #000; }
.dun-arr img.ic.ci { width: 16px; height: 16px; margin: 0; }
.dun-arr:active, .dun-far:active { transform: translateY(1px); filter: brightness(1.2); }
.dun-tiles { flex: 1; min-width: 0; display: flex; gap: 5px; z-index: 1; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; touch-action: pan-x; padding-top: 1px; }
.dun-tiles::-webkit-scrollbar { display: none; }
.dun-tiles > .dun-tile { flex: 0 0 calc((100% - 20px) / 5); scroll-snap-align: center; } /* five to the strip's width, as before; the rest a swipe away */
.dun-tile { position: relative; height: 58px; padding: 0; background: none; border: 0; cursor: pointer; color: #e8dcc4; }
.dun-tile .dun-frame, .dun-tile .dun-face { position: absolute; clip-path: polygon(0 100%, 0 36%, 7% 22%, 20% 10%, 50% 0, 80% 10%, 93% 22%, 100% 36%, 100% 100%); }
.dun-tile .dun-frame { inset: 0; background: linear-gradient(#e8c478, #9a7030 45%, #4a3014 100%); }
.dun-tile .dun-face { inset: 2px 2px 2px; background: radial-gradient(ellipse at 50% 22%, rgba(255,226,180,.14), rgba(0,0,0,0) 60%), linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.6)), var(--tex-stone, none) center / 36px 36px, #3e343a; }
.dun-tile .dun-face::after { content: ''; position: absolute; inset: 0; box-shadow: inset 2px 2px 0 rgba(255,236,210,.14), inset -2px -2px 0 rgba(0,0,0,.5); }
.dun-tile b { position: relative; z-index: 1; display: block; padding-top: 18px; font: 700 20px/1 var(--title); color: #e8dcc4; text-shadow: 0 2px 0 #000, 0 0 6px rgba(0,0,0,.8); }
.dun-tile.next b { color: #ffd35a; }
.dun-tile.done b { color: #d8ccb4; }
.dun-tile.on { filter: drop-shadow(0 0 5px rgba(255,70,40,.85)); }
.dun-tile.on .dun-frame { background: linear-gradient(#ffb07a, #d0381e 45%, #5a0a06 100%); }
.dun-tile.on .dun-face { background: radial-gradient(ellipse at 50% 30%, rgba(255,110,60,.32), rgba(0,0,0,0) 65%), linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.55)), var(--tex-stone, none) center / 36px 36px, #4a2a26; }
.dun-tile.on b { color: #fff0d0; }
.dun-tile.shut { cursor: default; }
.dun-tile.shut .dun-frame { background: linear-gradient(#5a4a3a, #2a2018); }
.dun-tile.shut .dun-face { filter: brightness(.42) saturate(.5); }
.dun-tile.shut b { color: #6a6068; }
.dun-tick { position: absolute; z-index: 1; left: 50%; bottom: 2px; transform: translateX(-50%); font: 900 15px/1 sans-serif; font-style: normal; color: #5ae070; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 0 3px #000; }
.dun-cup { position: absolute; z-index: 2; right: -3px; bottom: -3px; width: 18px; height: 18px; image-rendering: pixelated; filter: drop-shadow(0 1px 0 #000); }
.dun-card { margin-top: 8px; }
.dun-map { font-weight: 800; }
.dun-map.m-crypt { color: #c8b8e8; } .dun-map.m-abyss { color: #ff8a5a; } .dun-map.m-aqueduct { color: #7ae0c8; } .dun-map.m-catacombs { color: #8ac8ff; }
.dun-map.m-discord { color: #c88aff; } .dun-map.m-blightmire { color: #9ad860; } .dun-map.m-reliquary { color: #ffd35a; }
.dun-rw { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 4px 0 2px; }
.dun-rwi { width: 54px; text-align: center; }
.dun-rwi .slot { width: 46px; height: 46px; margin: 0 auto; }
.dun-rwi .n { font-size: 12px; font-weight: 800; color: #f4e6d0; margin-top: 2px; }
.dun-rwi.first .slot { box-shadow: 0 0 0 2px #ffd35a, 0 0 8px rgba(255,211,90,.5); }
.dun-leap { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
#hud .dunbar { top: calc(var(--safe-t) + 110px); }
#hud .dunbar .pb-autorow { align-items: center; justify-content: space-between; }
#hud .db-wave { font-family: var(--title); font-size: 12px; color: #e8d8c0; letter-spacing: .04em; }
#hud .autohall { position: absolute; top: calc(var(--safe-t) + 110px); right: 8px; z-index: 3; }
/* the Dungeon's window in one screen, no scrolling: a lower picture, the day in a 2×2 grid, the catacombs and Lord on one
   line, the rewards in one row of small slots */
.dunwin .dun-art { height: 84px; }
.dunwin .dun-strip { margin-top: 6px; padding: 6px 6px 5px; }
.dunwin .dun-tile { height: 50px; }
.dunwin .dun-tile b { padding-top: 15px; font-size: 18px; }
.dunwin .dun-card { margin-top: 6px; padding: 6px 8px; }
.dun-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; }
.dun-cell { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 5px; font-size: 12px; min-width: 0; }
.dun-cell span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c8b898; }
.dun-cell b { color: #f4e6d0; font-size: 13px; }
.dun-cell img.ic.ci, .dun-where img.ic.ci, .dun-rwh img.ic.ci { width: 16px; height: 16px; }
.dun-cell.bad b { color: var(--blood-hi); }
.dun-where { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 5px; padding-top: 5px; border-top: 1px solid rgba(255,230,200,.08); font-size: 13px; font-weight: 800; color: #f4e6d0; flex-wrap: wrap; }
.dun-where i { font-style: normal; color: #6a5a50; margin: 0 2px; }
.dun-rwh { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 5px; font-size: 12px; color: #c8b898; }
.dunwin .dun-rw { gap: 3px; margin: 3px 0 0; flex-wrap: wrap; }
.dunwin .dun-rwi { width: 40px; }
.dunwin .dun-rwi .slot { width: 36px; height: 36px; }
.dunwin .dun-rwi .n { font-size: 11px; white-space: nowrap; }
.dunwin .dun-leap { margin-top: 5px; }
.dunwin .mact { margin-top: 6px; }
.dun-where .dw { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.dun-where { gap: 4px 14px; }
.dunwin .dun-far { left: 8px; right: auto; }
.dunwin .dun-fxi button { width: 26px; height: 26px; }
/* the Pit's and the Dungeon's windows: one size, the same picture, and nothing moves when the level changes: the window is a
   fixed column, its picture gives way first on a short screen, the rewards keep room for two rows */
.modal.pitwin, .modal.dunwin { height: min(720px, 100%); display: flex; flex-direction: column; }
.modal.pitwin > .mhead, .modal.dunwin > .mhead, .modal.pitwin > .mdock, .modal.dunwin > .mdock, .modal.pitwin > .mfoot, .modal.dunwin > .mfoot { flex: none; }
.modal.pitwin > div:not(.mhead):not(.mdock):not(.mfoot), .modal.dunwin > .dun-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: space-between; }
:where(.modal.pitwin > div:not(.mhead):not(.mdock):not(.mfoot), .modal.dunwin > .dun-body) > * { flex: none; }
.modal.pitwin .pit-art, .modal.dunwin .dun-art { flex: 0 1 156px; height: auto; min-height: 60px; }
.dunwin .dun-rw { min-height: 106px; align-content: flex-start; }
.dunwin .dun-rwi { padding: 0; background: none; border: 0; cursor: pointer; color: inherit; font: inherit; }
.pit-slide.hide { visibility: hidden; }
@media (max-height: 700px) { .dunwin .dun-tile { height: 44px; } .dunwin .dun-tile b { padding-top: 13px; font-size: 16px; } }
@media (max-height: 700px) {
  .dunwin .dun-rwi { width: 36px; } .dunwin .dun-rwi .slot { width: 32px; height: 32px; } .dunwin .dun-rwi .n { font-size: 10px; }
  .dunwin .dun-rw { min-height: 94px; } .dun-where { font-size: 12px; margin-top: 3px; padding-top: 3px; } .dun-rwh { margin-top: 3px; }
  .dunwin .dun-leap { margin-top: 3px; } .dunwin .dun-leap .btn { min-height: 26px; padding: 2px 8px; }
  .dunwin .pit-share { min-height: 2.6em; }
}
/* the Pit's and the Dungeon's foot: the same buttons in the same places (Sweep, Enter; the share line; Mastery, ·, Ranks) */
.pitwin .pit-share, .dunwin .pit-share { min-height: 2.6em; margin-top: 2px; font-size: 11px; }
.pitwin .pit-more, .dunwin .pit-more { margin-top: 6px; }
.pitwin .pit-shopbtn { top: 12px; right: 12px; } /* its badge inside the picture, not on the frame */
.pitwin .pit-shopbtn .badge { top: -6px; right: -6px; }
/* the catacombs and the Lord always on one line (a long name is cut short), so the window never changes with the level */
.dun-where { flex-wrap: nowrap; gap: 4px 10px; }
.dun-where .dw { min-width: 0; flex: 0 1 auto; }
.dun-where .dw > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dun-where img.ic.ci { flex: none; }
/* the Pit's and the Dungeon's progress bars, alive: a sheen runs along the fill, its tip glows and flickers, sparks fly off
   it as it fills (runui.js barFx), and a full bar flares */
#hud .pb-bar { position: relative; overflow: visible; }
#hud .pb-bar > i { position: relative; box-shadow: 0 0 6px rgba(255,150,40,.45); }
#hud .pb-bar > i::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, rgba(255,255,255,0) 0 38%, rgba(255,250,220,.6) 50%, rgba(255,255,255,0) 62% 100%) 0 0 / 220% 100% no-repeat;
  animation: pbShine 1.8s linear infinite; }
#hud .pb-bar > i::after { content: ''; position: absolute; right: -3px; top: -4px; bottom: -4px; width: 7px; pointer-events: none;
  background: radial-gradient(ellipse at center, #fffbe6 0 22%, rgba(255,200,90,.85) 42%, rgba(255,120,30,0) 72%); animation: pbTip .35s ease-in-out infinite alternate; }
#hud .pb-bar.empty > i::after, #hud .pb-bar.empty > i::before { display: none; }
#hud .pb-spark { position: absolute; top: 50%; width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; background: var(--c, #ffd35a); box-shadow: 0 0 4px var(--c, #ffd35a);
  pointer-events: none; animation: pbSpark var(--d, .5s) cubic-bezier(.2,.7,.4,1) forwards; }
#hud .pb-bar.full { animation: pbFull .7s ease-out; }
#hud .dunbar.vault .pb-bar > i { box-shadow: 0 0 8px rgba(255,210,90,.6); }
@keyframes pbShine { from { background-position: 160% 0; } to { background-position: -60% 0; } }
@keyframes pbTip { from { opacity: .65; transform: scaleY(.85); } to { opacity: 1; transform: scaleY(1.15); } }
@keyframes pbSpark { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.3); opacity: 0; } }
@keyframes pbFull { 0% { box-shadow: inset 0 0 0 1px #6a5030; } 25% { box-shadow: inset 0 0 0 1px #ffe08a, 0 0 14px rgba(255,200,80,.95); } 100% { box-shadow: inset 0 0 0 1px #6a5030, 0 0 0 rgba(255,200,80,0); } }
#hud .pitbar .pb-bar { height: 11px; }
/* the Trials' arches turn under a finger: a swipe to either side slides them along; a tap on the middle one goes in */
.tr-hall { touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
.tr-hall img { pointer-events: none; -webkit-user-drag: none; }
.tr-arch.mid:not(.soon) { cursor: pointer; }
.tr-hall.slide-l > .tr-arch { animation: trSlideL .28s cubic-bezier(.2,.8,.3,1); }
.tr-hall.slide-r > .tr-arch { animation: trSlideR .28s cubic-bezier(.2,.8,.3,1); }
@keyframes trSlideL { from { transform: translateX(40%); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes trSlideR { from { transform: translateX(-40%); opacity: .4; } to { transform: none; opacity: 1; } }
/* the admin panel's messages: long text without spaces (an automatic report) wraps inside the card; its fields in a table */
.ap-text { overflow-wrap: anywhere; word-break: break-word; }
.ap-item { min-width: 0; max-width: 100%; overflow: hidden; }
.ap-fb { width: 100%; table-layout: fixed; margin: 4px 0; font-size: 13px; }
.ap-fb td { vertical-align: top; padding: 2px 4px; overflow-wrap: anywhere; word-break: break-word; }
.ap-fb td:first-child { width: 64px; }
.ad-wait { flex-direction: column; gap: 14px; } .ad-wait-x { width: auto; }

/* ===================== The Belfry ===================== */
.modal.belwin .bel-art { flex: 0 1 200px; min-height: 120px; }
.bel-art img, .bel-pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; image-rendering: pixelated; }
.bel-name { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; z-index: 2; text-shadow: 0 1px 0 #000, 0 0 6px #000; pointer-events: none; }
.bel-lv { font: 800 13px var(--title); color: #ffe0a0; letter-spacing: .5px; }
.bel-boss { font: 800 16px var(--title); color: #fff2dc; }
.bel-fx { position: absolute; top: 6px; right: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; color: #f4e6d0; text-shadow: 0 1px 0 #000, 0 0 4px #000; z-index: 2; }
.bel-fxg { text-align: right; }
.bel-fx .an { border-color: #7a40c0 !important; background: #12061a !important; }
.belintro .bel-fx { position: static; align-items: center; margin: 4px 0; }
.belintro .bel-fx .dun-fxi { justify-content: center; }
.bel-pic { height: 150px; overflow: hidden; border: 2px solid #050308; box-shadow: inset 0 0 0 2px var(--ring-gold), 0 3px 0 #000; }
.bel-cols { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.bel-col .dun-rw { flex-wrap: nowrap; }
.bel-col .dun-rwh { white-space: nowrap; }
.bel-col + .bel-col { border-left: 1px solid rgba(255,230,200,.08); padding-left: 6px; }
.bel-claimed { display: flex; align-items: center; justify-content: center; height: 46px; font: 800 14px var(--body); color: var(--good); }
.bel-day { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,230,200,.08); font-size: 13px; font-weight: 800; color: #f4e6d0; }
.bel-day .btn.small { padding: 3px 8px; }
.dun-tile.bell b { color: #ffcf6a; }
.dun-tile.bell .dun-face { box-shadow: inset 0 0 8px rgba(255,170,60,.45); }

/* ===================== Tempering ===================== */
.might .tmp-btn { margin-left: 6px; padding: 2px 8px; font-size: 12px; }
.tmp-lock { margin: -2px 0 6px; }
.tmp-body { display: flex; flex-direction: column; gap: 8px; }
.tmp-piece { display: flex; align-items: center; gap: 10px; }
.tmp-piece > .slot { width: 56px; flex: none; }
.tmp-bar .might-bar { height: 12px; }
.tmp-bar .might-bar i.old { background: rgba(255,240,220,.25); box-shadow: none; z-index: 1; }
.tmp-bar .might-bar i:not(.old) { z-index: 0; }
.tmp-res { text-align: center; font: 800 22px var(--num); }
.tmp-res.up { color: var(--good); text-shadow: 0 0 8px rgba(90,255,140,.4); }
.tmp-res.down { color: var(--blood-hi); text-shadow: 0 0 8px rgba(255,60,60,.4); }
.tmp-res.saved { color: #ffcf6a; font-size: 15px; }
.tmp-h { font-weight: 800; color: var(--gold); font-size: 13px; text-align: center; }
.tmp-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tmp-opt { padding: 6px 4px; background: rgba(0,0,0,.3); border: 2px solid #3a2c40; color: #f4e6d0; cursor: pointer; text-align: center; }
.tmp-opt.on { border-color: #b366ff; box-shadow: 0 0 8px rgba(179,102,255,.5); background: rgba(60,20,90,.4); }
.tmp-q { display: flex; justify-content: center; gap: 1px; min-height: 18px; }
.tmp-q img.ic.ci { width: 18px; height: 18px; }
.tmp-togs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
.tmp-tog { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; background: rgba(0,0,0,.3); border: 2px solid #3a2c40; color: #f4e6d0; cursor: pointer; font-size: 12px; }
.tmp-tog.on { border-color: #ffcf6a; background: rgba(90,60,10,.4); }
.tmp-tog.off { opacity: .55; }
.tmp-range { text-align: center; font-size: 13px; color: #f4e6d0; }
.tmp-stock { display: flex; align-items: center; gap: 4px; justify-content: center; flex-wrap: wrap; font-size: 13px; }
.tmp-stock i { width: 10px; }
/* the altar: the piece in the middle, three quartz sockets round its top, the Die and the Seal below */
.tmp-altar { position: relative; height: 196px; margin: 0 auto; width: 100%; max-width: 300px;
  background: radial-gradient(ellipse at 50% 60%, rgba(140,60,220,.22), rgba(0,0,0,0) 60%), radial-gradient(ellipse at 50% 92%, rgba(0,0,0,.55), rgba(0,0,0,0) 55%); }
.tmp-altar::before { content: ''; position: absolute; left: 50%; top: 50%; width: 210px; height: 150px; transform: translate(-50%, -50%);
  background: linear-gradient(160deg, transparent 49%, rgba(180,120,255,.35) 50%, transparent 51%), linear-gradient(20deg, transparent 49%, rgba(180,120,255,.35) 50%, transparent 51%),
    linear-gradient(90deg, transparent 49.5%, rgba(180,120,255,.35) 50%, transparent 50.5%); pointer-events: none; }
.tmp-item { position: absolute; left: 50%; top: 56%; width: 72px; transform: translate(-50%, -50%); z-index: 2; }
.tmp-sock { position: absolute; width: 46px; height: 46px; transform: translate(-50%, -50%); background: #120a18; border: 2px solid #4a3a5a; box-shadow: inset 0 0 8px #000, 0 2px 0 #000; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2; }
.tmp-sock img { width: 80%; height: 80%; image-rendering: pixelated; }
.tmp-sock .tmp-empty { width: 40%; height: 40%; border: 2px dashed rgba(180,120,255,.35); }
.tmp-sock.on { border-color: #b366ff; box-shadow: inset 0 0 8px #000, 0 0 10px rgba(179,102,255,.6); }
.tmp-sock.q1 { left: 50%; top: 14%; } .tmp-sock.q2 { left: 18%; top: 34%; } .tmp-sock.q3 { left: 82%; top: 34%; }
.tmp-sock.die { left: 22%; top: 84%; width: 40px; height: 40px; } .tmp-sock.seal { left: 78%; top: 84%; width: 40px; height: 40px; }
.tmp-sock.die.on, .tmp-sock.seal.on { border-color: #ffcf6a; box-shadow: inset 0 0 8px #000, 0 0 10px rgba(255,200,100,.55); }
.tmp-sock .tmp-n { position: absolute; bottom: -14px; font: 800 11px var(--num); color: #f4e6d0; text-shadow: 0 1px 0 #000; }
.tmp-name { text-align: center; font-size: 14px; }
.tmp-odds { text-align: center; font-weight: 800; font-size: 13px; color: #f4e6d0; }
.tmp-btns { display: flex; gap: 8px; }
.tmp-btns .btn.grow { flex: 1; }
/* Tempering from the Armory: the pieces that can rise, below the altar */
.tmp-pick { border-top: 1px solid #3a2c40; padding-top: 8px; }
.tmp-pick .tmp-h { margin-bottom: 6px; }
.tmp-inv { max-height: 196px; overflow-y: auto; padding: 2px; }
.tmp-inv .slot { position: relative; }
.tmp-inv .slot.tmp-sel { border-color: #e0b0ff; box-shadow: inset 0 0 0 2px #b366ff, inset 0 0 14px rgba(179,102,255,.8); }
.tmp-mt { position: absolute; left: 0; right: 0; bottom: 1px; text-align: center; font: 800 10px var(--num); color: #ffcf6a; text-shadow: 0 1px 0 #000, 0 0 3px #000; pointer-events: none; }
.tmp-wait .slot.empty { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.invbar .tmp-open img { width: 18px; height: 18px; }
.tmp-gold { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; font: 800 13px var(--num); }
.tmp-gold.bad { color: var(--blood-hi); }
.tmp-body { position: relative; }
.temperwin .tmp-shopbtn { top: 2px; right: 2px; width: 50px; height: 50px; z-index: 4; }
.temperwin .tmp-shopbtn .ic { width: 26px; height: 26px; }
.temperwin .tmp-shopbtn .badge { top: 2px; right: 2px; } /* inside its frame, not over the window's */
.temperwin .tmp-altar { max-width: min(270px, calc(100% - 100px)); } /* room for the shop button beside the sockets */
.temperwin .tmp-sock.q2 { left: 14%; } .temperwin .tmp-sock.q3 { left: 86%; }
.tmp-buy { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tmp-buy .btn { width: 100%; justify-content: center; }
.tmp-open .badge { position: absolute; top: -6px; right: -6px; }
.tmp-open { position: relative; }
/* Tempering: what the hero holds, below the altar while a piece is on it */
.tmp-invhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.tmp-invhead .tmp-h { margin: 0; text-align: left; }
.tmp-toggle { min-width: 46%; justify-content: center; }
.tmp-resinv .slot { cursor: pointer; }
.tmp-inv.tmp-resinv .slot.tmp-on { border-color: #5aff9a; box-shadow: inset 0 0 12px rgba(0,0,0,.8), inset 0 0 0 2px #5aff9a, 0 0 10px rgba(90,255,154,.75); }
.tmp-resinv .slot.tmp-none { filter: grayscale(.7) brightness(.6); }
.tmp-ct { position: absolute; right: 3px; bottom: 1px; font: 800 12px var(--num); color: #fff; text-shadow: 0 1px 0 #000, 0 0 3px #000; pointer-events: none; }
.tmp-use { position: absolute; left: 2px; top: 2px; min-width: 16px; height: 16px; padding: 0 3px; background: #1f7a3a; border: 1px solid #5aff9a; color: #fff; font: 800 11px/14px var(--num); text-align: center; pointer-events: none; }
.temperwin .tmp-clear { position: absolute; left: 2px; top: 2px; z-index: 4; }
/* Tempering's bar: orange to the lowest it can land on, green to the highest, the Might now a pin on it */
.tmp-scale { position: relative; padding: 0 10px; margin-bottom: 4px; }
.tmp-lt, .tmp-lb { position: relative; height: 16px; font: 800 12px var(--num); }
.tmp-lt span, .tmp-lb span { position: absolute; transform: translateX(-50%); white-space: nowrap; text-shadow: 0 1px 0 #000; }
.tmp-lt span { bottom: 1px; color: #8dffb4; } .tmp-lb span { top: 2px; color: #ffb36a; }
.tmp-track { position: relative; height: 16px; background: #0a070c; border: 2px solid #2a2030; box-shadow: inset 0 2px 4px #000; overflow: visible; }
.tmp-track i { position: absolute; top: 0; bottom: 0; }
.tmp-track .tmp-low { left: 0; background: linear-gradient(180deg, #ffc27a, #e07a2a 55%, #a8501a); }
.tmp-track .tmp-range { background: linear-gradient(180deg, #b8ffcc, #5ad888 55%, #2a9a58); border: 0; box-shadow: inset -2px 0 0 #e8fff0, inset 2px 0 0 #fff3c0; z-index: 1; }
.tmp-track .tmp-pin { width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 4px #fff; z-index: 3; top: -4px; bottom: -4px; }
.tmp-track .tmp-pin b { position: absolute; left: 5px; top: 50%; transform: translateY(-50%); font: 800 10px var(--num); color: #fff; text-shadow: 0 0 2px #000, 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000; white-space: nowrap; }
.tmp-track .tmp-pin b.l { left: auto; right: 5px; }
.tmp-track .tmp-cur { width: 6px; margin-left: -3px; top: -5px; bottom: -5px; background: #7ff8ff; box-shadow: 0 0 8px #3ff0ff, 0 0 16px #3ff0ff; z-index: 4; }
.tmp-track .tmp-cur::after { content: '✦'; position: absolute; left: 50%; top: -12px; transform: translateX(-50%); color: #e8ffff; font-size: 12px; text-shadow: 0 0 6px #3ff0ff; animation: tmpspark .5s ease-in-out infinite alternate; }
@keyframes tmpspark { from { opacity: .4; transform: translateX(-50%) scale(.8); } to { opacity: 1; transform: translateX(-50%) scale(1.25); } }
.tmp-sock img { width: 34px; height: 34px; flex: none; object-fit: contain; }
.tmp-sock.die img, .tmp-sock.seal img { width: 30px; height: 30px; }
/* the tempering shown: rolling, then its result */
.tmp-rollv { cursor: pointer; min-height: 420px; }
.tmp-altar.bare::before { opacity: .55; }
.tmp-rolling, .tmp-done { position: relative; text-align: center; padding-top: 6px; }
.tmp-rl { font: 800 18px var(--num); color: #f4e6d0; letter-spacing: .5px; animation: tmppulse .7s ease-in-out infinite alternate; }
@keyframes tmppulse { from { opacity: .55; } to { opacity: 1; } }
.tmp-rnum { font: 800 34px var(--num); color: #fff; text-shadow: 0 2px 0 #000, 0 0 10px rgba(127,248,255,.5); margin: 4px 0; }
.tmp-rnum.up { color: #c8ffd8; text-shadow: 0 2px 0 #000, 0 0 12px rgba(90,255,154,.6); }
.tmp-rnum.down { color: #ffd0d0; text-shadow: 0 2px 0 #000, 0 0 12px rgba(255,70,70,.6); }
.tmp-done .tmp-res { margin-top: -4px; }
.tmp-dt { font: 800 18px var(--num); color: #ffe7a0; margin-top: 8px; text-shadow: 0 2px 0 #000; }
.tmp-ds { font-weight: 800; font-size: 14px; margin-bottom: 12px; }
.tmp-ds.up { color: var(--good); } .tmp-ds.down { color: var(--blood-hi); } .tmp-ds.saved { color: #ffcf6a; }
.tmp-parts { position: absolute; left: 0; right: 0; top: -150px; bottom: 0; pointer-events: none; overflow: hidden; }
.tmp-parts i { position: absolute; bottom: 0; width: 12px; height: 8px; opacity: 0; clip-path: polygon(50% 0, 100% 70%, 78% 100%, 50% 45%, 22% 100%, 0 70%); background: #5aff9a; filter: drop-shadow(0 0 3px #5aff9a); animation: tmpup 1.8s ease-out infinite; }
.tmp-parts.down i { top: 0; bottom: auto; background: #ff5050; filter: drop-shadow(0 0 3px #ff5050); transform: rotate(180deg); animation-name: tmpdown; }
.tmp-parts.saved i { background: #ffcf6a; filter: drop-shadow(0 0 3px #ffcf6a); }
@keyframes tmpup { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-260px); } }
@keyframes tmpdown { 0% { opacity: 0; transform: rotate(180deg) translateY(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: rotate(180deg) translateY(-260px); } }
.tmp-cont { max-width: 240px; margin: 0 auto; }
/* Tempering: one size whatever is shown (the list below the altar scrolls inside it) */
.temperwin .tmp-body { height: min(690px, calc(100dvh - 190px)); min-height: 520px; box-sizing: border-box; }
.temperwin .tmp-pick { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.temperwin .tmp-inv { max-height: none; overflow: visible; }
.temperwin .tmp-rollv { min-height: 0; }
.tmp-track .tmp-low, .tmp-track .tmp-range, .tmp-track .tmp-pin { transition: width .5s cubic-bezier(.2,.8,.3,1), left .5s cubic-bezier(.2,.8,.3,1); }
.tmp-lt span, .tmp-lb span { transition: left .5s cubic-bezier(.2,.8,.3,1); }
.tmp-track .tmp-range.tmp-fill { animation: tmpfill .6s ease-out; }
@keyframes tmpfill { 0% { filter: brightness(1.9) saturate(1.3); } 100% { filter: none; } }
/* a filled socket in its resource's colour */
.tmp-sock.on[class*="rar"] { border-color: var(--rc); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 45%, #150e18), #120c16 80%); box-shadow: inset 0 0 8px #000, 0 0 10px color-mix(in srgb, var(--rc) 60%, transparent); }
/* (the parts above the list keep their size: only the list gives way, and scrolls) */
.temperwin .tmp-body > * { flex: none; }
.temperwin .tmp-body > .tmp-pick { flex: 1 1 0; min-height: 90px; }
.temperwin .tmp-inv { grid-template-columns: repeat(5, minmax(0, 1fr)); }
/* the shop buttons (the Pit's, Tempering's, the Constellation's, the Armory's Resource Store; with the stats buttons beside
   them): a black ground in the style of the item slots, a gold ring */
.pit-shopbtn, .cons-cb, .doll .resbtn > .ic {
  border: 2px solid var(--r4, #e0a030); border-radius: 3px;
  background: radial-gradient(circle at 50% 38%, #2e262c, #0c090c 72%, #050405);
  box-shadow: inset 0 0 12px rgba(0,0,0,.85), 0 2px 0 #000; }
.pit-shopbtn, .cons-cb { color: #ffd890; text-shadow: 0 1px 0 #000; }
/* the Pit's shop button the size of the other shops' (Tempering's): 50 x 50, its icon 26 */
.pit-shopbtn { width: 50px; height: 50px; padding: 3px 2px 2px; }
.pit-shopbtn .ic { width: 26px; height: 26px; }
.pit-shopbtn span { font-size: 10px; }
.pit-shopbtn .badge { top: 2px; right: 2px; }
/* every fight alike: the abilities drawn small, and the mode's panel (the Pit's, the Dungeon's and the Belfry's, the
   halls' AUTO) beside them on their row, at the right; six of them (the weapon and five tomes) always fit */
#hud .dunbar, #hud .pitbar { width: 160px; }
#hud .build .r { gap: 3px; flex-wrap: nowrap; max-width: calc(100vw - 192px); }
#hud .build .b { width: min(28px, calc((100vw - 207px) / 6)); height: min(28px, calc((100vw - 207px) / 6)); }
#hud .build .b img { width: 72%; height: 72%; }
#hud .build .b i { font-size: 7px; }
/* the buffs and the curse as small as the abilities */
#hud .buffs { gap: 3px; }
#hud .buffs .bf { width: 26px; height: 26px; padding: 2px; }
#hud .buffs .bf .bfi { width: 18px; height: 18px; }
#hud .buffs .bf .bfi img { width: 15px; height: 15px; margin-top: -4px; }
#hud .buffs .bf .bfi b { font-size: 7.5px; }
#hud .cursed { padding: 2px 6px 2px 3px; gap: 3px; }
#hud .cursed img.ic.ci { width: 13px; height: 13px; }
#hud .cursed b { font-size: 8px; }
/* the Pit's combo: its sparks, its number glowing like an ember */
#hud .pb-combo { position: relative; }
#hud .pb-n { animation: pbglow 1.2s ease-in-out infinite alternate; }
@keyframes pbglow { from { text-shadow: 0 2px 0 #000, 0 0 6px rgba(200,40,30,.7); } to { text-shadow: 0 2px 0 #000, 0 0 14px rgba(255,120,40,.95), 0 0 3px #ffd090; } }
/* (their own class: the wave bar's sparks keep .pb-spark and its place on the bar) */
#hud .pb-cspark { position: absolute; z-index: 4; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; background: #ffc060; box-shadow: 0 0 5px #ff7a20, 0 0 10px #ff4010; pointer-events: none; animation: pbspark .75s cubic-bezier(.2,.7,.4,1) forwards; }
#hud .pb-cspark.hot { width: 6px; height: 6px; background: #fff4c0; box-shadow: 0 0 6px #ffd060, 0 0 12px #ff8a20; }
@keyframes pbspark { 0% { transform: translate(0, 0) scale(1.4); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(.4); opacity: 0; } }
/* the Catacombs' window: the level's name between arrows, its block of the maze, the day, what can be found */
.mazewin .mz-head { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; }
.mazewin .mz-title { flex: 1; text-align: center; }
.mazewin .mz-lv { font: 800 13px var(--num); color: var(--gold); letter-spacing: .06em; }
.mazewin .mz-nm { font-family: var(--title, serif); font-size: 20px; color: #f4e6d0; text-shadow: 0 2px 0 #000; line-height: 1.1; }
.mazewin .mz-head .dun-arr.off { opacity: .35; pointer-events: none; }
.mazewin .mz-pic { margin-bottom: 6px; } /* the level's maze over the whole field, as the Dungeon's picture */
.mazewin .mz-pic img { object-position: 50% 50%; }
.mazewin .mz-pic.shut img { filter: grayscale(.85) brightness(.45); }
.mazewin .mz-lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 0 30px; font-size: 12px; font-weight: 800; color: #f4e6d0; text-shadow: 0 1px 0 #000, 0 0 6px #000; }
.mazewin .mz-lock img { width: 26px; height: 26px; }
.mazewin .mz-lock span.ok { color: #8fe08a; }
.mazewin .mz-card { display: flex; flex-direction: column; gap: 3px; }
.mazewin .mz-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.mazewin .mz-row b { font-family: var(--num); }
.mazewin .mz-fx .mz-fxi { display: flex; gap: 4px; }
.mazewin .mz-fx .mz-fxi button { width: 26px; height: 26px; padding: 0; border: 2px solid #8a1a1a; background: #120a0c; }
.mazewin .mz-fx .mz-fxi img { width: 20px; height: 20px; }
.mazewin .mz-cols { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-top: 4px; border-top: 1px solid #3a2c40; padding-top: 6px; }
.mazewin .mz-col + .mz-col { border-left: 1px solid #3a2c40; padding-left: 8px; }
.mazewin .mz-sub { font-size: 11px; color: #c8b8a8; text-align: center; margin-bottom: 3px; }
.mazewin .mz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 14px; }
.mazewin .mz-row { font-size: 12px; gap: 6px; white-space: nowrap; }
.mazewin .mz-row span { overflow: hidden; text-overflow: ellipsis; }
.mazewin .mz-row .btn.tiny { padding: 1px 6px; font-size: 11px; }
.mazewin .mz-cols .dun-rw { min-height: 0; }
.mazewin .dun-rwi .slot { width: 34px; height: 34px; }
.mazewin .dun-rwi { width: 38px; }
/* the Catacombs: the finds on the panel and on the results */
#hud .dunbar .db-wave { font-size: 11px; white-space: nowrap; }
.mazeres .mz-finds { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin: 8px 0; }
.mazeres .mz-find { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: rgba(0,0,0,.35); border: 1px solid rgba(232,194,106,.25); border-radius: 6px; }
.mazeres .mz-find span { flex: 1; font-size: 13px; }
.mazeres .mz-find b { color: #ffd35a; }
.mazeintro .pi-art.mz-pic img { width: 100%; image-rendering: pixelated; }
#hud .dunbar .mz-f { display: flex; align-items: center; gap: 2px; font-size: 11px; white-space: nowrap; margin: 3px 0 1px; }
#hud .dunbar .mz-f b { margin-right: 4px; color: #f2e6c8; }
#hud .dunbar .mz-f .ci { width: 14px; height: 14px; }
/* Purifying (js/ui/refine.js): the grade on a piece, the grades and stats over the altar, the Seed and Feather sockets, the odds; the exchange */
.ref-tag { font-weight: 800; margin-top: 2px; text-shadow: 0 1px 0 #000; }
.refwin .ref-grades { text-align: center; font-size: 16px; font-weight: 800; text-shadow: 0 1px 0 #000; margin: 2px 0; }
.refwin .ref-stats { text-align: center; font-size: 13px; margin-bottom: 6px; }
.refwin .ref-row { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px 0; }
.refwin .ref-rl { width: 54px; font-size: 12px; font-weight: 800; color: #e8d6b0; text-align: right; }
.refwin .ref-sock { background: none; border: 0; padding: 0; width: 50px; height: 50px; cursor: pointer; border-radius: 8px; }
.refwin .ref-sock .slot { width: 50px; height: 50px; opacity: .75; }
.refwin .ref-sock.on .slot { opacity: 1; box-shadow: 0 0 0 2px #8fe08a, 0 0 10px rgba(143,224,138,.6); }
.refwin .ref-sock.no .slot { opacity: .3; filter: grayscale(.8); }
.refwin .ref-odds { display: flex; align-items: center; gap: 8px; margin: 8px 6px 2px; }
.refwin .ref-ob { flex: 1; height: 12px; background: #1a1014; border: 1px solid rgba(232,194,106,.5); border-radius: 6px; overflow: hidden; }
.refwin .ref-ob i { display: block; height: 100%; background: linear-gradient(90deg, #2a8a3a, #8fe08a); transition: width .35s; }
.refwin .ref-odds b { font-size: 15px; color: #8fe08a; white-space: nowrap; }
.refwin .ref-gb { position: absolute; left: 3px; bottom: 3px; width: 9px; height: 9px; border-radius: 50%; border: 1px solid #000; }
.refwin .tmp-rnum.down { color: #ff6a6a; }
.refswap .ref-sect { font-weight: 800; color: #e8c26a; margin: 10px 0 4px; }
.refswap .ref-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.refswap .ref-card { display: flex; align-items: center; gap: 8px; padding: 6px; cursor: pointer; }
.refswap .ref-card.off { opacity: .7; }
.refswap .ref-card .slot { width: 46px; height: 46px; flex: none; }
.refswap .ref-cn { font-size: 12px; font-weight: 800; line-height: 1.15; }
.refswap .ref-cp { display: flex; align-items: center; gap: 3px; margin-top: 3px; }
.refswap .ref-cp b.bad { color: #ff6a6a; }
.refswap .ref-stock { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; margin-top: 12px; padding: 6px; background: rgba(0,0,0,.35); border-radius: 6px; }
.refswap .ref-stock span { display: flex; align-items: center; gap: 2px; font-size: 13px; }
.invbar.inv4 { flex-wrap: wrap; row-gap: 6px; }
.invbar.inv4 > .btn { flex: 1 1 calc(50% - 6px); }
/* Purifying's forge (ui.openRefine): the stock and the Exchange on top, the piece over the brazier with the next grade
   above it, the Seed's socket left and the Feather's right, Purify on the brazier's front; the swirl and the band */
.refwin .rf-body { position: relative; }
.refwin .rf-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.refwin .rf-stock { display: grid; grid-template-columns: repeat(2, auto); gap: 1px 10px; font-size: 12px; }
.refwin .rf-stock div { display: flex; align-items: center; gap: 3px; }
.refwin .rf-stock .ci { width: 16px; height: 16px; }
.refwin .rf-tr { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.refwin .rf-skip { display: flex; align-items: center; gap: 5px; font-size: 12px; cursor: pointer; }
.refwin .rf-swap { display: flex; align-items: center; gap: 4px; padding: 5px 9px; font: 800 13px inherit; font-family: inherit; color: #fff; text-shadow: 0 1px 0 #000;
  background: linear-gradient(#e0782a, #9a3a10); border: 2px solid #1a0a04; border-radius: 8px; box-shadow: inset 0 1px 0 rgba(255,220,180,.4), 0 2px 4px rgba(0,0,0,.5); cursor: pointer; }
.refwin .rf-stage { position: relative; height: 236px; margin-top: 2px; }
.refwin .rf-bowl { position: absolute; left: 50%; bottom: 0; width: 330px; max-width: 98%; transform: translateX(-50%); image-rendering: pixelated; pointer-events: none; }
.refwin .rf-item { position: absolute; left: 50%; top: 96px; width: 64px; transform: translateX(-50%); z-index: 2; }
.refwin .rf-item .slot { width: 64px; height: 64px; box-shadow: 0 0 16px rgba(255,140,40,.6); }
.refwin .rf-next { position: absolute; left: 50%; top: 4px; width: 50px; transform: translateX(-50%); }
.refwin .rf-next .slot { width: 50px; height: 50px; }
.refwin .rf-up { position: absolute; left: 50%; top: 62px; width: 0; height: 0; transform: translateX(-50%); border: 10px solid transparent; border-bottom: 12px solid #5ad84a; border-top: 0; filter: drop-shadow(0 0 4px #5ad84a); animation: rfUp 1.2s ease-in-out infinite; }
@keyframes rfUp { 50% { transform: translate(-50%, -4px); } }
.refwin .rf-gr { position: absolute; top: 1px; right: 4px; font-weight: 900; font-size: 12px; text-shadow: 0 1px 0 #000, 0 0 3px #000, 0 0 3px #000; z-index: 1; }
.refwin .rf-sock { position: absolute; top: 116px; width: 50px; height: 50px; z-index: 2; }
.refwin .rf-sock.l { left: calc(50% - 124px); } .refwin .rf-sock.r { left: calc(50% + 74px); }
.refwin .rf-sock .slot { width: 50px; height: 50px; }
.refwin .rf-sock .slot.empty { background: rgba(70,64,66,.75); border: 2px solid #3a3234; box-shadow: inset 0 0 8px #000; }
.refwin .rf-x { position: absolute; right: -7px; bottom: -7px; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 2px solid #1a0404; background: #d02424; color: #fff; font: 900 14px/14px sans-serif; cursor: pointer; z-index: 3; }
.refwin .rf-go { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); min-width: 150px; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 6px; }
.refwin .rf-info { text-align: center; min-height: 66px; margin-top: 4px; }
.refwin .rf-steps { font-size: 15px; font-weight: 700; }
.refwin .rf-chance { font-weight: 800; font-size: 14px; }
.refwin .rf-chance.hi, .rf-cost + .rf-chance.hi { color: #7cff6a; } .rf-chance.mid { color: #ffd040; } .rf-chance.lo { color: #ff6a5a; }
.rf-chance.hi { color: #7cff6a; }
.refwin .rf-stat { margin-top: 2px; }
.refwin .rf-doing { font-size: 15px; font-weight: 800; margin-top: 12px; }
.refwin .rf-nav { gap: 8px; margin: 6px 0; }
.refwin .rf-res { background: rgba(0,0,0,.3); border-radius: 8px; padding: 6px; }
.refwin .rf-rh { font-weight: 800; text-align: center; margin-bottom: 4px; }
.refwin .slot.rf-use { box-shadow: 0 0 0 2px #7cff6a, 0 0 12px rgba(124,255,106,.85); }
.refwin .rf-list { margin-top: 6px; }
.rf-cost { display: flex; align-items: center; justify-content: center; gap: 3px; margin-top: 6px; }
/* the animation: the Seed and the Feather fly into the piece, a swirl in the Seed's colour, then a band */
.refwin .rf-sock.fly.l .slot { animation: rfFlyL 1.3s ease-in forwards; }
.refwin .rf-sock.fly.r .slot { animation: rfFlyR 1.3s ease-in forwards; }
@keyframes rfFlyL { 0% { transform: none; } 30% { transform: translate(10px, -16px); } 100% { transform: translate(100px, -2px) scale(.25) rotate(220deg); opacity: 0; } }
@keyframes rfFlyR { 0% { transform: none; } 30% { transform: translate(-10px, -16px); } 100% { transform: translate(-100px, -2px) scale(.25) rotate(-220deg); opacity: 0; } }
.refwin .rf-swirl { position: absolute; left: 50%; top: 128px; width: 0; height: 0; z-index: 3; pointer-events: none; }
@keyframes rfSpin { to { transform: rotate(360deg); } }
.refwin .rf-swirl svg { position: absolute; left: -50px; top: -50px; overflow: visible; filter: drop-shadow(0 0 5px currentColor); }
.refwin .rf-swirl circle { transform-origin: 0 0; animation: rfSpin .9s linear infinite; }
.refwin .rf-swirl circle.s1 { animation-duration: .6s; animation-direction: reverse; }
.refwin .rf-swirl circle.s2 { animation-duration: .45s; opacity: .8; }
.refwin .rf-band { position: absolute; left: -12px; right: -12px; top: 108px; padding: 9px 0; z-index: 4; text-align: center; font-size: 22px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 #000, 0 0 8px #000;
  background: linear-gradient(90deg, transparent, rgba(24,110,36,.92) 14%, rgba(24,110,36,.92) 86%, transparent); border-top: 2px solid #7cff6a; border-bottom: 2px solid #7cff6a; animation: rfBand .35s ease-out; }
.refwin .rf-band.fail { background: linear-gradient(90deg, transparent, rgba(130,16,16,.92) 14%, rgba(130,16,16,.92) 86%, transparent); border-color: #ff6a5a; }
@keyframes rfBand { from { transform: scaleX(.2); opacity: 0; } to { transform: none; opacity: 1; } }
.refwin .rf-stage .tmp-parts { top: 0; z-index: 4; }
.refwin .rf-tr { padding-top: 58px; } /* (under the Exchange's button, top right as every shop's) */
.refwin .rf-shopbtn { top: 0; right: 0; z-index: 4; }
.refwin .rf-price { display: flex; align-items: center; justify-content: center; gap: 3px; margin-top: 2px; font-size: 13px; }
.refwin .rf-price b { margin-right: 8px; } .refwin .rf-price b.ok { color: #f2e6c8; } .refwin .rf-price b.bad { color: #ff6a5a; }
/* the Catacombs' window, as the Pit's: the level's picture (its name over it between the arrows, the Hellore held, the
   Exchange as the shop), its numbers one to a line, what it pays in two rows, the entries with their +1 */
.mazewin .mz-art { height: 160px; }
.mazewin .mz-art img { object-position: 50% 55%; }
.mazewin .mz-art.shut img { filter: grayscale(.85) brightness(.45); }
.mazewin .mz-name { position: absolute; left: 44px; right: 64px; top: 6px; text-align: center; pointer-events: none; text-shadow: 0 2px 0 #000, 0 0 6px #000, 0 0 10px #000; }
.mazewin .mz-name .mz-lv { font: 800 13px var(--num); color: var(--gold); letter-spacing: .06em; }
.mazewin .mz-name .mz-nm { font-family: var(--title, serif); font-size: 20px; color: #f4e6d0; line-height: 1.1; }
.mazewin .mz-arr { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 44px; padding: 0; display: flex; align-items: center; justify-content: center; z-index: 3;
  background: rgba(10,6,10,.7); border: 1px solid #8a6a30; box-shadow: inset 0 0 0 1px #000; cursor: pointer; }
.mazewin .mz-arr .ic, .mazewin .mz-arr img { width: 22px; height: 22px; }
.mazewin .mz-arr.l { left: 6px; } .mazewin .mz-arr.r { right: 6px; top: 62%; }
.mazewin .mz-arr.off { opacity: .3; pointer-events: none; }
.mazewin .mz-art .mz-lock { z-index: 2; padding: 30px 44px 0; }
.mazewin .mz-card { display: block; }
.mazewin .mz-card .pit-row b .bad { color: #ff6a5a; }
.mazewin .mz-fxrow { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 2px 0 6px; margin-bottom: 4px; border-bottom: 1px solid #3a2c40; color: #ff8a7a; font-weight: 800; }
.mazewin .mz-fxrow .mz-fxi { display: flex; gap: 4px; }
.mazewin .mz-fxrow .mz-fxi button { width: 28px; height: 28px; padding: 0; border: 2px solid #8a1a1a; background: #120a0c; }
.mazewin .mz-fxrow .mz-fxi img { width: 22px; height: 22px; }
.mazewin .mz-rw { padding: 6px 8px; }
.mazewin .mz-rw .mz-sub { font-size: 12px; color: #c8b8a8; text-align: left; margin: 2px 0 3px; font-weight: 700; }
.mazewin .mz-rw .mz-sub + .mz-rwr + .mz-sub { border-top: 1px solid #3a2c40; padding-top: 5px; margin-top: 4px; }
.mazewin .mz-rwr { display: flex; flex-wrap: wrap; gap: 4px; }
.mazewin .mz-rwr .dun-rwi { width: 46px; }
.mazewin .mz-rwr .dun-rwi .slot { width: 42px; height: 42px; }
.mazewin .mz-entries { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 4px; }
.mazewin .mz-entries .bad { color: #ff6a5a; }
.mazewin .mz-entries .btn.tiny { padding: 2px 8px; font-size: 12px; display: flex; align-items: center; gap: 2px; }
.modal.pitwin.mazewin .mz-art { flex: none; height: 150px; }
.modal.pitwin.mazewin > div:not(.mhead):not(.mdock):not(.mfoot) { overflow-y: auto; justify-content: flex-start; gap: 6px; }
.mazewin .pit-row { padding: 1px 0; font-size: 13px; }
.mazewin .mz-rwr .mz-rwi { padding: 0; background: none; border: 0; cursor: pointer; }
.mazewin .mz-rwr .mz-rwi .slot { width: 42px; height: 42px; }
.mazewin .mz-rwr .mz-rwi .tmp-ct { font-size: 11px; }
.mazewin .mz-arr.r { top: 64%; }
.modal.pitwin.mazewin .mz-art { height: 132px; }
.mazewin .mz-rwr { gap: 3px; }
.mazewin .mz-rwr .mz-rwi .slot { width: 37px; height: 37px; }
.mazewin .mz-rwr .mz-rwi .slot img { width: 28px; height: 28px; }
.mazewin .mz-rwr .mz-rwi .tmp-ct { font-size: 10px; right: 1px; }
.mazewin .mz-card { padding-top: 6px; padding-bottom: 6px; }
.mazewin .mz-name { right: 44px; } .mazewin .mz-arr.r { top: 50%; } /* (no shop on the picture: the Exchange is Purifying's) */
/* Skip the animation: top middle, a framed plate as the shops' buttons, its box iron with a gold rim, its tick glowing */
.refwin .rf-tr { padding-top: 0; width: 54px; height: 54px; flex: none; }
.refwin .rf-skip { flex: 0 1 150px; align-self: flex-start; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 9px;
  background: rgba(10,6,10,.78); border: 1px solid #8a6a30; box-shadow: inset 0 0 0 2px var(--ring-gold, #6a5020), inset 3px 3px 0 0 rgba(255,220,150,.08), inset -3px -3px 0 0 rgba(0,0,0,.45), 0 3px 0 #000;
  color: #ffd890; font-size: 11px; font-weight: 800; line-height: 1.15; text-shadow: 0 1px 0 #000; text-align: left; cursor: pointer; user-select: none; }
.refwin .rf-skip input { appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 0; display: grid; place-content: center; cursor: pointer;
  background: linear-gradient(#2a2024, #0e0a0c); border: 2px solid #c89a3a; box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #000; }
.refwin .rf-skip input:checked { border-color: #ffd35a; box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #000, 0 0 6px rgba(255,170,60,.7); }
.refwin .rf-skip input:checked::after { content: '✓'; color: #ffd35a; font: 900 14px/1 sans-serif; text-shadow: 0 0 4px #ff8a30, 0 1px 0 #000; }
.refwin .rf-skip:active { transform: translateY(1px); }
.refwin .rf-top { position: relative; }
.refwin .rf-skip { position: absolute; left: 50%; top: 0; width: 148px; box-sizing: border-box; transform: translateX(-50%); margin-top: 10px; }
.refwin .rf-skip:active { transform: translate(-50%, 1px); }
/* the Trials' picker: every mode's text keeps two lines' room, so nothing below it moves when the mode changes */
.tr-desc { min-height: 4.2em; } /* (three lines: the longest of them on a narrow phone) */
/* the Catacombs' window as the Pit's: a fixed column that never scrolls (its picture gives way first on a short screen),
   each row of rewards one line of eight equal slots */
.modal.pitwin.mazewin > div:not(.mhead):not(.mdock):not(.mfoot) { overflow: hidden; justify-content: space-between; gap: 4px; }
.modal.pitwin.mazewin .mz-art { flex: 0 1 132px; height: auto; min-height: 64px; }
.mazewin .mz-rwr { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
.mazewin .mz-rwr .mz-rwi { width: auto; min-width: 0; }
.mazewin .mz-rwr .mz-rwi .slot { width: 100%; height: auto; aspect-ratio: 1; max-width: 42px; }
.mazewin .mz-rwr .mz-rwi .slot img { width: 76%; height: 76%; }
@media (max-height: 700px) { .mazewin .pit-row { font-size: 12px; padding: 0; } .mazewin .mz-rw { padding: 4px 8px; } .mazewin .pit-share { display: none; } }
.mazewin .mz-fxrow .mz-fxi.none { height: 28px; display: flex; align-items: center; color: #8fe08a; font-weight: 800; }
.mazewin .mz-rwr { grid-template-columns: repeat(9, minmax(0, 1fr)); } /* (nine at the most: from level 10 the epic chests' Silver chest beside the Wooden) */
.mazewin .mz-rwr .mz-rwi .tmp-ct { font-size: 9px; right: 1px; bottom: 0; padding: 0 1px; background: rgba(0,0,0,.55); border-radius: 2px; line-height: 1.15; }
.mazewin .mz-rwr .mz-rwi .slot img { width: 82%; height: 82%; margin-bottom: 18%; }
.mazewin .pit-share { min-height: 2.6em; }

/* Mass salvage */
.msalv .msv-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 6px; }
.msalv .msv-help { min-width: 30px; padding: 2px 8px; }
.msalv .msv-ranks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 6px; padding: 8px; background: rgba(0,0,0,0.3); border: 1px solid #2a2228; }
.msalv .msv-r, .msalv .msv-auto { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; font-weight: 700; min-height: 26px; user-select: none; }
.msalv .msv-r .rtxt { line-height: 1.1; }
.msalv .msv-box { flex: none; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid currentColor; background: #120c10; color: inherit; font-size: 13px; line-height: 1; }
.msalv .msv-r.on .msv-box, .msalv .msv-auto.on .msv-box { background: #1a2414; color: #a9c27e; border-color: #5e7a44; text-shadow: 0 1px 0 #000; } /* a muted green: on, not glaring */
.msalv .msv-r:not(.on) { opacity: 0.75; }
.msalv .msv-might { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.msalv .msv-might .msv-r { color: #e8dcc8; }
.msalv .msv-get { min-height: 44px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.msalv .msv-auto { margin-top: 10px; padding: 8px 10px; background: linear-gradient(180deg, #6a4a18, #3e2a0c); border: 1px solid #c89a3a; color: #ffe0a0; }
.inv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inv-head .btn { flex: none; }


/* the Shop's Resources packs: what each holds, on small rows */
.rsc-pack .pf-in { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; font-size: 11px; margin: 4px 0; }
.rsc-pack .pf-in img { width: 14px; height: 14px; vertical-align: -3px; }

/* Leaderboards: the list of boards (a picture, the name, an arrow), then one board */
.lbhub .lbhub-list { display: flex; flex-direction: column; gap: 10px; }
.lbhub-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 6px 12px 6px 6px; cursor: pointer;
  background: linear-gradient(180deg, rgba(40,30,34,.95), rgba(18,12,16,.95)); border: 1px solid #5a4630; box-shadow: inset 0 1px 0 rgba(255,220,160,.12), 0 2px 0 #000; }
.lbhub-row::after { content: ''; position: absolute; left: 86px; right: 40px; bottom: 6px; height: 2px; background: linear-gradient(90deg, rgba(232,200,120,.7), rgba(232,200,120,0)); }
.lbhub-row:active { transform: translateY(1px); }
.lbhub-row.locked { filter: grayscale(.8); opacity: .7; }
.lbhub-t { flex: 1; font: 800 17px var(--title, inherit); color: #f4e6c8; text-shadow: 0 2px 0 #000; }
.lbhub-go { font: 800 26px var(--num); color: #e8c878; }
.lbthumb { flex: none; width: 64px; height: 64px; overflow: hidden; border: 2px solid #c89a3a; box-shadow: 0 0 0 2px #1a0e08, 0 3px 6px rgba(0,0,0,.6); background: #120c10; position: relative; }
.lbthumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; image-rendering: pixelated; }
.lbthumb.power { display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, #6a4a20, #1a0e08 75%); }
.lbthumb.power img { width: 80%; height: 80%; object-fit: contain; }
.lbthumb .lbstar { position: absolute; right: 2px; bottom: 2px; }
.lbthumb .lbstar img { width: 16px; height: 16px; }
.lbhead2 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.lbhead2 .lbthumb { width: 52px; height: 52px; }
.lbhead2 .lbt { flex: 1; font: 800 18px var(--title, inherit); color: var(--gold); text-shadow: 0 2px 0 #000; }
.lbhead2 .lbback { flex: none; }
.lbcols { display: grid; grid-template-columns: 70px 1fr auto; gap: 6px; padding: 0 8px 4px; font-weight: 800; color: #c8b890; font-size: 13px; }
.lbwin .lblist { max-height: 46vh; overflow-y: auto; }
.lbrow .lbplace { width: 62px; flex: none; display: flex; align-items: center; gap: 4px; font: 800 13px var(--num); color: #e8dcc8; }
.lbrow .lbplace img { width: 18px; height: 18px; }
.lbrow .lbplace .lbdot { width: 10px; height: 10px; margin: 0 4px; transform: rotate(45deg); background: #6a6070; display: inline-block; }
.lbrow .lbplace.p1 img { filter: drop-shadow(0 0 3px #ffd35a); }
.lbrow .lbplace.p2 img { filter: hue-rotate(170deg) saturate(.4) brightness(1.3); }
.lbrow .lbplace.p3 img { filter: hue-rotate(-25deg) saturate(1.2) brightness(.85); }
.lbrow .lbava { width: 30px; height: 30px; flex: none; border-radius: 50%; overflow: hidden; background: #1a1016; border: 1px solid #4a3a30; }
.lbrow .lbava img { width: 30px; height: 30px; }
.lbme { margin-top: 6px; }
.lbme .lbrow.me { background: radial-gradient(80% 140% at 50% 120%, rgba(255,170,70,.28), transparent 65%), linear-gradient(180deg, #3a2c38, #1a1018); border: 2px solid #050308; box-shadow: inset 0 0 0 2px #e0b050, 0 0 10px rgba(255,170,70,.3); clip-path: var(--notch); }
.lbme .lbrow.me .lbname, .lbme .lbrow.me .lbscore, .lbme .lbrow.me .lbplace { color: #ffe39a; text-shadow: 0 2px 0 #000; }

/* a locked Trial's card: the lock and what opens it, centred, within the card */
.tr-soon { padding: 0 8px; text-align: center; line-height: 1.25; }
.tr-soon span { max-width: 100%; overflow-wrap: anywhere; }

/* the Belfry's and the Dungeon's strip: a finger drags it sideways (the page still scrolls up and down) */
.dun-strip, .dun-strip * { touch-action: none; user-select: none; -webkit-user-select: none; } /* (the browser never takes a drag that starts on the strip: the game turns it, ui.swipeStrip) */

/* The Tasks: the Weekly Vault (three tiers in a centred row, a link between each two), gothic: stone, iron and gold */
.vault { padding: 10px 12px 12px; background: linear-gradient(180deg, #241a22, #120c12); border: 2px solid #050308; box-shadow: inset 0 0 0 2px var(--ring, #3a2c40), inset 0 0 22px rgba(0,0,0,.6); }
.vault-t { text-align: center; font: 800 16px var(--title, inherit); color: var(--gold); text-shadow: 0 2px 0 #000; letter-spacing: .5px; margin-bottom: 24px; }
.vault-row { display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; max-width: 300px; }
.vault-link { flex: 1; height: 6px; margin: 0 -2px; background: #0c080e; border: 1px solid #050308; box-shadow: inset 0 0 0 1px #2a2030; position: relative; z-index: 0; }
.vault-link i { display: block; height: 100%; background: linear-gradient(180deg, #ffe39a, #c8902a); box-shadow: 0 0 6px rgba(255,200,90,.5); }
.vault-box { position: relative; z-index: 1; flex: none; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: linear-gradient(180deg, #3a2c38, #1a1018); border: 2px solid #050308; box-shadow: inset 0 0 0 2px #4a3a48; font: 800 26px var(--num); color: #e8dcc8; }
.vault-box.on { background: radial-gradient(90% 120% at 50% 120%, rgba(255,170,70,.45), transparent 65%), linear-gradient(180deg, #5a2a22, #2a0e10); box-shadow: inset 0 0 0 2px #e0b050, 0 0 12px rgba(255,170,70,.45); color: #ffe39a; text-shadow: 0 0 8px rgba(255,200,100,.8), 0 2px 0 #000; }
.vault-box .vault-at { position: absolute; top: -21px; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 700 12px var(--num); color: #f0e0b0; display: flex; align-items: center; gap: 2px; }
.vault-box .vault-at img { width: 14px; height: 14px; }
.vault-box .vault-q img { width: 20px; height: 20px; opacity: .75; }
.vault-box .vault-ok { position: absolute; bottom: -2px; right: 2px; color: #8ff070; font-style: normal; font-size: 12px; text-shadow: 0 1px 0 #000; }
.vault-box { overflow: visible; }
.vault-pts { display: flex; align-items: center; justify-content: center; gap: 6px; font: 800 26px var(--num); color: #fff; text-shadow: 0 2px 0 #000; }
.vault-pts img { width: 24px; height: 24px; }
.vault-when { color: #e8dcc8; margin-top: 4px; }
.task-tabs { margin-top: 10px; }
.task-refresh { margin: 2px 0 6px; }
.task .task-pts { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.task .task-pts img { width: 30px; height: 30px; }
.task .task-pts b { font: 800 12px var(--num); color: #fff; text-shadow: 0 1px 0 #000; margin-top: -4px; }
.task .bar.gold i { background: linear-gradient(90deg, #c89a3a, #f0d070); }
.task-ok { flex: none; width: 34px; text-align: center; color: #8ff070; font-size: 22px; font-weight: 800; }
.task.done { opacity: .85; }

/* the leaderboard's hero filter: the Armory's gothic filter squares, in one row that scrolls sideways */
.gfilters.lbheroes { display: flex; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: none; }
.gfilters.lbheroes::-webkit-scrollbar { display: none; }
.gfilters.lbheroes .gf { flex: none; width: 44px; }
.gfilters.lbheroes .gf img { width: 34px; height: 34px; opacity: .9; filter: none; }
.tabs.lbperiod { margin-top: 6px; }
.tabs.lbperiod button { min-height: 38px; font-size: 14px; }
.lbhub-row .lbhub-go { color: var(--gold); }
/* v1.61.65: a red badge is always in front: above its neighbours, and never cut off by its own frame's notched corners
   (a frame that holds a badge keeps its square corners instead) */
.badge, .upb, .newdot { z-index: 20; }
:is(.btn, .gf, .pill, .set-tile, .tabs > button, .sidebtn, .pit-shopbtn, .cons-cb):has(> .badge, > .upb, > .newdot) { clip-path: none !important; }
/* the Armory's Resources button (bottom left of the hero) and its window: every resource in stone slots */
.doll .resbtn.allres { top: auto; bottom: 4px; right: auto; left: 4px; width: auto; min-width: 46px; }
.resview .rv-group { margin: 6px 0 10px; }
.resview .rv-head { font-family: var(--title); font-size: 14px; color: var(--gold); letter-spacing: .04em; margin: 0 2px 6px; text-shadow: 0 1px 0 #000; }
.resview .rv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.resview .rv-it { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 5px; border: 2px solid #050308; clip-path: var(--notch); cursor: pointer;
  background: var(--tex-panel, none) 0 0 / 64px 64px, #1b1320; box-shadow: inset 0 0 0 2px var(--ring), inset 3px 3px 0 0 var(--hi), inset -3px -3px 0 0 var(--lo); }
.resview .rv-ic { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 38%, #2e262c, #0c090c 72%); border: 1px solid #050308; }
.resview .rv-ic img { width: 30px; height: 30px; image-rendering: pixelated; }
.resview .rv-it b { font: 13px var(--num); color: #fff; text-shadow: 0 1px 0 #000; }
.resview .rv-it span { font-size: 10px; line-height: 1.1; color: #b8a888; text-align: center; min-height: 22px; display: flex; align-items: center; }
.resview .rv-it.none { opacity: .55; }
.resview .rv-it.none .rv-ic img { filter: grayscale(.8); }
/* the Trials' arches: today's tries left on each open one, a plate at its foot */
.tr-arch .tr-left { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); z-index: 3; white-space: nowrap; padding: 2px 8px;
  font: 800 12px var(--body); color: #ffe6a0; text-shadow: 0 1px 0 #000; background: linear-gradient(180deg, #2a2030, #120c14); border: 2px solid #050308; box-shadow: inset 0 0 0 1px #e0b050; }
.tr-arch .tr-left.none { color: #9a8a80; box-shadow: inset 0 0 0 1px #5a4a50; }
.tr-arch.side .tr-left { font-size: 10px; padding: 1px 5px; bottom: 4px; }

/* ---------------- Loading screen (the game's start, a hall, every Trial) ----------------
 * The picture of what is coming in a gold-ringed arch over its own blurred copy, its name in blackletter, a blood bar
 * with an ember at its tip, and a tip. ui.loading() builds it; the start's #boot uses the same layout. */
.ld { position: fixed; inset: 0; z-index: 200; transition: opacity .45s; overflow: hidden; background: #050306; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; font-family: var(--body); }
.ld .ld-bg { position: absolute; inset: -12px; background-size: cover; background-position: 50% 40%; filter: brightness(.55) saturate(1.05) blur(1.5px); image-rendering: pixelated; transform: scale(1.04); animation: ldzoom 9s ease-out forwards; }
@keyframes ldzoom { from { transform: scale(1.12); } to { transform: scale(1.02); } }
.ld::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 85% 60% at 50% 38%, transparent 30%, rgba(4,2,5,.78) 78%, #040205 100%), linear-gradient(180deg, rgba(4,2,5,.65) 0%, transparent 18%, transparent 46%, rgba(20,2,6,.85) 72%, #050206 100%); }
.ld .ld-arch { position: absolute; z-index: 2; left: 50%; top: 13%; transform: translateX(-50%); width: min(58vw, 250px); aspect-ratio: 2 / 3; border-radius: 999px 999px 0 0; overflow: hidden; border: 2px solid #050308;
  box-shadow: inset 0 0 0 2px #c9953a, inset 0 0 0 3px #1a0e08, 0 0 0 1px #050308, 0 0 40px rgba(255,90,40,.25), 0 14px 40px rgba(0,0,0,.8); background: #0b080d; }
.ld .ld-arch img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
.ld .ld-arch::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 120%, rgba(255,110,40,.28), transparent 60%), linear-gradient(180deg, transparent 60%, rgba(0,0,0,.55)); }
.ld .ld-panel { position: relative; z-index: 3; width: 100%; max-width: 440px; box-sizing: border-box; padding: 0 22px calc(env(safe-area-inset-bottom, 0px) + 34px); display: flex; flex-direction: column; align-items: center; }
.ld .ld-kicker { font-family: var(--title); font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: #b89a6a; display: flex; align-items: center; gap: 10px; text-shadow: 0 2px 0 #000; }
.ld .ld-kicker::before, .ld .ld-kicker::after { content: ''; width: 30px; height: 1px; background: linear-gradient(90deg, transparent, #c8902c); }
.ld .ld-kicker::after { transform: scaleX(-1); }
.ld .ld-title { margin-top: 6px; font-family: 'Unifraktur', var(--title); font-size: clamp(38px, 11vw, 54px); line-height: 1.05; text-align: center;
  background: linear-gradient(180deg, #fff6c8 0%, #f4cc58 38%, #c8902c 62%, #7a5214 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 #1a0406) drop-shadow(0 0 12px rgba(0,0,0,.9)); }
.ld .ld-sub { margin-top: 4px; font-family: var(--title); font-size: 15px; color: #e4d4b4; text-shadow: 0 2px 0 #000; text-align: center; }
.ld .ld-bar { position: relative; width: 100%; max-width: 300px; height: 12px; margin-top: 22px; background: linear-gradient(180deg, #0e080c, #1c1218); border: 2px solid #050308; box-shadow: 0 0 0 1px #8a6a2a, inset 0 2px 4px #000; }
.ld .ld-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #ff7a50 0%, #c8243a 45%, #6a0a1a 100%); box-shadow: 0 0 10px rgba(255,60,40,.6); }
.ld .ld-bar i::after { content: ''; position: absolute; right: -3px; top: -5px; bottom: -5px; width: 8px; background: radial-gradient(ellipse at center, #fff2c0 0%, #ffb050 35%, transparent 72%); filter: blur(.5px); animation: ldember .5s infinite alternate; }
@keyframes ldember { from { opacity: .7; } to { opacity: 1; } }
.ld .ld-bar::before, .ld .ld-bar::after { content: ''; position: absolute; top: 50%; width: 9px; height: 9px; background: #c9953a; border: 1px solid #050308; transform: translateY(-50%) rotate(45deg); z-index: 1; }
.ld .ld-bar::before { left: -9px; } .ld .ld-bar::after { right: -9px; }
.ld .ld-pct { margin-top: 7px; font: 11px var(--num); color: #9a8a78; letter-spacing: .1em; }
.ld .ld-tip { margin-top: 16px; max-width: 330px; text-align: center; font-size: 13px; line-height: 1.4; color: #b8a890; text-shadow: 0 1px 0 #000; }
.ld .ld-tip b { font-family: var(--title); color: #e0b050; font-weight: normal; letter-spacing: .06em; margin-right: 4px; }
.ld.boot .ld-emblem { position: absolute; z-index: 2; left: 50%; top: 20%; transform: translateX(-50%); width: min(40vw, 160px); border-radius: 22%; box-shadow: 0 0 0 2px #050308, 0 0 0 3px #8a6a2a, 0 10px 30px rgba(0,0,0,.7); filter: drop-shadow(0 0 22px rgba(226,56,74,.45)); }
.ld.boot .ld-bg { background: url('../assets/boot-bg.svg') center / auto 100% no-repeat, radial-gradient(ellipse at 50% 40%, #1a0e14 0%, #07050a 70%); filter: brightness(.8); }
.ld.out { opacity: 0; pointer-events: none; }
.ld .ld-arch.zoom img { transform: scale(1.55); transform-origin: 50% 64%; } /* a hall's art has its own arch: cropped past it */
.ld .ld-title { font-size: clamp(32px, 9.5vw, 48px); }
.ld .ld-bar i { width: 0; transition: width .2s linear; }
.ld.boot .ld-title { font-size: clamp(44px, 13vw, 64px); }
.ld.boot .ld-emblem { animation: bootpulse 2.4s infinite ease-in-out; }
#boot .ld-bar i { animation: bootfill 4s cubic-bezier(.2,.7,.3,1) forwards; }
#boot.ready .ld-bar i { animation: none; width: 100%; }
@keyframes bootfill { from { width: 4%; } to { width: 88%; } }
#boot .ld-tip:empty { visibility: hidden; }
.ld .ld-arch::before { content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 2px #c9953a, inset 0 0 0 3px #1a0e08, inset 0 0 18px rgba(0,0,0,.6); }
.ld .ld-arch::after { z-index: 1; }
.res-tip { margin: 8px 2px 2px; padding: 7px 10px; font-size: 12.5px; line-height: 1.35; color: #d8c8a8; text-align: center; background: rgba(40, 24, 10, .55); border: 1px solid #6a4a1c; border-radius: 4px; }
.res-tip b { color: #f0c860; font-family: var(--title); font-weight: normal; }
/* the invitation to rate the game: the nave of the loading screen behind a gold-haloed emblem, the name in blackletter */
.modal.ratewin { text-align: center; max-width: 340px; }
.modal.ratewin .rate-hero { position: relative; height: 158px; margin: -12px -10px 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-bottom: 1px solid rgba(201,149,58,.35); }
.modal.ratewin .rate-hero::before { content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,4,8,0) 40%, rgba(18,10,16,.92) 100%), radial-gradient(ellipse 60% 70% at 50% 50%, rgba(226,56,74,.38), transparent 72%), url('../assets/boot-bg.svg') center 28% / cover no-repeat; filter: saturate(1.05); }
.modal.ratewin .rate-halo { position: relative; width: 112px; height: 112px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(255,214,120,.38) 0%, rgba(255,140,60,.16) 46%, transparent 70%); animation: ratehalo 2.8s infinite ease-in-out; }
.modal.ratewin .rate-halo::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; border: 1px solid rgba(232,190,100,.55); box-shadow: 0 0 18px rgba(255,170,70,.35), inset 0 0 14px rgba(255,170,70,.25); }
@keyframes ratehalo { 0%,100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.04); filter: brightness(1.15); } }
.modal.ratewin .rate-emblem { position: relative; z-index: 1; width: 74px; height: auto; border-radius: 22%; box-shadow: 0 0 0 2px #050308, 0 0 0 3px #c9953a, 0 8px 20px rgba(0,0,0,.8); }
.modal.ratewin .rate-kicker { font-family: var(--title); font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: #b89a6a; display: flex; align-items: center; justify-content: center; gap: 10px; text-shadow: 0 2px 0 #000; margin-top: 10px; }
.modal.ratewin .rate-kicker::before, .modal.ratewin .rate-kicker::after { content: ''; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, #c8902c); }
.modal.ratewin .rate-kicker::after { transform: scaleX(-1); }
.modal.ratewin .rate-title { font-family: 'Unifraktur', var(--title); font-size: 40px; line-height: 1.1; margin-top: 2px;
  background: linear-gradient(180deg, #fff6c8 0%, #f4cc58 38%, #c8902c 62%, #7a5214 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 3px 0 #1a0406) drop-shadow(0 0 10px rgba(0,0,0,.9)); }
.modal.ratewin .rate-text { margin: 8px 6px 16px; font-size: 14px; line-height: 1.5; color: #e4d4b4; }
.modal.ratewin .rate-go { font-size: 17px; letter-spacing: .02em; text-transform: none; padding-left: 8px; padding-right: 8px; white-space: nowrap; }
.modal.ratewin .rate-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 12px 0 2px; flex-wrap: wrap; }
.modal.ratewin .rate-alt { background: none; border: 0; padding: 6px 4px; font: 13px var(--body); color: #a8987e; text-decoration: underline; text-decoration-color: rgba(168,152,126,.4); text-underline-offset: 3px; cursor: pointer; }
.modal.ratewin .rate-alt:active { color: #e4d4b4; }
.modal.ratewin .rate-sep { color: #6a4a1c; font-size: 8px; }
/* admin panel: hints, attention list, folding sections, badges, the pieces, answers */
.ap-hint { color: var(--muted); font-size: 12.5px; line-height: 1.4; margin: 2px 0 6px; }
.ap-alert { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; font-size: 13.5px; border: 1px solid var(--line); background: var(--panel2); }
.ap-alert .btn { flex: none; }
.ap-alert.bad { border-color: var(--blood); background: rgba(176,30,44,.18); color: #ffb0b0; }
.ap-alert.warn { border-color: #b8862c; background: rgba(184,134,44,.14); color: #ffd890; }
.ap-alert.info { border-color: #3a6a9a; background: rgba(58,106,154,.14); color: #b8d8ff; }
.ap-alert.good { border-color: #3a7a4a; background: rgba(58,122,74,.14); color: #a8e8b8; }
.ap-card i { font-style: normal; font-size: 11px; line-height: 1.3; color: var(--muted); opacity: .8; margin-top: 3px; }
.ap-tabs button { position: relative; }
.ap-badge { display: inline-block; margin-left: 4px; min-width: 0; font: 800 11px var(--body); color: #fff; background: var(--blood); padding: 0 5px; border-radius: 8px; }
.ap-badge:empty { display: none; }
.ap-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; margin-bottom: 0; }
.ap-fold > summary::-webkit-details-marker { display: none; }
.ap-fold > summary::before { content: '▸'; color: var(--muted); font-size: 12px; }
.ap-fold[open] > summary::before { content: '▾'; }
.ap-fold[open] > summary { margin-bottom: 6px; }
.ap-chip.hi { border-color: var(--bronze-hi); color: var(--gold-hi); }
.ap-chip.bad { background: var(--blood); color: #fff; border-color: var(--blood); }
.ap-chip.warn { border-color: #b8862c; color: #ffd890; }
.ap-chip.st-on { border-color: #3a7a4a; color: #a8e8b8; }
.ap-chip.st-up { border-color: #3a6a9a; color: #b8d8ff; }
.ap-chip.st-shop { border-color: #b8862c; color: #ffd890; }
.ap-chip.st-end { opacity: .6; }
.ap-ev.ev-end { opacity: .7; }
.ap-ev .ap-row .ap-h { flex: 1; margin: 0; }
.ap-ul { margin: 6px 0; padding-left: 18px; text-align: left; }
.ap-ul li { margin: 2px 0; }
.ap-gear { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px; }
.ap-gi { display: flex; gap: 8px; align-items: center; background: var(--panel2); border: 1px solid var(--line); padding: 4px 6px; }
.ap-gi .slot { width: 40px; height: 40px; flex: none; }
.ap-gi .ap-name { font-size: 13px; }
.ap-reply { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; }
.ap-scroll { overflow-x: auto; }
.ap-fbi.k-bug { border-left: 3px solid var(--blood); }
.ap-fbi.k-idea { border-left: 3px solid #3a6a9a; }
.ap-fbi.k-balance { border-left: 3px solid #b8862c; }

/* ---------- Hero Mastery: the heroes three to a row (Armory), and the Shrine's Blessings, Altar and Archive ---------- */
.hm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; cursor: pointer; }
.hm-head .t { font-weight: 800; font-size: 15px; }
.hm-tot { flex: none; width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #3a2a24, #120c10); border: 2px solid var(--gold); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.hm-tot b { font-size: 18px; color: #fff; }
.hm-tot span { font-size: 9px; color: var(--muted); margin-top: 2px; }
.hm-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 6px; } /* every tile as tall as the tallest */
.hm-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 6px; border-radius: 10px; cursor: pointer; text-align: center;
  background: var(--tex-panel, none) 0 0 / 64px 64px, #1b1320; border: 2px solid #050308; /* the same stone as the Altar's tiles */ box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), inset -2px -2px 0 rgba(0,0,0,.4), 0 3px 0 #000; min-width: 0; }
.hm-tile.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(240,200,96,.3); }
.hm-tile.locked .hm-pic img { filter: grayscale(1) brightness(0.45); }
.hm-name { font-weight: 800; font-size: 12px; line-height: 1.1; min-height: 26px; padding: 0 14px; display: flex; align-items: center; justify-content: center; word-break: break-word; }
.hm-lv { font-size: 11px; color: var(--gold); font-weight: 700; }
.hm-pic { width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at 50% 60%, #3a2a24, #0e080c); border: 2px solid #050308; display: flex; align-items: center; justify-content: center; }
.hm-pic img { width: 48px; height: 48px; }
.hm-bonus { font-size: 10px; color: #9be38a; line-height: 1.15; min-height: 23px; display: flex; align-items: center; justify-content: center; }
.hm-bar { position: relative; flex: none; width: 100%; height: 15px; border-radius: 7px; background: #0c070c; border: 1px solid #050308; overflow: hidden; display: flex; align-items: center; justify-content: center; margin-top: auto; box-shadow: inset 0 1px 2px rgba(0,0,0,.8); }
.hm-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, rgba(200,225,255,.45), rgba(40,70,160,.1) 45%, rgba(0,0,30,.45)), var(--tex-blue, none) 0 0 / 32px 32px, #3a6ad0; box-shadow: inset 0 0 0 1px rgba(170,200,255,.35), 0 0 6px rgba(80,140,255,.5); } /* a gothic blue: the stone texture in blue, lit from above */
.hm-bar span { position: relative; z-index: 1; font-size: 9px; font-weight: 800; color: #fff; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000; line-height: 1; white-space: nowrap; }
.hm-lock { display: flex; flex-direction: column; gap: 3px; width: 100%; align-items: stretch; margin-top: auto; }
.hm-lock .small { font-size: 9px; line-height: 1.1; }
.hm-i { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); background: #1a1220; color: var(--muted); font-size: 11px; font-weight: 800; line-height: 16px; padding: 0; cursor: pointer; }
.hm-sel { position: absolute; top: 3px; left: 4px; color: #5fe05f; font-size: 13px; font-weight: 900; text-shadow: 0 1px 0 #000; }
.hm-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin: 6px 0; }
.hm-li { font-size: 13px; color: #9be38a; }
.shrine-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.shrine-grid .shrine { padding: 8px 4px; }
.shrine-grid .shrine .t { font-size: 12px; line-height: 1.1; }
.shrine-grid .shrine .d { font-size: 10px; min-height: 26px; }
.shrine-grid .shrine img { width: 30px; height: 30px; }
.alt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.alt-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; text-align: center; cursor: pointer; min-width: 0; }
.alt-tile .ico img { width: 40px; height: 40px; }
.alt-tile .t { font-size: 11px; font-weight: 800; line-height: 1.1; min-height: 25px; display: flex; align-items: center; word-break: break-word; }
.alt-tile.done { border-color: #5fa04a; box-shadow: 0 0 0 1px #5fa04a; }
.alt-tile .switch { transform: scale(0.85); }
img.alt-big { width: 72px; height: 72px; }

.alt-tile { position: relative; }
.alt-i { position: absolute; top: 3px; right: 3px; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--line); background: #1a1220; color: var(--muted); font-size: 10px; font-weight: 800; line-height: 13px; text-align: center; pointer-events: none; }
/* the mastery bar's track: a dim, greyish blue stone, not black; the account's bar at the top in the same blue (its own size and shape kept) */
.hm-bar, .topbar .acct .xpbar { background: linear-gradient(180deg, rgba(20,26,40,.62), rgba(12,16,28,.78)), var(--tex-blue, none) 0 0 / 32px 32px, #2a3650; }
.hm-bar i, .topbar .acct .xpbar i { background: linear-gradient(180deg, rgba(225,240,255,.55), rgba(80,140,255,.05) 45%, rgba(0,10,50,.35)), var(--tex-blue, none) 0 0 / 32px 32px, #4f8cf0;
  box-shadow: inset -1px 0 0 rgba(235,245,255,.85), inset 0 0 0 1px rgba(170,205,255,.35), 0 0 7px rgba(90,150,255,.65); } /* a bright edge where it ends */
/* the account's bar: the fill takes the whole inside of the frame (an older height: 100% had pushed it 3px down) */
.topbar .acct .xpbar i { top: 0; bottom: 0; left: 0; height: auto; max-width: 100%; }
.hm-bar i { overflow: hidden; }
/* the loading bar: a few sparks thrown off the bright head of the fill only (the yellow glow at its front) */
.ld .ld-bar i::before { content: ''; position: absolute; right: -7px; top: -9px; bottom: -9px; width: 16px; pointer-events: none; z-index: 2;
  background-image: radial-gradient(circle, #fff6d0 0 0.8px, transparent 1.4px), radial-gradient(circle, #ffc060 0 0.7px, transparent 1.2px), radial-gradient(circle, #ffe8a0 0 0.6px, transparent 1.1px);
  background-repeat: no-repeat; background-size: 4px 4px, 4px 4px, 4px 4px;
  animation: ldSparkHead .55s linear infinite; }
@keyframes ldSparkHead {
  0%   { background-position: 6px 13px, 9px 15px, 4px 12px; opacity: 1; }
  50%  { background-position: 2px 6px, 12px 9px, 1px 4px; opacity: .9; }
  100% { background-position: -2px 0px, 14px 2px, -3px -2px; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ld .ld-bar i::before { animation: none; } }
/* the fight's experience bar in the heroes' mastery style: a dim blue stone track, a blue stone fill with a light
   edge, and its sparks (ui.sparkle); its size unchanged */
#hud .xp { background: linear-gradient(180deg, rgba(20,26,40,.62), rgba(12,16,28,.78)), var(--tex-blue, none) 0 0 / 32px 32px, #2a3650; }
#hud .xp i { position: relative; overflow: hidden; background: linear-gradient(180deg, rgba(225,240,255,.55), rgba(80,140,255,.05) 45%, rgba(0,10,50,.35)), var(--tex-blue, none) 0 0 / 32px 32px, #4f8cf0;
  box-shadow: inset -1px 0 0 rgba(235,245,255,.85), inset 0 0 0 1px rgba(170,205,255,.3), 0 0 8px rgba(90,150,255,.6); }
/* ui.sparkle's sparks: a white-hot core in a blue glow; each flares, drifts a few pixels and dies, and is moved
   elsewhere while out (so they come at random places); moved by transform and opacity only, cheap mid-fight */
.spk { position: absolute; display: block; margin: -2px 0 0 -2px; border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, #fff 0 22%, rgba(200,228,255,.9) 38%, rgba(110,170,255,.35) 58%, rgba(90,150,255,0) 72%);
  mix-blend-mode: screen; will-change: transform, opacity; animation: spkLife 1.4s ease-out infinite; }
@keyframes spkLife {
  0%   { opacity: 0; transform: translate(0, 0) scale(.3); }
  12%  { opacity: var(--pk, 1); transform: translate(calc(var(--dx) * .1), calc(var(--dy) * .1)) scale(1.15); }
  30%  { opacity: calc(var(--pk, 1) * .7); transform: translate(calc(var(--dx) * .3), calc(var(--dy) * .3)) scale(.9); }
  45%  { opacity: var(--pk, 1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.25); } }
@media (prefers-reduced-motion: reduce) { .spk { display: none; } }
/* the Altar, laid out as a shrine: the rank over the mirror with what it does, the chosen artifacts in slots, what the
   last touched one does, and every artifact as an icon on a stone tile (burning when on) */
.altar2 .alt-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.alt-rank { flex: none; display: flex; flex-direction: column; align-items: center; width: 72px; }
.alt-rank b { font: 700 30px/1 'Cinzel', var(--title); white-space: nowrap; margin-bottom: 3px; color: #e8c060; text-shadow: 0 1px 0 #000, 0 -1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 2px 0 #3a2208, 0 0 6px rgba(255,120,30,.45); } /* the rank in the titles' serif, old gold cut into the stone */
.alt-rank img { width: 52px; height: 52px; filter: drop-shadow(0 0 7px rgba(255,110,20,.55)); }
.alt-stats { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; padding-right: 26px; font-size: 13px; font-weight: 700; line-height: 1.25; }
.alt-stats .good { color: #8fd870; }
.altar2 .alt-head .infob { position: absolute; top: 6px; right: 6px; }
.alt-cap { margin: 10px 2px 4px; font-size: 12px; font-weight: 800; color: var(--gold, #e8c060); text-transform: uppercase; letter-spacing: .04em; }
.alt-cap .muted { text-transform: none; letter-spacing: 0; font-weight: 600; }
.alt-slots { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; padding: 5px; border-radius: 8px; background: rgba(10,6,16,.6); border: 1px solid #2a1f34; }
.alt-slot { aspect-ratio: 1; border-radius: 4px; background: linear-gradient(rgba(14,9,12,.55), rgba(14,9,12,.55)), var(--tex-dark, none) 0 0 / 32px 32px, #1a141e; box-shadow: inset 0 0 0 1px rgba(120,100,150,.25), inset 0 2px 4px rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 0; border: 0; min-width: 0; }
.alt-slot.full { background: radial-gradient(circle at 50% 75%, rgba(255,150,40,.6), rgba(170,40,0,.35) 55%, rgba(0,0,0,0) 80%), var(--tex-dark, none) 0 0 / 32px 32px, #2a1408; box-shadow: inset 0 0 0 1px rgba(255,170,70,.7), 0 0 5px rgba(255,100,20,.5); cursor: pointer; }
.alt-slot img { width: 88%; height: 88%; }
.altar2 .alt-desc { display: flex; align-items: center; gap: 10px; min-height: 64px; margin-top: 8px; padding: 8px 10px; }
.altar2 .alt-desc .ico img { width: 44px; height: 44px; }
.altar2 .alt-desc .t { font-weight: 800; margin-bottom: 2px; }
.altar2 .alt-desc .d { font-size: 12px; line-height: 1.35; }
.alt-icons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.alt-ic { position: relative; aspect-ratio: 1; padding: 3px; border-radius: 6px; border: 1px solid #3a2c34; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.35)), var(--tex-stone, none) 0 0 / 48px 48px, #2a2228; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); cursor: pointer; display: flex; align-items: center; justify-content: center; min-width: 0; }
.alt-ic img { position: relative; z-index: 1; width: 100%; height: 100%; }
.alt-ic.on { background: radial-gradient(circle at 50% 80%, rgba(255,170,50,.75), rgba(200,60,0,.45) 50%, rgba(60,10,0,.2) 85%), var(--tex-stone, none) 0 0 / 48px 48px, #3a1a0c; border-color: #ffa040; box-shadow: 0 0 7px rgba(255,110,20,.65), inset 0 0 0 1px rgba(255,220,150,.35); }
.alt-ic.on::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(ellipse at 50% 100%, rgba(255,200,80,.55), rgba(255,90,10,0) 65%); animation: altEmber 1.3s ease-in-out infinite alternate; }
@keyframes altEmber { from { opacity: .45; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .alt-ic.on::before { animation: none; } }
.alt-ic.locked img { filter: grayscale(1) brightness(0.35); }
.alt-ic.focus { outline: 2px solid #f0c860; outline-offset: 0; }
.alt-stats .alt-st { grid-column: 1 / -1; font-size: 11px; color: var(--gold, #e8c060); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 1px; }
.alt-stats .foe { color: #ff9f7a; }
.ss-wpn .ss-wtxt { padding: 4px 8px 0; color: #8fd870; }
.altar2 .alt-desc .alt-tg { flex: none; align-self: center; min-width: 86px; }
.ss-tm .ss-tml { padding: 2px 8px 0; display: flex; flex-direction: column; gap: 3px; }
.ss-tm .ss-tmr { font-size: 12px; line-height: 1.3; }
.ss-tm .ss-tmr b { color: #8fd870; margin-right: 6px; }
.altar2 .alt-hint { margin: -2px 0 6px; }
.altpop .ap-head { display: flex; gap: 12px; align-items: flex-start; }
.altpop .ap-ico { flex: none; width: 64px; height: 64px; padding: 4px; border-radius: 8px; border: 1px solid #3a2c34; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.35)), var(--tex-stone, none) 0 0 / 48px 48px, #2a2228; }
.altpop .ap-ico img { width: 100%; height: 100%; }
.altpop .ap-ico.on { background: radial-gradient(circle at 50% 80%, rgba(255,170,50,.75), rgba(200,60,0,.45) 50%, rgba(60,10,0,.2) 85%), var(--tex-stone, none) 0 0 / 48px 48px, #3a1a0c; border-color: #ffa040; box-shadow: 0 0 7px rgba(255,110,20,.65); }
.altpop .ap-ico.locked img { filter: grayscale(1) brightness(0.35); }
.altpop .ap-d { font-size: 14px; line-height: 1.4; margin-top: 2px; }
/* Hero Mastery's total: a gothic lancet of stone rimmed in old gold, the number carved in the titles' serif */
.hm-totw { flex: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.7)) drop-shadow(0 0 5px rgba(255,140,40,.25)); }
.hm-tot { width: 64px; height: 78px; padding: 2px; border: none; border-radius: 0; display: block;
  background: linear-gradient(180deg, #f6dc8c, #b07a24 45%, #6a4210 70%, #d8a840);
  clip-path: path('M0 78 L0 34 Q3 13 32 0 Q61 13 64 34 L64 78 Z'); }
.hm-tot .hm-in { width: 60px; height: 74px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 12px; box-sizing: border-box;
  background: radial-gradient(ellipse at 50% 45%, rgba(255,150,50,.16), rgba(0,0,0,.6) 75%), var(--tex-stone, none) 0 0 / 48px 48px, #2a2228;
  clip-path: path('M0 74 L0 33 Q3 13 30 0 Q57 13 60 33 L60 74 Z'); box-shadow: inset 0 0 0 1px rgba(0,0,0,.6); }
.hm-tot .hm-orn { position: absolute; top: 14px; left: 50%; width: 6px; height: 6px; margin-left: -3px; transform: rotate(45deg); background: linear-gradient(135deg, #fff0b0, #b07a24); box-shadow: 0 0 0 1px #1a0e06; }
.hm-tot .hm-in { position: relative; }
.hm-tot b { font: 700 25px/1 'Cinzel', var(--title); color: #e8c060; margin-top: 6px; text-shadow: 0 1px 0 #000, 0 -1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 2px 0 #3a2208, 0 0 6px rgba(255,120,30,.45); }
.hm-tot span { font: 700 8px/1 'Cinzel', var(--title); color: #c8a868; text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; text-shadow: 0 1px 0 #000; }
.hm-tot b.long { font-size: 18px; }
