/* Somnium Engine v2 — "dream journal at night"
   Deep night background, soft nebula glow, Cinzel display type, glass cards.
   Brand colors carried over from v1: spore green + arcane violet. */

:root {
  --night: #070910;
  --night-2: #0c1019;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-solid: #111622;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e6ece9;
  --text-dim: #93a19b;
  --text-faint: #5f6d68;

  --spore: #3ddc97;
  --spore-ink: #062417;
  --spore-soft: rgba(61, 220, 151, 0.12);
  --violet: #9b7ff5;
  --violet-soft: rgba(155, 127, 245, 0.14);
  --gold: #e8b43d;
  --gold-soft: rgba(232, 180, 61, 0.14);
  --blood: #ef5a72;
  --blood-soft: rgba(239, 90, 114, 0.14);
  --sky: #6ac8e8;
  --rust: #e8812e;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --display: 'Cinzel', 'Cormorant Garamond', Georgia, serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --sidebar: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(155, 127, 245, 0.16), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(61, 220, 151, 0.09), transparent 60%),
    radial-gradient(800px 600px at 60% 110%, rgba(106, 200, 232, 0.07), transparent 60%),
    var(--night);
}
a { color: var(--spore); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
::selection { background: rgba(61, 220, 151, 0.3); }
.icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.shell > div { min-width: 0; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  border-right: 1px solid var(--line);
  background: rgba(7, 9, 16, 0.72); backdrop-filter: blur(14px);
  padding: 22px 14px; display: flex; flex-direction: column; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--violet), var(--spore)); color: var(--night);
  font-family: var(--display); font-weight: 700; font-size: 18px;
}
.brand-name { font-family: var(--display); font-weight: 700; letter-spacing: 0.06em; font-size: 15px; line-height: 1.1; }
.brand-name small { display: block; font-family: var(--body); font-weight: 500; letter-spacing: 0.02em; color: var(--text-faint); font-size: 11px; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-faint); padding: 14px 10px 6px; }
.nav-campaign { padding: 4px 10px 10px; font-family: var(--display); font-size: 14px; color: var(--text); line-height: 1.3; }
.sidebar > * { flex-shrink: 0; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px;
  color: var(--text-dim); font-weight: 500; font-size: 14px;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--spore-soft); color: var(--spore); }
.nav-link .pill { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.sidebar-foot .who { flex: 1; min-width: 0; font-size: 13px; }
.sidebar-foot .who a { color: var(--text); }
.sidebar-foot .who small { display: block; color: var(--text-faint); font-size: 11px; }

.topbar { display: none; }
.content { min-width: 0; padding: 34px clamp(16px, 4vw, 48px) 80px; }
.content-inner { max-width: 1180px; margin: 0 auto; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: min(300px, 86vw);
    height: auto; max-height: 100dvh; -webkit-overflow-scrolling: touch;
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-102%); transition: transform 0.22s ease, visibility 0s linear 0.22s; background: var(--night-2);
    visibility: hidden;
  }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow); visibility: visible; transition: transform 0.22s ease, visibility 0s; }
  body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 55; }
  /* the page behind the open menu must not scroll */
  html:has(body.nav-open), body.nav-open { overflow: hidden; }
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20;
    padding: 10px 16px; background: rgba(7, 9, 16, 0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
  }
  .topbar .title { font-family: var(--display); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .content { padding-top: 20px; }
}

/* ---------------------------------------------------------------- type */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--spore); font-weight: 600; margin-bottom: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: 0.02em; margin: 0; line-height: 1.2; }
h1 { font-size: clamp(26px, 3.4vw, 36px); }
h2 { font-size: 19px; margin: 34px 0 14px; }
h3 { font-size: 15.5px; margin: 0 0 10px; }
.card > h2:first-child, .card > h3:first-child, .card-head h2, .card-head h3 { margin-top: 0; }
.lede { color: var(--text-dim); margin: 8px 0 0; max-width: 720px; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.prose { white-space: pre-wrap; }

/* ---------------------------------------------------------------- layout */
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1050px) { .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: minmax(0, 1fr); }
  .page-head { align-items: flex-start; }
  .form-row > .field { min-width: 100%; }
  .form-row > .field[style*="max-width"] { min-width: 80px; }
  .card { padding: 16px; }
}
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.spacer { flex: 1; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 28px; } .mb0 { margin-bottom: 0 !important; }

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; position: relative;
}
.card.flush { padding: 0; overflow: hidden; }
.card.glow { box-shadow: 0 0 0 1px rgba(61, 220, 151, 0.25), 0 12px 40px rgba(61, 220, 151, 0.07); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
a.card { display: block; color: var(--text); transition: border-color 0.15s, transform 0.15s, background 0.15s; }
a.card:hover { border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-2px); text-decoration: none; }
.card .corner { position: absolute; top: 14px; right: 14px; }

.empty {
  border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 30px 20px;
  text-align: center; color: var(--text-dim); font-size: 14px;
}
.empty strong { display: block; color: var(--text); font-family: var(--display); font-size: 16px; margin-bottom: 4px; }

/* ---------------------------------------------------------------- buttons */
.btn, button {
  font: inherit; font-size: 13.5px; font-weight: 600; letter-spacing: 0.01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; background: var(--spore); color: var(--spore-ink);
  transition: filter 0.15s, background 0.15s, border-color 0.15s, transform 0.05s; white-space: nowrap;
}
.btn:hover, button:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active, button:active { transform: translateY(1px); }
.btn.ghost, button.ghost { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn.ghost:hover, button.ghost:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.09); }
.btn.violet, button.violet { background: var(--violet); color: #120a2a; }
.btn.gold, button.gold { background: var(--gold); color: #2a1c02; }
.btn.danger, button.danger { background: var(--blood-soft); color: var(--blood); border-color: rgba(239, 90, 114, 0.35); }
.btn.danger:hover, button.danger:hover { background: var(--blood); color: #fff; }
.btn.sm, button.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.xs, button.xs { padding: 3px 8px; font-size: 11.5px; border-radius: 7px; }
.btn.icon-only, button.icon-only { padding: 7px; }
.btn.block, button.block { width: 100%; }
button:disabled, .btn.disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--spore); font-weight: 500; }
.linkish:hover { text-decoration: underline; filter: none; }
form.inline { display: inline; }

/* ---------------------------------------------------------------- forms */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
input[type=text], input[type=number], input[type=url], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--text);
  background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 9px 12px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--spore); box-shadow: 0 0 0 3px var(--spore-soft); }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
select option { background: var(--surface-solid); }
input[type=number] { font-family: var(--mono); }
input.w-xs { width: 72px; } input.w-sm { width: 110px; } input.w-md { width: 200px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; margin: 0; }
.check input { width: 17px; height: 17px; accent-color: var(--spore); margin: 0; }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-row > .field { flex: 1; min-width: 130px; margin-bottom: 0; }
.hint { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }
.input-group { display: flex; }
.input-group input { border-radius: 10px 0 0 10px; }
.input-group button { border-radius: 0 10px 10px 0; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); }

/* ---------------------------------------------------------------- badges & chips */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-dim);
  border: 1px solid var(--line);
}
.badge.green { background: var(--spore-soft); color: var(--spore); border-color: rgba(61, 220, 151, 0.3); }
.badge.violet { background: var(--violet-soft); color: var(--violet); border-color: rgba(155, 127, 245, 0.3); }
.badge.gold { background: var(--gold-soft); color: var(--gold); border-color: rgba(232, 180, 61, 0.3); }
.badge.red { background: var(--blood-soft); color: var(--blood); border-color: rgba(239, 90, 114, 0.3); }
.badge.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
.pill { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--blood); color: #fff; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px 3px 8px;
  border-radius: 999px; border: 1px solid color-mix(in srgb, var(--c, var(--violet)) 45%, transparent);
  background: color-mix(in srgb, var(--c, var(--violet)) 16%, transparent); color: var(--c, var(--violet));
}
.chip .r { font-family: var(--mono); font-size: 11px; opacity: 0.85; }
.chip button { background: none; border: 0; padding: 0 0 0 2px; color: inherit; font-size: 14px; line-height: 1; opacity: 0.7; }
.chip button:hover { opacity: 1; filter: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------------------------------------------------------------- avatars */
.avatar {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; object-fit: cover;
  background: linear-gradient(135deg, var(--violet-soft), var(--spore-soft)); border: 1px solid var(--line);
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; color: var(--text); font-size: 17px;
}
.avatar.lg { width: 96px; height: 96px; border-radius: 20px; font-size: 36px; }
.avatar.sm { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; }

/* ---------------------------------------------------------------- meters */
.meter { position: relative; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.meter > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--spore); transition: width 0.4s ease; }
.meter.hp > span { background: linear-gradient(90deg, #2bb57a, var(--spore)); }
.meter.hp.mid > span { background: linear-gradient(90deg, #c98e1f, var(--gold)); }
.meter.hp.low > span { background: linear-gradient(90deg, #c23752, var(--blood)); }
.meter.xp > span { background: linear-gradient(90deg, #6d55c9, var(--violet)); }
.meter.lg { height: 16px; }
.meter-label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-dim); margin-bottom: 5px; }
.meter-label b { color: var(--text); font-family: var(--mono); font-weight: 600; }

.pips { display: flex; flex-wrap: wrap; gap: 5px; }
.pip { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--violet); background: var(--violet); box-shadow: 0 0 8px rgba(155, 127, 245, 0.45); }
.pip.spent { background: transparent; box-shadow: none; opacity: 0.45; }
.tier-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; }
.tier-row + .tier-row { border-top: 1px solid var(--line); }
.tier-label { font-family: var(--mono); font-weight: 700; color: var(--violet); font-size: 13px; }

.stat { background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px; text-align: center; }
.stat .k { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--text-faint); text-transform: uppercase; }
.stat .v { font-family: var(--mono); font-size: 24px; font-weight: 700; margin-top: 2px; }
.stat .m { font-size: 12px; color: var(--text-dim); font-family: var(--mono); }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 10px; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.current td { background: var(--spore-soft); }
tr.down td { opacity: 0.5; }

/* ---------------------------------------------------------------- lists / logs */
.log { display: flex; flex-direction: column; }
.log-item { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.log-item:last-child { border-bottom: 0; }
.log-meta { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--text-faint); margin-bottom: 2px; }
.log-type { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--gold); font-size: 10.5px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.feat { padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.18); border: 1px solid var(--line); border-left: 3px solid var(--spore); }
.feat.universal { border-left-color: var(--gold); }
.feat + .feat { margin-top: 10px; }
.feat .name { font-weight: 700; }
.feat .desc { color: var(--text-dim); font-size: 13.5px; margin-top: 3px; white-space: pre-wrap; }
.rumor { padding: 12px 14px 12px 40px; position: relative; font-style: italic; color: var(--text); border-radius: 12px; background: rgba(232, 180, 61, 0.06); border: 1px solid rgba(232, 180, 61, 0.18); }
.rumor::before { content: '“'; position: absolute; left: 13px; top: 2px; font-family: var(--display); font-size: 34px; color: var(--gold); font-style: normal; }
.rumor + .rumor { margin-top: 10px; }

/* ---------------------------------------------------------------- party cards */
.char-card { display: flex; flex-direction: column; gap: 12px; }
.char-card .top { display: flex; gap: 12px; align-items: center; }
.char-card .name { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--text); }
.char-card .sub { font-size: 12.5px; color: var(--text-dim); }
.char-card .chips { display: flex; flex-wrap: wrap; gap: 5px; }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 20px; overflow-x: auto; }
.tab { padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--text-dim); border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; border-radius: 0; white-space: nowrap; }
.tab:hover { color: var(--text); filter: none; }
.tab.active { color: var(--spore); border-bottom-color: var(--spore); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

details.fold { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
details.fold > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: '+'; margin-left: auto; font-size: 18px; color: var(--text-faint); }
details.fold[open] > summary::after { content: '–'; }
details.fold > .fold-body { padding: 0 18px 18px; }
details.fold + details.fold { margin-top: 10px; }

/* ---------------------------------------------------------------- flash / toasts */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; margin-bottom: 20px; font-size: 14px; border: 1px solid; }
.flash.ok { background: var(--spore-soft); border-color: rgba(61, 220, 151, 0.35); color: #bff3da; }
.flash.error { background: var(--blood-soft); border-color: rgba(239, 90, 114, 0.4); color: #ffd3da; }
.flash.warn { background: var(--gold-soft); border-color: rgba(232, 180, 61, 0.4); color: #ffe7b0; }

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; min-width: 240px; max-width: 360px; padding: 12px 14px; border-radius: 14px;
  background: rgba(17, 22, 34, 0.96); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  font-size: 13.5px; animation: toast-in 0.25s ease;
}
.toast.dice { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.toast .total { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--spore); min-width: 44px; text-align: center; }
.toast.crit-max .total { color: var(--gold); text-shadow: 0 0 14px rgba(232, 180, 61, 0.7); }
.toast.crit-min .total { color: var(--blood); }
.toast .who { font-weight: 600; }
.toast .detail { color: var(--text-dim); font-size: 12px; font-family: var(--mono); }
.toast.leaving { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }
.live-pill {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 55;
  background: var(--violet); color: #120a2a; font-weight: 700; font-size: 13px; padding: 8px 16px; border-radius: 999px;
  box-shadow: var(--shadow); cursor: pointer; display: none; border: 0;
}
.live-pill.show { display: inline-flex; }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); display: inline-block; }
.conn-dot.on { background: var(--spore); box-shadow: 0 0 8px var(--spore); }

/* ---------------------------------------------------------------- login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); text-align: center; padding: 40px 32px; }
.login-card .brand-mark { width: 64px; height: 64px; font-size: 32px; border-radius: 18px; margin: 0 auto 18px; }
.login-card h1 { font-size: 32px; }
.btn.discord { background: #5865f2; color: #fff; padding: 12px 22px; font-size: 15px; }

/* ---------------------------------------------------------------- misc */
.kbd { font-family: var(--mono); font-size: 12px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.3); }
.cmd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.cmd { padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--line); font-size: 13px; }
.cmd code { background: none; padding: 0; color: var(--spore); font-weight: 600; }
.cmd .dm { color: var(--gold); }
.dot-sep::before { content: '·'; margin: 0 6px; color: var(--text-faint); }
.turn-marker { color: var(--spore); font-weight: 700; }
.disp { font-family: var(--mono); font-weight: 700; }
.disp.pos { color: var(--spore); } .disp.neg { color: var(--blood); } .disp.zero { color: var(--text-dim); }
.dice-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.dice-quick button { font-family: var(--mono); }

/* ---------------------------------------------------------------- maps */
.map-stage { position: relative; width: 100%; aspect-ratio: 10 / 7; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-strong); background: #05070b; user-select: none; touch-action: none; }
.map-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-stage.mode-draw canvas { cursor: crosshair; }
.map-stage.mode-pin canvas { cursor: copy; }
.map-pin { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; pointer-events: auto; z-index: 2; }
.map-pin .marker { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--pc, var(--gold)); border: 2px solid rgba(5, 7, 11, 0.85); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
.map-pin .marker::after { content: ''; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #f4ede0; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.map-pin .label { position: absolute; top: calc(100% + 4px); white-space: nowrap; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: rgba(8, 12, 16, 0.88); border: 1px solid var(--pc, var(--gold)); color: #f4ede0; }
.map-pin.hidden-pin { opacity: 0.55; }
.map-pin.hidden-pin .marker { border-style: dashed; }
.map-pin.draggable { cursor: grab; }
.map-pin.dragging { cursor: grabbing; z-index: 5; }
.map-pin.flash .marker { animation: pin-pop 0.9s ease; }
@keyframes pin-pop { 30% { transform: rotate(-45deg) scale(1.6); } }
.pin-settlement { --pc: #3ddc97; } .pin-exploration { --pc: #e8b43d; } .pin-dungeon { --pc: #e8812e; } .pin-combat { --pc: #e6435f; } .pin-secret { --pc: #b07cf2; }
.swatch { width: 12px; height: 12px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--pc); display: inline-block; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px; }
.toolbar .sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 2px; }
.toolbar button.active { background: var(--spore); color: var(--spore-ink); border-color: transparent; }
.toolbar input[type=color] { width: 38px; height: 34px; padding: 2px; border-radius: 8px; border: 1px solid var(--line-strong); background: none; }
.toolbar input[type=range] { width: 90px; accent-color: var(--spore); }
.map-thumb { aspect-ratio: 10 / 7; border-radius: 10px; background: #05070b center / cover no-repeat; border: 1px solid var(--line); margin-bottom: 12px; display: grid; place-items: center; color: var(--text-faint); font-size: 12px; }
.gen-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 720px) { .gen-types { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gen-type { text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; background: rgba(0, 0, 0, 0.22); color: var(--text); border: 1px solid var(--line-strong); white-space: normal; }
.gen-type small { color: var(--text-dim); font-weight: 500; font-size: 12px; }
.gen-type.active { border-color: var(--spore); background: var(--spore-soft); box-shadow: 0 0 0 3px var(--spore-soft); }
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(3, 4, 7, 0.82); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal-inner { background: var(--surface-solid); border: 1px solid var(--line-strong); border-radius: 18px; padding: 18px; max-width: min(1200px, 96vw); max-height: 94vh; overflow: auto; }
.modal-inner canvas { max-width: 100%; height: auto; border-radius: 10px; display: block; }

/* ---------------------------------------------------------------- overlay previews on Stream page */
.overlay-url { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.overlay-url:last-child { border-bottom: 0; }
@media (max-width: 720px) { .overlay-url { grid-template-columns: 1fr; } }

/* ================================================================ 5e character sheet
   Laid out like the official sheet: banner, abilities column, saves/skills,
   combat column, personality/features — framed boxes with labels underneath. */
.sheet { --frame: rgba(232, 180, 61, 0.38); --frame-strong: rgba(232, 180, 61, 0.7); }
.sheet-label { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.sheet-head { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 1.5fr); gap: 18px; align-items: stretch; margin-bottom: 20px; }
.sheet-name { display: flex; gap: 18px; align-items: center; padding: 18px 22px; border-radius: 18px; border: 2px solid var(--frame); background: linear-gradient(135deg, rgba(232, 180, 61, 0.08), transparent 60%), var(--surface); }
.sheet-name h1 { font-size: clamp(24px, 3vw, 34px); }
.sheet-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 18px; padding: 14px 20px; border-radius: 18px; border: 1px solid var(--frame); background: var(--surface); margin: 0; }
.sheet-meta .meta { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; border-bottom: 1px solid var(--line-strong); padding: 6px 0 4px; min-width: 0; }
.sheet-meta .v { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 0; }
.sheet-meta input, .sheet-meta select { color: var(--text); background: transparent; border: 0; width: 100%; min-width: 0; border-radius: 6px; padding: 2px 4px; font-weight: 600; font-size: 15px; margin-left: -4px; }
.sheet-meta select { background-position: calc(100% - 12px) 55%, calc(100% - 7px) 55%; padding-right: 22px; }
.sheet-meta input:focus, .sheet-meta select:focus { background: rgba(0, 0, 0, 0.3); box-shadow: none; }

.sheet-body { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.sheet-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; margin: 0; }
.sheet-box { position: relative; border: 1px solid var(--frame); border-radius: 14px; padding: 12px 12px 30px; background: var(--surface); margin: 0; }
.sheet-box .box-title { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; color: var(--gold); opacity: 0.85; }
.sheet-box textarea { background: transparent; border-color: transparent; padding: 4px; min-height: 64px; font-size: 13.5px; }
.sheet-box textarea:focus { background: rgba(0, 0, 0, 0.25); }

/* abilities */
.abilities { gap: 12px; }
.ability-box { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px 0; border: 2px solid var(--frame); border-radius: 18px 18px 40px 40px; background: radial-gradient(circle at 50% 30%, rgba(232, 180, 61, 0.07), transparent 70%), var(--surface); }
.ab-name { font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); text-align: center; }
.ab-mod { font-family: var(--mono); font-size: 30px; font-weight: 700; line-height: 1.1; background: none; border: 0; color: var(--text); padding: 4px 10px; border-radius: 10px; }
.ab-mod:hover:not(:disabled) { background: var(--spore-soft); color: var(--spore); filter: none; }
.ab-mod:disabled { opacity: 1; cursor: default; }
.ab-score { width: 64px; text-align: center; font-family: var(--mono); font-weight: 700; font-size: 15px; padding: 4px 6px; margin-bottom: -12px; border-radius: 999px; border: 2px solid var(--frame-strong); background: var(--night-2); display: inline-block; }
input.ab-score { color: var(--text); }
.ability-box:last-child { margin-bottom: 12px; }

/* pills: inspiration / proficiency / passive */
.pill-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pill-row > * { min-width: 0; }
.pill-box { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--frame); border-radius: 999px; background: var(--surface); color: var(--text); text-align: left; width: 100%; white-space: normal; font-weight: 500; }
.pill-box .pv { font-family: var(--mono); font-size: 18px; font-weight: 700; min-width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--frame-strong); background: var(--night-2); flex-shrink: 0; }
.pill-box .sheet-label { line-height: 1.25; white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.pill-box.on .pv { color: var(--gold); border-color: var(--gold); box-shadow: 0 0 14px rgba(232, 180, 61, 0.45); }
button.pill-box:hover:not(:disabled) { border-color: var(--frame-strong); filter: none; }
button.pill-box:disabled { opacity: 1; cursor: default; }
.pill-box.wide { border-radius: 14px; }

/* saves & skills */
.prof-row { display: grid; grid-template-columns: 20px 44px 1fr; align-items: center; gap: 6px; padding: 2px 0; font-size: 13.5px; }
.dot { width: 14px; height: 14px; border-radius: 50%; padding: 0; border: 1.5px solid var(--text-faint); background: transparent; }
.dot.on { background: var(--spore); border-color: var(--spore); box-shadow: 0 0 6px rgba(61, 220, 151, 0.6); }
.dot.expert { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 2px var(--night), 0 0 0 3.5px var(--gold); }
.dot.fail { background: var(--blood); border-color: var(--blood); }
.dot:disabled { cursor: default; opacity: 1; }
.dot:hover:not(:disabled) { border-color: var(--spore); filter: none; }
.pr-val { font-family: var(--mono); font-weight: 700; font-size: 13.5px; background: none; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 4px 4px 0 0; color: var(--text); padding: 2px 4px; justify-content: center; }
.pr-val:hover:not(:disabled) { background: var(--spore-soft); color: var(--spore); filter: none; }
.pr-val:disabled { opacity: 1; cursor: default; }
.pr-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* combat column */
.vitals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.shield { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px 10px; border: 2px solid var(--frame); background: var(--surface); border-radius: 14px 14px 50% 50% / 14px 14px 30% 30%; text-align: center; }
.shield .pv, .shield input { font-family: var(--mono); font-size: 26px; font-weight: 700; width: 70px; text-align: center; background: transparent; border: 0; color: var(--text); padding: 0; }
.shield input:focus { background: rgba(0, 0, 0, 0.3); box-shadow: none; border-radius: 8px; }
.shield button.pv { border-radius: 10px; }
.shield button.pv:hover:not(:disabled) { background: var(--spore-soft); color: var(--spore); filter: none; }
.shield button.pv:disabled { opacity: 1; cursor: default; }
.hp-box { padding-top: 12px; }
.hp-current { font-size: 44px; font-weight: 700; text-align: center; line-height: 1.1; margin: 4px 0 6px; }
.hp-current.mid { color: var(--gold); } .hp-current.low { color: var(--blood); }
.hp-actions { display: grid; grid-template-columns: 1fr auto auto auto; gap: 6px; margin-top: 10px; }
.hp-actions input { padding: 6px 8px; }
.temp-box input { text-align: center; font-family: var(--mono); font-size: 20px; font-weight: 700; background: transparent; border-color: transparent; }
.temp-box .pv { text-align: center; font-size: 20px; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.death-row { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin: 3px 0; }
.death-row .small { margin-right: auto; }
table.attacks { font-size: 13px; }
table.attacks th { padding: 6px 4px; font-size: 10px; }
table.attacks td { padding: 3px 2px; border-bottom: 1px solid var(--line); }
table.attacks input { padding: 5px 6px; font-size: 13px; background: transparent; border-color: transparent; }
table.attacks input:focus { background: rgba(0, 0, 0, 0.3); }
table.attacks form { margin: 0; }
.coins { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 0 0 10px; }
.coin { display: flex; flex-direction: column; align-items: center; gap: 3px; margin: 0; }
.coin-k { font-size: 10.5px; font-weight: 800; color: var(--gold); letter-spacing: 0.08em; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--frame-strong); display: grid; place-items: center; }
.coin input { text-align: center; padding: 4px 2px; font-size: 13px; }
.equip-list { display: flex; flex-direction: column; }
.equip { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 5px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.equip .eq-on { color: var(--spore); font-weight: 600; }
.equip .eq-on::before { content: '⚔ '; }

/* personality & features */
.persona { padding-bottom: 28px; }
.persona textarea { min-height: 70px; }
.features .feat-group { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin: 10px 0 4px; }
.features .feat-group:first-child { margin-top: 0; }
.feat-item { border-bottom: 1px solid var(--line); padding: 5px 0; }
.feat-item summary { cursor: pointer; font-weight: 600; font-size: 13.5px; list-style: none; }
.feat-item summary::-webkit-details-marker { display: none; }
.feat-item summary::before { content: '▸ '; color: var(--gold); }
.feat-item[open] summary::before { content: '▾ '; }
.feat-item .md { margin: 4px 0 4px 14px; color: var(--text-dim); }

.sheet-foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }

@media (max-width: 1200px) {
  .sheet-body { grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1.2fr); }
  .sheet-body > .sheet-col:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sheet-head { grid-template-columns: minmax(0, 1fr); }
  .sheet-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet-body { grid-template-columns: minmax(0, 1fr); }
  .abilities { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ability-box:last-child { margin-bottom: 0; }
  .ability-box { padding-bottom: 14px; }
  .sheet-body > .sheet-col:last-child { grid-template-columns: minmax(0, 1fr); }
  .sheet-foot { grid-template-columns: minmax(0, 1fr); }
  .prof-row { font-size: 15px; padding: 5px 0; }
  .dot { width: 20px; height: 20px; }
  .pr-val { font-size: 15px; padding: 4px; }
}
@media (max-width: 480px) {
  .abilities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet-name { padding: 14px; }
  .sheet-name .avatar.lg { width: 64px; height: 64px; font-size: 24px; }
  .coins { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
}

/* markdown output */
.md p { margin: 0 0 8px; }
.md p:last-child { margin-bottom: 0; }
.md h3, .md h4, .md h5, .md h6 { font-family: var(--display); margin: 12px 0 6px; font-size: 15px; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 20px; }
.md blockquote { margin: 6px 0; padding: 4px 12px; border-left: 3px solid var(--gold); color: var(--text-dim); font-style: italic; }
.md code { font-size: 0.86em; }
.md hr { margin: 12px 0; }

/* creation wizard */
.ability-entry { display: flex; flex-direction: column; gap: 6px; }
.ae-row { display: grid; grid-template-columns: 1fr 76px 40px 44px; gap: 10px; align-items: center; margin: 0; font-size: 14px; color: var(--text); font-weight: 500; }
.ae-row input { text-align: center; padding: 7px; }
.ae-bonus { color: var(--spore); font-weight: 700; text-align: center; }
.ae-final { font-size: 18px; font-weight: 700; text-align: center; color: var(--gold); }
.skill-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; }

/* dice tray */
.dice-fab { position: fixed; left: calc(var(--sidebar) + 22px); bottom: 22px; z-index: 45; width: 56px; height: 56px; border-radius: 50%; padding: 0; box-shadow: 0 10px 30px rgba(61, 220, 151, 0.35); }
.dice-fab .icon { width: 26px; height: 26px; }
.dice-tray { position: fixed; left: calc(var(--sidebar) + 22px); bottom: 90px; z-index: 46; width: min(360px, calc(100vw - 32px)); background: var(--surface-solid); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow); padding: 16px; display: none; max-height: calc(100vh - 120px); overflow: auto; }
.dice-tray.open { display: block; }
.dice-tray .tray-feed { margin-top: 12px; max-height: 220px; overflow: auto; }
.tray-roll { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.tray-roll .t { font-family: var(--mono); font-weight: 700; font-size: 18px; color: var(--spore); }
.tray-roll.crit-max .t { color: var(--gold); } .tray-roll.crit-min .t { color: var(--blood); }
@media (max-width: 900px) { .dice-fab { left: 16px; bottom: 16px; } .dice-tray { left: 16px; bottom: 82px; } }
.save-state { position: fixed; right: 18px; top: 14px; z-index: 55; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--surface-solid); border: 1px solid var(--line-strong); color: var(--text-dim); opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.save-state.show { opacity: 1; }
.save-state.err { color: var(--blood); border-color: rgba(239, 90, 114, 0.5); }

/* ---------- homebrew content (v2.1) ---------- */
.grid.c6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid.tight { gap: 6px; }
@media (max-width: 600px) { .grid.c6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.grid.c6 input { text-align: center; padding-left: 4px; padding-right: 4px; }
.center { text-align: center; }
.row.wrap { flex-wrap: wrap; }
.content-entry > summary { align-items: flex-start; }
.content-entry > summary > .badge { margin-left: auto; flex: none; }
.content-entry > summary::after { margin-left: 10px !important; }
.grid > details.fold + details.fold { margin-top: 0; }
.trait { font-size: 14px; line-height: 1.5; padding: 6px 0; border-top: 1px dashed var(--line); }
.trait:first-of-type { border-top: 0; }
.md-inline > p { display: inline; margin: 0; }
.content-form { margin-bottom: 16px; }

/* ---------- combat turn banners (v2.1) ---------- */
.turn-banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.turn-banner > .icon { width: 22px; height: 22px; flex: none; color: var(--text-faint); }
.turn-banner strong { display: block; }
.turn-banner span { font-size: 13px; color: var(--text-dim); }
.turn-banner.yours { border-color: var(--spore); background: color-mix(in srgb, var(--spore) 14%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--spore) 18%, transparent); animation: turnPulse 2.2s ease-in-out infinite; }
.turn-banner.yours > .icon { color: var(--spore); }
.turn-banner.next { border-color: var(--gold); }
.turn-banner.next > .icon { color: var(--gold); }
@keyframes turnPulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--spore) 6%, transparent); } }
@media (prefers-reduced-motion: reduce) { .turn-banner.yours { animation: none; } }
tr.mine td:nth-child(2) { box-shadow: inset 3px 0 0 var(--gold); }
.session-note.is-note { border-left: 3px solid var(--violet, #9b7ff5); }
.content-inner { padding-bottom: 96px; }

/* ---------- combat strip on the character sheet (v2.1.3) ---------- */
.combat-strip { position: sticky; top: 8px; z-index: 15; margin-bottom: 16px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--surface-solid, #111520) 92%, transparent); backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.combat-strip.yours { border-color: var(--spore); box-shadow: 0 0 0 3px color-mix(in srgb, var(--spore) 22%, transparent), var(--shadow); animation: turnPulse 2.2s ease-in-out infinite; }
.combat-strip.next { border-color: var(--gold); }
.cs-head { display: flex; align-items: center; gap: 10px; }
.cs-head > .icon { width: 20px; height: 20px; flex: none; color: var(--text-faint); }
.combat-strip.yours .cs-head > .icon { color: var(--spore); }
.combat-strip.next .cs-head > .icon { color: var(--gold); }
.cs-text { flex: 1; min-width: 0; }
.cs-text strong { display: block; line-height: 1.2; }
.combat-strip.yours .cs-text strong { color: var(--spore); }
.cs-text span { font-size: 12.5px; color: var(--text-dim); }
.cs-order { list-style: none; margin: 8px 0 0; padding: 0 0 2px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.cs-order li { flex: none; display: flex; align-items: center; gap: 6px; padding: 4px 9px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; white-space: nowrap; }
.cs-order li.foe { border-color: color-mix(in srgb, var(--blood, #e5484d) 45%, var(--line)); }
.cs-order li.cur { border-color: var(--spore); background: var(--spore-soft); color: var(--text); font-weight: 600; }
.cs-order li.me .cs-name { color: var(--gold); font-weight: 600; }
.cs-order li.down { opacity: 0.45; text-decoration: line-through; }
.cs-init { font-family: var(--mono); font-size: 11px; min-width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--night-2, #0b0e16); border: 1px solid var(--line-strong); }
.cs-cond { font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 999px; background: var(--gold); color: #000; }
@media (max-width: 900px) { .combat-strip { top: 58px; } }
@media (prefers-reduced-motion: reduce) { .combat-strip.yours { animation: none; } }
.cs-order { position: relative; scroll-behavior: smooth; }

/* ---------- ability boxes: fixed oval + raw-score mode (v2.1.4) ---------- */
.ability-box input.ab-score, .ability-box span.ab-score { width: 64px; max-width: 64px; flex: none; }
.ability-box input.ab-raw, .ability-box span.ab-raw {
  width: 100%; max-width: 120px; text-align: center; font-family: var(--mono); font-size: 30px; font-weight: 700; line-height: 1.1;
  background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 2px 4px; color: var(--text); -moz-appearance: textfield;
}
.ability-box input.ab-raw::-webkit-outer-spin-button, .ability-box input.ab-raw::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ability-box input.ab-raw:hover { border-color: var(--line-strong); }
.ability-box input.ab-raw:focus { border-color: var(--spore); background: rgba(0, 0, 0, 0.3); box-shadow: none; }
.ab-roll { display: inline-flex; align-items: center; gap: 5px; margin: 2px 0 10px; padding: 3px 12px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 999px; border: 1px solid var(--frame-strong); background: var(--night-2); color: var(--text-dim); }
.ab-roll .icon { width: 13px; height: 13px; }
.ab-roll:hover:not(:disabled) { color: var(--spore); border-color: var(--spore); filter: none; }
.ab-roll:disabled { display: none; }
.stat-mode { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); text-align: center; padding: 2px 0 6px; cursor: help; }
.stat-mode a { color: var(--spore); }
.ability-box input.ab-score.out-of-range { border-color: var(--blood, #e5484d); color: var(--blood, #e5484d); }
.ability-box input.ab-score, .ability-box span.ab-score { width: 72px; max-width: 72px; padding-left: 2px; padding-right: 2px; -moz-appearance: textfield; }
.ability-box input.ab-score::-webkit-outer-spin-button, .ability-box input.ab-score::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- score oval sits inside the ability box (v2.1.6) ---------- */
.ability-box { padding-bottom: 12px; }
.ability-box .ab-mod { margin-bottom: 2px; }
.ability-box input.ab-score, .ability-box span.ab-score {
  margin: 0; height: 28px; line-height: 24px; padding-top: 0; padding-bottom: 0;
  border-radius: 999px; border: 2px solid var(--frame-strong); background: var(--night-2);
  font-size: 14px; display: inline-flex; align-items: center; justify-content: center;
}
.ability-box:last-child { margin-bottom: 0; }
@media (max-width: 900px) { .ability-box { padding-bottom: 12px; } }
.sheet-col.abilities > .stat-mode { grid-column: 1 / -1; }

/* ---------- changelog (v2.2) ---------- */
.changelog { max-width: 880px; }
.cl-era { margin: 28px 0 12px; font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); font-family: var(--body); }
.cl-era:first-child { margin-top: 0; }
.cl-entry { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-top: 1px solid var(--line); }
.cl-rail { display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.cl-version { font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--text); }
.cl-entry.kind-major .cl-version { color: var(--gold); font-size: 18px; }
.cl-date { font-size: 12.5px; color: var(--text-faint); }
.cl-body h3 { margin: 0 0 8px; font-size: 18px; }
.cl-entry.is-new .cl-body { border-left: 3px solid var(--spore); padding-left: 14px; }
@media (max-width: 640px) { .cl-entry { grid-template-columns: minmax(0, 1fr); gap: 6px; } .cl-rail { flex-direction: row; gap: 10px; align-items: baseline; } }
.nav-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--spore); box-shadow: 0 0 10px var(--spore); }
.site-banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; margin-bottom: 18px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; }
.site-banner .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.site-banner.info { border-color: color-mix(in srgb, var(--violet) 60%, var(--line)); }
.site-banner.info .icon { color: var(--violet); }
.site-banner.success { border-color: var(--spore); } .site-banner.success .icon { color: var(--spore); }
.site-banner.warning { border-color: var(--gold); } .site-banner.warning .icon { color: var(--gold); }
.site-banner.danger { border-color: var(--blood, #e5484d); } .site-banner.danger .icon { color: var(--blood, #e5484d); }
.site-banner .md p { margin: 0; }
.site-banner button { margin-left: auto; flex: none; }

/* ---------- admin (v2.2) ---------- */
.content-inner:has(> .site-banner) { padding-bottom: 0; }
.admin-tabs { margin-bottom: 18px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
.admin-tabs .tab { white-space: nowrap; text-decoration: none; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.admin-stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; color: var(--text); text-decoration: none; }
.admin-stat:hover { border-color: var(--spore); text-decoration: none; }
.admin-stat .n { font-family: var(--mono); font-size: 26px; font-weight: 700; }
.admin-stat .l { font-size: 12.5px; color: var(--text-dim); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr.is-banned td { opacity: 0.6; }
.admin-table .badge { margin-left: 6px; }
.admin-line { padding: 7px 0; border-top: 1px solid var(--line); gap: 10px; }
.admin-line:first-of-type { border-top: 0; }
.kv { width: 100%; font-size: 14px; border-collapse: collapse; }
.kv th { text-align: left; font-weight: 500; color: var(--text-dim); padding: 6px 12px 6px 0; width: 40%; }
.kv td { padding: 6px 0; font-family: var(--mono); font-size: 13px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.checks li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.checks .dot-s { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); flex: none; }
.checks li.ok .dot-s { background: var(--spore); box-shadow: 0 0 8px var(--spore); }
.checks li.off { color: var(--text-dim); }
.admin-filter input, .admin-filter select { width: auto; }
@media (max-width: 700px) { .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.admin-stats .admin-stat { display: flex; flex-direction: column; align-items: flex-start; }
.admin-stats .admin-stat .n, .admin-stats .admin-stat .l { display: block; }

/* ---------- status page (v2.2.1) ---------- */
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; background: var(--text-faint); }
.status-dot.up { background: var(--spore); box-shadow: 0 0 10px var(--spore); }
.status-dot.degraded { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.status-dot.down { background: var(--blood, #e5484d); box-shadow: 0 0 10px var(--blood, #e5484d); }
.status-dot.big { width: 16px; height: 16px; }
.status-hero { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: var(--radius); border: 1px solid var(--spore); background: color-mix(in srgb, var(--spore) 10%, var(--surface)); margin-bottom: 18px; }
.status-hero.degraded { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); }
.status-hero.down { border-color: var(--blood, #e5484d); background: color-mix(in srgb, var(--blood, #e5484d) 10%, var(--surface)); }
.status-hero strong { display: block; font-size: 18px; }
.status-hero span { font-size: 13px; color: var(--text-dim); }
.status-list { display: grid; gap: 14px; }
.status-name { display: flex; align-items: center; gap: 12px; }
.status-name strong { display: block; font-size: 16px; }
.status-state { font-size: 13px; font-weight: 700; color: var(--text-faint); }
.status-state.up { color: var(--spore); } .status-state.degraded { color: var(--gold); } .status-state.down { color: var(--blood, #e5484d); }
.status-msg { margin: 10px 0 12px; font-size: 14px; }
.uptime-bars { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; height: 30px; }
.uptime-bars i { border-radius: 3px; background: var(--line-strong); }
.uptime-bars i.ok { background: var(--spore); opacity: 0.85; }
.uptime-bars i.warn { background: var(--gold); }
.uptime-bars i.bad { background: var(--blood, #e5484d); }
.uptime-bars i:hover { opacity: 1; outline: 1px solid var(--text); }
.uptime-legend { margin-top: 6px; gap: 8px; }
.uptime-legend strong { color: var(--text); }
.status-detail { margin-top: 12px; }
@media (max-width: 600px) { .uptime-bars { gap: 2px; height: 26px; } .uptime-legend > span:first-child, .uptime-legend > span:last-child { display: none; } }
