/* TOFU: Threads of Fate Universe. Gold filigree and glowing threads on deep space. */
:root {
  --bg: #07080f;
  --bg2: #0c0f1c;
  --panel: #111526;
  --panel2: #171c31;
  --line: #262c47;
  --text: #ece7da;
  --muted: #a3a8bd;
  --gold: #d9b45a;
  --gold2: #f3d58c;
  --cyan: #5fd4ff;
  --crimson: #e0475b;
  --earth: #d0623f;
  --aos: #3fc1ad;
  --space: #9a7dff;
  --accent: var(--gold);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --display: 'Cinzel', Georgia, serif;
  --body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16.5px/1.65 var(--body);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(154,125,255,.12), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(95,212,255,.08), transparent 60%),
    radial-gradient(1px 1px at 20% 30%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 80%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 60%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 40%, #fff7 50%, transparent 51%);
  background-size: auto, auto, 300px 300px, 410px 410px, 530px 530px, 370px 370px;
  min-height: 100vh;
}
body.sec-worlds { --accent: var(--aos); }
.threads {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background:
    linear-gradient(115deg, transparent 49.6%, rgba(95,212,255,.18) 50%, transparent 50.4%),
    linear-gradient(62deg, transparent 49.7%, rgba(224,71,91,.12) 50%, transparent 50.3%),
    linear-gradient(155deg, transparent 49.8%, rgba(217,180,90,.14) 50%, transparent 50.2%);
}
a { color: var(--gold2); text-decoration-color: rgba(243,213,140,.35); text-underline-offset: 3px; }
a:hover { color: #fff; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

.preview-bar { position: relative; z-index: 3; background: linear-gradient(90deg, #3a1520, #2a1d40); color: #ffd9de; text-align: center; font-size: 13px; padding: 4px 12px; letter-spacing: .03em; }

/* ---------- header */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 22px;
  padding: 10px 28px; background: rgba(7,8,15,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), var(--cyan), transparent); opacity: .6; }
.brand { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-decoration: none; color: var(--text); }
.knot { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--gold);
  background: radial-gradient(circle at 50% 50%, rgba(95,212,255,.9) 0 2px, transparent 3px),
    conic-gradient(from 0deg, transparent 0 20%, rgba(217,180,90,.7) 21% 23%, transparent 24% 53%, rgba(95,212,255,.7) 54% 56%, transparent 57% 80%, rgba(224,71,91,.7) 81% 83%, transparent 84%);
  box-shadow: 0 0 14px rgba(217,180,90,.35); }
.word { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .14em; line-height: 1; background: linear-gradient(180deg, var(--gold2), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); line-height: 1.3; }
nav.main { display: flex; gap: 4px; }
nav.main a { padding: 8px 14px; border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 500; font-size: 15px; }
nav.main a:hover { background: var(--panel2); }
nav.main a.active { background: rgba(217,180,90,.14); color: var(--gold2); box-shadow: inset 0 0 0 1px rgba(217,180,90,.35); }
.menu-btn { display: none; margin-left: auto; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font: 600 14px var(--body); }
.search { position: relative; margin-left: auto; width: min(340px, 34vw); }
.search input, .filters input, .filters select {
  width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 10px 16px; font: 15px var(--body);
}
.search input:focus, .filters input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(217,180,90,.18); }
.results { position: absolute; right: 0; top: calc(100% + 8px); width: min(520px, 92vw); max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; }
.results a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text); }
.results a:hover, .results a.sel { background: var(--panel2); }
.results .r-sec { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.results .r-t { font-weight: 600; }
.results .r-x { font-size: 13px; color: var(--muted); }
.results .r-none { padding: 12px; color: var(--muted); }
mark { background: rgba(217,180,90,.3); color: inherit; border-radius: 3px; }

/* ---------- layout */
.wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; max-width: 1320px; margin: 0 auto; padding: 32px 28px 60px; }
.wrap.wide { grid-template-columns: minmax(0, 1fr); max-width: 1240px; }
nav.side { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; padding-right: 6px; }
nav.side a { display: block; padding: 7px 12px; border-radius: 9px; text-decoration: none; color: var(--muted); font-size: 15px; border-left: 2px solid transparent; }
nav.side a:hover { color: var(--text); background: var(--panel); }
nav.side a.cur { color: var(--gold2); background: rgba(217,180,90,.1); border-left-color: var(--gold); }
.side-group { margin: 18px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }

/* ---------- article */
.doc { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 220px; column-gap: 40px; }
.doc > .doc-head, .doc > .pn { grid-column: 1 / -1; }
.doc > .prose { grid-column: 1; grid-row: 2; min-width: 0; }
.doc > .toc { grid-column: 2; grid-row: 2; position: sticky; top: 92px; align-self: start; font-size: 14px; }
.doc:not(:has(.toc)) { grid-template-columns: minmax(0, 1fr); }
.doc.bestiary { display: block; }
.doc-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; padding-bottom: 18px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.doc-head .hero-art { width: 170px; height: 170px; object-fit: cover; border-radius: 16px; border: 1px solid rgba(217,180,90,.4); box-shadow: 0 0 30px rgba(217,180,90,.15); }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); margin-bottom: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: .02em; line-height: 1.2; }
h1 { font-size: clamp(30px, 4.2vw, 44px); margin: 0; background: linear-gradient(180deg, #fff 10%, var(--gold2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: 18px; color: var(--muted); margin: 10px 0 0; max-width: 62ch; }
.prose { max-width: 78ch; }
.prose h2 { font-size: 25px; margin: 44px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--gold2); }
.prose h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.prose h3 { font-size: 19px; margin: 30px 0 8px; color: #fff; }
.prose h4 { font-family: var(--body); font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); margin: 24px 0 6px; }
.prose h3.pname { font-family: var(--body); font-size: 17.5px; letter-spacing: 0; color: #fff; margin: 26px 0 6px; padding-left: 12px; border-left: 3px solid var(--gold); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--gold); }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0 22px; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--panel2); color: var(--gold2); font-weight: 600; white-space: nowrap; }
.prose tr:hover td { background: rgba(255,255,255,.02); }
.prose blockquote { margin: 18px 0; padding: 4px 18px; border-left: 3px solid var(--gold); color: var(--muted); font-style: italic; }
.prose code { background: var(--panel2); padding: 1px 6px; border-radius: 5px; font-size: .92em; }
.new-head { color: var(--cyan) !important; }
.admonition { margin: 20px 0; padding: 14px 18px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--gold); }
.admonition-title { margin: 0 0 4px; font-weight: 700; color: var(--gold2); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
.admonition p:last-child { margin-bottom: 0; }
.admonition.info { border-left-color: var(--cyan); } .admonition.info .admonition-title { color: var(--cyan); }
.admonition.warning { border-left-color: var(--crimson); } .admonition.warning .admonition-title { color: #ff8a98; }
.admonition.tip { border-left-color: var(--aos); } .admonition.tip .admonition-title { color: var(--aos); }
.admonition.summary { background: linear-gradient(135deg, rgba(217,180,90,.1), rgba(95,212,255,.05)); }
.toc-title { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 4px 12px; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 50px; }
.pn a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); background: var(--panel); font-weight: 600; }
.pn a:hover { border-color: var(--gold); }
.pn small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.pn .next { text-align: right; }
figure.map { margin: 0 0 28px; }
figure.map img { width: 100%; border-radius: var(--radius); border: 1px solid rgba(217,180,90,.35); }
figure.map figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ---------- cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin: 16px 0 28px; }
.card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-3px); border-color: var(--gold); color: var(--text); }
.card img { width: 100%; height: 160px; object-fit: cover; object-position: 50% 28%; transition: transform .4s; }
.card.has-img { overflow: hidden; }
.card.has-img:hover img { transform: scale(1.04); }
.card-body { padding: 14px 16px 16px; }
.card h3 { margin: 4px 0 6px; font-size: 18px; color: var(--gold2); }
.card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); }
.btn { display: inline-block; padding: 12px 22px; border-radius: 999px; border: 1px solid rgba(217,180,90,.5); color: var(--gold2); text-decoration: none; font-weight: 600; background: rgba(217,180,90,.06); }
.btn:hover { background: rgba(217,180,90,.16); color: #fff; }
.btn.primary { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #1a1406; border-color: transparent; box-shadow: 0 6px 24px rgba(217,180,90,.3); }
.btn.primary:hover { filter: brightness(1.08); color: #000; }

/* ---------- home */
.hero { position: relative; border-radius: 22px; overflow: hidden; min-height: 470px; display: flex; align-items: flex-end; border: 1px solid rgba(217,180,90,.35); box-shadow: var(--shadow); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .7; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,8,15,.92) 0%, rgba(7,8,15,.6) 45%, rgba(7,8,15,0) 75%), linear-gradient(0deg, rgba(7,8,15,.95) 10%, rgba(7,8,15,0) 60%); }
.hero-in { position: relative; z-index: 1; padding: 44px; max-width: 760px; }
.hero-title { font-size: clamp(34px, 6vw, 62px); }
.hero-text { font-size: 18.5px; color: #d9d4c8; margin: 14px 0 24px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.band { margin-top: 56px; }
.band-title { font-size: 26px; color: var(--gold2); margin: 0 0 18px; }
.doors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.door { padding: 22px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s; }
.door:hover { transform: translateY(-3px); border-color: var(--gold); color: var(--text); }
.door-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; font-size: 24px; background: rgba(217,180,90,.12); color: var(--gold2); }
.door h3 { margin: 14px 0 6px; font-size: 19px; color: #fff; }
.door p { margin: 0; color: var(--muted); font-size: 14.5px; }
.worlds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.world { position: relative; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid var(--line); transition: transform .15s; }
.world:hover { transform: translateY(-4px); color: var(--text); }
.world img { width: 100%; height: 240px; object-fit: cover; }
.world > div { padding: 16px 20px 20px; border-top: 3px solid var(--c); }
.world h3 { margin: 4px 0 6px; font-size: 22px; color: #fff; }
.world p { margin: 0; color: var(--muted); font-size: 15px; }
.world .tag { color: var(--c); }
.world.earth { --c: var(--earth); } .world.aos { --c: var(--aos); } .world.space { --c: var(--space); }
.how { padding: 28px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0 0 20px; }
.steps li { counter-increment: s; position: relative; padding: 44px 16px 16px; background: var(--bg2); border-radius: 12px; border: 1px solid var(--line); color: var(--muted); }
.steps li b { color: #fff; }
.steps li::before { content: counter(s); position: absolute; top: 12px; left: 16px; font-family: var(--display); font-weight: 700; color: var(--gold); font-size: 20px; }

/* ---------- dice demo */
.roller { margin: 18px 0 26px; padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.roller .ctl { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.roller label { font-size: 14px; color: var(--muted); }
.roller select { background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: 15px var(--body); }
.roller button { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #1a1406; border: 0; border-radius: 999px; padding: 9px 20px; font: 700 15px var(--body); cursor: pointer; }
.dice { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; min-height: 46px; }
.die { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; font-weight: 700; font-size: 18px; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); }
.die.hit { border-color: var(--gold); color: #1a1406; background: var(--gold2); }
.die.cos { box-shadow: 0 0 0 2px var(--cyan); }
.roll-out { font-weight: 600; }

/* ---------- bestiary */
.filters { display: grid; gap: 12px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); position: sticky; top: 66px; z-index: 5; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--bg2); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font: 500 14px var(--body); cursor: pointer; }
.chip:hover { color: var(--text); }
.chip.on { background: rgba(217,180,90,.16); color: var(--gold2); border-color: rgba(217,180,90,.5); }
.row2 { display: flex; flex-wrap: wrap; gap: 14px; }
.row2 label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.row2 select { width: auto; border-radius: 10px; padding: 7px 10px; }
.count { margin: 16px 2px 10px; color: var(--muted); font-size: 14px; }
.blist { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.crow { text-align: left; display: grid; gap: 4px; padding: 13px 15px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text); cursor: pointer; font: inherit; border-left: 3px solid var(--c, var(--gold)); }
.crow:hover { border-color: var(--gold); border-left-color: var(--c, var(--gold)); }
.crow .cn { font-weight: 600; font-size: 15.5px; }
.crow .cm { font-size: 13px; color: var(--muted); }
.crow .badge { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); margin-left: 6px; vertical-align: 2px; letter-spacing: .05em; }
.crow .badge.draft { color: #ffc27a; border-color: #6a4a22; }
.crow[data-s="Aos"] { --c: var(--aos); } .crow[data-s="Earth"] { --c: var(--earth); } .crow[data-s="Space Opera"] { --c: var(--space); }
.more { display: block; margin: 18px auto; }
.cdlg { width: min(860px, 94vw); max-height: 88vh; padding: 0; border-radius: 18px; border: 1px solid rgba(217,180,90,.45); background: var(--bg2); color: var(--text); box-shadow: var(--shadow); }
.cdlg::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(3px); }
.cdlg-in { padding: 26px 28px; }
.cdlg h2 { margin: 0; font-size: 28px; color: var(--gold2); }
.cdlg .x { position: sticky; top: 0; float: right; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 999px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 18px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stat small { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stat b { font-size: 18px; }
.hpbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.hpbar span { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; font-size: 13.5px; }
.hpbar span b { color: var(--gold2); }
.cdlg .prose { max-width: none; }
.cdlg table { display: block; overflow-x: auto; font-size: 13.5px; }

/* ---------- footer */
.foot { position: relative; z-index: 1; border-top: 1px solid var(--line); padding: 26px 28px 40px; color: var(--muted); font-size: 14px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; max-width: 1320px; margin: 0 auto; }

/* ---------- responsive */
@media (max-width: 1100px) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .doc > .toc { display: none; }
  .doors { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .top { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .menu-btn { display: block; }
  nav.main { display: none; order: 3; width: 100%; flex-direction: column; }
  nav.main.open { display: flex; }
  nav.main a { padding: 12px 14px; font-size: 16px; }
  .search { order: 4; width: 100%; margin: 0; }
  .wrap { grid-template-columns: minmax(0, 1fr); padding: 20px 16px 50px; gap: 18px; }
  nav.side { position: static; max-height: none; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 6px; }
  nav.side a { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; }
  nav.side a.cur { border-color: var(--gold); }
  .side-group { display: none; }
  .worlds { grid-template-columns: minmax(0, 1fr); }
  .doc-head .hero-art { width: 96px; height: 96px; }
  .hero { min-height: 420px; }
  .hero-bg { opacity: .35; object-position: 70% 50%; }
  .hero-in { padding: 24px; }
  .filters { position: static; }
  .foot { padding: 22px 16px 36px; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .doors { gap: 10px; }
  .door { padding: 14px; }
  .door p { display: none; }
  .door h3 { font-size: 15px; margin: 10px 0 0; }
  .pn { grid-template-columns: minmax(0, 1fr); }
  .sub { display: none; }
}

/* ---------- home v2 */
nav.main a { white-space: nowrap; }
.hero2 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px; align-items: center; padding: 28px 0 10px; }
.hero2-text { min-width: 0; }
.hero2 .hero-text { max-width: 54ch; }
.loom { position: relative; aspect-ratio: 1 / 1; max-width: 460px; width: 100%; justify-self: center; }
.loom::before { content: ''; position: absolute; inset: 8%; border-radius: 50%; border: 1px solid rgba(217,180,90,.35); box-shadow: 0 0 80px rgba(154,125,255,.15), inset 0 0 60px rgba(95,212,255,.08); }
.loom::after { content: ''; position: absolute; inset: 2%; border-radius: 50%; border: 1px dashed rgba(217,180,90,.18); }
.loom-threads { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.loom-threads path { fill: none; stroke-width: 2.2; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(95,212,255,.6)); stroke-dasharray: 6 10; animation: weave 6s linear infinite; }
.loom-threads path.faint { stroke: rgba(217,180,90,.35); stroke-width: 1; filter: none; stroke-dasharray: 2 6; }
@keyframes weave { to { stroke-dashoffset: -160; } }
@media (prefers-reduced-motion: reduce) { .loom-threads path { animation: none; } }
.orb { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 6px; text-decoration: none; color: var(--text); z-index: 1; }
.orb img { width: clamp(84px, 11vw, 132px); aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 2px solid var(--c); box-shadow: 0 0 0 5px rgba(7,8,15,.9), 0 0 28px var(--c); transition: transform .2s; }
.orb:hover img { transform: scale(1.06); }
.orb span { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .08em; background: rgba(7,8,15,.85); padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); }
.orb.earth { --c: var(--earth); } .orb.aos { --c: var(--aos); } .orb.space { --c: var(--space); }

.path { margin-top: 40px; }
.path-steps { list-style: none; counter-reset: p; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); position: relative; }
.path-steps::before { content: ''; position: absolute; left: 6%; right: 6%; top: 21px; height: 2px; background: linear-gradient(90deg, var(--earth), var(--aos), var(--space)); opacity: .7; }
.path-steps li { counter-increment: p; position: relative; padding: 0 14px; }
.path-steps a { display: grid; gap: 4px; text-decoration: none; color: var(--text); padding-top: 58px; }
.path-steps a::before { content: counter(p); position: absolute; top: 0; left: 14px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); border: 2px solid var(--gold); font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--gold2); }
.path-steps a:hover b { color: var(--gold2); }
.path-steps b { font-size: 18px; }
.path-steps span { color: var(--muted); font-size: 15px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.quick a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; font-size: 14.5px; }
.quick a:hover { border-color: var(--gold); color: var(--gold2); }

.worlds2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.w2 { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; color: var(--text); text-decoration: none; border: 1px solid var(--line); }
.w2 img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.w2:hover img { transform: scale(1.04); }
.w2::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(7,8,15,.97) 22%, rgba(7,8,15,.2) 62%, rgba(7,8,15,0)); }
.w2-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 20px 22px 22px; border-bottom: 4px solid var(--c); }
.w2 h3 { margin: 4px 0 6px; font-size: 24px; color: #fff; }
.w2 p { margin: 0; color: #cfcabe; font-size: 15px; }
.w2 .tag { color: var(--c); }
.w2.earth { --c: var(--earth); } .w2.aos { --c: var(--aos); } .w2.space { --c: var(--space); }
.w2:hover { border-color: var(--c); color: var(--text); }

.rollband { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.rollsteps { padding-left: 22px; margin: 0 0 18px; color: var(--muted); }
.rollsteps li { margin: 6px 0; } .rollsteps b { color: var(--text); }
.rollsteps li::marker { color: var(--gold); font-weight: 700; }
.rollband .roller { margin: 0; }

@media (max-width: 1180px) {
  .top { gap: 14px; }
  .search { width: min(260px, 26vw); }
  .sub { display: none; }
}
@media (max-width: 960px) {
  .top { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .menu-btn { display: block; }
  nav.main { display: none; order: 3; width: 100%; flex-direction: column; }
  nav.main.open { display: flex; }
  .search { order: 4; width: 100%; margin: 0; }
}
@media (max-width: 860px) {
  .hero2 { grid-template-columns: minmax(0, 1fr); }
  .loom { max-width: 340px; }
  .path-steps { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .path-steps::before { left: 35px; right: auto; top: 10px; bottom: 10px; width: 2px; height: auto; background: linear-gradient(180deg, var(--earth), var(--aos), var(--space)); }
  .path-steps a { padding: 4px 0 0 64px; min-height: 44px; }
  .worlds2 { grid-template-columns: minmax(0, 1fr); }
  .w2 { aspect-ratio: 16 / 10; }
  .rollband { grid-template-columns: minmax(0, 1fr); }
}
.w2.space img { object-position: 50% 60%; transform: scale(1.35); }
.w2.space:hover img { transform: scale(1.4); }
@media (max-width: 860px) { .w2 { aspect-ratio: 4 / 3; } }

/* ================= Cosmic Crit effect ================= */
.cos-text { color: var(--cyan); font-family: var(--display); font-weight: 700; letter-spacing: .06em; text-shadow: 0 0 12px rgba(95,212,255,.7); }
.roller.is-cosmic { border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(95,212,255,.4), 0 0 40px rgba(95,212,255,.25); transition: box-shadow .4s; }
.roller.is-cosmic .die.cos { background: radial-gradient(circle, #fff, var(--cyan)); color: #04121a; border-color: #fff; animation: cosDie 1.2s ease-out; }
@keyframes cosDie { 0% { transform: scale(1); } 25% { transform: scale(1.35) rotate(-8deg); box-shadow: 0 0 30px var(--cyan); } 100% { transform: scale(1); } }
.cosmic-fx { position: fixed; inset: 0; z-index: 100; pointer-events: none; overflow: hidden; }
.cosmic-fx::before { content: ""; position: absolute; inset: 0; background: rgba(4,5,10,.7); animation: cfFlash 2s ease-out forwards; }
.cf-flash { position: absolute; inset: 0; background: radial-gradient(circle at var(--x) var(--y), rgba(255,255,255,.55), rgba(95,212,255,.25) 18%, rgba(217,180,90,.12) 40%, transparent 70%); animation: cfFlash 1.6s ease-out forwards; }
@keyframes cfFlash { 0% { opacity: 0; } 8% { opacity: 1; } 100% { opacity: 0; } }
.cf-threads { position: absolute; inset: 0; }
.cf-threads path { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 1600; stroke-dashoffset: 1600; animation: cfThread 1.5s cubic-bezier(.2,.7,.2,1) forwards; }
.cf-threads path.g { stroke: var(--gold2); filter: drop-shadow(0 0 6px var(--gold)); }
.cf-threads path.c { stroke: var(--cyan); stroke-width: 3; filter: drop-shadow(0 0 8px var(--cyan)); }
@keyframes cfThread { 0% { stroke-dashoffset: 1600; opacity: 1; } 55% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.cf-ring { position: absolute; left: var(--x); top: var(--y); width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 2px solid var(--gold2); box-shadow: 0 0 20px var(--gold), inset 0 0 20px rgba(95,212,255,.5); animation: cfRing 1.1s ease-out forwards; }
.cf-ring.two { border-color: var(--cyan); animation-delay: .18s; opacity: 0; }
@keyframes cfRing { 0% { transform: scale(.2); opacity: 1; } 100% { transform: scale(18); opacity: 0; } }
.cf-title { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 4px; text-align: center; padding: 28px 12vw; background: radial-gradient(closest-side, rgba(7,8,15,.92), rgba(7,8,15,.6) 60%, transparent); animation: cfTitle 2.1s ease-out forwards; }
.cf-title span { font-family: var(--display); font-weight: 700; font-size: clamp(38px, 8vw, 84px); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  background: linear-gradient(180deg, #fff 20%, var(--gold2) 55%, var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 18px rgba(95,212,255,.6)) drop-shadow(0 4px 0 rgba(0,0,0,.5)); }
.cf-title small { font-size: 13px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold2); text-shadow: 0 0 10px #000; }
@keyframes cfTitle { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); letter-spacing: .5em; } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); } 30% { transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -54%) scale(1); } }
.cosmic-fx.still .cf-ring, .cosmic-fx.still .cf-threads { display: none; }
.cosmic-fx.still .cosmic-fx::before { content: ""; position: absolute; inset: 0; background: rgba(4,5,10,.7); animation: cfFlash 2s ease-out forwards; }
.cf-flash { animation-duration: 1.4s; }
.cosmic-fx.still .cf-title { animation: cfStill 1.5s ease forwards; }
@keyframes cfStill { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ================= Character sheet ================= */
.sheet-app { position: relative; display: grid; gap: 18px; }
.sheet-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.sheet-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sheet-tools select { min-width: 200px; }
.sheet-hint { margin: 0; color: var(--muted); max-width: 70ch; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sheet-app select, .sheet-app input:not([type=checkbox]):not([type=file]), .sheet-app textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.sheet-app textarea { resize: vertical; min-height: 96px; }
.sheet-app select:focus, .sheet-app input:focus, .sheet-app textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217,180,90,.18); }
.sheet-app button { font: inherit; cursor: pointer; }
.btn.small { padding: 8px 16px; font-size: 14px; }
.btn.wide { display: block; width: 100%; text-align: center; }
.btn.danger { border-color: rgba(224,71,91,.6); color: #ff9aa6; background: rgba(224,71,91,.08); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.mode { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); }
.mode button { border: 0; background: none; color: var(--muted); padding: 8px 22px; border-radius: 999px; font-weight: 600; letter-spacing: .04em; }
.mode button[aria-selected="true"] { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #1a1406; box-shadow: 0 4px 16px rgba(217,180,90,.3); }

.sheet-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: start; }
.sheet-main { min-width: 0; display: grid; gap: 18px; }
.sheet-main > div:not([hidden]) { display: grid; gap: 18px; }
[hidden] { display: none !important; }
.sheet-side { position: sticky; top: 88px; display: grid; gap: 14px; }

.sblock { background: linear-gradient(180deg, var(--panel), rgba(17,21,38,.7)); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; display: grid; gap: 14px; min-width: 0; }
.sblock > h2 { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 21px; color: var(--gold2); }
.sblock > p { margin: 0; }
.num { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; font-size: 15px; color: #1a1406; background: linear-gradient(180deg, var(--gold2), var(--gold)); box-shadow: 0 0 0 4px rgba(217,180,90,.15); font-family: var(--body); }
.muted { color: var(--muted); }
.lbl { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-right: 6px; }

.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.fields.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.fields label, label.full { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.classcard { display: grid; gap: 6px; padding: 14px 16px; border-radius: 12px; background: rgba(95,212,255,.05); border: 1px solid rgba(95,212,255,.25); font-size: 15px; }
.classcard a { font-size: 14px; }

.pris { display: grid; gap: 10px; }
.pri { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 12px; }
.pri > span { font-family: var(--display); font-weight: 700; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button { display: grid; gap: 0; padding: 8px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--muted); font-weight: 600; font-size: 14px; }
.seg button small { font-weight: 400; font-size: 12px; opacity: .8; }
.seg button[aria-checked="true"] { border-color: var(--gold); color: #1a1406; background: linear-gradient(180deg, var(--gold2), var(--gold)); }

.skcols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.skcol { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.skcol header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.skcol h3 { margin: 0; font-size: 16px; }
.budget { font-weight: 700; font-size: 14px; color: var(--cyan); white-space: nowrap; }
.budget small { color: var(--muted); font-weight: 400; }
.budget.done { color: var(--aos); } .budget.over { color: #ff8a98; }
.meterbar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-bottom: 4px; }
.meterbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--cyan)); }
.skrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; border-top: 1px solid rgba(38,44,71,.6); }
.skrow:first-of-type { border-top: 0; }
.skname { font-size: 14.5px; min-width: 0; }
.skname em { font-style: normal; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--space); margin-left: 4px; }
.step { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.step button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--gold2); font-size: 18px; line-height: 1; display: grid; place-items: center; }
.step button:hover:not(:disabled) { border-color: var(--gold); }
.step button:disabled { opacity: .3; cursor: default; }
.step b { min-width: 26px; text-align: center; font-size: 16px; }
.step b.capped { color: var(--gold2); text-shadow: 0 0 8px rgba(217,180,90,.6); }

.pw-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.pw-head p { margin: 0; }
.pw-group { margin: 6px 0 0; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.pwlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.pw { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); display: grid; gap: 6px; }
.pw.on { border-color: rgba(217,180,90,.55); background: linear-gradient(180deg, rgba(217,180,90,.08), var(--bg2)); }
.pw-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pw-name { font-weight: 700; }
.pw-d { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.badge.new { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .1em; padding: 1px 6px; border-radius: 6px; background: rgba(95,212,255,.15); color: var(--cyan); vertical-align: middle; }
.perklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.perk { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); font-size: 14px; cursor: pointer; }
.perk:has(input:checked) { border-color: rgba(217,180,90,.55); background: rgba(217,180,90,.07); }
.perk input { margin-top: 4px; accent-color: var(--gold); }
.filebar { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.filebtn { position: relative; cursor: pointer; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* side summary */
.who-card { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid rgba(217,180,90,.4); background: var(--panel); min-height: 120px; display: grid; align-items: end; }
.who-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.who-card:has(img) { aspect-ratio: 1; }
.who-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(7,8,15,.95)); }
.who-txt { position: relative; z-index: 1; padding: 16px 18px; }
.who-txt h2 { margin: 0; font-size: 24px; color: #fff; }
.who-txt p { margin: 2px 0 0; color: var(--gold2); font-size: 14px; }
.who-card.w-earth .kicker { color: var(--earth); } .who-card.w-aos .kicker { color: var(--aos); } .who-card.w-space .kicker { color: var(--space); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { display: grid; gap: 0; text-align: center; padding: 10px 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.stat small { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat b { font-size: 18px; color: var(--gold2); }
.scores { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.scores .lbl { flex-basis: 100%; }
.scores > span:not(.lbl) { flex: 1; display: grid; text-align: center; }
.scores small { font-size: 12px; color: var(--muted); }
.scores b { font-size: 18px; }
.check { padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.check ul { margin: 6px 0 0; padding-left: 18px; }
.check.warn { background: rgba(224,71,91,.08); border: 1px solid rgba(224,71,91,.35); }
.check.warn b { color: #ff9aa6; }
.check.ok { background: rgba(63,193,173,.08); border: 1px solid rgba(63,193,173,.4); }
.check.ok b { color: var(--aos); }

/* play mode */
.sblock.meters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.meter { padding: 14px 16px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); display: grid; gap: 10px; align-content: start; min-width: 0; }
.meter.hp, .meter:has(.pips.dmd) { grid-column: 1 / -1; }
.meter:has(.pips.dmd) .pip { width: 18px; height: 18px; }
.m-top { display: flex; justify-content: space-between; align-items: baseline; }
.m-top span { font-family: var(--display); font-weight: 700; font-size: 17px; }
.m-top b { font-size: 24px; } .m-top small { color: var(--muted); font-size: 14px; font-weight: 400; }
.hpbar2 { height: 14px; border-radius: 8px; background: rgba(224,71,91,.15); overflow: hidden; border: 1px solid rgba(224,71,91,.3); }
.hpbar2 i { display: block; height: 100%; background: linear-gradient(90deg, var(--crimson), #ff8a6a); transition: width .25s; }
.m-ctl { display: flex; flex-wrap: wrap; gap: 6px; }
.m-ctl button { flex: 1; min-width: 52px; padding: 10px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-weight: 700; }
.m-ctl button:hover { border-color: var(--gold); }
.m-note { margin: 0; font-size: 13px; color: var(--muted); min-height: 1em; }
.pips { display: flex; flex-wrap: wrap; gap: 5px; }
.pip { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel2); padding: 0; }
.pips.dmd .pip { width: 15px; height: 15px; border-radius: 4px; }
.pips.stress .pip.on { background: var(--gold); border-color: var(--gold2); box-shadow: 0 0 6px rgba(217,180,90,.6); }
.pips.exh .pip.on { background: var(--earth); border-color: #ff9a75; }
.pips.dmd .pip.on { background: var(--space); border-color: #c4b2ff; box-shadow: 0 0 5px rgba(154,125,255,.6); }
.linkish { border: 0; background: none; color: var(--cyan); padding: 0; text-decoration: underline; text-underline-offset: 3px; justify-self: start; font-size: 14px; }
.rc { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; }
.rc label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.rc select { width: auto; }
.lev { display: flex; align-items: center; gap: 8px; }
.lev span { font-size: 13px; color: var(--muted); font-weight: 600; }
.lev button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--gold2); font-size: 20px; }
.lev b { min-width: 28px; text-align: center; font-size: 18px; }
.rollgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rollgrid h3 { margin: 0 0 6px; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.rollgrid > div { display: grid; gap: 6px; align-content: start; }
.rollbtn { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); text-align: left; transition: border-color .15s, transform .1s; }
.rollbtn:hover { border-color: var(--gold); }
.rollbtn:active { transform: scale(.98); }
.rollbtn b { display: inline-grid; place-items: center; min-width: 30px; height: 26px; border-radius: 8px; background: rgba(217,180,90,.15); color: var(--gold2); font-size: 14px; }
.rollbtn[data-zero] { opacity: .55; }
.pwplay { display: grid; gap: 8px; }
.pwp { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.pwp small { display: block; color: var(--muted); font-size: 12px; }
.pwp select { width: auto; }
.log { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.log li { padding: 8px 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); line-height: 1.9; }
.log li:first-child { border-color: rgba(217,180,90,.45); }
.d { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin: 0 1px; border-radius: 6px; font-size: 13px; font-weight: 700; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.d.h { background: var(--gold2); color: #1a1406; border-color: var(--gold); }
.d.c { box-shadow: 0 0 0 1.5px var(--cyan); }
b.cos { color: var(--cyan); text-shadow: 0 0 10px rgba(95,212,255,.6); }
b.fail { color: #ff8a98; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); max-width: min(560px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 14px; background: rgba(17,21,38,.97); border: 1px solid rgba(217,180,90,.5); box-shadow: var(--shadow); font-size: 14.5px; line-height: 1.9; }

@media (max-width: 1080px) {
  .sheet-grid { grid-template-columns: minmax(0, 1fr); }
  .sheet-side { position: static; order: -1; grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
  .sheet-side .who-card { grid-row: span 3; }
}
@media (max-width: 1080px) { .sheet-app[data-mode=play] .sheet-side { order: 1; } }
@media (max-width: 760px) {
  .skcols, .rollgrid { grid-template-columns: minmax(0, 1fr); }
  .sblock { padding: 18px 16px; }
  .sblock.meters { grid-template-columns: minmax(0, 1fr); }
  .pri { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .sheet-side { grid-template-columns: minmax(0, 1fr); }
  .sheet-side .who-card { grid-row: auto; }
  .who-card:has(img) { aspect-ratio: auto; min-height: 0; grid-template-columns: 76px minmax(0, 1fr); align-items: center; }
  .who-card img { position: static; width: 76px; height: 76px; border-radius: 12px; margin: 12px 0 12px 12px; border: 1px solid rgba(217,180,90,.4); }
  .who-card::after { display: none; }
  .who-txt { padding: 12px 14px; } .who-txt h2 { font-size: 20px; }
  .sheet-tools { width: 100%; }
  .sheet-tools select { flex: 1; min-width: 0; }
  .mode { width: 100%; } .mode button { flex: 1; }
  .pw-head { flex-direction: column; gap: 6px; }
  .pwp { grid-template-columns: minmax(0, 1fr) auto; } .pwp > div { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .roller.is-cosmic .die.cos { animation: none; } }

/* ================= Motion ================= */
.starfield { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.threads { animation: threadDrift 40s linear infinite alternate; }
@keyframes threadDrift { from { transform: translate3d(0,0,0); } to { transform: translate3d(-60px, 30px, 0); } }
.top::after { background-size: 200% 100%; animation: lineFlow 6s linear infinite; background-image: linear-gradient(90deg, transparent, var(--gold), var(--cyan), var(--gold), transparent); }
@keyframes lineFlow { from { background-position: 0 0; } to { background-position: 200% 0; } }
.motion .rv { opacity: 0; transform: translateY(22px); transition: opacity .7s ease var(--d, 0ms), transform .7s cubic-bezier(.2,.7,.2,1) var(--d, 0ms); }
.motion .rv.in { opacity: 1; transform: none; }
.motion .card.rv.in:hover { transform: translateY(-5px); }
.card { position: relative; transition: transform .25s, border-color .25s, box-shadow .25s; }
.card:hover { box-shadow: 0 14px 34px rgba(0,0,0,.5), 0 0 24px rgba(217,180,90,.18); }
.card::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(243,213,140,.16) 48%, transparent 66%); transform: translateX(-120%); transition: transform .8s; }
.card:hover::after { transform: translateX(120%); }
.card.has-img:hover img { transform: scale(1.07); }
.doc-head .hero-art { animation: artFloat 7s ease-in-out infinite; }
@keyframes artFloat { 0%, 100% { transform: translateY(0); box-shadow: 0 0 30px rgba(217,180,90,.15); } 50% { transform: translateY(-6px); box-shadow: 0 10px 40px rgba(95,212,255,.25); } }
.loom { transform: translate3d(var(--px, 0), var(--py, 0), 0); transition: transform .6s ease-out; }
.orb img { animation: orbBob 6s ease-in-out infinite; }
.orb.aos img { animation-delay: -2s; } .orb.space img { animation-delay: -4s; }
@keyframes orbBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.orb:hover img { animation-play-state: paused; transform: scale(1.08); }
.w2 img { transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.w2:hover img { transform: scale(1.08); }
.btn.primary { background-size: 200% 100%; background-image: linear-gradient(100deg, var(--gold) 0%, var(--gold2) 40%, #fff3c9 50%, var(--gold2) 60%, var(--gold) 100%); animation: shimmer 5s ease-in-out infinite; }
@keyframes shimmer { 0%, 70% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.dice .die { animation: tumble .55s cubic-bezier(.2,.8,.3,1.2) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes tumble { 0% { opacity: 0; transform: translateY(-26px) rotate(-200deg) scale(.6); } 100% { opacity: 1; transform: none; } }
.dice .die.hit { animation-name: tumble, hitGlow; animation-duration: .55s, 1.2s; animation-delay: calc(var(--i, 0) * 45ms), calc(var(--i, 0) * 45ms + .5s); }
@keyframes hitGlow { 0% { box-shadow: 0 0 0 rgba(243,213,140,0); } 40% { box-shadow: 0 0 18px rgba(243,213,140,.8); } 100% { box-shadow: 0 0 0 rgba(243,213,140,0); } }
.num { animation: numPulse 3.5s ease-in-out infinite; }
@keyframes numPulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(217,180,90,.15); } 50% { box-shadow: 0 0 0 7px rgba(217,180,90,.06), 0 0 16px rgba(217,180,90,.4); } }
.log li:first-child { animation: logIn .45s ease-out; }
@keyframes logIn { from { opacity: 0; transform: translateX(-12px); background: rgba(217,180,90,.2); } }
.hpbar2 i, .meterbar i { transition: width .45s cubic-bezier(.2,.7,.2,1); }
.pip { transition: transform .15s, background .2s; } .pip:hover { transform: scale(1.2); }
@media (prefers-reduced-motion: reduce) {
  .threads, .top::after, .doc-head .hero-art, .orb img, .btn.primary, .dice .die, .num, .log li:first-child { animation: none !important; }
  .card::after { display: none; }
}

/* success dice green, Cosmic Crit turns every die gold */
:root { --hit: #3fd28b; --hit2: #8ff0bd; }
.die.hit { border-color: var(--hit); color: #04140b; background: linear-gradient(180deg, var(--hit2), var(--hit)); }
.d.h { background: linear-gradient(180deg, var(--hit2), var(--hit)); color: #04140b; border-color: var(--hit); }
@keyframes hitGlow { 0% { box-shadow: 0 0 0 rgba(63,210,139,0); } 40% { box-shadow: 0 0 18px rgba(63,210,139,.8); } 100% { box-shadow: 0 0 0 rgba(63,210,139,0); } }
.dice .die.gold, .roller.is-cosmic .die.gold.cos { border-color: #fff3c9; color: #2a1d02; background: radial-gradient(circle at 35% 30%, #fff8dc, var(--gold2) 45%, var(--gold)); box-shadow: 0 0 16px rgba(243,213,140,.8); animation-name: tumble, goldPulse; animation-duration: .55s, 1.6s; animation-timing-function: cubic-bezier(.2,.8,.3,1.2), ease-in-out; animation-iteration-count: 1, 2; animation-fill-mode: backwards, none; animation-delay: calc(var(--i, 0) * 45ms), calc(var(--i, 0) * 45ms + .55s); }
@keyframes goldPulse { 50% { box-shadow: 0 0 30px rgba(243,213,140,1), 0 0 8px #fff; transform: scale(1.08); } }
.d.g { background: radial-gradient(circle at 35% 30%, #fff8dc, var(--gold2) 45%, var(--gold)); color: #2a1d02; border-color: #fff3c9; box-shadow: 0 0 8px rgba(243,213,140,.7); }
@media (prefers-reduced-motion: reduce) { .dice .die.gold { animation: none !important; } }

/* ================= Campaign hub ================= */
.camp-tabs { justify-self: start; }
.camp-tabs button { padding: 9px 24px; }
#cp-body { display: grid; gap: 18px; }
.party-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.pcard { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; transition: border-color .2s, background .2s; }
.pcard.on { border-color: rgba(63,210,139,.55); background: linear-gradient(180deg, rgba(63,210,139,.08), var(--bg2)); }
.pcard input { accent-color: var(--hit, #3fd28b); width: 18px; height: 18px; }
.pcard .btn { justify-self: end; }
div.pcard { grid-template-columns: minmax(0, 1fr) auto; cursor: default; }
.pc-main { display: grid; min-width: 0; } .pc-main small { color: var(--muted); font-size: 13px; }
.pc-stats { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--gold2); }
.addrow { display: flex; flex-wrap: wrap; gap: 8px; }
.addrow input { flex: 1 1 160px; width: auto !important; }
.addrow input[type=number] { flex: 0 1 110px; }
.party-sum { margin: 0; color: var(--muted); } .party-sum b { color: var(--gold2); }
.small-note { font-size: 13px; }
.enc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.enc-side { position: sticky; top: 88px; }
.mlist { display: grid; gap: 6px; max-height: 620px; overflow: auto; padding-right: 4px; }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.mrow:hover { border-color: rgba(217,180,90,.5); }
.m-main { display: grid; min-width: 0; } .m-main small { color: var(--muted); font-size: 12.5px; } .m-main .fair { color: var(--aos); }
.m-hp { font-weight: 700; color: #ff9a8a; white-space: nowrap; }
.elist { display: grid; gap: 8px; }
.erow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.erow small { display: block; color: var(--muted); font-size: 12.5px; }
.fight-top { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.fight-top .small-note { grid-column: 1 / -1; margin: 0; }
.round { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; border: 2px solid var(--gold); box-shadow: 0 0 24px rgba(217,180,90,.3), inset 0 0 18px rgba(217,180,90,.15); }
.round small { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: -10px; }
.round b { font-family: var(--display); font-size: 34px; color: var(--gold2); }
.fight-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fight-list { display: grid; gap: 8px; }
.frow { display: grid; grid-template-columns: 64px minmax(160px, 1fr) 70px auto 34px; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line); transition: border-color .2s, box-shadow .3s, opacity .3s; }
.frow.pc { border-left-color: var(--hit, #3fd28b); } .frow.foe { border-left-color: var(--crimson); }
.frow.now { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 30px rgba(217,180,90,.25); background: linear-gradient(90deg, rgba(217,180,90,.1), var(--panel) 40%); }
.frow.down { opacity: .5; }
.frow.down .f-main b { text-decoration: line-through; }
.frow input { padding: 8px 10px !important; }
.f-init { text-align: center; font-weight: 700; }
.f-main { display: grid; gap: 4px; min-width: 0; } .f-main small { color: var(--muted); font-size: 12.5px; }
.f-main .hpbar2 { height: 8px; }
.frow.pc .hpbar2 i { background: linear-gradient(90deg, var(--hit, #3fd28b), #8ff0bd); }
.f-hp { text-align: right; } .f-hp b { font-size: 22px; } .f-hp small { color: var(--muted); }
.f-ctl button { min-width: 42px; padding: 8px 4px; }
.f-x { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--muted); font-size: 18px; }
.f-x:hover { color: #ff9aa6; border-color: rgba(224,71,91,.5); }
.log.notes li small { display: block; color: var(--gold); font-size: 12px; letter-spacing: .04em; }
.log.notes li { line-height: 1.6; }
@media (max-width: 1080px) { .enc-grid { grid-template-columns: minmax(0, 1fr); } .enc-side { position: static; } }
@media (max-width: 860px) {
  .frow { grid-template-columns: 56px minmax(0, 1fr) auto 34px; }
  .frow .f-ctl, .frow .f-cond { grid-column: 1 / -1; }
  .frow .f-hp { grid-column: 3; grid-row: 1; } .frow .f-x { grid-column: 4; grid-row: 1; }
}
@media (max-width: 520px) { .camp-tabs { width: 100%; } .camp-tabs button { flex: 1; padding: 8px 6px; } .fight-top { grid-template-columns: minmax(0, 1fr); justify-items: start; } }

/* ================= Character screen (game-style hero banner) ================= */
.hero-banner { --wc: var(--aos); position: relative; overflow: hidden; border-radius: 22px; border: 1px solid rgba(217,180,90,.45);
  background: radial-gradient(120% 140% at 85% 20%, rgba(154,125,255,.18), transparent 55%), linear-gradient(180deg, #0d1124, #07080f);
  box-shadow: 0 30px 60px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.03), 0 0 50px rgba(217,180,90,.08);
  clip-path: polygon(0 18px, 18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px)); }
.hero-banner.w-earth { --wc: var(--earth); } .hero-banner.w-space { --wc: var(--space); }
.hero-banner::before { content: ''; position: absolute; inset: 10px; border: 1px solid rgba(217,180,90,.18); pointer-events: none; z-index: 2;
  clip-path: polygon(0 12px, 12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px)); }
.hb-art { position: absolute; right: 0; top: 0; width: 62%; height: 100%; object-fit: cover; object-position: 50% 22%; animation: hbArt 22s ease-in-out infinite alternate; }
@keyframes hbArt { from { transform: scale(1.02); } to { transform: scale(1.1) translate(-1.5%, 1%); } }
.hb-shade { position: absolute; inset: 0; background: linear-gradient(90deg, #07080f 34%, rgba(7,8,15,.85) 48%, rgba(7,8,15,.2) 75%, rgba(7,8,15,.35)), linear-gradient(0deg, rgba(7,8,15,.95), transparent 45%); }
.hb-in { position: relative; z-index: 3; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-areas: "id crests" "bars bars" "plates plates"; gap: 22px 28px; padding: 30px 34px; }
.hb-id { grid-area: id; display: flex; align-items: center; gap: 20px; min-width: 0; }
.hb-level { position: relative; flex: none; width: 108px; height: 108px; display: grid; place-items: center; }
.hb-level svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.hb-level .trk { fill: rgba(7,8,15,.7); stroke: rgba(255,255,255,.08); stroke-width: 6; }
.hb-level .val { fill: none; stroke: url(#none); stroke: var(--gold2); stroke-width: 6; stroke-linecap: round; filter: drop-shadow(0 0 6px var(--gold)); transition: stroke-dashoffset 1s cubic-bezier(.2,.7,.2,1); }
.hb-level > div { display: grid; justify-items: center; line-height: 1; }
.hb-level small { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.hb-level b { font-family: var(--display); font-size: 44px; color: #fff; text-shadow: 0 0 18px rgba(243,213,140,.6); }
.hb-name { min-width: 0; }
.hb-name .kicker { color: var(--wc); }
.hb-name h2 { margin: 0; font-size: clamp(30px, 4vw, 50px); line-height: 1.05; background: linear-gradient(180deg, #fff 30%, var(--gold2)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 rgba(0,0,0,.6)); overflow-wrap: anywhere; }
.hb-name p { margin: 6px 0 0; color: var(--text); opacity: .8; }
.hb-crests { grid-area: crests; display: flex; gap: 12px; justify-content: flex-end; align-self: center; }
.crest { --cc: var(--gold); position: relative; width: 92px; height: 104px; display: grid; justify-items: center; align-content: center; gap: 0;
  background: linear-gradient(180deg, rgba(23,28,49,.92), rgba(7,8,15,.92)); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.crest::before { content: ''; position: absolute; inset: 0; background: var(--cc); opacity: .5; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%, 0 25%, 3px 26.5%, 3px 73.5%, 50% calc(100% - 3.5px), calc(100% - 3px) 73.5%, calc(100% - 3px) 26.5%, 50% 3.5px, 3px 26.5%, 0 25%); }
.crest.c-physical { --cc: var(--earth); } .crest.c-mental { --cc: var(--cyan); } .crest.c-social { --cc: var(--space); }
.crest small { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.crest b { font-family: var(--display); font-size: 32px; color: #fff; line-height: 1.1; text-shadow: 0 0 14px var(--cc); }
.crest span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--cc); }
.hb-bars { grid-area: bars; display: grid; grid-template-columns: 1.3fr 1fr 1.3fr 1fr; gap: 18px; }
.sheet-app[data-mode=play] .hb-bars { display: none; }
.hbar { display: grid; gap: 6px; min-width: 0; }
.hl { display: flex; align-items: center; gap: 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hl svg { width: 15px; height: 15px; color: #ff6b6b; }
.hl b { margin-left: auto; font-size: 16px; letter-spacing: 0; color: #fff; } .hl b small { color: var(--muted); font-size: 12px; font-weight: 400; }
.hbar .fill { position: relative; height: 14px; border-radius: 3px; background: rgba(224,71,91,.14); border: 1px solid rgba(224,71,91,.4); overflow: hidden; transform: skewX(-18deg); }
.hbar .fill i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #b8213a, #ff5a5f 60%, #ffb199); box-shadow: 0 0 14px rgba(255,90,95,.6); transition: width .6s cubic-bezier(.2,.7,.2,1); }
.hbar .fill i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: barShine 3.2s ease-in-out infinite; }
@keyframes barShine { from { background-position: -60% 0; } to { background-position: 160% 0; } }
.segbar { display: flex; gap: 3px; height: 14px; transform: skewX(-18deg); }
.segbar i { flex: 1; border-radius: 2px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); transition: background .3s; }
.segbar.stress i.on { background: linear-gradient(180deg, var(--gold2), var(--gold)); box-shadow: 0 0 8px rgba(217,180,90,.6); }
.segbar.dmd { gap: 2px; } .segbar.dmd i.on { background: linear-gradient(180deg, #c4b2ff, var(--space)); box-shadow: 0 0 6px rgba(154,125,255,.7); }
.segbar.exh i.on { background: linear-gradient(180deg, #ff9a75, var(--earth)); }
.hb-plates { grid-area: plates; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.plate { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 14px; background: linear-gradient(180deg, rgba(23,28,49,.85), rgba(12,15,28,.85)); border: 1px solid rgba(217,180,90,.25);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); backdrop-filter: blur(4px); }
.plate svg { grid-row: span 2; width: 26px; height: 26px; color: var(--gold); filter: drop-shadow(0 0 6px rgba(217,180,90,.5)); }
.plate small { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.plate b { font-size: 19px; color: #fff; line-height: 1.1; }
.sheet-grid.playing { grid-template-columns: minmax(0, 1fr); }
.sheet-grid.playing .sheet-side { display: none; }
.sheet-hint { order: 0; }
/* skill bars */
.skbar { display: inline-flex; gap: 2px; flex: 1; max-width: 120px; height: 8px; margin: 0 6px; transform: skewX(-18deg); }
.skbar i { flex: 1; background: rgba(255,255,255,.07); border-radius: 1px; }
.skbar i.on { background: linear-gradient(180deg, var(--gold2), var(--gold)); box-shadow: 0 0 5px rgba(217,180,90,.5); }
.skrow { gap: 4px; }
.skrow .skname { flex: 0 1 auto; min-width: 96px; }
.rollbtn { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; }
.rollbtn .skbar { width: 90px; flex: none; }
.rollbtn:hover .skbar i.on { background: linear-gradient(180deg, #8ff0bd, #3fd28b); box-shadow: 0 0 6px rgba(63,210,139,.6); }
@media (max-width: 1080px) {
  .hb-in { grid-template-columns: minmax(0, 1fr); grid-template-areas: "id" "crests" "bars" "plates"; }
  .hb-crests { justify-content: flex-start; }
  .hb-art { width: 100%; opacity: .55; }
  .hb-shade { background: linear-gradient(180deg, rgba(7,8,15,.3), rgba(7,8,15,.85) 45%, #07080f); }
  .hb-bars { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .hb-in { padding: 22px 18px; gap: 16px; }
  .hb-level { width: 84px; height: 84px; } .hb-level b { font-size: 34px; }
  .hb-id { gap: 14px; }
  .crest { width: 78px; height: 90px; } .crest b { font-size: 26px; }
  .hb-crests { justify-content: space-between; }
  .hb-bars { grid-template-columns: minmax(0, 1fr); }
  .hb-plates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plate { padding: 8px 10px; column-gap: 8px; } .plate svg { width: 20px; height: 20px; } .plate b { font-size: 16px; }
  .rollbtn .skbar { width: 60px; }
  .skbar { max-width: 70px; }
}
@media (prefers-reduced-motion: reduce) { .hb-art, .hbar .fill i::after { animation: none; } }

/* ================= Campaign: table sharing + sheet privacy ================= */
.share-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.kinds { grid-template-columns: repeat(3, 1fr); }
.fldlbl { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.slist { display: grid; gap: 6px; }
.sitem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.sitem p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.sitem small { color: var(--gold); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.scard { position: relative; display: grid; grid-template-rows: auto 1fr auto; border-radius: 14px; overflow: hidden; background: var(--bg2); border: 1px solid var(--line); animation: logIn .45s ease-out; }
.scard.k-power { border-color: rgba(95,212,255,.45); box-shadow: 0 0 18px rgba(95,212,255,.1); }
.scard.k-item { border-color: rgba(217,180,90,.45); }
.scard.k-perk { border-color: rgba(63,193,173,.45); }
.scard img { width: 100%; max-height: 220px; object-fit: cover; }
.scard-body { padding: 12px 14px; display: grid; gap: 4px; align-content: start; }
.scard-body h3 { margin: 0; font-size: 17px; color: var(--gold2); }
.scard-body p { margin: 0; font-size: 13.5px; color: var(--text); opacity: .85; line-height: 1.5; }
.scard-body small { color: var(--muted); font-size: 12px; }
.scard-btns { display: flex; justify-content: space-between; align-items: center; padding: 0 12px 12px; }
.showbig { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); background: rgba(4,5,10,.86); backdrop-filter: blur(6px); animation: cfFlash 0s; }
.showbig .sb-in { width: min(980px, 100%); max-height: 100%; overflow: auto; display: grid; gap: 16px; justify-items: start; padding: 24px; border-radius: 20px; background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid rgba(217,180,90,.5); box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 40px rgba(217,180,90,.15); animation: bigIn .35s cubic-bezier(.2,.8,.3,1.1); }
@keyframes bigIn { from { opacity: 0; transform: scale(.94) translateY(12px); } }
.showbig img { width: 100%; max-height: 62vh; object-fit: contain; border-radius: 12px; background: #000; }
.sb-txt h2 { margin: 6px 0 8px; font-size: clamp(26px, 4vw, 40px); color: var(--gold2); }
.sb-txt p { margin: 0 0 8px; font-size: 17px; line-height: 1.6; max-width: 70ch; }
.sheetview section { margin-top: 14px; }
.sheetview h3 { margin: 0 0 6px; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); font-size: 13.5px; }
.chip b { color: var(--gold2); margin-left: 4px; }
.vis-tag { color: var(--muted); }
.pc-stats .linkish { font-size: 13px; }
.vis-seg { grid-template-columns: repeat(3, 1fr); }
.vis-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
@media (max-width: 1080px) { .share-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .kinds, .vis-seg { grid-template-columns: minmax(0, 1fr); } }

/* ================= Campaign GM screen (everything on one page) ================= */
body.sec-campaign .wrap.wide { max-width: 1720px; }
.gm-strip { position: sticky; top: 64px; z-index: 15; display: grid; gap: 8px; padding: 12px 14px; border-radius: 16px; background: rgba(12,15,28,.94); backdrop-filter: blur(10px); border: 1px solid rgba(217,180,90,.35); box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.gs-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.gs-head .kicker { margin: 0; color: var(--gold2); }
.gs-jump { display: flex; gap: 4px; }
.gs-jump button { border: 1px solid var(--line); background: var(--bg2); color: var(--muted); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.gs-jump button:hover { color: var(--gold2); border-color: var(--gold); }
.gs-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.gs-party { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.gs-party > p { margin: 6px 0; }
.hv { flex: 0 0 200px; display: grid; gap: 4px; padding: 8px 10px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); border-left: 3px solid var(--hit, #3fd28b); transition: border-color .2s, box-shadow .3s; }
.hv.now { border-color: var(--gold); box-shadow: 0 0 16px rgba(217,180,90,.35); }
.hv.down { border-left-color: var(--crimson); opacity: .7; }
.hv-top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; min-width: 0; }
.hv-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.hv-top small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.hv-hp { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.hv-hp .hpbar2 { height: 8px; } .hv-hp .hpbar2 i { background: linear-gradient(90deg, var(--hit, #3fd28b), #8ff0bd); }
.hv.down .hv-hp .hpbar2 i { background: var(--crimson); }
.hv-hp span { font-weight: 700; font-size: 13px; }
.hv-ex { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.roller.mini { margin: 0; padding: 8px 10px; width: 360px; }
.roller.mini .ctl { gap: 6px; flex-wrap: nowrap; }
.roller.mini .ctl label { font-size: 12px; }
.roller.mini select { padding: 4px 6px !important; width: auto !important; font-size: 13px !important; }
.roller.mini .dice { gap: 4px; margin: 8px 0 4px; min-height: 30px; }
.roller.mini .die { width: 30px; height: 30px; font-size: 14px; border-radius: 7px; }
.roller.mini .roll-out { font-size: 13px; }
.dash { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, .95fr); grid-template-areas: "fight enc table"; gap: 18px; align-items: start; margin-top: 4px; }
#p-fight { grid-area: fight; } #p-enc { grid-area: enc; } #p-table { grid-area: table; }
.dcol { display: grid; gap: 14px; min-width: 0; container-type: inline-size; }
.dlabel { margin: 4px 2px -4px; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); font-family: var(--body); }
.dcol .sblock { padding: 16px 18px; gap: 10px; }
.dcol .sblock > h2 { font-size: 18px; }
.dcol .fight-top { grid-template-columns: auto minmax(0, 1fr); }
.dcol .round { width: 66px; height: 66px; } .dcol .round b { font-size: 26px; }
.dcol .mlist { max-height: 420px; }
.dcol .feed { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); max-height: 560px; overflow: auto; }
.dcol .log.notes { max-height: 360px; overflow: auto; }
.manage summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.manage summary::-webkit-details-marker { display: none; }
.manage summary::after { content: '▾'; color: var(--gold); margin-left: auto; transition: transform .2s; }
.manage:not([open]) summary::after { transform: rotate(-90deg); }
.manage summary h2 { margin: 0; font-size: 18px; color: var(--gold2); }
.manage[open] { gap: 12px; }
.dcol .party-grid { grid-template-columns: minmax(0, 1fr); }
@container (max-width: 760px) {
  .frow { grid-template-columns: 52px minmax(0, 1fr) auto 32px; gap: 8px; padding: 10px; }
  .frow .f-ctl, .frow .f-cond { grid-column: 1 / -1; }
  .frow .f-hp { grid-column: 3; grid-row: 1; } .frow .f-x { grid-column: 4; grid-row: 1; }
  .f-ctl button { padding: 6px 2px; }
}
@media (max-width: 1400px) { .dash { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-areas: "fight enc" "table enc"; } }
@media (max-width: 1080px) { .dash { grid-template-columns: minmax(0, 1fr); grid-template-areas: "fight" "enc" "table"; } }
@media (max-width: 860px) {
  .gm-strip { position: static; }
  .gs-row { grid-template-columns: minmax(0, 1fr); }
  .roller.mini { width: auto; }
  .roller.mini .ctl { flex-wrap: wrap; }
}

/* ================= Campaign: monster + hero sheet drawer ================= */
.cp-drawer { position: fixed; top: 64px; right: 0; bottom: 0; z-index: 40; width: min(460px, 100vw); overflow: auto; display: grid; gap: 14px; align-content: start; padding: 20px max(18px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) 18px; background: linear-gradient(180deg, var(--panel), var(--bg2)); border-left: 1px solid rgba(217,180,90,.45); box-shadow: -20px 0 50px rgba(0,0,0,.55); animation: dwIn .3s cubic-bezier(.2,.8,.3,1); }
@keyframes dwIn { from { transform: translateX(40px); opacity: 0; } }
@media (min-width: 1500px) { body.dw-open .dash { margin-right: 470px; } body.dw-open .gm-strip { margin-right: 470px; } }
.dw-x { position: sticky; top: 0; justify-self: end; margin-bottom: -34px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }
.dw-x:hover { border-color: var(--gold); color: var(--gold2); }
.dw-head { display: grid; gap: 6px; padding-right: 40px; }
.dw-head.dwh-hero { grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 14px; }
.dw-head.dwh-hero img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); box-shadow: 0 0 18px rgba(217,180,90,.35); }
.dw-head .tag { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.dw-head h2 { margin: 0; font-size: 24px; color: var(--gold2); text-wrap: balance; }
.dw-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.dw-head .fair { font-size: 13px; color: var(--muted); font-style: italic; }
.dw-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.dw-stats span { padding: 5px 10px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.dw-stats b { color: var(--text); font-size: 14px; margin-left: 2px; }
.dw-stats.dw-scores span { border-color: rgba(95,212,255,.35); }
.dw-ctl { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(95,212,255,.06); border: 1px solid rgba(95,212,255,.25); }
.dw-ctl label { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.dw-ctl select { width: auto !important; padding: 4px 8px !important; }
.dw-ctl .lev { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.dw-ctl .lev button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font-size: 16px; cursor: pointer; }
.dw-ctl .lev b { min-width: 24px; text-align: center; color: var(--gold2); }
.dw-skills { display: grid; gap: 10px; }
.dw-cat h4, .cp-drawer .pw-group { margin: 0 0 6px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.dw-cat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.dw-cat h4 { grid-column: 1 / -1; }
.rollbtn { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font-size: 13.5px; cursor: pointer; text-align: left; transition: border-color .15s, transform .1s; }
.rollbtn:hover { border-color: var(--hit, #3fd28b); }
.rollbtn:active { transform: scale(.97); }
.rollbtn b { color: var(--gold2); }
.dw-pools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.dw-pools .lbl { font-size: 12px; color: var(--muted); margin-right: 4px; }
.dw-pools button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); cursor: pointer; }
.dw-pools button:hover { border-color: var(--gold); }
#dw-log { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
#dw-log li { padding: 8px 10px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); font-size: 13px; line-height: 1.8; animation: logIn .35s ease-out; }
#dw-log li:first-child:not(.muted) { border-color: rgba(217,180,90,.5); }
#dw-log .d { display: inline-grid; place-items: center; width: 24px; height: 24px; margin: 0 1px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); font-weight: 700; font-size: 12px; }
#dw-log .d.h { background: var(--hit, #3fd28b); color: #04140b; border-color: var(--hit2, #8ff0bd); }
#dw-log .d.g { background: linear-gradient(135deg, #f3d58c, #d9b45a); color: #2a1d00; border-color: #fff1c4; box-shadow: 0 0 10px rgba(243,213,140,.6); }
#dw-log .d.c { outline: 1px dashed rgba(217,180,90,.6); outline-offset: 1px; }
#dw-log .cos { color: var(--gold2); } #dw-log .fail { color: var(--crimson); }
.dw-block summary { cursor: pointer; color: var(--gold2); font-weight: 600; }
.dw-block .prose { font-size: 13.5px; overflow-x: auto; }
.dw-block table { font-size: 12.5px; }
.cp-drawer .sitem { grid-template-columns: minmax(0, 1fr); }
.f-name { all: unset; cursor: pointer; font-weight: 700; color: var(--text); border-bottom: 1px dashed rgba(217,180,90,.5); }
.f-name:hover, .f-name:focus-visible { color: var(--gold2); border-bottom-color: var(--gold); }
.hv[data-hero] { cursor: pointer; }
.hv[data-hero]:hover, .hv[data-hero]:focus-visible { border-color: var(--gold); outline: none; }
.cp-pop { position: fixed; z-index: 60; width: 320px; max-width: calc(100vw - 16px); display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid rgba(217,180,90,.5); box-shadow: 0 18px 40px rgba(0,0,0,.55); pointer-events: none; animation: logIn .2s ease-out; }
.cp-pop > b { color: var(--gold2); font-size: 16px; }
.cp-pop small { color: var(--muted); font-size: 12px; }
.cp-pop .chip { font-size: 12px; padding: 3px 8px; }
.cp-pop .chip.pw { border-color: rgba(95,212,255,.45); }
@media (max-width: 600px) { .cp-drawer { top: 0; z-index: 200; padding-top: calc(16px + env(safe-area-inset-top, 0px)); } }

.dw-cap { display: grid; gap: 6px; }
.dw-cap .rollbtn { border-color: rgba(63,210,139,.5); }

/* ================= Inventory ================= */
.sblock h3.sub { margin: 6px 0 0; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); font-family: var(--body); }
.inv { display: grid; gap: 12px; min-width: 0; }
.inv-sum { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: stretch; }
.inv-load, .inv-money { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.il-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.il-top b { color: var(--text); font-size: 16px; } .il-top small { color: var(--muted); font-weight: 500; }
.inv-load .hpbar2 { height: 8px; } .inv-load .hpbar2 i { background: linear-gradient(90deg, var(--hit, #3fd28b), #8ff0bd); }
.inv-load.over { border-color: rgba(224,71,91,.6); } .inv-load.over .hpbar2 i { background: var(--crimson); }
.inv-load > small { font-size: 12.5px; color: var(--muted); }
.inv-money > span { font-size: 13px; color: var(--muted); }
.inv-money .step { display: flex; gap: 4px; align-items: center; }
.inv-money .step button { min-width: 38px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 13px; }
.sheet-app .inv-money input { width: 90px !important; text-align: center; font-weight: 700; color: var(--gold2) !important; padding: 6px !important; }
.inv-filter .chip { cursor: pointer; color: var(--text); font-size: 13px; }
.inv-filter .chip.on { border-color: var(--gold); background: rgba(217,180,90,.14); color: var(--gold2); }
.it-list { display: grid; gap: 6px; }
.it { border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); transition: border-color .2s; }
.it.eq { border-left: 3px solid var(--gold); }
.it.open { border-color: var(--gold); }
.it-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 10px; }
.it-ico { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--panel2); font-size: 16px; flex: 0 0 auto; }
.it-name { all: unset; cursor: pointer; display: grid; flex: 1 1 160px; min-width: 0; }
.it-name b { font-size: 15px; } .it-name small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.it-name:focus-visible b, .it-name:hover b { color: var(--gold2); }
.it-wt { font-size: 12.5px; color: var(--muted); min-width: 40px; text-align: right; }
.step.sm button { width: 28px; height: 28px; font-size: 15px; }
.it-eq { border: 1px solid var(--line); background: var(--panel2); color: var(--muted); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; }
.it-eq.on { border-color: var(--gold); color: var(--gold2); background: rgba(217,180,90,.12); }
.it-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding: 4px 12px 12px; }
.it-edit label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.it-edit .wide { grid-column: 1 / -1; }
.sheet-app .it-edit textarea { min-height: 60px; }
.it-btns { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: space-between; }
.it-add { display: grid; grid-template-columns: minmax(0, 1fr) 170px auto; gap: 8px; }
@media (max-width: 560px) { .inv-sum { grid-template-columns: minmax(0, 1fr); } .it-add { grid-template-columns: minmax(0, 1fr) auto; } .it-add input { grid-column: 1 / -1; } }

/* ================= Effects over time ================= */
.fx-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fx-head h2 { margin: 0; font-size: 21px; color: var(--gold2); }
.fx-list, .fx-presets, .hb-fx { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px 4px 10px; border-radius: 999px; font-size: 13px; background: var(--panel2); border: 1px solid var(--line); }
.fx-chip b { color: #ff9aa6; }
.fx-chip em { font-style: normal; font-size: 11px; min-width: 18px; height: 18px; display: inline-grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.08); color: var(--muted); padding: 0 4px; }
.fx-chip button { border: 0; background: none; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 4px; cursor: pointer; }
.fx-chip.k-poison { border-color: rgba(120,220,90,.55); } .fx-chip.k-bleed { border-color: rgba(224,71,91,.6); } .fx-chip.k-burn { border-color: rgba(255,140,60,.6); }
.fx-chip.k-acid { border-color: rgba(200,230,60,.55); } .fx-chip.k-cold { border-color: rgba(120,200,255,.6); } .fx-chip.k-shock { border-color: rgba(255,230,90,.6); }
.fx-chip.k-regen { border-color: rgba(63,210,139,.6); } .fx-chip.k-regen b { color: var(--hit2, #8ff0bd); }
.fx-addbox summary { cursor: pointer; color: var(--gold2); font-weight: 600; }
.fx-addbox[open] { display: grid; gap: 10px; }
.fx-presets { margin-top: 10px; } .fx-presets .chip { cursor: pointer; color: var(--text); }
.fx-presets .chip:hover { border-color: var(--gold); }
.fx-custom { display: grid; grid-template-columns: minmax(0, 1fr) 110px 90px auto; gap: 8px; align-items: end; }
.fx-custom label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
@media (max-width: 560px) { .fx-custom { grid-template-columns: 1fr 1fr; } .fx-custom input:first-child { grid-column: 1 / -1; } }
.hb-fx .fx-chip { background: rgba(7,8,15,.6); backdrop-filter: blur(4px); }
.frow .fx-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.frow .fx-row .fx-chip { font-size: 12px; padding: 2px 4px 2px 8px; }
.frow .fx-row select { width: auto; font-size: 12.5px; padding: 3px 6px; border-radius: 8px; background: var(--bg2); color: var(--muted); border: 1px dashed var(--line); }

/* ================= Each world gets its own sheet look ================= */
/* EARTH: survival field file. Rust, hazard tape, typewriter, hard corners, worn concrete. */
.sheet-app[data-world=earth] {
  --panel: #1a1714; --panel2: #24201b; --bg2: #120f0c; --line: #3b332a; --gold: #e0893a; --gold2: #ffb46a; --cyan: #e8c547; --display: 'Black Ops One', 'Cinzel', Impact, sans-serif;
}
.sheet-app[data-world=earth] .sblock { border-radius: 4px; background:
  repeating-linear-gradient(135deg, rgba(255,255,255,.012) 0 2px, transparent 2px 7px),
  linear-gradient(180deg, #1c1814, #15120f); border: 1px solid #3b332a; box-shadow: inset 0 0 40px rgba(0,0,0,.45); position: relative; }
.sheet-app[data-world=earth] .sblock::before { content: ''; position: absolute; left: -1px; right: -1px; top: -1px; height: 5px; border-radius: 4px 4px 0 0;
  background: repeating-linear-gradient(135deg, #e8c547 0 10px, #15120f 10px 20px); opacity: .75; }
.sheet-app[data-world=earth] .sblock > h2, .sheet-app[data-world=earth] .fx-head h2 { font-family: var(--display); letter-spacing: .06em; color: #ffb46a; text-transform: uppercase; }
.sheet-app[data-world=earth] .sblock .num { border-radius: 3px; background: #e0893a; color: #120f0c; }
.sheet-app[data-world=earth] .hero-banner { border-radius: 6px; border-color: #e0893a; }
.sheet-app[data-world=earth] .hb-name h2 { font-family: 'Black Ops One', Impact, sans-serif; letter-spacing: .04em; }
.sheet-app[data-world=earth] .hb-name .kicker, .sheet-app[data-world=earth] .it-name small, .sheet-app[data-world=earth] .sheet-hint { font-family: 'Special Elite', 'Courier New', monospace; }
.sheet-app[data-world=earth] .crest, .sheet-app[data-world=earth] .plate, .sheet-app[data-world=earth] .it, .sheet-app[data-world=earth] .rollbtn, .sheet-app[data-world=earth] .meter, .sheet-app[data-world=earth] .inv-load, .sheet-app[data-world=earth] .inv-money { border-radius: 3px; }
.sheet-app[data-world=earth] .mode button[aria-selected="true"], .sheet-app[data-world=earth] .btn.primary { background: linear-gradient(180deg, #ffb46a, #e0893a); color: #120f0c; }
.sheet-app[data-world=earth] .mode, .sheet-app[data-world=earth] .chip, .sheet-app[data-world=earth] .fx-chip, .sheet-app[data-world=earth] .it-eq { border-radius: 3px; }
.sheet-app[data-world=earth] .it.eq { border-left-color: #e8c547; }
.sheet-app[data-world=earth] .sheet-top h1 { font-family: 'Black Ops One', Impact, sans-serif; color: #ffb46a; }

/* AOS: woven fate. Teal thread on gold, ornate double frames, illuminated-manuscript feel. */
.sheet-app[data-world=aos] {
  --panel: #180e27; --panel2: #211433; --bg2: #120a1d; --line: #3b2654; --gold: #f08bd6; --gold2: #ffc4ef; --cyan: #b994ff;
}
.sheet-app[data-world=aos] .sblock { border-radius: 20px; border: 1px solid rgba(217,180,90,.35);
  background: radial-gradient(120% 80% at 100% 0%, rgba(185,148,255,.14), transparent 60%), radial-gradient(90% 70% at 0% 100%, rgba(240,139,214,.10), transparent 60%), linear-gradient(180deg, #1a0f2a, #120a1d);
  box-shadow: inset 0 0 0 4px #120a1d, inset 0 0 0 5px rgba(240,139,214,.22), 0 10px 30px rgba(0,0,0,.35); }
.sheet-app[data-world=aos] .sblock > h2, .sheet-app[data-world=aos] .fx-head h2 { font-family: 'Cinzel', serif; letter-spacing: .05em; }
.sheet-app[data-world=aos] .sblock > h2::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(240,139,214,.7), rgba(185,148,255,.4), transparent); }
.sheet-app[data-world=aos] .sblock .num { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffc4ef, #a04fd0); color: #1a0626; box-shadow: 0 0 12px rgba(240,139,214,.5); }
.sheet-app[data-world=aos] .hb-name p, .sheet-app[data-world=aos] .sheet-hint, .sheet-app[data-world=aos] .pw-d { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.08em; }
.sheet-app[data-world=aos] .hero-banner { border-radius: 26px; border-color: rgba(240,139,214,.5); box-shadow: inset 0 0 0 1px rgba(185,148,255,.35), 0 0 50px rgba(200,110,255,.2); }
.sheet-app[data-world=aos] .it.eq { border-left-color: #f08bd6; }
.sheet-app[data-world=aos] .sheet-top h1 { background: linear-gradient(90deg, #ffc4ef, #b994ff); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* SPACE OPERA: starship HUD. Neon violet and cyan, clipped corners, scanlines, tech type. */
.sheet-app[data-world=space] {
  --panel: #0b1018; --panel2: #111a26; --bg2: #070a10; --line: #22303f; --gold: #ffd93b; --gold2: #ffe98a; --cyan: #4fc3ff; --display: 'Orbitron', 'Cinzel', sans-serif;
}
.sheet-app[data-world=space] .sblock { border-radius: 0; border: 1px solid rgba(95,212,255,.28);
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  background: repeating-linear-gradient(0deg, rgba(79,195,255,.04) 0 1px, transparent 1px 4px), linear-gradient(160deg, #0d141f, #06090e 70%); }
.sheet-app[data-world=space] .sblock > h2, .sheet-app[data-world=space] .fx-head h2 { font-family: 'Orbitron', sans-serif; font-size: 17px; letter-spacing: .14em; text-transform: uppercase; color: #ffe81f; text-shadow: 0 0 12px rgba(255,232,31,.35); }
.sheet-app[data-world=space] .sblock .num { border-radius: 0; clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); background: #5fd4ff; color: #090819; }
.sheet-app[data-world=space] .hero-banner { border-radius: 0; clip-path: polygon(28px 0, 100% 0, 100% calc(100% - 28px), calc(100% - 28px) 100%, 0 100%, 0 28px); border-color: rgba(95,212,255,.5); }
.sheet-app[data-world=space] .hb-name h2, .sheet-app[data-world=space] .hb-level b, .sheet-app[data-world=space] .crest b, .sheet-app[data-world=space] .plate b, .sheet-app[data-world=space] .sheet-top h1 { font-family: 'Orbitron', sans-serif; letter-spacing: .06em; }
.sheet-app[data-world=space] .sheet-top h1 { color: #ffe81f; text-shadow: 0 0 18px rgba(255,232,31,.35); }
.sheet-app[data-world=space] .crest, .sheet-app[data-world=space] .plate, .sheet-app[data-world=space] .it, .sheet-app[data-world=space] .rollbtn, .sheet-app[data-world=space] .meter, .sheet-app[data-world=space] .inv-load, .sheet-app[data-world=space] .inv-money {
  border-radius: 0; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.sheet-app[data-world=space] .mode button[aria-selected="true"], .sheet-app[data-world=space] .btn.primary { background: linear-gradient(90deg, #ffe81f, #ffb000); color: #050505; box-shadow: 0 0 18px rgba(255,217,59,.35); }
.sheet-app[data-world=space] .it-name small, .sheet-app[data-world=space] .il-top b, .sheet-app[data-world=space] .rollbtn b { font-family: 'Rajdhani', 'Inter', sans-serif; letter-spacing: .04em; }
.sheet-app[data-world=space] .it.eq { border-left-color: #5fd4ff; }

/* ================= World dice effects ================= */
.rfx { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: visible; transition: opacity 1.6s ease; }
.rfx.fade { opacity: 0; }
/* Earth: blood */
.rfx-earth .splat { position: absolute; transform: translate(-50%, -50%) rotate(var(--r)) scale(0); border-radius: 48% 52% 40% 60% / 55% 45% 58% 42%;
  background: radial-gradient(circle at 40% 40%, #b3121f 0 35%, #7c0a14 60%, rgba(90,6,12,.0) 72%);
  box-shadow: 6px 2px 0 -3px #8d0c17, -5px 6px 0 -4px #8d0c17, 2px -6px 0 -4px #a01019; mix-blend-mode: screen; opacity: .85;
  animation: rfxSplat .32s cubic-bezier(.2,1.6,.4,1) var(--dl) forwards; }
.rfx-earth .drip { position: absolute; width: 3px; height: 0; border-radius: 0 0 3px 3px; background: linear-gradient(#a01019, #6a0710); opacity: .85; animation: rfxDrip 1.6s ease-in var(--dl) forwards; }
@keyframes rfxSplat { to { transform: translate(-50%, -50%) rotate(var(--r)) scale(1); } }
@keyframes rfxDrip { to { height: var(--h); } }
.d.bloody, .die.bloody { animation: rfxShake .35s ease-out; }
@keyframes rfxShake { 0% { transform: translate(-3px, -6px) rotate(-12deg); } 60% { transform: translate(1px, 1px) rotate(4deg); } 100% { transform: none; } }
/* Space: cosmic trail */
.rfx-space .trail { position: absolute; width: 90px; height: 6px; border-radius: 6px; transform-origin: right center; opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(154,125,255,.5) 40%, rgba(95,212,255,.95)); filter: blur(1px); box-shadow: 0 0 12px rgba(95,212,255,.7);
  animation: rfxTrail 1.1s ease-out var(--dl) forwards; }
.rfx-space .spark { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #5fd4ff, 0 0 12px #9a7dff; opacity: 0; animation: rfxSpark 1.2s ease-out var(--dl) forwards; }
@keyframes rfxTrail { 0% { opacity: 0; transform: scaleX(.2); } 20% { opacity: 1; transform: scaleX(1); } 100% { opacity: 0; transform: scaleX(.35) translateX(30px); } }
@keyframes rfxSpark { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-14px, 6px) scale(.4); } }
.d.warp, .die.warp { animation: rfxWarp .5s cubic-bezier(.15,.9,.3,1.15) var(--dl, 0ms) both; box-shadow: 0 0 10px rgba(95,212,255,.45); }
@keyframes rfxWarp { from { transform: translateX(-70px) scale(.6); opacity: 0; filter: blur(3px); } }
/* Aos: golden fate thread */
.rfx-aos svg { position: absolute; left: 0; top: 0; overflow: visible; }
.rfx-aos .thread { stroke-dasharray: 100; stroke-dashoffset: 100; animation: rfxThread 1.1s ease-out forwards; }
.rfx-aos .knot { opacity: 0; transform-box: fill-box; transform-origin: center; animation: rfxKnot .5s ease-out var(--dl) forwards; }
@keyframes rfxThread { to { stroke-dashoffset: 0; } }
@keyframes rfxKnot { 0% { opacity: 0; transform: scale(1.8); } 60% { opacity: 1; } 100% { opacity: .9; transform: scale(1); } }
.d.woven, .die.woven { animation: rfxWoven .6s ease-out var(--dl, 0ms) both; }
@keyframes rfxWoven { 0% { box-shadow: 0 0 0 rgba(243,213,140,0); } 50% { box-shadow: 0 0 16px rgba(243,213,140,.8); } 100% { box-shadow: 0 0 6px rgba(63,224,200,.35); } }
.rfx.calm * { animation-duration: .01s !important; animation-delay: 0s !important; }
.toast .rfx, .roller .rfx { z-index: 1; }

/* ================= Loom backstory ================= */
.loomgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.thread-f { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); position: relative; }
.thread-f::before { content: ''; position: absolute; left: 12px; right: 12px; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), var(--cyan), transparent); opacity: .6; }
.thread-f span { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.thread-f b { color: var(--gold2); font-family: var(--display); font-size: 15px; letter-spacing: .03em; }
.thread-f small { color: var(--muted); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; }
.sheet-app .thread-f textarea { min-height: 72px; }
.thread-f.view p { margin: 0; font-size: 14px; line-height: 1.55; }
details.loom-sec > summary { list-style: none; cursor: pointer; } details.loom-sec > summary::-webkit-details-marker { display: none; }
details.loom-sec > summary h2 { margin: 0; font-size: 21px; color: var(--gold2); }
details.loom-sec[open] > summary { margin-bottom: 12px; }

/* ================= Site-wide world mood (follows the world you're in) ================= */
.wsw { display: inline-flex; gap: 3px; padding: 3px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); flex: none; }
.wsw button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid transparent; cursor: pointer; padding: 0; position: relative; transition: transform .2s, box-shadow .3s; }
.wsw button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wsw [data-w=earth] { background: radial-gradient(circle at 35% 30%, #ffb46a, #8a3a1c 60%, #2a120a); }
.wsw [data-w=aos] { background: radial-gradient(circle at 35% 30%, #f3d58c, #3fc1ad 55%, #0d2e2a); }
.wsw [data-w=space] { background: radial-gradient(circle at 35% 30%, #e6dcff, #9a7dff 50%, #1b1340); }
.wsw button:hover { transform: scale(1.1); }
.wsw button[aria-pressed=true] { border-color: #fff8; box-shadow: 0 0 0 2px var(--bg2), 0 0 0 3px var(--gold), 0 0 14px var(--gold); }
@media (max-width: 1180px) { .wsw button { width: 26px; height: 26px; } }

html[data-world] body { transition: background-color .8s ease; }
/* EARTH: ash sky, black rain, rust glow on the horizon */
html[data-world=earth] { --gold: #e0893a; --gold2: #ffb46a; --cyan: #e8c547; --bg: #0b0908; --bg2: #120f0c; --panel: #17130f; --panel2: #201b16; --line: #352d25; }
html[data-world=earth] body { background-color: #0b0908; background-image:
  radial-gradient(1100px 520px at 80% 115%, rgba(208,98,63,.22), transparent 65%),
  radial-gradient(900px 500px at 10% -10%, rgba(120,110,100,.14), transparent 60%),
  repeating-linear-gradient(100deg, rgba(255,255,255,.012) 0 1px, transparent 1px 9px); }
html[data-world=earth] .threads { opacity: .22; filter: hue-rotate(160deg) saturate(.4); }
html[data-world=earth] .top { background: rgba(11,9,8,.9); }
/* AOS: woven gold and teal, warm nebula */
html[data-world=aos] { --gold: #f08bd6; --gold2: #ffc4ef; --cyan: #b994ff; --bg: #0c0614; --bg2: #120a1d; --panel: #180e27; --panel2: #211433; --line: #3b2654; --aos: #c98bff; }
html[data-world=aos] body { background-color: #0c0614; background-image:
  radial-gradient(1100px 600px at 85% -10%, rgba(240,139,214,.18), transparent 60%),
  radial-gradient(900px 600px at -10% 40%, rgba(160,110,255,.18), transparent 60%),
  radial-gradient(700px 400px at 50% 120%, rgba(255,150,220,.1), transparent 60%); }
html[data-world=aos] .threads { opacity: .6; filter: hue-rotate(110deg) saturate(1.3); }
html[data-world=aos] .top { background: rgba(12,6,20,.86); border-bottom-color: rgba(240,139,214,.35); }
/* SPACE OPERA: deep violet void, cyan nebula, grid hum */
html[data-world=space] { --gold: #ffd93b; --gold2: #ffe98a; --cyan: #4fc3ff; --crimson: #ff3b3b; --bg: #020306; --bg2: #070a10; --panel: #0b1018; --panel2: #111a26; --line: #22303f; --space: #4fc3ff; --display: 'Orbitron', 'Cinzel', sans-serif; }
html[data-world=space] body { background-color: #020306; background-image:
  radial-gradient(1000px 500px at 90% -10%, rgba(79,195,255,.14), transparent 60%),
  radial-gradient(800px 500px at -10% 110%, rgba(255,59,59,.10), transparent 60%),
  linear-gradient(rgba(79,195,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(79,195,255,.05) 1px, transparent 1px);
  background-size: auto, auto, 40px 40px, 40px 40px; }
html[data-world=space] h1, html[data-world=space] h2, html[data-world=space] .doc-head h1 { font-family: 'Orbitron', sans-serif; letter-spacing: .06em; color: #ffe81f; text-shadow: 0 0 18px rgba(255,232,31,.25); }
html[data-world=space] .prose h2, html[data-world=space] .prose h3 { font-family: 'Orbitron', sans-serif; letter-spacing: .05em; }
html[data-world=space] .top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, #4fc3ff, #ffd93b, #ff3b3b, transparent); }
html[data-world=space] .card, html[data-world=space] .sblock, html[data-world=space] .admonition { border-radius: 4px; }
html[data-world=space] .wrap::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px); }
html[data-world=aos] h1, html[data-world=aos] .doc-head h1 { background: linear-gradient(90deg, #ffc4ef, #c98bff 60%, #8fb6ff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
html[data-world=space] .threads { opacity: .2; filter: hue-rotate(-40deg) saturate(.6); }
html[data-world=space] .top { background: rgba(2,3,6,.9); }

/* ================= Vehicles and companions ================= */
.assets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.as-col { display: grid; gap: 10px; align-content: start; min-width: 0; }
.as-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.as-head h3.sub { margin: 0; }
.as-add { display: flex; gap: 6px; flex-wrap: wrap; }
.asset { display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); min-width: 0; }
.asset.open { border-color: var(--gold); }
.as-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.as-ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--panel2); font-size: 20px; flex: none; }
.as-name { all: unset; cursor: pointer; display: grid; flex: 1 1 150px; min-width: 0; }
.as-name b { font-size: 16px; } .as-name small { color: var(--muted); font-size: 12.5px; }
.as-name:hover b, .as-name:focus-visible b { color: var(--gold2); }
.as-vitals { display: flex; gap: 10px; flex: 1 1 220px; }
.as-v { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; font-size: 12px; color: var(--muted); }
.as-v b { color: var(--text); text-align: right; font-size: 14px; }
.as-v .hpbar2 { grid-column: 1 / -1; height: 7px; }
.as-v .hpbar2 i { background: linear-gradient(90deg, var(--hit, #3fd28b), #8ff0bd); }
.as-v.sh .hpbar2 i { background: linear-gradient(90deg, #5fd4ff, #9a7dff); }
.as-dmg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sheet-app .as-dmg input { width: 80px; padding: 7px 8px; }
.chk { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.as-weps { display: grid; gap: 6px; }
.as-w { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.as-w small { grid-column: 1; color: var(--muted); font-size: 12px; } .as-w button { grid-row: 1 / 3; grid-column: 2; }
.as-weps > .btn { justify-self: start; }
.pet-skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.as-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.as-edit .wide { grid-column: 1 / -1; display: grid; gap: 6px; }
.af { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.af small { color: var(--cyan); font-weight: 500; }
.af.sm input { padding: 6px 8px !important; }
.as-edit .lbl { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.as-stats { display: flex !important; flex-wrap: wrap; gap: 6px !important; }
.as-stats span { padding: 4px 10px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.as-stats b { color: var(--gold2); }
.stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pet-sk-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.wrow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 6px; align-items: center; }
.wrow .f-x { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); }
@media (max-width: 560px) { .wrow { grid-template-columns: minmax(0, 1fr) 32px; } .wrow > :not(.f-x) { grid-column: 1; } .wrow .f-x { grid-column: 2; grid-row: 1; } }

/* home loom: orbs travel around the ring */
.loom.orbiting .orb { transition: none; }
.loom.orbiting .loom-threads path { transition: none; }

/* monster sheet: kits, gear, loot */
.cp-drawer .sitem.kit { grid-template-columns: minmax(0, 1fr) auto; border-left: 3px solid var(--line); }
.cp-drawer .sitem.k-offense { border-left-color: var(--crimson); } .cp-drawer .sitem.k-defense { border-left-color: var(--cyan); } .cp-drawer .sitem.k-utility { border-left-color: var(--gold); }
.dw-gear { margin: 0; font-size: 14px; }
.dw-loot { display: grid; gap: 8px; justify-items: start; }
.loot-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(217,180,90,.08); border: 1px solid rgba(217,180,90,.4); animation: logIn .35s ease-out; }
.loot-box > b { color: var(--gold2); font-size: 16px; margin-right: 4px; }
.loot-act { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.loot-act select { width: auto; padding: 5px 8px; border-radius: 8px; background: var(--bg2); color: var(--text); border: 1px solid var(--line); }
.dw-block p { font-size: 14px; line-height: 1.55; }

/* ================= World backdrop: strong, automatic per page / campaign / character ================= */
.world-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.world-bg i { position: absolute; inset: -40px; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.2s ease; filter: blur(6px) saturate(1.15); transform: scale(1.06); }
.world-bg .wb-earth { background-image: linear-gradient(180deg, rgba(6,4,4,.35), rgba(6,4,4,.88) 80%), url(../img/cls-the-damned.webp); filter: blur(6px) saturate(.6) contrast(1.15); }
.world-bg .wb-aos { background-image: linear-gradient(180deg, rgba(12,6,20,.3), rgba(12,6,20,.85) 80%), url(../img/dragons/dragon-house-gem.webp); filter: blur(7px) saturate(1.2); }
.world-bg .wb-space { background-image: linear-gradient(180deg, rgba(2,3,6,.35), rgba(2,3,6,.9) 80%), url(../img/ships-imperium.webp); filter: blur(4px) saturate(.9) contrast(1.1); }
html[data-world=earth] .world-bg .wb-earth, html[data-world=aos] .world-bg .wb-aos, html[data-world=space] .world-bg .wb-space { opacity: .8; }
.world-bg .wb-fx { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s; }
html[data-world=earth] .world-bg .wb-fx { opacity: 1; background: radial-gradient(120% 90% at 50% 120%, rgba(150,30,20,.35), transparent 60%), radial-gradient(80% 60% at 50% 50%, transparent 40%, rgba(0,0,0,.65)); }
html[data-world=aos] .world-bg .wb-fx { opacity: 1; background: radial-gradient(70% 50% at 80% 10%, rgba(240,139,214,.28), transparent 60%), radial-gradient(70% 60% at 10% 90%, rgba(150,100,255,.28), transparent 60%); animation: aosGlow 9s ease-in-out infinite alternate; }
html[data-world=space] .world-bg .wb-fx { opacity: 1; background: radial-gradient(60% 50% at 85% 15%, rgba(79,195,255,.18), transparent 60%), radial-gradient(60% 50% at 10% 80%, rgba(255,59,59,.12), transparent 60%), linear-gradient(rgba(79,195,255,.06) 1px, transparent 1px) 0 0 / 100% 6px; animation: aosGlow 12s ease-in-out infinite alternate; }
@keyframes aosGlow { to { transform: scale(1.08) translate(-1%, 1%); filter: hue-rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .world-bg .wb-fx { animation: none !important; } }
.wrap, .foot { position: relative; z-index: 1; }
.rfx-space .trail { background: linear-gradient(90deg, transparent, rgba(255,59,59,.45) 40%, rgba(79,195,255,.95)); box-shadow: 0 0 12px rgba(79,195,255,.8); }
.d.woven, .die.woven { animation-name: rfxWovenP; }
@keyframes rfxWovenP { 0% { box-shadow: 0 0 0 rgba(240,139,214,0); } 50% { box-shadow: 0 0 16px rgba(240,139,214,.85); } 100% { box-shadow: 0 0 6px rgba(185,148,255,.45); } }

/* ================= Class layer on top of the world backdrop ================= */
.world-bg .wb-class { opacity: 0; background-size: cover; background-position: center 20%; filter: blur(10px) saturate(1.2); transition: opacity 1.2s; mix-blend-mode: screen; }
html[data-cls] .world-bg .wb-class { opacity: .32; }
html[data-cls] .world-bg .wb-earth, html[data-cls] .world-bg .wb-aos, html[data-cls] .world-bg .wb-space { opacity: .45; }
.world-bg .wb-cfx { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s; }
html[data-cls] .world-bg .wb-cfx { opacity: 1; }
.wb-cfx[data-p=cells] { background: radial-gradient(circle at 20% 30%, color-mix(in srgb, var(--cls-a) 14%, transparent) 0 3px, transparent 4px) 0 0 / 46px 46px, radial-gradient(circle, color-mix(in srgb, var(--cls-b) 10%, transparent) 0 2px, transparent 3px) 23px 23px / 46px 46px; animation: cfxDrift 40s linear infinite; }
.wb-cfx[data-p=clock] { background: repeating-radial-gradient(circle at 75% 30%, transparent 0 38px, color-mix(in srgb, var(--cls-a) 22%, transparent) 39px 40px), conic-gradient(from 0deg at 75% 30%, transparent 0 88%, color-mix(in srgb, var(--cls-a) 25%, transparent) 90%, transparent 92%); animation: cfxSpin 60s linear infinite; transform-origin: 75% 30%; }
.wb-cfx[data-p=leaves] { background: radial-gradient(60% 40% at 15% 85%, color-mix(in srgb, var(--cls-a) 28%, transparent), transparent 70%), radial-gradient(40% 30% at 90% 20%, color-mix(in srgb, var(--cls-b) 22%, transparent), transparent 70%); }
.wb-cfx[data-p=frayed] { background: repeating-linear-gradient(115deg, transparent 0 46px, color-mix(in srgb, var(--cls-a) 18%, transparent) 46px 47px, transparent 47px 60px, color-mix(in srgb, var(--cls-b) 16%, transparent) 60px 61px); mask-image: linear-gradient(90deg, #000 0 30%, transparent 32% 40%, #000 42% 70%, transparent 72%); -webkit-mask-image: linear-gradient(90deg, #000 0 30%, transparent 32% 40%, #000 42% 70%, transparent 72%); }
.wb-cfx[data-p=moon] { background: radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--cls-a) 45%, transparent) 0 70px, transparent 72px), radial-gradient(circle at 80% 17%, transparent 0 140px, color-mix(in srgb, var(--cls-a) 12%, transparent) 141px 220px, transparent 260px); }
.wb-cfx[data-p=wisps] { background: radial-gradient(18% 12% at 20% 70%, color-mix(in srgb, var(--cls-a) 30%, transparent), transparent 70%), radial-gradient(14% 10% at 70% 40%, color-mix(in srgb, var(--cls-b) 26%, transparent), transparent 70%), radial-gradient(10% 8% at 50% 85%, color-mix(in srgb, var(--cls-a) 24%, transparent), transparent 70%); animation: cfxFloat 14s ease-in-out infinite alternate; }
.wb-cfx[data-p=vortex] { background: conic-gradient(from 0deg at 50% 45%, transparent, color-mix(in srgb, var(--cls-a) 25%, transparent), transparent 30%, color-mix(in srgb, var(--cls-b) 18%, transparent) 55%, transparent 70%), radial-gradient(circle at 50% 45%, rgba(0,0,0,.6) 0 80px, transparent 300px); animation: cfxSpin 50s linear infinite; transform-origin: 50% 45%; }
.wb-cfx[data-p=plates] { background: linear-gradient(color-mix(in srgb, var(--cls-a) 10%, transparent) 2px, transparent 2px) 0 0 / 120px 70px, linear-gradient(90deg, color-mix(in srgb, var(--cls-a) 10%, transparent) 2px, transparent 2px) 0 0 / 120px 70px, radial-gradient(80% 60% at 50% 110%, color-mix(in srgb, var(--cls-b) 20%, transparent), transparent 70%); }
.wb-cfx[data-p=waves] { background: repeating-radial-gradient(circle at 30% 40%, transparent 0 30px, color-mix(in srgb, var(--cls-a) 16%, transparent) 31px 33px); animation: cfxPulse 6s ease-in-out infinite; }
.wb-cfx[data-p=elements] { background: conic-gradient(from 45deg at 50% 50%, color-mix(in srgb, #ff6a2a 20%, transparent), color-mix(in srgb, #3dc8ff 20%, transparent), color-mix(in srgb, #7bd36a 18%, transparent), color-mix(in srgb, #e8e8ff 16%, transparent), color-mix(in srgb, #ff6a2a 20%, transparent)); mask-image: radial-gradient(circle at 50% 50%, transparent 30%, #000 75%); -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 30%, #000 75%); animation: cfxSpin 90s linear infinite; }
.wb-cfx[data-p=saber] { background: linear-gradient(100deg, transparent 0 62%, color-mix(in srgb, var(--cls-a) 40%, transparent) 62.3%, transparent 63%), linear-gradient(80deg, transparent 0 30%, color-mix(in srgb, var(--cls-b) 28%, transparent) 30.2%, transparent 30.8%); filter: blur(1.5px) drop-shadow(0 0 8px var(--cls-a)); }
.wb-cfx[data-p=grid] { background: linear-gradient(color-mix(in srgb, var(--cls-a) 9%, transparent) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, color-mix(in srgb, var(--cls-a) 9%, transparent) 1px, transparent 1px) 0 0 / 32px 32px; mask-image: radial-gradient(circle at 70% 30%, #000, transparent 70%); -webkit-mask-image: radial-gradient(circle at 70% 30%, #000, transparent 70%); }
.wb-cfx[data-p=tape] { background: repeating-linear-gradient(-35deg, color-mix(in srgb, var(--cls-a) 12%, transparent) 0 22px, rgba(0,0,0,.15) 22px 44px) 0 99% / 100% 30px no-repeat; }
.wb-cfx[data-p=veins] { background: radial-gradient(60% 40% at 50% 110%, rgba(150,10,20,.4), transparent 70%), repeating-linear-gradient(170deg, transparent 0 80px, rgba(120,0,10,.18) 80px 82px); }
@keyframes cfxSpin { to { transform: rotate(360deg); } }
@keyframes cfxDrift { to { background-position: 46px 92px, 69px 115px; } }
@keyframes cfxFloat { to { transform: translate(-3%, -4%) scale(1.05); } }
@keyframes cfxPulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .wb-cfx { animation: none !important; } }

/* ================= Earth = horror ================= */
html[data-world=earth] { --gold: #c8202b; --gold2: #ff5a5a; --cyan: #b9c48a; --bg: #060404; --bg2: #0c0807; --panel: #120c0b; --panel2: #1a1110; --line: #3a1e1c; --earth: #c8202b; }
html[data-world=earth][data-cls] { --bg: #060404; }
html[data-world=earth] body { background-color: #060404; }
html[data-world=earth] h1, html[data-world=earth] .doc-head h1, html[data-world=earth] .prose h2 { font-family: 'Special Elite', 'Courier New', monospace; letter-spacing: .04em; color: #e9dcd0; text-shadow: 2px 0 rgba(200,32,43,.55), -1px 0 rgba(120,200,160,.25); animation: horrorFlicker 7s steps(1) infinite; }
@keyframes horrorFlicker { 0%, 100% { opacity: 1; } 91% { opacity: 1; } 92% { opacity: .4; } 93% { opacity: 1; } 95% { opacity: .7; transform: translateX(1px); } 96% { opacity: 1; transform: none; } }
html[data-world=earth] .top { background: rgba(6,4,4,.92); border-bottom: 1px solid #3a1e1c; }
html[data-world=earth] .top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -14px; height: 14px; pointer-events: none;
  background: radial-gradient(6px 12px at 8% 0, #7a0b12 60%, transparent 62%), radial-gradient(4px 9px at 23% 0, #7a0b12 60%, transparent 62%), radial-gradient(7px 14px at 47% 0, #7a0b12 60%, transparent 62%), radial-gradient(3px 7px at 66% 0, #7a0b12 60%, transparent 62%), radial-gradient(5px 11px at 88% 0, #7a0b12 60%, transparent 62%); }
html[data-world=earth] .world-bg .wb-grain { position: absolute; inset: -50%; opacity: .14; 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='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); animation: grainShift 1s steps(4) infinite; }
@keyframes grainShift { 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-1%, -2%); } }
html[data-world=earth] .world-bg .wb-fx { background: radial-gradient(120% 90% at 50% 120%, rgba(160,10,20,.45), transparent 60%), radial-gradient(70% 55% at 50% 45%, transparent 35%, rgba(0,0,0,.85)); animation: horrorPulse 5s ease-in-out infinite; }
@keyframes horrorPulse { 50% { opacity: .75; } }
html[data-world=earth] .card, html[data-world=earth] .sblock, html[data-world=earth] .admonition { border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { html[data-world=earth] h1, html[data-world=earth] .doc-head h1, html[data-world=earth] .prose h2, .world-bg .wb-grain, .world-bg .wb-fx { animation: none !important; } }

/* ---------- ready characters picker */
.ready-pick { margin: 0 0 1.4rem; padding: 1.2rem; border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); border-radius: 16px; background: color-mix(in srgb, var(--bg, #0b0a12) 82%, transparent); backdrop-filter: blur(6px); }
.rp-head h2 { margin: 0 0 .3rem; }
.rp-head p { margin: 0 0 1rem; color: var(--muted, #b8b3c8); max-width: 65ch; }
.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; }
.rp-card { position: relative; display: flex; flex-direction: column; gap: .3rem; text-align: left; padding: 0 0 .9rem; border-radius: 14px; overflow: hidden; cursor: pointer; color: inherit; font: inherit;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.1); transition: transform .2s, border-color .2s, box-shadow .2s; }
.rp-card:hover, .rp-card:focus-visible { transform: translateY(-3px); border-color: var(--rpc); box-shadow: 0 10px 30px -10px var(--rpc); }
.rp-card[data-world=earth] { --rpc: #c8202b; } .rp-card[data-world=aos] { --rpc: #f08bd6; } .rp-card[data-world=space] { --rpc: #4fc3ff; }
.rp-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: top; display: block; max-width: 100%; }
.rp-card > :not(img) { padding: 0 .9rem; }
.rp-tag { margin-top: .5rem; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--rpc); font-weight: 700; }
.rp-card b { font-size: 1.15rem; }
.rp-card small { color: var(--muted, #b8b3c8); line-height: 1.45; }
.rp-go { margin-top: .4rem; font-weight: 700; color: var(--rpc); font-size: .85rem; }

/* ---------- per-character sheet colours */
.theme-pick { margin-top: 1rem; display: grid; gap: .5rem; }
.tp-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tp-sw { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); cursor: pointer; padding: 0; background: conic-gradient(var(--a) 0 50%, var(--b) 50% 100%); transition: transform .15s, border-color .15s; }
.tp-sw:hover { transform: scale(1.1); }
.tp-sw.on { border-color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 50%, transparent); }
.tp-sw.def { width: auto; padding: 0 .8rem; border-radius: 18px; background: rgba(255,255,255,.06); color: inherit; font: inherit; font-size: .8rem; }
.tp-own { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--muted, #b8b3c8); }
.tp-own input[type=color] { width: 40px; height: 32px; padding: 0; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: none; cursor: pointer; }
html[data-ctheme] .sheet-app .hero-banner { border-color: color-mix(in srgb, var(--gold) 55%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 35%, transparent), 0 0 50px color-mix(in srgb, var(--gold) 22%, transparent); }
html[data-ctheme] .sheet-app .sheet-top h1 { background: linear-gradient(90deg, var(--gold2), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
html[data-ctheme] .sheet-app .sblock .num { background: radial-gradient(circle at 35% 30%, var(--gold2), var(--gold)); color: #0b0a12; box-shadow: 0 0 12px color-mix(in srgb, var(--gold) 50%, transparent); }
html[data-ctheme] .sheet-app .sblock > h2::after { background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--cyan) 40%, transparent), transparent); }
html[data-ctheme] .sheet-app .sblock { border-color: color-mix(in srgb, var(--gold) 30%, transparent); }
html[data-ctheme] .sheet-app .it.eq { border-left-color: var(--gold); }
.sheet-app .tp-own input[type=color] { -webkit-appearance: none; appearance: none; width: 44px !important; min-width: 0 !important; height: 34px !important; padding: 2px !important; border-radius: 9px; background: rgba(255,255,255,.06) !important; }
.tp-own input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.tp-own input[type=color]::-webkit-color-swatch { border: none; border-radius: 7px; }
.tp-own input[type=color]::-moz-color-swatch { border: none; border-radius: 7px; }

/* ================= AOS LANDING PAGE ================= */
.aosl { --ap: #f08bd6; --ap2: #ffc4ef; --av: #b994ff; --aink: #f6eefc; --amut: #cdbfe0; display: grid; gap: 4.5rem; padding-bottom: 3rem; color: var(--aink); }
.aosl h1, .aosl h2, .aosl h3 { font-family: 'Cinzel', Georgia, serif; text-wrap: balance; }
.aosl .btn { text-decoration: none; }
.aosl-hero { position: relative; border-radius: 28px; overflow: hidden; min-height: min(78vh, 680px); display: grid; align-content: end; isolation: isolate;
  background: var(--hero) center 40% / cover no-repeat; box-shadow: 0 30px 80px -30px rgba(160, 80, 255, .55), inset 0 0 0 1px rgba(240,139,214,.35); }
.aosl-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(12,6,20,.15) 0%, rgba(12,6,20,.35) 40%, rgba(12,6,20,.95) 100%), radial-gradient(60% 50% at 20% 100%, rgba(240,139,214,.35), transparent 70%); }
.aosl-hero-in { padding: clamp(1.4rem, 5vw, 3.5rem); max-width: 760px; animation: aoslRise 1.1s ease-out both; }
.aosl-kick { letter-spacing: .3em; text-transform: uppercase; font-size: .78rem; color: var(--ap2); }
.aosl-hero h1 { font-size: clamp(4rem, 14vw, 9rem); line-height: .9; margin: .2rem 0 .6rem; background: linear-gradient(90deg, #fff, var(--ap2) 40%, var(--av)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 30px rgba(240,139,214,.45)); }
.aosl-tag { font-family: 'Cormorant Garamond', Georgia, serif; font-size: clamp(1.2rem, 2.4vw, 1.6rem); line-height: 1.35; color: var(--aink); margin: 0 0 1.4rem; }
.aosl-cta { display: flex; flex-wrap: wrap; gap: .7rem; }
.aosl-facts { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid rgba(240,139,214,.3); background: rgba(12,6,20,.6); backdrop-filter: blur(8px); }
.aosl-facts div { padding: 1rem .6rem; text-align: center; border-left: 1px solid rgba(240,139,214,.18); }
.aosl-facts div:first-child { border-left: 0; }
.aosl-facts b { display: block; font-family: 'Cinzel', serif; font-size: 1.8rem; color: var(--ap2); }
.aosl-facts span { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--amut); }
@keyframes aoslRise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.aosl-h { margin-bottom: 1.6rem; }
.aosl-h span { display: block; font-size: .75rem; letter-spacing: .28em; text-transform: uppercase; color: var(--ap); margin-bottom: .3rem; }
.aosl-h h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.8rem); color: #fff; border: 0; padding: 0; }
.aosl-h h2::after { content: ''; display: block; width: 90px; height: 2px; margin-top: .7rem; background: linear-gradient(90deg, var(--ap), var(--av), transparent); }
.aosl-lede { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.25rem; line-height: 1.5; color: var(--amut); max-width: 65ch; margin: -.4rem 0 1.6rem; }

.aosl-time { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; position: relative; }
.aosl-time::before { content: ''; position: absolute; left: 0; right: 0; top: 11px; height: 2px; background: linear-gradient(90deg, transparent, var(--av), var(--ap), transparent); }
.aosl-time li { position: relative; padding-top: 2.2rem; }
.aosl-time li::before { content: ''; position: absolute; top: 3px; left: 0; width: 18px; height: 18px; border-radius: 50%; background: #1a0e27; border: 2px solid var(--av); box-shadow: 0 0 14px rgba(185,148,255,.6); }
.aosl-time li.now::before { background: var(--ap); border-color: #fff; box-shadow: 0 0 22px var(--ap); animation: aoslPulse 2.4s ease-in-out infinite; }
.aosl-time b { font-family: 'Cinzel', serif; font-size: 1.15rem; color: #fff; }
.aosl-time p { margin: .4rem 0 0; color: var(--amut); line-height: 1.55; }
@keyframes aoslPulse { 50% { box-shadow: 0 0 6px var(--ap); } }

.aosl-conts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.aosl-cont { --cc: var(--ap); border-radius: 22px; overflow: hidden; background: linear-gradient(180deg, rgba(30,16,46,.85), rgba(14,8,22,.95)); border: 1px solid color-mix(in srgb, var(--cc) 40%, transparent); transition: transform .3s, box-shadow .3s; display: flex; flex-direction: column; }
.aosl-cont:hover { transform: translateY(-6px); box-shadow: 0 24px 60px -20px var(--cc); }
.aosl-cont.fire { --cc: #ff6a3d; } .aosl-cont.ice { --cc: #8fd3ff; } .aosl-cont.gem { --cc: #f08bd6; }
.aosl-cont img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; max-width: 100%; transition: transform .6s; }
.aosl-cont:hover img { transform: scale(1.05); }
.aosl-cont-b { padding: 1.2rem 1.3rem 1.4rem; position: relative; }
.aosl-house { font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--cc); font-weight: 700; }
.aosl-cont h3 { font-size: 1.9rem; margin: .25rem 0 .5rem; color: #fff; }
.aosl-cont p { color: var(--amut); line-height: 1.6; margin: 0 0 .9rem; }
.aosl-chips { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0; }
.aosl-chips li { font-size: .78rem; padding: .25rem .65rem; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--cc) 45%, transparent); color: color-mix(in srgb, var(--cc) 70%, white); background: color-mix(in srgb, var(--cc) 10%, transparent); }

.aosl-peoples { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
.aosl-peoples figure { margin: 0; text-align: center; }
.aosl-peoples img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: top; border-radius: 50%; border: 2px solid rgba(240,139,214,.45); box-shadow: 0 0 0 6px rgba(185,148,255,.08), 0 14px 30px -12px rgba(200,110,255,.6); transition: transform .3s, border-color .3s; max-width: 100%; }
.aosl-peoples figure:hover img { transform: scale(1.06) rotate(-2deg); border-color: var(--ap2); }
.aosl-peoples figcaption { margin-top: .7rem; color: var(--amut); font-size: .88rem; line-height: 1.45; }
.aosl-peoples figcaption b { display: block; font-family: 'Cinzel', serif; font-size: 1.05rem; color: #fff; margin-bottom: .2rem; }

.aosl-moons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.moon { text-align: center; padding: 1.4rem 1rem; border-radius: 20px; background: rgba(20,10,32,.7); border: 1px solid rgba(255,255,255,.08); }
.moon i { display: block; width: 110px; height: 110px; margin: 0 auto 1rem; border-radius: 50%; animation: aoslGlow 5s ease-in-out infinite alternate; }
.moon.aestra i { background: radial-gradient(circle at 35% 30%, #fff, #bfe0ff 45%, #5c7bd6); box-shadow: 0 0 40px #9fc6ff; }
.moon.rhala i { background: radial-gradient(circle at 35% 30%, #f2ffe0, #8fe37a 45%, #2d7a3c); box-shadow: 0 0 40px #7be06a; animation-delay: -1.6s; }
.moon.xibu i { background: radial-gradient(circle at 35% 30%, #ffe0e0, #ff5a5a 45%, #7a1020); box-shadow: 0 0 40px #ff4040; animation-delay: -3.2s; }
.moon b { display: block; font-family: 'Cinzel', serif; font-size: 1.4rem; color: #fff; }
.moon small { letter-spacing: .15em; text-transform: uppercase; color: var(--amut); font-size: .72rem; }
.moon p { color: var(--amut); margin: .6rem 0 0; }
@keyframes aoslGlow { to { filter: brightness(1.18); transform: scale(1.03); } }
.aosl-note { display: flex; align-items: center; gap: 1rem; margin: 1.4rem 0 0; color: var(--amut); font-size: 1.05rem; }
.aosl-note img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--av); flex: none; }

.aosl-weavers { display: grid; grid-template-columns: repeat(5, 1fr); gap: .9rem; }
.aosl-weavers a { position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 3/4; border-radius: 18px; overflow: hidden; text-decoration: none; color: #fff; padding: .9rem; isolation: isolate; border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); transition: transform .25s, box-shadow .25s; }
.aosl-weavers a img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .5s; }
.aosl-weavers a::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 35%, rgba(8,4,14,.95)); }
.aosl-weavers a:hover { transform: translateY(-5px); box-shadow: 0 18px 40px -14px var(--c); }
.aosl-weavers a:hover img { transform: scale(1.07); }
.aosl-weavers b { font-family: 'Cinzel', serif; font-size: 1.05rem; }
.aosl-weavers small { color: var(--c); font-size: .8rem; margin-top: .15rem; }

.aosl-places { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.aosl-places figure { position: relative; margin: 0; border-radius: 18px; overflow: hidden; min-height: 230px; isolation: isolate; border: 1px solid rgba(240,139,214,.22); }
.aosl-places figure.big { grid-column: span 2; grid-row: span 2; }
.aosl-places img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .6s; }
.aosl-places figure:hover img { transform: scale(1.05); }
.aosl-places figure::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 30%, rgba(10,5,18,.94)); }
.aosl-places figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1rem 1.1rem; color: var(--amut); font-size: .9rem; line-height: 1.45; }
.aosl-places figcaption b { display: block; font-family: 'Cinzel', serif; color: #fff; font-size: 1.15rem; margin-bottom: .2rem; }
.aosl-places .big figcaption { font-size: 1.05rem; } .aosl-places .big figcaption b { font-size: 1.7rem; }

.aosl-threats { padding: 2rem clamp(1rem, 3vw, 2rem); border-radius: 26px; background: radial-gradient(80% 60% at 50% 0%, rgba(120,20,60,.35), transparent 70%), rgba(10,4,14,.75); border: 1px solid rgba(255,80,140,.25); }
.aosl-tgroup { margin-bottom: 2rem; }
.aosl-tgroup.two { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 0; }
.aosl-tgroup h3 { margin: 0; color: #fff; font-size: 1.35rem; }
.aosl-tgroup p { margin: .2rem 0 1rem; color: var(--amut); }
.aosl-tokens { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.aosl-tokens figure { margin: 0; width: 110px; text-align: center; }
.aosl-tokens img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; object-position: top; border: 2px solid rgba(255,80,140,.5); box-shadow: 0 0 22px -4px rgba(255,40,120,.55); transition: transform .3s, filter .3s; filter: saturate(.9); }
.aosl-tokens figure:hover img { transform: scale(1.08); filter: saturate(1.2) brightness(1.1); }
.aosl-tokens figcaption { margin-top: .5rem; font-size: .8rem; color: var(--amut); line-height: 1.3; }
.aosl-map img { border-radius: 18px; }
.aosl-end { text-align: center; padding: 3rem 1rem; border-radius: 26px; background: radial-gradient(60% 80% at 50% 0%, rgba(240,139,214,.25), transparent 70%), rgba(20,10,32,.7); border: 1px solid rgba(240,139,214,.3); }
.aosl-end h2 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 .5rem; color: #fff; }
.aosl-end p { color: var(--amut); margin: 0 0 1.4rem; font-family: 'Cormorant Garamond', serif; font-size: 1.25rem; }
.aosl-end .aosl-cta { justify-content: center; }

@media (max-width: 1000px) {
  .aosl-conts { grid-template-columns: 1fr; }
  .aosl-cont { flex-direction: row; } .aosl-cont img { width: 40%; aspect-ratio: auto; }
  .aosl-peoples { grid-template-columns: repeat(3, 1fr); }
  .aosl-weavers { grid-template-columns: repeat(3, 1fr); }
  .aosl-places { grid-template-columns: 1fr 1fr; }
  .aosl-time { grid-template-columns: 1fr 1fr; row-gap: 2rem; } .aosl-time::before { display: none; }
}
@media (max-width: 640px) {
  .aosl { gap: 3rem; }
  .aosl-facts { grid-template-columns: repeat(3, 1fr); } .aosl-facts div:nth-child(4) { border-left: 0; }
  .aosl-cont { flex-direction: column; } .aosl-cont img { width: 100%; aspect-ratio: 16/10; }
  .aosl-peoples { grid-template-columns: 1fr 1fr; }
  .aosl-weavers { grid-template-columns: 1fr 1fr; }
  .aosl-places { grid-template-columns: 1fr; } .aosl-places figure.big { grid-column: auto; grid-row: auto; min-height: 320px; }
  .aosl-moons { grid-template-columns: 1fr; }
  .aosl-time { grid-template-columns: 1fr; }
  .aosl-tgroup.two { grid-template-columns: 1fr; }
  .aosl-tokens figure, .aosl-tokens img { width: 86px; } .aosl-tokens img { height: 86px; }
}
@media (prefers-reduced-motion: reduce) { .aosl *, .aosl-hero-in { animation: none !important; transition: none !important; } }
@media (min-width: 1001px) { .aosl-places figure:last-child { grid-column: 1 / -1; min-height: 260px; } .aosl-places figure:last-child img { object-position: center 40%; } }

/* ---------- campaign fight effects */
.f-fx { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; grid-column: 1 / -1; }
.f-fx select { font: inherit; font-size: .8rem; padding: .25rem .5rem; border-radius: 99px; background: rgba(255,255,255,.05); color: inherit; border: 1px dashed rgba(255,255,255,.25); max-width: 9rem; }
.f-fx .f-cond { flex: 1; min-width: 8rem; }
.f-tick { margin: .6rem 0 0; padding: .55rem .8rem; border-radius: 10px; background: color-mix(in srgb, var(--gold) 12%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); font-size: .92rem; animation: aoslRise .4s ease-out; }

/* ---------- species traits */
.sp-card { margin-top: 1rem; padding: .9rem 1rem; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--cyan) 35%, transparent); background: color-mix(in srgb, var(--cyan) 6%, transparent); }
.sp-h { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .4rem; }
.sp-h b { font-size: 1.05rem; }
.sp-card ul { margin: 0 0 .4rem; padding-left: 1.1rem; display: grid; gap: .3rem; }
.sp-pick { display: inline-flex; gap: .4rem; flex-wrap: wrap; margin-left: .4rem; }
.sp-pick select { font: inherit; font-size: .85rem; padding: .2rem .4rem; }
.skname .sp-b { color: var(--cyan); font-style: normal; font-size: .75rem; }
.skbar i.on.sp { background: var(--cyan) !important; opacity: .8; }

/* ---------- campaign: add characters */
.add-pcs { margin-top: 1.2rem; }
.ap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; }
.ap-box { display: flex; flex-direction: column; gap: .45rem; padding: .9rem; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line); min-width: 0; }
.ap-box > small { color: var(--muted, #b8b3c8); line-height: 1.4; }
.ap-box .btn { align-self: flex-start; }
.ap-box .addrow { display: flex; flex-wrap: wrap; gap: .4rem; }
.ap-box .addrow input { flex: 1; min-width: 6rem; }
.ap-ready { display: flex; flex-wrap: wrap; gap: .35rem; }
.ap-ready .chip small { opacity: .7; font-size: .7rem; margin-left: .2rem; }
.hv.hv-add { display: grid; place-items: center; min-width: 130px; border: 1px dashed color-mix(in srgb, var(--gold) 60%, transparent); background: transparent; color: var(--gold); font: inherit; font-weight: 700; cursor: pointer; border-radius: 12px; }
.hv.hv-add:hover { background: color-mix(in srgb, var(--gold) 10%, transparent); }

/* ---- level up + portrait ---- */
.hb-lvup { position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 700 11px/1 var(--body, Inter, sans-serif); letter-spacing: .08em; text-transform: uppercase; padding: 6px 10px; border-radius: 99px; border: 1px solid var(--gold2); background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #1a1205; cursor: pointer; box-shadow: 0 0 14px rgba(243,213,140,.45); z-index: 2; }
.hb-lvup:hover { filter: brightness(1.1); }
.hb-art.own { object-position: 50% 30%; }
.lvup-card { border: 1px solid var(--gold); background: radial-gradient(120% 140% at 0% 0%, rgba(243,213,140,.16), transparent 60%), var(--panel, rgba(255,255,255,.03)); animation: lvIn .6s cubic-bezier(.2,.7,.2,1); }
@keyframes lvIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.lvup-top { display: flex; gap: 16px; align-items: center; position: relative; }
.lvup-top h2 { margin: 2px 0 4px; }
.lvup-top .x { position: absolute; right: 0; top: 0; background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; }
.lvup-badge { flex: none; width: 74px; height: 74px; border-radius: 50%; display: grid; place-content: center; text-align: center; border: 3px solid var(--gold2); box-shadow: 0 0 22px rgba(243,213,140,.5); line-height: 1; }
.lvup-badge small { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.lvup-badge b { font-family: var(--display); font-size: 34px; }
.lvup-list { list-style: none; padding: 0; margin: 14px 0 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.lvup-list li { padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.lvup-list li b { font-family: var(--display); font-size: 20px; color: var(--gold2); }
.lvup-list li span { margin-left: auto; font-size: 12px; padding: 2px 8px; border-radius: 99px; }
.lvup-list .todo { background: rgba(243,213,140,.15); color: var(--gold2); }
.lvup-list .ok { background: rgba(125,255,158,.1); color: #9fe8b0; }
.pf-field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.pf-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-thumb { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; border: 2px solid var(--gold); background: rgba(255,255,255,.05); flex: none; }
.pf-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.pf-up { cursor: pointer; }
.gl { border-bottom: 1px dotted var(--gold); cursor: help; }
.gl:focus { outline: 1px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
.gl-tip { position: fixed; z-index: 90; display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: #14101f; color: #efeaf8; border: 1px solid var(--gold); box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 13px; line-height: 1.45; pointer-events: none; }
.gl-tip b { color: var(--gold2); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.b-add { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; padding: 12px 14px; margin: 14px 0; border-radius: 12px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); }
.b-add > b { flex-basis: 100%; }
.b-add label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.b-add input { width: 70px; }
.b-add-msg { flex-basis: 100%; font-size: 13px; color: #9fe8b0; }
.b-add-msg:empty { display: none; }
.pwp .pw-eff { flex-basis: 100%; margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.pwp .pw-eff { grid-column: 1 / -1; }
/* item browser */
.ib { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--bg2); display: grid; gap: 10px; }
.ib-top { display: flex; gap: 8px; flex-wrap: wrap; }
.ib-top input { flex: 1 1 220px; min-width: 0; }
.ib-top select { width: auto; }
.ib .chips { margin: 0; }
.ib-list { display: grid; gap: 6px; max-height: 460px; overflow-y: auto; padding-right: 4px; }
.ib-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.ib-txt b { display: block; }
.ib-txt small { color: var(--gold2); font-size: 12px; }
.ib-txt p { margin: 2px 0 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
/* play mode compact sections */
.cmp-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
#pane-play[data-compact="1"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 14px; align-items: start; }
#pane-play[data-compact="1"] > :not(.cmp), #pane-play[data-compact="1"] > .big { grid-column: 1 / -1; }
#pane-play[data-compact="1"] > .sblock { margin: 0; }
.sblock.cmp { position: relative; max-height: 230px; overflow: hidden; transition: max-height .35s ease, box-shadow .25s; }
.sblock.cmp::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: linear-gradient(rgba(14,17,31,0), rgba(14,17,31,.97)); border-radius: 0 0 18px 18px; pointer-events: none; transition: opacity .25s; }
.sblock.cmp:hover, .sblock.cmp:focus-within, .sblock.cmp.big { max-height: 4000px; overflow: visible; box-shadow: 0 0 0 1px var(--gold), 0 14px 40px rgba(0,0,0,.45); z-index: 3; }
.sblock.cmp:hover::after, .sblock.cmp:focus-within::after, .sblock.cmp.big::after { opacity: 0; }
.sblock.cmp.big { box-shadow: none; }
.cmp-big { position: absolute; bottom: 10px; right: 12px; z-index: 4; font: 600 11px/1 var(--body, Inter, sans-serif); letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg2); color: var(--muted); cursor: pointer; }
.cmp-big[aria-pressed="true"] { border-color: var(--gold); color: var(--gold2); }
@media (hover: none) { .sblock.cmp:hover:not(:focus-within):not(.big) { max-height: 230px; overflow: hidden; } }
/* ---- Find your hero (quiz) ---- */
.quiz-app { max-width: 1180px; margin: 0 auto; padding-block: 24px 60px; }
.qz-link { border-color: var(--cyan, #4fc3ff); }
.qz-intro { text-align: center; max-width: 62ch; margin: 0 auto 26px; }
.qz-intro h1 { font-family: var(--display); font-size: clamp(2rem, 5vw, 3.4rem); margin: 4px 0 10px; text-wrap: balance; }
.qz-intro p { color: var(--muted); font-size: 17px; }
.qz-worlds { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.qz-world { position: relative; min-height: 440px; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); padding: 0; cursor: pointer; text-align: left; background: #000; color: #fff; isolation: isolate; transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; }
.qz-world img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); z-index: -2; }
.qz-wshade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(5,4,12,.92)); z-index: -1; }
.qz-world:hover, .qz-world:focus-visible { transform: translateY(-6px); box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 0 1px var(--gold); }
.qz-world:hover img { transform: scale(1.08); }
.qz-wtxt { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px; display: grid; gap: 6px; }
.qz-wtxt b { font-family: var(--display); font-size: 30px; }
.qz-wtxt small { font-size: 15px; color: rgba(255,255,255,.82); line-height: 1.45; }
.qz-wtxt em { font-style: normal; font-weight: 700; color: var(--gold2); margin-top: 6px; }
.qz-world.w-earth .qz-wtxt em { color: #ff6b6b; } .qz-world.w-space .qz-wtxt em { color: #6fd3ff; }
.qz-scene, .qz-result { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); border-radius: 24px; overflow: hidden; border: 1px solid var(--line); background: var(--panel, #120f1f); min-height: 560px; animation: qzIn .55s cubic-bezier(.2,.7,.2,1); }
@keyframes qzIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.qz-art, .qz-res-art { position: relative; overflow: hidden; min-height: 320px; }
.qz-art img, .qz-res-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: qzZoom 18s ease-in-out infinite alternate; }
@keyframes qzZoom { from { transform: scale(1.02); } to { transform: scale(1.12) translate(-1.5%, -1%); } }
.qz-artshade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,0) 55%, var(--panel, #120f1f)), linear-gradient(0deg, rgba(0,0,0,.35), transparent 40%); }
.qz-panel { padding: 28px 30px; display: flex; flex-direction: column; gap: 14px; }
.qz-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.qz-prog { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.qz-prog i { display: block; height: 100%; width: var(--prog); background: linear-gradient(90deg, var(--gold), var(--gold2)); transition: width .5s; }
.qz-text { font-size: 19px; line-height: 1.6; margin: 0; }
.qz-ch { display: grid; gap: 10px; margin-top: auto; }
.qz-opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: inherit; font: inherit; font-size: 16px; line-height: 1.45; cursor: pointer; opacity: 0; animation: qzIn .45s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(.15s + var(--d) * .08s); transition: border-color .2s, background .2s, transform .2s; }
.qz-opt span { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; border: 1px solid var(--gold); color: var(--gold2); }
.qz-opt:hover, .qz-opt:focus-visible { border-color: var(--gold); background: rgba(243,213,140,.08); transform: translateX(4px); }
.qz-res-name { position: absolute; left: 26px; bottom: 24px; right: 26px; text-shadow: 0 2px 20px rgba(0,0,0,.8); }
.qz-res-name h2 { font-family: var(--display); font-size: clamp(2rem, 4.5vw, 3.2rem); margin: 2px 0; color: #fff; }
.qz-res-name p { margin: 0; color: rgba(255,255,255,.85); }
.qz-result .qz-artshade { background: linear-gradient(0deg, rgba(5,4,12,.9), transparent 55%); }
.qz-res-body { padding: 28px 30px; display: grid; gap: 18px; align-content: start; }
.qz-res-body h3 { margin: 0 0 6px; font-family: var(--display); }
.qz-res-body p { margin: 0 0 6px; line-height: 1.6; }
.qz-sp { display: flex; gap: 14px; align-items: flex-start; }
.qz-sp img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; border: 2px solid var(--gold); flex: none; }
.qz-sp ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.qz-sp li b { color: var(--fg, #fff); }
.qz-pri { display: flex; gap: 8px; flex-wrap: wrap; }
.qz-pri span { display: grid; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); font-weight: 700; }
.qz-pri small { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.qz-pri .p-primary { border-color: var(--gold); }
.qz-btns { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 820px) {
  .qz-scene, .qz-result { grid-template-columns: minmax(0, 1fr); }
  .qz-art { min-height: 260px; } .qz-res-art { min-height: 340px; }
  .qz-artshade { background: linear-gradient(0deg, var(--panel, #120f1f), transparent 50%); }
  .qz-panel, .qz-res-body { padding: 20px 18px; }
  .qz-world { min-height: 300px; }
}
@media (prefers-reduced-motion: reduce) { .qz-art img, .qz-res-art img { animation: none; } .qz-opt { animation: none; opacity: 1; } }
/* fight: attacks */
.frow .f-act { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.f-pips { display: inline-flex; gap: 4px; }
.f-pips i { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px rgba(243,213,140,.5); }
.f-pips i.used { background: rgba(255,255,255,.12); box-shadow: none; }
.ak { border-color: var(--gold); }
.ak-head { display: flex; justify-content: space-between; align-items: center; }
.ak-head h2 { margin: 0; }
.ak-head .x { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; }
.ak-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.ak-row label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.ak-row select { width: auto; max-width: 100%; }
.ak-res { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.ak-res .d { display: inline-grid; place-items: center; width: 26px; height: 26px; margin: 1px; border-radius: 6px; background: rgba(255,255,255,.06); font-weight: 700; font-size: 13px; }
.ak-res .d.h { background: #1f8a4c; color: #fff; } .ak-res .d.g { background: linear-gradient(180deg, #f6d77e, #c99a2e); color: #1a1205; }
.ak-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.ak-msg { margin: 0; font-size: 15px; }
.f-log { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); display: grid; gap: 2px; }
.fight-top .f-log, .fight-top .f-tick, .fight-top .small-note { grid-column: 1 / -1; }

/* ---- readability polish ---- */
.doc { background: linear-gradient(180deg, rgba(9,9,19,.86), rgba(9,9,19,.78)); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.07); border-radius: 24px; padding: 40px 44px 48px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.prose { font-size: 17px; line-height: 1.72; color: #e9e6f2; }
.prose p, .prose li { max-width: 72ch; }
.prose h2 { margin-top: 2.2em; }
.prose table { font-size: 15px; }
.prose td, .prose th { padding: 10px 14px; }
.prose tbody tr:nth-child(even) td { background: rgba(255,255,255,.025); }
.lede { color: #c9c3d8; }
.sheet-hint { font-size: 16px; line-height: 1.6; color: #cfc9dd; }
.sheet-app[data-world=aos] .sheet-hint { font-size: 18px; }
@media (min-width: 1401px) { .dash.fighting { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, .85fr); } }
.crow .cm:empty { display: none; }
small, .muted { letter-spacing: .005em; }
@media (max-width: 900px) { .doc { padding: 26px 22px 32px; border-radius: 18px; } }
@media (max-width: 520px) {
  .doc { padding: 20px 14px 26px; margin-inline: -4px; }
  .prose { font-size: 16.5px; }
  .sheet-tools { width: 100%; }
  #sh-pick { flex: 1 1 100%; }
}
@media (min-width: 901px) { nav.side { background: rgba(9,9,19,.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.06); border-radius: 20px; padding: 14px 10px; align-self: start; } }
/* ---- Play mode: one-screen layout ---- */
.play-grid { display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(260px, 330px); gap: 14px; align-items: start; }
.pcol { display: grid; gap: 14px; min-width: 0; align-content: start; }
.pcol > .sblock { margin: 0; padding: 16px 18px; gap: 10px; }
.pcol > .sblock > h2, .pcol summary h2 { font-size: 17px; margin: 0; }
.pa .sblock.meters { grid-template-columns: 1fr 1fr; gap: 10px; }
.pa .sblock.meters > :first-child, .pa .sblock.meters .meter.hp, .pa .sblock.meters .meter.dmd { grid-column: 1 / -1; }
.pa .meter { padding: 10px 12px; }
.pa .fx-panel > p.muted { display: none; }
.pa .roll-ctl { gap: 8px; }
.pa .roll-ctl .skillgrid, .pa .roll-ctl [class*="skill-cols"] { gap: 6px 12px; }
.pc .log li { font-size: 13px; padding: 6px 8px; }
.qa { display: grid; gap: 6px; }
.qa-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); color: inherit; font: inherit; font-weight: 600; cursor: pointer; text-align: left; transition: border-color .15s, transform .15s; }
.qa-btn:hover, .qa-btn:focus-visible { border-color: var(--gold); transform: translateX(2px); }
.qa-btn b { flex: none; min-width: 30px; text-align: center; padding: 2px 8px; border-radius: 8px; background: rgba(243,213,140,.14); color: var(--gold2); }
.qa-btn.use b { background: rgba(125,255,158,.12); color: #9fe8b0; }
.inv-sec summary { cursor: pointer; list-style: none; }
.inv-sec summary::-webkit-details-marker { display: none; }
.inv-sec summary h2::after { content: ' ▾'; color: var(--muted); font-size: 13px; }
.inv-sec[open] summary h2::after { content: ' ▴'; }
.inv-sec summary small { font-family: var(--body); font-size: 12px; color: var(--muted); letter-spacing: 0; text-transform: none; margin-left: 6px; }
.pc .inv-sec .inv-sum { grid-template-columns: 1fr; }
.pc .inv-sec .it-top { flex-wrap: wrap; }
/* smaller hero in play mode so the controls fit on one screen */
.sheet-grid.playing ~ * .hero-banner, .sheet-app[data-mode="play"] .hero-banner { min-height: 0; }
.sheet-app[data-mode="play"] .hb-in { padding-block: 16px; gap: 10px; }
.sheet-app[data-mode="play"] .hb-bars, .sheet-app[data-mode="play"] .sheet-hint { display: none; }
@media (max-width: 1180px) { .play-grid { grid-template-columns: minmax(240px, 280px) minmax(0, 1fr); } .pc { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
@media (max-width: 760px) { .play-grid { grid-template-columns: minmax(0, 1fr); } .pc { grid-template-columns: minmax(0, 1fr); } }
.pa .sblock.meters { grid-template-columns: minmax(0, 1fr); }
.pa .rollgrid { gap: 10px; }
.pa .rollgrid h3 { font-size: 12px; margin-bottom: 2px; }
.pa .rollbtn { grid-template-columns: minmax(0, 1fr) auto; padding: 7px 10px; font-size: 14px; min-height: 0; }
.pa .rollbtn .skbar { display: none; }
.pa .rollbtn > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa .rollbtn em, .pa .rollbtn .sp-b { display: none; }
.sheet-app[data-mode="play"] .hb-level { width: 84px; height: 84px; } .sheet-app[data-mode="play"] .hb-level b { font-size: 34px; }
.sheet-app[data-mode="play"] .hb-name h2 { font-size: clamp(26px, 3.2vw, 40px); }
.sheet-app[data-mode="play"] .plate { padding-block: 8px; }
.pa .sblock.meters { gap: 8px; padding: 12px; }
.pa .meter { padding: 10px 12px; gap: 6px; }
.pa .m-top b { font-size: 22px; }
.pa .m-ctl { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.pa .m-ctl button { padding: 6px 0; font-size: 13px; min-height: 0; grid-column: auto !important; }
.pa .pips { gap: 4px; }
.pa .pip { width: 16px; height: 16px; }
.pa .pips.dmd .pip { width: 12px; height: 12px; border-radius: 3px; }
.pa .m-note { font-size: 12px; margin: 0; }
.pa .m-note:empty { display: none; }
@media (max-width: 620px) {
  .sheet-app[data-mode="play"] .hb-crests { display: none; }
  .sheet-app[data-mode="play"] .hb-plates { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .sheet-app[data-mode="play"] .plate { padding: 6px 4px; display: grid; justify-items: center; text-align: center; gap: 0; }
  .sheet-app[data-mode="play"] .plate svg { display: none; }
  .sheet-app[data-mode="play"] .plate small { font-size: 8.5px; letter-spacing: .06em; }
  .sheet-app[data-mode="play"] .plate b { font-size: 15px; }
  .sheet-app[data-mode="play"] .hb-level { width: 64px; height: 64px; } .sheet-app[data-mode="play"] .hb-level b { font-size: 26px; }
  .sheet-app[data-mode="play"] .hb-lvup { font-size: 9px; padding: 4px 7px; bottom: -10px; }
  .pa .rollgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .sheet-app[data-mode="play"] .plate { display: flex !important; flex-direction: column; align-items: center; justify-content: center; }
  .sheet-app[data-mode="play"] .plate > :not(small):not(b) { display: none; }
  .sheet-app[data-mode="play"] .plate b { white-space: nowrap; font-size: 14px; }
  .pa .sblock.meters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pa .sblock.meters .meter { padding: 8px; }
  .pa .sblock.meters .meter:not(.hp) .m-note { display: none; }
  .pa .sblock.meters .meter:not(.hp) .m-top span { font-size: 12px; }
  .pa .sblock.meters .meter:not(.hp) .m-top b { font-size: 18px; }
  .pa .sblock.meters .meter:not(.hp) .pip { width: 12px; height: 12px; }
  .pa .sblock.meters .meter:last-child { grid-column: auto; }
}
@media (max-width: 620px) { .pa .sblock.meters .pips.dmd { gap: 2px; } .pa .sblock.meters .pips.dmd .pip { width: 8px; height: 8px; border-radius: 2px; } }

/* ---- Play mode v2: meters on the character card; skills | powers | quick ---- */
.sheet-app[data-mode="play"] .hb-in { grid-template-areas: "id crests" "plates plates" "live live"; }
.hb-live { grid-area: live; display: grid; gap: 10px; }
.hb-live .meters { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0; background: none; border: 0; }
.hb-live .meter { background: rgba(8,8,18,.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 10px 12px; display: grid; gap: 6px; align-content: start; }
.hb-live .m-top { display: flex; justify-content: space-between; align-items: baseline; }
.hb-live .m-top span { font-family: var(--display); font-size: 15px; }
.hb-live .m-top b { font-size: 22px; }
.hb-live .m-ctl { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.hb-live .m-ctl button { padding: 5px 0; font-size: 13px; min-height: 0; }
.hb-live .pips { gap: 3px; flex-wrap: wrap; }
.hb-live .pip { width: 14px; height: 14px; }
.hb-live .pips.dmd .pip { width: 9px; height: 9px; border-radius: 2px; }
.hb-live .m-note { font-size: 11.5px; margin: 0; color: var(--muted); }
.hb-live .m-note:empty { display: none; }
.hb-live .fx-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; background: rgba(8,8,18,.6); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; }
.hb-live .fx-panel .fx-head { display: flex; align-items: center; gap: 10px; }
.hb-live .fx-panel .fx-head h2 { font-size: 15px; margin: 0; }
.hb-live .fx-panel > p.muted { display: none; }
.hb-live .fx-panel .fx-addbox { margin-left: auto; }
.sheet-app[data-mode="play"] .hb-bars { display: none; }
.play-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(260px, 320px); }
.pa .rollgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.perk-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
@media (max-width: 1180px) { .play-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .pc { grid-column: 1 / -1; } }
@media (max-width: 900px) { .hb-live .meters { grid-template-columns: repeat(3, minmax(0, 1fr)); } .hb-live .meter.hp { grid-column: 1 / -1; } }
@media (max-width: 760px) { .play-grid { grid-template-columns: minmax(0, 1fr); } .sheet-app[data-mode="play"] .hb-in { grid-template-areas: "id" "plates" "live"; } }
@media (max-width: 620px) { .pa .rollgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hb-live .m-note { display: none; } .hb-live .meter.hp .m-note { display: block; } }
.sheet-app .hb-live > .meters { grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); }
.sheet-app .hb-live > .meters > .meter { grid-column: auto; }
@media (max-width: 900px) { .sheet-app .hb-live > .meters { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sheet-app .hb-live > .meters > .meter.hp { grid-column: 1 / -1; } }
.play-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(250px, 300px); }
.pa .roll-ctl > p, .pa .roll-ctl .muted { display: none; }
.pa .rollgrid { gap: 8px; }
.pa .rollgrid > div { gap: 5px; }
.pa .rollbtn { padding: 6px 8px; font-size: 13.5px; gap: 6px; }
.pa .rollbtn b { min-width: 24px; height: 22px; font-size: 13px; }
.pb .pwp { grid-template-columns: minmax(0, 1fr) auto; }
.pb .pwp > div:first-child { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; }
.pb .pwp > div:first-child small { display: inline; }
.pb .pwp select { width: 100%; }
.pb .sblock > p.muted:first-of-type { display: none; } .pb .pwp { padding: 10px 12px; gap: 6px 10px; } .pb .pwp select { padding-block: 6px; }
@media (max-width: 620px) {
  .sheet-app .hb-live > .meters { gap: 6px; }
  .hb-live .meter:not(.hp) { padding: 8px; }
  .hb-live .meter:not(.hp) .m-top { flex-direction: column; align-items: flex-start; gap: 2px; }
  .hb-live .meter:not(.hp) .m-top span { font-family: var(--body); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .hb-live .meter:not(.hp) .m-top b { font-size: 18px; white-space: nowrap; }
  .hb-live .pip { width: 11px; height: 11px; }
  .hb-live .pips.dmd .pip { width: 7px; height: 7px; }
  .hb-live #b-rest { font-size: 12px; }
}
@media (max-width: 1180px) { .play-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } .pc { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
@media (max-width: 760px) { .play-grid { grid-template-columns: minmax(0, 1fr); } .pc { grid-template-columns: minmax(0, 1fr); } }
.pw-name { cursor: help; } .pw-name b { border-bottom: 1px dotted var(--gold); }
.skname .skdesc { display: block; font-size: 12px; line-height: 1.35; color: var(--muted); margin-top: 2px; white-space: normal; }
/* play v3: skills | powers | last rolls, inventory under skills + powers */
.play-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(240px, 290px); grid-template-areas: "sk pw lg" "inv inv lg"; }
.play-grid > .pa { grid-area: sk; } .play-grid > .pb { grid-area: pw; } .play-grid > .pc { grid-area: lg; } .play-grid > .pi { grid-area: inv; }
.pc .log { max-height: 640px; overflow-y: auto; }
.pi .inv-sum { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1180px) { .play-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); grid-template-areas: "sk pw" "inv inv" "lg lg"; } .pc { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .play-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "sk" "pw" "inv" "lg"; } .pi .inv-sum { grid-template-columns: minmax(0, 1fr); } }
/* even columns — powers fills the skills row, last rolls runs to the bottom of inventory */
.play-grid { align-items: stretch; }
.play-grid > .pcol { display: flex; flex-direction: column; gap: 14px; }
.play-grid > .pcol > .sblock { display: flex; flex-direction: column; }
.play-grid > .pb > .sblock:last-child, .play-grid > .pa > .sblock:last-child, .play-grid > .pi > .sblock:last-child { flex: 1 1 auto; }
.play-grid > .pc > .sblock { flex: 1 1 0; min-height: 0; }
.play-grid > .pc .log { flex: 1 1 0; min-height: 160px; max-height: none; overflow-y: auto; margin: 0; }
@media (max-width: 1180px) { .play-grid > .pc > .sblock { flex: 0 0 auto; } .play-grid > .pc .log { flex: 0 0 auto; max-height: 420px; } }
/* rolls stop with skills+powers; inventory spans the whole bottom */
.play-grid { grid-template-areas: "sk pw lg" "inv inv inv"; }
.pi .inv-sum { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1180px) { .play-grid { grid-template-areas: "sk pw" "lg lg" "inv inv"; } }
@media (max-width: 760px) { .play-grid { grid-template-areas: "sk" "pw" "lg" "inv"; } .pi .inv-sum { grid-template-columns: minmax(0, 1fr); } }
/* header icon = the cover's portal, with a moving glowing rim */
.brand .knot { position: relative; width: 46px; height: 46px; border: 0; background: none; box-shadow: none; display: grid; place-items: center; isolation: isolate; }
.brand .knot img { position: relative; z-index: 2; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: block; box-shadow: inset 0 0 0 1px rgba(191,244,255,.5); animation: portalBob 4s ease-in-out infinite; }
.brand .knot::before { content: ''; position: absolute; inset: 0; border-radius: 50%; z-index: 1;
  background: conic-gradient(from 0deg, #7fe3ff, #e9fbff 12%, #1f7fd6 30%, #3fc6ff 48%, #e9fbff 60%, #1f7fd6 78%, #7fe3ff);
  animation: portalSpin 3.2s linear infinite; }
.brand .knot::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; z-index: 0;
  background: radial-gradient(circle, rgba(63,198,255,.55) 40%, rgba(63,198,255,0) 70%);
  animation: portalPulse 2.4s ease-in-out infinite; }
.brand:hover .knot::before { animation-duration: 1.2s; }
.brand:hover .knot::after { animation-duration: 1.1s; }
@keyframes portalSpin { 0%, 100% { transform: scale(1); opacity: .45; } 50% { transform: scale(1.025); opacity: 1; } }
@keyframes portalPulse { 0%, 100% { opacity: .55; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes portalBob { 0%, 100% { filter: brightness(1) saturate(1); } 50% { filter: brightness(1.12) saturate(1.1); } }
@media (prefers-reduced-motion: reduce) { .brand .knot::before, .brand .knot::after, .brand .knot img { animation: none; } }

/* =====================================================================
   v28 TOON THEME — matches the TOFU cover art: night-blue street, cream title,
   glowing cyan portal, chunky ink outlines, bold flat colours, hard drop shadows.
   (Backup of the old gold/space look: site_backups/site_v27_cosmic_gold)
   ===================================================================== */
:root {
  --bg: #19203d; --bg2: #212a4d; --panel: #263160; --panel2: #2f3c72; --line: #0b0f22;
  --ink: #0b0f22; --text: #fbf3dc; --muted: #c3c9e4;
  --gold: #ffcf3f; --gold2: #ffe99a; --cyan: #44dbff; --crimson: #ff5a4e;
  --earth: #f08a2c; --aos: #5ccb6b; --space: #a77ff0;
  --radius: 20px; --pop: 0 6px 0 var(--ink); --pop-sm: 0 4px 0 var(--ink);
  --shadow: 0 6px 0 var(--ink);
  --display: 'Lilita One', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --slab: 'Alfa Slab One', Georgia, serif;
}
body {
  font-weight: 600; background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 50% -8%, rgba(68,219,255,.16), transparent 62%),
    radial-gradient(1.6px 1.6px at 12% 18%, #fff 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 64% 9%, #fffbe0 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 38% 42%, #fff 50%, transparent 52%),
    radial-gradient(1.8px 1.8px at 86% 30%, #fff 50%, transparent 52%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 160' preserveAspectRatio='none'%3E%3Cpath d='M0 160V70h70V40h60v50h40V20h90v60h50V50h70v40h60V10h80v70h40V45h70v35h50V30h90v55h40V60h70V25h80v65h50V55h70v105z' fill='%23111833'/%3E%3Cg fill='%23ffcf3f' opacity='.75'%3E%3Ccircle cx='100' cy='70' r='2.4'/%3E%3Ccircle cx='108' cy='70' r='2.4'/%3E%3Ccircle cx='540' cy='45' r='2.4'/%3E%3Ccircle cx='548' cy='45' r='2.4'/%3E%3Ccircle cx='905' cy='60' r='2.4'/%3E%3Ccircle cx='913' cy='60' r='2.4'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, #141a33 0%, #1a2242 55%, #1f2a4c 100%);
  background-size: auto, 260px 260px, 340px 340px, 420px 420px, 380px 380px, 100% 160px, auto;
  background-repeat: no-repeat, repeat, repeat, repeat, repeat, no-repeat, no-repeat;
  background-position: 0 0, 0 0, 0 0, 0 0, 0 0, bottom center, 0 0;
  background-attachment: fixed;
}
.threads { display: none; }
a { color: var(--cyan); text-decoration-color: rgba(68,219,255,.45); }
a:hover { color: #fff; }
::selection { background: var(--gold); color: var(--ink); }

/* header */
.top { background: #121831; border-bottom: 3px solid var(--ink); box-shadow: 0 4px 0 rgba(11,15,34,.6); }
.top::after { display: none; }
.word { font-family: var(--slab); font-weight: 400; letter-spacing: .06em; font-size: 24px; background: none; color: var(--text); -webkit-text-fill-color: var(--text); text-shadow: 0 3px 0 var(--ink); }
.sub { font-family: var(--body); font-weight: 800; color: var(--text); letter-spacing: .16em; opacity: .85; }
nav.main a { font-weight: 800; font-size: 15px; border: 2.5px solid transparent; }
nav.main a:hover { background: var(--panel); border-color: var(--ink); }
nav.main a.active { background: var(--gold); color: var(--ink); box-shadow: 0 3px 0 var(--ink); border-color: var(--ink); }
.search input, .filters input, .filters select { background: #0f1430; border: 2.5px solid var(--ink); border-radius: 14px; color: var(--text); font-weight: 600; }
.search input:focus, .filters input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(68,219,255,.25); }
.preview-bar { background: var(--crimson); color: var(--ink); font-weight: 800; border-bottom: 3px solid var(--ink); }

/* type */
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .01em; }
h1 { background: none; -webkit-text-fill-color: currentColor; color: var(--text); text-shadow: 0 4px 0 var(--ink); }
.prose { font-weight: 600; }
.prose h2 { color: var(--gold); border-top: 3px dashed rgba(11,15,34,.8); text-shadow: 0 2px 0 var(--ink); }
.prose h3 { color: var(--cyan); }
.prose h3.pname { border-left: 5px solid var(--gold); }
.prose strong, .prose b { color: #fff; font-weight: 800; }

/* panels: chunky ink outline + hard drop shadow */
.doc, .sblock, .card, .hero, .hero-banner, .rp-card, .scard, .who-card, .admonition, .fx-panel, .roller, .step, .qz-world {
  border: 3px solid var(--ink) !important; box-shadow: var(--pop), inset 0 2px 0 rgba(255,255,255,.07) !important;
}
.doc { background: linear-gradient(180deg, #263160, #222b55); -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 26px; }
.sblock { background: linear-gradient(180deg, var(--panel), #232d58); border-radius: 22px; }
.card { background: var(--panel); border-radius: 22px; }
.card:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 10px 0 var(--ink) !important; border-color: var(--ink); }
.card img { border-bottom: 3px solid var(--ink); }
.card h3 { color: var(--gold); text-shadow: 0 2px 0 var(--ink); }
.card p { color: var(--muted); }
.hero { border-radius: 28px; }
.doc-head { border-bottom: 3px dashed rgba(11,15,34,.8); }
.doc-head .hero-art { border: 3px solid var(--ink); box-shadow: var(--pop); border-radius: 20px; }
.sblock > h2, .pcol > .sblock > h2 { color: var(--gold); text-shadow: 0 2px 0 var(--ink); font-family: var(--display); letter-spacing: .02em; text-transform: none; }

/* buttons: chunky, press down on click */
.btn, .chip, .rollbtn, .mode button, .fx-chip, .it-eq, button.small {
  border: 2.5px solid var(--ink) !important; font-weight: 800; font-family: var(--body);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn { background: var(--panel2); color: var(--text); box-shadow: var(--pop-sm); }
.btn:hover { background: #3a488a; color: #fff; transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.btn:active, .rollbtn:active, .chip:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink) !important; }
.btn.primary { background: var(--cyan); background-image: none; animation: none; color: var(--ink); box-shadow: var(--pop-sm), 0 0 18px rgba(68,219,255,.35); }
.btn.primary:hover { background: #7fe7ff; color: var(--ink); filter: none; }
.btn.danger { background: var(--crimson); color: var(--ink); }
.chip { background: var(--bg2); color: var(--text); box-shadow: 0 3px 0 var(--ink); }
.chip[aria-pressed="true"], .chip.on, .chip.active { background: var(--gold); color: var(--ink); }
.chip b { color: var(--gold); }
input, select, textarea { font-family: var(--body); font-weight: 600; }
.sheet-app input, .sheet-app select, .sheet-app textarea, .dash input, .dash select { border: 2.5px solid var(--ink); border-radius: 12px; background: #141a38; color: var(--text); }

/* tables */
.prose table th { background: var(--ink); color: var(--gold); font-family: var(--display); font-weight: 400; letter-spacing: .02em; }
.prose table td { border-color: rgba(11,15,34,.7); }
.prose table tr:nth-child(even) td { background: rgba(255,255,255,.03); }

/* side nav + toc */
nav.side a { font-weight: 700; color: var(--muted); border-left: 0; border: 2.5px solid transparent; }
nav.side a:hover { background: var(--panel); border-color: var(--ink); color: var(--text); }
nav.side a.cur { background: var(--gold); color: var(--ink); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.toc-title { color: var(--gold); font-family: var(--display); font-weight: 400; letter-spacing: .06em; }
.toc ol { border-left: 3px solid var(--ink); }

/* sheet bits */
.rollbtn { background: #1d2550; box-shadow: 0 3px 0 var(--ink); border-radius: 12px; }
.rollbtn:hover { background: #2b3772; }
.sblock .num, .rollbtn .num { background: var(--gold); color: var(--ink); border: 2px solid var(--ink); font-weight: 900; }
.mode button[aria-selected="true"] { background: var(--gold); color: var(--ink); }
.pwp, .it, .meter, .inv-load, .inv-money, .crest, .plate { border: 2.5px solid var(--ink) !important; box-shadow: 0 3px 0 var(--ink); }
.log li { border: 2px solid var(--ink); }
.gl-tip, .sh-tip { background: var(--text); color: var(--ink); border: 3px solid var(--ink); box-shadow: var(--pop-sm); font-weight: 700; border-radius: 14px; }
.gl-tip b, .sh-tip b, .gl-tip strong, .sh-tip strong { color: var(--ink); }
/* more toon coverage */
.filters, .gm-strip, .crow, .frow, .sitem, .ap-box, .cp-pop, .cdlg, .lvup, .ib, .stat, nav.side {
  border: 3px solid var(--ink) !important; box-shadow: var(--pop-sm) !important;
}
nav.side { background: #1c2448 !important; border-radius: 22px; padding: 8px; }
.gm-strip { background: #1c2448 !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
.filters { background: var(--panel) !important; }
.crow { background: var(--panel2) !important; border-radius: 16px !important; border-left-width: 8px !important; }
.crow:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink) !important; }
.side-group { font-family: var(--display); font-weight: 400; letter-spacing: .08em; font-size: 13px; }
.kicker { font-weight: 900; }
.badge { border: 2px solid var(--ink); font-weight: 800; }
/* one family of type everywhere; worlds & classes keep their colours */
h1, h2, h3, .sblock > h2, .fx-head h2, .hb-name h2, .sheet-top h1, .prose h2, .prose h3:not(.pname) { font-family: var(--display) !important; font-weight: 400 !important; text-transform: none !important; }
.lede, .sheet-hint, .hb-name p, .pw-d, .prose p, .it-name small { font-family: var(--body) !important; }
.lede { font-size: 18px; font-weight: 600; }
/* softer skyline so text on top stays clean */
body { background-size: auto, 260px 260px, 340px 340px, 420px 420px, 380px 380px, 100% 110px, auto; }
/* world circles are portals (wobbly glowing ovals like the cover) */
.orb .ptl { position: relative; display: block; width: clamp(96px, 12vw, 146px); aspect-ratio: .84; animation: orbBob 6s ease-in-out infinite; }
.orb.aos .ptl { animation-delay: -2s; } .orb.space .ptl { animation-delay: -4s; }
.orb .ptl img { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; border: 4px solid var(--ink); box-shadow: inset 0 0 0 4px var(--c), 0 0 0 4px var(--c), 0 0 0 8px var(--ink), 0 0 34px 6px var(--c) !important;
  border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%; animation: portalWobble 5s ease-in-out infinite !important; z-index: 2; }
.orb .ptl::before { content: ''; position: absolute; inset: -14px; z-index: 1; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 10%, var(--c) 18%, #fff 22%, transparent 30% 45%, var(--c) 55%, #fff 58%, transparent 66% 80%, var(--c) 90%, transparent);
  -webkit-mask: radial-gradient(closest-side, transparent 78%, #000 80%, #000 96%, transparent 100%); mask: radial-gradient(closest-side, transparent 78%, #000 80%, #000 96%, transparent 100%);
  filter: blur(1px); animation: portalSpin 4s linear infinite; opacity: .95; }
.orb .ptl::after { content: ''; position: absolute; inset: -26px; z-index: 0; border-radius: 50%; background: radial-gradient(closest-side, var(--c), transparent 72%); opacity: .5; animation: portalPulse 2.6s ease-in-out infinite; }
.orb .ptl .sw { position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%; overflow: hidden; animation: portalWobble 5s ease-in-out infinite;
  background: radial-gradient(closest-side, transparent 52%, rgba(11,15,34,.55) 100%); }
.orb .ptl .sw::before { content: ''; position: absolute; inset: -30%; background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.0) 0 14deg, rgba(255,255,255,.22) 18deg, rgba(255,255,255,0) 26deg); mix-blend-mode: screen; animation: portalSpin 9s linear infinite reverse; -webkit-mask: radial-gradient(closest-side, transparent 30%, #000 75%); mask: radial-gradient(closest-side, transparent 30%, #000 75%); }
.orb.earth .ptl { --c: #ff8a3d; } .orb.aos .ptl { --c: #5ce08a; } .orb.space .ptl { --c: #b48cff; }
.orb.aos .ptl::before { animation-duration: 5s; animation-direction: reverse; } .orb.space .ptl::before { animation-duration: 6s; }
.orb:hover .ptl { animation-play-state: paused; transform: scale(1.08); }
.orb:hover .ptl::before { animation-duration: 1.4s; }
.orb span:not(.ptl) { font-family: var(--display); font-weight: 400; font-size: 17px; letter-spacing: .06em; background: var(--c); color: var(--ink); padding: 2px 14px; border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
@keyframes portalWobble { 0%,100% { border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%; } 33% { border-radius: 54% 46% 47% 53% / 47% 54% 46% 53%; } 66% { border-radius: 49% 51% 55% 45% / 55% 47% 53% 45%; } }
@media (prefers-reduced-motion: reduce) { .orb .ptl, .orb .ptl img, .orb .ptl::before, .orb .ptl::after, .orb .ptl .sw, .orb .ptl .sw::before { animation: none !important; } }
/* TOFU pals */
.pals { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.pal { position: absolute; display: block; filter: drop-shadow(0 4px 0 rgba(11,15,34,.55)); }
.pal-rocket { width: 70px; left: -90px; top: 70%; animation: palRocket 22s linear infinite; animation-delay: 3s; }
.pal-ufo { width: 96px; top: 16%; left: -120px; animation: palUfo 46s linear infinite, palHover 3s ease-in-out infinite; animation-delay: 8s, 0s; }
.pal-octo { width: 110px; right: 18px; bottom: -34px; animation: palPeek 7s ease-in-out infinite; transform-origin: 50% 100%; }
.pal-shadow { width: 104px; left: 14px; bottom: -40px; animation: palPeek 9s ease-in-out infinite; animation-delay: -4s; transform-origin: 50% 100%; }
.pal-sit { position: absolute; z-index: 4; pointer-events: none; width: 84px; right: 46px; top: -74px; filter: drop-shadow(0 4px 0 rgba(11,15,34,.6)); animation: palSit 4s ease-in-out infinite; transform-origin: 50% 100%; }
.pal-sit-ufo { width: 110px; top: -70px; animation: palHover 3s ease-in-out infinite; }
.pal-sit-shadow, .pal-sit-octopus { width: 96px; top: -70px; }
.doc, .hero-banner { overflow: visible !important; }
@keyframes palRocket { 0% { transform: translate(0, 0) rotate(0); } 100% { transform: translate(calc(100vw + 200px), -70vh) rotate(8deg); } }
@keyframes palUfo { 0% { left: -120px; } 100% { left: calc(100% + 120px); } }
@keyframes palHover { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes palPeek { 0%, 60%, 100% { transform: translateY(40px); } 70%, 90% { transform: translateY(0) rotate(-4deg); } 80% { transform: translateY(0) rotate(4deg); } }
@keyframes palSit { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-3px); } }
@media (max-width: 900px) { .pal-octo, .pal-shadow { display: none; } .pal-sit { width: 60px; top: -54px; right: 24px; } }
@media (prefers-reduced-motion: reduce) { .pal, .pal-sit { animation: none !important; } .pal-rocket, .pal-ufo { display: none; } }
.pals-front { z-index: 6; }
.wrap { padding-top: 64px; }
.pal-sit { top: -66px; width: 74px; }
/* per-world lil guys */
.pal-fly.pal-rocket { width: 70px; left: -90px; top: 70%; animation: palRocket 22s linear infinite 3s; }
.pal-fly.pal-ufo { width: 96px; top: 16%; left: -120px; animation: palUfo 46s linear infinite 8s, palHover 3s ease-in-out infinite; }
.pal-peekL, .pal-peekR, .pal-peekM { width: 112px; bottom: -36px; transform-origin: 50% 100%; animation: palPeek 8s ease-in-out infinite; }
.pal-peekL { left: 16px; animation-delay: -4s; } .pal-peekR { right: 16px; } .pal-peekM { left: 46%; width: 96px; animation-delay: -6s; animation-duration: 11s; }
.pal-peekR.pal-octopus, .pal-peekR.pal-beast, .pal-peekL.pal-shadow { width: 104px; }
.pal-beast { width: 140px !important; }
.pal-sit { width: 80px; top: -76px; }
.pal-sit.pal-weaver { width: 88px; } .pal-sit.pal-knight { width: 84px; }
@media (max-width: 900px) { .pal-peekL, .pal-peekR, .pal-peekM { display: none; } }
/* cameo pals */
.pals .pal { position: absolute; left: auto; top: auto; animation: none; will-change: transform; }
.pal-fx { position: absolute; pointer-events: none; z-index: 7; filter: drop-shadow(0 3px 0 rgba(11,15,34,.5)); }
.pal-fx svg { display: block; width: 100%; height: auto; }
.pal-laser { position: absolute; width: 26px; height: 5px; border-radius: 4px; border: 1.5px solid #0b0f22; transform-origin: 0 50%; box-shadow: 0 0 10px currentColor; }
/* ============ v33 PHONE-FRIENDLY (small screens only; desktop unchanged) ============ */
.srch-btn { display: none; }
@media (max-width: 860px) {
  .preview-bar { font-size: 11.5px; padding: 3px 10px; }
  .top { flex-wrap: wrap; gap: 8px; padding: 8px max(14px, env(safe-area-inset-right, 0px)) 8px max(14px, env(safe-area-inset-left, 0px)); }
  .brand .sub { display: none; }
  .brand .knot { width: 40px; height: 40px; } .brand .knot img { width: 34px; height: 34px; }
  .word { font-size: 21px; }
  .srch-btn { display: grid; place-items: center; margin-left: auto; width: 44px; height: 44px; border-radius: 14px; background: var(--panel2); color: var(--text); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
  .menu-btn { margin-left: 0; min-height: 44px; padding: 8px 16px; border: 2.5px solid var(--ink); border-radius: 14px; font-weight: 800; box-shadow: 0 3px 0 var(--ink); }
  .top .search { display: none; }
  .top.search-open .search { display: block; }
  nav.main.open { max-height: calc(100vh - 120px); overflow: auto; padding-bottom: 8px; }
  .wrap { padding-top: 22px; }
  .pal-sit { display: none; }
  .doc { padding: 22px 18px 28px; }
  .prose { font-size: 16.5px; }
  .prose table { font-size: 14px; }
  nav.side { padding: 6px; border-radius: 18px; }
  nav.side a { padding: 9px 14px; }
  .btn { min-height: 44px; }
  .chip { min-height: 38px; }
}
@media (max-width: 760px) {
  /* character sheet: compact top, docked quick bar */
  .sheet-top .kicker, .sheet-top h1, .sheet-hint { display: none !important; }
  .sheet-top { gap: 10px !important; padding-top: 0 !important; }
  .sheet-tools { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; gap: 8px; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .sheet-tools > * { flex: 0 0 auto; }
  .sheet-tools select { min-width: 200px; }
  body.has-dock { padding-bottom: calc(118px + env(safe-area-inset-bottom, 0px)); }
  body.has-dock .pals-front { display: none; }
  .m-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; gap: 6px; padding: 8px max(10px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
    background: #121831; border-top: 3px solid var(--ink); box-shadow: 0 -4px 0 rgba(11,15,34,.6); }
  .md-hp { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 48px 48px; align-items: center; gap: 8px; }
  .md-hp b { font-family: var(--display); font-weight: 400; font-size: 16px; max-width: 32vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .md-bar { height: 12px; border-radius: 999px; background: #0b0f22; border: 2px solid var(--ink); overflow: hidden; } .md-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff5a4e, #ff9a6b); }
  .md-num { font-weight: 900; font-size: 15px; }
  .md-hp button { height: 38px; border-radius: 12px; border: 2.5px solid var(--ink); background: var(--panel2); color: var(--text); font: 900 16px var(--body); box-shadow: 0 3px 0 var(--ink); }
  .md-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .md-tabs button { display: grid; justify-items: center; gap: 1px; padding: 6px 2px; min-height: 50px; border-radius: 12px; border: 2.5px solid var(--ink); background: var(--panel); color: var(--text); font: 800 11.5px var(--body); box-shadow: 0 3px 0 var(--ink); }
  .md-tabs button span { font-size: 18px; line-height: 1.1; }
  .md-tabs button:active, .md-hp button:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
  /* play sheet: last rolls right under skills so a roll result is visible, bigger roll buttons */
  .play-grid { grid-template-areas: "sk" "lg" "pw" "inv" !important; }
  .pc .log { max-height: 260px !important; min-height: 0 !important; }
  .play-grid > .pc > .sblock, .play-grid > .pc .log { flex: 0 0 auto !important; }
  .pa .rollbtn { min-height: 44px; }
  .hb-live .m-ctl button, .meter .m-ctl button { min-height: 42px; }
  .it-top { flex-wrap: wrap; }
  /* campaign / GM */
  .gm-strip { position: static !important; }
}
@media (min-width: 761px) { .m-dock { display: none !important; } }
@media (max-width: 760px) {
  .sheet-app { grid-template-columns: minmax(0, 1fr) !important; max-width: 100%; }
  .sheet-app > *, #sh-grid > *, .sheet-top > * { min-width: 0; max-width: 100%; }
  .sheet-tools { flex-wrap: wrap !important; overflow: visible; }
  .sheet-tools select { flex: 1 1 100%; min-width: 0; }
  .sheet-tools .btn.small { padding: 8px 12px; font-size: 13.5px; min-height: 40px; }
  .sheet-tools .mode { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .m-dock { width: 100%; box-sizing: border-box; }
}
@media (max-width: 760px) { body.has-dock .toast { bottom: calc(132px + env(safe-area-inset-bottom, 0px)) !important; } }
@media (max-width: 760px) {
  .pa .rollgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
  .pa .rollgrid > * { min-width: 0; }
  .pa .rollbtn { display: grid !important; grid-template-columns: minmax(0, 1fr) auto !important; gap: 6px; padding: 8px 8px 8px 10px !important; width: 100%; }
  .pa .rollbtn > b, .pa .rollbtn .num { position: static !important; flex: none; }
}
@media (max-width: 380px) { .pa .rollgrid { grid-template-columns: minmax(0, 1fr) !important; } }

/* Ko-fi donate */
.kofi-top{display:none;align-items:center;gap:6px;padding:8px 14px;border-radius:999px;background:#ff5e5b;color:#fff;font-family:var(--display),system-ui,sans-serif;text-decoration:none;border:3px solid var(--ink);box-shadow:0 4px 0 var(--ink);white-space:nowrap;margin-left:auto}
.kofi-top:hover{transform:translateY(-2px)}
@media (min-width:1100px){.kofi-top{display:inline-flex}}
.foot{display:grid;justify-items:center;gap:10px}
.kofi-btn{display:inline-flex;align-items:center;gap:12px;padding:12px 22px;border-radius:18px;background:#ff5e5b;color:#fff;text-decoration:none;border:3px solid var(--ink);box-shadow:0 6px 0 var(--ink);text-align:left;min-height:44px}
.kofi-btn .cup{font-size:30px;display:inline-block;animation:portalBob 3s ease-in-out infinite}
.kofi-btn b{display:block;font-family:var(--display),system-ui,sans-serif;font-weight:400;font-size:19px}
.kofi-btn small{display:block;opacity:.9;font-size:13px}
.kofi-btn:hover{transform:translateY(-2px)}
@media (prefers-reduced-motion:reduce){.kofi-btn .cup{animation:none}}

/* ================= v35 BETTER DICE ================= */
.d, .die { position: relative; isolation: isolate; font-family: var(--display), system-ui, sans-serif; font-weight: 400; color: var(--text);
  background: linear-gradient(180deg, #3a4785, #27315f); border: 2.5px solid var(--ink); border-radius: 9px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.18), inset 0 -3px 0 rgba(0,0,0,.25), 0 3px 0 var(--ink); text-shadow: 0 2px 0 var(--ink); }
.d { min-width: 26px; height: 26px; font-size: 15px; margin: 1px 2px; }
.die { font-size: 22px; border-radius: 12px; border-width: 3px; box-shadow: inset 0 3px 0 rgba(255,255,255,.18), inset 0 -4px 0 rgba(0,0,0,.25), 0 4px 0 var(--ink); }
.d.h, .die.hit { color: #fff; background: linear-gradient(180deg, #6ef08f, #1fb653); border-color: var(--ink); }
/* Cosmic Crit: every die gold */
.d.g, .d.g.c, .dice .die.gold, .die.gold.cos { color: #2a1d02; text-shadow: 0 1px 0 #fff3c9; border-color: var(--ink); background: radial-gradient(circle at 35% 30%, #fff8dc, #ffd96a 45%, #f0a91c); box-shadow: 0 3px 0 var(--ink), 0 0 16px rgba(255,207,63,.9); }
.d.g::before, .die.gold::before { content: ''; position: absolute; inset: -3px; border-radius: inherit; z-index: -1; background: conic-gradient(#fff3c9, #ffcf3f, #fff, #ffcf3f, #fff3c9); filter: blur(5px); opacity: .7; animation: nebulaSpin 2.5s linear infinite; }
/* EARTH BLOOD v35 */
.d.bloody::after, .die.bloody::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; animation: smearIn .25s ease-out var(--dl, 0ms) forwards;
  background: radial-gradient(ellipse 34% 26% at var(--bx, 70%) var(--by, 70%), rgba(160,8,20,.92) 0 60%, transparent 62%), radial-gradient(circle at calc(100% - var(--bx, 30%)) 18%, rgba(140,8,18,.8) 0 9%, transparent 11%), linear-gradient(170deg, transparent 55%, rgba(120,6,16,.55) 56% 64%, transparent 66%); }
@keyframes smearIn { to { opacity: 1; } }
.rfx-earth .splat2 { position: absolute; transform: translate(-50%, -50%) rotate(var(--r)) scale(0); overflow: visible; filter: drop-shadow(0 1px 0 rgba(0,0,0,.4)); animation: rfxSplat .3s cubic-bezier(.2,1.7,.4,1) var(--dl, 0ms) forwards; z-index: -1; }
.rfx-earth .drop { position: absolute; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 35% 30%, #ff6b6b, #a50d18 55%, #5a040b); box-shadow: 0 0 2px rgba(0,0,0,.4); }
.rfx-earth .drip2 { position: absolute; width: var(--w, 3px); height: 0; transform: translateX(-50%); border-radius: 0 0 4px 4px; background: linear-gradient(#b3101c, #7a0812); animation: rfxDrip 2.2s cubic-bezier(.5,0,.8,.6) var(--dl) forwards; }
.rfx-earth .drip2::after { content: ''; position: absolute; left: 50%; bottom: -3px; width: calc(var(--w, 3px) * 2); height: calc(var(--w, 3px) * 2.2); transform: translateX(-50%); border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%; background: radial-gradient(circle at 35% 35%, #e0303c, #7a0812); }
.rfx-earth .splat, .rfx-earth .drip { display: none; }
.blood-vig { position: fixed; inset: 0; z-index: 59; pointer-events: none; animation: bloodVig 1.4s ease-out forwards;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(140,0,12,.55) 85%, rgba(90,0,8,.85)); }
@keyframes bloodVig { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
.toast { overflow: visible; }
@media (prefers-reduced-motion: reduce) { .d.g::before, .die.gold::before { animation: none !important; } }
/* blood and stains sit BEHIND the dice so numbers stay readable; drops still fly over */
.d, .die { z-index: 2; }
.rfx { z-index: 1; }
.rfx-earth .drop { z-index: 3; }
.d.bloody::after, .die.bloody::after { z-index: -1; }
.toast .d { min-width: 34px; height: 34px; font-size: 19px; border-radius: 10px; margin: 2px 3px; vertical-align: middle; }
/* glow ring via box-shadow (a ::before layer was covering the dice face) */
.d.c::before, .die.cos::before, .d.g::before, .die.gold::before { content: none; }
.dice .die.gold.cos { animation-name: tumble, goldPulse; animation-duration: .55s, 1.6s; animation-iteration-count: 1, 2; }

/* cosmic dice back to the plain look with a cyan ring */
.d.c { box-shadow: inset 0 2px 0 rgba(255,255,255,.18), inset 0 -3px 0 rgba(0,0,0,.25), 0 3px 0 var(--ink), 0 0 0 2px var(--cyan); }
.die.cos { box-shadow: inset 0 3px 0 rgba(255,255,255,.18), inset 0 -4px 0 rgba(0,0,0,.25), 0 4px 0 var(--ink), 0 0 0 2.5px var(--cyan); }
/* Earth: drips only. Blood runs from the top of each die down its face, then drips off the bottom. */
.d.bloody::after, .die.bloody::after { opacity: 1; animation: faceRun 1s ease-in var(--dl, 0ms) both;
  background:
    linear-gradient(180deg, #a50d18 0 14%, transparent 15%),
    radial-gradient(ellipse 9% 26% at calc(var(--bx, 30%) - 20%) 30%, #a50d18 0 60%, transparent 64%),
    radial-gradient(ellipse 7% 40% at var(--bx, 60%) 40%, #8e0a15 0 60%, transparent 64%),
    radial-gradient(ellipse 6% 18% at calc(var(--bx, 50%) + 22%) 22%, #a50d18 0 60%, transparent 64%);
  -webkit-mask: linear-gradient(#000, #000); clip-path: inset(0 0 100% 0); }
@keyframes faceRun { to { clip-path: inset(0 0 0 0); } }
.rfx-earth .drip2 { animation-duration: 2.6s; }

/* D10 DICE (ten-sided shape, not d6). Shape is an SVG background; glows use drop-shadow so nothing is square. */
.d, .die, .toast .d { background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%2327315f%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%225%22%20stroke-linejoin%3D%22round%22/%3E%3Cpolygon%20points%3D%2250%2C4%2076%2C56%2050%2C76%2024%2C56%22%20fill%3D%22%234a59a3%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%223.5%22%20stroke-linejoin%3D%22round%22/%3E%3Cpath%20d%3D%22M76%2056%2096%2050M76%2056%2084%2086M24%2056%204%2050M24%2056%2016%2086M50%2076%2050%20106%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%223.5%22%20stroke-linecap%3D%22round%22/%3E%3Cpath%20d%3D%22M50%2012%2066%2052%22%20stroke%3D%22%23fff%22%20stroke-opacity%3D%22.28%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E") center/100% 100% no-repeat !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  filter: drop-shadow(0 3px 0 #0b0f22); color: #fbf3dc; padding-bottom: 14%; line-height: 1; }
.d { min-width: 30px; width: 30px; height: 33px; font-size: 14px; margin: 0 1px; }
.toast .d { min-width: 38px; width: 38px; height: 42px; font-size: 17px; }
.die { width: 46px; height: 51px; font-size: 19px; }
.roller.mini .die { width: 32px; height: 35px; font-size: 13px; }
.d.h, .die.hit { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%231aa64b%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%225%22%20stroke-linejoin%3D%22round%22/%3E%3Cpolygon%20points%3D%2250%2C4%2076%2C56%2050%2C76%2024%2C56%22%20fill%3D%22%237cf59b%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%223.5%22%20stroke-linejoin%3D%22round%22/%3E%3Cpath%20d%3D%22M76%2056%2096%2050M76%2056%2084%2086M24%2056%204%2050M24%2056%2016%2086M50%2076%2050%20106%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%223.5%22%20stroke-linecap%3D%22round%22/%3E%3Cpath%20d%3D%22M50%2012%2066%2052%22%20stroke%3D%22%23fff%22%20stroke-opacity%3D%22.28%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E") !important; color: #fff; filter: drop-shadow(0 3px 0 #0b0f22) drop-shadow(0 0 6px rgba(63,224,122,.6)); }
.d.c, .die.cos { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%2327315f%22%20stroke%3D%22%2344dbff%22%20stroke-width%3D%226%22%20stroke-linejoin%3D%22round%22/%3E%3Cpolygon%20points%3D%2250%2C4%2076%2C56%2050%2C76%2024%2C56%22%20fill%3D%22%234a59a3%22%20stroke%3D%22%2344dbff%22%20stroke-width%3D%223.5%22%20stroke-linejoin%3D%22round%22/%3E%3Cpath%20d%3D%22M76%2056%2096%2050M76%2056%2084%2086M24%2056%204%2050M24%2056%2016%2086M50%2076%2050%20106%22%20stroke%3D%22%2344dbff%22%20stroke-width%3D%223.5%22%20stroke-linecap%3D%22round%22/%3E%3Cpath%20d%3D%22M50%2012%2066%2052%22%20stroke%3D%22%23fff%22%20stroke-opacity%3D%22.28%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E") !important; }
.d.c.h, .die.cos.hit { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%231aa64b%22%20stroke%3D%22%2344dbff%22%20stroke-width%3D%226%22%20stroke-linejoin%3D%22round%22/%3E%3Cpolygon%20points%3D%2250%2C4%2076%2C56%2050%2C76%2024%2C56%22%20fill%3D%22%237cf59b%22%20stroke%3D%22%2344dbff%22%20stroke-width%3D%223.5%22%20stroke-linejoin%3D%22round%22/%3E%3Cpath%20d%3D%22M76%2056%2096%2050M76%2056%2084%2086M24%2056%204%2050M24%2056%2016%2086M50%2076%2050%20106%22%20stroke%3D%22%2344dbff%22%20stroke-width%3D%223.5%22%20stroke-linecap%3D%22round%22/%3E%3Cpath%20d%3D%22M50%2012%2066%2052%22%20stroke%3D%22%23fff%22%20stroke-opacity%3D%22.28%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E") !important; }
.d.g, .d.g.c, .dice .die.gold, .die.gold.cos { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%23f0a91c%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%225%22%20stroke-linejoin%3D%22round%22/%3E%3Cpolygon%20points%3D%2250%2C4%2076%2C56%2050%2C76%2024%2C56%22%20fill%3D%22%23fff3b0%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%223.5%22%20stroke-linejoin%3D%22round%22/%3E%3Cpath%20d%3D%22M76%2056%2096%2050M76%2056%2084%2086M24%2056%204%2050M24%2056%2016%2086M50%2076%2050%20106%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%223.5%22%20stroke-linecap%3D%22round%22/%3E%3Cpath%20d%3D%22M50%2012%2066%2052%22%20stroke%3D%22%23fff%22%20stroke-opacity%3D%22.28%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E") !important; color: #2a1d02; text-shadow: 0 1px 0 #fff3c9; filter: drop-shadow(0 3px 0 #0b0f22) drop-shadow(0 0 10px rgba(255,207,63,.9)); }
.d.bloody::after, .die.bloody::after { clip-path: polygon(50% 3.6%, 96% 45.5%, 84% 78%, 50% 96.4%, 16% 78%, 4% 45.5%) !important; transform-origin: top; animation: faceRun2 1s ease-in var(--dl, 0ms) both !important; }
@keyframes faceRun2 { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.d, .die, .toast .d { display: inline-grid !important; place-items: center !important; box-sizing: border-box !important; padding: 0 0 20% 0 !important; text-shadow: -1.5px 0 0 #0b0f22, 1.5px 0 0 #0b0f22, 0 -1.5px 0 #0b0f22, 0 2px 0 #0b0f22 !important; }
.d.g, .die.gold { text-shadow: 0 1px 0 #fff3c9 !important; }
.d { padding: 0 0 7px 0 !important; } .toast .d { padding: 0 0 9px 0 !important; } .die { padding: 0 0 11px 0 !important; } .roller.mini .die { padding: 0 0 7px 0 !important; }

/* ================= v38 BREAK TEST pop-up ================= */
body.bt-open { overflow: hidden; }
.bt-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: radial-gradient(ellipse at center, rgba(25,8,20,.82), rgba(5,2,8,.95)); animation: btFade .3s ease-out; }
.bt-modal.out { animation: btFade .3s ease-in reverse forwards; }
@keyframes btFade { from { opacity: 0; } }
.bt-cracks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.bt-cracks path { fill: none; stroke: rgba(255,255,255,.55); stroke-width: .35; vector-effect: non-scaling-stroke; stroke-dasharray: 100; stroke-dashoffset: 100; animation: btCrack .5s ease-out calc(.15s + var(--k) * 40ms) forwards; filter: drop-shadow(0 0 2px rgba(255,90,78,.8)); }
.bt-cracks path { stroke-width: 2px; }
@keyframes btCrack { to { stroke-dashoffset: 0; } }
.bt-card { position: relative; width: min(440px, 100%); text-align: center; padding: 26px 22px 22px; border-radius: 22px; background: var(--panel, #263160); border: 3px solid var(--ink, #0b0f22); box-shadow: 0 8px 0 var(--ink, #0b0f22), 0 0 60px rgba(255,90,78,.35);
  animation: btPop .55s cubic-bezier(.2,1.5,.4,1) both, btGlow 1.1s ease-in-out .6s infinite; }
@keyframes btPop { from { transform: scale(.4) rotate(-6deg); opacity: 0; } }
@keyframes btGlow { 0%, 100% { box-shadow: 0 8px 0 var(--ink, #0b0f22), 0 0 50px rgba(255,90,78,.3); } 15% { box-shadow: 0 8px 0 var(--ink, #0b0f22), 0 0 80px rgba(255,90,78,.65); } 30% { box-shadow: 0 8px 0 var(--ink, #0b0f22), 0 0 50px rgba(255,90,78,.3); } 45% { box-shadow: 0 8px 0 var(--ink, #0b0f22), 0 0 70px rgba(255,90,78,.55); } }
.bt-modal.is-break .bt-card, .bt-modal.is-snap .bt-card { animation: none; }
.bt-kick { margin: 0; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted, #b9bfdc); font-weight: 800; }
.bt-title { margin: 6px 0 4px; font-family: var(--display, 'Lilita One'), system-ui, sans-serif; font-weight: 400; font-size: clamp(40px, 11vw, 60px); line-height: 1; color: #ff5a4e; text-shadow: 0 5px 0 var(--ink, #0b0f22); letter-spacing: .04em; }
.bt-title span { display: inline-block; animation: btShake .5s ease-in-out .2s 2; }
.bt-title span + span { animation-delay: .3s; color: var(--text, #fbf3dc); }
@keyframes btShake { 0%, 100% { transform: none; } 20% { transform: translate(-3px, 1px) rotate(-3deg); } 40% { transform: translate(3px, -1px) rotate(2deg); } 60% { transform: translate(-2px, 0) rotate(-1deg); } 80% { transform: translate(2px, 1px); } }
.bt-sub { margin: 0 auto 14px; max-width: 32ch; color: var(--text, #fbf3dc); opacity: .85; }
.bt-stage { display: grid; place-items: center; height: 120px; }
.bt-modal .bt-die { width: 92px !important; min-width: 92px; height: 101px !important; font-size: 40px !important; padding: 0 0 20px 0 !important; filter: drop-shadow(0 5px 0 #0b0f22); }
.bt-die.spin { animation: btSpin .18s linear infinite; }
@keyframes btSpin { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(.9); } 100% { transform: rotate(360deg) scale(1); } }
.bt-die.bt-bad { filter: drop-shadow(0 5px 0 #0b0f22) drop-shadow(0 0 14px rgba(255,60,60,.9)) hue-rotate(115deg) saturate(1.6); }
.bt-table { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; font-size: 14px; }
.bt-table span { padding: 8px; border-radius: 12px; background: rgba(0,0,0,.25); border: 2px solid transparent; transition: .3s; }
.bt-table b { display: block; font-family: var(--display, 'Lilita One'), system-ui, sans-serif; font-weight: 400; font-size: 18px; }
.bt-table .bad b { color: #ff7a6e; } .bt-table .good b { color: #6ef08f; }
.bt-table span.on { transform: scale(1.06); border-color: currentColor; background: rgba(255,255,255,.08); }
.bt-table .bad.on { color: #ff9b91; } .bt-table .good.on { color: #a6ffbf; }
.bt-res { min-height: 0; }
.bt-res b { display: block; font-family: var(--display, 'Lilita One'), system-ui, sans-serif; font-weight: 400; font-size: 34px; text-shadow: 0 4px 0 var(--ink, #0b0f22); animation: btPop .45s cubic-bezier(.2,1.6,.4,1) both; }
.bt-res span { display: block; margin-top: 4px; color: var(--text, #fbf3dc); }
.is-break .bt-res b { color: #ff5a4e; } .is-snap .bt-res b { color: #ffcf3f; }
.bt-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.bt-btns .btn { min-height: 44px; }
.bt-modal.is-break .bt-cracks { animation: btQuake .5s ease-in-out; }
@keyframes btQuake { 0%, 100% { transform: none; } 15% { transform: translate(-8px, 3px); } 30% { transform: translate(7px, -4px); } 45% { transform: translate(-5px, 2px); } 60% { transform: translate(4px, -1px); } 80% { transform: translate(-2px, 1px); } }
.bt-modal.is-break .bt-cracks path { stroke: rgba(255,90,78,.9); stroke-width: 3px; }
.bt-modal.is-snap::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at center, rgba(255,215,90,.55), transparent 55%); animation: btFlashY .9s ease-out forwards; }
@keyframes btFlashY { from { opacity: 1; transform: scale(.4); } to { opacity: 0; transform: scale(1.6); } }
.bt-modal.is-snap .bt-cracks path { stroke: rgba(255,215,90,.8); }
@media (prefers-reduced-motion: reduce) { .bt-modal *, .bt-modal, .bt-modal::after { animation: none !important; } .bt-cracks path { stroke-dashoffset: 0; } }

/* CLEAR D10: flat d10, grey = fail, green = success, big dark numbers. Cosmic first two = white outline. */
.d, .die, .toast .d { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%23b4b8c6%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%225%22%20stroke-linejoin%3D%22round%22/%3E%3Cpolygon%20points%3D%2250%2C6%2080%2C54%2050%2C80%2020%2C54%22%20fill%3D%22%23e3e5ec%22/%3E%3Cpath%20d%3D%22M80%2054%2094%2050M80%2054%2084%2084M20%2054%206%2050M20%2054%2016%2084M50%2080%2050%20104%22%20stroke%3D%22%230b0f22%22%20stroke-opacity%3D%22.35%22%20stroke-width%3D%222.5%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E") !important; color: #0b0f22 !important; text-shadow: none !important; font-family: var(--display), system-ui, sans-serif; filter: drop-shadow(0 2px 0 #0b0f22) !important; }
.d.h, .die.hit { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%233ccf68%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%225%22%20stroke-linejoin%3D%22round%22/%3E%3Cpolygon%20points%3D%2250%2C6%2080%2C54%2050%2C80%2020%2C54%22%20fill%3D%22%238af2a5%22/%3E%3Cpath%20d%3D%22M80%2054%2094%2050M80%2054%2084%2084M20%2054%206%2050M20%2054%2016%2084M50%2080%2050%20104%22%20stroke%3D%22%230b0f22%22%20stroke-opacity%3D%22.35%22%20stroke-width%3D%222.5%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E") !important; color: #062b12 !important; filter: drop-shadow(0 2px 0 #0b0f22) drop-shadow(0 0 6px rgba(63,224,122,.55)) !important; }
.d.c, .die.cos { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%23b4b8c6%22%20stroke%3D%22%23ffffff%22%20stroke-width%3D%227%22%20stroke-linejoin%3D%22round%22/%3E%3Cpolygon%20points%3D%2250%2C6%2080%2C54%2050%2C80%2020%2C54%22%20fill%3D%22%23e3e5ec%22/%3E%3Cpath%20d%3D%22M80%2054%2094%2050M80%2054%2084%2084M20%2054%206%2050M20%2054%2016%2084M50%2080%2050%20104%22%20stroke%3D%22%230b0f22%22%20stroke-opacity%3D%22.35%22%20stroke-width%3D%222.5%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E") !important; }
.d.c.h, .die.cos.hit { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%233ccf68%22%20stroke%3D%22%23ffffff%22%20stroke-width%3D%227%22%20stroke-linejoin%3D%22round%22/%3E%3Cpolygon%20points%3D%2250%2C6%2080%2C54%2050%2C80%2020%2C54%22%20fill%3D%22%238af2a5%22/%3E%3Cpath%20d%3D%22M80%2054%2094%2050M80%2054%2084%2084M20%2054%206%2050M20%2054%2016%2084M50%2080%2050%20104%22%20stroke%3D%22%230b0f22%22%20stroke-opacity%3D%22.35%22%20stroke-width%3D%222.5%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E") !important; }
.d.g, .d.g.c, .dice .die.gold, .die.gold.cos { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%23f2b52e%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%225%22%20stroke-linejoin%3D%22round%22/%3E%3Cpolygon%20points%3D%2250%2C6%2080%2C54%2050%2C80%2020%2C54%22%20fill%3D%22%23fff3b0%22/%3E%3Cpath%20d%3D%22M80%2054%2094%2050M80%2054%2084%2084M20%2054%206%2050M20%2054%2016%2084M50%2080%2050%20104%22%20stroke%3D%22%230b0f22%22%20stroke-opacity%3D%22.35%22%20stroke-width%3D%222.5%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E") !important; color: #2a1d02 !important; filter: drop-shadow(0 2px 0 #0b0f22) drop-shadow(0 0 10px rgba(255,207,63,.9)) !important; }
.d { min-width: 34px; width: 34px; height: 37px; font-size: 18px; padding: 0 0 7px 0 !important; }
.toast .d { min-width: 42px; width: 42px; height: 46px; font-size: 22px; padding: 0 0 9px 0 !important; }
.die { width: 52px; height: 57px; font-size: 26px; padding: 0 0 11px 0 !important; }
.roller.mini .die { width: 36px; height: 40px; font-size: 18px; padding: 0 0 8px 0 !important; }
.bt-modal .bt-die { font-size: 46px !important; }
/* Earth blood keeps off the number: a rim at the top and runs down the edges */
.d.bloody::after, .die.bloody::after { background:
  linear-gradient(180deg, #a50d18 0 9%, transparent 10%),
  radial-gradient(ellipse 7% 30% at 22% 42%, #a50d18 0 60%, transparent 64%),
  radial-gradient(ellipse 6% 22% at 79% 36%, #8e0a15 0 60%, transparent 64%),
  radial-gradient(ellipse 5% 14% at 70% 20%, #a50d18 0 60%, transparent 64%) !important; }
/* thicker, longer Earth drips with a pooled drop */
.rfx-earth .drip2 { background: linear-gradient(90deg, #7a0812, #c8141f 45%, #8e0a15); box-shadow: inset 1px 0 0 rgba(255,140,140,.35); }

/* ================= v38 COSMIC CRIT per world ================= */
/* Earth: blood moon + the screen bleeds */
.cf-earth .cf-dark { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(60,0,6,.55), rgba(5,0,2,.85)); animation: cfDark 3.2s ease forwards; }
@keyframes cfDark { 0% { opacity: 0; } 12% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
.cf-earth .cf-moon { position: absolute; left: 50%; top: 30%; width: min(46vmin, 360px); aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, 40%) scale(.6); opacity: 0;
  background: radial-gradient(circle at 38% 35%, #ff8a6e, #c81e1e 45%, #6a0a0a 80%); box-shadow: 0 0 60px 20px rgba(200,20,20,.55), 0 0 160px 60px rgba(120,0,0,.45);
  animation: cfMoon 3.2s cubic-bezier(.2,.8,.3,1) forwards; }
.cf-earth .cf-moon::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 30% 60%, rgba(80,0,0,.45) 0 10%, transparent 12%), radial-gradient(circle at 65% 40%, rgba(80,0,0,.35) 0 8%, transparent 10%), radial-gradient(circle at 55% 75%, rgba(80,0,0,.3) 0 6%, transparent 8%); }
@keyframes cfMoon { 0% { opacity: 0; transform: translate(-50%, 40%) scale(.6); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 45% { transform: translate(-50%, -50%) scale(1.05); } 55% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); } }
.cf-earth .cf-drips { position: absolute; inset: 0 0 auto; height: 100%; }
.cf-earth .cf-drips i { position: absolute; top: 0; width: var(--w); height: 0; border-radius: 0 0 99px 99px; background: linear-gradient(90deg, #6a0710, #c8141f 45%, #7a0812); animation: cfDrip 2.4s cubic-bezier(.5,0,.7,.6) var(--dl) forwards; }
.cf-earth .cf-drips i::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: calc(var(--w) * 1.8); height: calc(var(--w) * 2.2); transform: translateX(-50%); border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%; background: radial-gradient(circle at 35% 35%, #e0303c, #7a0812); }
@keyframes cfDrip { 0% { height: 0; } 85% { opacity: 1; } 100% { height: var(--h); opacity: 0; } }
.cf-earth .cf-beat { position: absolute; inset: 0; box-shadow: inset 0 0 120px 30px rgba(150,0,10,.8); animation: cfBeat .9s ease-in-out 3; opacity: 0; }
@keyframes cfBeat { 0%, 100% { opacity: 0; } 20% { opacity: 1; } 40% { opacity: .2; } 55% { opacity: .8; } }
.cf-earth .cf-title span { color: #ff3b3b; text-shadow: 0 5px 0 #0b0f22, 0 0 30px rgba(255,0,0,.7); }
.cf-earth .cf-title small { color: #ffb0a8; }
/* Space Opera: hyperspace streaks */
.cf-space .cf-warp { position: absolute; inset: 0; }
.cf-space .cf-warp line { stroke-linecap: round; stroke-dasharray: 0 2000; animation: cfWarp 1.6s cubic-bezier(.3,0,.2,1) forwards; }
.cf-space .cf-warp line.w { stroke: #e9f6ff; stroke-width: 2; }
.cf-space .cf-warp line.c { stroke: #44dbff; stroke-width: 3; filter: drop-shadow(0 0 4px #44dbff); }
@keyframes cfWarp { 0% { stroke-dasharray: 0 2000; opacity: 1; } 60% { stroke-dasharray: 600 2000; opacity: 1; } 100% { stroke-dasharray: 600 2000; stroke-dashoffset: -700; opacity: 0; } }
.cf-space .cf-flash { background: radial-gradient(circle at var(--x) var(--y), rgba(180,140,255,.8), rgba(68,219,255,.35) 25%, transparent 60%) !important; }
.cf-space .cf-ring { border-color: #b48cff !important; box-shadow: 0 0 30px #44dbff !important; }
.cf-space .cf-title span { color: #b9f0ff; text-shadow: 0 5px 0 #0b0f22, 0 0 30px #44dbff; }
.cf-space .cf-title small { color: #d8c6ff; }
@media (prefers-reduced-motion: reduce) { .cf-earth *, .cf-space * { animation-duration: .01s !important; } }

/* READABLE DICE: plain d10 silhouette, no facet lines, big heavy numbers centred */
.d, .die, .toast .d { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%23e4e6ee%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%225%22%20stroke-linejoin%3D%22round%22/%3E%3C/svg%3E") !important; font-family: 'Nunito', system-ui, sans-serif !important; font-weight: 900 !important; color: #0b0f22 !important; letter-spacing: -.02em; }
.d.h, .die.hit { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%236fe68f%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%225%22%20stroke-linejoin%3D%22round%22/%3E%3C/svg%3E") !important; color: #04260f !important; }
.d.c, .die.cos { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%23e4e6ee%22%20stroke%3D%22%23ffffff%22%20stroke-width%3D%228%22%20stroke-linejoin%3D%22round%22/%3E%3C/svg%3E") !important; }
.d.c.h, .die.cos.hit { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%236fe68f%22%20stroke%3D%22%23ffffff%22%20stroke-width%3D%228%22%20stroke-linejoin%3D%22round%22/%3E%3C/svg%3E") !important; }
.d.g, .d.g.c, .dice .die.gold, .die.gold.cos { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%23ffd451%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%225%22%20stroke-linejoin%3D%22round%22/%3E%3C/svg%3E") !important; color: #2a1d02 !important; }
.d { min-width: 36px; width: 36px; height: 39px; font-size: 19px; padding: 2px 0 0 0 !important; }
.toast .d { min-width: 46px; width: 46px; height: 50px; font-size: 25px; padding: 2px 0 0 0 !important; }
.die { width: 56px; height: 61px; font-size: 30px; padding: 3px 0 0 0 !important; }
.roller.mini .die { width: 38px; height: 42px; font-size: 20px; padding: 2px 0 0 0 !important; }
.bt-modal .bt-die { font-size: 52px !important; padding: 4px 0 0 0 !important; }
/* Play bottom row = Gear (left half) + Vehicles and companions (right half) */
.play-grid > .pi { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.play-grid > .pi > .sblock { min-width: 0; }
.play-grid > .pi .assets { grid-template-columns: minmax(0, 1fr) !important; }
@media (max-width: 1000px) { .play-grid > .pi { grid-template-columns: minmax(0, 1fr); } }

/* ===== v41 LIBRARY: the whole wiki ===== */
.ruling { margin: 0 0 22px; padding: 14px 18px; border: 3px solid #0b0e1c; border-radius: 16px; background: rgba(255,214,81,.10); box-shadow: 4px 4px 0 #0b0e1c; }
.ruling.stats { background: rgba(95,212,255,.10); }
.ruling-h { font-family: 'Lilita One', var(--display); font-size: 17px; color: var(--gold2, #ffd451); margin-bottom: 4px; }
.ruling.stats .ruling-h { color: var(--cyan); }
.ruling ul { margin: 6px 0 0; padding-left: 20px; } .ruling p { margin: 4px 0; }
.upd { text-decoration: underline wavy rgba(255,212,81,.85) 1.5px; text-underline-offset: 4px; cursor: help; background: rgba(255,212,81,.08); border-radius: 3px; }
.upd-block { border-left: 4px solid var(--gold2, #ffd451); background: rgba(255,212,81,.07); padding: 4px 14px; margin: 14px 0; border-radius: 0 12px 12px 0; }
.upd-block::before { content: 'Added to match the current rules'; display: block; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold2, #ffd451); margin: 6px 0 2px; }
.lib-src { margin-top: 28px; font-size: 13px; opacity: .7; }
.lib-count { font-weight: 800; color: var(--cyan); }
.lib-list { columns: 2 260px; column-gap: 28px; padding-left: 18px; } .lib-list li { break-inside: avoid; margin: 3px 0; }
.lib-list small { opacity: .7; }
.lib-find { position: relative; margin: 10px 0 6px; max-width: 560px; }
.lib-find input { width: 100%; box-sizing: border-box; font: inherit; font-size: 17px; padding: 12px 16px; border-radius: 14px; border: 3px solid #0b0e1c; background: var(--panel); color: var(--text); box-shadow: 3px 3px 0 #0b0e1c; }
.lib-res { display: grid; gap: 4px; margin-top: 8px; }
.lib-res a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--panel); text-decoration: none; color: var(--text); border: 1px solid var(--line); }
.lib-res a small { opacity: .7; white-space: nowrap; }
.lib-meta { margin: 6px 0 18px; }
.lib-cards .card { border-top: 6px solid var(--cyan); }
.lib-cards .card[data-w="earth"] { border-top-color: #e2584a; } .lib-cards .card[data-w="aos"] { border-top-color: #ffd451; } .lib-cards .card[data-w="space"] { border-top-color: #b07cff; }
.chg { margin: 10px 0 16px; padding: 10px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.chg-why { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold2, #ffd451); margin-bottom: 6px; }
.chg-old { opacity: .75; text-decoration: line-through; text-decoration-color: rgba(226,88,74,.6); margin-bottom: 6px; }
.chg-old b, .chg-new b { text-decoration: none; display: inline-block; min-width: 72px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.chg-new p { display: inline; }
.tbl { overflow-x: auto; margin: 12px 0 24px; } .tbl table { min-width: 100%; }
.tbl td, .tbl th { white-space: normal; vertical-align: top; }
.side .lib-cat { color: var(--gold2, #ffd451); }
.prose aside.ruling { display: block !important; float: none !important; width: auto !important; max-width: none !important; position: static !important; }
.sec-library .prose p, .sec-library .prose li { overflow-wrap: anywhere; }
.sec-library .tbl table { width: auto; min-width: 100%; }
.sec-library .tbl th, .sec-library .tbl td { overflow-wrap: normal; word-break: normal; min-width: 5.5em; }

/* clickable score crests */
button.crest { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; transition: transform .15s ease, filter .15s ease; }
button.crest:hover { transform: translateY(-3px) scale(1.04); filter: brightness(1.15); }
button.crest:active { transform: scale(.96); }
button.crest:focus-visible { outline: 3px solid var(--cc); outline-offset: 4px; border-radius: 12px; }

/* open Library directory (world pages + Library front page) */
.lib-dir { margin: 0 0 30px; padding: 18px 20px 14px; border: 3px solid var(--ink, #0b0f1e); border-radius: 18px; background: rgba(255,255,255,.04); box-shadow: 4px 4px 0 var(--ink, #0b0f1e); min-width: 0; }
.lib-dir h3, .lib-dir h2 { margin: 0 0 2px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.lib-dir h3 a, .lib-dir h2 a { text-decoration: none; color: inherit; }
.lib-dir h3 small, .lib-dir h2 small { font-family: var(--body, inherit); font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.lib-dir-blurb { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.lib-dir-g { margin: 14px 0 4px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold, #ffd34d); }
.lib-dir-list { list-style: none; margin: 0; padding: 0; columns: 3 15em; column-gap: 26px; }
.lib-dir-list li { break-inside: avoid; padding: 3px 0; }
.lib-dir-list a { text-decoration: none; border-bottom: 1px solid transparent; }
.lib-dir-list a:hover { border-bottom-color: currentColor; }
.lib-dir-all { display: inline-block; }
.world-dir { margin-top: 34px; }
.world-dir-wrap { max-width: 1180px; margin: 30px auto 0; padding: 28px clamp(16px, 4vw, 40px); }
@media (max-width: 600px) { .lib-dir { padding: 14px 14px 10px; } .lib-dir-list { columns: 1; } }

/* wiki pictures */
.wiki-gallery { margin-top: 30px; }
.wg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.wg-item { display: block; border: 3px solid var(--ink, #0b0f1e); border-radius: 14px; overflow: hidden; box-shadow: 4px 4px 0 var(--ink, #0b0f1e); background: rgba(0,0,0,.25); transition: transform .15s ease; }
.wg-item:hover { transform: translateY(-3px); }
.wg-item img { display: block; width: 100%; height: 220px; object-fit: cover; }
@media (max-width: 600px) { .wg-grid { grid-template-columns: 1fr 1fr; gap: 10px; } .wg-item img { height: 150px; } }
.sec-library .doc-head .hero-art { width: 240px; height: 240px; }
@media (max-width: 600px) { .sec-library .doc-head .hero-art { width: 120px; height: 120px; } }
.sec-library .doc-head .hero-art { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 9999; background: rgba(5,8,20,.92); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 10px 50px rgba(0,0,0,.6); }
.lb-x { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px)); width: 44px; height: 44px; border-radius: 50%; border: 0; font-size: 28px; line-height: 1; background: #fff; color: #111; cursor: pointer; }

/* BREAK TEST die: menacing, different for each setting */
.bt-modal[data-world="earth"] .bt-die { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%231c0707%22%20stroke%3D%22%238b0d14%22%20stroke-width%3D%225%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpolygon%20points%3D%2250%2C6%2078%2C55%2050%2C78%2022%2C55%22%20fill%3D%22%233a0b0d%22%20stroke%3D%22%238b0d14%22%20stroke-width%3D%223%22%2F%3E%3Cpath%20d%3D%22M78%2055%2096%2050M78%2055%2084%2086M22%2055%204%2050M22%2055%2016%2086M50%2078%2050%20106%22%20stroke%3D%22%238b0d14%22%20stroke-width%3D%223%22%2F%3E%3Cpath%20d%3D%22M50%204%20Q46%2014%2047%2022%20Q47%2026%2050%2026%20Q53%2026%2052%2020%20Q52%2012%2050%204Z%20M96%2050%20Q90%2056%2091%2063%20Q92%2067%2094%2065%20Q96%2060%2096%2050Z%20M16%2086%20Q14%2094%2017%2099%20Q20%20101%2021%2097%20Q21%2091%2016%2086Z%22%20fill%3D%22%23b3101b%22%2F%3E%3Ccircle%20cx%3D%2230%22%20cy%3D%2240%22%20r%3D%222.5%22%20fill%3D%22%23b3101b%22%2F%3E%3Ccircle%20cx%3D%2270%22%20cy%3D%2288%22%20r%3D%222%22%20fill%3D%22%23b3101b%22%2F%3E%3Ccircle%20cx%3D%2264%22%20cy%3D%2230%22%20r%3D%221.6%22%20fill%3D%22%23b3101b%22%2F%3E%3C%2Fsvg%3E") !important; color: #f2e6cf !important; text-shadow: 0 2px 0 #000, 0 0 10px #ff2230 !important; filter: drop-shadow(0 5px 0 #0b0f22) drop-shadow(0 0 18px rgba(200,10,25,.85)) !important; animation: btEarth 2.2s ease-in-out infinite; }
.bt-modal[data-world="aos"] .bt-die { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%230d0618%22%20stroke%3D%22%23b46bff%22%20stroke-width%3D%225%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpolygon%20points%3D%2250%2C6%2078%2C55%2050%2C78%2022%2C55%22%20fill%3D%22%231e0d38%22%20stroke%3D%22%23b46bff%22%20stroke-width%3D%223%22%2F%3E%3Cpath%20d%3D%22M78%2055%2096%2050M78%2055%2084%2086M22%2055%204%2050M22%2055%2016%2086M50%2078%2050%20106%22%20stroke%3D%22%237a3fd1%22%20stroke-width%3D%223%22%2F%3E%3Cpath%20d%3D%22M50%206%20L44%2022%20L52%2030%20L46%2044%20M84%2086%20L72%2080%20L76%2070%20M16%2086%20L26%2078%20L22%2068%20M96%2050%20L86%2048%22%20fill%3D%22none%22%20stroke%3D%22%23e2b8ff%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4%2050%20C-6%2060%206%2070%20-2%2082%20M96%2050%20C106%2058%2094%2070%20104%2080%20M50%20106%20C46%20112%2054%20114%2050%20120%22%20fill%3D%22none%22%20stroke%3D%22%23c88cff%22%20stroke-width%3D%221.5%22%20stroke-opacity%3D%22.8%22%2F%3E%3C%2Fsvg%3E") !important; color: #f0dcff !important; text-shadow: 0 0 8px #b46bff, 0 0 18px #7a3fd1 !important; filter: drop-shadow(0 5px 0 #0b0f22) drop-shadow(0 0 20px rgba(180,107,255,.9)) !important; animation: btAos 2.6s ease-in-out infinite; }
.bt-modal[data-world="space"] .bt-die { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cdefs%3E%3Cpattern%20id%3D%22s%22%20width%3D%224%22%20height%3D%224%22%20patternUnits%3D%22userSpaceOnUse%22%3E%3Crect%20width%3D%224%22%20height%3D%222%22%20fill%3D%22%23ff2a2a%22%20fill-opacity%3D%22.14%22%2F%3E%3C%2Fpattern%3E%3C%2Fdefs%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22%23050508%22%20stroke%3D%22%23ff2a2a%22%20stroke-width%3D%225%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpolygon%20points%3D%2250%2C6%2078%2C55%2050%2C78%2022%2C55%22%20fill%3D%22%2314060a%22%20stroke%3D%22%23ff2a2a%22%20stroke-width%3D%223%22%2F%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22url%28%23s%29%22%2F%3E%3Cpath%20d%3D%22M78%2055%2096%2050M78%2055%2084%2086M22%2055%204%2050M22%2055%2016%2086M50%2078%2050%20106%22%20stroke%3D%22%23ff2a2a%22%20stroke-width%3D%223%22%2F%3E%3Cpath%20d%3D%22M12%2030h10M78%2030h10M12%2094h6M82%2094h6%22%20stroke%3D%22%23ff2a2a%22%20stroke-width%3D%222%22%2F%3E%3C%2Fsvg%3E") !important; color: #ff4040 !important; text-shadow: -2px 0 0 rgba(0,240,255,.8), 2px 0 0 rgba(255,0,60,.9), 0 0 12px #ff2a2a !important; filter: drop-shadow(0 5px 0 #0b0f22) drop-shadow(0 0 16px rgba(255,42,42,.9)) !important; animation: btSpace 1.6s steps(1) infinite; }
.bt-modal .bt-die.spin { animation: btSpin .18s linear infinite !important; }
/* the aura behind the die */
.bt-stage { position: relative; }
.bt-stage::before { content: ''; position: absolute; width: 150px; height: 150px; border-radius: 50%; z-index: 0; pointer-events: none; }
.bt-stage .bt-die { position: relative; z-index: 1; }
.bt-modal[data-world="earth"] .bt-stage::before { background: radial-gradient(circle, rgba(170,8,20,.55), transparent 65%); animation: btBeat 1.1s ease-in-out infinite; }
.bt-modal[data-world="aos"] .bt-stage::before { background: conic-gradient(from 0deg, transparent, rgba(180,107,255,.55), transparent 30%, rgba(122,63,209,.5), transparent 60%, rgba(226,184,255,.45), transparent); filter: blur(6px); animation: nebulaSpin 6s linear infinite; }
.bt-modal[data-world="space"] .bt-stage::before { background: radial-gradient(circle, rgba(0,0,0,.95) 30%, rgba(255,42,42,.35) 45%, transparent 66%); animation: btAlarm 1s steps(2) infinite; }
.bt-modal[data-world="earth"] { background: radial-gradient(circle at center, rgba(60,0,4,.55), rgba(8,0,0,.92)); }
.bt-modal[data-world="aos"] { background: radial-gradient(circle at center, rgba(40,10,70,.55), rgba(6,2,14,.93)); }
.bt-modal[data-world="space"] { background: repeating-linear-gradient(0deg, rgba(255,40,40,.05) 0 2px, transparent 2px 4px), radial-gradient(circle at center, rgba(40,0,0,.5), rgba(0,0,0,.94)); }
.bt-modal[data-world="earth"] .bt-title span:first-child { color: #c3101c; }
.bt-modal[data-world="aos"] .bt-title span:first-child { color: #c88cff; text-shadow: 0 5px 0 #0b0f22, 0 0 22px #7a3fd1; }
.bt-modal[data-world="space"] .bt-title span:first-child { color: #ff3a3a; text-shadow: -3px 0 0 rgba(0,240,255,.7), 3px 0 0 rgba(255,0,60,.8), 0 5px 0 #0b0f22; }
@keyframes btEarth { 0%,100% { transform: rotate(-2deg) scale(1); } 50% { transform: rotate(2deg) scale(1.05); } }
@keyframes btAos { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(4deg); } }
@keyframes btSpace { 0%,88%,100% { transform: none; } 90% { transform: translate(-3px,1px) skewX(-6deg); } 93% { transform: translate(3px,-1px) skewX(5deg); } 96% { transform: translate(-1px,0); } }
@keyframes btBeat { 0%,100% { transform: scale(.9); opacity: .7; } 15% { transform: scale(1.1); opacity: 1; } 30% { transform: scale(.95); } 45% { transform: scale(1.08); opacity: .95; } }
@keyframes btAlarm { 0% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .bt-modal .bt-die, .bt-stage::before { animation: none !important; } }

/* own Leverage on pet and vehicle cards */
.as-dmg .as-lev { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.as-lev span { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.as-lev button { width: 34px; height: 34px; }
.as-lev b { min-width: 2ch; text-align: center; }
@media (max-width: 600px) { .as-dmg .as-lev { margin-left: 0; } }
.bt-stage { height: 160px; }
.bt-modal .bt-die { width: 118px !important; min-width: 118px; height: 130px !important; font-size: 60px !important; }

/* accounts */
.acct-link { align-self: center; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--ink, #0b0f22); background: var(--panel2, #2c3770); color: var(--text, #fbf3dc); font-weight: 800; font-size: 14px; text-decoration: none; white-space: nowrap; }
.acct-link.in { background: var(--cyan, #44dbff); color: #0b0f22; }
.acct-wrap { max-width: 720px; margin: 0 auto; }
.acct-card { display: grid; gap: 12px; padding: 22px; margin: 0 0 20px; border: 3px solid var(--ink, #0b0f22); border-radius: 18px; background: var(--panel, #263160); box-shadow: 4px 4px 0 var(--ink, #0b0f22); }
.acct-card h2 { margin: 0; }
.acct-form .af { display: grid; gap: 4px; }
.acct-form input[type=email], .acct-form input[type=password], .acct-danger input { min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--line, #3a4790); background: var(--bg2, #1a2147); color: var(--text, #fbf3dc); font: inherit; }
.acct-chk { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.acct-chk input { width: 20px; height: 20px; margin-top: 2px; }
.acct-sub, .acct-alt { margin: 0; color: var(--muted, #b9bfdc); font-size: 14px; }
.acct-err { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(255,90,78,.15); border: 2px solid #ff5a4e; color: #ffd0cb; }
.acct-ok { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(63,224,122,.12); border: 2px solid #3fe07a; color: #c9ffd9; }
.acct-who { margin: 0; font-weight: 800; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; overflow-wrap: anywhere; }
.acct-plan { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--gold, #ffcf3f); color: #1a1406; }
.acct-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.acct-stats > div { display: grid; padding: 12px; border-radius: 12px; background: rgba(0,0,0,.2); }
.acct-stats b { font-size: 30px; font-family: var(--display, inherit); }
.acct-stats small { color: var(--muted, #b9bfdc); }
.acct-sync { margin: 0; color: var(--muted, #b9bfdc); }
.acct-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.acct-danger summary { cursor: pointer; font-weight: 800; color: #ff9b91; }
.acct-note { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: min(560px, calc(100% - 32px)); display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 3px solid var(--ink, #0b0f22); background: var(--panel, #263160); color: var(--text, #fbf3dc); box-shadow: 4px 4px 0 var(--ink, #0b0f22); }
.acct-note button { flex: none; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 0; background: var(--cyan, #44dbff); font-weight: 800; }
@media (max-width: 860px) { .acct-link { padding: 6px 10px; font-size: 13px; } }
@media (max-width: 560px) { .acct-stats { grid-template-columns: 1fr; } }
.acct-link { display: inline-flex; align-items: center; gap: 6px; }
.acct-link .ai { width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4.2'/%3E%3Cpath d='M3.5 21c.8-4.6 4.3-7 8.5-7s7.7 2.4 8.5 7z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4.2'/%3E%3Cpath d='M3.5 21c.8-4.6 4.3-7 8.5-7s7.7 2.4 8.5 7z'/%3E%3C/svg%3E") center/contain no-repeat; }
@media (min-width: 861px) and (max-width: 1560px) { .acct-link { padding: 8px; width: 40px; height: 40px; justify-content: center; } .acct-link .at { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
/* mid-width header fits on one row (the Ko-fi button is still in the footer) */
@media (min-width: 861px) and (max-width: 1320px) {
  header.top .kofi-top { display: none; }
  header.top nav.main a { padding-left: 9px !important; padding-right: 9px !important; font-size: 14px; }
  header.top .search { min-width: 0; width: 120px; flex: 0 1 120px; }
  header.top .search input { width: 100%; min-width: 0; }
}
@media (min-width: 861px) and (max-width: 1100px) {
  header.top .brand .sub { display: none; }
  header.top nav.main a { padding-left: 6px !important; padding-right: 6px !important; font-size: 13px; }
  header.top .search { width: 90px; flex-basis: 90px; }
}
html, body { overflow-x: clip; }
.acct-admin { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--cyan, #44dbff); background: rgba(68,219,255,.08); }
.acct-admin.warn { border-color: #ffcf3f; background: rgba(255,207,63,.12); }
.acct-admin small { color: var(--muted, #b9bfdc); }

/* members gate: welcome + agreement */
.acct-welcome h2, .acct-terms h2 { margin-top: 0; }
.acct-welcome { border-color: var(--cyan, #44dbff); }
.acct-terms p { max-width: 62ch; }

/* Player view / GM view */
html[data-mode="player"] [data-gm] { display: none !important; }
html.gm-locked #main > :not(#gm-cover) { display: none !important; }
.gm-cover { display: grid; place-items: center; padding: 48px 0; }
.gm-cover-card { max-width: 560px; padding: 24px; border-radius: 16px; border: 3px solid var(--ink, #0b0f24); background: var(--panel, #1b2350); box-shadow: 6px 6px 0 var(--ink, #0b0f24); }
.gm-cover-card h2 { margin: 4px 0 8px; }
.foot-legal { font-size: 13px; opacity: .8; max-width: 70ch; text-align: center; }
.acct-role { display: flex; gap: 10px; flex-wrap: wrap; border: 0; padding: 0; margin: 0; }
.acct-role legend { font-weight: 700; margin-bottom: 6px; }
.acct-role label { display: flex; gap: 8px; align-items: flex-start; flex: 1 1 200px; padding: 10px 12px; border: 2px solid var(--line, rgba(255,255,255,.2)); border-radius: 12px; cursor: pointer; }
.acct-role label:has(input:checked) { border-color: var(--cyan, #44dbff); background: rgba(68,219,255,.08); }
.acct-role small { display: block; opacity: .8; }
.acct-mode { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.orc-notice { padding: 12px 16px; border-left: 4px solid var(--cyan, #44dbff); background: rgba(68,219,255,.06); border-radius: 8px; font-size: 14px; }

/* sign-up landing (members-only site, signed out) */
body.joining .acct-wrap > .doc-head { display: none; }
body.joining .acct-wrap { max-width: 1180px; margin-inline: auto; }
.join { display: grid; gap: 22px 40px; grid-template-columns: minmax(0, 1fr) minmax(320px, 430px); grid-template-areas: "head card" "art card" "worlds worlds" "perks perks"; align-items: start; padding-block: 8px 24px; }
.join-head { grid-area: head; min-width: 0; }
.join-kicker { font: 800 13px/1 var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); }
.join-title { margin: 10px 0 10px; font-family: var(--slab, 'Alfa Slab One', Georgia, serif); font-weight: 400; font-size: clamp(40px, 6.4vw, 78px); line-height: .98; color: var(--text); text-shadow: 0 6px 0 var(--ink, #0b0f22); text-wrap: balance; }
.join-title span { color: var(--cyan); text-shadow: 0 6px 0 var(--ink, #0b0f22), 0 0 28px rgba(68,219,255,.55); }
.join-lede { font-size: 19px; color: var(--muted); max-width: 46ch; margin: 0; }
.join-next { display: inline-block; margin: 14px 0 0; padding: 8px 14px; border-radius: 999px; background: var(--gold, #ffcf3f); color: var(--ink, #0b0f22); font-weight: 800; border: 3px solid var(--ink, #0b0f22); }
.join-art { grid-area: art; position: relative; justify-self: center; width: min(100%, 380px); aspect-ratio: 624 / 753; }
.join-art img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; border-radius: 28px; border: 4px solid var(--ink, #0b0f22); box-shadow: 0 10px 0 var(--ink, #0b0f22); animation: joinFloat 6s ease-in-out infinite; }
.join-ring { position: absolute; inset: -14px; border-radius: 40px; background: radial-gradient(closest-side, rgba(68,219,255,.55), rgba(68,219,255,0) 75%); filter: blur(8px); animation: joinPulse 3.2s ease-in-out infinite; }
.join-card { grid-area: card; position: sticky; top: 90px; padding: 18px; border-radius: 24px; background: var(--panel); border: 4px solid var(--ink, #0b0f22); box-shadow: 0 10px 0 var(--ink, #0b0f22), 0 0 0 2px rgba(68,219,255,.35) inset; }
.join-card .acct-card { background: none; border: 0; box-shadow: none; padding: 6px 4px 0; margin: 0; }
.join-card .acct-form h2 { display: none; }
.join-card #f-up .acct-alt { display: none; }
.join-card .btn.primary { width: 100%; font-size: 18px; padding: 14px; }
.join-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 16px; background: var(--bg2); border: 3px solid var(--ink, #0b0f22); }
.join-tabs button { border: 0; border-radius: 11px; padding: 10px 8px; background: none; color: var(--muted); font: 400 18px var(--display); cursor: pointer; }
.join-tabs button.on { background: var(--cyan); color: var(--ink, #0b0f22); box-shadow: 0 3px 0 var(--ink, #0b0f22); }
.join-worlds { grid-area: worlds; list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.jw { position: relative; overflow: hidden; border-radius: 22px; border: 4px solid var(--ink, #0b0f22); box-shadow: 0 8px 0 var(--ink, #0b0f22); background: var(--panel); transition: transform .25s ease; }
.jw:hover { transform: translateY(-4px) rotate(-.6deg); }
.jw img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.jw div { padding: 12px 16px 16px; display: grid; gap: 4px; }
.jw b { font: 400 24px var(--display); }
.jw span { color: var(--muted); font-size: 15px; }
.jw-earth b { color: var(--earth); } .jw-aos b { color: var(--aos); } .jw-space b { color: var(--space); }
.jw-earth { border-top: 6px solid var(--earth); } .jw-aos { border-top: 6px solid var(--aos); } .jw-space { border-top: 6px solid var(--space); }
.join-perks { grid-area: perks; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.join-perks li { padding: 14px 16px; border-radius: 18px; background: var(--panel2); border: 3px solid var(--ink, #0b0f22); display: grid; gap: 4px; }
.join-perks b { font: 400 18px var(--display); color: var(--gold); }
.join-perks span { font-size: 14px; color: var(--muted); }
@keyframes joinFloat { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-10px) rotate(1deg); } }
@keyframes joinPulse { 0%, 100% { opacity: .55; transform: scale(.97); } 50% { opacity: 1; transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .join-art img, .join-ring { animation: none; } .jw { transition: none; } }
@media (max-width: 980px) {
  .join { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "art" "card" "worlds" "perks"; }
  .join-card { position: static; }
  .join-art { width: min(72%, 300px); }
  .join-head { text-align: center; } .join-lede { margin-inline: auto; }
  .join-perks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .join-worlds, .join-perks { grid-template-columns: minmax(0, 1fr); }
  .join-art { width: min(64%, 240px); }
  .join-lede { font-size: 17px; }
}

/* sign-up: TOFU-style art only (lil guys), no photo art */
.jw { border-top-width: 4px; }
.jw-stage { position: relative; height: 170px; display: flex; align-items: flex-end; justify-content: center; gap: 4px; padding-top: 12px; overflow: hidden; }
.jw-earth .jw-stage { background: radial-gradient(circle at 50% 120%, rgba(240,138,44,.55), transparent 65%), #1d1a2e; }
.jw-aos .jw-stage { background: radial-gradient(circle at 50% 120%, rgba(92,203,107,.55), transparent 65%), #17283a; }
.jw-space .jw-stage { background: radial-gradient(circle at 50% 120%, rgba(167,127,240,.6), transparent 65%), #151a3a; }
.jw-pal { height: 140px; width: auto; filter: drop-shadow(0 5px 0 var(--ink, #0b0f22)); animation: jwBob 3.4s ease-in-out infinite; }
.jw-p1 { height: 110px; animation-delay: -1.7s; }
.jw:hover .jw-pal { animation-duration: 1.2s; }
.role-pal { width: 54px; height: 60px; object-fit: contain; flex: none; filter: grayscale(.85) opacity(.65); transition: filter .2s, transform .2s; }
.acct-role label:has(input:checked) .role-pal { filter: drop-shadow(0 3px 0 var(--ink, #0b0f22)); transform: scale(1.08) rotate(-3deg); }
.acct-role input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.acct-role label { position: relative; align-items: center; }
.acct-joke { margin: 4px 0 2px; font-size: 13px; font-style: italic; color: var(--gold, #ffcf3f); text-align: center; }
@keyframes jwBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .jw-pal { animation: none; } }

/* sign-up hero: the animated TOFU cover fills the left side */
body.joining .acct-wrap { max-width: 1320px; }
.join { grid-template-columns: minmax(0, 1.05fr) minmax(340px, 1fr); grid-template-areas: "art head" "art card" "worlds worlds" "perks perks"; column-gap: 48px; }
.join-art { width: min(100%, calc((100vh - 110px) * .6617)); justify-self: center; aspect-ratio: 624 / 943; position: sticky; top: 84px; }
.join-ring { inset: -18px; border-radius: 44px; }
.join-cover { position: relative; z-index: 1; width: 100%; height: 100%; overflow: hidden; border-radius: 28px; border: 4px solid var(--ink, #0b0f22); box-shadow: 0 10px 0 var(--ink, #0b0f22); background: #1b2340; }
.join-cover .jc-base { width: 100%; height: 100%; object-fit: cover; display: block; transform-origin: 50% 45%; animation: jcZoom 18s ease-in-out infinite; border: 0; box-shadow: none; border-radius: 0; }
.join-art > img { display: none; }
.jc-portal { position: absolute; left: 20%; top: 21%; width: 60%; height: 50%; border-radius: 46% 46% 44% 44%; box-shadow: 0 0 30px 10px rgba(68,219,255,.55), inset 0 0 40px 12px rgba(68,219,255,.45); mix-blend-mode: screen; animation: jcPortal 2.6s ease-in-out infinite; pointer-events: none; }
.jc-spark { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #e9fbff; box-shadow: 0 0 10px 3px #44dbff; opacity: 0; animation: jcSpark 3s ease-in-out infinite; }
.jc-spark.s1 { left: 22%; top: 30%; } .jc-spark.s2 { left: 76%; top: 26%; animation-delay: -.8s; } .jc-spark.s3 { left: 19%; top: 58%; animation-delay: -1.6s; } .jc-spark.s4 { left: 79%; top: 63%; animation-delay: -2.3s; }
.jc-eyes { position: absolute; width: 7%; height: 2.4%; border-radius: 40%; background: #1c2130; transform: scaleY(0); transform-origin: 50% 0; animation: jcBlink 5s infinite; }
.jc-eyes.e1 { left: 11.5%; top: 69.6%; } .jc-eyes.e2 { left: 81.6%; top: 69%; animation-delay: -1.9s; } .jc-eyes.e3 { left: 91.3%; top: 50.2%; width: 6%; animation-delay: -3.3s; }
.jc-fly { position: absolute; top: 24%; left: -22%; width: 20%; animation: jcFly 13s linear infinite; filter: drop-shadow(0 3px 0 var(--ink, #0b0f22)); }
@keyframes jcZoom { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045) translateY(-1%); } }
@keyframes jcPortal { 0%, 100% { opacity: .55; transform: scale(.985); } 50% { opacity: 1; transform: scale(1.015); } }
@keyframes jcSpark { 0%, 100% { opacity: 0; transform: scale(.4); } 45% { opacity: 1; transform: scale(1.2); } 60% { opacity: .2; } }
@keyframes jcBlink { 0%, 90%, 100% { transform: scaleY(0); } 93%, 96% { transform: scaleY(1); } }
@keyframes jcFly { 0%, 55% { left: -22%; transform: translateY(0) rotate(-6deg); } 75% { transform: translateY(-14px) rotate(4deg); } 100% { left: 104%; transform: translateY(6px) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .jc-base, .jc-portal, .jc-spark, .jc-eyes, .jc-fly { animation: none; } .jc-fly { display: none; } }
@media (max-width: 980px) {
  .join { grid-template-areas: "head" "art" "card" "worlds" "perks"; grid-template-columns: minmax(0, 1fr); }
  .join-art { position: relative; top: 0; width: min(88%, 420px); }
}
@media (max-width: 640px) { .join-art { width: min(92%, 340px); } }

/* the sign-up card is the glowing portal */
.join-card { border-radius: 46% 46% 40% 40% / 15% 15% 10% 10%; padding: 46px 30px 34px; border: 5px solid #bff6ff;
  background: radial-gradient(ellipse at 50% 0%, rgba(68,219,255,.28), transparent 60%), linear-gradient(180deg, #1d3570 0%, #1a2758 45%, #18204a 100%);
  box-shadow: 0 0 0 5px #44dbff, 0 0 0 10px rgba(11,15,34,1), 0 0 38px 14px rgba(68,219,255,.55), inset 0 0 40px 6px rgba(68,219,255,.35);
  animation: portalGlow 2.8s ease-in-out infinite; position: sticky; overflow: visible; }
.join-card::before { content: ''; position: absolute; inset: -16px; border-radius: inherit; border: 3px dashed rgba(191,246,255,.55); animation: portalSpin 3.2s ease-in-out infinite; pointer-events: none; }
.join-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(2px 2px at 20% 18%, #fff, transparent), radial-gradient(2px 2px at 78% 12%, #fff, transparent), radial-gradient(1.5px 1.5px at 60% 30%, #bff6ff, transparent), radial-gradient(1.5px 1.5px at 35% 8%, #bff6ff, transparent);
  animation: portalTwinkle 4s ease-in-out infinite; }
.join-card > * { position: relative; z-index: 1; }
.join-card input:not([type=checkbox]):not([type=radio]) { background: rgba(11,15,34,.55); border-color: rgba(191,246,255,.45); }
.join-card input:focus { outline: none; border-color: #44dbff; box-shadow: 0 0 0 3px rgba(68,219,255,.35), 0 0 16px rgba(68,219,255,.5); }
@keyframes portalGlow { 0%, 100% { box-shadow: 0 0 0 5px #44dbff, 0 0 0 10px #0b0f22, 0 0 30px 10px rgba(68,219,255,.45), inset 0 0 34px 4px rgba(68,219,255,.3); } 50% { box-shadow: 0 0 0 5px #7fe9ff, 0 0 0 10px #0b0f22, 0 0 52px 20px rgba(68,219,255,.7), inset 0 0 52px 10px rgba(68,219,255,.45); } }
@keyframes portalSpin { 0%, 100% { transform: scale(1); opacity: .45; } 50% { transform: scale(1.025); opacity: 1; } }
@keyframes portalTwinkle { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .join-card, .join-card::before, .join-card::after { animation: none; } }
@media (max-width: 640px) { .join-card { padding: 38px 18px 28px; border-radius: 40% 40% 32% 32% / 9% 9% 6% 6%; } .join-card::before { display: none; } }

@media (max-width: 640px) { .join-tabs button { font-size: 15px; padding: 9px 4px; } }

/* sign-up polish: entrances, shimmer, bounce */
.join > * { animation: joinIn .7s cubic-bezier(.2,.8,.2,1.2) both; }
.join-head { animation-delay: .05s; } .join-art { animation-delay: .15s; } .join-card { animation-name: joinIn, portalGlow; animation-duration: .8s, 2.8s; animation-delay: .3s, 1.1s; animation-iteration-count: 1, infinite; animation-timing-function: cubic-bezier(.2,.8,.2,1.2), ease-in-out; }
.join-worlds { animation-delay: .45s; } .join-perks { animation-delay: .6s; }
.join-title span { display: inline-block; animation: titleWobble 3.6s ease-in-out infinite; }
.join-kicker { animation: kickerGlow 4s ease-in-out infinite; }
.join-card .btn.primary { position: relative; overflow: hidden; transition: transform .15s ease; }
.join-card .btn.primary::after { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.6), transparent); transform: skewX(-20deg); animation: btnShine 3.2s ease-in-out infinite; }
.join-card .btn.primary:hover { transform: translateY(-2px) scale(1.02); }
.join-card .btn.primary:active { transform: translateY(2px) scale(.98); }
.join-tabs button { transition: background .2s, color .2s, transform .2s; }
.join-tabs button.on { animation: tabPop .35s cubic-bezier(.2,.8,.2,1.4); }
.acct-role label { transition: transform .2s, border-color .2s, background .2s; }
.acct-role label:hover { transform: translateY(-2px); }
.acct-role label:has(input:checked) .role-pal { animation: palHop .9s ease-in-out infinite; }
.jw { animation: none; }
.join-worlds .jw { animation: joinIn .7s cubic-bezier(.2,.8,.2,1.2) both; }
.join-worlds .jw:nth-child(2) { animation-delay: .1s; } .join-worlds .jw:nth-child(3) { animation-delay: .2s; }
.jw:hover .jw-pal { animation: palHop .6s ease-in-out infinite; }
.join-perks li { transition: transform .2s; } .join-perks li:hover { transform: translateY(-3px) rotate(-.5deg); }
.join-card .acct-err { animation: shake .4s; }
@keyframes joinIn { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes titleWobble { 0%, 100% { transform: rotate(-2deg) translateY(0); } 50% { transform: rotate(2deg) translateY(-4px); } }
@keyframes kickerGlow { 0%, 100% { text-shadow: none; } 50% { text-shadow: 0 0 12px rgba(68,219,255,.8); } }
@keyframes btnShine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
@keyframes tabPop { 0% { transform: scale(.9); } 100% { transform: scale(1); } }
@keyframes palHop { 0%, 100% { transform: translateY(0) rotate(-3deg) scale(1.08); } 50% { transform: translateY(-6px) rotate(3deg) scale(1.12); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .join > *, .join-worlds .jw, .join-title span, .join-kicker, .join-card .btn.primary::after, .acct-role label:has(input:checked) .role-pal, .jw:hover .jw-pal, .join-card .acct-err { animation: none !important; } }
/* Tower of Trials card beside Ko-fi */
.foot-cta{display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-start;gap:16px}
.tot-card{display:flex;flex-direction:column;align-items:center;gap:8px}
.tot-btn{display:inline-flex;align-items:center;gap:12px;padding:12px 22px;border-radius:18px;background:linear-gradient(135deg,#6b3fd6,#2b7bd9);color:#fff;text-decoration:none;border:3px solid var(--ink);box-shadow:0 6px 0 var(--ink),0 0 18px rgba(68,219,255,.35);text-align:left;min-height:44px;position:relative;overflow:hidden}
.tot-btn::after{content:"";position:absolute;inset:0;background:linear-gradient(110deg,transparent 35%,rgba(255,255,255,.35) 50%,transparent 65%);transform:translateX(-120%);animation:totShine 4.5s ease-in-out infinite}
.tot-btn .tot-ico{font-size:30px;display:inline-block;animation:portalBob 3s ease-in-out infinite .6s}
.tot-btn b{display:block;font-family:var(--display),system-ui,sans-serif;font-weight:400;font-size:19px}
.tot-btn small{display:block;opacity:.9;font-size:13px}
.tot-btn:hover{transform:translateY(-2px)}
.tot-pw{font:inherit;font-size:13px;color:inherit;background:rgba(0,0,0,.25);border:2px dashed rgba(68,219,255,.6);border-radius:12px;padding:6px 12px;cursor:pointer;min-height:36px}
.tot-pw code{font-size:13px;user-select:all;color:#ffe066}
.tot-copied{opacity:.7;font-size:12px;margin-left:4px}
@keyframes totShine{0%,60%{transform:translateX(-120%)}100%{transform:translateX(120%)}}
@media (prefers-reduced-motion:reduce){.tot-btn::after,.tot-btn .tot-ico{animation:none}}
/* Tower of Trials pill in top bar + tidy footer pair */
.tot-top{display:none;align-items:center;gap:6px;padding:8px 14px;border-radius:999px;background:linear-gradient(135deg,#6b3fd6,#2b7bd9);color:#fff;font-family:var(--display),system-ui,sans-serif;text-decoration:none;border:3px solid var(--ink);box-shadow:0 4px 0 var(--ink);white-space:nowrap}
.tot-top:hover{transform:translateY(-2px)}
@media (min-width:1100px){.tot-top{display:inline-flex}}
@media (max-width:860px){header.top .tot-top{display:none}}
.foot-cta{align-items:stretch}
.foot-cta > .kofi-btn,.tot-card .tot-btn{min-width:280px;min-height:76px;box-sizing:border-box}
.tot-card{gap:6px}
.tot-pw{background:transparent;border:0;padding:2px 6px;min-height:0;opacity:.85}
.tot-pw:hover{opacity:1}
.tot-pw code{background:rgba(0,0,0,.3);padding:1px 6px;border-radius:6px}
.foot{justify-items:center;text-align:center;width:100%;box-sizing:border-box}
@media (max-width:620px){.foot-cta > .kofi-btn,.tot-card .tot-btn{min-width:0;width:100%}.tot-card{width:100%}}
.foot{justify-content:center;grid-template-columns:minmax(0,1fr)}
.foot-cta{align-items:flex-start}
.foot-cta > .kofi-btn,.tot-card .tot-btn{height:84px;min-height:0}
/* phone tap targets */
@media (max-width: 760px), (pointer: coarse) {
  .foot .mode-switch { display: inline-block; min-height: 44px; padding: 10px 6px; }
  .foot-links a { display: inline-block; padding: 10px 4px; }
  .lib-dir h3 > a { display: block; padding: 10px 0; }
  .classcard a { display: inline-block; padding: 10px 0; }
}
/* Places of Aos */
.lore-draft { margin: 0 0 18px; padding: 10px 14px; border: 2px dashed var(--gold, #ffd34d); border-radius: 12px; font-size: 14px; background: rgba(255, 211, 77, .08); }
.lore-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.lore-jump a { display: inline-block; padding: 8px 12px; border-radius: 999px; border: 2px solid var(--line); text-decoration: none; font-size: 14px; min-height: 40px; box-sizing: border-box; }
.lore-entry { scroll-margin-top: 90px; padding: 20px 0 8px; border-top: 2px solid var(--line); }
.lore-entry h2 { margin: 0 0 4px; }
.lore-path { font-size: 13px; opacity: .75; margin-bottom: 6px; }
.lore-tag { font-style: italic; font-size: 17px; margin: 4px 0 12px; }
.lore-body h4 { margin: 18px 0 6px; font-size: 18px; }
.lore-body table { border-collapse: collapse; margin: 6px 0 10px; min-width: 200px; }
.lore-body th, .lore-body td { padding: 6px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.lore-top { display: inline-block; font-size: 13px; padding: 10px 0; }
.lore-group { margin-top: 30px; }
.lore-group small { font-size: 14px; opacity: .7; font-weight: 400; }
.lore-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.lore-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 16px; border: 3px solid var(--ink, #0b0f2a); background: var(--card, rgba(255,255,255,.06)); text-decoration: none; color: inherit; box-shadow: 0 5px 0 var(--ink, #0b0f2a); }
.lore-card:hover { transform: translateY(-2px); }
.lore-card small { opacity: .75; }
.lore-card span { font-size: 14px; opacity: .9; }
/* polish */
.make-class-row { margin: 10px 0 0; }
.make-class { display: inline-flex; align-items: center; gap: 8px; }
header.top .kofi-top { margin-left: 14px; }
header.top .tot-top { margin-left: 8px; margin-right: auto; }
@media (min-width: 1100px) and (max-width: 1280px) { header.top .kofi-top, header.top .tot-top { padding: 6px 10px; font-size: 14px; } }
/* phone polish: class button stays one line */
@media (max-width: 760px) { .make-class { white-space: nowrap; font-size: 15px; padding: 10px 16px; } }

/* ---- fight simulator (Campaign) + full creature sheets */
.sim-ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sim-ctl label { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.sim-verdict { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin: 12px 0 8px; padding: 10px 14px; border-radius: 12px; border: 3px solid var(--ink, #0b1020); background: var(--panel2); }
.sim-verdict b { font-family: var(--display); font-size: 22px; letter-spacing: .5px; }
.sim-verdict.v-easy b { color: #7be08a; } .sim-verdict.v-fair b { color: var(--cyan); } .sim-verdict.v-hard b { color: var(--gold); } .sim-verdict.v-deadly b { color: var(--crimson); }
.sim-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.sim-stats div { background: var(--panel2); border: 2px solid var(--line); border-radius: 10px; padding: 8px 10px; text-align: center; }
.sim-stats small { display: block; color: var(--muted); font-size: 12px; } .sim-stats b { font-size: 22px; }
.sim-per { display: grid; gap: 8px; }
.sp-row { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr; gap: 2px 10px; align-items: center; }
.sp-row small { grid-column: 2; color: var(--muted); font-size: 12.5px; }
.sp-bar { height: 10px; border-radius: 6px; background: var(--panel2); border: 2px solid var(--line); overflow: hidden; }
.sp-bar i { display: block; height: 100%; background: var(--crimson); }
.sim-log { list-style: none; padding: 0; margin: 8px 0; max-height: 360px; overflow: auto; font-size: 13.5px; display: grid; gap: 3px; }
.sim-log .sl-round { margin-top: 6px; font-family: var(--display); color: var(--gold); }
.sim-log .sl-dice .d { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin: 0 1px; border-radius: 4px; font-size: 11px; background: var(--panel2); border: 1px solid var(--line); }
.sim-log .sl-dice .d.g { background: var(--gold); color: #1a1200; }
.sim-stale { color: var(--gold); font-size: 13.5px; margin: 8px 0 0; }
@media (max-width: 560px) { .sim-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sp-row { grid-template-columns: 1fr; } .sp-row small { grid-column: 1; } }
.cs-gear { padding-left: 18px; margin: 6px 0; } .cs-gear li { margin: 3px 0; }
.cs-skills td:first-child, .cs-skills td:nth-child(2) { text-align: center; white-space: nowrap; }
.sitem.k-trait { border-left-color: #b78cff; } .cp-drawer .sitem.k-trait { border-left-color: #b78cff; }
.cs-abil .sitem { border-left: 4px solid var(--line); padding-left: 10px; }
.cs-abil .sitem.k-offense { border-left-color: var(--crimson); } .cs-abil .sitem.k-defense { border-left-color: var(--cyan); } .cs-abil .sitem.k-utility { border-left-color: var(--gold); }
/* Player/GM view pill in the main menu */
nav.main .view-pill { font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; margin-left: 6px; padding: 6px 12px; border-radius: 999px; border: 2.5px solid var(--ink); background: var(--panel2); color: var(--text); white-space: nowrap; box-shadow: 0 3px 0 var(--ink); align-self: center; }
nav.main .view-pill::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #7fd4ff; margin-right: 7px; vertical-align: 1px; }
nav.main .view-pill.on::before { background: #ff8a5c; }
nav.main .view-pill:hover { background: var(--panel); }
@media (max-width: 860px) { nav.main .view-pill { margin: 8px 0 0; padding: 12px 14px; font-size: 16px; text-align: left; } }
/* GM view shows 8 menu links, so the Ko-fi and Tower pills step aside (they stay in the footer) until the screen is wide */
@media (max-width: 1599px) { html[data-mode="gm"] header.top .kofi-top, html[data-mode="gm"] header.top .tot-top { display: none !important; } }
/* Places of Aos finder */
.place-find-box { margin: 18px 0 8px; display: grid; gap: 8px; }
.place-find { font: inherit; font-size: 17px; padding: 12px 14px; border-radius: 12px; border: 2.5px solid var(--ink); background: var(--panel2); color: var(--text); width: 100%; max-width: 560px; min-height: 48px; }
.place-az { list-style: none; margin: 0; padding: 6px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 16px; max-width: 900px; }
.place-az li a { font-weight: 700; display: inline-block; padding: 6px 0; }
.place-az li small { color: var(--muted); }
/* owner tools */
.own-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.own-stats div { background: var(--panel2); border: 2.5px solid var(--ink); border-radius: 14px; padding: 10px 14px; }
.own-stats small { display: block; color: var(--muted); font-weight: 700; } .own-stats b { font-size: 28px; }
.own-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; } .own-tools input { flex: 1 1 260px; font: inherit; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--ink); background: var(--panel2); color: var(--text); min-height: 44px; }
.own-list { display: grid; gap: 8px; }
.own-u { border: 2.5px solid var(--ink); border-radius: 14px; background: var(--panel); overflow: hidden; }
.own-head { all: unset; box-sizing: border-box; cursor: pointer; display: block; width: 100%; padding: 12px 14px; }
.own-head small { display: block; color: var(--muted); margin-top: 2px; }
.own-chars { padding: 4px 14px 12px; display: grid; gap: 6px; }
.own-c { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--panel2); }
.own-c small { grid-column: 1; color: var(--muted); } .own-c .btn { grid-row: 1 / span 2; grid-column: 2; }

/* ================= v62 Campaign: tabs + encounter builder ================= */
.cp-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cp-tabs button { display: inline-flex; align-items: center; gap: 7px; border: 2.5px solid var(--ink, #0b0f22); background: var(--bg2); color: var(--text); border-radius: 999px; padding: 7px 16px; font-size: 14.5px; font-weight: 800; cursor: pointer; min-height: 40px; }
.cp-tabs button:hover { border-color: var(--cyan); }
.cp-tabs button.on { background: #ffd23f; color: #141a38; box-shadow: 3px 3px 0 var(--ink, #0b0f22); }
.ct-n { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: rgba(68,219,255,.18); color: var(--cyan); font-size: 12px; text-align: center; }
.cp-tabs button.on .ct-n { background: rgba(20,26,56,.15); color: #141a38; }
.ct-live { padding: 1px 8px; border-radius: 999px; background: var(--crimson, #e0475b); color: #fff; font-size: 11.5px; animation: ctPulse 1.6s ease-in-out infinite; }
@keyframes ctPulse { 50% { opacity: .65; } }
@media (prefers-reduced-motion: reduce) { .ct-live { animation: none; } }
.dash.tabbed { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: none; gap: 14px; margin-top: 14px; }
.dash.tabbed .cgrid { display: grid; gap: 18px; align-items: start; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dash.tabbed .cgrid.one { grid-template-columns: minmax(0, 1fr); max-width: 1100px; }
.dash.tabbed .cgrid.fight { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.dash.tabbed .cgrid.enc { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.dash.tabbed #p-party .party-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.dash.tabbed .dcol .mlist { max-height: 520px; }
.dash.tabbed .dcol .log.notes { max-height: 640px; }
.cp-hint { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 14px; border: 2px dashed rgba(68,219,255,.55); background: rgba(68,219,255,.07); }
.cp-empty { text-align: left; }
@media (max-width: 1080px) { .dash.tabbed .cgrid, .dash.tabbed .cgrid.fight, .dash.tabbed .cgrid.enc { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .cp-tabs { display: grid; grid-template-columns: 1fr 1fr; } .cp-tabs button { justify-content: center; padding: 7px 8px; font-size: 13.5px; } }
.eb textarea { width: 100%; min-height: 64px; padding: 10px 12px; font: inherit; resize: vertical; box-sizing: border-box; }
.eb-lab { font-weight: 800; }
.eb-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.eb-diff { display: flex; flex-wrap: wrap; gap: 6px; }
.eb-diff .chip { cursor: pointer; min-height: 36px; padding: 6px 14px; font-weight: 800; }
.eb-diff .chip.on { background: #ffd23f; color: #141a38; border-color: var(--ink, #0b0f22); }
.eb-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.eb-card { display: grid; gap: 8px; align-content: start; padding: 12px 14px; border-radius: 14px; background: var(--bg2); border: 2.5px solid var(--ink, #0b0f22); border-top: 5px solid var(--vc, var(--cyan)); min-width: 0; }
.eb-card.v-easy { --vc: #3fd28b; } .eb-card.v-fair { --vc: #44dbff; } .eb-card.v-hard { --vc: #ffb23f; } .eb-card.v-deadly { --vc: #e0475b; }
.eb-ch { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.eb-v { font-weight: 800; color: var(--vc); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.eb-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.eb-card li small { color: var(--muted); }
.eb-st { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.eb-st b { color: var(--text); }
.eb-card .filebar { margin: 0; gap: 6px; }
.dash.tabbed .dcol, .dash.tabbed #p-enc, .dash.tabbed #p-fight, .dash.tabbed #p-table { grid-area: auto; }
@media (max-width: 760px) { .gm-strip .gs-head { flex-wrap: wrap; } .gm-strip .cp-tabs { width: 100%; } }
/* remove button on vehicle + companion cards */
.as-top .as-x { margin-left: auto; flex: 0 0 auto; min-width: 36px; height: 36px; padding: 0 10px; border-radius: 999px; border: 2px solid var(--line); background: transparent; color: var(--muted); font-weight: 800; cursor: pointer; }
.as-top .as-x:hover { color: #fff; border-color: var(--crimson, #e0475b); background: rgba(224,71,91,.18); }
.as-top .as-x.sure { color: #fff; background: var(--crimson, #e0475b); border-color: var(--crimson, #e0475b); font-size: 13px; }

/* ---------- Adventure maker (Campaign > Adventure, js/adventure.js) */
.av-wrap { display: grid; gap: 14px; }
.av-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.av-make .av-row { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; align-items: center; margin: 10px 0; }
.av-lab { font-weight: 700; } .av-lab small { font-weight: 400; color: var(--muted); }
.av-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.av-make select, .av-make input { max-width: 420px; width: 100%; }
.av-doc { background: var(--bg2); border: 2.5px solid var(--ink, #0b0f22); border-radius: 16px; padding: 18px 20px; display: grid; gap: 12px; }
.av-doc h2 { margin: 0; }
.av-hook { font-size: 1.08rem; margin: 6px 0 0; }
.av-secret { border: 2px dashed rgba(224,71,91,.55); border-radius: 12px; padding: 8px 12px; background: rgba(224,71,91,.06); }
.av-secret summary { cursor: pointer; font-weight: 700; color: #ff8a98; }
.av-cast { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin: 0; }
.av-cast span { padding: 8px 10px; border-radius: 10px; background: var(--panel2); font-size: 14px; }
.av-cast small { color: var(--cyan); margin-left: 4px; }
.av-sess { border: 2px solid var(--line); border-radius: 12px; background: var(--panel); }
.av-sess[open] { border-color: rgba(68,219,255,.55); }
.av-sess summary { display: flex; gap: 12px; align-items: center; padding: 10px 12px; cursor: pointer; list-style: none; }
.av-sess summary::-webkit-details-marker { display: none; }
.av-sess summary small { display: block; color: var(--muted); font-size: 13px; }
.av-n { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--cyan); color: #04121a; border: 2px solid var(--ink, #0b0f22); }
.av-body { padding: 0 14px 14px; display: grid; gap: 8px; }
.av-body p { margin: 0; }
.av-body h4 { margin: 6px 0 0; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); }
.av-scenes { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.av-scenes .tag { margin-right: 6px; }
.av-people { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14.5px; }
.av-fight { padding: 10px 12px; border-radius: 12px; border: 2px solid var(--ink, #0b0f22); border-left: 6px solid var(--vc, var(--cyan)); background: var(--bg2); display: grid; gap: 6px; }
.av-fight.v-easy { --vc: #3fd28b; } .av-fight.v-fair { --vc: #44dbff; } .av-fight.v-hard { --vc: #ffb23f; } .av-fight.v-deadly, .av-fight.v-near { --vc: #e0475b; }
.av-fight ul { margin: 0; padding-left: 18px; }
.av-fh { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.av-fight .eb-v { color: var(--vc); }
.av-lvl { color: var(--gold2, #ffd36a); font-weight: 700; }
.av-list { display: grid; gap: 10px; }
.av-card { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--bg2); border: 2.5px solid var(--ink, #0b0f22); }
.av-card small { display: block; color: var(--muted); }
.av-card p { margin: 6px 0 0; font-size: 14.5px; }
.av-card .av-sh { color: var(--cyan); }
.av-rate { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.av-star { background: none; border: 0; padding: 0 1px; font-size: 20px; line-height: 1; color: rgba(255,255,255,.22); cursor: default; box-shadow: none !important; }
.av-stars.mine .av-star { cursor: pointer; } .av-stars.mine .av-star:hover, .av-star.on { color: #ffd36a; }
.av-runhead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: flex-start; }
.av-runhead h2 { margin: 0; }
.av-pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.av-pager .chip.done { opacity: .75; }
.av-bar { margin-bottom: 4px; }
@media (max-width: 760px) { .av-make .av-row { grid-template-columns: 1fr; } .av-doc { padding: 14px 12px; } }
@media print {
  body.av-printing .top, body.av-printing .gm-strip, body.av-printing .sheet-top, body.av-printing .av-tabs, body.av-printing .av-run .filebar, body.av-printing .av-fight .filebar, body.av-printing footer, body.av-printing .cp-drawer { display: none !important; }
  body.av-printing, body.av-printing .av-doc, body.av-printing .av-sess, body.av-printing .av-fight, body.av-printing .av-cast span { background: #fff !important; color: #000 !important; }
  body.av-printing .av-sess { break-inside: avoid-page; }
}
/* scavenge / hunt roller */
.scv { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: rgba(5,8,20,.72); backdrop-filter: blur(4px); }
.scv-card { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; display: grid; gap: 12px; padding: 18px 20px; border-radius: 18px; background: var(--panel, #1b2148); border: 3px solid var(--ink, #0b0f22); box-shadow: 6px 6px 0 var(--ink, #0b0f22); }
.scv-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.scv-top h2 { margin: 0; font-size: 22px; }
.scv-x { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); background: transparent; color: var(--text); font-size: 16px; cursor: pointer; }
.scv-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.scv-tabs button { border: 2.5px solid var(--ink, #0b0f22); background: var(--bg2); color: var(--text); border-radius: 999px; padding: 6px 14px; font-weight: 800; cursor: pointer; min-height: 38px; }
.scv-tabs button.on { background: #ffd23f; color: #141a38; }
.scv-help { margin: 0; font-size: 13.5px; }
.scv-ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.scv-ctl label, .scv-give label { display: grid; gap: 4px; font-weight: 700; font-size: 13px; flex: 1 1 200px; min-width: 0; }
.scv-ctl select, .scv-give select { width: 100%; padding: 8px 10px; border: 2.5px solid var(--ink, #0b0f22); border-radius: 12px; background: #141a38; color: var(--text); font: inherit; }
.scv-sum { margin: 0; }
.scv-d { display: inline-block; margin: 0 6px 0 0; padding: 1px 7px; border-radius: 6px; background: rgba(63,210,139,.16); color: #8ff0bd; font-size: 12px; font-weight: 800; white-space: nowrap; }
.scv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.scv-list li label { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 8px 10px; border-radius: 10px; background: var(--bg2); cursor: pointer; }
.scv-list li.boring label { opacity: .6; }
.scv-list small { color: var(--muted); }
.scv-r { display: block; font-size: 11.5px; }
.scv-give { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
@media (max-width: 560px) { .scv-list li label { grid-template-columns: auto minmax(0, 1fr); } .scv-list .scv-d { grid-column: 2; justify-self: start; } .scv-list .scv-t { grid-column: 1 / -1; } }
/* Threadburn backlash window (Aos) */
.tb { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); background: radial-gradient(circle at 50% 45%, rgba(120,20,40,.55), rgba(4,4,12,.92) 70%); animation: tbIn .35s ease-out; }
.tb.out { animation: tbOut .25s ease-in forwards; }
@keyframes tbIn { from { opacity: 0; } } @keyframes tbOut { to { opacity: 0; } }
.tb-card { position: relative; overflow: hidden; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; border-radius: 20px; background: #160a1c; border: 3px solid #ff4d6d; box-shadow: 0 0 40px rgba(255,77,109,.45), 6px 6px 0 #0b0f22; animation: tbShake .6s cubic-bezier(.36,.07,.19,.97) .15s both; }
@keyframes tbShake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px) rotate(-.4deg); } 40%, 60% { transform: translateX(7px) rotate(.4deg); } }
.tb-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .75; }
.tb-th { fill: none; stroke: #ffb3c1; stroke-linecap: round; filter: drop-shadow(0 0 3px #ff4d6d); stroke-dasharray: 160; stroke-dashoffset: 0; animation: tbSnap 1.4s cubic-bezier(.6,0,.4,1) calc(var(--i) * 70ms) forwards, tbHum .18s linear calc(var(--i) * 30ms) 6 alternate; }
@keyframes tbHum { to { transform: translateY(1.2px); } }
@keyframes tbSnap { 0% { stroke-dashoffset: 0; stroke: #ffe3ea; } 55% { stroke-dashoffset: 0; stroke: #ff4d6d; } 70% { stroke-dasharray: 40 20; } 100% { stroke-dasharray: 6 40; stroke-dashoffset: 120; opacity: .15; stroke: #7a1030; } }
.tb-in { position: relative; display: grid; gap: 12px; padding: 22px 22px 20px; text-align: center; }
.tb-kick { font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: #ffb3c1; }
.tb-title { margin: 0; font-size: clamp(34px, 9vw, 54px); letter-spacing: .06em; color: #ff4d6d; text-shadow: 0 0 18px rgba(255,77,109,.8), 3px 3px 0 #0b0f22; animation: tbFlick 1.2s steps(2) .2s 3; }
@keyframes tbFlick { 50% { opacity: .55; } }
.tb-body { display: grid; gap: 12px; justify-items: center; }
.tb-body p { margin: 0; max-width: 46ch; line-height: 1.5; }
.tb-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tb-dice { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tb-dice .d { animation: tbDrop .4s cubic-bezier(.2,.8,.3,1.3) calc(var(--i) * 60ms) both; }
@keyframes tbDrop { from { transform: translateY(-24px) rotate(-90deg); opacity: 0; } }
.tb-die-wrap { display: flex; align-items: center; gap: 10px; justify-content: center; min-height: 92px; }
.tb-die { display: grid; place-items: center; width: 84px; height: 84px; clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); background: linear-gradient(160deg, #ff8fa3, #b3123a); color: #fff; font: 800 34px/1 var(--head, sans-serif); text-shadow: 2px 2px 0 #0b0f22; }
.tb-die.spin { animation: tbSpin .5s linear infinite; }
@keyframes tbSpin { to { transform: rotate(360deg) scale(.92); } }
.tb-die.land { animation: tbLand .45s cubic-bezier(.2,.8,.3,1.4); }
@keyframes tbLand { from { transform: scale(1.8) rotate(-30deg); opacity: 0; } }
.tb-die.r-snapped { background: linear-gradient(160deg, #6b0f24, #1a0208); box-shadow: 0 0 30px #ff0033; }
.tb-plus { font-weight: 800; font-size: 22px; color: #8ff0bd; }
.tb-res { margin: 0; font-size: 28px; letter-spacing: .08em; text-transform: uppercase; }
.tb-res.r-snapped { color: #ff2a4d; } .tb-res.r-burned { color: #ff7a45; } .tb-res.r-scorched { color: #ffb23f; } .tb-res.r-singed { color: #ffd98a; }
.tb-apply { font-size: 14px; color: #ffd5de; }
@media (prefers-reduced-motion: reduce) { .tb, .tb-card, .tb-th, .tb-title, .tb-dice .d, .tb-die, .tb-die.spin, .tb-die.land { animation: none !important; } }

/* campaign polish: getting-started steps, new-campaign window, ready hero cards */
.cp-guide { display: grid; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--panel, #1b2148); border: 2.5px solid var(--ink, #0b0f22); box-shadow: 4px 4px 0 var(--ink, #0b0f22); }
.cp-guide ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; counter-reset: none; }
.cp-guide li button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; font-weight: 800; font-size: 14px; text-align: left; cursor: pointer; min-height: 44px; }
.cp-guide li i { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-style: normal; font-size: 13px; background: var(--bg, #0e1330); border: 2px solid var(--line); }
.cp-guide li.done button { opacity: .75; }
.cp-guide li.done i { background: #3fd28b; color: #0b0f22; border-color: #0b0f22; }
.cp-guide li.now button { border-color: #ffd23f; background: rgba(255,210,63,.12); }
.cp-guide li.now i { background: #ffd23f; color: #141a38; border-color: #0b0f22; }
.cg-next { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.cg-next > span:first-child { min-width: 0; flex: 1 1 260px; }
.cg-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 640px) { .cp-guide ol { grid-template-columns: 1fr 1fr; } .cp-guide li button { font-size: 13px; padding: 6px 8px; } }
.cw-card { width: min(760px, 100%); }
.cw-f { display: grid; gap: 4px; font-weight: 800; }
.cw-f input { font: inherit; padding: 10px 12px; border-radius: 10px; }
.cw-l { margin: 4px 0 -4px; font-weight: 800; }
.cw-opts { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cw-opts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cw-o { display: grid; gap: 3px; align-content: start; text-align: left; padding: 10px 12px; border-radius: 12px; border: 2.5px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; cursor: pointer; min-height: 64px; }
.cw-o small { color: var(--muted, #b8b3c8); line-height: 1.35; }
.cw-o.on { border-color: #ffd23f; background: rgba(255,210,63,.12); box-shadow: 3px 3px 0 var(--ink, #0b0f22); }
.cw-chk { display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.cw-chk input { width: 18px; height: 18px; flex: none; margin-top: 2px; }
@media (max-width: 560px) { .cw-opts, .cw-opts.three { grid-template-columns: minmax(0, 1fr); } .cw-o { min-height: 0; } }
.rc-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 8px; }
.rc-card { display: grid; gap: 4px; align-content: start; text-align: left; padding: 10px 12px; border-radius: 14px; border: 2.5px solid var(--ink, #0b0f22); background: var(--bg2); color: var(--text); font: inherit; cursor: pointer; min-width: 0; }
.rc-card small { color: var(--muted, #b8b3c8); font-weight: 700; }
.rc-card span { font-size: 13.5px; line-height: 1.4; }
.rc-card em { font-style: normal; font-weight: 800; color: var(--cyan, #44dbff); }
.rc-card:hover:not([disabled]) { border-color: var(--cyan, #44dbff); }
.rc-card.in { cursor: default; opacity: .7; }
.rc-card.in em { color: #3fd28b; }
.av-more { margin-top: 8px; }
.av-more > summary { cursor: pointer; font-weight: 800; padding: 6px 0; }
.av-more > .av-list, .av-more > .rc-grid { margin-top: 8px; }
.cp-settings .fields { margin-bottom: 8px; }
.cp-next { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(63,210,139,.08); border: 2px dashed rgba(63,210,139,.5); }
.cp-next span { flex: 1 1 220px; }
.f-initw { display: grid; gap: 2px; justify-items: center; }
.f-initw small { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #b8b3c8); }
.f-initw .f-init { width: 100%; }
.btn.pulse { animation: cpPulse 1.6s ease-in-out infinite; }
@keyframes cpPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,210,63,.55); } 50% { box-shadow: 0 0 0 6px rgba(255,210,63,0); } }
@media (prefers-reduced-motion: reduce) { .btn.pulse { animation: none; } }
.savefail { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 120; max-width: 640px; margin: 0 auto; padding: 12px 14px; border-radius: 14px; background: #ffd23f; color: #141a38; border: 3px solid #0b0f22; box-shadow: 4px 4px 0 #0b0f22; line-height: 1.4; }
.savefail button { margin-left: 8px; font: inherit; font-weight: 800; padding: 4px 12px; border-radius: 999px; border: 2px solid #0b0f22; background: #fff; color: #141a38; cursor: pointer; }
/* fix: on phones and tablets the sign-in card must scroll with the page. The v54 portal rule made it sticky again,
   so the world cards slid over the password box when the keyboard was open. */
@media (max-width: 980px) { .join-card { position: relative; top: auto; z-index: 2; } .join-art { position: relative; top: auto; } }
/* old wiki rules pages point to the current rule */
.lib-archive { margin: 0 0 18px; padding: 12px 16px; border-radius: 14px; background: rgba(255,210,63,.12); border: 2px dashed rgba(255,210,63,.7); line-height: 1.5; }
.lib-archive a { font-weight: 800; }
/* Player view: GM links inside sentences stay, with a small label */
html[data-mode="player"] a[data-gm-in]::after { content: "GM"; display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 6px; font-size: .68em; font-weight: 800; letter-spacing: .04em; vertical-align: .15em; background: rgba(255,210,63,.18); color: var(--gold, #ffcf3f); border: 1px solid rgba(255,210,63,.5); }

/* class / species picker (sheet Build step 1) */
.pk-open { display: inline-block; margin-top: 6px; font-size: 13.5px; text-align: left; }
.pk-box { width: min(1040px, 100%); gap: 10px; }
.pk-help { margin: 0; font-size: 13.5px; }
.pk-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; min-height: 0; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.pk-card { display: grid; gap: 6px; justify-items: center; padding: 8px 6px 10px; border-radius: 14px; border: 2.5px solid var(--ink, #0b0f22); background: var(--bg2); color: var(--text); cursor: pointer; font: inherit; font-size: 13.5px; line-height: 1.2; text-align: center; box-shadow: 3px 3px 0 var(--ink, #0b0f22); transition: transform .12s, box-shadow .12s; }
.pk-card:hover, .pk-card:focus-visible { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink, #0b0f22); outline: none; border-color: var(--cyan); }
.pk-card.on { background: color-mix(in srgb, var(--cyan) 22%, var(--bg2)); border-color: var(--cyan); }
.pk-img { width: 100%; aspect-ratio: 1; max-width: 100%; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--cyan) 10%, transparent); }
.pk-img img { width: 100%; height: 100%; object-fit: cover; }
.pk-mono { font-family: var(--display, 'Lilita One', sans-serif); font-size: 30px; color: var(--cyan); letter-spacing: .02em; }
.pk-prev { position: sticky; top: 0; display: grid; gap: 10px; padding: 12px; border-radius: 14px; border: 2.5px solid var(--ink, #0b0f22); background: color-mix(in srgb, var(--cyan) 7%, var(--panel, #1b2148)); }
.pk-pimg { aspect-ratio: 1; max-width: 100%; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--cyan) 10%, transparent); }
.pk-pimg img { width: 100%; height: 100%; object-fit: cover; }
.pk-pimg .pk-mono { font-size: 64px; }
.pk-ptxt h3 { margin: 0 0 4px; font-size: 20px; }
.pk-ptxt p { margin: 0 0 8px; font-size: 14px; }
.pk-ptxt ul { margin: 0 0 10px; padding-left: 18px; font-size: 13.5px; display: grid; gap: 4px; }
.pk-go { width: 100%; }
@media (max-width: 760px) {
  .pk-body { grid-template-columns: 1fr; }
  .pk-prev { order: -1; position: static; grid-template-columns: 72px minmax(0, 1fr); align-items: start; padding: 10px; gap: 10px; scroll-margin-top: 8px; }
  .pk-ptxt h3 { font-size: 17px; }
  .pk-ptxt p, .pk-ptxt ul { font-size: 13px; }
  .pk-go { min-height: 44px; }
  .pk-pimg .pk-mono { font-size: 36px; }
  .pk-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .pk-card { transition: none; } }

/* effects added by themselves (Campaign attack result, sheet power rolls) */
.ak-fx { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.ak-fx .fx-chip { display: inline-flex; align-items: center; gap: 6px; }
.ak-fx .fx-chip small { opacity: .75; }
.ak-fx .f-x { min-width: 28px; min-height: 28px; }
.fx-auto { color: var(--cyan); }

/* step-by-step build: steps bar with points left (sticky), one step at a time */
.bstep-bar { position: sticky; top: 72px; z-index: 12; display: grid; gap: 8px; padding: 10px 12px; margin-bottom: 14px; border-radius: 16px; background: color-mix(in srgb, var(--panel, #1b2148) 94%, transparent); border: 2.5px solid var(--ink, #0b0f22); box-shadow: 4px 4px 0 var(--ink, #0b0f22); backdrop-filter: blur(6px); }
.bstep-dots { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.bstep-dot { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 2px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; }
.bstep-dot b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--cyan) 20%, transparent); font-size: 14px; }
.bstep-dot.extra { opacity: .8; border-style: dashed; }
.bstep-dot.on { border-color: var(--cyan); background: color-mix(in srgb, var(--cyan) 18%, var(--bg2)); font-weight: 800; }
.bstep-dot.on b { background: var(--cyan); color: #0b0f22; }
.bstep-left { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13.5px; }
.bstep-left > span:not(.bstep-lbl) { display: inline-flex; gap: 6px; align-items: baseline; padding: 3px 10px; border-radius: 999px; border: 1.5px solid var(--line); }
.bstep-left .todo { border-color: #ffd23f; } .bstep-left .todo b { color: #ffd23f; }
.bstep-left .over { border-color: #ff8a8a; } .bstep-left .over b { color: #ff8a8a; }
.bstep-left .ok b { color: #5fe0a0; }
.bstep-lbl { opacity: .75; margin-right: auto; }
.bstep-nav { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 4px 0 18px; }
.bstep-ready { flex: 1 1 220px; font-weight: 700; }
@media (max-width: 860px) { .bstep-bar { top: 64px; } .bstep-dot span { display: none; } .bstep-dot.on span { display: inline; } .bstep-dot { padding-right: 4px; } .bstep-dot.on { padding-right: 12px; } }
@media (max-width: 760px) { .bstep-nav .btn { flex: 1 1 auto; min-height: 44px; } }

/* home: Make your hero */
.make-hero { scroll-margin-top: 90px; }
.mh-sub { margin: -6px 0 16px; font-size: 16px; opacity: .85; }
.mh-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.mh-card { display: grid; gap: 8px; align-content: start; padding: 18px 18px 20px; border-radius: 20px; text-decoration: none; color: var(--text); background: var(--panel, #1b2148); border: 3px solid var(--ink, #0b0f22); box-shadow: 6px 6px 0 var(--ink, #0b0f22); transition: transform .15s, box-shadow .15s; }
.mh-card:hover, .mh-card:focus-visible { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--ink, #0b0f22); outline: none; }
.mh-card b { font-family: var(--display, 'Lilita One', sans-serif); font-size: 26px; font-weight: 400; letter-spacing: .01em; }
.mh-card > span:last-child { font-size: 15px; opacity: .9; }
.mh-art { display: grid; place-items: center; height: 150px; border-radius: 14px; background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--cyan) 30%, transparent), transparent 70%); }
.mh-art img { height: 140px; width: auto; max-width: 100%; transition: transform .2s; }
.mh-card:hover .mh-art img { transform: rotate(-4deg) scale(1.06); }
.mh-own { border-top: 6px solid #ffd23f; } .mh-quiz { border-top: 6px solid #e0567f; } .mh-learn { border-top: 6px solid #5fe0a0; }
@media (max-width: 860px) { .mh-cards { grid-template-columns: 1fr; } .mh-card { grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 14px; } .mh-art { grid-row: span 2; height: 96px; } .mh-art img { height: 88px; } .mh-card b { font-size: 22px; align-self: end; } }
@media (prefers-reduced-motion: reduce) { .mh-card, .mh-art img { transition: none; } }

/* random name dice + Adventure Builder page */
.nm-row{display:flex;gap:6px;align-items:stretch}
.nm-row input{flex:1;min-width:0}
.nm-dice{flex:none;min-width:44px;font-size:1.1rem;padding:0 10px}
.adv-page .sheet-top p{max-width:60ch;margin:.3rem 0 0}
.av-link{margin:.2rem 0 .6rem}

/* Teach Me to Play (learn/index.html, js/learn.js) */
.learn { display: grid; gap: 18px; max-width: 980px; margin: 0 auto; }
.ln-head h1 { margin: .1rem 0 .3rem; }
.ln-head .lede { max-width: 62ch; }
.ln-worlds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ln-world { display: grid; gap: 6px; align-content: start; text-align: left; padding: 14px 14px 18px; border-radius: 20px; color: var(--text); background: var(--panel); border: 3px solid var(--ink, #0b0f22); box-shadow: 6px 6px 0 var(--ink, #0b0f22); cursor: pointer; font: inherit; transition: transform .15s, box-shadow .15s; }
.ln-world:hover, .ln-world:focus-visible { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--ink, #0b0f22); outline: none; }
.ln-world b { font-family: var(--display); font-size: 28px; font-weight: 400; }
.ln-world.w-earth { border-top: 6px solid var(--earth); } .ln-world.w-aos { border-top: 6px solid var(--aos); } .ln-world.w-space { border-top: 6px solid var(--space); }
.ln-wart svg { width: 100%; height: auto; border-radius: 14px; border: 3px solid var(--ink, #0b0f22); display: block; }
.ln-wtag { color: var(--gold); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.ln-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; }
.ln-steps li { flex: 1; height: 8px; border-radius: 6px; background: var(--panel2, #2f3c72); border: 2px solid var(--ink, #0b0f22); }
.ln-steps li.done { background: var(--cyan); } .ln-steps li.on { background: var(--gold); }
.ln-bar { position: sticky; top: 72px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 14px; border-radius: 16px; background: var(--panel2, #2f3c72); border: 3px solid var(--ink, #0b0f22); box-shadow: 4px 4px 0 var(--ink, #0b0f22); font-size: 14px; }
.ln-me { display: grid; line-height: 1.15; } .ln-me small { color: var(--muted); }
.ln-meter { display: inline-flex; align-items: center; gap: 6px; } .ln-meter small { color: var(--muted); }
.ln-hp { width: 90px; height: 12px; border-radius: 8px; background: #0b0f22; overflow: hidden; border: 2px solid var(--ink, #0b0f22); }
.ln-hp i { display: block; height: 100%; background: #5fe0a0; transition: width .3s; }
.ln-chip { padding: 3px 10px; border-radius: 999px; background: var(--panel); border: 2px solid var(--ink, #0b0f22); }
.ln-scene { margin: 0; border-radius: 20px; overflow: hidden; border: 3px solid var(--ink, #0b0f22); box-shadow: 6px 6px 0 var(--ink, #0b0f22); background: #0b0f22; }
.ln-scene svg { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; }
.ln-foe { transition: opacity .5s, filter .5s; }
.ln-foe.hit { animation: lnShake .4s; }
.ln-foe.dead { opacity: .25; filter: grayscale(1); }
.ln-zap { stroke-dasharray: 220; animation: lnZap .6s ease-out; }
@keyframes lnShake { 0%, 100% { transform: translate(600px, 70px) scale(-1, 1); } 25% { transform: translate(612px, 66px) scale(-1, 1); } 60% { transform: translate(592px, 74px) scale(-1, 1); } }
@keyframes lnZap { from { stroke-dashoffset: 220; } to { stroke-dashoffset: 0; } }
.ln-card { display: grid; gap: 12px; padding: 18px 20px 20px; border-radius: 20px; background: var(--panel); border: 3px solid var(--ink, #0b0f22); box-shadow: 6px 6px 0 var(--ink, #0b0f22); }
.ln-card h2 { margin: 0; }
.ln-card p { margin: 0; max-width: 68ch; }
.ln-tip { padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--cyan) 12%, var(--panel)); border: 2px dashed color-mix(in srgb, var(--cyan) 60%, transparent); display: grid; gap: 4px; }
.ln-tip b:first-child { color: var(--cyan); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.ln-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ln-lab { font-weight: 800; margin: 0; }
.ln-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.ln-ch { display: grid; gap: 4px; text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--panel2, #2f3c72); color: var(--text); border: 3px solid var(--ink, #0b0f22); box-shadow: 4px 4px 0 var(--ink, #0b0f22); cursor: pointer; font: inherit; }
.ln-ch:hover, .ln-ch:focus-visible, .ln-ch.on { border-color: var(--gold); outline: none; }
.ln-ch small { color: var(--muted); }
.ln-roll { display: grid; gap: 6px; }
.ln-dice { display: flex; flex-wrap: wrap; gap: 8px; }
.ln-die { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; font-family: var(--display); font-size: 22px; background: #e9e4d4; color: #0b0f22; border: 3px solid var(--ink, #0b0f22); box-shadow: 3px 3px 0 var(--ink, #0b0f22); }
.ln-die.ok { background: #5fe0a0; } .ln-die.crit { background: #ffcf3f; }
.ln-die.cos { outline: 3px solid #ff7fb0; outline-offset: 2px; }
.ln-roll.tumble .ln-die { animation: lnTumble .5s calc(var(--i) * 60ms) both; }
@keyframes lnTumble { from { transform: rotate(-200deg) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.ln-sum small { color: var(--muted); display: block; }
.ln-out { padding: 8px 12px; border-radius: 12px; background: var(--panel2, #2f3c72); }
.ln-out.win { border-left: 6px solid #5fe0a0; } .ln-out.lose { border-left: 6px solid var(--crimson); }
.ln-stress { color: var(--crimson); }
.ln-foe { color: var(--muted); }
p.ln-foe b { color: var(--text); }
.ln-power { padding: 10px 14px; border-radius: 14px; background: var(--panel2, #2f3c72); border: 2px solid var(--ink, #0b0f22); }
.ln-power small { color: var(--gold); margin-left: 6px; }
.ln-hero { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.ln-port svg { width: 100%; height: auto; border-radius: 18px; border: 3px solid var(--ink, #0b0f22); box-shadow: 6px 6px 0 var(--ink, #0b0f22); display: block; margin-bottom: 10px; }
.ln-hform { display: grid; gap: 10px; min-width: 0; }
.ln-name { display: grid; gap: 4px; font-weight: 800; }
.ln-cls { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.ln-c { display: grid; gap: 4px; padding: 6px; border-radius: 12px; background: var(--panel2, #2f3c72); color: var(--text); border: 3px solid var(--ink, #0b0f22); cursor: pointer; font: inherit; font-size: 13px; font-weight: 800; text-align: center; }
.ln-c img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.ln-c.on { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold); }
.ln-csum { padding: 10px 12px; border-radius: 12px; background: var(--panel2, #2f3c72); }
.ln-learned { display: grid; gap: 6px; padding-left: 20px; margin: 0; }
.ln-final { font-weight: 800; color: var(--gold); }
@media (max-width: 760px) {
  .ln-worlds { grid-template-columns: 1fr; }
  .ln-world { grid-template-columns: 96px minmax(0, 1fr); column-gap: 12px; } .ln-wart { grid-row: span 3; } .ln-world b { font-size: 22px; }
  .ln-hero { grid-template-columns: 1fr; } .ln-port { max-width: 260px; } .ln-cls { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ln-c { font-size: 11px; }
  .ln-bar { top: 64px; font-size: 13px; } .ln-bar .ln-chip:last-child { display: none; }
  .ln-die { width: 38px; height: 38px; font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { .ln-world, .ln-foe, .ln-hp i { transition: none; } .ln-foe.hit, .ln-zap, .ln-roll.tumble .ln-die { animation: none; } }
.ln-nav { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ===== v71 polish pass ===== */
@media (max-width: 760px) {
  .sheet-app .hb-lvup { font-size: 10px; padding: 4px 8px; bottom: -8px; letter-spacing: .04em; }
}
.scv-card { max-height: calc(100dvh - 32px); }
/* Teach Me to Play: keep the picture, story and buttons on screen together */
.learn { scroll-margin-top: 76px; }
@media (min-width: 1000px) {
  .learn:has(> .ln-scene) { max-width: 1240px; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
  .learn:has(> .ln-scene) > * { grid-column: 1 / -1; }
  .learn:has(> .ln-scene) > .ln-scene { grid-column: 1; position: sticky; top: calc(88px + var(--lnbar, 64px)); }
  .learn:has(> .ln-scene) > .ln-card { grid-column: 2; }
  .learn:has(> .ln-scene) .ln-choices { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .ln-bar { top: 64px; padding: 8px 10px; gap: 6px 10px; font-size: 13px; }
  .ln-bar { flex-wrap: nowrap; justify-content: space-between; }
  .ln-bar .ln-me, .ln-bar .ln-meter > small { display: none; }
  .ln-bar .ln-hp { width: 56px; }
  .ln-bar .ln-meter::before { content: "\2764"; color: #ff6b81; }
  .ln-bar .ln-chip { padding: 2px 8px; white-space: nowrap; }
  .ln-bar .ln-chip:last-child { display: none; }
  .learn { scroll-margin-top: 66px; gap: 14px; }
}

/* new character art (2026-11-05): class and species pictures crop from the top so faces stay in frame */
.card img[src*="/cls-"], .card img[src*="/sp-"], .doc-head .hero-art[src*="/cls-"], .doc-head .hero-art[src*="/sp-"] { object-position: 50% 4%; }
.wg-item img[src*="/gallery/"] { object-position: 50% 4%; }

/* sign-up page calm-down (2026-11-05): the form stays still, sits near the top and nothing pops over it */
body.joining .pals, body.joining .pal, body.joining .pal-sit, body.joining .pal-fly, body.joining [class*="pal-peek"] { display: none !important; }
body.joining .join > *, body.joining .join-card, body.joining .join-card::before, body.joining .join-card::after,
body.joining .join-card .btn.primary::after, body.joining .join-title span, body.joining .join-kicker,
body.joining .join-art, body.joining .join-art img, body.joining .join-ring, body.joining .jc-base { animation: none !important; }
body.joining .join-card::before { display: none; }
body.joining .join-card { position: relative !important; top: auto; transform: none !important; }
body.joining .join-card .btn.primary:hover, body.joining .join-card .btn.primary:active { transform: none; }
body.joining .join-art { position: relative !important; top: auto !important; }
body.joining .join-title { font-size: clamp(34px, 4.6vw, 60px); margin: 6px 0 8px; }
body.joining .join-lede { font-size: 17px; }
body.joining .join-card { padding-top: 30px; }
@media (min-width: 981px) {
  body.joining .join { grid-template-areas: "art head" "art card" "worlds worlds" "perks perks"; align-items: start; }
  body.joining .join-art { width: min(100%, 360px); }
}
@media (max-width: 980px) {
  body.joining .join { grid-template-areas: "head" "card" "art" "worlds" "perks"; }
  body.joining .join-art { width: min(70%, 280px); }
}
@media (max-width: 640px) {
  body.joining .join-title { font-size: 32px; }
  body.joining .join-lede { font-size: 15px; }
  body.joining .join-kicker { font-size: 11px; letter-spacing: .14em; }
  body.joining .join-card { padding: 24px 14px 22px; border-radius: 26px; }
}

/* Earth item pictures (2026-11-05): picture on top, the old SVG/emoji icon only shows if the picture fails */
.it-ico .ico-fb { display: contents; }
.it-ico.im { padding: 0; overflow: hidden; background: #0b0f22; }
.it-ico.im .ico-fb { display: none; }
.it-ico.im img { width: 100%; height: 100%; object-fit: cover; display: block; }
.it .it-ico.im { width: 40px; height: 40px; }
.ib-row .it-ico.im { width: 56px; height: 56px; border-radius: 12px; }

/* Aos landing: the fact strip is a row of links */
.aosl-facts a { display: block; padding: 1rem .6rem; text-align: center; border-left: 1px solid rgba(240,139,214,.18); text-decoration: none; color: inherit; transition: background .15s; }
.aosl-facts a:first-child { border-left: 0; }
.aosl-facts a:hover, .aosl-facts a:focus-visible { background: rgba(240,139,214,.14); }
.aosl-facts a:hover b { text-decoration: underline; text-underline-offset: 4px; }
#continents { scroll-margin-top: 90px; }
@media (max-width: 640px) { .aosl-facts a:nth-child(4) { border-left: 0; } }

/* Species page (species/index.html) */
.spx-app h1 { margin: .2rem 0 .3rem; }
.spx-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0 .6rem; }
.spx-tabs button { font: inherit; font-weight: 800; padding: .55rem 1.2rem; min-height: 44px; border-radius: 999px; border: 3px solid #0b0f22; background: #1b2347; color: #f4ecd8; cursor: pointer; box-shadow: 3px 3px 0 #0b0f22; }
.spx-tabs button[aria-selected="true"] { background: #ffd93b; color: #0b0f22; }
.spx-count { margin: 0 0 1rem; }
.spx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.spx-card { display: flex; flex-direction: column; border: 3px solid #0b0f22; border-radius: 16px; overflow: hidden; background: rgba(20,26,56,.92); box-shadow: 4px 4px 0 #0b0f22; }
.spx-img { aspect-ratio: 4/3; background: #0b0f22; display: grid; place-items: center; }
.spx-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 4%; display: block; }
.spx-mono { font-family: 'Lilita One', sans-serif; font-size: 3rem; color: #44dbff; opacity: .8; }
.spx-b { padding: .8rem 1rem 1rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.spx-b h3 { margin: 0; }
.spx-b p { margin: 0; font-size: .95rem; }
.spx-b ul { margin: 0; padding-left: 1.1rem; font-size: .9rem; }
.spx-more { margin-top: auto; padding-top: .4rem; font-weight: 800; }
.spx-cta { margin-top: 1.5rem; display: flex; gap: .6rem; flex-wrap: wrap; }
@media (max-width: 560px) { .spx-grid { grid-template-columns: 1fr; } }

/* Earth / Space Opera: clickable "at a glance" strip, same idea as the Aos landing */
.wfacts { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0 0 1.5rem; border: 3px solid #0b0f22; border-radius: 16px; overflow: hidden; background: rgba(11,15,34,.75); box-shadow: 4px 4px 0 #0b0f22; }
.wfacts a { display: block; padding: .9rem .5rem; text-align: center; text-decoration: none; color: inherit; border-left: 1px solid rgba(255,255,255,.12); transition: background .15s; }
.wfacts a:first-child { border-left: 0; }
.wfacts a:hover, .wfacts a:focus-visible { background: rgba(255,255,255,.08); }
.wfacts b { display: block; font-family: 'Lilita One', sans-serif; font-size: 1.8rem; line-height: 1.1; color: var(--accent, #44dbff); }
.wfacts span { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.wfacts a:hover b { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 640px) { .wfacts { grid-template-columns: repeat(3, 1fr); } .wfacts a:nth-child(4) { border-left: 0; } .wfacts a:nth-child(n+4) { border-top: 1px solid rgba(255,255,255,.12); } }
/* fact strips: flex so the boxes fill the row when Player view hides the monsters box */
.aosl-facts, .wfacts { display: flex; flex-wrap: wrap; }
.aosl-facts > a, .wfacts > a { flex: 1 1 0; min-width: 0; }
@media (max-width: 640px) { .aosl-facts > a, .wfacts > a { flex: 1 1 33%; } }

/* Header logo: the portal with three fate threads orbiting it (Earth, Aos, Space). Name on one line. */
.brand .knot { width: 50px; height: 50px; overflow: visible; }
.brand .knot::before { display: none; }
.brand .knot .orbits { position: absolute; left: 50%; top: 50%; width: 74px; height: 74px; margin: -37px 0 0 -37px; pointer-events: none; overflow: visible; }
.brand .knot .ob-back { z-index: 1; }
.brand .knot .ob-front { z-index: 3; }
.brand .knot .orbits path, .brand .knot .orbits circle { filter: drop-shadow(0 0 2px currentColor); }
.brand .knot .ob-run { stroke-dasharray: 26 102; animation: obRun 3.9s linear infinite; }
@keyframes obRun { to { stroke-dashoffset: -128; } }
.brand:hover .knot .ob-run { animation-duration: 1.6s; }
.brand .sub { white-space: nowrap; letter-spacing: .14em; }
@media (prefers-reduced-motion: reduce) { .brand .knot .ob-run { animation: none; } .brand .knot .orbits circle { display: none; } }
@media (max-width: 860px) { .brand .knot .orbits { width: 62px; height: 62px; margin: -31px 0 0 -31px; } }
/* if "Threads of Fate Universe" won't fit on one line, wrap it and centre "Universe" under the rest */
@media (min-width: 861px) and (max-width: 1279px) {
  header.top .brand .sub { display: block; white-space: nowrap; text-align: center; letter-spacing: .1em; font-size: 9.5px; line-height: 1.25; }
  header.top .brand .sub .u { display: block; }
}

/* ---------- Live table (js/live.js): GM bar on Campaign, player panel on the Character Sheet */
.lv-panel, .lv-gm { margin: 14px 0; padding: 14px 16px; border-radius: 18px; border: 3px solid var(--ink, #0b0f22); background: rgba(20, 28, 64, .92); box-shadow: 0 6px 0 var(--ink, #0b0f22); }
.lv-panel[hidden] { display: none; }
.lv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.lv-head > b { font-family: 'Lilita One', system-ui, sans-serif; font-weight: 400; font-size: 1.15rem; letter-spacing: .02em; }
.lv-head .btn:last-child { margin-left: auto; }
.lv-dot { width: 12px; height: 12px; border-radius: 50%; background: #8a8fa8; box-shadow: 0 0 0 2px var(--ink, #0b0f22); flex: none; }
.lv-dot.live { background: #46e88a; animation: lvPulse 1.6s ease-in-out infinite; }
.lv-dot.connecting, .lv-dot.retrying { background: #ffd24a; }
.lv-dot.offline { background: #ff5a4a; }
@keyframes lvPulse { 50% { box-shadow: 0 0 0 2px var(--ink, #0b0f22), 0 0 0 7px rgba(70, 232, 138, .25); } }
.lv-code { font-family: 'Alfa Slab One', 'Lilita One', monospace; font-size: 1.5rem; letter-spacing: .18em; padding: 2px 12px; border-radius: 10px; background: #fff3c4; color: #0b0f22; border: 3px solid var(--ink, #0b0f22); user-select: all; }
.lv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.lv-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lv-box { background: rgba(8, 12, 32, .55); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.lv-box h3 { margin: 0 0 8px; font-size: 1rem; }
.lv-peers { display: grid; gap: 8px; }
.lv-peer { padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .05); }
.lv-peer.down { opacity: .6; }
.lv-pn { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.lv-pn small { opacity: .75; }
.lv-pm { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: .85rem; margin-top: 4px; }
.lv-bar { display: inline-block; width: 90px; height: 9px; border-radius: 6px; background: rgba(0, 0, 0, .45); overflow: hidden; vertical-align: middle; border: 2px solid var(--ink, #0b0f22); }
.lv-bar i { display: block; height: 100%; background: #46e88a; transition: width .25s ease; }
.lv-bar.low i { background: #ffb02e; } .lv-bar.out i { background: #ff5a4a; }
.lv-fx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.lv-round { font-size: .9rem; margin-bottom: 6px; opacity: .85; }
.lv-turns { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.lv-turns li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 2px solid transparent; }
.lv-turns li.foe b { color: #ff9b8f; }
.lv-turns li.now { border-color: #ffd24a; background: rgba(255, 210, 74, .14); }
.lv-turns li.me b::after { content: ' (you)'; font-weight: 400; opacity: .7; }
.lv-turns li.down { opacity: .5; text-decoration: line-through; }
.lv-init { min-width: 1.6em; text-align: center; font-weight: 800; opacity: .8; }
.lv-look, .lv-cond { opacity: .8; }
.lv-cond { color: #c77dff; }
.lv-yours { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; padding: 10px 14px; border-radius: 14px; background: #ffd24a; color: #0b0f22; border: 3px solid var(--ink, #0b0f22); animation: lvGlow 1.4s ease-in-out infinite; }
.lv-yours b { font-family: 'Lilita One', system-ui, sans-serif; font-weight: 400; font-size: 1.3rem; }
.lv-yours .btn { margin-left: auto; }
@keyframes lvGlow { 50% { box-shadow: 0 0 18px rgba(255, 210, 74, .8); } }
.lv-rolls { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; max-height: 300px; overflow-y: auto; font-size: .88rem; }
.lv-roll { padding: 5px 8px; border-radius: 9px; background: rgba(255, 255, 255, .04); }
.lv-roll.mine { background: rgba(68, 219, 255, .1); }
.lv-roll small { opacity: .6; margin-left: 4px; }
.lv-dice .d { display: inline-grid; place-items: center; min-width: 1.5em; height: 1.5em; margin: 0 1px; border-radius: 5px; background: rgba(0, 0, 0, .4); font-weight: 800; font-size: .8rem; }
.lv-dice .d.h { background: #2fbf6b; color: #04140a; }
.lv-dice .d.g { background: #ffcf3a; color: #2a1c00; }
.lv-log { margin-top: 8px; font-size: .85rem; } .lv-log ol { margin: 6px 0 0; padding-left: 18px; }
.lv-shared { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.lv-shared img { width: 100%; border-radius: 10px; display: block; margin-top: 6px; }
.lv-join h2 { margin: 0 0 4px; }
.lv-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 8px; }
.lv-form label { display: grid; gap: 4px; font-weight: 700; }
.lv-form input { font-size: 1.3rem; letter-spacing: .16em; text-transform: uppercase; width: 9em; padding: 8px 10px; border-radius: 10px; }
.btn.lv-btn.live { background: #46e88a; color: #04140a; }
@media (max-width: 980px) { .lv-grid, .lv-grid.two { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .lv-panel, .lv-gm { padding: 12px; } .lv-head .btn:last-child { margin-left: 0; } .lv-yours .btn { margin-left: 0; width: 100%; } }

.lv-gm .lv-peers { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.lv-gm .lv-rolls { max-height: 230px; }

/* ---------- Economy page (js/economy_page.js) */
.ec-app .ec-worlds { margin: 14px 0 6px; }
.ec-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.ec-jump a { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .06); text-decoration: none; }
.ec-how h3, #ec-loot h3, #ec-lists h3 { margin-top: 18px; }
.ec-cat { margin: 6px 0; border-radius: 12px; background: rgba(8, 12, 32, .45); padding: 4px 10px; }
.ec-cat > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 0; list-style: none; }
.ec-cat > summary::-webkit-details-marker { display: none; }
.ec-cat > summary::before { content: '▸'; opacity: .7; transition: transform .15s; }
.ec-cat[open] > summary::before { transform: rotate(90deg); }
.ec-cat > summary small { opacity: .65; }
.ec-cat > summary .btn { margin-left: auto; }
.ec-cat .tbl { max-height: 520px; overflow: auto; }
.ec-filter { display: grid; gap: 10px; margin: 8px 0 12px; }
.ec-filter input { width: 100%; max-width: 520px; padding: 10px 12px; border-radius: 12px; }
.ec-secs { flex-wrap: wrap; }
.ec-lres p { margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: rgba(255, 210, 74, .12); }
.ec-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* GM loot roller (js/loot.js): GM Tools > Loot Roller, Campaign, Bestiary */
.loot-page { max-width: 980px; margin: 0 auto; }
.lt { display: grid; gap: 12px; }
.lt-card { width: min(860px, 100%); }
.lt-worlds { display: flex; flex-wrap: wrap; gap: 8px; }
.lt-worlds .wpill { border: 2.5px solid var(--ink, #0b0f22); border-radius: 999px; padding: 6px 16px; font-weight: 900; background: var(--bg2); color: var(--text); cursor: pointer; min-height: 40px; }
.lt-worlds .wpill.on.w-earth { background: #ff6b4a; color: #1a0b07; }
.lt-worlds .wpill.on.w-aos { background: #b98cff; color: #160b2a; }
.lt-worlds .wpill.on.w-space { background: #44dbff; color: #071a22; }
.lt-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.lt-tabs button { border: 2.5px solid var(--ink, #0b0f22); background: var(--bg2); color: var(--text); border-radius: 999px; padding: 6px 14px; font-weight: 800; cursor: pointer; min-height: 40px; }
.lt-tabs button.on { background: #ffd23f; color: #141a38; }
.lt-help { margin: 0; font-size: 14px; }
.lt-ctl, .lt-foe { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.lt-ctl label, .lt-foe label, .lt-give label { display: grid; gap: 4px; font-weight: 700; font-size: 13px; flex: 1 1 150px; min-width: 0; }
.lt-ctl select, .lt-foe select, .lt-give select { width: 100%; padding: 8px 10px; border: 2.5px solid var(--ink, #0b0f22); border-radius: 12px; background: #141a38; color: var(--text); font: inherit; min-height: 42px; }
.lt-foes { display: grid; gap: 8px; }
.lt-foe { padding: 10px; border-radius: 14px; background: var(--bg2); border: 2px solid var(--line); }
.lt-foe .lt-fn { flex-basis: 100%; }
.lt-foe .lt-chk { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; min-height: 42px; }
.lt-foe .lt-x { flex: 0 0 auto; min-height: 42px; }
.lt-out { display: grid; gap: 12px; }
.lt-sum { margin: 0; font-size: 16px; }
.lt-grp h3 { margin: 4px 0 6px; font-size: 18px; }
.lt-grp h3 small { color: var(--muted); font-size: 13px; font-weight: 700; margin-left: 6px; }
.lt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lt-list li label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; padding: 8px 12px; border-radius: 12px; background: var(--bg2); cursor: pointer; }
.lt-list li.coin label { background: rgba(255, 210, 63, .14); }
.lt-list li.boring label { opacity: .55; }
.lt-list .lt-v { font-weight: 900; white-space: nowrap; color: #ffd23f; }
.lt-list .lt-d, .lt-list .lt-note { grid-column: 2 / -1; }
.lt-list .lt-d { justify-self: start; padding: 1px 7px; border-radius: 6px; background: rgba(63,210,139,.16); color: #8ff0bd; font-size: 12px; font-weight: 800; }
.lt-list .lt-note, .lt-list small { color: var(--muted); font-size: 12.5px; }
.lt-gnote { margin: 6px 0 0; font-size: 13px; }
.lt-give, .lt-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
@media (max-width: 560px) { .lt-ctl label, .lt-foe label { flex-basis: 45%; } .lt-list li label { grid-template-columns: auto minmax(0, 1fr); } .lt-list .lt-v { grid-column: 2; } }
.spx-card.spx-hi { outline: 3px solid #ffd23f; outline-offset: 3px; }

/* uniform world pages: Earth, Aos and Space Opera share the .aosl landing layout; wl-* sets each world's colours */
.aosl.wl-earth { --ap: #ff6b4a; --ap2: #ffc27a; --av: #c0262d; --aink: #f7efe6; --amut: #d8c6b8; }
.aosl.wl-space { --ap: #44dbff; --ap2: #bff3ff; --av: #8a7dff; --aink: #eef8ff; --amut: #b9cbe0; }
.aosl.wl-earth h1, .aosl.wl-earth h2, .aosl.wl-earth h3, .aosl.wl-earth .aosl-facts b, .aosl.wl-earth .aosl-time b, .aosl.wl-earth .aosl-weavers b, .aosl.wl-earth .aosl-peoples figcaption b { font-family: 'Alfa Slab One', Georgia, serif; letter-spacing: .01em; }
.aosl.wl-space h1, .aosl.wl-space h2, .aosl.wl-space h3, .aosl.wl-space .aosl-facts b, .aosl.wl-space .aosl-time b, .aosl.wl-space .aosl-weavers b, .aosl.wl-space .aosl-peoples figcaption b { font-family: 'Orbitron', system-ui, sans-serif; letter-spacing: .02em; }
.aosl.wl-space .aosl-hero h1 { font-size: clamp(2.6rem, 9vw, 6rem); }
.aosl.wl-earth .aosl-hero { box-shadow: 0 30px 80px -30px rgba(255, 90, 60, .5), inset 0 0 0 1px rgba(255,107,74,.35); }
.aosl.wl-space .aosl-hero { box-shadow: 0 30px 80px -30px rgba(68, 219, 255, .5), inset 0 0 0 1px rgba(68,219,255,.35); }
.aosl.wl-earth .aosl-hero::before { background: linear-gradient(180deg, rgba(20,8,4,.15) 0%, rgba(20,8,4,.4) 40%, rgba(16,6,4,.95) 100%), radial-gradient(60% 50% at 20% 100%, rgba(255,90,60,.35), transparent 70%); }
.aosl.wl-space .aosl-hero::before { background: linear-gradient(180deg, rgba(4,10,24,.1) 0%, rgba(4,10,24,.35) 40%, rgba(4,8,20,.95) 100%), radial-gradient(60% 50% at 20% 100%, rgba(68,219,255,.3), transparent 70%); }
.aosl.wl-earth .aosl-cont { --cc: #ff6b4a; background: linear-gradient(180deg, rgba(40,18,12,.85), rgba(18,8,6,.95)); }
.aosl.wl-earth .aosl-cont.road { --cc: #ffc27a; } .aosl.wl-earth .aosl-cont.post { --cc: #a8b06a; }
.aosl.wl-earth .aosl-threats { background: radial-gradient(80% 60% at 50% 0%, rgba(140,20,20,.4), transparent 70%), rgba(14,4,4,.8); border-color: rgba(255,60,60,.3); }
.aosl.wl-space .aosl-threats { background: radial-gradient(80% 60% at 50% 0%, rgba(60,40,160,.4), transparent 70%), rgba(4,6,18,.8); border-color: rgba(68,219,255,.3); }
.aosl.wl-space .aosl-tokens img { border-color: rgba(68,219,255,.5); box-shadow: 0 0 22px -4px rgba(68,219,255,.55); }
.aosl.wl-earth .aosl-end { background: radial-gradient(60% 80% at 50% 0%, rgba(255,107,74,.25), transparent 70%), rgba(30,12,8,.7); border-color: rgba(255,107,74,.3); }
.aosl.wl-space .aosl-end { background: radial-gradient(60% 80% at 50% 0%, rgba(68,219,255,.22), transparent 70%), rgba(6,14,30,.7); border-color: rgba(68,219,255,.3); }
.aosl.wl-earth .aosl-peoples img, .aosl.wl-earth .aosl-weavers a { border-color: rgba(255,107,74,.45); }
.aosl.wl-space .aosl-peoples img { border-color: rgba(68,219,255,.5); box-shadow: 0 0 0 6px rgba(68,219,255,.08), 0 14px 30px -12px rgba(68,219,255,.6); }
/* linked pictures keep the same look as before */
.aosl a { text-decoration: none; color: inherit; }
.aosl-peoples > a, .aosl-tokens > a { display: block; }
.aosl-tokens > a figure { margin: 0; width: 110px; text-align: center; }
.aosl-places > a.fig-a { display: block; }
.aosl-places > a.fig-a figure { height: 100%; }
.aosl-places > a.fig-a.big { grid-column: span 2; grid-row: span 2; }
.aosl-places > a.fig-a:hover img { transform: scale(1.05); }
.aosl-cont > a { display: block; overflow: hidden; }
.aosl-cont h3 a:hover, .aosl-sub a:hover { text-decoration: underline; }
.aosl-chips li a { color: inherit; }
.aosl-chips.more { margin-top: 1rem; }
.aosl-note a { display: inline-flex; }
.aosl-weavers.two { grid-template-columns: repeat(3, minmax(0, 260px)); justify-content: center; }
.aosl-sub { margin: 2rem 0 1rem; font-size: 1.4rem; color: #fff; }
/* rule cards: the "How X plays" and "Gear" sections */
.aosl-rulecards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.aosl-rulecards a { display: block; padding: 1.2rem 1.2rem 1.3rem; border-radius: 20px; background: rgba(16,10,28,.72); border: 1px solid color-mix(in srgb, var(--ap) 35%, transparent); transition: transform .25s, box-shadow .25s; }
.aosl-rulecards a:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -16px var(--ap); }
.aosl-rulecards b { display: block; color: #fff; font-size: 1.15rem; margin-bottom: .4rem; }
.aosl-rulecards p { margin: 0; color: var(--amut); line-height: 1.5; font-size: .95rem; }
.aosl-rulecards a.gm-only-card { border-style: dashed; }
/* the ten galaxies */
.aosl-gal { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.aosl-gal a { position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 4/3; border-radius: 18px; overflow: hidden; padding: .8rem; isolation: isolate; border: 1px solid rgba(68,219,255,.3); transition: transform .25s, box-shadow .25s; }
.aosl-gal a img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .5s; }
.aosl-gal a::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 35%, rgba(4,8,20,.95)); }
.aosl-gal a:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -14px #44dbff; }
.aosl-gal a:hover img { transform: scale(1.07); }
.aosl-gal b { color: #fff; font-size: 1.1rem; }
.aosl-gal small { color: var(--amut); font-size: .8rem; }
@media (max-width: 1000px) { .aosl-rulecards { grid-template-columns: 1fr 1fr; } .aosl-gal { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .aosl-rulecards { grid-template-columns: 1fr; } .aosl-gal { grid-template-columns: 1fr 1fr; } .aosl-weavers.two { grid-template-columns: 1fr 1fr; } .aosl-places > a.fig-a.big { grid-column: auto; grid-row: auto; } .aosl-tokens > a figure { width: 86px; } }

/* setting bar: where you are + one tap to the other settings */
.wbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; max-width: 1240px; margin: 10px auto 0; padding: 0 16px; font: 800 13px/1 Nunito, sans-serif; }
.wbar span { color: var(--muted, #9aa); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; margin-right: 4px; }
.wbar a { padding: 7px 14px; border-radius: 999px; border: 2px solid #0008; background: #ffffff10; color: inherit; text-decoration: none; transition: transform .15s, background .2s; }
.wbar a:hover { transform: translateY(-1px); background: #ffffff22; }
.wbar a.on { color: #111; box-shadow: 2px 2px 0 #000; }
.wbar a.wbar-earth.on { background: #e0a060; }
.wbar a.wbar-aos.on { background: #f3d58c; }
.wbar a.wbar-space.on { background: #ffe14a; }
.wbar a.wbar-cosmos.on { background: #b9a4ff; }
@media (max-width: 560px) { .wbar span { display: none; } .wbar a { padding: 8px 11px; font-size: 12px; } }
img.img-link { cursor: pointer; transition: transform .2s, filter .2s; }
img.img-link:hover, img.img-link:focus-visible { transform: scale(1.02); filter: brightness(1.08); outline: none; }
html[data-mode=player] img.img-link[data-gm] { cursor: default; transform: none; filter: none; }
/* loot roller: icons, creature art, event lines */
.lt-ico { width: 30px; height: 30px; object-fit: contain; vertical-align: middle; margin-right: 8px; border-radius: 6px; background: #0003; }
.lt-grp h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lt-art { width: 52px; height: 52px; object-fit: cover; object-position: 50% 15%; border-radius: 12px; border: 2px solid #000; box-shadow: 2px 2px 0 #000; }
.lt-list li.ev { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 8px 12px; border-radius: 12px; border: 1px dashed var(--line, #fff3); font-style: italic; }
.lt-list li.ev .lt-note { flex-basis: 100%; font-style: normal; }
/* creature art in lists, dialogs and fights (sources/art_map.json) */
.crow.has-art { grid-template-columns: 56px minmax(0, 1fr); column-gap: 12px; }
.crow.has-art .cr-art { grid-row: 1 / span 2; width: 56px; height: 56px; object-fit: cover; object-position: 50% 15%; border-radius: 10px; border: 2px solid #000; }
.b-art { display: block; margin: 8px 0 12px; }
.b-art img { width: 100%; max-height: 340px; object-fit: contain; border-radius: 14px; background: #0004; border: 2px solid #000; }
.c-art { width: 40px; height: 40px; object-fit: cover; object-position: 50% 15%; border-radius: 8px; border: 2px solid #000; vertical-align: middle; flex: none; }
.f-name .c-art { width: 34px; height: 34px; margin-right: 8px; }
.f-name:has(.c-art) { display: inline-flex; align-items: center; text-align: left; }
.dw-art { display: block; width: 100%; max-height: 260px; object-fit: contain; margin: 8px 0; border-radius: 12px; background: #0004; border: 2px solid #000; }
/* home: what TOFU is + the story so far */
.home-story { max-width: 1180px; margin-left: auto; margin-right: auto; }
.hs-intro { max-width: 760px; }
.hs-intro p { font-size: 17px; line-height: 1.65; margin: 0 0 12px; }
.hs-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 22px 0 34px; }
.hs-card, .hs-w { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 16px; background: var(--panel, #1c2140); border: 2px solid #000; box-shadow: 3px 3px 0 #000; color: inherit; text-decoration: none; transition: transform .15s; }
.hs-card:hover, .hs-w:hover { transform: translateY(-2px); }
.hs-card b { font-family: 'Lilita One', sans-serif; font-weight: 400; font-size: 19px; color: var(--gold, #ffd23f); }
.hs-card span { font-size: 14.5px; line-height: 1.55; }
.hs-sub { margin-top: -4px; color: var(--muted, #aab); }
.hs-hist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
.hs-w h3 { margin: 2px 0 4px; font-size: 21px; }
.hs-w .tag { font: 800 11px/1 Nunito, sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.hs-w.earth { border-top: 5px solid #e0a060; } .hs-w.earth .tag { color: #e0a060; }
.hs-w.aos { border-top: 5px solid #3fc1ad; } .hs-w.aos .tag { color: #3fc1ad; }
.hs-w.space { border-top: 5px solid #9a7dff; } .hs-w.space .tag { color: #b9a4ff; }
.hs-w ol { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14.5px; line-height: 1.5; }
.hs-secret { margin-top: 20px; font-style: italic; color: var(--muted, #aab); }
@media (max-width: 1000px) { .hs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hs-hist { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .hs-cards { grid-template-columns: 1fr; } }
/* bestiary picture view: pick enemies by their looks */
.bview { display: inline-flex; gap: 4px; margin: 0 0 10px; padding: 3px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); }
.bview button { border: 0; background: none; color: inherit; font: 800 13px/1 Nunito, sans-serif; padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.bview button[aria-pressed=true] { background: var(--gold, #ffd23f); color: #111; }
.blist.pics { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.bcard { display: flex; flex-direction: column; padding: 0; border-radius: 16px; overflow: hidden; background: var(--panel); border: 2px solid #000; box-shadow: 3px 3px 0 #000; color: var(--text); cursor: pointer; font: inherit; text-align: left; transition: transform .15s; }
.bcard:hover, .bcard:focus-visible { transform: translateY(-3px); outline: 2px solid var(--gold, #ffd23f); }
.bc-img { display: block; aspect-ratio: 4 / 3; background: radial-gradient(circle at 50% 35%, #ffffff14, #0006); }
.bc-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bc-t { display: grid; gap: 3px; padding: 10px 12px 12px; }
.bc-t b { font-size: 15.5px; line-height: 1.2; }
.bc-t small { font-size: 12.5px; color: var(--muted); }
.bc-terr { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.bc-terr i { font-style: normal; font-size: 11px; font-weight: 800; line-height: 1; padding: 3px 7px; border-radius: 999px; color: #9be8ff; background: rgba(68,219,255,.14); border: 1px solid rgba(68,219,255,.35); }
.bc-terr.big i { font-size: 13px; padding: 5px 10px; }
.b-terr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.bc-t .badge { justify-self: start; margin-right: 4px; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); }
@media (max-width: 560px) { .blist.pics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .bc-t b { font-size: 14px; } }

/* DICE: one d10 look for the whole site (roller, sheet, campaign, live table, toasts).
   Shaded pentagonal d10, misses slate blue, hits green, the two Cosmic Dice purple with a cyan rim, Cosmic Crit gold.
   6 and 9 are underlined like real dice. Roll animation: drop + spin + number shuffle (site.js v83). */
html body .d:not(#_), html body .die:not(#_), html body .toast .d:not(#_) { background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2076%2C56%22%20fill%3D%22%234f5d9c%22%2F%3E%3Cpolygon%20points%3D%2250%2C4%204%2C50%2024%2C56%22%20fill%3D%22%23424f8a%22%2F%3E%3Cpolygon%20points%3D%2276%2C56%2096%2C50%2084%2C86%2050%2C106%2050%2C76%22%20fill%3D%22%23323d6e%22%2F%3E%3Cpolygon%20points%3D%2224%2C56%204%2C50%2016%2C86%2050%2C106%2050%2C76%22%20fill%3D%22%2328315a%22%2F%3E%3Cpolygon%20points%3D%2250%2C4%2076%2C56%2050%2C76%2024%2C56%22%20fill%3D%22%236371b4%22%2F%3E%3Cpath%20d%3D%22M50%204%2076%2056%2050%2076%2024%2056Z%20M76%2056%2096%2050%20M24%2056%204%2050%20M50%2076%2050%20106%22%20fill%3D%22none%22%20stroke%3D%22%230b0f22%22%20stroke-opacity%3D%22.55%22%20stroke-width%3D%222.2%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22none%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%224.5%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M47%2012%2030%2050%22%20stroke%3D%22%23fff%22%20stroke-opacity%3D%22.45%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M58%2014%2070%2040%22%20stroke%3D%22%23fff%22%20stroke-opacity%3D%22.18%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E") center/100% 100% no-repeat !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  color: #fff !important; filter: drop-shadow(0 3px 0 rgba(11,15,34,.9)) drop-shadow(0 6px 8px rgba(0,0,0,.35)) !important; font-family: 'Lilita One', var(--display), system-ui, sans-serif !important; letter-spacing: -.02em;
  text-shadow: -1.5px 0 0 #0b0f22, 1.5px 0 0 #0b0f22, 0 -1.5px 0 #0b0f22, 0 2px 0 #0b0f22 !important; }
html body .d.h:not(#_), html body .die.hit:not(#_) { color: #fff !important; background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2076%2C56%22%20fill%3D%22%2356df80%22%2F%3E%3Cpolygon%20points%3D%2250%2C4%204%2C50%2024%2C56%22%20fill%3D%22%233cc768%22%2F%3E%3Cpolygon%20points%3D%2276%2C56%2096%2C50%2084%2C86%2050%2C106%2050%2C76%22%20fill%3D%22%2322a050%22%2F%3E%3Cpolygon%20points%3D%2224%2C56%204%2C50%2016%2C86%2050%2C106%2050%2C76%22%20fill%3D%22%23188240%22%2F%3E%3Cpolygon%20points%3D%2250%2C4%2076%2C56%2050%2C76%2024%2C56%22%20fill%3D%22%238af7a6%22%2F%3E%3Cpath%20d%3D%22M50%204%2076%2056%2050%2076%2024%2056Z%20M76%2056%2096%2050%20M24%2056%204%2050%20M50%2076%2050%20106%22%20fill%3D%22none%22%20stroke%3D%22%230b0f22%22%20stroke-opacity%3D%22.55%22%20stroke-width%3D%222.2%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22none%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%224.5%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M47%2012%2030%2050%22%20stroke%3D%22%23fff%22%20stroke-opacity%3D%22.45%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M58%2014%2070%2040%22%20stroke%3D%22%23fff%22%20stroke-opacity%3D%22.18%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E") !important; filter: drop-shadow(0 3px 0 rgba(11,15,34,.9)) drop-shadow(0 0 7px rgba(63,224,122,.55)) !important; }
html body .d.c:not(#_), html body .die.cos:not(#_) { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2076%2C56%22%20fill%3D%22%238a6ef0%22%2F%3E%3Cpolygon%20points%3D%2250%2C4%204%2C50%2024%2C56%22%20fill%3D%22%237558db%22%2F%3E%3Cpolygon%20points%3D%2276%2C56%2096%2C50%2084%2C86%2050%2C106%2050%2C76%22%20fill%3D%22%23563fae%22%2F%3E%3Cpolygon%20points%3D%2224%2C56%204%2C50%2016%2C86%2050%2C106%2050%2C76%22%20fill%3D%22%2343308c%22%2F%3E%3Cpolygon%20points%3D%2250%2C4%2076%2C56%2050%2C76%2024%2C56%22%20fill%3D%22%23a68cff%22%2F%3E%3Cpath%20d%3D%22M50%204%2076%2056%2050%2076%2024%2056Z%20M76%2056%2096%2050%20M24%2056%204%2050%20M50%2076%2050%20106%22%20fill%3D%22none%22%20stroke%3D%22%2344dbff%22%20stroke-opacity%3D%22.55%22%20stroke-width%3D%222.2%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22none%22%20stroke%3D%22%2344dbff%22%20stroke-width%3D%226%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M47%2012%2030%2050%22%20stroke%3D%22%23fff%22%20stroke-opacity%3D%22.45%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M58%2014%2070%2040%22%20stroke%3D%22%23fff%22%20stroke-opacity%3D%22.18%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E") !important; }
html body .d.c.h:not(#_), html body .die.cos.hit:not(#_) { color: #fff !important; background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2076%2C56%22%20fill%3D%22%2356df80%22%2F%3E%3Cpolygon%20points%3D%2250%2C4%204%2C50%2024%2C56%22%20fill%3D%22%233cc768%22%2F%3E%3Cpolygon%20points%3D%2276%2C56%2096%2C50%2084%2C86%2050%2C106%2050%2C76%22%20fill%3D%22%2322a050%22%2F%3E%3Cpolygon%20points%3D%2224%2C56%204%2C50%2016%2C86%2050%2C106%2050%2C76%22%20fill%3D%22%23188240%22%2F%3E%3Cpolygon%20points%3D%2250%2C4%2076%2C56%2050%2C76%2024%2C56%22%20fill%3D%22%238af7a6%22%2F%3E%3Cpath%20d%3D%22M50%204%2076%2056%2050%2076%2024%2056Z%20M76%2056%2096%2050%20M24%2056%204%2050%20M50%2076%2050%20106%22%20fill%3D%22none%22%20stroke%3D%22%2344dbff%22%20stroke-opacity%3D%22.55%22%20stroke-width%3D%222.2%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22none%22%20stroke%3D%22%2344dbff%22%20stroke-width%3D%226%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M47%2012%2030%2050%22%20stroke%3D%22%23fff%22%20stroke-opacity%3D%22.45%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M58%2014%2070%2040%22%20stroke%3D%22%23fff%22%20stroke-opacity%3D%22.18%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E") !important; filter: drop-shadow(0 3px 0 rgba(11,15,34,.9)) drop-shadow(0 0 8px rgba(68,219,255,.6)) !important; }
html body .d.g:not(#_), html body .d.g.c:not(#_), html body .die.gold:not(#_), html body .die.gold.cos:not(#_) { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20110%22%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2076%2C56%22%20fill%3D%22%23ffdb63%22%2F%3E%3Cpolygon%20points%3D%2250%2C4%204%2C50%2024%2C56%22%20fill%3D%22%23f7bf32%22%2F%3E%3Cpolygon%20points%3D%2276%2C56%2096%2C50%2084%2C86%2050%2C106%2050%2C76%22%20fill%3D%22%23e29d16%22%2F%3E%3Cpolygon%20points%3D%2224%2C56%204%2C50%2016%2C86%2050%2C106%2050%2C76%22%20fill%3D%22%23bb7a0d%22%2F%3E%3Cpolygon%20points%3D%2250%2C4%2076%2C56%2050%2C76%2024%2C56%22%20fill%3D%22%23fff4b8%22%2F%3E%3Cpath%20d%3D%22M50%204%2076%2056%2050%2076%2024%2056Z%20M76%2056%2096%2050%20M24%2056%204%2050%20M50%2076%2050%20106%22%20fill%3D%22none%22%20stroke%3D%22%230b0f22%22%20stroke-opacity%3D%22.55%22%20stroke-width%3D%222.2%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpolygon%20points%3D%2250%2C4%2096%2C50%2084%2C86%2050%2C106%2016%2C86%204%2C50%22%20fill%3D%22none%22%20stroke%3D%22%230b0f22%22%20stroke-width%3D%224.5%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M47%2012%2030%2050%22%20stroke%3D%22%23fff%22%20stroke-opacity%3D%22.45%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M58%2014%2070%2040%22%20stroke%3D%22%23fff%22%20stroke-opacity%3D%22.18%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E") !important; color: #2a1d02 !important; text-shadow: 0 1px 0 #fff3c9 !important;
  filter: drop-shadow(0 3px 0 rgba(11,15,34,.9)) drop-shadow(0 0 12px rgba(255,207,63,.95)) !important; }
html body .d.u:not(#_), html body .die.u:not(#_) { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
html body .d:not(#_)::before, html body .die:not(#_)::before { content: none !important; }
@keyframes d10roll {
  0% { transform: translateY(-34px) rotate(-260deg) scale(.55); opacity: 0; filter: blur(2px); }
  55% { transform: translateY(5px) rotate(18deg) scale(1.08); opacity: 1; filter: none; }
  75% { transform: translateY(-2px) rotate(-7deg) scale(.98); }
  100% { transform: none; }
}
html body .dice .die:not(#_), html body .tb-dice .d:not(#_), html body .ak-res .d:not(#_), html body .toast .d:not(#_) { animation: d10roll .6s cubic-bezier(.2,.8,.3,1.1) backwards !important; animation-delay: calc(var(--i, 0) * 55ms) !important; }
html body .dice .die.gold:not(#_), html body .tb-dice .d.g:not(#_) { animation: d10roll .6s cubic-bezier(.2,.8,.3,1.1) backwards, goldPulse 1.6s ease-in-out calc(var(--i, 0) * 55ms + .6s) 2 !important; }
@media (prefers-reduced-motion: reduce) { html body .dice .die:not(#_), html body .tb-dice .d:not(#_), html body .ak-res .d:not(#_), html body .toast .d:not(#_) { animation: none !important; } }

.rfx-aos { opacity: .45; }

/* PORTRAITS: species x class galleries (js/portraits.js) on the Species page, class pages and the sheet's portrait picker */
.pt-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 4px 0 12px; }
.pt-seg { display: inline-flex; border: 2px solid var(--ink, #0b0f22); border-radius: 999px; overflow: hidden; }
.pt-seg button { font: 800 .85rem/1 var(--body, Nunito, sans-serif); padding: 8px 14px; min-height: 36px; background: rgba(255,255,255,.06); color: inherit; border: 0; cursor: pointer; }
.pt-seg button + button { border-left: 2px solid var(--ink, #0b0f22); }
.pt-seg button[aria-pressed="true"] { background: #ffd23f; color: #1a1300; }
.pt-n { font-size: .85rem; }
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.pt-cell { display: flex; flex-direction: column; padding: 0; border: 3px solid #0b0f22; border-radius: 14px; overflow: hidden; background: #121633; color: inherit; cursor: zoom-in; box-shadow: 0 4px 0 #0b0f22; transition: transform .15s, box-shadow .15s; text-align: center; }
.pt-cell img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: top; display: block; background: #0d1028; }
.pt-cell span { font: 800 .82rem/1.2 var(--body, Nunito, sans-serif); padding: 7px 6px 8px; }
.pt-cell:hover, .pt-cell:focus-visible { transform: translateY(-3px); box-shadow: 0 7px 0 #0b0f22; }
.pt-cell.cur { border-color: #44dbff; }
.pt-sec { margin-top: 2.2em; }
.pt-dlg { width: min(1100px, 96vw); max-height: 92vh; padding: 18px 20px 22px; border: 3px solid #0b0f22; border-radius: 18px; background: #161a3d; color: #fff6e3; box-shadow: 0 10px 0 #0b0f22; }
.pt-dlg::backdrop, .pt-view::backdrop { background: rgba(5,7,20,.78); }
.pt-dhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pt-dhead h2 { margin: 0; }
.pt-sub { margin: 4px 0 10px; }
.pt-x { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #0b0f22; background: #ffd23f; color: #1a1300; font-weight: 900; cursor: pointer; flex: none; }
.pt-view { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 96vh; overflow: visible; display: none; align-items: center; gap: 10px; }
.pt-view[open] { display: flex; }
.pt-view figure { margin: 0; text-align: center; }
.pt-view img { max-width: min(78vw, 720px); max-height: 78vh; border: 3px solid #0b0f22; border-radius: 16px; box-shadow: 0 8px 0 #0b0f22; display: block; margin: 0 auto; background: #0d1028; }
.pt-view figcaption { color: #fff6e3; margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: center; }
.pt-view .pt-x { position: absolute; top: -8px; right: -8px; z-index: 2; }
.pt-prev, .pt-next { width: 48px; height: 48px; border-radius: 50%; border: 2px solid #0b0f22; background: #44dbff; color: #0b0f22; font: 900 1.6rem/1 sans-serif; cursor: pointer; flex: none; }
.spx-card .pt-open { margin: 10px 8px 0 0; }
@media (max-width: 600px) {
  .pt-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .pt-cell span { font-size: .72rem; }
  .pt-dlg { padding: 12px; }
  .pt-view { flex-direction: column; }
  .pt-view img { max-width: 92vw; max-height: 70vh; }
  .pt-prev, .pt-next { position: absolute; top: 38%; z-index: 2; }
  .pt-prev { left: 4px; } .pt-next { right: 4px; }
}
/* campaign: bestiary Fair-encounter notes beside sim results, test party box */
.sim-fair { margin: 8px 0 4px; }
.sim-fair ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sim-fair li small { opacity: .85; margin-left: 4px; }
.eb-card .sim-fair { font-size: .9em; }
.ap-test select { min-width: 110px; }
.eb-miss { margin-top: 10px; }
/* home: "Make your hero" sits inside "What is TOFU?", between the intro and the lore cards */
.home-story#story { margin-bottom: 0; padding-bottom: 8px; }
.home-story.hs-more { margin-top: 0; padding-top: 8px; }

/* CALM BREAK TEST (card bounced too much to read or click). The card, text and buttons hold still;
   the menace lives in the glow, the cracks, the aura and the die. Card glow = btGlow (box-shadow only);
   the old card used btBeat, which the v48 aura redefined with a scale pulse, so the whole card throbbed. */
.bt-card { will-change: box-shadow; }
.bt-title span { animation-iteration-count: 1; }
@keyframes btShake { 0%, 100% { transform: none; } 25% { transform: translate(-2px, 0) rotate(-1.5deg); } 50% { transform: translate(2px, 0) rotate(1deg); } 75% { transform: translate(-1px, 0); } }
.bt-table span.on { transform: none; }
/* the result box keeps its space before the roll, so the card never grows and the buttons never jump */
.bt-res { min-height: 146px; display: grid; align-content: center; }
.bt-wait { color: var(--muted, #b9bfdc); opacity: .6; font-size: 14px; }
.bt-btns .bt-roll { min-width: 13.5em; } /* v90: same width for "Roll" and "Continue" */
/* short screens (phones) - compact card that fits without scrolling; scroll still allowed as a fallback */
.bt-modal { overflow-y: auto; }
@media (max-height: 780px) {
  .bt-card { padding: 16px 16px 16px; }
  .bt-title { font-size: clamp(34px, 9vw, 48px); }
  .bt-sub { margin-bottom: 4px; font-size: 15px; }
  .bt-stage { height: 104px; }
  .bt-stage::before { width: 110px; height: 110px; }
  .bt-modal .bt-die { width: 82px !important; min-width: 82px; height: 90px !important; font-size: 40px !important; padding: 0 0 14px 0 !important; }
  .bt-table { margin: 8px 0; font-size: 13px; }
  .bt-table span { padding: 6px; }
  .bt-res { min-height: 124px; }
  .bt-res b { font-size: 28px; }
  .bt-res span { font-size: 14px; }
  .bt-btns { margin-top: 8px; }
}

/* ================= v63 Owner dashboard (js/owner_dash.js) ================= */
#owner-dash { position: relative; margin-bottom: 26px; --dash-bar: #44dbff; --dash-hover: #9beeff; }
.dash-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 10px; }
.dash-top h2 { margin: 0; }
.dash-range { display: flex; gap: 6px; flex-wrap: wrap; }
.dash-range button { border: 2.5px solid var(--ink, #0b0f22); background: var(--bg2); color: var(--text); border-radius: 999px; padding: 7px 14px; font: inherit; font-weight: 800; cursor: pointer; min-height: 40px; }
.dash-range button:hover { border-color: var(--cyan); }
.dash-range button.on { background: #ffd23f; color: #141a38; box-shadow: 3px 3px 0 var(--ink, #0b0f22); }
.dash-tiles em { display: block; font-style: normal; color: var(--muted); font-size: 13px; }
.dash-space { display: grid; grid-template-columns: minmax(200px, auto) 1fr; gap: 6px 16px; align-items: center; background: var(--panel2); border: 2.5px solid var(--ink); border-radius: 14px; padding: 10px 14px; margin-bottom: 16px; }
.dash-space span { display: block; color: var(--muted); font-size: 14px; }
.dash-space .meter { height: 14px; border-radius: 999px; background: var(--bg2); overflow: hidden; border: 2px solid var(--ink); }
.dash-space .meter i { display: block; height: 100%; background: var(--dash-bar); border-radius: 999px; }
.dash-space.warn .meter i { background: #ffb020; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 12px; }
.dash-card { background: var(--panel); border: 2.5px solid var(--ink); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.dash-card.wide { grid-column: 1 / -1; }
.dash-card h3 { margin: 0; font-size: 19px; }
.dash-sub { margin: 2px 0 8px; color: var(--muted); font-size: 13.5px; }
.dash-card svg { width: 100%; height: auto; display: block; overflow: visible; }
.dash-card svg .g { stroke: var(--muted); stroke-opacity: .18; }
.dash-card svg .base { stroke: var(--muted); stroke-opacity: .5; }
.dash-card svg .ax { fill: var(--muted); font-size: 11px; font-family: inherit; }
.dash-card svg .bar { fill: var(--dash-bar); }
.dash-card svg .hb { fill: transparent; }
.dash-card svg .hit:hover .bar, .dash-card svg .hit:focus .bar { fill: var(--dash-hover); }
.dash-card svg .hit:hover .hb { fill: var(--text); fill-opacity: .05; }
.dash-card svg .hit:focus { outline: none; }
.hbars { display: grid; gap: 6px; }
.hrow { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 14px; border-radius: 6px; }
.hrow .hk { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow .ht { height: 12px; }
.hrow .ht i { display: block; height: 100%; background: var(--dash-bar); border-radius: 0 4px 4px 0; }
.hrow:hover .ht i, .hrow:focus .ht i { background: var(--dash-hover); }
.hrow b { min-width: 2.5ch; text-align: right; }
.dash-empty { padding: 18px 0; }
.dash-tbl { margin-top: 6px; font-size: 13.5px; }
.dash-tbl summary { cursor: pointer; color: var(--muted); }
.dash-tbl table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.dash-tbl td, .dash-tbl th { padding: 3px 6px; border-bottom: 1px solid rgba(255,255,255,.08); text-align: left; }
.dash-tip { position: absolute; z-index: 20; pointer-events: none; background: #0b0f22; color: #fbf3dc; border: 2px solid var(--dash-bar); border-radius: 10px; padding: 6px 10px; font-size: 13.5px; font-weight: 700; white-space: nowrap; box-shadow: 3px 3px 0 rgba(0,0,0,.5); }
@media (max-width: 600px) { .dash-space { grid-template-columns: 1fr; } }
.own-plan { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 4px 14px 6px; }
/* Supporter upgrade box on the account page */
.acct-up { display: grid; gap: 6px; margin: 14px 0; padding: 12px 14px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--panel2); }
.acct-up span { color: var(--muted); }
.acct-up ol { margin: 2px 0 6px 20px; padding: 0; }
.acct-up .btn { justify-self: start; }
.acct-up.on { border-color: #ffd23f; }
.acct-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px; margin: 6px 0; }
.acct-tier { display: grid; gap: 6px; align-content: start; padding: 10px 12px; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--panel); }
.acct-tier em { font-style: normal; color: #ffd23f; margin-left: 4px; }
.acct-tier ul { margin: 0 0 4px 18px; padding: 0; }
.acct-tier.on { border-color: #ffd23f; }
.acct-yours { color: #ffd23f; font-weight: 800; }
.acct-how { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.own-plan-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* NARRATION v4 (2026-11-15): speaker buttons */
.narr-btn { --p: 0; position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 8px; height: 44px; min-width: 44px; padding: 0 12px; border-radius: 999px; border: 3px solid #05081a; background: #44dbff; color: #05081a; box-shadow: 3px 3px 0 #05081a; cursor: pointer; font: inherit; font-family: var(--display, inherit); font-size: 15px; letter-spacing: .04em; }
.narr-btn svg { width: 22px; height: 22px; flex: none; }
.narr-btn .spk { fill: currentColor; }
.narr-btn .wv { stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.narr-btn .ps { fill: currentColor; display: none; }
.narr-btn.playing .spk, .narr-btn.playing .wv { display: none; }
.narr-btn.playing .ps { display: inline; }
.narr-btn.playing { background: #ffd23f; }
.narr-btn:hover { transform: translateY(-1px); }
.narr-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.narr-ring { position: absolute; inset: -7px; border-radius: inherit; pointer-events: none; background: conic-gradient(#ffd23f calc(var(--p) * 360deg), transparent 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); opacity: 0; transition: opacity .2s; }
.narr-btn.playing .narr-ring { opacity: 1; }
.narr-btn.on-orb { width: 44px; padding: 0; justify-content: center; border-radius: 50%; top: -6px; right: -14px; z-index: 5; }
.aosl-hero > .narr-btn { top: 18px; right: 18px; }
@media (prefers-reduced-motion: reduce) { .narr-btn, .narr-ring { transition: none; } }
.narr-speed { position: absolute; z-index: 5; display: none; height: 32px; min-width: 52px; padding: 0 10px; border-radius: 999px; border: 3px solid #05081a; background: #ffd23f; color: #05081a; box-shadow: 2px 2px 0 #05081a; cursor: pointer; font: inherit; font-family: var(--display, inherit); font-size: 15px; font-variant-numeric: tabular-nums; }
.narr-speed.show { display: inline-block; }
.narr-speed:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.narr-speed.on-orb { top: 44px; right: -22px; }
.aosl-hero > .narr-speed { top: 24px; right: 150px; }
.orb.aos .narr-btn.on-orb { right: auto; left: -14px; }
.orb.aos .narr-speed.on-orb { right: auto; left: -22px; }
.narr-menu { position: absolute; z-index: 6; display: none; flex-direction: column; gap: 6px; padding: 8px; border-radius: 14px; border: 3px solid #05081a; background: #17224a; box-shadow: 3px 3px 0 #05081a; }
.narr-menu.show { display: flex; }
.narr-menu button { display: flex; justify-content: space-between; gap: 14px; min-width: 128px; height: 40px; align-items: center; padding: 0 12px; border-radius: 999px; border: 2px solid #05081a; background: #44dbff; color: #05081a; cursor: pointer; font: inherit; font-family: var(--display, inherit); font-size: 15px; white-space: nowrap; }
.narr-menu button span { font-family: inherit; opacity: .75; font-variant-numeric: tabular-nums; }
.narr-menu button:hover, .narr-menu button:focus-visible { background: #ffd23f; outline: none; }
.narr-menu.on-orb { top: 44px; right: -40px; }
.orb.aos .narr-menu.on-orb { right: auto; left: -96px; }
.aosl-hero > .narr-menu { top: 70px; right: 18px; }
.narr-menu button span, .orb .narr-menu button span { background: none; border: 0; padding: 0; border-radius: 0; box-shadow: none; letter-spacing: normal; font-size: inherit; font-weight: inherit; white-space: nowrap; color: inherit; }
/* NARRATION places (library pages) */
.narr-host { position: relative; }
.narr-host > .narr-btn { position: relative; top: auto; right: auto; margin-top: 14px; vertical-align: middle; }
.narr-host > .narr-speed { position: relative; top: auto; right: auto; margin: 14px 0 0 10px; vertical-align: middle; }
.narr-host > .narr-menu { top: 100%; left: 0; right: auto; margin-top: 6px; }
