/* ASCEND — production stylesheet. Implements the design system in /design (style.css + rank-tiers.css). */

@font-face { font-family: 'Cinzel'; src: url('../fonts/cinzel-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Cinzel'; src: url('../fonts/cinzel-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Special Elite'; src: url('../fonts/special-elite-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('../fonts/ibm-plex-sans-300.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('../fonts/ibm-plex-sans-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('../fonts/ibm-plex-sans-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('../fonts/ibm-plex-sans-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --bg-0: #000; --bg-1: #0A0A0A; --bg-grad: linear-gradient(178deg, #141414 0%, #080808 40%, #000 100%);
  --text: #F2F2F0; --dim: #8E8E8E; --faint: #4A4A4A; --hair: rgba(255, 255, 255, .16); --hair-faint: rgba(255, 255, 255, .09);
  --success: #34D399; --success-glow: rgba(52, 211, 153, .35); --gold: #F0C24B; --gold-glow: rgba(240, 194, 75, .35);
  --danger: #F0546B; --danger-glow: rgba(240, 84, 107, .3); --warning: #E3A63C;
  --xp: #6FAEFF; --xp-glow: rgba(111, 174, 255, .5); --violet: #7C5CFC;
  --rank-main: #EDEDED; --rank-secondary: #6B6B6B; --rank-glow: rgba(237, 237, 237, .18);
  --font-display: 'Cinzel', serif; --font-eyebrow: 'Special Elite', ui-monospace, monospace; --font-body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --r-sm: 3px; --r-md: 8px; --r-lg: 14px; --r-pill: 999px;
  --ease: cubic-bezier(.2, .8, .2, 1); --dur-fast: 120ms; --dur-base: 220ms;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --nav-h: 58px;
  /* aliases used by inline styles in templates */
  --cy: var(--xp); --display: var(--font-display); --red: var(--danger); --green: var(--success); --accent: var(--rank-main); --accent2: var(--rank-secondary);
}
/* rank accent tiers (engine tier names -> design tiers 1..7) */
[data-tier="iron"] { --rank-main: #EDEDED; --rank-secondary: #6B6B6B; --rank-glow: rgba(237, 237, 237, .18); }
[data-tier="jade"] { --rank-main: #FFFFFF; --rank-secondary: #8A8A8A; --rank-glow: rgba(255, 255, 255, .28); }
[data-tier="azure"] { --rank-main: #CFE3FF; --rank-secondary: #7C93B8; --rank-glow: rgba(111, 174, 255, .30); }
[data-tier="violet"] { --rank-main: #9FCBFF; --rank-secondary: #5E7DA8; --rank-glow: rgba(111, 174, 255, .42); }
[data-tier="ember"] { --rank-main: #6FAEFF; --rank-secondary: #EDEDED; --rank-glow: rgba(111, 174, 255, .55); }
[data-tier="apex"] { --rank-main: #FFFFFF; --rank-secondary: #6FAEFF; --rank-glow: rgba(255, 255, 255, .6); }
[data-tier="form"] { --rank-main: #FFFFFF; --rank-secondary: #6FAEFF; --rank-glow: rgba(255, 255, 255, .85); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg-0); }
body { font-family: var(--font-body); font-weight: 300; font-size: 14px; line-height: 1.45; color: var(--text); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background:
  radial-gradient(1px 1px at 10% 5%, rgba(255, 255, 255, .4), transparent), radial-gradient(1px 1px at 36% 3%, rgba(255, 255, 255, .3), transparent),
  radial-gradient(1px 1px at 62% 8%, rgba(255, 255, 255, .4), transparent), radial-gradient(1px 1px at 82% 4%, rgba(255, 255, 255, .3), transparent),
  radial-gradient(1.5px 1.5px at 92% 12%, rgba(255, 255, 255, .45), transparent), var(--bg-grad); }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
input, textarea, select { -webkit-user-select: text; user-select: text; }
textarea::placeholder, input::placeholder { color: var(--faint); }
h1, h2, h3, p { margin: 0; font-weight: inherit; }
b, strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding: calc(var(--sat) + 14px) 20px calc(var(--nav-h) + var(--sab) + 28px); }
#view > section.enter { animation: fade var(--dur-base) var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
@keyframes fadein { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* boot */
.boot { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 22px; color: var(--faint); font-family: var(--font-eyebrow); letter-spacing: .2em; font-size: 10px; text-transform: lowercase; }
.boot-sigil { width: 40px; height: 40px; border: 1.5px solid var(--text); transform: rotate(45deg); animation: pulse 1.6s ease-in-out infinite; box-shadow: 0 0 24px var(--xp-glow); }
@keyframes pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

/* titles + section headers */
.title { padding: 0 0 16px; }
.title small, .eyebrow, .tile small, label.f, .vs .h { font-family: var(--font-eyebrow); font-size: 10px; letter-spacing: .1em; color: var(--faint); text-transform: lowercase; font-weight: 400; }
.title small { display: block; }
.title h1 { font-family: var(--font-display); font-weight: 600; font-size: 40px; line-height: 1.1; margin-top: 2px; }
.eyebrow { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 22px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--hair-faint); }
.eyebrow b { color: var(--xp); font-weight: 400; }
.eyebrow + .panel, .eyebrow + .tiles, .eyebrow + .ladder, .eyebrow + .heat { margin-top: 12px; }

/* panel */
.panel { position: relative; border: 1px solid var(--hair-faint); border-radius: var(--r-lg); padding: 16px; }
.panel.glow { border-color: var(--rank-glow); box-shadow: 0 0 24px var(--rank-glow) inset; }
.panel + .panel { margin-top: 12px; }

/* emblem */
.emblem { position: relative; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; flex: none; }
.emblem svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transform-origin: 50% 50%; }
.emblem .emblem-halo { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, var(--rank-glow), transparent 70%); }
.emblem .glyph { position: relative; font-family: var(--font-display); font-weight: 600; font-size: 16px; line-height: 1; color: var(--rank-main); }
.emblem .glyph.long { font-size: 11px; letter-spacing: -.02em; }
.emblem.md { width: 72px; height: 72px; } .emblem.md .glyph { font-size: 26px; } .emblem.md .glyph.long { font-size: 17px; }
.emblem.lg { width: 96px; height: 96px; } .emblem.lg .glyph { font-size: 30px; } .emblem.lg .glyph.long { font-size: 21px; }
.emblem.xl { width: 120px; height: 120px; } .emblem.xl .glyph { font-size: 40px; } .emblem.xl .glyph.long { font-size: 27px; }
.emblem .ring-inner, .emblem .ticks-dashed { display: none; }
.emblem-t1 .ring { opacity: .5; } .emblem-t2 .ring { opacity: .8; }
.emblem-t3 .ring-inner, .emblem-t4 .ring-inner, .emblem-t5 .ring-inner, .emblem-t6 .ring-inner, .emblem-t7 .ring-inner { display: block; }
.emblem-t4 .emblem-halo { filter: blur(6px); opacity: .7; } .emblem-t5 .emblem-halo { filter: blur(8px); opacity: .85; }
.emblem-t5 .ticks-dashed, .emblem-t6 .ticks-dashed, .emblem-t7 .ticks-dashed { display: block; }
.emblem-t6 .emblem-halo { filter: blur(10px); opacity: .9; animation: emblem-pulse 2.4s ease-in-out infinite; }
.emblem-t6 .ring { animation: spin 18s linear infinite; }
.emblem-t7 .emblem-halo { filter: blur(12px); animation: emblem-pulse 1.8s ease-in-out infinite; }
.emblem-t7 .ring { animation: spin 10s linear infinite; } .emblem-t7 .ring-inner { animation: spin 14s linear infinite reverse; }
.emblem-t7::after { content: ''; position: absolute; inset: -14px; border-radius: 50%; background: conic-gradient(from 0deg, transparent, var(--rank-secondary), transparent 40%); opacity: .35; filter: blur(6px); animation: spin 6s linear infinite; }
@keyframes emblem-pulse { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }

/* HUD */
.hud { display: flex; align-items: center; gap: 12px; }
.hud > div:nth-child(2) { flex: 1; min-width: 0; }
.hud-name { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-weight: 600; font-size: 15px; }
.hud-name em { font-style: normal; font-family: var(--font-eyebrow); font-weight: 400; font-size: 10px; letter-spacing: .1em; color: var(--rank-main); text-transform: uppercase; }
.hud-sub { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--dim); margin-top: 2px; }
.hud-sub b { color: var(--text); font-weight: 500; }
.bar { position: relative; height: 1px; background: var(--hair-faint); border-radius: 2px; margin-top: 8px; }
.bar > i { position: absolute; left: 0; top: -1px; height: 3px; max-width: 100%; border-radius: 2px; background: var(--xp); box-shadow: 0 0 8px var(--xp-glow); transition: width 250ms ease-out; }
.bar.thin { margin-top: 7px; }
.bar.gold > i { background: var(--gold); box-shadow: 0 0 8px var(--gold-glow); }
.bar.red > i { background: var(--danger); box-shadow: 0 0 8px var(--danger-glow); }
.ring { position: relative; width: 44px; height: 44px; display: grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .t { stroke: var(--hair-faint); }
.ring .p { stroke: var(--xp); stroke-linecap: round; transition: stroke-dashoffset 400ms var(--ease); }
.ring.perfect .p { stroke: var(--gold); }
.ring b { font-weight: 600; font-size: 12px; } .ring b small { font-size: 9px; font-weight: 400; }
.chips { display: flex; gap: 8px; margin-top: 12px; }
.chip { flex: 1; min-width: 0; text-align: center; border: 1px solid var(--hair-faint); border-radius: var(--r-pill); padding: 6px 4px; font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip b { font-weight: 500; color: var(--text); }
.chip.gold { border-color: rgba(240, 194, 75, .35); color: var(--gold); } .chip.gold b { color: var(--gold); }

/* banners */
.banner { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; margin-top: 16px; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--hair); font-size: 12.5px; line-height: 1.4; color: var(--dim); }
.banner .ico { font-size: 16px; line-height: 1.2; flex: none; }
.banner b { display: block; font-family: var(--font-eyebrow); font-weight: 400; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 3px; color: var(--text); }
.banner.gold { border-color: rgba(240, 194, 75, .35); background: rgba(240, 194, 75, .06); } .banner.gold b { color: var(--gold); }
.banner.red { border-color: rgba(240, 84, 107, .35); background: rgba(240, 84, 107, .06); } .banner.red b { color: var(--danger); }
.banner.cy b { color: var(--xp); }
.banner.ok { border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .05); } .banner.ok b { color: var(--success); }

/* quest rows */
.quest { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hair-faint); border-radius: 0; transition: opacity 400ms ease-out; position: relative; }
.check { position: relative; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--hair); flex: none; display: grid; place-items: center; transition: background var(--dur-base), border-color var(--dur-base), border-radius var(--dur-base); }
.check::before { content: ""; position: absolute; inset: -10px; } /* 44px touch target */
.check svg { width: 13px; height: 13px; fill: none; stroke: #04140D; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.4); transition: all var(--dur-base) var(--ease); }
.check:active { transform: scale(.88); }
.done > .check, .check.on { background: var(--success); border-color: var(--success); border-radius: 6px; }
.done > .check svg, .check.on svg { opacity: 1; transform: none; }
.q-ico { font-size: 16px; flex: none; }
.q-body { flex: 1; min-width: 0; text-align: left; }
.q-name { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-weight: 500; font-size: 14px; }
.q-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-name .rew { flex: none; font-weight: 300; font-size: 11px; color: var(--gold); }
.q-meta, .q-prog { display: flex; flex-wrap: wrap; font-size: 10.5px; color: var(--dim); margin-top: 3px; }
.q-prog { margin-top: 5px; }
.q-meta > span + span::before, .q-prog > span + span::before { content: "·"; margin: 0 6px; color: var(--faint); }
.q-prog b { font-weight: 400; color: inherit; }
.q-meta .imp { color: var(--danger); }
.quest.done { opacity: .5; } .quest.done .q-name > span:first-child { text-decoration: line-through; color: var(--dim); }
.quest.done .q-meta, .quest.done .q-prog { color: var(--success); }
.quest.just { animation: questflash 900ms ease-out; opacity: 1; }
@keyframes questflash { 0%, 55% { background: rgba(52, 211, 153, .08); box-shadow: 0 0 16px rgba(52, 211, 153, .18), 0 0 0 1px rgba(52, 211, 153, .3); border-radius: var(--r-md); opacity: 1; } 100% { background: none; box-shadow: none; opacity: .5; } }
.plus { flex: none; min-width: 48px; min-height: 44px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid var(--hair); font-family: var(--font-eyebrow); font-size: 11px; letter-spacing: .1em; color: var(--xp); }
.plus:active { transform: scale(.95); }
/* missions */
.quest.weekly .rew, .quest.challenge .rew, .quest.side .rew { color: var(--gold); }
.quest.boss { display: block; padding: 12px; margin: 10px 0 4px; border: 1px solid rgba(240, 84, 107, .4); border-radius: var(--r-md); background: rgba(240, 84, 107, .05); }
.quest.boss .q-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--danger); } .quest.boss .rew { font-family: var(--font-body); color: var(--danger); }
.quest.boss .q-body { width: 100%; }
.quest.recovery { padding: 10px 12px; margin-top: 10px; border: 1px dashed rgba(240, 84, 107, .4); border-radius: var(--r-md); }
.quest.recovery .rew { color: var(--danger); } .quest.recovery .plus { border-color: var(--danger); color: var(--danger); }
.r-ico { width: 32px; height: 32px; border-radius: 50%; border: 1px dashed var(--danger); display: grid; place-items: center; flex: none; font-size: 15px; }
.quest.boss.done, .quest.recovery.done { opacity: .55; }
.empty { text-align: center; color: var(--dim); font-size: 13px; padding: 28px 16px; line-height: 1.5; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid var(--hair); font-family: var(--font-eyebrow); font-size: 11px; letter-spacing: .1em; color: var(--text); }
.btn:active { transform: scale(.98); }
.btn.primary { min-height: 48px; border: 0; background: linear-gradient(90deg, var(--violet), var(--xp)); color: #050505; font-family: var(--font-body); font-weight: 600; font-size: 14px; letter-spacing: 0; }
.btn.danger { border-color: rgba(240, 84, 107, .4); color: var(--danger); }
.btn.sm { width: auto; min-height: 36px; padding: 0 12px; }
.btn-row { display: flex; gap: 10px; margin-top: 16px; }
.fab { position: fixed; right: max(20px, calc(50% - 260px)); bottom: calc(var(--nav-h) + var(--sab) + 20px); z-index: 5; width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(135deg, var(--violet), var(--xp)); color: #04101F; font-size: 28px; font-weight: 300; line-height: 1; box-shadow: 0 6px 24px rgba(111, 174, 255, .4); }
label.f { display: block; margin-top: 14px; }
.inp { display: block; width: 100%; margin-top: 6px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--hair); border-radius: var(--r-md); background: none; outline: none; font-family: var(--font-body); font-weight: 300; font-size: 16px; letter-spacing: 0; text-transform: none; color: var(--text); }
.inp:focus { border-color: var(--xp); }
textarea.inp { min-height: 88px; resize: none; line-height: 1.45; }
select.inp { appearance: none; -webkit-appearance: none; }
select.inp option { background: #0A0A0A; color: var(--text); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pick label { position: relative; } .pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick span, .pick .tag { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--hair); font-family: var(--font-body); font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--dim); }
.pick input:checked + span { border-color: var(--xp); color: var(--text); background: rgba(111, 174, 255, .12); font-weight: 500; }
.pick .tag { min-width: 36px; padding: 0; border-radius: var(--r-md); border-color: var(--hair-faint); font-size: 17px; }
.onb .pick span { min-height: 44px; padding: 0 16px; font-size: 13px; }
.switch { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--hair-faint); }
.switch div { font-weight: 500; font-size: 14px; } .switch small { display: block; font-weight: 300; font-size: 11.5px; color: var(--dim); margin-top: 3px; line-height: 1.4; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 44px; height: 26px; margin: 0; border-radius: var(--r-pill); border: 1px solid var(--hair); background: none; transition: background var(--dur-base); }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--dim); transition: transform var(--dur-base) var(--ease), background var(--dur-base); }
.switch input:checked { background: var(--xp); border-color: var(--xp); } .switch input:checked::after { background: #fff; transform: translateX(18px); }
form[data-kind="check"] .if-num, form[data-metric="check"] .if-target, form[data-metric="check"] .if-link, form[data-metric="manual"] .if-link,
form[data-metric="count"] .if-manual, form[data-metric="sum"] .if-manual { display: none; }

/* segmented */
.seg { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--hair-faint); border-radius: var(--r-pill); overflow-x: auto; scrollbar-width: none; margin-bottom: 8px; } .seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; min-height: 36px; padding: 0 12px; border-radius: var(--r-pill); font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.seg button.on { background: var(--xp); color: #04101F; font-weight: 600; }

/* nav */
#nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--bg-0); border-top: 1px solid var(--hair-faint); padding-bottom: var(--sab); }
#nav .in { max-width: 560px; margin: 0 auto; display: flex; height: var(--nav-h); padding: 0 12px; }
#nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-family: var(--font-eyebrow); font-size: 9px; text-transform: lowercase; }
#nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#nav button.on { color: var(--xp); }

/* sheets */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .5); animation: fadein var(--dur-base); }
.sheet { width: 100%; max-width: 560px; max-height: calc(100% - var(--sat) - 28px); overflow-y: auto; overscroll-behavior: contain; background: var(--bg-1); border: 1px solid var(--hair-faint); border-bottom: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -8px 32px rgba(0, 0, 0, .6); padding: 12px 20px calc(var(--sab) + 22px); animation: up 260ms var(--ease); }
@keyframes up { from { transform: translateY(100%); } }
.sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--hair); margin: 0 auto 14px; }
.sheet h2 { display: flex; align-items: center; gap: 8px; font-family: var(--font-body); font-weight: 600; font-size: 17px; }
.sheet .x { margin-left: auto; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .06); color: var(--dim); display: grid; place-items: center; flex: none; position: relative; }
.sheet .x::before { content: ""; position: absolute; inset: -8px; } .sheet .x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sheet .sub { font-size: 12px; color: var(--dim); margin-top: 4px; line-height: 1.45; }
.bigval { font-family: var(--font-display); font-weight: 600; font-size: 44px; line-height: 1.1; margin: 18px 0 14px; }
.bigval small { font-family: var(--font-body); font-weight: 300; font-size: 16px; color: var(--dim); }
.sheet .note { margin-top: 10px; padding: 10px 12px; border-left: 2px solid var(--hair); font-size: 13px; line-height: 1.45; }
.sheet .note.bad { border-color: var(--danger); } .sheet .note.warn { border-color: var(--warning); } .sheet .note b { display: block; font-family: var(--font-eyebrow); font-weight: 400; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); margin-bottom: 2px; }

/* tiles & stats */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .tiles.t3 { grid-template-columns: 1fr 1fr 1fr; text-align: center; }
.tile { border: 1px solid var(--hair-faint); border-radius: var(--r-md); padding: 10px 12px; min-width: 0; }
.tile small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 20px; margin-top: 2px; }
.tile b small { display: inline; font-family: var(--font-body); font-size: 11px; letter-spacing: 0; text-transform: none; color: var(--dim); }
.tile.xp b { color: var(--xp); } .tile.gold b { color: var(--gold); }
.statrow { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 11px; }
.statrow span { width: 36px; flex: none; color: var(--dim); } .statrow .bar { flex: 1; margin: 0; } .statrow em { width: 38px; flex: none; text-align: right; font-style: normal; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding-top: 10px; }
.chart .col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.chart .col i { width: 100%; max-width: 20px; min-height: 2px; background: var(--xp); opacity: .6; transition: height 400ms var(--ease); }
.chart .col.cur i { opacity: 1; } .chart .col.gold i { background: var(--gold); }
.chart .col small { font-family: var(--font-eyebrow); font-size: 8px; color: var(--faint); white-space: nowrap; }
.vs-title { font-weight: 600; font-size: 14px; }
.vs { display: grid; grid-template-columns: 2fr 1fr 1fr auto; align-items: center; margin-top: 12px; font-size: 12.5px; }
.vs > * { padding: 6px 0; border-top: 1px solid var(--hair-faint); } .vs .h { border-top: 0; text-transform: uppercase; text-align: right; } .vs .h:first-child { text-align: left; }
.vs b { font-weight: 400; text-align: right; } .vs em { font-style: normal; text-align: right; color: var(--dim); }
.delta { font-size: 10.5px; text-align: right; padding-left: 10px !important; min-width: 58px; } .delta.up { color: var(--success); } .delta.down { color: var(--danger); } .delta.flat { color: var(--faint); }
.insight { display: flex; gap: 10px; margin-top: 8px; padding: 10px 12px; border-left: 2px solid var(--xp); font-size: 12.5px; line-height: 1.5; }
.insight.up { border-color: var(--success); } .insight.down { border-color: var(--danger); } .insight.warn { border-color: var(--gold); } .insight .ico { flex: none; }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; } .cal-head b { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.cal-head button { width: 44px; height: 36px; color: var(--dim); display: grid; place-items: center; } .cal-head button:disabled { opacity: .25; }
.cal-head svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.cal .wd { text-align: center; font-family: var(--font-eyebrow); font-size: 9px; color: var(--faint); }
.day { aspect-ratio: 1; border-radius: 6px; display: grid; place-items: center; position: relative; font-size: 11px; font-weight: 400; color: #04101F; background: rgba(255, 255, 255, .05); border: 1.5px solid transparent; }
.day.none { color: var(--dim); } .day.out { visibility: hidden; } .day.future { background: none; color: var(--faint); pointer-events: none; }
.day.l0 { background: rgba(240, 84, 107, .35); color: var(--text); } .day.l1 { background: rgba(240, 194, 75, .35); color: var(--text); } .day.l2 { background: var(--xp); } .day.l3 { background: var(--success); } .day.perfect { background: var(--gold); }
.day.today { border-color: var(--xp); } .day.today.none { background: none; color: var(--xp); }
.day.j::after { content: ""; position: absolute; bottom: 3px; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .7; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 12px; font-size: 9.5px; color: var(--dim); } .legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 9px); grid-auto-columns: 9px; gap: 2px; overflow-x: auto; scrollbar-width: none; direction: rtl; padding-bottom: 4px; } .heat::-webkit-scrollbar { display: none; }
.heat i { border-radius: 2px; background: rgba(255, 255, 255, .05); } .heat i.l0 { background: rgba(240, 84, 107, .45); } .heat i.l1 { background: rgba(240, 194, 75, .4); } .heat i.l2 { background: var(--xp); } .heat i.l3 { background: var(--success); } .heat i.perfect { background: var(--gold); } .heat i.none { opacity: .5; }

/* hero */
.hero-top { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 20px; }
.hero-top h2 { font-weight: 600; font-size: 16px; margin-top: 10px; }
.hero-top .ttl { font-family: var(--font-eyebrow); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--rank-main); margin-top: 2px; }
.ladder { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; } .ladder::-webkit-scrollbar { display: none; }
.rk { flex: none; width: 46px; height: 46px; border-radius: 10px; border: 1px solid var(--hair-faint); display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 13px; color: var(--faint); }
.rk small { font-family: var(--font-body); font-size: 8px; }
.rk.cur { border-color: var(--xp); box-shadow: 0 0 10px var(--xp-glow); color: var(--text); }
.rk.lock { border-style: dashed; opacity: .4; } .rk svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.beyond { text-align: center; } .beyond .q { font-family: var(--font-display); font-size: 22px; letter-spacing: .3em; color: var(--faint); margin-top: 8px; } .beyond p { font-size: 12px; color: var(--dim); margin-top: 6px; }
.beyond small { display: block; margin-top: 8px; font-family: var(--font-eyebrow); font-size: 10px; letter-spacing: .1em; color: var(--faint); text-transform: lowercase; }
.form-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--hair-faint); font-size: 13.5px; } .form-row:first-child { border-top: 0; }
.form-row .n { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--hair-faint); display: grid; place-items: center; font-size: 11px; color: var(--dim); flex: none; }
.form-row b { font-family: var(--font-display); font-weight: 500; } .form-row small { margin-left: auto; font-size: 11px; color: var(--dim); }
.form-row.got .n { border-color: var(--xp); color: var(--xp); box-shadow: 0 0 8px var(--xp-glow); } .form-row.locked b { color: var(--faint); letter-spacing: .2em; }
.ach { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hair-faint); opacity: .55; } .ach.got { opacity: 1; }
.ach .ico { font-size: 20px; flex: none; } .ach > div:nth-child(2) { flex: 1; min-width: 0; } .ach b { font-weight: 500; font-size: 13.5px; } .ach p { font-size: 10.5px; color: var(--faint); margin-top: 2px; }
.ach .bar { width: 140px; max-width: 100%; margin-top: 6px; } .ach em { flex: none; font-style: normal; font-size: 11px; color: var(--dim); text-align: right; } .ach.got em { color: var(--success); }
.radar { display: block; width: 100%; max-width: 260px; margin: 4px auto 8px; } .radar text { font-family: var(--font-eyebrow); font-size: 10px; fill: var(--dim); }

/* list rows */
.row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 0; border-bottom: 1px solid var(--hair-faint); }
.row .ico { font-size: 22px; flex: none; } .row .m { flex: 1; min-width: 0; } .row .m b { display: block; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .m small { display: block; font-size: 11.5px; color: var(--dim); margin-top: 2px; } .row .r { flex: none; text-align: right; font-family: var(--font-eyebrow); font-size: 9px; color: var(--dim); }
.row .r b { display: block; font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--text); } .row.off { opacity: .5; }
.tag { display: inline-block; font-family: var(--font-eyebrow); font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); border: 1px solid var(--hair-faint); border-radius: var(--r-pill); padding: 3px 8px; }
.tag.ok { color: var(--success); border-color: rgba(52, 211, 153, .4); } .tag.bad { color: var(--danger); border-color: rgba(240, 84, 107, .4); }
.obj { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 0; border-top: 1px solid var(--hair-faint); font-size: 13px; } .obj:last-child { border-bottom: 1px solid var(--hair-faint); }
.obj .check { width: 20px; height: 20px; border-radius: 6px; } .obj .check svg { width: 11px; height: 11px; } .obj.on span { text-decoration: line-through; color: var(--dim); }
details.help { border-bottom: 1px solid var(--hair-faint); padding: 14px 0; font-size: 13.5px; } details.help summary { list-style: none; display: flex; justify-content: space-between; } details.help summary::-webkit-details-marker { display: none; }
details.help summary::after { content: "+"; color: var(--dim); } details.help[open] summary::after { content: "–"; } details.help ol { margin: 10px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--dim); line-height: 1.6; } details.help li b { color: var(--text); font-weight: 500; }
.fine { font-size: 12px; color: var(--dim); line-height: 1.5; } .fine b { color: var(--text); }

/* celebration overlays */
.fx { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; text-align: center; background: radial-gradient(ellipse at center, #0c0c0c, #000); animation: fadein 250ms var(--ease); }
.fx.out { animation: fadeout 300ms forwards; }
.fx-in { display: flex; flex-direction: column; align-items: center; animation: fxpop 250ms var(--ease); max-width: 300px; }
@keyframes fxpop { from { transform: scale(.8); opacity: 0; } }
.fx-eyebrow { font-family: var(--font-eyebrow); font-size: 12px; letter-spacing: .1em; text-transform: lowercase; color: var(--dim); margin-top: 14px; }
.fx p { font-size: 14px; margin-top: 6px; line-height: 1.5; } .fx p b { font-weight: 600; }
.fx-num { font-family: var(--font-display); font-weight: 600; font-size: 96px; line-height: 1; text-shadow: 0 0 30px var(--xp-glow); animation: glowpulse 2s ease-in-out; }
@keyframes glowpulse { 50% { text-shadow: 0 0 60px var(--xp-glow), 0 0 20px var(--xp-glow); } }
.fx-icon { font-size: 56px; line-height: 1; }
.fx-level .fx-eyebrow { order: -1; margin: 0 0 8px; }
.fx-form .fx-eyebrow { color: var(--xp); } .fx-rank .emblem .ring, .fx-online .emblem .ring { animation: ringin 900ms var(--ease); }
@keyframes ringin { from { transform: rotate(-180deg) scale(.6); opacity: 0; } }
.fx-perfect { background: radial-gradient(ellipse at center, rgba(240, 194, 75, .12), #000 65%); } .fx-perfect .fx-eyebrow, .fx-perfect p b { color: var(--gold); } .fx-perfect .fx-icon { animation: bounce 700ms var(--ease); filter: drop-shadow(0 0 24px var(--gold-glow)); }
@keyframes bounce { 0% { transform: scale(.4); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.fx-boss { background: radial-gradient(ellipse at center, rgba(240, 84, 107, .14), #000 65%); } .fx-boss .fx-eyebrow, .fx-boss p b { color: var(--danger); } .fx-boss .fx-in { animation: shake 400ms linear; }
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-2px); } 40%, 80% { transform: translateX(2px); } }

/* toasts */
#toast-root { position: fixed; top: calc(var(--sat) + 10px); left: 0; right: 0; z-index: 60; display: grid; justify-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 10px 16px; border-radius: var(--r-pill); border: 1px solid var(--hair); background: var(--bg-1); font-size: 12.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); animation: drop 200ms var(--ease); }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } }
.toast.out { animation: fadeout 150ms forwards; } .toast b { font-weight: 600; }
.toast.xp { border-color: rgba(111, 174, 255, .4); font-family: var(--font-eyebrow); color: var(--xp); } .toast.xp b { font-weight: 400; }
.toast.gold { border-color: rgba(240, 194, 75, .4); } .toast.gold b { color: var(--gold); }
.toast.err { border-color: rgba(240, 84, 107, .4); color: var(--danger); }
.toast button { min-height: 28px; padding: 0 10px; margin-left: 8px; border: 1px solid var(--hair); border-radius: var(--r-md); font-family: var(--font-eyebrow); font-size: 10px; letter-spacing: .1em; }

/* onboarding */
.onb { min-height: calc(100vh - 60px); display: flex; flex-direction: column; align-items: center; padding: 24px 4px 30px; }
.onb h1 { font-family: var(--font-display); font-weight: 600; font-size: 44px; letter-spacing: .06em; margin-top: 24px; background: linear-gradient(90deg, var(--rank-main), var(--xp)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.onb .lead { text-align: center; color: var(--dim); font-size: 13px; margin-top: 8px; max-width: 320px; }
.onb form { width: 100%; margin-top: 32px; border-color: var(--hair); padding: 20px; box-shadow: none; }
.onb .btn.primary { min-height: 52px; font-size: 16px; letter-spacing: .02em; }
.onb .foot { color: var(--faint); font-size: 11px; line-height: 1.7; margin-top: 20px; } .onb .foot label { color: var(--xp); }

/* clean mode */
body.clean .rpg { display: none !important; }
body.clean::before { background: var(--bg-0); }
body.clean .ring .p { stroke: var(--text); } body.clean .ring.perfect .p { stroke: var(--text); }
body.clean #nav button.on { color: var(--text); }
body.clean .done > .check, body.clean .check.on { background: var(--text); border-color: var(--text); } body.clean .check svg { stroke: #000; }
body.clean .quest { padding: 14px 0; } body.clean .q-name { font-weight: 300; font-size: 15px; } body.clean .quest.done .q-meta, body.clean .quest.done .q-prog { color: var(--dim); }
body.clean .plus { color: var(--text); } body.clean .bar > i { background: var(--text); box-shadow: none; }
body.clean .quest.just { animation: none; opacity: .5; }
body.clean .quest.boss, body.clean .quest.recovery { border-color: var(--hair); background: none; } body.clean .quest.boss .q-name { font-family: var(--font-body); font-size: 15px; color: var(--text); } body.clean .r-ico { border-color: var(--hair); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
