:root {
  color-scheme: dark;
  --bg: #0b1111;
  --panel: #111a19;
  --soft: #16211f;
  --line: #2b3935;
  --ink: #f4f0e7;
  --muted: #aab2ab;
  --gold: #e5b65f;
  --mint: #77d6b1;
  --danger: #ffae78;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; padding-bottom: 72px; background: var(--bg); color: var(--ink); }
a { color: inherit; }
button, summary { font: inherit; }
img { display: block; max-width: 100%; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 24px;
  min-height: 64px; padding: 0 max(18px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(11,17,17,.9); backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto; font-weight: 800; text-decoration: none; }
.brand-logo { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; object-fit: cover; }
.brand span { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font: 700 11px/1 Georgia,serif; }
.brand-copy { display: flex !important; flex: 0 1 auto; min-width: 0; flex-wrap: wrap; gap: 0 .35em; border: 0 !important; width: auto !important; height: auto !important; color: var(--ink) !important; font: inherit !important; }
.brand-copy > span { display: inline !important; width: auto !important; height: auto !important; border: 0 !important; color: inherit !important; font: inherit !important; white-space: nowrap; }
.topbar nav { display: flex; gap: 22px; }
.topbar nav a { color: var(--muted); font-size: 13px; text-decoration: none; }
.topbar nav a:hover { color: var(--ink); }
.top-cta { padding: 10px 14px; border: 1px solid #4c5e58; border-radius: 999px; color: var(--gold); background: transparent; font-size: 12px; font-weight: 800; text-decoration: none; cursor: pointer; }
.top-cta:hover { border-color: var(--gold); background: rgba(229,182,95,.08); }

main { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.campaigns { padding: 84px 0 24px; border-bottom: 1px solid var(--line); }
.campaign-intro { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(260px,.8fr); gap: 40px; align-items: center; padding-bottom: 46px; }
.campaign-intro h1 { margin-bottom: 20px; }
.campaign-intro .lead { max-width: 720px; }
.campaign-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.campaign-stats span { display: grid; gap: 4px; min-width: 128px; padding: 12px 14px; border: 1px solid var(--line); background: rgba(119,214,177,.04); color: var(--muted); font-size: 11px; }
.campaign-stats b { color: var(--gold); font: 700 20px/1 Georgia,serif; }
.dice-stage { position: relative; display: flex; flex-direction: column; align-items: center; min-height: 280px; padding: 26px 14px 58px; overflow: hidden; border: 1px solid rgba(119,214,177,.22); border-radius: 22px; background: radial-gradient(circle at 50% 36%, rgba(229,182,95,.19), transparent 32%), linear-gradient(145deg, rgba(119,214,177,.07), rgba(229,182,95,.03)); }
.dice-stage::before, .dice-stage::after { content: ""; position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--mint); box-shadow: 44px -64px 0 rgba(229,182,95,.8), -92px 32px 0 rgba(119,214,177,.6), 112px 76px 0 rgba(229,182,95,.55), -48px 83px 0 rgba(119,214,177,.4); animation: spark-drift 6s ease-in-out infinite alternate; }
.dice-stage::after { width: 2px; height: 2px; opacity: .65; transform: translate(35px, -8px) scale(1.4); animation-delay: -2s; }
.dice-button { position: relative; z-index: 1; display: grid; flex: 0 0 auto; place-items: center; width: 164px; height: 172px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; transform: translateY(-4px); transform-origin: center; transition: transform .2s ease, filter .2s ease; will-change: transform; }
.dice-button:hover { transform: translateY(-8px) scale(1.04); filter: drop-shadow(0 16px 24px rgba(229,182,95,.25)); }
.dice-button:focus-visible { outline: 3px solid var(--gold); outline-offset: 8px; }
.dice-model { width: 156px; height: 166px; background: linear-gradient(145deg, #fff3bd 0%, #e5b65f 42%, #8d5324 100%); -webkit-mask: url("./images/d20-foundry.svg") center / contain no-repeat; mask: url("./images/d20-foundry.svg") center / contain no-repeat; filter: drop-shadow(0 12px 18px rgba(229,182,95,.34)); transition: transform .2s ease, filter .2s ease; }
.dice-button:hover .dice-model { filter: drop-shadow(0 14px 24px rgba(229,182,95,.48)); }
.dice-number { position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 5px; color: #fff4d2; font: 800 38px/1 Georgia,serif; text-shadow: 0 2px 6px rgba(23,16,6,.8), 0 0 14px rgba(255,244,210,.28); pointer-events: none; }
.dice-button.is-rolling { animation: dice-throw .72s cubic-bezier(.2,.78,.28,1); }
.dice-button.is-critical .dice-model { filter: drop-shadow(0 0 22px rgba(229,182,95,.75)); }
.dice-result { position: absolute; right: 14px; bottom: 34px; left: 14px; margin: 0; color: #fff4d2; font-size: 13px; font-weight: 700; letter-spacing: .02em; line-height: 1.4; text-align: center; }
.dice-stage small { position: absolute; right: 14px; bottom: 13px; left: 14px; color: var(--muted); font: 700 9px/1 ui-monospace,monospace; letter-spacing: .18em; text-align: center; }
.module-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.module-card { display: grid; grid-template-rows: 248px 1fr; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); box-shadow: 0 20px 50px rgba(0,0,0,.18); }
.module-card--winter { border-color: rgba(119,214,177,.36); }
.module-card--abyss { border-color: rgba(229,182,95,.28); }
.module-art { position: relative; overflow: hidden; background: #101717; }
.module-art::after { content: ""; position: absolute; inset: auto 0 0; height: 45%; background: linear-gradient(transparent, rgba(8,13,13,.7)); pointer-events: none; }
.module-art img { width: 100%; height: 100%; object-fit: cover; }
.module-card--winter .module-art img { object-position: center 42%; }
.module-card--abyss .module-art img { object-position: center 28%; }
.module-content { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 23px; }
.module-kicker { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 12px; color: var(--mint); font: 700 9px/1.3 ui-monospace,monospace; letter-spacing: .09em; }
.module-status { flex: 0 0 auto; padding: 5px 8px; border: 1px solid currentColor; border-radius: 999px; font-size: 9px; letter-spacing: 0; }
.module-status.live { color: var(--mint); }
.module-status.soon { color: var(--danger); }
.module-content h2 { margin: 0; color: var(--ink); font: 600 31px/1.1 Georgia,"Songti SC",serif; }
.module-content > p { margin: 0; color: #c2cac3; font-size: 13px; line-height: 1.85; }
.module-note { display: grid; gap: 7px; width: 100%; padding: 13px 15px; border-left: 2px solid var(--mint); background: rgba(119,214,177,.07); }
.module-note.muted { border-left-color: var(--gold); background: rgba(229,182,95,.06); }
.module-note strong { color: var(--mint); font-size: 12px; }
.module-note.muted strong { color: var(--gold); }
.module-note span { color: var(--muted); font-size: 11px; line-height: 1.7; }
.module-note span strong { color: var(--gold); font-size: inherit; }
.module-principles-link { width: fit-content; padding: 0; border: 0; background: transparent; color: var(--gold); cursor: pointer; font: 700 11px/1.7 inherit; text-align: left; }
.module-principles-link strong { color: inherit; font-size: inherit; }
.module-principles-link:hover { color: #fff4d2; text-decoration: underline; }
.module-content > .button { margin-top: auto; }
.button.disabled { border: 1px solid #40504a; color: #7e8982; background: #17201d; cursor: not-allowed; }
.map-strip { display: grid; grid-template-columns: 1.05fr .95fr; gap: 16px; margin-top: 16px; }
.map-strip figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #0e1514; }
.map-strip img { width: 100%; height: 208px; object-fit: cover; }
.map-strip figure:first-child img { object-position: center 44%; }
.map-strip figure:last-child img { object-position: center 46%; }
.map-strip figcaption { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; }
.map-strip figcaption b { color: var(--gold); font-size: 12px; }
.map-strip figcaption span { color: var(--muted); font-size: 10px; text-align: right; }
.hero { display: grid; grid-template-columns: 1.35fr .65fr; gap: 70px; align-items: center; min-height: 650px; padding: 86px 0 72px; }
.eyebrow, .section-title p { margin: 0; color: var(--mint); font-size: 11px; font-weight: 850; letter-spacing: .17em; text-transform: uppercase; }
h1 { margin: 16px 0 22px; font: 600 clamp(48px, 7vw, 86px)/.98 Georgia,"Songti SC",serif; letter-spacing: -.045em; }
h1 em { color: var(--gold); font-weight: 500; }
.lead { max-width: 720px; margin: 0; color: #c1c7c1; font-size: clamp(15px, 1.8vw, 19px); line-height: 1.85; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { display: inline-flex; align-items: center; min-height: 46px; padding: 0 19px; border-radius: 999px; font-size: 13px; font-weight: 850; text-decoration: none; }
.button.primary { background: var(--gold); color: #171005; }
.button.ghost { border: 1px solid #46554f; color: var(--ink); }
.updated { margin: 24px 0 0; color: #7f8d86; font-size: 11px; }
.detail-hero { max-width: 900px; padding: 88px 0 54px; }
.detail-hero h1 { font-size: clamp(40px,6vw,68px); }
.detail-guide { padding-top: 34px; }
.detail-guide .class-list { margin-top: 18px; }
.detail-page .build > summary { cursor: default; }
.hero-card { padding: 27px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(229,182,95,.09), transparent 42%), var(--panel); box-shadow: 0 30px 70px rgba(0,0,0,.28); }
.hero-card > p { margin: 0 0 16px; color: var(--gold); font-size: 11px; font-weight: 850; letter-spacing: .14em; }
.hero-card dl { margin: 0; }
.hero-card dl div { display: flex; justify-content: space-between; gap: 18px; padding: 15px 0; border-top: 1px solid var(--line); }
.hero-card dt { font-weight: 800; }
.hero-card dd { margin: 0; color: var(--muted); text-align: right; }
.demo-entry { display: grid; grid-template-columns: .72fr 1.28fr; gap: 28px; margin-bottom: 86px; padding: 24px; border: 1px solid #5b4c33; border-radius: 18px; background: linear-gradient(135deg,rgba(229,182,95,.12),transparent 45%),var(--panel); }
.demo-entry.first-entry { margin-top: 46px; margin-bottom: 0; }
.demo-entry h2 { margin: 7px 0 12px; font: 600 clamp(27px,3vw,40px)/1.15 Georgia,"Songti SC",serif; }
.demo-entry-copy > p:not(.eyebrow) { margin: 0 0 18px; color: #c6ccc6; font-size: 13px; line-height: 1.8; }
.button.wide { justify-content: center; width: 100%; }
.quick-demo-list { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.quick-demo { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(9,15,14,.72); text-decoration: none; }
.quick-demo b { font-size: 13px; }
.quick-demo span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.quick-demo:hover { border-color: var(--gold); }
.quick-demo:hover b { color: var(--gold); }

.section { padding: 86px 0; border-top: 1px solid var(--line); scroll-margin-top: 64px; }
.section.compact { padding-bottom: 56px; }
.section-title { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 34px; }
.section-title > span { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #4b5a54; border-radius: 50%; color: var(--gold); font: 700 12px/1 ui-monospace,monospace; }
.section-title h2 { margin: 4px 0 0; font: 600 clamp(30px, 4vw, 48px)/1.12 Georgia,"Songti SC",serif; }
.section-lead { max-width: 800px; margin: -14px 0 30px; color: var(--muted); line-height: 1.8; }

.rule-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.rule-grid article { min-height: 184px; padding: 23px; background: var(--panel); }
.rule-grid b { color: var(--gold); font-size: 17px; }
.rule-grid p { margin: 13px 0 0; color: var(--muted); font-size: 13px; line-height: 1.85; }
.callout { display: grid; grid-template-columns: 140px 1fr; gap: 18px; margin-top: 14px; padding: 19px 21px; border: 1px solid #355147; background: rgba(119,214,177,.06); }
.callout.warning { border-color: #654a38; background: rgba(255,174,120,.06); }
.callout b { color: var(--mint); }
.callout.warning b { color: var(--danger); }
.callout p { margin: 0; color: #c6cdc7; font-size: 13px; line-height: 1.75; }
.point-buy { display: grid; grid-template-columns: 1fr 1.3fr; gap: 28px; align-items: center; margin-top: 14px; padding: 22px; border: 1px solid var(--line); background: var(--panel); }
.point-buy b { color: var(--gold); }
.point-buy p { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: center; }
th,td { padding: 9px 6px; border: 1px solid var(--line); }
th { color: var(--gold); }

.steps { display: grid; gap: 14px; }
.step-card { display: grid; grid-template-columns: minmax(260px,.75fr) minmax(0,1.25fr); gap: 24px; padding: 24px; border: 1px solid var(--line); background: var(--panel); }
.step-copy small { color: var(--mint); font-weight: 850; letter-spacing: .12em; }
.step-copy h3 { margin: 8px 0 16px; font: 600 26px/1.2 Georgia,"Songti SC",serif; }
.line { margin: 9px 0 0; padding: 12px 13px; border-left: 2px solid #52645d; background: var(--soft); color: #c9cec9; font-size: 12px; line-height: 1.75; }
.line.example { border-left-color: var(--gold); }
.line b { color: var(--ink); }

.gallery { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; align-items: start; overflow: visible; padding: 0; }
.shot { width: 100%; max-width: 900px; margin: 0 auto; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #0d1413; }
.shot button { width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.shot img { width: 100%; height: auto; object-fit: contain; }
.shot figcaption { min-height: 58px; padding: 14px 15px; color: #e5ece5; background: linear-gradient(180deg, rgba(22,33,31,.98), rgba(13,20,19,.98)); font-size: 14px; font-weight: 750; line-height: 1.5; }

.class-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.class-jump a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: #c9d0ca; font-size: 12px; text-decoration: none; }
.class-jump a:hover { border-color: var(--gold); color: var(--gold); }
.career-index { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: stretch; margin: 0 0 22px; padding: 18px; border: 1px solid rgba(229,182,95,.28); background: linear-gradient(135deg, rgba(229,182,95,.08), transparent 55%), var(--panel); }
.career-index--landing { margin-top: 30px; padding: 22px; border-color: rgba(229,182,95,.5); box-shadow: 0 18px 52px rgba(0,0,0,.22); scroll-margin-top: 72px; }
.career-index > div:first-child { display: grid; align-content: center; gap: 8px; padding-right: 17px; border-right: 1px solid var(--line); }
.career-index > div:first-child span { color: var(--mint); font: 700 9px/1 ui-monospace,monospace; letter-spacing: .14em; }
.career-index > div:first-child b { color: var(--gold); font: 600 20px/1.2 Georgia,"Songti SC",serif; }
.career-index > div:first-child small { color: var(--muted); font-size: 10px; line-height: 1.65; }
.career-index .demo-help { margin: 3px 0 0; color: #f4e5bb; font-size: 12px; font-weight: 700; line-height: 1.7; }
.alignment-note { display: grid; grid-template-columns: 120px 1fr; gap: 15px; align-items: start; margin: 0 0 18px; padding: 15px 17px; border: 1px solid rgba(229,182,95,.3); border-left: 3px solid var(--gold); background: rgba(229,182,95,.06); }
.alignment-note b { color: var(--gold); font-size: 12px; }
.alignment-note span { color: #c8d0c9; font-size: 12px; line-height: 1.75; }
.class-list { display: grid; gap: 12px; }
.build { border: 1px solid var(--line); background: var(--panel); scroll-margin-top: 72px; }
.build[open] { border-color: #665437; }
.build > summary { display: grid; grid-template-columns: minmax(160px,.8fr) minmax(0,1.2fr) auto; gap: 18px; align-items: center; padding: 20px; cursor: pointer; list-style: none; }
.build > summary::-webkit-details-marker { display: none; }
.build > summary h3 { margin: 0; font: 600 24px/1.1 Georgia,"Songti SC",serif; }
.build > summary p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.build > summary .stats { color: #c8cec8; font: 11px/1.6 ui-monospace,"SFMono-Regular",monospace; }
.build > summary::after { content: "+"; color: var(--gold); font-size: 22px; }
.build[open] > summary::after { content: "−"; }
.build-body { padding: 0 20px 22px; border-top: 1px solid var(--line); }
.build-meta { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; margin: 0 0 18px; border: 1px solid var(--line); background: var(--line); }
.build-meta div { padding: 14px; background: var(--soft); }
.build-meta dt { color: var(--muted); font-size: 10px; }
.build-meta dd { margin: 5px 0 0; font-size: 13px; font-weight: 800; }
.build-lines { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.build-lines p { margin: 0; padding: 14px; border-left: 2px solid #54645e; background: #0e1715; color: #c7cdc8; font-size: 12px; line-height: 1.75; }
.build-lines p:last-child { border-left-color: var(--gold); }
.build-lines b { color: var(--ink); }
.mini-steps { display: grid; grid-template-columns: repeat(5,1fr); gap: 1px; margin: 0 0 18px; border: 1px solid var(--line); background: var(--line); }
.mini-steps p { display: grid; align-content: start; gap: 8px; min-height: 150px; margin: 0; padding: 14px; background: var(--soft); }
.mini-steps b { color: var(--gold); font-size: 12px; }
.mini-steps span { color: var(--muted); font-size: 11px; line-height: 1.7; }
.evidence-title { margin: 18px 0 10px; color: var(--mint); font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }

.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.check-grid p { display: flex; gap: 12px; align-items: center; min-height: 68px; margin: 0; padding: 15px 18px; background: var(--panel); color: #c8cec9; font-size: 13px; }
.check-grid span { display: grid; place-items: center; flex: 0 0 auto; width: 25px; height: 25px; border-radius: 50%; background: var(--mint); color: #06130e; font-weight: 900; }
.source { margin: 14px 0 0; padding: 18px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.source a { color: var(--gold); }

.lightbox { width: min(1200px,96vw); max-height: 94vh; padding: 12px; border: 1px solid #4a5a54; border-radius: 12px; background: #080c0c; color: var(--ink); }
.lightbox::backdrop { background: rgba(0,0,0,.86); backdrop-filter: blur(4px); }
.lightbox img { max-width: 100%; max-height: calc(94vh - 82px); margin: auto; object-fit: contain; }
.lightbox p { margin: 10px 40px 2px 8px; color: var(--muted); font-size: 12px; }
.close { position: absolute; top: 13px; right: 15px; width: 36px; height: 36px; border: 1px solid #52615b; border-radius: 50%; background: #111a18; color: white; font-size: 22px; cursor: pointer; }

.site-footer { position: fixed; right: 0; bottom: 0; left: 0; z-index: 40; width: 100%; margin: 0; padding: 14px 16px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.09); background: rgba(8,18,29,.93); backdrop-filter: blur(14px); color: #91a0ad; font-size: 13px; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 12px; margin: 0 auto; }
.site-footer a, .footer-button { color: #b7dff2; font: inherit; text-underline-offset: 3px; }
.footer-button { padding: 0; border: 0; background: transparent; cursor: pointer; text-decoration: underline; }
.site-footer a:hover, .footer-button:hover { color: #e6f7ff; }
.footer-separator { color: #596b79; }
.principles-modal { width: min(760px, calc(100vw - 28px)); max-height: min(84vh, 760px); overflow: auto; padding: 30px; border: 1px solid rgba(229,182,95,.45); border-radius: 18px; background: linear-gradient(145deg, rgba(229,182,95,.11), transparent 25%), #101817; color: var(--ink); box-shadow: 0 34px 120px rgba(0,0,0,.55); }
.principles-modal::backdrop { background: rgba(4,8,8,.78); backdrop-filter: blur(8px); }
.principles-modal h2 { margin: 9px 0 24px; color: var(--gold); font: 600 34px/1.15 Georgia,"Songti SC",serif; }
.principles-copy { display: grid; gap: 9px; }
.principles-copy h3 { margin: 15px 0 0; color: var(--mint); font-size: 15px; }
.principles-copy p { margin: 0; color: #c8d0c9; font-size: 13px; line-height: 1.9; }
.principles-close { background: #17211f; }
.donation-dialog { width: min(430px, calc(100vw - 28px)); max-height: 90vh; overflow: auto; padding: 0; border: 1px solid rgba(183,223,242,.4); border-radius: 18px; background: #0d1824; color: var(--ink); box-shadow: 0 34px 120px rgba(0,0,0,.55); }
.donation-dialog::backdrop { background: rgba(4,8,8,.78); backdrop-filter: blur(8px); }
.donation-content { position: relative; padding: 30px 20px 20px; }
.donation-content h2 { margin: 0 30px 18px 0; color: #d8effb; font-size: 18px; line-height: 1.5; }
.donation-content img { width: 100%; height: auto; border-radius: 8px; }
.donation-close { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border: 1px solid #526779; border-radius: 50%; background: #132334; color: white; font-size: 21px; cursor: pointer; }

@keyframes dice-throw {
  0% { transform: translateY(12px) rotate(-10deg) scale(.86); }
  28% { transform: translateY(-26px) rotate(120deg) scale(1.08); }
  58% { transform: translateY(8px) rotate(250deg) scale(.98); }
  82% { transform: translateY(-5px) rotate(330deg) scale(1.02); }
  100% { transform: translateY(0) rotate(360deg) scale(1); }
}
@keyframes spark-drift { from { transform: translate(-4px, 3px); opacity: .45; } to { transform: translate(5px, -7px); opacity: 1; } }

@media (max-width: 900px) {
  .topbar nav { display: none; }
  .campaign-intro { grid-template-columns: 1fr; }
  .dice-stage { max-width: 620px; }
  .module-grid, .map-strip { grid-template-columns: 1fr; }
  .career-index { grid-template-columns: 1fr; }
  .career-index > div:first-child { padding: 0 0 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 36px; }
  .hero-card { max-width: 620px; }
  .demo-entry { grid-template-columns: 1fr; }
  .rule-grid { grid-template-columns: repeat(2,1fr); }
  .step-card { grid-template-columns: 1fr; }
  .build-meta { grid-template-columns: repeat(2,1fr); }
  .mini-steps { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 640px) {
  .topbar { min-height: 58px; padding-inline: 14px; }
  .brand { font-size: 0; }
  .brand span { font-size: 10px; }
  .top-cta { margin-left: auto; }
  main { width: min(100% - 28px,1180px); }
  .campaigns { padding-top: 58px; }
  .campaign-stats span { flex: 1 1 100px; min-width: 0; }
  .dice-stage { padding: 12px 12px 58px; }
  .dice-button { transform: translateY(-14px) scale(.88); }
  .dice-button:hover { transform: translateY(-18px) scale(.92); }
  .module-card { grid-template-rows: 210px 1fr; }
  .map-strip img { height: 165px; }
  .hero { padding: 58px 0 50px; }
  .demo-entry { margin-bottom: 58px; padding: 18px; }
  .demo-entry.first-entry { margin-top: 20px; margin-bottom: 0; }
  .quick-demo-list { grid-template-columns: 1fr 1fr; }
  h1 { font-size: clamp(44px,13vw,60px); }
  .section { padding: 58px 0; scroll-margin-top: 58px; }
  .rule-grid, .check-grid, .build-lines { grid-template-columns: 1fr; }
  .mini-steps { grid-template-columns: 1fr; }
  .mini-steps p { min-height: 0; }
  .rule-grid article { min-height: 0; }
  .callout, .point-buy { grid-template-columns: 1fr; }
  .point-buy { overflow-x: auto; }
  .point-buy table { min-width: 500px; }
  .step-card { padding: 18px; }
  .build > summary { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .build > summary .stats { grid-column: 1 / -1; }
  .build-meta { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr; gap: 14px; }
  .shot { max-width: 100%; }
  .shot figcaption { min-height: 0; font-size: 13px; }
  .alignment-note { grid-template-columns: 1fr; gap: 7px; }
  .principles-modal { padding: 24px 19px; }
  .principles-modal h2 { font-size: 29px; }
  body { padding-bottom: 98px; }
  .site-footer { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dice-button.is-rolling, .dice-stage::before, .dice-stage::after { animation: none; }
}
