@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700;800&family=Inter:wght@400;500;600;700&family=Special+Elite&display=swap');

:root {
  --bg: #0b0d11;
  --bg2: #10141a;
  --panel: #151a21;
  --panel2: #1c232c;
  --panel3: #232b36;
  --line: #2a3340;
  --line2: #364151;
  --ink: #eceae4;
  --mute: #96a0ab;
  --faint: #66707c;
  --accent: #a8f060;       /* ectoplasm */
  --accent-ink: #102006;
  --accent-dim: #a8f06022;
  --wound: #ff5f5f;
  --strain: #5fb4ff;
  --gold: #ffd25a;
  --good: #8ff07a;
  --bad: #ff6b6b;
  /* dice */
  --dA: #3fb950; --dP: #f2cc35; --dB: #86d0f7;
  --dD: #7d4fd6; --dC: #d23b3b; --dS: #1d2026;
  --sym-s: #9df07f; --sym-f: #ff7a7a; --sym-a: #8fd0ff; --sym-h: #c49bff; --sym-t: #ffd25a; --sym-d: #ff4d4d;
  --radius: 14px;
  --shadow: 0 10px 30px #0008;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--body);
  background-image: radial-gradient(1200px 600px at 80% -10%, #1b2a1433, transparent), radial-gradient(900px 500px at -10% 110%, #2a143522, transparent);
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: var(--accent); }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: .02em; line-height: 1.1; margin: 0; }
.mute { color: var(--mute); }
.faint { color: var(--faint); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.hide { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.center { text-align: center; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 1px solid var(--line2); background: var(--panel2); color: var(--ink);
  padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: .95rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.1;
  transition: background .12s, border-color .12s, transform .06s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--panel3); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { border-color: #ff5f5f66; color: #ffb3b3; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 9px; font-size: .82rem; border-radius: 8px; }
.btn.lg { padding: 14px 20px; font-size: 1.1rem; border-radius: 12px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.on { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.icon-btn { width: 34px; height: 34px; padding: 0; border-radius: 9px; font-size: 1.15rem; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); font-size: .8rem; color: var(--mute); white-space: nowrap; }
.chip.accent { color: var(--accent); border-color: #a8f06055; background: var(--accent-dim); }
.chip.red { color: #ffb0b0; border-color: #ff5f5f55; background: #ff5f5f18; }
.chip.gold { color: var(--gold); border-color: #ffd25a55; background: #ffd25a14; }
.chip.blue { color: #a9d8ff; border-color: #5fb4ff55; background: #5fb4ff14; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card.tight { padding: 10px 12px; }
.card h3 { font-size: 1.25rem; }
.label { font-family: var(--display); text-transform: uppercase; letter-spacing: .09em; font-size: .78rem; color: var(--mute); font-weight: 600; }

input[type=text], input[type=password], input[type=number], select, textarea {
  background: var(--bg2); border: 1px solid var(--line2); color: var(--ink); border-radius: 10px; padding: 9px 11px; font: inherit; width: 100%;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

/* ---------- dice & symbols ---------- */
.die { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -.17em; margin: 0 1px; }
.die-A { background: var(--dA); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.die-D { background: var(--dD); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.die-P { background: var(--dP); clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }
.die-C { background: var(--dC); clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }
.die-B { background: var(--dB); border-radius: 2px; width: .9em; height: .9em; vertical-align: -.1em; }
.die-S { background: var(--dS); border-radius: 2px; width: .9em; height: .9em; vertical-align: -.1em; box-shadow: inset 0 0 0 1.5px #8a93a0; }
.sym { font-style: normal; font-weight: 800; }
.sym-s { color: var(--sym-s); } .sym-f { color: var(--sym-f); } .sym-a { color: var(--sym-a); }
.sym-h { color: var(--sym-h); } .sym-t { color: var(--sym-t); } .sym-d { color: var(--sym-d); }

/* big dice in results */
.dice-tray { display: flex; flex-wrap: wrap; gap: 6px; }
.bigdie {
  --c: #444; position: relative; width: 46px; height: 46px; display: grid; place-items: center;
  font-weight: 800; font-size: 15px; line-height: 1; color: #fff; text-shadow: 0 1px 2px #000a;
}
.bigdie::before { content: ''; position: absolute; inset: 0; background: var(--c); z-index: 0; }
.bigdie span { position: relative; z-index: 1; display: flex; gap: 1px; }
.bigdie.A, .bigdie.D { } .bigdie.A::before, .bigdie.D::before { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.bigdie.P::before, .bigdie.C::before { clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }
.bigdie.B::before, .bigdie.S::before, .bigdie.X::before { inset: 5px; border-radius: 6px; }
.bigdie.A { --c: var(--dA); } .bigdie.P { --c: var(--dP); color: #2a2100; text-shadow: none; }
.bigdie.B { --c: var(--dB); color: #062030; text-shadow: none; } .bigdie.D { --c: var(--dD); }
.bigdie.C { --c: var(--dC); } .bigdie.S { --c: var(--dS); } .bigdie.S::before { box-shadow: inset 0 0 0 2px #8a93a0; }
.bigdie.X { --c: #2c3440; } .bigdie.X::before { box-shadow: inset 0 0 0 2px var(--accent); }
.bigdie .sym { text-shadow: none; }
.bigdie.P .sym, .bigdie.B .sym { filter: brightness(.55) saturate(1.6); }
.bigdie.rolling { animation: tumble .45s ease-in-out infinite; }
.bigdie.land { animation: land .35s ease-out both; }
@keyframes tumble { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(160deg) scale(.85); } 100% { transform: rotate(360deg) scale(1); } }
@keyframes land { 0% { transform: scale(1.35) rotate(-20deg); opacity: .3; } 100% { transform: none; opacity: 1; } }
.sm-dice .bigdie { width: 30px; height: 30px; font-size: 11px; }
.sm-dice .bigdie.B::before, .sm-dice .bigdie.S::before, .sm-dice .bigdie.X::before { inset: 3px; border-radius: 4px; }

/* ---------- roll result card ---------- */
.roll { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; position: relative; overflow: hidden; }
.roll::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--who, var(--line2)); }
.roll .who { display: flex; align-items: center; gap: 8px; }
.roll .who img { width: 30px; height: 30px; object-fit: cover; object-position: top; border-radius: 50%; background: var(--panel3); }
.roll .who .nm { font-family: var(--display); font-weight: 700; font-size: 1.05rem; }
.roll .lbl { color: var(--mute); font-size: .88rem; }
.roll .verdict { font-family: var(--display); font-weight: 800; font-size: 1.6rem; letter-spacing: .03em; line-height: 1; margin-top: 8px; }
.roll .verdict.good { color: var(--good); } .roll .verdict.bad { color: var(--bad); } .roll .verdict.neutral { color: var(--ink); }
.roll .vsub { font-weight: 600; color: var(--ink); }
.roll .netline { font-size: 1.15rem; letter-spacing: 2px; margin-top: 2px; }
.roll .plain { color: var(--mute); margin-top: 4px; font-size: .92rem; }
.roll .dmg { margin-top: 8px; background: #ff5f5f14; border: 1px solid #ff5f5f40; border-radius: 10px; padding: 8px 10px; }
.roll .dmg b { color: #ffb0b0; font-size: 1.15rem; }
.roll details { margin-top: 8px; }
.roll summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .9rem; list-style: none; }
.roll summary::-webkit-details-marker { display: none; }
.roll summary::before { content: '▸ '; }
.roll details[open] summary::before { content: '▾ '; }
.roll ul.sugg { margin: 6px 0 0; padding: 0; list-style: none; }
.roll ul.sugg li { padding: 5px 0; border-top: 1px dashed var(--line); font-size: .9rem; }
.roll ul.sugg li .cost { display: inline-block; min-width: 3.2em; }
.roll .gm-sugg summary { color: var(--sym-h); }
.roll .fx { margin-top: 6px; font-size: .82rem; color: var(--gold); }
.roll .ts { font-size: .72rem; color: var(--faint); margin-left: auto; white-space: nowrap; }
.roll.hidden-roll { border-style: dashed; opacity: .9; }
.roll.fresh { animation: pop .5s ease-out; }
@keyframes pop { 0% { transform: translateY(-8px) scale(.98); box-shadow: 0 0 0 2px var(--accent); } 100% { transform: none; box-shadow: none; } }
.feed { display: flex; flex-direction: column; gap: 10px; }

/* ---------- meters ---------- */
.meter { display: flex; align-items: center; gap: 8px; }
.meter .bar { flex: 1; height: 12px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line); overflow: hidden; position: relative; }
.meter .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; transition: width .25s; }
.meter.w .bar i { background: linear-gradient(90deg, #b83232, var(--wound)); }
.meter.s .bar i { background: linear-gradient(90deg, #2c6fb5, var(--strain)); }
.meter .val { font-family: var(--display); font-weight: 700; font-size: 1.15rem; min-width: 4.2em; text-align: center; }
.meter.over .val { color: var(--bad); }
.meter .nm { font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--mute); width: 4.4em; }

/* ---------- toasts ---------- */
#toasts { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 20px)); pointer-events: none; }
.toast { pointer-events: auto; background: #1c232cf2; backdrop-filter: blur(8px); border: 1px solid var(--line2); border-left: 4px solid var(--accent); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); animation: slidein .25s ease-out; font-size: .92rem; }
.toast.out { animation: slideout .3s ease-in forwards; }
.toast b { font-family: var(--display); font-size: 1.05rem; letter-spacing: .02em; }
@keyframes slidein { from { transform: translateY(-14px); opacity: 0; } }
@keyframes slideout { to { transform: translateY(-14px); opacity: 0; } }

/* ---------- modal / sheet ---------- */
.overlay { position: fixed; inset: 0; background: #000a; z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--panel); border: 1px solid var(--line2); border-bottom: none; border-radius: 20px 20px 0 0; width: min(640px, 100%); max-height: 94vh; overflow-y: auto; padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); animation: up .22s ease-out; }
@media (min-width: 760px) { .overlay { align-items: center; } .sheet { border-radius: 20px; border-bottom: 1px solid var(--line2); } }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.sheet .grab-zone { position: sticky; top: -16px; z-index: 5; margin: -16px -16px 6px; padding: 12px 0 10px; cursor: pointer; touch-action: none; background: linear-gradient(var(--panel) 70%, transparent); }
.sheet .grab { width: 48px; height: 5px; border-radius: 9px; background: var(--line2); margin: 0 auto; }
.sheet .grab-zone:hover .grab { background: var(--mute); }
.sheet h2 { font-size: 1.7rem; }
.sheet .section { margin-top: 14px; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { flex: 1 1 auto; min-width: 64px; border: 1px solid var(--line2); background: var(--bg2); padding: 8px 6px; border-radius: 10px; cursor: pointer; text-align: center; font-size: .82rem; line-height: 1.2; }
.seg button .d { display: block; min-height: 1.1em; margin-top: 3px; }
.seg button.on { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); font-weight: 700; }

.stepper { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.stepper .nm { flex: 1; }
.stepper .ct { min-width: 1.6em; text-align: center; font-weight: 800; font-family: var(--display); font-size: 1.2rem; }
.toggle { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; margin-top: 6px; }
.toggle input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.toggle.on { border-color: var(--accent); }

.pool-preview { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; align-items: center; gap: 12px; min-height: 72px; }
.pool-preview .dice-tray { flex: 1; }
.pool-preview .odds { text-align: right; font-family: var(--display); }
.pool-preview .odds b { font-size: 1.7rem; display: block; line-height: 1; }
.explain { font-size: .86rem; color: var(--mute); margin-top: 6px; }

/* ---------- read-aloud & handouts ---------- */
.read { background: linear-gradient(180deg, #1a1f16, #141a12); border: 1px solid #a8f06033; border-left: 4px solid var(--accent); border-radius: 12px; padding: 12px 16px; font-size: 1.05rem; line-height: 1.6; white-space: pre-line; font-family: Georgia, 'Times New Roman', serif; color: #e9eadf; }
.read .rt { font-family: var(--display); color: var(--accent); text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; display: block; margin-bottom: 4px; font-weight: 700; }
.paper { background: #e9dfc8; color: #2a2116; border-radius: 6px; padding: 22px 22px; font-family: 'Special Elite', 'Courier New', monospace; line-height: 1.55; box-shadow: 0 8px 24px #000a, inset 0 0 60px #b8a17a66; }
.paper h3 { font-family: 'Special Elite', monospace; font-size: 1.4rem; margin-bottom: 10px; }
.paper p { margin: 0 0 12px; }
.paper .entry b { display: block; margin-top: 4px; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th, table.t td { border-bottom: 1px solid var(--line); padding: 7px 6px; text-align: left; vertical-align: top; }
table.t th { color: var(--mute); font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; }

/* ---------- landing ---------- */
.hero { text-align: center; padding: 30px 16px 8px; }
.hero h1 { font-size: clamp(2.4rem, 9vw, 4.6rem); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; line-height: .92; text-shadow: 0 0 30px #a8f06040; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--mute); max-width: 560px; margin: 10px auto 0; }
.pick-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); padding: 16px; max-width: 1100px; margin: 0 auto; }
.pick { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; cursor: pointer; text-decoration: none; color: inherit; position: relative; transition: transform .12s, border-color .12s; min-height: 190px; }
.pick:hover { transform: translateY(-2px); border-color: var(--pc); }
.pick .art { width: 120px; flex: none; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--pc) 30%, transparent), transparent 70%); display: flex; align-items: flex-end; justify-content: center; }
.pick .art img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.pick .info { padding: 14px 14px 14px 0; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.pick h2 { font-size: 1.6rem; color: var(--pc); }
.pick .claimed { position: absolute; top: 10px; right: 10px; }
.pick .tag { font-size: .9rem; }
.pick .stats { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; }

/* ---------- player page ---------- */
.pc-head { position: relative; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 16%, transparent), transparent); display: flex; gap: 12px; align-items: flex-end; }
.pc-head .port { width: 74px; height: 96px; flex: none; border-radius: 12px; overflow: hidden; background: var(--panel2); border: 1px solid var(--line2); }
.pc-head .port img { width: 100%; height: 135%; object-fit: cover; object-position: top center; }
.pc-head h1 { font-size: 1.9rem; color: var(--pc); }
.pc-head .meta { color: var(--mute); font-size: .88rem; }
.vitals { padding: 10px 16px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.scene-bar { padding: 8px 16px; display: flex; gap: 8px; align-items: center; font-size: .86rem; border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; }
.scene-bar b { font-family: var(--display); font-size: 1.05rem; letter-spacing: .03em; }
.tabs { position: sticky; top: 0; z-index: 20; display: flex; background: #0b0d11ee; backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { flex: 1; background: none; border: none; color: var(--mute); padding: 12px 10px; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; font-size: .9rem; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; position: relative; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs button .dot { position: absolute; top: 8px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--wound); }
.page { padding: 14px 16px 90px; max-width: 760px; margin: 0 auto; }
.chars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.charbox { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; text-align: center; padding: 8px 2px 6px; cursor: pointer; }
.charbox b { display: block; font-family: var(--display); font-size: 1.9rem; line-height: 1; }
.charbox span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .58rem; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); }
.charbox.mod b { color: var(--accent); }
.skill-list { display: flex; flex-direction: column; gap: 6px; }
.skill { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .12s, background .12s; }
.skill:hover { border-color: var(--line2); background: var(--panel2); }
.skill:active { transform: scale(.99); }
.skill .nm { font-weight: 600; }
.skill .sub { font-size: .76rem; color: var(--mute); }
.skill .pips { display: flex; gap: 3px; }
.skill .pips i { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); }
.skill .pips i.on { background: var(--accent); }
.skill .pool { margin-left: auto; white-space: nowrap; font-size: 1.15rem; }
.skill.trained { border-color: #a8f06030; }
.skill.untrained .nm { color: var(--mute); }
.career-dot { color: var(--gold); font-size: .7rem; margin-left: 4px; }
.group-h { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 8px; }
.group-h h3 { font-size: 1.15rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); }
.weapon { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.weapon h4 { font-size: 1.25rem; }
.weapon .stats { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.talent { padding: 10px 0; border-top: 1px solid var(--line); }
.talent:first-child { border-top: none; }
.talent b { font-family: var(--display); font-size: 1.1rem; letter-spacing: .02em; }
.motiv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 480px) { .motiv { grid-template-columns: 1fr; } }
.motiv .card .label { color: var(--accent); }

.request { background: linear-gradient(90deg, #a8f06022, #a8f06008); border: 1px solid var(--accent); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; animation: glow 2s ease-in-out infinite; cursor: pointer; margin: 10px 16px 0; }
.request .big { font-family: var(--display); font-size: 1.2rem; font-weight: 700; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px #a8f06022; } }

.story { display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 999px; padding: 4px 6px 4px 10px; font-size: .85rem; }
.story .tok { display: inline-flex; gap: 3px; }
.story .tok i { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px #ffd25a88; }
.story .tok i.gm { background: #b06bff; box-shadow: 0 0 8px #b06bff88; }

.init-list { display: flex; flex-direction: column; gap: 6px; }
.init { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.init.pc { border-left: 4px solid var(--good); }
.init.npc { border-left: 4px solid var(--bad); }
.init.now { outline: 2px solid var(--accent); background: var(--panel2); }
.init .n { font-family: var(--display); font-weight: 700; font-size: 1.05rem; }

.target { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.target.down { opacity: .45; text-decoration: line-through; }

.guide h3 { font-size: 1.3rem; color: var(--accent); margin: 18px 0 6px; }
.guide p { margin: 6px 0; }
.guide .card { margin-top: 10px; }

/* ---------- GM layout ---------- */
.gm-top { position: sticky; top: 0; z-index: 30; background: #0b0d11f2; backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 8px 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.gm-top h1 { font-size: 1.35rem; text-transform: uppercase; letter-spacing: .06em; }
.gm-top h1 span { color: var(--accent); }
.gm-wrap { display: grid; grid-template-columns: 200px minmax(0, 1fr) 380px; gap: 0; min-height: calc(100vh - 56px); }
.gm-nav { border-right: 1px solid var(--line); padding: 10px; position: sticky; top: 56px; align-self: start; height: calc(100vh - 56px); overflow-y: auto; }
.gm-nav button { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--mute); padding: 9px 10px; border-radius: 9px; cursor: pointer; font-family: var(--display); font-size: 1.05rem; font-weight: 600; letter-spacing: .03em; }
.gm-nav button.on { background: var(--accent-dim); color: var(--accent); }
.gm-nav .sub { padding-left: 20px; font-size: .92rem; }
.gm-main { padding: 16px 20px 80px; min-width: 0; }
.gm-side { border-left: 1px solid var(--line); padding: 12px; position: sticky; top: 56px; align-self: start; height: calc(100vh - 56px); overflow-y: auto; background: var(--bg2); }
@media (max-width: 1180px) { .gm-wrap { grid-template-columns: 170px minmax(0, 1fr); } .gm-side { grid-column: 1 / -1; position: static; height: auto; border-left: none; border-top: 1px solid var(--line); } }
@media (max-width: 760px) { .gm-wrap { grid-template-columns: 1fr; } .gm-nav { position: static; height: auto; display: flex; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); } .gm-nav button { white-space: nowrap; width: auto; } .gm-nav .sub { display: none; } }
.gm-main h2 { font-size: 2rem; margin-bottom: 4px; }
.gm-main .goal { color: var(--mute); margin-bottom: 14px; }
.enc-block { margin-top: 18px; }
.enc-block > .label { margin-bottom: 6px; display: block; }
.notes { margin: 0; padding-left: 20px; }
.notes li { margin: 6px 0; }
.check { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.check .hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.check .hd b { font-size: 1rem; }
.check .outs { margin: 6px 0 0; padding: 0; list-style: none; }
.check .outs li { font-size: .9rem; padding: 3px 0; }
.check .outs li .k { display: inline-block; min-width: 3.4em; }
.loc { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 10px; }
.loc.closed { opacity: .6; }
.loc h3 { font-size: 1.3rem; }
.loc .num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line2); font-family: var(--display); font-weight: 700; margin-right: 6px; }
.adv-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 12px; }
.adv-card.down { opacity: .5; }
.adv-card h3 { font-size: 1.4rem; }
.adv-chars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin: 8px 0; text-align: center; }
.adv-chars div { background: var(--bg2); border-radius: 8px; padding: 4px 0; }
.adv-chars b { display: block; font-family: var(--display); font-size: 1.3rem; line-height: 1; }
.adv-chars span { font-size: .62rem; text-transform: uppercase; color: var(--mute); letter-spacing: .05em; }
.adv-skill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; background: var(--bg2); border: 1px solid var(--line); cursor: pointer; font-size: .85rem; margin: 3px 3px 0 0; }
.adv-skill:hover { border-color: var(--accent); }
.pc-mini { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; border-left: 4px solid var(--pc); }
.pc-mini .nm { font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: var(--pc); }
.pc-mini .meter .val { font-size: .95rem; min-width: 3.4em; }
.pc-mini .meter .nm { width: 3.6em; font-size: .7rem; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.online-dot.on { background: var(--good); box-shadow: 0 0 6px var(--good); }
.side-h { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 8px; }
.side-h:first-child { margin-top: 0; }
.side-h h3 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); }
.popover { position: fixed; z-index: 60; background: var(--panel2); border: 1px solid var(--line2); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); width: min(360px, calc(100vw - 20px)); }
.tracker { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.tracker .pips { display: flex; gap: 4px; }
.tracker .pips i { width: 16px; height: 16px; border-radius: 4px; background: var(--bg2); border: 1px solid var(--line2); }
.tracker .pips i.on { background: var(--accent); border-color: var(--accent); }
.login { max-width: 380px; margin: 12vh auto; padding: 16px; }

/* ---------- table / TV ---------- */
.tv { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; padding: 18px; height: 100vh; }
.tv .feed .roll { font-size: 1.1rem; }
.tv .feed .roll .verdict { font-size: 2.3rem; }
.tv h1 { font-size: 2.4rem; text-transform: uppercase; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 9px; border: 2px solid var(--bg); }

html, body { overflow-x: hidden; }
.pc-head .grow, .vitals, .page { min-width: 0; }

summary { display: list-item; }
.roll summary, summary[style*='list-style:none'] { list-style: none; }

.scene-art { position: relative; aspect-ratio: 16/9; background: #000; overflow: hidden; cursor: zoom-in; border-bottom: 1px solid var(--line); animation: fade .6s; }
.scene-art img { width: 100%; height: 100%; object-fit: contain; display: block; }
.scene-art .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 16px 8px; background: linear-gradient(transparent, #0b0d11ee); display: flex; flex-direction: column; }
.scene-art .cap b { font-family: var(--display); font-size: 1.3rem; letter-spacing: .03em; }
.scene-art .cap span { font-size: .8rem; color: var(--mute); }

/* roleplay cards */
.role { background: linear-gradient(180deg, #1b1830, #161a22); border: 1px solid #a98bff44; border-left: 4px solid #a98bff; border-radius: 12px; margin-top: 10px; }
.role summary { list-style: none; cursor: pointer; padding: 10px 14px; }
.role summary::-webkit-details-marker { display: none; }
.role-hd { display: flex; gap: 10px; align-items: flex-start; }
.role-mask { font-size: 1.4rem; line-height: 1; margin-top: 2px; }
.role-hd b { font-family: var(--display); font-size: 1.25rem; letter-spacing: .02em; color: #d4c6ff; }
.role-play { margin-top: 3px; font-size: .93rem; }
.role-more { font-size: .78rem; color: var(--mute); white-space: nowrap; }
.role[open] .role-more { visibility: hidden; }
.role-say { margin-top: 8px; background: #0d0b16; border-radius: 8px; padding: 8px 12px; font-family: Georgia, serif; font-size: 1.02rem; color: #efe9ff; }
.role-say .label { display: block; font-family: var(--display); margin-bottom: 2px; }
.role-body { padding: 0 14px 12px 48px; font-size: .92rem; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.role-knows { margin: 4px 0 0; padding: 0; list-style: none; }
.role-knows li { padding: 4px 0; border-top: 1px dashed var(--line); }
.role-knows .chip { font-size: .7rem; margin-right: 4px; }
.role-asks { display: grid; gap: 6px; margin-top: 4px; }
.role-ask { background: var(--bg2); border-radius: 8px; padding: 7px 10px; }
.role-ask .q { font-size: .78rem; color: var(--mute); text-transform: uppercase; letter-spacing: .05em; font-family: var(--display); }
.role-ask .a { font-family: Georgia, serif; font-size: .98rem; margin-top: 2px; }
.role-side { margin-top: 10px; }
.role-tip { margin-top: 10px; background: #a8f06014; border: 1px solid #a8f06033; border-radius: 8px; padding: 8px 10px; }
@media (max-width: 760px) { .role-body { padding-left: 14px; } }

/* turn banners */
.turn { margin: 10px 16px 0; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line2); background: var(--panel); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.turn.enemy { border-color: #ff5f5f66; background: linear-gradient(90deg, #ff5f5f1c, transparent); }
.turn.wait { color: var(--mute); }
.turn.open { border-color: var(--accent); background: linear-gradient(90deg, #a8f06026, #a8f06008); animation: glow 1.6s ease-in-out infinite; }
.turn.mine { display: block; border: 2px solid var(--accent); background: linear-gradient(180deg, #a8f0601c, var(--panel) 40%); box-shadow: 0 0 24px #a8f06022; }
.turn.mine h3 { font-size: 1.5rem; color: var(--accent); }
.tpill { font-size: .82rem; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line2); background: var(--bg2); }
.tpill.done { border-color: var(--accent); color: var(--accent); }
.tsec { margin-top: 10px; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin-top: 4px; }
.tgrid .btn { flex-direction: column; align-items: flex-start; text-align: left; padding: 8px 10px; gap: 2px; font-size: .9rem; }
.tgrid .btn span { font-size: .72rem; font-weight: 500; opacity: .8; }

/* spellbook */
.spellbook { display: grid; gap: 6px; }
.spell { display: flex; gap: 10px; align-items: center; text-align: left; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid #a98bff44; background: linear-gradient(90deg, #a98bff14, var(--bg2)); cursor: pointer; color: var(--ink); font: inherit; }
.spell:hover { border-color: #a98bff; }
.spell:active { transform: scale(.99); }
.spell .si { font-size: 1.6rem; line-height: 1; }
.spell b { font-family: var(--display); font-size: 1.15rem; letter-spacing: .02em; display: block; color: #d4c6ff; }
.spell .sd { display: block; font-size: .84rem; margin-top: 1px; }
.spell .sf { display: block; font-size: .76rem; color: var(--mute); margin-top: 2px; }
.spell .sdiff { text-align: right; font-size: .72rem; color: var(--mute); white-space: nowrap; line-height: 1.5; }

/* GM toasts out of the way; flashes; down banner */
.gm-page #toasts { top: auto; bottom: 12px; left: 12px; transform: none; width: min(360px, calc(100vw - 24px)); flex-direction: column-reverse; }
.flash { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; pointer-events: none; animation: flashout 1.6s ease-out forwards; }
.flash div { font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 12vw, 6rem); letter-spacing: .06em; text-shadow: 0 0 30px currentColor; animation: flashpop .5s ease-out; }
.flash-t { background: radial-gradient(circle, #ffd25a55, #ffd25a11 60%, transparent); color: var(--gold); }
.flash-d { background: radial-gradient(circle, #ff3b3b66, #3b000044 60%, transparent); color: #ff5f5f; }
@keyframes flashout { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
@keyframes flashpop { from { transform: scale(.4); opacity: 0; } }
.down-banner { margin: 10px 16px 0; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--bad); background: linear-gradient(90deg, #ff5f5f2a, #ff5f5f08); }
.down-banner b { font-family: var(--display); font-size: 1.3rem; color: #ffb0b0; }
.lunacy { position: fixed; inset: 0; z-index: 150; background: radial-gradient(circle at 50% 30%, #3a0d0dee, #000e); display: grid; place-items: center; padding: 20px; text-align: center; animation: fade .3s; }
.lunacy h1 { font-size: clamp(3rem, 14vw, 6rem); color: #ff5f5f; text-shadow: 0 0 40px #ff0000aa; }
.hint { background: #ffd25a12; border: 1px solid #ffd25a40; border-radius: 10px; padding: 8px 10px; margin-top: 8px; font-size: .88rem; }
.hint b { color: var(--gold); }
