/* ==========================================================
   Tarnished's Codex — styles
   ========================================================== */
:root {
  --bg: #0b0a08;
  --bg2: #13110d;
  --panel: rgba(28, 24, 18, 0.62);
  --panel-solid: #1a1712;
  --line: rgba(232, 200, 114, 0.18);
  --line-strong: rgba(232, 200, 114, 0.45);
  --gold: #e8c872;
  --gold-deep: #b8913a;
  --ember: #ff7a2a;
  --text: #ece4cf;
  --muted: #a39a83;
  --danger: #e2574c;
  --ok: #7fdc8f;
  --radius: 16px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .8);
  --f-display: "Cinzel", serif;
  --f-serif: "Cormorant Garamond", serif;
  --f-sans: "Inter", system-ui, sans-serif;
  --top-h: 68px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: radial-gradient(1200px 800px at 50% -10%, #2a2111 0%, transparent 60%), var(--bg);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
body::after { /* film grain */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font: inherit; color: var(--text); }
img { max-width: 100%; display: block; }
::selection { background: var(--gold); color: #000; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #3a3223; border-radius: 10px; border: 2px solid var(--bg); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

#embers { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.cursor-glow {
  position: fixed; width: 420px; height: 420px; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(232,200,114,.10), transparent 65%);
  transform: translate(-50%, -50%); left: -500px; top: -500px; transition: opacity .3s;
}
@media (hover: none) { .cursor-glow { display: none; } }

/* ---------- Loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 1000; background: var(--bg);
  display: grid; place-content: center; justify-items: center; gap: 22px;
  transition: opacity .8s ease, visibility .8s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-ring svg { width: 110px; height: 110px; fill: none; stroke: var(--gold); stroke-width: 1.5; filter: drop-shadow(0 0 12px rgba(232,200,114,.7)); }
.loader-ring circle, .loader-ring line { stroke-dasharray: 340; stroke-dashoffset: 340; animation: draw 1.6s ease forwards; }
.loader-ring circle:nth-child(2) { animation-delay: .2s; }
.loader-ring circle:nth-child(3) { animation-delay: .4s; }
.loader-ring line { animation-delay: .6s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.loader-text { font-family: var(--f-display); letter-spacing: .35em; text-transform: uppercase; color: var(--gold); font-size: .85rem; opacity: 0; animation: fadeIn 1s .8s forwards; }
@keyframes fadeIn { to { opacity: 1; } }

/* ---------- Topbar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 0 clamp(16px, 4vw, 40px);
  transition: background .35s, border-color .35s, backdrop-filter .35s;
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { background: rgba(11,10,8,.78); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px); border-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-size: 1.05rem; letter-spacing: .06em; white-space: nowrap; }
.brand b { color: var(--gold); font-weight: 600; }
.brand-mark { width: 32px; height: 32px; fill: none; stroke: var(--gold); stroke-width: 3; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.brand:hover .brand-mark { transform: rotate(180deg); }
.nav { display: flex; gap: 4px; }
.nav a {
  position: relative; padding: 8px 14px; font-family: var(--f-display); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  transition: color .25s;
}
.nav a::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 0; height: 1px; background: var(--gold); box-shadow: 0 0 8px var(--gold); transition: width .3s, left .3s; }
.nav a:hover, .nav a.active { color: var(--gold); }
.nav a.active::after, .nav a:hover::after { width: 60%; left: 20%; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; transition: border-color .25s, background .25s; }
.icon-btn:hover { border-color: var(--line-strong); background: rgba(232,200,114,.06); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--gold); stroke-width: 2; }
kbd { font-family: var(--f-sans); font-size: .7rem; color: var(--muted); }
.burger { display: none; flex-direction: column; gap: 4px; padding: 12px 11px; }
.burger span { width: 18px; height: 1.5px; background: var(--gold); transition: transform .3s, opacity .3s; }
.burger.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.bottom-nav { display: none; }

/* ---------- Layout ---------- */
main { position: relative; z-index: 3; min-height: 100vh; }
.container { width: min(1240px, 100% - clamp(32px, 6vw, 80px)); margin-inline: auto; padding-bottom: 60px; }
.view { display: none; }
.view.active { display: block; animation: viewIn .6s cubic-bezier(.2,.8,.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.glass {
  background: linear-gradient(160deg, rgba(40,34,24,.68), rgba(18,16,12,.72));
  border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.section-head { text-align: center; margin: 80px 0 32px; }
.view > .container > .section-head:first-child { margin-top: calc(var(--top-h) + 50px); }
.section-head h2 {
  font-family: var(--f-display); font-weight: 600; font-size: clamp(1.7rem, 4vw, 2.6rem); letter-spacing: .06em;
  background: linear-gradient(180deg, #fff3cf, var(--gold) 55%, var(--gold-deep)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-head h2::after { content: ""; display: block; width: 120px; height: 1px; margin: 14px auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.section-head p { color: var(--muted); font-family: var(--f-serif); font-size: 1.2rem; font-style: italic; margin-top: 8px; }
.center { text-align: center; margin-top: 30px; }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; overflow: hidden;
  padding: 14px 28px; border-radius: 999px; font-family: var(--f-display); letter-spacing: .14em; text-transform: uppercase; font-size: .82rem; font-weight: 600;
  transition: transform .25s, box-shadow .25s, background .25s, border-color .25s;
}
.btn.sm { padding: 9px 16px; font-size: .7rem; }
.btn-gold { background: linear-gradient(135deg, #f6dc8f, var(--gold) 40%, var(--gold-deep)); color: #1a1408; box-shadow: 0 10px 30px -8px rgba(232,200,114,.55); }
.btn-gold::before { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.6), transparent 70%); transform: translateX(-120%); transition: transform .7s; }
.btn-gold:hover::before { transform: translateX(120%); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -8px rgba(232,200,114,.75); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--gold); background: rgba(232,200,114,.04); }
.btn-ghost:hover { background: rgba(232,200,114,.12); transform: translateY(-2px); }
.link { color: var(--gold); font-size: .9rem; font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(0,0,0,.25); }
.seg button { padding: 7px 14px; border-radius: 999px; font-size: .82rem; color: var(--muted); transition: all .25s; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.active { background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: #1a1408; font-weight: 600; box-shadow: 0 4px 14px -4px rgba(232,200,114,.6); }
.center-seg { display: flex; width: fit-content; margin: 0 auto 28px; border-radius: 22px; justify-content: center; }

input[type="search"], select, .field select {
  background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; outline: none; transition: border-color .25s, box-shadow .25s;
}
input[type="search"]:focus, select:focus { border-color: var(--line-strong); box-shadow: 0 0 0 4px rgba(232,200,114,.08); }
select option { background: var(--panel-solid); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.2,.8,.2,1), transform .9s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; place-items: center; overflow: hidden; text-align: center; padding: var(--top-h) 20px 40px; }
.hero-bg {
  position: absolute; inset: -6%; background: url("../assets/hero.jpg") center 35% / cover no-repeat, #1a140a;
  transform: scale(1.08); animation: kenburns 30s ease-in-out infinite alternate; will-change: transform;
}
.hero-bg::after { content: ""; position: absolute; inset: 0; background:
  radial-gradient(ellipse at 50% 30%, transparent 0%, rgba(11,10,8,.35) 55%, rgba(11,10,8,.9) 100%),
  linear-gradient(180deg, rgba(11,10,8,.5) 0%, transparent 30%, rgba(11,10,8,.4) 70%, var(--bg) 100%); }
@keyframes kenburns { from { transform: scale(1.08) translate3d(0,0,0); } to { transform: scale(1.18) translate3d(-1.5%, -1%, 0); } }
.hero-tree { position: absolute; left: 50%; top: 28%; width: 60vmin; height: 60vmin; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(255,220,130,.35), rgba(232,200,114,.08) 40%, transparent 70%); mix-blend-mode: screen; animation: pulse 6s ease-in-out infinite; pointer-events: none; }
@keyframes pulse { 50% { opacity: .55; transform: translate(-50%, -50%) scale(1.12); } }
.hero-content { position: relative; z-index: 2; max-width: 900px; }
.eyebrow { font-family: var(--f-display); letter-spacing: .5em; text-transform: uppercase; color: var(--gold); font-size: clamp(.7rem, 1.8vw, .85rem); margin-bottom: 18px; text-shadow: 0 0 20px rgba(232,200,114,.6); }
.hero-title { font-family: var(--f-display); font-weight: 400; line-height: 1; text-shadow: 0 4px 40px rgba(0,0,0,.8); }
.hero-title span { display: block; font-size: clamp(1.2rem, 3.5vw, 2rem); letter-spacing: .3em; text-transform: uppercase; color: #f3e9cf; margin-bottom: 10px; }
.hero-title em { display: block; font-style: normal; font-weight: 800; font-size: clamp(3rem, 12vw, 8.5rem); letter-spacing: .04em;
  background: linear-gradient(180deg, #fff8e0 0%, #f2d488 45%, #a87d2b 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(232,200,114,.35)); }
.hero-quote { font-family: var(--f-serif); font-style: italic; font-size: clamp(1.1rem, 2.6vw, 1.5rem); color: #e8dfc8; min-height: 3.2em; margin: 22px auto 34px; max-width: 680px; }
.hero-quote::after { content: "|"; color: var(--gold); animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .reveal:nth-child(2) { transition-delay: .15s; }
.hero .reveal:nth-child(3) { transition-delay: .3s; }
.hero .reveal:nth-child(4) { transition-delay: .45s; }
.scroll-hint { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); width: 24px; height: 40px; border: 1.5px solid var(--line-strong); border-radius: 14px; z-index: 2; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; background: var(--gold); border-radius: 2px; animation: scrolly 1.8s infinite; }
@keyframes scrolly { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

.page-hero { position: relative; padding: calc(var(--top-h) + 70px) 20px 70px; text-align: center; overflow: hidden; isolation: isolate; }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--img) center / cover no-repeat; transform: scale(1.1); animation: kenburns 40s ease-in-out infinite alternate; }
.page-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(11,10,8,.65), rgba(11,10,8,.55) 50%, var(--bg)); }
.page-hero h1 { font-family: var(--f-display); font-size: clamp(2rem, 6vw, 3.8rem); font-weight: 600; letter-spacing: .05em;
  background: linear-gradient(180deg, #fff4d4, var(--gold) 60%, var(--gold-deep)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 20px rgba(0,0,0,.7)); }
.page-hero p { font-family: var(--f-serif); font-style: italic; font-size: clamp(1.05rem, 2.4vw, 1.35rem); color: #e2d9c2; max-width: 640px; margin: 10px auto 0; }

/* ---------- Home ---------- */
.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: -40px; position: relative; z-index: 3;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.stats-strip > div { background: rgba(20,17,12,.92); padding: 26px 16px; text-align: center; backdrop-filter: blur(8px); }
.stats-strip b { display: block; font-family: var(--f-display); font-size: clamp(1.7rem, 4vw, 2.5rem); color: var(--gold); line-height: 1.1; text-shadow: 0 0 20px rgba(232,200,114,.35); }
.stats-strip span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }

.progress-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.progress-card { display: flex; gap: 20px; align-items: center; padding: 24px; }
.progress-card h3 { font-family: var(--f-display); font-size: 1.05rem; color: var(--gold); letter-spacing: .04em; margin-bottom: 4px; }
.progress-card p { color: var(--muted); font-size: .92rem; margin-bottom: 6px; }
.ring { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .track { stroke: rgba(232,200,114,.1); }
.ring .bar { stroke: url(#none); stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 1.6s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 6px rgba(232,200,114,.7)); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-display); font-size: 1.25rem; color: var(--text); }
.grace-icon { width: 96px; height: 96px; flex-shrink: 0; display: grid; place-items: center; position: relative; }
.grace-icon::before { content: ""; position: absolute; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle, rgba(255,226,140,.6), transparent 70%); animation: pulse2 3s ease-in-out infinite; }
.grace-icon span { width: 10px; height: 46px; background: linear-gradient(180deg, transparent, #ffe9a8 40%, #fff 60%, transparent); border-radius: 50%; filter: blur(1px); box-shadow: 0 0 20px #ffd76a; animation: flicker 2.4s ease-in-out infinite; }
@keyframes pulse2 { 50% { transform: scale(1.25); opacity: .6; } }
@keyframes flicker { 0%,100% { transform: scaleY(1); } 40% { transform: scaleY(1.15) skewX(4deg); } 70% { transform: scaleY(.92) skewX(-3deg); } }
#graceTip { font-family: var(--f-serif); font-style: italic; font-size: 1.05rem; color: var(--text); min-height: 3em; transition: opacity .3s; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  position: relative; padding: 30px 26px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden;
  background: linear-gradient(160deg, rgba(40,34,24,.7), rgba(14,12,9,.85)); transform-style: preserve-3d; transition: border-color .3s, box-shadow .3s, transform .15s ease-out;
}
.feature::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%); opacity: 0; transition: opacity .3s; }
.feature:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 30px 60px -25px color-mix(in srgb, var(--accent) 40%, transparent); }
.feature:hover::before { opacity: 1; }
.feature > * { position: relative; }
.feature-icon { font-size: 2rem; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 14px; margin-bottom: 18px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.feature h3 { font-family: var(--f-display); font-size: 1.15rem; margin-bottom: 8px; color: #f4ead2; }
.feature p { color: var(--muted); font-size: .94rem; }

/* ---------- Walkthrough ---------- */
.wt-toolbar { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; position: sticky; top: calc(var(--top-h) + 10px); z-index: 20; margin-bottom: 40px; }
.wt-progress { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 180px; }
.wt-progress .bar { flex: 1; height: 8px; background: rgba(232,200,114,.1); border-radius: 99px; overflow: hidden; }
.wt-progress .bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-deep), var(--gold), #fff3c4); box-shadow: 0 0 12px var(--gold); border-radius: 99px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.wt-progress b { font-family: var(--f-display); color: var(--gold); min-width: 46px; text-align: right; }

.timeline { position: relative; padding-left: 50px; }
.timeline::before { content: ""; position: absolute; left: 18px; top: 0; bottom: 0; width: 2px; background: linear-gradient(180deg, var(--gold), rgba(232,200,114,.15)); }
.chapter { position: relative; margin-bottom: 26px; }
.chapter-dot { position: absolute; left: -50px; top: 22px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); border: 2px solid var(--gold); font-family: var(--f-display); font-size: .9rem; color: var(--gold); z-index: 1; transition: all .4s; }
.chapter.complete .chapter-dot { background: var(--gold); color: #1a1408; box-shadow: 0 0 20px var(--gold); }
.chapter.dlc .chapter-dot { border-color: #c9b6ff; color: #c9b6ff; }
.chapter.dlc.complete .chapter-dot { background: #c9b6ff; color: #1a1408; box-shadow: 0 0 20px #c9b6ff; }
.chapter-card { overflow: hidden; }
.chapter-head { width: 100%; display: flex; align-items: center; gap: 16px; padding: 20px 22px; text-align: left; }
.chapter-head h3 { font-family: var(--f-display); font-size: 1.2rem; color: #f4ead2; }
.chapter-head .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); letter-spacing: .03em; }
.chip.gold { color: var(--gold); border-color: var(--line-strong); }
.chip.purple { color: #c9b6ff; border-color: rgba(201,182,255,.4); }
.chip.red { color: #ff8a7a; border-color: rgba(255,138,122,.4); }
.chapter-head .count { margin-left: auto; font-family: var(--f-display); color: var(--gold); font-size: .9rem; white-space: nowrap; }
.chev { width: 18px; height: 18px; flex-shrink: 0; transition: transform .35s; stroke: var(--gold); fill: none; stroke-width: 2; }
.chapter.open .chev { transform: rotate(180deg); }
.chapter-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s cubic-bezier(.2,.8,.2,1); }
.chapter.open .chapter-body { grid-template-rows: 1fr; }
.chapter-body > div { overflow: hidden; }
.chapter-inner { padding: 0 22px 22px; }
.chapter-inner > p { color: var(--muted); font-family: var(--f-serif); font-size: 1.1rem; font-style: italic; margin-bottom: 14px; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; cursor: pointer; transition: background .2s; }
.task:hover { background: rgba(232,200,114,.05); }
.task input { display: none; }
.check { width: 22px; height: 22px; flex-shrink: 0; border: 1.5px solid var(--line-strong); border-radius: 7px; display: grid; place-items: center; margin-top: 1px; transition: all .25s; }
.check svg { width: 14px; height: 14px; stroke: #1a1408; stroke-width: 3; fill: none; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset .3s .05s; }
.task input:checked + .check { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 12px rgba(232,200,114,.6); }
.task input:checked + .check svg { stroke-dashoffset: 0; }
.task-text b { display: block; font-weight: 500; color: var(--text); transition: color .2s; }
.task-text span { font-size: .87rem; color: var(--muted); }
.task input:checked ~ .task-text b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--gold-deep); }
.tag-mini { display: inline-block; font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; padding: 1px 7px; border-radius: 4px; margin-left: 6px; vertical-align: 2px; }
.tag-boss { background: rgba(226,87,76,.18); color: #ff9c90; }
.tag-item { background: rgba(127,220,143,.14); color: #9fe8ab; }
.tag-miss { background: rgba(255,170,60,.18); color: #ffc47a; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px; margin: 30px 0 26px; }
.filters input[type="search"] { flex: 1; min-width: 200px; }

/* ---------- Bosses ---------- */
.boss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 22px; }
.boss { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--panel-solid);
  display: flex; flex-direction: column; transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s; }
.boss:hover { transform: translateY(-6px); border-color: var(--line-strong); box-shadow: 0 30px 60px -25px rgba(232,200,114,.3); }
.boss-art { position: relative; height: 180px; overflow: hidden; background: radial-gradient(circle at 50% 120%, var(--c1, #5a3b12), #0d0b08 70%); }
.boss-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; transition: transform .8s, opacity .6s; opacity: 0; }
.boss-art img.loaded { opacity: 1; }
.boss:hover .boss-art img { transform: scale(1.08); }
.boss-art .sigil { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-display); font-size: 4.5rem; color: rgba(232,200,114,.18); }
.boss-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, var(--panel-solid)); }
.boss-badges { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; z-index: 2; }
.boss-badges .chip { background: rgba(0,0,0,.55); backdrop-filter: blur(6px); }
.boss-body { padding: 0 20px 20px; margin-top: -30px; position: relative; z-index: 2; display: flex; flex-direction: column; flex: 1; }
.boss-body h3 { font-family: var(--f-display); font-size: 1.22rem; color: #f6ecd4; line-height: 1.25; }
.boss-body .loc { color: var(--muted); font-size: .86rem; margin: 4px 0 12px; }
.diff { display: flex; gap: 3px; align-items: center; }
.diff i { width: 18px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.1); }
.diff i.on { background: linear-gradient(90deg, #ff9a3d, #e2574c); box-shadow: 0 0 6px rgba(255,120,60,.6); }
.boss-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.boss-stats div { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.05); border-radius: 10px; padding: 8px; text-align: center; }
.boss-stats small { display: block; font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.boss-stats b { font-family: var(--f-display); color: var(--gold); font-size: .95rem; }
.weak { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.boss-actions { display: flex; gap: 10px; margin-top: auto; }
.boss-actions .btn { flex: 1; }
.defeat-btn.on { background: linear-gradient(135deg, #9fe8ab, #4fa862); color: #0b1a0e; border-color: transparent; }
.boss.defeated .boss-art { filter: grayscale(.7) brightness(.7); }
.boss.defeated::after { content: "ENEMY FELLED"; position: absolute; top: 70px; left: 50%; transform: translateX(-50%) rotate(-6deg); font-family: var(--f-display); font-size: 1.5rem; letter-spacing: .15em; color: var(--gold);
  text-shadow: 0 0 20px rgba(232,200,114,.8); white-space: nowrap; z-index: 3; pointer-events: none; animation: felled .8s cubic-bezier(.2,.8,.2,1); }
@keyframes felled { from { opacity: 0; letter-spacing: .6em; filter: blur(6px); } }

/* ---------- Modal ---------- */
.modal, .palette { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 20px; visibility: hidden; opacity: 0; transition: opacity .3s, visibility .3s; }
.modal.open, .palette.open { visibility: visible; opacity: 1; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5,4,3,.75); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-card { position: relative; width: min(760px, 100%); max-height: 88vh; overflow: auto; padding: 0; transform: translateY(30px) scale(.97); transition: transform .4s cubic-bezier(.2,.8,.2,1); background: linear-gradient(160deg, #241e14, #110f0b); }
.modal.open .modal-card { transform: none; }
.modal-close { position: absolute; top: 12px; right: 14px; width: 38px; height: 38px; border-radius: 50%; font-size: 1.6rem; line-height: 1; color: var(--gold); background: rgba(0,0,0,.5); z-index: 3; transition: transform .3s; }
.modal-close:hover { transform: rotate(90deg); }
.m-hero { position: relative; height: 220px; background: radial-gradient(circle at 50% 120%, #6b4615, #0d0b08 70%); overflow: hidden; }
.m-hero img { width: 100%; height: 100%; object-fit: contain; }
.m-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, #1c170f); }
.m-body { padding: 0 28px 28px; margin-top: -40px; position: relative; z-index: 2; }
.m-body h2 { font-family: var(--f-display); font-size: clamp(1.4rem, 4vw, 2rem); color: var(--gold); line-height: 1.2; }
.m-body .sub { color: var(--muted); margin: 4px 0 18px; }
.m-body h4 { font-family: var(--f-display); color: var(--gold); letter-spacing: .1em; text-transform: uppercase; font-size: .78rem; margin: 22px 0 10px; }
.m-body p { color: #d8cfb8; }
.m-body ol, .m-body ul { padding-left: 20px; color: #d8cfb8; }
.m-body li { margin-bottom: 8px; }
.m-body li::marker { color: var(--gold); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.kv div { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.kv small { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.kv b { color: var(--text); font-weight: 500; }

/* ---------- Palette ---------- */
.palette { place-items: start center; padding-top: 12vh; }
.palette-card { position: relative; width: min(640px, 100%); overflow: hidden; transform: translateY(-20px); transition: transform .3s; background: linear-gradient(160deg, #241e14, #110f0b); }
.palette.open .palette-card { transform: none; }
#paletteInput { width: 100%; padding: 20px 22px; background: transparent; border: none; border-bottom: 1px solid var(--line); outline: none; font-size: 1.1rem; }
#paletteResults { list-style: none; max-height: 50vh; overflow: auto; padding: 8px; }
#paletteResults li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; cursor: pointer; }
#paletteResults li.sel, #paletteResults li:hover { background: rgba(232,200,114,.1); }
#paletteResults li .k { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); border: 1px solid var(--line); padding: 2px 7px; border-radius: 5px; min-width: 64px; text-align: center; }
#paletteResults li small { color: var(--muted); margin-left: auto; font-size: .8rem; text-align: right; }
#paletteResults .empty { color: var(--muted); justify-content: center; cursor: default; }
.palette-foot { display: flex; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: .75rem; color: var(--muted); }

/* ---------- Map ---------- */
.map-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: start; }
.map-stage { position: relative; padding: 10px; overflow: hidden; background:
  radial-gradient(ellipse at center, rgba(30,26,18,.6), rgba(10,9,7,.9)), url("../assets/map.jpg") center/cover; }
#worldMap { width: 100%; height: auto; display: block; touch-action: manipulation; }
.region { cursor: pointer; transition: transform .35s cubic-bezier(.2,.8,.2,1), filter .3s; transform-box: fill-box; transform-origin: center; }
.region path { stroke: rgba(255,240,200,.55); stroke-width: 1.5; transition: fill-opacity .3s, stroke .3s, stroke-width .3s; fill-opacity: .42; }
.region text { font-family: var(--f-display); font-size: 17px; fill: #fff6dc; text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: rgba(0,0,0,.85); stroke-width: 4px; letter-spacing: .06em; }
.region:hover path, .region.sel path { fill-opacity: .78; stroke: #fff3c4; stroke-width: 2.5; }
.region:hover, .region.sel { filter: drop-shadow(0 0 14px rgba(255,220,130,.6)); }
.region.sel { transform: scale(1.04); }
.lvl-low path { fill: #6aa86b; } .lvl-mid path { fill: #d9b44a; } .lvl-high path { fill: #d9663a; } .lvl-end path { fill: #a24ad9; }
.erdtree-mark { pointer-events: none; }
.erdtree-mark circle { animation: treeGlow 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes treeGlow { 50% { opacity: .4; transform: scale(1.4); } }
.route-line { fill: none; stroke: rgba(255,230,160,.6); stroke-width: 2; stroke-dasharray: 6 8; animation: dash 30s linear infinite; pointer-events: none; }
@keyframes dash { to { stroke-dashoffset: -600; } }
.map-legend { position: absolute; left: 16px; bottom: 14px; display: flex; gap: 8px; align-items: center; font-size: .72rem; color: var(--muted); background: rgba(0,0,0,.55); padding: 6px 12px; border-radius: 99px; flex-wrap: wrap; }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 4px; }
.lg-low { background: #6aa86b; } .lg-mid { background: #d9b44a; } .lg-high { background: #d9663a; } .lg-end { background: #a24ad9; }
.map-info { padding: 26px; min-height: 420px; position: sticky; top: calc(var(--top-h) + 20px); }
.map-info-empty { height: 100%; min-height: 360px; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--muted); font-family: var(--f-serif); font-style: italic; font-size: 1.2rem; }
.compass { width: 90px; height: 90px; border: 1px solid var(--line-strong); border-radius: 50%; position: relative; animation: spin 20s linear infinite; }
.compass::before { content: ""; position: absolute; left: 50%; top: 8px; bottom: 8px; width: 2px; margin-left: -1px; background: linear-gradient(var(--danger) 50%, var(--gold) 50%); }
@keyframes spin { to { transform: rotate(360deg); } }
.mi-anim { animation: viewIn .5s cubic-bezier(.2,.8,.2,1); }
.map-info h3 { font-family: var(--f-display); font-size: 1.6rem; color: var(--gold); line-height: 1.2; }
.map-info .lvl { color: var(--muted); margin: 6px 0 14px; }
.map-info p.desc { font-family: var(--f-serif); font-size: 1.12rem; color: #e0d7c0; margin-bottom: 8px; }
.map-info h4 { font-family: var(--f-display); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 18px 0 8px; }
.map-info ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.map-info ul li { font-size: .82rem; padding: 4px 10px; border-radius: 8px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.extra-regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.extra { padding: 22px; cursor: pointer; transition: transform .3s, border-color .3s; }
.extra:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.extra h3 { font-family: var(--f-display); color: var(--gold); font-size: 1.1rem; }
.extra p { color: var(--muted); font-size: .9rem; margin-top: 6px; }

/* ---------- Planner ---------- */
.planner { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; }
.planner-left, .planner-right { padding: 26px; }
.field { display: flex; flex-direction: column; gap: 8px; font-family: var(--f-display); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: 20px; }
.field select { font-family: var(--f-sans); text-transform: none; letter-spacing: 0; font-size: 1rem; }
.stat-row { display: grid; grid-template-columns: 110px 34px 1fr 34px 44px; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.stat-row label { font-family: var(--f-display); font-size: .85rem; letter-spacing: .06em; }
.stat-row label small { display: block; font-family: var(--f-sans); font-size: .66rem; color: var(--muted); letter-spacing: 0; }
.stat-row output { font-family: var(--f-display); color: var(--gold); font-size: 1.15rem; text-align: right; }
.stat-row output.up { color: var(--ok); }
.step-btn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); color: var(--gold); font-size: 1.1rem; transition: background .2s; touch-action: manipulation; }
.step-btn:hover { background: rgba(232,200,114,.12); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; outline: none;
  background: linear-gradient(90deg, var(--gold) var(--p, 10%), rgba(232,200,114,.12) var(--p, 10%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle, #fff6d6, var(--gold)); border: 2px solid #1a1408; box-shadow: 0 0 10px rgba(232,200,114,.8); cursor: grab; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--gold); border: 2px solid #1a1408; box-shadow: 0 0 10px rgba(232,200,114,.8); cursor: grab; }
.planner-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.planner-right { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.level-badge { text-align: center; }
.level-badge span { font-family: var(--f-display); font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.level-badge b { display: block; font-family: var(--f-display); font-size: 4rem; line-height: 1; color: var(--gold); text-shadow: 0 0 30px rgba(232,200,114,.5); transition: transform .2s; }
.level-badge b.bump { transform: scale(1.12); }
.derived { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; }
.derived > div { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.derived small { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); display: block; }
.derived b { font-family: var(--f-display); font-size: 1.3rem; }
.derived .hp b { color: #ff7a6a; } .derived .fp b { color: #7aaaff; } .derived .st b { color: #8fe08f; } .derived .el b { color: var(--gold); }
.mini-bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.07); margin-top: 6px; overflow: hidden; }
.mini-bar i { display: block; height: 100%; border-radius: 4px; transition: width .4s; }
#plRadar, #classRadar { width: 100%; max-width: 320px; height: auto; aspect-ratio: 1; }
.rune-cost { text-align: center; }
.rune-cost span { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rune-cost b { display: block; font-family: var(--f-display); font-size: 1.6rem; color: var(--gold); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }

.build-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.build { padding: 24px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; transition: transform .3s, border-color .3s; }
.build::before { content: ""; position: absolute; top: -60px; right: -60px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, var(--accent), transparent 70%); opacity: .25; transition: opacity .3s, transform .5s; }
.build:hover { transform: translateY(-5px); border-color: var(--line-strong); }
.build:hover::before { opacity: .5; transform: scale(1.3); }
.build h3 { font-family: var(--f-display); font-size: 1.2rem; color: #f6ecd4; }
.build .arch { font-size: .8rem; color: var(--accent); text-transform: uppercase; letter-spacing: .12em; }
.build p { color: var(--muted); font-size: .92rem; }
.build ul { list-style: none; font-size: .88rem; display: grid; gap: 4px; }
.build ul li span { color: var(--muted); display: inline-block; min-width: 84px; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.build .btn { margin-top: auto; align-self: flex-start; }

/* ---------- Codex ---------- */
.codex-cats { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; justify-content: safe center; flex-wrap: wrap; }
.codex-cats::-webkit-scrollbar { display: none; }
.cat { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; white-space: nowrap; font-size: .88rem; color: var(--muted); background: rgba(0,0,0,.25); transition: all .25s; }
.cat:hover { color: var(--text); border-color: var(--line-strong); }
.cat.active { color: #1a1408; background: linear-gradient(135deg, var(--gold), var(--gold-deep)); border-color: transparent; font-weight: 600; }
.codex-count { color: var(--muted); font-size: .85rem; }
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.item { padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; transition: transform .3s, border-color .3s, box-shadow .3s; animation: pop .5s cubic-bezier(.2,.8,.2,1) both; }
.item:hover { transform: translateY(-5px); border-color: var(--line-strong); box-shadow: 0 20px 40px -20px rgba(232,200,114,.35); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.item-img { aspect-ratio: 1; border-radius: 10px; background: radial-gradient(circle at 50% 60%, rgba(232,200,114,.12), rgba(0,0,0,.3) 70%); display: grid; place-items: center; overflow: hidden; }
.item-img img { width: 82%; height: 82%; object-fit: contain; transition: transform .5s; filter: drop-shadow(0 6px 12px rgba(0,0,0,.6)); }
.item:hover .item-img img { transform: scale(1.1) rotate(-3deg); }
.item-img .ph { font-family: var(--f-display); font-size: 2.4rem; color: rgba(232,200,114,.25); }
.item h4 { font-size: .92rem; font-weight: 500; line-height: 1.3; }
.item small { color: var(--muted); font-size: .76rem; }
.skeleton { pointer-events: none; }
.skeleton .item-img, .skeleton h4, .skeleton small { background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; color: transparent; }
@keyframes shimmer { to { background-position: -200% 0; } }
.codex-error { grid-column: 1 / -1; text-align: center; padding: 40px; color: var(--muted); }

/* ---------- Classes ---------- */
.class-layout { display: grid; grid-template-columns: 1fr 1.1fr; gap: 22px; align-items: start; }
.class-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cls { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(20,17,12,.7); text-align: left; transition: all .25s; }
.cls:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.cls.active { border-color: var(--gold); background: linear-gradient(160deg, rgba(232,200,114,.16), rgba(20,17,12,.8)); box-shadow: 0 0 0 1px var(--gold), 0 10px 30px -10px rgba(232,200,114,.4); }
.cls b { font-family: var(--f-display); font-size: 1.05rem; display: block; }
.cls span { font-size: .78rem; color: var(--muted); }
.class-detail { padding: 26px; display: flex; flex-direction: column; align-items: center; position: sticky; top: calc(var(--top-h) + 20px); }
#classInfo { width: 100%; }
#classInfo h3 { font-family: var(--f-display); font-size: 1.8rem; color: var(--gold); text-align: center; }
#classInfo .lvl { text-align: center; color: var(--muted); margin-bottom: 12px; }
#classInfo p { font-family: var(--f-serif); font-size: 1.12rem; color: #e0d7c0; text-align: center; margin-bottom: 14px; }
.stat-pills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.stat-pills div { text-align: center; background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.stat-pills small { display: block; font-size: .64rem; color: var(--muted); letter-spacing: .1em; }
.stat-pills b { font-family: var(--f-display); color: var(--gold); }
.verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: .88rem; }
.verdict div { padding: 12px; border-radius: 10px; background: rgba(255,255,255,.03); }
.verdict h5 { font-family: var(--f-display); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }
.verdict .pro h5 { color: var(--ok); } .verdict .con h5 { color: #ff8a7a; }

/* ---------- Tips accordion ---------- */
.accordion { max-width: 860px; margin: 0 auto; display: grid; gap: 12px; }
.acc { overflow: hidden; }
.acc-head { width: 100%; display: flex; gap: 14px; align-items: center; padding: 18px 20px; text-align: left; }
.acc-head .ic { font-size: 1.4rem; width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: rgba(232,200,114,.08); border: 1px solid var(--line); }
.acc-head b { font-weight: 500; flex: 1; }
.acc-head small { display: block; font-size: .7rem; color: var(--gold); text-transform: uppercase; letter-spacing: .1em; }
.acc .chapter-body { display: grid; }
.acc.open .chapter-body { grid-template-rows: 1fr; }
.acc.open .chev { transform: rotate(180deg); }
.acc-inner { padding: 0 20px 20px 74px; color: #d0c7b0; }

/* ---------- Footer / toast ---------- */
.footer { position: relative; z-index: 3; text-align: center; padding: 40px 20px 50px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.footer a { color: var(--gold); }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 30px); z-index: 900; padding: 12px 22px; border-radius: 999px; background: linear-gradient(135deg, #2a2213, #17130c); border: 1px solid var(--line-strong); color: var(--gold); font-size: .9rem; opacity: 0; pointer-events: none; transition: all .4s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow); white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1100px) {
  .nav a { padding: 8px 9px; font-size: .74rem; }
}
@media (max-width: 960px) {
  :root { --top-h: 60px; }
  .burger { display: flex; }
  .icon-btn kbd { display: none; }
  .nav { position: fixed; top: var(--top-h); left: 0; right: 0; flex-direction: column; gap: 0; padding: 10px 20px 24px; background: rgba(11,10,8,.96); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line); transform: translateY(-120%); transition: transform .45s cubic-bezier(.2,.8,.2,1); z-index: -1; }
  .nav.open { transform: none; }
  .nav a { padding: 14px 6px; font-size: .95rem; border-bottom: 1px solid rgba(255,255,255,.04); }
  .nav a::after { display: none; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; justify-content: space-around;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); background: rgba(11,10,8,.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .64rem; color: var(--muted); padding: 4px 10px; border-radius: 10px; transition: color .25s; letter-spacing: .04em; }
  .bottom-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; transition: transform .3s; }
  .bottom-nav a.active { color: var(--gold); }
  .bottom-nav a.active svg { transform: translateY(-2px); filter: drop-shadow(0 0 6px var(--gold)); }
  body { padding-bottom: 70px; }
  .toast { bottom: 90px; }
  .progress-grid, .feature-grid { grid-template-columns: 1fr 1fr; }
  .grace-card { grid-column: 1 / -1; }
  .map-layout, .planner, .class-layout { grid-template-columns: 1fr; }
  .map-info, .class-detail { position: static; min-height: 0; }
  .map-info-empty { min-height: 160px; }
}
@media (max-width: 640px) {
  .brand span { font-size: .95rem; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .progress-grid, .feature-grid { grid-template-columns: 1fr; }
  .progress-card { padding: 18px; }
  .ring, .grace-icon { width: 78px; height: 78px; }
  .section-head { margin: 60px 0 24px; }
  .timeline { padding-left: 36px; }
  .timeline::before { left: 12px; }
  .chapter-dot { left: -36px; width: 28px; height: 28px; font-size: .75rem; top: 24px; }
  .chapter-head { padding: 16px; gap: 10px; }
  .chapter-head h3 { font-size: 1.02rem; }
  .chapter-inner { padding: 0 12px 16px; }
  .wt-toolbar { top: calc(var(--top-h) + 6px); padding: 10px; }
  .wt-toolbar .seg button { padding: 6px 10px; font-size: .74rem; }
  .boss-grid { grid-template-columns: 1fr; }
  .codex-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .item { padding: 10px; }
  .codex-cats { flex-wrap: nowrap; justify-content: flex-start; }
  .class-list { grid-template-columns: 1fr 1fr; }
  .stat-row { grid-template-columns: 96px 30px 1fr 30px 30px; gap: 6px; } .stat-row label { font-size: .74rem; letter-spacing: .02em; }
  .stat-row label small { display: none; }
  .planner-left, .planner-right, .map-info, .class-detail { padding: 18px; }
  .acc-inner { padding: 0 18px 18px; }
  .m-body { padding: 0 18px 22px; }
  .region text { font-size: 22px; }
  .filters { padding: 10px; }
  .filters .seg { width: 100%; justify-content: center; border-radius: 16px; }
  .filters select { width: 100%; }
  .verdict { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* test/screenshot mode */
.shot #loader { display: none; }
.shot .reveal { opacity: 1; transform: none; transition: none; }
.shot .view.active { animation: none; }
