/* 幻想世界官網：月光檔案館視覺系統 */
:root {
  --bg: #0b0f16;
  --bg2: #0f151e;
  --panel: #141c27;
  --panel2: #192331;
  --panel3: #202c3b;
  --line: #293340;
  --line2: #3a4655;
  --ink: #eee9df;
  --ink-soft: #d4cec1;
  --dim: #a2a7ae;
  --dim2: #78818c;
  --gold: #c7a86c;
  --gold2: #e0c58e;
  --magic: #86a9c2;
  --red: #c36f72;
  --green: #82aa8a;
  --r: 10px;
  --wrap: 1180px;
  --nav-h: 72px;
  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --display: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--ink); font: 16px/1.75 var(--font); text-rendering: optimizeLegibility; }
body::selection { background: var(--gold); color: #11151b; }
a { color: var(--gold2); text-decoration: none; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
button, input, select, textarea, summary { touch-action: manipulation; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--gold2); outline-offset: 4px; }
img { display: block; max-width: 100%; height: auto; }
main { min-height: 55vh; }
.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.muted { color: var(--dim); }
.small { font-size: 13px; }
.center { text-align: center; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.grid { display: grid; }
.section { padding-block: clamp(72px, 9vw, 128px); }
.band { background: var(--bg2); border-block: 1px solid var(--line); }
.skip-link { position: fixed; z-index: 1000; top: 10px; left: 10px; padding: 10px 14px; background: var(--ink); color: var(--bg); transform: translateY(-160%); transition: transform 180ms var(--ease); }
.skip-link:focus { transform: translateY(0); }

h1, h2, h3, h4 { color: var(--ink); font-family: var(--display); line-height: 1.25; text-wrap: balance; }
h1 { margin: 0 0 20px; font-size: clamp(42px, 7vw, 74px); font-weight: 600; letter-spacing: -.035em; }
h2 { margin: 1.6em 0 .65em; font-size: clamp(28px, 4vw, 46px); font-weight: 600; letter-spacing: -.025em; }
h3 { margin: 1.2em 0 .45em; font-size: 20px; font-weight: 600; }
h4 { font-size: 16px; }
.eyebrow, .link-kicker { margin: 0 0 18px; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .2em; line-height: 1.4; text-transform: uppercase; }
.breadcrumb { display: flex; gap: 10px; align-items: center; margin: 0 0 30px; color: var(--dim2); font-size: 13px; }
.section-heading { max-width: 760px; margin-bottom: clamp(42px, 6vw, 76px); }
.section-heading h2 { margin: 0; }
.section-heading > p:last-child { max-width: 620px; margin: 22px 0 0; color: var(--dim); font-size: 17px; }
.section-heading.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .75fr); gap: 64px; align-items: end; max-width: none; }
.section-heading.split > p:last-child { margin: 0 0 8px; }
.section-heading.compact { margin-bottom: 28px; }
.section-heading.compact h2 { font-size: clamp(30px, 4vw, 42px); }
.ttl { margin-top: 0; text-align: left; }
.text-link { display: inline-flex; min-height: 44px; align-items: center; color: var(--ink-soft); border-bottom: 1px solid var(--line2); font-weight: 600; }
.text-link:hover { color: var(--gold2); border-color: var(--gold); text-decoration: none; }
.arrow-icon { width: 18px; height: 18px; vertical-align: middle; }

/* Buttons and reusable surfaces */
.btn { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; padding: 11px 20px; border: 1px solid var(--gold); border-radius: 4px; background: var(--gold); color: #11151b; font-weight: 700; letter-spacing: .02em; cursor: pointer; text-decoration: none !important; transition: background 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease); }
.btn:hover { background: var(--gold2); border-color: var(--gold2); }
.btn:active { transform: translateY(1px); }
.btn.sec { background: transparent; border-color: var(--line2); color: var(--ink-soft); }
.btn.sec:hover { border-color: var(--gold); color: var(--gold2); }
.btn.big { min-height: 54px; padding-inline: 26px; font-size: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.card { display: block; padding: 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--ink); }
a.card { cursor: pointer; transition: border-color 180ms var(--ease), background 180ms var(--ease); }
a.card:hover { border-color: var(--line2); background: var(--panel2); text-decoration: none; }

/* Navigation */
.nav { position: sticky; z-index: 100; top: 0; height: var(--nav-h); border-bottom: 1px solid rgba(199,168,108,.2); background: rgba(11,15,22,.94); backdrop-filter: blur(14px); }
.nav-in { display: flex; height: 100%; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none !important; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(199,168,108,.35); border-radius: 50%; }
.brand-mark img { width: 32px; height: 32px; border-radius: 50%; image-rendering: pixelated; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy b { font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: .08em; }
.brand-copy small { color: var(--dim2); font-size: 8px; font-weight: 700; letter-spacing: .18em; }
.brand.sm .brand-mark { width: 34px; height: 34px; }
.brand.sm .brand-copy b { font-size: 16px; }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-links a:not(.btn) { position: relative; display: inline-flex; min-height: 44px; align-items: center; padding: 0 10px; color: var(--dim); font-size: 13px; font-weight: 600; }
.nav-links a:not(.btn)::after { position: absolute; right: 10px; bottom: 5px; left: 10px; height: 1px; background: var(--gold); content: ''; transform: scaleX(0); transform-origin: left; transition: transform 180ms var(--ease); }
.nav-links a:not(.btn):hover, .nav-links a.on { color: var(--ink); text-decoration: none; }
.nav-links a:not(.btn):hover::after, .nav-links a.on::after { transform: scaleX(1); }
.nav-links .play { min-height: 40px; margin-left: 10px; padding: 8px 15px; }
.nav-tg { display: none; width: 48px; height: 48px; margin-left: auto; padding: 12px; border: 1px solid var(--line2); border-radius: 4px; background: transparent; cursor: pointer; }
.nav-tg span { display: block; width: 100%; height: 1px; margin: 5px 0; background: var(--ink); transition: transform 180ms var(--ease), opacity 180ms var(--ease); }
.nav.open .nav-tg span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.open .nav-tg span:nth-child(2) { opacity: 0; }
.nav.open .nav-tg span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Home hero */
.hero { position: relative; min-height: min(790px, calc(100svh - var(--nav-h))); overflow: hidden; display: grid; align-items: end; isolation: isolate; }
.hero-art { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 58% center; image-rendering: pixelated; }
.hero::after { position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgba(8,11,16,.96) 0%, rgba(8,11,16,.76) 42%, rgba(8,11,16,.16) 76%), linear-gradient(0deg, rgba(8,11,16,.92) 0%, transparent 42%); content: ''; }
.hero-in { padding-top: clamp(90px, 14vh, 150px); padding-bottom: 150px; }
.hero h1 { display: grid; width: fit-content; margin: 0 0 24px; font-size: clamp(62px, 10vw, 118px); font-weight: 600; letter-spacing: .04em; line-height: .96; }
.hero h1 span { white-space: nowrap; }
.hero h1 small { margin-top: 16px; color: var(--gold2); font-family: var(--display); font-size: .25em; font-weight: 500; letter-spacing: .42em; }
.lead { max-width: 580px; margin: 0 0 28px; color: var(--ink-soft); font-family: var(--display); font-size: clamp(21px, 3vw, 30px); letter-spacing: .04em; }
.cta { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.hero-note { max-width: 620px; margin: 20px 0 0; color: var(--dim); font-size: 13px; letter-spacing: .04em; }
.hero-facts { position: absolute; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(3, max-content) 1fr; gap: 0; align-items: stretch; border-top: 1px solid rgba(238,233,223,.18); }
.hero-facts span { display: flex; min-height: 76px; align-items: center; gap: 8px; padding: 0 28px; border-right: 1px solid rgba(238,233,223,.14); color: var(--dim); font-size: 12px; letter-spacing: .04em; }
.hero-facts b { color: var(--ink); font-family: var(--display); font-size: 24px; font-weight: 500; }
.hero-facts .hero-platform { justify-content: flex-end; border-right: 0; color: var(--gold2); }

/* Platform routes */
.platform-section { padding-block: clamp(70px, 8vw, 112px) 22px; }
.platform-intro { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(320px, 1.1fr); gap: 70px; align-items: end; margin-bottom: 42px; }
.platform-intro .eyebrow { grid-column: 1 / -1; margin-bottom: -40px; }
.platform-intro h2 { margin: 0; font-size: clamp(30px, 4vw, 46px); }
.platform-intro > p:last-child { max-width: 620px; margin: 0 0 5px; color: var(--dim); }
.platform-list { border-top: 1px solid var(--line2); }
.platform-item { display: grid; grid-template-columns: 150px 1fr minmax(120px, 170px); gap: 26px; min-height: 124px; align-items: center; padding: 22px 4px; border-bottom: 1px solid var(--line); color: var(--ink); transition: border-color 180ms var(--ease), background 180ms var(--ease); }
.platform-item:hover { border-color: var(--gold); background: rgba(199,168,108,.035); text-decoration: none; }
.platform-item.primary { border-top: 1px solid var(--gold); }
.platform-item.primary h3 { color: var(--gold2); }
.platform-status { width: fit-content; padding: 4px 9px; border: 1px solid var(--magic); border-radius: 999px; color: var(--magic); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.platform-status.ready { border-color: var(--green); color: var(--green); }
.platform-status.limited { border-color: var(--gold); color: var(--gold2); }
.platform-item h3 { margin: 0 0 4px; font-family: var(--font); font-size: 17px; }
.platform-item p { max-width: 680px; margin: 0; color: var(--dim); font-size: 13px; }
.platform-action { justify-self: end; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.platform-item:hover .platform-action { color: var(--gold2); }

/* Home content */
.feature-section { display: grid; grid-template-columns: minmax(300px, .75fr) minmax(0, 1.25fr); gap: clamp(50px, 8vw, 110px); }
.feature-section .section-heading { position: sticky; top: calc(var(--nav-h) + 40px); align-self: start; margin: 0; }
.feature-list { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line2); }
.feature-item { display: grid; grid-template-columns: 38px 1fr; gap: 12px; min-height: 210px; padding: 28px 22px 32px 0; border-bottom: 1px solid var(--line); }
.feature-item:nth-child(odd) { border-right: 1px solid var(--line); }
.feature-item:nth-child(even) { padding-left: 24px; }
.feature-no, .class-no, .news-no { color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.feature-item h3 { margin: 0 0 10px; font-family: var(--font); font-size: 17px; font-weight: 700; }
.feature-item p { margin: 0; color: var(--dim); font-size: 14px; }
.class-band { overflow: hidden; }
.cls { grid-template-columns: repeat(7, minmax(145px, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.cls-c { position: relative; min-width: 0; padding: 24px 16px 20px; overflow: hidden; background: var(--bg2); transition: background 180ms var(--ease); }
.cls-c:hover { background: var(--panel); }
.class-no { position: absolute; top: 16px; left: 16px; }
.cls-c img { width: auto; height: 150px; margin: 12px auto 8px; image-rendering: pixelated; filter: saturate(.88); transition: filter 180ms var(--ease), transform 220ms var(--ease); }
.cls-c:hover img { filter: saturate(1); transform: translateY(-3px); }
.cls-c h3 { margin: 10px 0 1px; font-size: 20px; }
.cls-c > small { color: var(--gold); font-size: 11px; letter-spacing: .08em; }
.cls-c p { margin: 12px 0 0; color: var(--dim); font-size: 13px; line-height: 1.65; }
.cls-c .class-meta { color: var(--dim2); font-size: 11px; }
.boss { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 30px; }
.boss-c { min-width: 0; text-align: center; }
.boss-art { display: grid; min-height: 170px; place-items: end center; border-bottom: 1px solid var(--line2); }
.boss-c img { width: auto; height: 148px; object-fit: contain; image-rendering: pixelated; filter: saturate(.86); transition: filter 180ms var(--ease), transform 220ms var(--ease); }
.boss-c:hover img { filter: saturate(1); transform: translateY(-4px); }
.boss-c h3 { margin: 18px 0 3px; font-size: 18px; }
.boss-c p { margin: 0; color: var(--dim); font-size: 12px; }
.news-list { border-top: 1px solid var(--line2); }
.news-i { display: grid; grid-template-columns: 50px 120px 1fr 32px; gap: 18px; min-height: 86px; align-items: center; border-bottom: 1px solid var(--line); color: var(--ink); }
.news-i:hover { color: var(--gold2); text-decoration: none; }
.news-date { color: var(--dim2); font-size: 12px; }
.news-i h3 { margin: 0; font-family: var(--font); font-size: 16px; font-weight: 600; }
.news-arrow { display: grid; place-items: center; color: var(--dim2); transition: color 180ms var(--ease), transform 180ms var(--ease); }
.news-i:hover .news-arrow { color: var(--gold); transform: translate(2px,-2px); }
.community { display: grid; grid-template-columns: 1.3fr .7fr; gap: 60px; align-items: end; }
.community h2 { max-width: 760px; margin: 0 0 16px; }
.community-copy > p:last-child { max-width: 600px; color: var(--dim); }
.community-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; padding-bottom: 10px; }

/* Lists, docs and tables */
.news-list a.card { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 20px; border-width: 0 0 1px; border-radius: 0; background: transparent; }
.news-list a.card h3 { margin: 0; font-family: var(--font); font-size: 16px; }
.guide { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.guide h3 { margin: 0; }
.doc { max-width: 820px; }
.doc > p, .doc > ul, .doc > ol { max-width: 72ch; }
.doc ul, .doc ol { padding-left: 1.4em; }
.doc li { margin: 6px 0; }
.doc code { padding: 2px 6px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); color: var(--gold2); }
.tw { margin: 12px 0 24px; overflow-x: auto; border-block: 1px solid var(--line); }
.tw.narrow { max-width: 440px; }
table { width: 100%; border-collapse: collapse; background: transparent; font-size: 14px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; overflow-wrap: anywhere; }
th { color: var(--gold2); background: var(--panel); font-size: 12px; letter-spacing: .03em; }
tr:last-child td { border-bottom: 0; }
pre.lic { padding: 18px; white-space: pre-wrap; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--dim); font-size: 12px; }

/* Support */
.sup-q { grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 24px 0 56px; }
.sup-q h3 { margin: 6px 0; }
.sup-q p { margin: 0; color: var(--dim); font-size: 13px; }
.faq details { margin: 0; padding: 0 4px; border-bottom: 1px solid var(--line); }
.faq summary { min-height: 56px; padding: 15px 0; cursor: pointer; list-style: none; font-weight: 700; }
.faq summary::before { display: inline-block; width: 26px; color: var(--gold); content: '+'; }
.faq details[open] summary::before { content: '−'; }
.faq details p { max-width: 72ch; margin: 0 0 18px 26px; color: var(--dim); }
.form { display: grid; max-width: 720px; gap: 16px; }
.form label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.form input, .form select, .form textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 4px; background: var(--bg2); color: var(--ink); font-size: 16px; font-weight: 400; }
.form textarea { min-height: 120px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--gold); outline: 2px solid rgba(199,168,108,.25); outline-offset: 1px; }
.form .btn { justify-self: start; }
.form-msg:empty { display: none; }
.form-msg { padding: 12px 14px; border-left: 3px solid var(--line2); background: var(--panel2); }
.form-msg.ok { border-left-color: var(--green); }
.form-msg.bad { border-left-color: var(--red); }
.code-big { color: var(--gold2); font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: .14em; }
.reply { margin: 10px 0; padding: 10px 14px; border-left: 2px solid var(--magic); background: var(--bg2); white-space: pre-wrap; }
.reply.gm { border-left-color: var(--gold); }

/* Official archive */
.db-home { padding-top: clamp(78px, 10vw, 132px); }
.db-home h1 { max-width: 800px; font-size: clamp(50px, 8vw, 92px); line-height: 1.08; }
.db-lead { max-width: 720px; color: var(--dim); font-size: clamp(17px, 2vw, 20px); }
.db-statbar { display: grid; grid-template-columns: repeat(4, 1fr); margin: 58px 0 72px; border-block: 1px solid var(--line2); }
.db-statbar span { display: grid; min-height: 100px; place-items: center; padding: 16px; border-right: 1px solid var(--line); color: var(--dim); text-align: center; }
.db-statbar span:last-child { border-right: 0; }
.db-statbar b { display: block; color: var(--ink); font-family: var(--display); font-size: 30px; font-weight: 500; font-variant-numeric: tabular-nums; }
.db-nav { grid-template-columns: 1fr 1fr; gap: 0 40px; }
.db-nav a.card { display: grid; grid-template-columns: 42px 1fr auto; gap: 18px; align-items: start; min-height: 190px; padding: 28px 0; border-width: 1px 0 0; border-radius: 0; background: transparent; }
.db-nav a.card:hover { background: transparent; border-color: var(--gold); }
.db-index { color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.db-nav h2 { margin: -5px 0 5px; font-size: 26px; }
.db-nav b { color: var(--ink-soft); font-size: 13px; }
.db-nav p { margin: 12px 0 0; color: var(--dim); font-size: 14px; }
.db-open { display: inline-flex; align-self: end; align-items: center; gap: 6px; color: var(--dim2); font-size: 12px; white-space: nowrap; }
.db-open .arrow-icon { width: 15px; height: 15px; }
.db-note { display: grid; grid-template-columns: 150px 1fr; gap: 28px; margin: 70px 0 20px; padding: 28px 0; border-block: 1px solid var(--line2); }
.db-note-label { color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .18em; }
.db-note b { color: var(--ink); font-family: var(--display); font-size: 20px; }
.db-note p { max-width: 780px; margin: 6px 0 0; color: var(--dim); }
.db-page { max-width: 1000px; padding-top: clamp(64px, 8vw, 110px); }
.db-page > h1 { max-width: 760px; }
.db-page > h1 + p { max-width: 760px; font-size: 17px; }
.db-page h2 { margin-top: 58px; color: var(--ink); }
.db-tools { position: sticky; z-index: 30; top: calc(var(--nav-h) + 12px); display: grid; grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto; gap: 12px; align-items: end; margin: 30px 0 18px; padding: 14px; border: 1px solid var(--line2); border-radius: 6px; background: rgba(15,21,30,.97); box-shadow: 0 18px 34px rgba(0,0,0,.26); }
.db-tools label { display: grid; gap: 4px; color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.db-tools input, .db-tools select { width: 100%; min-height: 46px; padding: 9px 12px; border: 1px solid var(--line2); border-radius: 3px; background: var(--bg); color: var(--ink); font-size: 16px; }
.db-tools input:focus, .db-tools select:focus { border-color: var(--gold); outline: 2px solid rgba(199,168,108,.25); outline-offset: 1px; }
.db-count { min-width: 104px; padding: 11px 2px; color: var(--magic); text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.db-list { display: grid; gap: 8px; }
.db-entry { scroll-margin-top: 165px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.db-entry[hidden] { display: none; }
.db-entry:target { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(199,168,108,.25); }
.db-entry summary { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; }
.db-entry summary::-webkit-details-marker { display: none; }
.db-entry summary::before { flex: 0 0 24px; color: var(--gold); content: '+'; font-size: 18px; }
.db-entry[open] summary::before { content: '−'; }
.db-entry summary > span { flex: 1; min-width: 0; }
.db-entry summary b { display: block; color: var(--ink); font-size: 15px; }
.db-entry summary small { display: block; color: var(--dim2); font-size: 11px; overflow-wrap: anywhere; }
.db-anchor { display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center; border-radius: 3px; color: var(--dim2); }
.db-anchor:hover { background: var(--panel3); color: var(--gold2); text-decoration: none; }
.db-entry-body { padding: 0 18px 18px 52px; border-top: 1px solid var(--line); }
.db-entry-body > p:first-child { margin-top: 14px; }
.db-entry-body h4 { margin: 18px 0 6px; color: var(--gold2); font-family: var(--font); }
.db-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.db-chip { display: inline-flex; min-height: 28px; align-items: center; padding: 3px 9px; border: 1px solid var(--line2); border-radius: 3px; background: var(--bg2); color: var(--dim); font-size: 11px; }
.db-sources { columns: 2; column-gap: 30px; padding-left: 1.2em; color: var(--dim); font-size: 14px; }
.db-sources li { break-inside: avoid; margin: 4px 0; }
.db-empty { padding: 34px; border: 1px dashed var(--line2); color: var(--dim); text-align: center; }
.rarity-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--rarity); }
.db-formulas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 24px 0; border: 1px solid var(--line); background: var(--line); }
.db-formulas > div { display: grid; gap: 4px; padding: 18px; background: var(--panel); }
.db-formulas b { color: var(--gold2); }
.db-formulas code { color: var(--magic); overflow-wrap: anywhere; }
.db-formulas small { color: var(--dim); }

/* Footer and utility pages */
.foot { margin-top: 40px; padding: 64px 0 calc(32px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #080b10; }
.foot-cols { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 44px; }
.foot-cols > div:first-child p { max-width: 360px; }
.foot h4 { margin: 0 0 14px; color: var(--ink); font-family: var(--font); font-size: 12px; letter-spacing: .12em; }
.foot a:not(.brand) { display: block; min-height: 34px; padding: 4px 0; color: var(--dim); font-size: 13px; }
.foot a:hover { color: var(--gold2); }
.rating { margin: 30px 0 8px; color: var(--dim2); font-size: 12px; }
.rating-badge { display: inline-block; margin-right: 8px; padding: 1px 8px; border: 1px solid var(--gold); color: var(--gold2); font-weight: 800; }
.nf { max-width: 760px; }
.nf-art { position: relative; display: inline-block; margin-top: 10px; animation: nfBob 2.4s ease-in-out infinite; }
.nf-art img { width: auto; height: 120px; image-rendering: pixelated; }
.nf-q { position: absolute; top: -6px; right: -18px; color: var(--gold); font-family: var(--display); font-size: 32px; font-weight: 700; }
@keyframes nfBob { 50% { transform: translateY(-6px); } }
.nf-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 24px 0; text-align: left; }
.nf-links b { display: block; color: var(--gold2); }
.nf-links span { color: var(--dim); font-size: 12px; }
.nf-btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

@media (max-width: 1100px) {
  .cls { grid-template-columns: repeat(4, 1fr); }
  .sup-q { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 980px) {
  :root { --nav-h: 66px; }
  .nav-tg { display: block; }
  .nav-links { position: absolute; top: var(--nav-h); right: 0; left: 0; display: grid; gap: 0; padding: 14px 20px 20px; border-bottom: 1px solid var(--line2); background: var(--bg2); opacity: 0; pointer-events: none; transform: translateY(-8px); transition: opacity 180ms var(--ease), transform 180ms var(--ease); }
  .nav.open .nav-links { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .nav-links a:not(.btn) { min-height: 50px; padding-inline: 4px; border-bottom: 1px solid var(--line); }
  .nav-links a:not(.btn)::after { display: none; }
  .nav-links .play { margin: 14px 0 0; }
  .feature-section { grid-template-columns: 1fr; }
  .feature-section .section-heading { position: static; }
  .section-heading.split { grid-template-columns: 1fr; gap: 20px; }
  .platform-intro { grid-template-columns: 1fr; gap: 18px; }
  .platform-intro .eyebrow { grid-column: auto; margin-bottom: 0; }
  .db-nav { grid-template-columns: 1fr; }
  .foot-cols { grid-template-columns: 1.5fr 1fr 1fr; }
  .foot-cols > div:last-child { grid-column: 2; }
}

@media (max-width: 760px) {
  .wrap { width: min(100% - 32px, var(--wrap)); }
  .section { padding-block: 68px; }
  .brand-copy small { display: none; }
  .hero { min-height: 680px; }
  .hero-art { object-position: 63% center; }
  .hero::after { background: linear-gradient(180deg, rgba(8,11,16,.48) 0%, rgba(8,11,16,.72) 46%, rgba(8,11,16,.98) 82%); }
  .hero-in { align-self: end; padding-top: 130px; padding-bottom: 170px; }
  .hero h1 { font-size: clamp(58px, 19vw, 88px); }
  .hero h1 small { font-size: 18px; }
  .hero-note { font-size: 12px; }
  .hero-facts { grid-template-columns: repeat(3, 1fr); }
  .hero-facts span { min-height: 72px; justify-content: center; padding: 8px; text-align: center; }
  .hero-facts .hero-platform { display: none; }
  .platform-section { padding-bottom: 0; }
  .platform-item { grid-template-columns: 116px 1fr; gap: 14px; }
  .platform-action { grid-column: 2; justify-self: start; }
  .feature-list { grid-template-columns: 1fr; }
  .feature-item { min-height: 0; padding: 24px 0; border-right: 0 !important; }
  .feature-item:nth-child(even) { padding-left: 0; }
  .cls { grid-template-columns: 1fr 1fr; }
  .cls-c img { height: 130px; }
  .boss { grid-template-columns: 1fr 1fr; gap: 26px 14px; }
  .news-i { grid-template-columns: 34px 1fr 26px; gap: 10px; padding: 15px 0; }
  .news-date { grid-column: 2; grid-row: 1; }
  .news-i h3 { grid-column: 2; grid-row: 2; }
  .news-no { grid-row: 1 / 3; }
  .news-arrow { grid-column: 3; grid-row: 1 / 3; }
  .community { grid-template-columns: 1fr; gap: 26px; }
  .community-actions { justify-content: flex-start; }
  .news-list a.card { grid-template-columns: 1fr; gap: 2px; }
  .db-statbar { grid-template-columns: 1fr 1fr; }
  .db-statbar span:nth-child(2) { border-right: 0; }
  .db-statbar span:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .db-nav a.card { grid-template-columns: 34px 1fr; }
  .db-open { display: none; }
  .db-note { grid-template-columns: 1fr; gap: 10px; }
  .db-tools { top: calc(var(--nav-h) + 8px); grid-template-columns: 1fr; align-items: stretch; }
  .db-count { min-width: 0; padding: 0; text-align: left; }
  .db-sources { columns: 1; }
  .db-entry-body { padding-left: 18px; }
  .db-formulas { grid-template-columns: 1fr; }
  .sup-q { grid-template-columns: 1fr; }
  .foot-cols { grid-template-columns: 1fr 1fr; gap: 30px; }
  .foot-cols > div:first-child { grid-column: 1 / -1; }
  .foot-cols > div:last-child { grid-column: auto; }
}

@media (max-width: 480px) {
  body { font-size: 15px; }
  .hero { min-height: 640px; }
  .hero-facts span { display: grid; gap: 0; font-size: 10px; }
  .hero-facts b { font-size: 21px; }
  .cta { align-items: stretch; flex-direction: column; }
  .cta .text-link { justify-content: center; }
  .platform-item { grid-template-columns: 1fr; gap: 10px; padding-block: 24px; }
  .platform-action { grid-column: auto; justify-self: start; }
  .cls { grid-template-columns: 1fr; }
  .cls-c { display: grid; grid-template-columns: 100px 1fr; column-gap: 16px; min-height: 170px; align-content: center; }
  .cls-c img { grid-row: 1 / 5; width: 100px; height: 140px; margin: 0; object-fit: contain; }
  .cls-c h3, .cls-c > small, .cls-c p { grid-column: 2; }
  .cls-c h3 { margin-top: 0; }
  .boss-art { min-height: 140px; }
  .boss-c img { height: 120px; }
  .db-statbar span { min-height: 86px; }
  .db-statbar b { font-size: 25px; }
  th, td { padding: 9px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
