/* SOUL RP · Night at the gate. All accents follow the active resonance. */
.page-chat .msgs { scrollbar-gutter:stable; padding-inline:clamp(12px,3vw,54px); gap:clamp(14px,2vh,22px); }
.page-chat .msg:is(.npc,.me) { max-width:min(77ch,94%); min-width:0; }
.page-chat .msg:is(.npc,.me) > div { min-width:0; }
.page-chat .bubble,.page-chat .narrbox { line-height:1.65; overflow-wrap:anywhere; }
.page-chat .bubble em { color:var(--soft); }
.page-chat .msg .who { flex-wrap:wrap; column-gap:.55rem; row-gap:.12rem; }
.page-chat .msg.narr .narrbox { border-inline-start:2px solid var(--lantern); padding-inline-start:1em; }
.page-chat .scene[aria-current] { box-shadow:inset 3px 0 var(--lantern); }
.page-chat .chat-toolbox > summary { width:fit-content; display:flex; align-items:center; gap:.45rem; min-height:32px; font-size:.78rem; color:var(--soft); cursor:pointer; list-style:none; }
.page-chat .chat-toolbox > summary::-webkit-details-marker { display:none; }
.page-chat .chat-toolbox > summary::after { content:'⌄'; }
.page-chat .chat-toolbox[open] > summary::after { transform:rotate(180deg); }
.page-chat .chat-toolbox[open] .composer-tools { margin-top:4px; }
.page-chat .world-drawer { border-bottom:1px solid var(--line); background:var(--panel); max-height:26vh; overflow:auto; flex:none; }
.page-chat .world-drawer > summary { display:flex; align-items:center; gap:8px; padding:6px 16px; min-height:32px; cursor:pointer; color:var(--soft); font-size:12px; }
.page-chat .world-drawer > summary b { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.page-chat .world-drawer > summary span { color:var(--muted); }
.page-chat .world-drawer > summary::after { content:'⌄'; margin-inline-start:auto; }
.page-chat .world-drawer[open] > summary::after { transform:rotate(180deg); }
.page-chat .chat-toolbox[open] { max-height:25vh; overflow:auto; }
.page-chat .chat-toolbox[open] .suggest { display:flex; overflow-x:auto; }
.page-chat .cast-strip { padding-block:4px; gap:8px; }
.page-chat .cast-strip .castcard { width:auto; min-width:0; display:inline-flex; flex-direction:row; align-items:center; gap:5px; padding:3px 8px 3px 3px; }
.page-chat .cast-strip .castcard :is(img,.ck) { width:31px; height:34px; border-radius:7px; }
.page-chat .cast-strip .castcard small { max-width:11ch; margin:0; font-size:11px; line-height:1.3; }
.page-chat .cast-strip .castcard .mood { top:2px; right:auto; left:23px; }
body.scene-focus .page-chat .world-drawer { display:none; }
.page-chat .chat-jump { position:relative; height:0; z-index:3; display:flex; justify-content:center; }
.page-chat .chat-jump[hidden] { display:none; }
.page-chat .chat-jump button { position:absolute; bottom:8px; border-color:var(--line3); background:var(--panel); box-shadow:0 3px 12px #0006; }
@media(max-width:650px) {
  .page-chat .msgs { padding-inline:10px; }
  .page-chat .msg:is(.npc,.me) { max-width:97%; }
  .page-chat .composer textarea { font-size:16px; }
  .page-chat .composer-hints { display:none; }
  .page-chat .room-actions { max-width:52%; overflow-x:auto; }
  .page-chat .room-actions > * { flex-shrink:0; }
  .page-chat .living .lw-acts { flex-wrap:wrap; }
}
:root {
  --bg: #0a1017;
  --bg2: #0e161f;
  --panel: #131d27;
  --panel2: #192532;
  --raise: #202e3a;
  --text: #f4f0e9;
  --soft: #d5dce2;
  --muted: #acb8c5;
  --dim: #91a0af;
  --line: rgb(181 201 214 / .14);
  --line2: rgb(185 201 212 / .23);
  --line3: rgb(200 216 230 / .38);
  --paper: #fff4e0;
  --lantern: color-mix(in srgb, var(--rei), #ffe3b7 40%);
  --ink-card: linear-gradient(145deg, #182431, #101822 76%);
  --gate-art: url("../img/spirit-gate.webp");
  --dojo-art: url("../img/moon-dojo.webp");
}
body {
  background: radial-gradient(ellipse at 54% 0, #1b2835, transparent 54rem), var(--bg);
}
.gate { isolation: isolate; background: #0c141d; }
.gate-sky {
  background: linear-gradient(90deg, #101722 1%, transparent 84%);
  overflow: hidden;
}
.gate-sky::before {
  content: ""; position: absolute; inset: -1% 18% -1% -1%;
  background: linear-gradient(0deg, #0c131c 0%, #0b111c69 45%, #0b111c12 75%),
    linear-gradient(90deg, #0a111d77, transparent 55%, #0d1620 100%),
    var(--gate-art) 69% 48% / cover no-repeat;
  transform: translate3d(calc(var(--px) * -5px), calc(var(--py) * -3px), 0);
}
.gate .ridges, .gate .stars { display: none; }
.gate-fog {
  inset: auto 0 0; height: 27%;
  background: linear-gradient(0deg, #0a111b 0%, transparent 95%);
}
.gate-top, .gate-foot { border-color: var(--line); }
.gate-top { background: linear-gradient(#07101bcc, transparent); }
.gate-top .proto { color: #c9d2d9; }
.gate-body { max-width: 1540px; gap: clamp(42px, 7vw, 116px); padding-block: clamp(22px, 5vh, 64px); }
.gate-body .sigil {
  width: clamp(72px, 8vw, 114px); margin: 0 0 clamp(15px, 3vh, 35px);
}
.gate-body .sigil .moon {
  background: linear-gradient(145deg, #392c25, #0a151e 76%);
  box-shadow: inset 0 0 0 1px #cfb18d70, 0 8px 30px #05080e70;
}
.gate-body .sigil .moon::before, .gate-body .sigil .mist { display: none; }
.gate-body .sigil .kanji { font-size: 43cqw; color: var(--paper); text-shadow: none; filter: none; }
.gate-body .sigil .ring { color: #e6c49b; }
.gate-copy { max-width: 46rem; }
.gate-copy .eyebrow, .hero-copy .eyebrow, .page-head .eyebrow {
  display: flex; align-items: center; gap: 10px; color: var(--lantern);
  font-weight: 650; letter-spacing: .13em;
}
.gate-copy .eyebrow::before, .hero-copy .eyebrow::before, .page-head .eyebrow::before {
  content: ""; flex: 0 0 27px; height: 2px; background: currentColor;
}
.gate-title {
  color: var(--paper); font-size: clamp(48px, 5vw, 86px); letter-spacing: -.045em;
  text-shadow: 0 2px 14px #060a0f9c;
}
.gate-title em, .hero h1 em { color: var(--lantern); }
.gate-copy .lede { color: #d3dbe4; text-wrap: pretty; text-shadow: 0 1px 5px #07101b; }
.gate-copy .perks { row-gap: 8px; color: #d4dce2; }
.gate-card {
  border-radius: 18px; border-color: #c8aa8069;
  background: linear-gradient(150deg, #1e2b37f5, #0e1620f7 68%);
  box-shadow: 0 26px 76px #0308118a, inset 0 1px #fff2;
}
.gc-inner { padding: clamp(22px, 2.4vw, 36px); }
.gc-head .eyebrow { min-height: 0; color: var(--lantern); }
.gc-head h2 { font-size: clamp(30px, 2.7vw, 40px); color: var(--paper); }
.gc-head p { min-height: 0; }
.gate-seg { background: #080f18; }
.gate-seg .seg-ind { background: linear-gradient(145deg, #30414b, #222d39); }
.fl input { border-color: #43515e; background: #0c151e; }
.gate .charge { min-height: 48px; }
.gate-foot { color: #b6c1cb; }
.gate.intro .gate-cover .gc-t, .gate.intro .gate-cover .gc-b {
  inset: 0 auto 0 0; width: 50.2%; height: 100%;
  background: linear-gradient(90deg, #060c14, #182631 98%, #ae8761 100%);
  animation: realm-door-left .82s .12s cubic-bezier(.65,.02,.22,1) both;
}
.gate.intro .gate-cover .gc-b {
  left: auto; right: 0;
  background: linear-gradient(270deg, #060c14, #182631 98%, #ae8761 100%);
  animation-name: realm-door-right;
}
.gate-cover .gc-line { display: none; }
.gate.intro .gate-card { animation: realm-card-in .74s .22s var(--ease) both; }
.gate.intro .gate-title .ln > span { animation-delay: .24s; animation-duration: .8s; }
.gate.intro .gate-title .ln + .ln > span { animation-delay: .34s; }
.gate.intro :is(.rise,.gate-top,.gate-foot) { animation-delay: .38s; animation-duration: .62s; }
.gate.intro .gate-sky::before { animation: realm-landscape 1.65s var(--ease) both; }
.gate .gform:not([hidden]) { animation: realm-form-in .25s var(--ease); }
.gate .gform.shake { animation: shake .42s; }
.slash .sh > i {
  background: linear-gradient(120deg, #0a1420bf, #0b1420aa), var(--gate-art) center / cover;
}
.slash .flash { background: linear-gradient(135deg, transparent 44%, #f1ba6d80 50%, transparent 56%); }
@keyframes realm-door-left { to { transform: translateX(-102%); } }
@keyframes realm-door-right { to { transform: translateX(102%); } }
@keyframes realm-landscape { from { transform: scale(1.06); opacity: .62; } }
@keyframes realm-card-in { from { opacity: 0; translate: 0 12px; } }
@keyframes realm-form-in { from { opacity: .55; translate: 0 4px; } }

/* The outer navigation shares one material across all player and owner pages. */
#app > .topbar { background: #0b131df5; border-bottom-color: #8299ae38; }
.brand-mark { border-radius: 7px; background: linear-gradient(145deg, var(--lantern), var(--rei)); box-shadow: inset 0 0 0 1px #ffedcf40, 0 4px 16px #0004; }
.brand-name { color: var(--paper); }
.topnav button.on, .hub-tabs button.on { box-shadow: inset 0 -2px var(--rei); }
.sidebar, .rightbar {
  background: linear-gradient(180deg, #111c27f5, #0a121cf5);
}
.sidebar > *, .rightbar > * { flex-shrink: 0; }
.nav-label, .rail-title, .rail-sec .eyebrow { color: #a5b5c3; letter-spacing: .15em; }
.sidebar .nav-item { border: 1px solid transparent; border-radius: 8px; }
.sidebar .nav-item.on {
  background: linear-gradient(90deg, rgba(var(--rei-rgb),.17), rgba(var(--rei-rgb),.035));
  border-color: rgba(var(--rei-rgb),.24);
}
.sidebar .nav-item.on::before { left: 0; top: 8px; bottom: 8px; width: 2px; }
.sidebar .nav-item .ico { width: 17px; height: 17px; }
.side-card, .mini-soul { background-color: #16212c; }
.rail-title span, .nav-item .count { font-variant-numeric: tabular-nums; }
.slot, .slot.filled { min-height: 54px; }
.btn.primary {
  color: #15100d; background: linear-gradient(135deg, var(--lantern), var(--rei));
  box-shadow: inset 0 1px #fffa, 0 6px 16px -10px rgba(var(--rei-rgb),.7);
}
.btn, .ibtn, .cmdk { border-radius: 9px; }
:is(button,a,input,select,textarea,summary):focus-visible {
  outline: 2px solid var(--lantern); outline-offset: 3px;
}
.hero {
  display: flex; align-items: end; min-height: clamp(300px, 25vw, 445px);
  border-color: #bfab8d6b; border-radius: 18px;
  background: #14202c var(--gate-art) 68% 42% / cover no-repeat;
  box-shadow: 0 14px 38px -26px #000d;
}
.hero::before {
  inset: 0; background: linear-gradient(90deg, #070f19ef 0%, #0a111dd4 32%, #0a111d38 68%, transparent),
    linear-gradient(0deg, #08111bc7, transparent 54%);
  mask-image: none; -webkit-mask-image: none;
}
.hero::after, .page-head::after {
  content: ""; position: absolute; pointer-events: none; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--rei), #dbc6a280 32%, transparent 72%);
}
.hero .hero-copy { z-index: 1; width: min(84%, 760px); padding: clamp(24px, 3.4vw, 56px); }
.hero h1 { font-size: clamp(38px, 4.35vw, 68px); color: var(--paper); text-wrap: balance; }
.hero p { color: #d9dfe4; text-shadow: 0 1px 4px #080e14; }
.hero-actions .btn:not(.primary) { border-color: #cad3d44d; color: #e8e7df; background: #111b26dc; }
.hero-art { position: absolute; inset: auto 18px 17px auto; min-height: 0; container-type: normal; }
.hero-art .orb { display: none; }
.hero-art .playing-tag {
  position: static; transform: none; max-width: 190px; overflow: hidden;
  background: #0c151eed; border-color: #c6c5b24f;
}
.stats { gap: 0; background: var(--ink-card); border: 1px solid var(--line2); border-radius: 13px; overflow: hidden; }
.stat { border: 0; border-radius: 0; background: transparent; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat > span:last-child { min-width: 0; }
.stat:hover { transform: none; background: rgba(var(--rei-rgb),.07); }
.stat .si { border-radius: 8px; }
.page-head {
  position: relative; isolation: isolate; align-items: end; flex-wrap: wrap;
  padding: clamp(20px, 2.3vw, 38px); border: 1px solid var(--line2); border-radius: 14px;
  background: linear-gradient(105deg, #15212c 28%, #182430f2 55%, #121c27b8), var(--gate-art) 55% 32% / cover;
}
.page-head > div { flex: 1 1 290px; }
.page-head h1 { color: var(--paper); font-size: clamp(32px, 3.1vw, 48px); }
.section-head h2, .hub-h2, .dialog-head h2 { color: var(--paper); }
.section-head { align-items: end; }
.section-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line2), transparent); order: 1; align-self: center; }
.section-head > :is(button,a) { order: 2; }
.hero ~ .section .grid3 { grid-template-columns: repeat(auto-fit,minmax(min(100%,250px),1fr)); }
.page { animation-name: realm-page; animation-duration: .28s; }
@keyframes realm-page { from { opacity: .82; transform: translateY(4px); } }
.pcard, .panel, .htile, .relcard, .diary-entry, .exp-memory { background-color: #121d28; border-color: var(--line); }
.pcard.active { box-shadow: inset 3px 0 rgb(var(--pc-rgb)), 0 9px 26px -22px #000; }
.pcard .meta, .stat small { color: var(--muted); }
.support-callout { margin-top: 28px; border-radius: 16px; }
.hub-tabs { gap: 6px; }
.diary-entry { border-left: 2px solid rgba(var(--rei-rgb),.46); }
.rel-grid { grid-template-columns: repeat(auto-fill,minmax(min(100%,310px),1fr)); }
.scenes { background: #101923; }
.room-head, .composer { background: #111b26f5; }
.room-head > div:first-child { min-width: 0; }
.room-head b { color: var(--paper); }
.msg:not(.me) .bubble { background-color: #18232eef; }
.msg.me .bubble { background-color: color-mix(in srgb,var(--rei) 8%,#14202b); }
.narrbox { background-color: #15212bd9; }
.composer-row { background: #0b141e; }
.composer-row:focus-within { box-shadow: 0 0 0 2px rgba(var(--rei-rgb),.18); }
.scene.on, .hub-tabs button.on { background: rgba(var(--rei-rgb),.1); }
dialog, .popover { border-color: #899aa451; background-color: #101a25; }
.dialog-head { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.dialog-actions { gap: 10px; }
.fl input:focus-visible, .composer textarea:focus-visible { outline: 0; }
@media (min-width: 1281px) {
  .shell { grid-template-columns: clamp(195px,13.3vw,240px) minmax(0,1fr) clamp(235px,15.5vw,290px); }
  body:is([data-page=rpg],[data-page=chats]) .shell { grid-template-columns: clamp(188px,12.5vw,224px) minmax(0,1fr); }
}
@media (hover: hover) and (pointer: fine) {
  .sidebar .nav-item:hover .ico { color: var(--lantern); }
  .gitem:hover img, .castcard:hover :is(img,.ck) { scale: 1.035; }
  .gitem img, .castcard :is(img,.ck) { transition: scale .25s var(--ease); }
  .relcard:hover, .diary-entry:hover { border-color: var(--line3); }
}
@media (max-width: 1080px) {
  .stats .stat:nth-child(odd) { border-left: 0; }
  .stats .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .hero-art .playing-tag { display: none; }
}
@media (max-width: 980px) {
  .gate-body { max-width: 630px; gap: 18px; padding-block: 22px 32px; }
  .gate-sky::before { inset: -1%; background-position: center, center, 72% 22%; }
  .gate-body .gate-left { text-align: left; align-items: start; width: 100%; }
  .gate-body .sigil { display: none; }
  .gate-title { font-size: clamp(34px, 5vw, 53px); margin: 12px 0; }
  .gate-copy .lede { margin: 0; }
  .gate-copy .perks { justify-content: start; margin-top: 10px; }
  .gate-card { margin: 0; justify-self: start; max-width: none; }
}
@media (max-width: 760px) {
  .gate-top { padding: 12px 16px; }
  .gate-body { padding: 10px 16px 22px; }
  .gate-copy { padding: 12px 0; }
  .gate-copy .eyebrow { letter-spacing: .08em; font-size: 9px; }
  .gate-title { font-size: clamp(33px, 8.3vw, 46px); }
  .gate-copy .perks { display: none; }
  .gate-copy .lede { font-size: 13px; line-height: 1.55; }
  .gate-foot { padding-inline: 16px; }
  .gc-inner { padding: 20px; }
  .gate-seg { margin-block: 15px; }
  .hero { min-height: 330px; background-position: 70% 22%; }
  .hero::before { background: linear-gradient(0deg,#09131bf5 0%,#09131bbb 48%,#0a131c30 90%); }
  .hero .hero-copy { width: 100%; padding: 64px 20px 22px; }
  .hero h1 { font-size: clamp(36px, 8vw, 48px); }
  .hero p { font-size: 14px; }
  .hero-actions { gap: 7px; margin-top: 16px; }
  .hero-actions .btn { min-height: 40px; padding: 8px 11px; }
  .stat { padding: 12px 10px; gap: 8px; }
  .stat strong { font-size: 18px; }
  .page-head { align-items: start; gap: 12px; }
  .page-head > div { flex: initial; }
  .bottomnav { background: #0c1520f5; }
  .bottomnav button.on { box-shadow: inset 0 2px var(--rei); background: rgba(var(--rei-rgb),.07); }
  .sidebar { background: #101b26; }
}
@media (max-width:520px) {
  #app > .topbar { padding-inline: 8px; gap: 6px; }
  .topbar .brand { gap: 6px; }
  .topbar .top-right { min-width: 0; flex: 1; justify-content: flex-end; }
  .top-right-slot { min-width: 0; gap: 5px; }
  .top-right-slot .playing { min-width: 36px; overflow: hidden; gap: 4px; }
  .playing > span:not(.av), .playing b { min-width: 0; }
  .playing b { display: block; max-width: 9ch; }
  .top-right-slot [data-action="account-language"] { padding-inline: 4px; flex: none; }
  .top-right-slot .acct-badged { padding-inline: 5px; }
}
@media (max-width:360px) {
  .topbar .brand-name { font-size: 11px; letter-spacing: .12em; }
  .top-right-slot .playing { padding-inline: 2px; }
  .top-right-slot .playing > span:not(.av), .top-right-slot .playing > .ico { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gate .gate-cover { display: none; }
  .gate-sky::before { transform: none; }
  .gitem:hover img, .castcard:hover :is(img,.ck) { scale: 1; }
}
.no-motion .gate-cover { display: none; }
.no-motion .gate-sky::before { transform: none; }
.no-motion .gitem:hover img, .no-motion .castcard:hover :is(img,.ck) { scale: 1; }
