/* rpg table — the visual system. CTO-owned design artifact: the client generates the
   markup these rules style (see mockups/rpg-table/index.html for every state). */

:root {
  --ink-0: #0b0a0f;
  --ink-1: #13111a;
  --ink-2: #1c1924;
  --ink-3: #272231;
  --line: rgba(255, 238, 214, 0.09);
  --line-strong: rgba(255, 238, 214, 0.18);
  --text: #ece5d8;
  --muted: #a89e8f;
  --faint: #6e665c;
  --ember: #f0a35e;
  --ember-hi: #ffd08f;
  --ember-glow: rgba(240, 163, 94, 0.28);
  --jade: #7fcaa6;
  --rose: #e37474;
  --moon: #9aa8ff;          /* the GM's side is moonlit; the table is lantern-lit */
  --moon-glow: rgba(154, 168, 255, 0.26);
  --glass: rgba(17, 15, 24, 0.72);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", Consolas, "SF Mono", monospace;
  --ease: cubic-bezier(0.22, 0.8, 0.26, 1);
  --drawer: min(31rem, 100vw);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink-0);
  color: var(--text);
  font: 13px/1.5 var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ scene */
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.veil {            /* keeps prose legible over the scene, lets the lantern pool show at the edges */
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 62% 78% at 50% 46%, rgba(11, 10, 15, 0.86) 0%, rgba(11, 10, 15, 0.62) 46%, rgba(11, 10, 15, 0) 78%),
    linear-gradient(to bottom, rgba(11, 10, 15, 0.55), rgba(11, 10, 15, 0) 18%, rgba(11, 10, 15, 0) 72%, rgba(11, 10, 15, 0.9));
  transition: opacity 600ms var(--ease);
}
body.mode-world .veil { opacity: 0.25; }

/* ------------------------------------------------------------------ story */
.table {
  position: fixed; inset: 0; z-index: 2;
  display: grid; grid-template-columns: minmax(1rem, 1fr) minmax(0, 44rem) minmax(1rem, 1fr);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
body.gm-open .table { transform: translateX(calc(var(--drawer) * -0.28)); }
body.mode-world .table { opacity: 0; pointer-events: none; }
.story {
  grid-column: 2; overflow-y: auto; padding: 16vh 0.5rem 34vh;
  scrollbar-width: none; scroll-behavior: smooth;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 80%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 80%, transparent 100%);
}
.story::-webkit-scrollbar { display: none; }

.entry { margin: 0 0 1.9rem; animation: rise 520ms var(--ease) both; }
.entry p { margin: 0 0 1.05em; font: 19px/1.78 var(--serif); letter-spacing: 0.003em; color: var(--text); text-wrap: pretty; }
.entry p:last-child { margin-bottom: 0; }
.entry--old p { color: #cfc7b9; }
.entry--out > p:first-of-type::first-letter { color: var(--ember-hi); }

.said { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.9rem; align-items: baseline; padding: 0.15rem 0 0.15rem 1.1rem; border-left: 2px solid var(--ember); }
.said .who { font: 600 11px/1.6 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ember); }
.said p { font-style: italic; color: #f4ecdd; margin: 0; }
.said p + p { grid-column: 2; }

.turnmark { display: flex; align-items: center; justify-content: center; gap: 0.7rem; margin: 2.4rem 0; color: var(--faint); font: 11px/1 var(--sans); letter-spacing: 0.3em; }
.turnmark::before, .turnmark::after { content: ""; height: 1px; width: 4.5rem; background: linear-gradient(to right, transparent, var(--line-strong)); }
.turnmark::after { transform: scaleX(-1); }

/* a roll, with its stakes */
.roll {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.2rem 1.2rem;
  margin: 0 0 1.3rem; padding: 0.8rem 1.05rem; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(135deg, rgba(240, 163, 94, 0.07), rgba(28, 25, 36, 0.55) 55%);
  backdrop-filter: blur(6px);
}
.roll__test { font: 600 13px/1.4 var(--sans); color: var(--text); }
.roll__math { grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; color: var(--muted); font: 12px/1 var(--sans); }
.die { display: inline-grid; place-items: center; min-width: 1.75rem; height: 1.75rem; padding: 0 0.3rem; border-radius: 7px; background: #efe6d2; color: #3b1d17; font: 700 13px/1 var(--sans); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.4); }
.die--dropped { opacity: 0.35; text-decoration: line-through; }
.roll__total { grid-column: 2; grid-row: 1 / span 2; text-align: right; font: 600 30px/1 var(--serif); color: var(--ember-hi); }
.roll__total small { display: block; margin-top: 0.3rem; font: 600 10px/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; }
.roll--success .roll__total small { color: var(--jade); }
.roll--failure .roll__total small { color: var(--rose); }
.roll--failure { background: linear-gradient(135deg, rgba(227, 116, 116, 0.08), rgba(28, 25, 36, 0.55) 55%); }

/* --------------------------------------------------------------- composer */
.composer {
  position: fixed; left: 50%; bottom: 2.1rem; z-index: 4; width: min(42rem, calc(100vw - 2rem));
  transform: translateX(-50%); display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 0.5rem;
  padding: 0.55rem 0.6rem 0.55rem 0.7rem; border: 1px solid var(--line-strong); border-radius: 20px;
  background: var(--glass); backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.3);
  transition: transform 500ms var(--ease), border-color 200ms, box-shadow 200ms, opacity 400ms;
}
body.gm-open .composer { transform: translateX(calc(-50% - var(--drawer) * 0.28)); }
body.mode-world .composer { opacity: 0; pointer-events: none; }
.composer:focus-within { border-color: rgba(240, 163, 94, 0.55); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 0 4px var(--ember-glow); }
.speaker { display: inline-flex; align-items: center; gap: 0.45rem; height: 2.3rem; padding: 0 0.75rem 0 0.35rem; border: 0; border-radius: 14px; background: var(--ink-3); color: var(--text); font-weight: 600; }
.speaker .avatar, .sheet .avatar { display: inline-grid; place-items: center; width: 1.65rem; height: 1.65rem; border-radius: 50%; background: linear-gradient(140deg, var(--ember), #b9603a); color: #1a0f09; font: 700 11px/1 var(--sans); }
.composer textarea { resize: none; border: 0; outline: 0; background: transparent; min-height: 2.3rem; max-height: 9rem; padding: 0.42rem 0.2rem; font: 16px/1.5 var(--serif); }
.composer textarea::placeholder { color: var(--faint); font-style: italic; }
.send { width: 2.3rem; height: 2.3rem; border: 0; border-radius: 50%; background: var(--ember); color: #1a0f09; font-size: 15px; transition: transform 150ms var(--ease), filter 150ms; }
.send:hover { transform: translateY(-1px); filter: brightness(1.1); }
.send:disabled { background: var(--ink-3); color: var(--faint); cursor: default; transform: none; }
.composer--waiting textarea { display: none; }
.composer--waiting .send { background: var(--ink-3); color: var(--faint); pointer-events: none; }
.thinking { display: none; align-items: center; gap: 0.6rem; min-height: 2.3rem; padding: 0 0.3rem; color: var(--muted); font: italic 15px/1 var(--serif); }
.composer--waiting .thinking { display: flex; }
.dots { display: inline-flex; gap: 0.28rem; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ember); animation: pulse 1.3s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.18s; }
.dots i:nth-child(3) { animation-delay: 0.36s; }

/* ------------------------------------------------- quiet chrome at the edges */
.chrome { transition: opacity 900ms var(--ease); }
body.is-idle .chrome { opacity: 0.28; }
body.is-idle .chrome:hover, body.is-idle .chrome:focus-within { opacity: 1; }
body.gm-open .systemchip { opacity: 0; pointer-events: none; }      /* the drawer's head says the same, and the story slides under this corner */

.systemchip { position: fixed; top: 1.15rem; left: 1.3rem; z-index: 4; display: flex; align-items: center; gap: 0.55rem; color: var(--muted); font: 11px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; }
.systemchip b { color: var(--text); font-weight: 600; }
.systemchip .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }

.party { position: fixed; top: 1rem; right: 1.2rem; z-index: 4; display: grid; gap: 0.5rem; width: 15.5rem; transition: transform 500ms var(--ease), opacity 900ms var(--ease); }
body.gm-open .party { opacity: 0; pointer-events: none; transform: translateX(-1rem); }   /* the drawer's Ledger tab has the sheets */
.sheet { border: 1px solid var(--line); border-radius: 14px; background: var(--glass); backdrop-filter: blur(14px); overflow: hidden; }
.sheet > summary { list-style: none; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.6rem; padding: 0.5rem 0.7rem 0.5rem 0.5rem; cursor: pointer; }
.sheet > summary::-webkit-details-marker { display: none; }
.sheet .name { font: 600 13px/1.2 var(--sans); }
.sheet .hpnum { color: var(--muted); font: 600 11px/1 var(--sans); font-variant-numeric: tabular-nums; }
.hp { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.hp > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(to right, #c9743f, var(--ember-hi)); transition: width 700ms var(--ease); }
.hp--low > i { background: linear-gradient(to right, #a23d3d, var(--rose)); }
.sheet__body { padding: 0.15rem 0.75rem 0.75rem; border-top: 1px solid var(--line); display: grid; gap: 0.55rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.chip { padding: 0.16rem 0.5rem; border-radius: 99px; background: var(--ink-3); color: var(--muted); font: 11px/1.5 var(--sans); }
.chip b { color: var(--text); font-weight: 600; }
.chip--bad { background: rgba(227, 116, 116, 0.14); color: #f0a3a3; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.7rem; margin: 0; font-size: 12px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- GM side */
.gm-pip {
  position: fixed; right: 0; top: 50%; z-index: 6; transform: translateY(-50%);
  display: grid; justify-items: center; gap: 0.5rem; width: 1.55rem; padding: 0.8rem 0; border: 1px solid var(--line); border-right: 0;
  border-radius: 12px 0 0 12px; background: var(--glass); backdrop-filter: blur(14px); color: var(--muted);
  transition: width 220ms var(--ease), right 500ms var(--ease), border-color 200ms, color 200ms;
}
.gm-pip:hover, .gm-pip:focus-visible { width: 2rem; color: var(--text); border-color: var(--moon-glow); }
body.gm-open .gm-pip { right: var(--drawer); }
.gm-pip .lamp { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.gm-pip .label { writing-mode: vertical-rl; font: 600 10px/1 var(--sans); letter-spacing: 0.22em; text-transform: uppercase; }
.gm-pip .count { min-width: 1.05rem; padding: 0.12rem 0.2rem; border-radius: 99px; background: var(--moon); color: #10112a; font: 700 10px/1.2 var(--sans); text-align: center; }
.gm-pip--turn .lamp { background: var(--ember); box-shadow: 0 0 10px var(--ember); }
.gm-pip--attention { border-color: var(--moon-glow); color: var(--text); }
.gm-pip--attention .lamp { background: var(--moon); box-shadow: 0 0 12px var(--moon); animation: beacon 1.6s ease-in-out infinite; }

.gm-toast {
  position: fixed; right: 2.3rem; top: 50%; z-index: 6; width: 19rem; transform: translate(1.2rem, -50%); opacity: 0; pointer-events: none;
  padding: 0.8rem 0.95rem; border: 1px solid var(--moon-glow); border-radius: 14px; background: var(--glass); backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(154, 168, 255, 0.07);
  transition: transform 320ms var(--ease), opacity 320ms var(--ease);
}
.gm-toast--in { transform: translate(0, -50%); opacity: 1; pointer-events: auto; }
body.gm-open .gm-toast { opacity: 0; pointer-events: none; }
.gm-toast h4 { margin: 0 0 0.2rem; font: 600 12px/1.3 var(--sans); color: var(--moon); letter-spacing: 0.04em; }
.gm-toast p { margin: 0 0 0.6rem; color: var(--muted); }

.gm-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 5; width: var(--drawer);
  display: grid; grid-template-rows: auto auto auto 1fr auto; transform: translateX(102%);
  border-left: 1px solid var(--line-strong); background: linear-gradient(to bottom, rgba(19, 17, 30, 0.9), rgba(13, 12, 20, 0.94));
  backdrop-filter: blur(22px) saturate(1.15); box-shadow: -30px 0 80px rgba(0, 0, 0, 0.55);
  transition: transform 420ms var(--ease);
}
body.gm-open .gm-drawer { transform: none; }
.gm-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.2rem 1rem; padding: 1.05rem 1.2rem 0.8rem; }
.gm-head h2 { margin: 0; font: 600 16px/1.2 var(--serif); letter-spacing: 0.01em; }
.gm-head .state { grid-column: 1; color: var(--muted); font-size: 12px; }
.gm-head .state b { color: var(--moon); font-weight: 600; }
.iconbtn { width: 1.9rem; height: 1.9rem; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--muted); }
.iconbtn:hover { color: var(--text); border-color: var(--line-strong); }

/* the turn's pipeline: input, plan, checks, reviews, commit, prose */
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 0 1.2rem 0.9rem; }
.step { display: grid; gap: 0.35rem; color: var(--faint); font: 600 10px/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; }
.step::before { content: ""; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); }
.step--done { color: var(--muted); }
.step--done::before { background: var(--moon); opacity: 0.55; }
.step--now { color: var(--text); }
.step--now::before { background: var(--moon); box-shadow: 0 0 10px var(--moon-glow); }
.step--blocked { color: var(--rose); }
.step--blocked::before { background: var(--rose); }

.tabs { display: flex; gap: 0.15rem; padding: 0 0.9rem; border-bottom: 1px solid var(--line); }
.tab { padding: 0.55rem 0.65rem 0.6rem; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 600; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--moon); }
.tab .n { margin-left: 0.3rem; padding: 0.05rem 0.38rem; border-radius: 99px; background: var(--ink-3); color: var(--moon); font-size: 10px; }

.pane { overflow-y: auto; padding: 1rem 1.2rem 1.4rem; display: grid; align-content: start; gap: 1rem; scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; }
.card { border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.022); }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.6rem 0.8rem; color: var(--muted); font: 600 11px/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; }
.card > .body { padding: 0 0.8rem 0.8rem; }
.card--alert { border-color: rgba(227, 116, 116, 0.35); background: rgba(227, 116, 116, 0.05); }
.card--alert > header { color: #f0a3a3; }
.mono, pre.window { margin: 0; font: 11.5px/1.55 var(--mono); color: #cfd2e6; white-space: pre-wrap; word-break: break-word; }
pre.window { max-height: 17rem; overflow: auto; padding: 0.7rem 0.8rem; border-radius: 10px; background: rgba(0, 0, 0, 0.28); }
pre.window .sec { color: var(--moon); }
textarea.plan { width: 100%; min-height: 10rem; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, 0.28); font: 11.5px/1.55 var(--mono); color: #dfe2f5; resize: vertical; }
textarea.plan:focus { outline: 0; border-color: var(--moon-glow); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.btn { height: 2rem; padding: 0 0.85rem; border: 1px solid var(--line-strong); border-radius: 10px; background: transparent; color: var(--text); font-weight: 600; transition: background 150ms, border-color 150ms; }
.btn:hover { background: rgba(255, 255, 255, 0.06); }
.btn--primary { border-color: transparent; background: var(--moon); color: #10112a; }
.btn--primary:hover { background: #b3bdff; }
.btn--danger { color: #f0a3a3; border-color: rgba(227, 116, 116, 0.35); }
.btn:disabled { opacity: 0.4; cursor: default; }

.issue { display: grid; grid-template-columns: 1fr; justify-items: start; gap: 0.3rem; padding: 0.6rem 0; border-top: 1px solid var(--line); }   /* tag, then the text at full width */
.issue:first-child { border-top: 0; }
.issue .tag { align-self: start; padding: 0.1rem 0.45rem; border-radius: 6px; background: var(--ink-3); color: var(--muted); font: 600 10px/1.6 var(--mono); }
.issue--block .tag { background: rgba(227, 116, 116, 0.16); color: #f0a3a3; }
.issue--note .tag { background: rgba(154, 168, 255, 0.14); color: var(--moon); }
.issue p { margin: 0; color: var(--text); }
.issue .cites { color: var(--faint); font: 11px/1.5 var(--mono); word-break: break-word; }

.entity { display: grid; gap: 0.5rem; }
.entity h3 { margin: 0; font: 600 17px/1.2 var(--serif); }
.entity .kind { color: var(--moon); font: 600 10px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.claim { padding: 0.45rem 0; border-top: 1px solid var(--line); color: var(--text); }
.claim small { display: block; color: var(--faint); font: 11px/1.5 var(--mono); }

.gm-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.7rem 1.2rem; border-top: 1px solid var(--line); color: var(--faint); font-size: 11px; }
kbd { padding: 0.05rem 0.38rem; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; font: 10px/1.5 var(--mono); color: var(--muted); }

/* labels the scene asks the client to place (world view) */
.node-label { position: fixed; z-index: 3; transform: translate(-50%, -160%); padding: 0.1rem 0.45rem; border-radius: 6px; background: rgba(11, 10, 15, 0.6); color: var(--text); font: 600 11px/1.4 var(--sans); pointer-events: none; white-space: nowrap; }
.node-label--dim { opacity: 0.45; }

/* the roll that is being thrown right now: stakes over the dice tray */
/* the client sets left/top to the point the scene reports above the dice */
.rollcall { position: fixed; left: 82vw; top: 56vh; z-index: 3; width: 18rem; opacity: 0; transform: translate(-50%, calc(-100% + 10px)); transition: opacity 400ms var(--ease), transform 400ms var(--ease); pointer-events: none; text-align: center; }
.rollcall--in { opacity: 1; transform: translate(-50%, -100%); }
.rollcall .what { font: 600 12px/1.4 var(--sans); letter-spacing: 0.06em; color: var(--muted); }
.rollcall .result { font: 600 44px/1.05 var(--serif); color: var(--ember-hi); text-shadow: 0 0 30px var(--ember-glow); }
.rollcall .result small { display: block; margin-top: 0.15rem; font: 600 11px/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; }
.rollcall--success .result small { color: var(--jade); }
.rollcall--failure .result small { color: var(--rose); }

/* ------------------------------------------------- states the client adds */
body.is-loading .composer, body.is-loading .chrome { opacity: 0; }
.story__empty { margin: 18vh 0 0; text-align: center; color: var(--muted); font: italic 19px/1.7 var(--serif); animation: rise 700ms var(--ease) both; }
.story .roll { cursor: pointer; transition: border-color 200ms, transform 200ms var(--ease); }
.story .roll:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.entry--pending .roll { margin-bottom: 0; }
.entry--pending::after { content: ""; display: block; width: 2.2rem; height: 2px; margin: 1.3rem 0 0 0.2rem; border-radius: 2px; background: linear-gradient(to right, var(--ember), transparent); animation: pulse 1.3s ease-in-out infinite; }
.speaker[hidden] { display: none; }
.composer--notice .thinking { color: #f0a3a3; }
.composer--notice .dots { display: none; }
.composer textarea:disabled { opacity: 0.5; }
.rollcall { width: 24rem; max-width: 80vw; }
.rollcall .what { text-wrap: balance; }
.node-label { transition: opacity 300ms var(--ease); }
.node-label--selected { background: rgba(154, 168, 255, 0.22); color: #fff; box-shadow: 0 0 0 1px var(--moon-glow); }

/* the drawer's forms and lists */
.gm-drawer.is-busy .pane { opacity: 0.6; pointer-events: none; transition: opacity 200ms; }
.card > header > span { color: var(--faint); font-weight: 500; letter-spacing: 0.06em; text-transform: none; }
.card > header .btn { height: 1.7rem; padding: 0 0.6rem; font-size: 11px; letter-spacing: 0; text-transform: none; }
.card .body > p { margin: 0 0 0.6rem; }
.card .body > p:last-child { margin-bottom: 0; }
.pane form { display: grid; gap: 0.6rem; }
.hint { margin: 0; color: var(--muted); font-size: 12px; }
.field { flex: 1 1 9rem; min-width: 0; height: 2rem; padding: 0 0.65rem; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, 0.28); }
.field:focus { outline: 0; border-color: var(--moon-glow); }
.field::placeholder, textarea.plan::placeholder { color: var(--faint); }
form.override { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
form.override fieldset { display: grid; gap: 0.4rem; margin: 0; padding: 0; border: 0; min-width: 0; }
form.override legend { padding: 0; color: var(--muted); font: 11px/1.6 var(--mono); word-break: break-all; }
form.override .field { flex: none; width: 100%; }
details.review { border-top: 1px solid var(--line); padding: 0.5rem 0; }
details.review:first-child { border-top: 0; padding-top: 0; }
details.review > summary { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-weight: 600; list-style: none; }
details.review > summary::-webkit-details-marker { display: none; }
details.review > summary::before { content: "›"; display: inline-block; width: 0.8rem; color: var(--moon); transition: transform 180ms var(--ease); }
details.review[open] > summary::before { transform: rotate(90deg); }
details.review > summary .chip { margin-left: auto; }
details.review > * + * { margin-top: 0.5rem; }
details.review > p { margin: 0.5rem 0 0; }
details.review pre.window { max-height: 11rem; }
.sealed { padding: 0.5rem 0.7rem; border-left: 2px solid var(--moon); border-radius: 0 8px 8px 0; background: rgba(154, 168, 255, 0.07); font: italic 14px/1.55 var(--serif); }
.group { display: grid; gap: 0.35rem; padding: 0.45rem 0; border-top: 1px solid var(--line); }
.group:first-child { border-top: 0; padding-top: 0; }
.group .kind, .entity .kind { color: var(--moon); font: 600 10px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.chip--pick { border: 1px solid transparent; cursor: pointer; transition: background 150ms, border-color 150ms, color 150ms; }
.chip--pick:hover { color: var(--text); border-color: var(--line-strong); }
.chip--pick[aria-pressed="true"] { background: rgba(154, 168, 255, 0.2); color: #fff; border-color: var(--moon-glow); }
.claim--ended { color: var(--faint); }
.claim--ended small { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.2); }
ol.ops { list-style: none; margin: 0.7rem 0 0; padding: 0; display: grid; gap: 0.15rem; font: 11.5px/1.6 var(--mono); color: #cfd2e6; }
ol.ops li { padding: 0.3rem 0; border-top: 1px solid var(--line); word-break: break-word; }
ol.ops .tag { display: inline-block; min-width: 3.6rem; padding: 0 0.4rem; border-radius: 6px; background: var(--ink-3); color: var(--moon); font-weight: 600; text-align: center; }
ol.ops small { display: block; color: var(--faint); font-family: var(--sans); }
.gm-toast .row { gap: 0.4rem; }
body.is-locked .composer, body.is-locked .chrome { opacity: 0; pointer-events: none; }
body.no-scene #scene { display: none; }
body.no-scene { background: radial-gradient(ellipse 70% 60% at 30% 40%, #1b1410 0%, var(--ink-0) 70%); }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes beacon { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.6); opacity: 0.55; } }

@media (max-width: 860px) {
  /* a phone: the party is a row of faces in the corner; a tapped sheet opens under it */
  .party { top: 0.6rem; right: 0.7rem; grid-auto-flow: column; width: auto; gap: 0.35rem; }
  .sheet { border-radius: 99px; }
  .sheet > summary { grid-template-columns: auto; padding: 0.25rem; gap: 0.2rem; }
  .sheet > summary .name, .sheet > summary .hpnum { display: none; }
  .sheet[open] { position: fixed; top: 3.4rem; left: 0.7rem; right: 0.7rem; border-radius: 14px; z-index: 5; }
  .sheet[open] > summary { grid-template-columns: auto 1fr auto; padding: 0.5rem 0.7rem 0.5rem 0.5rem; gap: 0.6rem; }
  .sheet[open] > summary .name, .sheet[open] > summary .hpnum { display: inline; }
  .systemchip { top: 0.95rem; left: 0.9rem; max-width: calc(100vw - 8rem); overflow: hidden; white-space: nowrap; }
  .story { padding-top: 12vh; }
  .gm-pip { top: auto; bottom: 7.5rem; transform: none; }
  .gm-toast { right: 0.8rem; left: 0.8rem; width: auto; top: auto; bottom: 7rem; transform: translateY(1rem); }
  .gm-toast--in { transform: none; }
  .rollcall { display: none; }                /* on a phone the dice sit behind the text: the roll card in the story says it */
  .entry p { font-size: 17px; }
  body.gm-open .table, body.gm-open .composer { transform: none; }
  body.gm-open .composer { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
