﻿:root {
  --ink: #0e1114;
  --panel: #171d21;
  --panel-raised: #1e262b;
  --line: rgba(235, 241, 238, .13);
  --line-strong: rgba(235, 241, 238, .24);
  --paper: #eef1ed;
  --muted: #a6b0ac;
  --faint: #77827d;
  --mint: #baf4cf;
  --amber: #f1bd74;
}

html {
  font-size: 16px;
  min-height: 100%;
  background: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 6%, rgba(104, 161, 130, .14), transparent 28rem),
    radial-gradient(circle at 92% 36%, rgba(123, 91, 174, .12), transparent 28rem),
    var(--ink);
  color: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 4px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 17, 20, .86);
  backdrop-filter: blur(16px);
}

.site-nav,
.site-frame,
.site-footer {
  width: min(1180px, calc(100% - 3rem));
  margin: 0 auto;
}

.site-nav {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -.03em;
}

.brand-glyph {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(186, 244, 207, .58);
  border-radius: 9px 4px 9px 4px;
  color: var(--mint);
  font-family: Georgia, serif;
  font-size: 1.1rem;
  font-style: italic;
}

.site-links {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 1.45rem;
}

.site-link,
.account-link,
.account-button,
.account-button:hover,
.account-link:hover {
  color: var(--muted);
  font-size: .9rem;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.site-link:hover,
.site-link.active,
.account-link:hover {
  color: var(--paper);
}

.nav-divider {
  width: 1px;
  height: 22px;
  margin-left: auto;
  background: var(--line);
}

.site-links ul,
.site-links .navbar-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-links .nav-item {
  display: flex;
  align-items: center;
}

.account-button {
  display: inline-flex;
  align-items: center;
  min-height: 37px;
  padding: .4rem .8rem;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.account-button:hover {
  border-color: rgba(186, 244, 207, .6);
  background: rgba(186, 244, 207, .08);
  color: var(--mint);
}

.site-frame {
  padding: 4.8rem 0 5.2rem;
}

.library-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 3.4rem;
}

.eyebrow {
  margin: 0 0 .85rem;
  color: var(--mint);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .18em;
  line-height: 1.2;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--paper);
  font-weight: 650;
  letter-spacing: -.045em;
}

h1 {
  max-width: 700px;
  margin-bottom: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 6vw, 5rem);
  line-height: .98;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1.05;
}

h3 {
  margin-bottom: .6rem;
  font-size: 1.35rem;
  line-height: 1.08;
}

.intro-copy {
  max-width: 540px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .75rem;
  padding-bottom: .2rem;
}

.button {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  padding: .65rem 1rem;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: .92rem;
  font-weight: 700;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--mint);
  color: #102019;
}

.button-primary:hover {
  background: #d4f9df;
}

.button-quiet {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--paper);
}

.button-quiet:hover {
  border-color: rgba(186, 244, 207, .55);
  background: rgba(186, 244, 207, .07);
}

.featured-panel {
  border-top: 1px solid var(--line);
  padding-top: 1.65rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-note {
  color: var(--faint);
  font-size: .82rem;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.scenario-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(23, 29, 33, .82);
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}

.scenario-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  background: var(--panel-raised);
}

.scenario-art {
  display: flex;
  min-height: 178px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1.25rem;
  background-color: #2b3530;
  background-image:
    linear-gradient(130deg, rgba(255, 255, 255, .08), transparent 50%),
    radial-gradient(circle at 74% 25%, rgba(255, 255, 255, .24), transparent 1px),
    radial-gradient(circle at 23% 68%, rgba(255, 255, 255, .12), transparent 1px);
  background-size: auto, 20px 20px, 28px 28px;
}

.art-amber { background-color: #66503a; }
.art-cyan { background-color: #28565a; }
.art-violet { background-color: #4b3d61; }

.scenario-mark {
  color: rgba(255, 255, 255, .86);
  font-family: Georgia, serif;
  font-size: 4.3rem;
  line-height: .8;
  text-shadow: 0 8px 26px rgba(0, 0, 0, .25);
}

.scenario-format {
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: rgba(0, 0, 0, .15);
  color: rgba(255, 255, 255, .86);
  font-size: .7rem;
  letter-spacing: .05em;
  padding: .3rem .55rem;
}

.scenario-body {
  padding: 1.2rem 1.25rem 1.25rem;
}

.scenario-meta,
.scenario-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.scenario-meta {
  margin-bottom: 1.15rem;
  color: var(--mint);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.scenario-meta span:last-child {
  color: var(--faint);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.scenario-body p {
  min-height: 4.8rem;
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-size: .95rem;
}

.scenario-footer {
  border-top: 1px solid var(--line);
  padding-top: .9rem;
}

.creator {
  color: var(--faint);
  font-size: .8rem;
}

.text-link {
  color: var(--mint);
  font-size: .86rem;
  font-weight: 750;
}

.text-link span {
  display: inline-block;
  margin-left: .22rem;
  transition: transform .2s ease;
}

.text-link:hover span {
  transform: translateX(3px);
}

.creator-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 4.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2rem;
  background: linear-gradient(125deg, rgba(186, 244, 207, .08), rgba(23, 29, 33, .75) 58%);
}

.creator-copy h2 {
  max-width: 540px;
  margin-bottom: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.75rem, 3vw, 2.8rem);
}

.creator-copy p:last-child {
  max-width: 480px;
  margin-bottom: 0;
  color: var(--muted);
}

.creator-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 1rem;
}

.step {
  display: grid;
  gap: .3rem;
  border-left: 1px solid var(--line-strong);
  padding-left: 1rem;
}

.step span {
  color: var(--amber);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .1em;
}

.step strong {
  color: var(--paper);
  font-size: 1rem;
}

.step small {
  color: var(--faint);
  font-size: .8rem;
}

.library-footer {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-top: 1.5rem;
  color: var(--faint);
  font-size: .84rem;
}

.library-footer p {
  flex: 1;
  margin: 0;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(241, 189, 116, .1);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding: 1.3rem 0 2.4rem;
  color: var(--faint);
  font-size: .78rem;
}

.site-footer > div {
  display: flex;
  gap: .7rem;
}

.footer-brand {
  color: var(--muted);
  font-weight: 750;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  margin-left: auto;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: transparent;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 1px;
  margin: 5px auto;
  background: var(--paper);
}

@media (max-width: 860px) {
  .site-nav,
  .site-frame,
  .site-footer {
    width: min(100% - 2rem, 680px);
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 0;
  }

  .nav-toggle {
    display: block;
  }

  .site-links {
    width: 100%;
    flex-basis: 100%;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0 1.2rem;
  }

  .site-links:not(.show) {
    display: none;
  }

  .site-links .navbar-nav {
    flex-wrap: wrap;
  }

  .nav-divider {
    display: none;
  }

  .library-intro,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro-actions {
    justify-content: flex-start;
  }

  .scenario-grid,
  .creator-strip {
    grid-template-columns: 1fr;
  }

  .creator-steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 520px) {
  .site-frame {
    padding-top: 3.5rem;
  }

  h1 {
    font-size: 3.15rem;
  }

  .creator-strip {
    padding: 1.3rem;
  }

  .creator-steps {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .step {
    min-height: 3.5rem;
  }

  .library-footer,
  .site-footer,
  .site-footer > div {
    align-items: flex-start;
    flex-direction: column;
  }
}

.empty-library,
.studio-empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2rem;
  background: linear-gradient(120deg, rgba(186, 244, 207, .07), rgba(23, 29, 33, .74));
}

.empty-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(186, 244, 207, .35);
  border-radius: 14px 5px 14px 5px;
  color: var(--mint);
  font-family: Georgia, serif;
  font-size: 1.7rem;
}

.empty-library h3,
.studio-empty h2 {
  margin-bottom: .65rem;
}

.empty-library p:not(.eyebrow),
.studio-empty p:not(.eyebrow) {
  max-width: 620px;
  margin-bottom: 1.2rem;
  color: var(--muted);
}

.studio-page,
.scenario-page {
  max-width: 980px;
  margin: 0 auto;
}

.studio-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 3rem;
}

.compact-heading {
  margin-bottom: 2.2rem;
}

.heading-actions,
.studio-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
}

.studio-empty {
  margin-bottom: 3rem;
}

.studio-section-heading {
  margin-bottom: 1rem;
}

.studio-list {
  display: grid;
  gap: .8rem;
}

.studio-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem 1.35rem;
  background: rgba(23, 29, 33, .76);
}

.studio-item:hover {
  border-color: var(--line-strong);
}

.studio-item h2 {
  margin: 0 0 .35rem;
  font-size: 1.35rem;
}

.studio-item p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
}

.studio-item .scenario-meta {
  justify-content: flex-start;
  margin-bottom: .55rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: .25rem .55rem;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.status-published {
  border-color: rgba(186, 244, 207, .35);
  background: rgba(186, 244, 207, .09);
  color: var(--mint);
}

.status-draft {
  color: var(--muted);
}

.form-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  background: rgba(23, 29, 33, .76);
}

.form-heading {
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.35rem;
}

.studio-form {
  display: grid;
  gap: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-field {
  display: grid;
  gap: .45rem;
}

.form-field label {
  color: var(--paper);
  font-size: .86rem;
  font-weight: 700;
}

.form-field input,
.form-field textarea,
.form-field select,
.mode-form select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: none;
  background: rgba(14, 17, 20, .65);
  color: var(--paper);
  font: inherit;
  line-height: 1.5;
  padding: .75rem .85rem;
  transition: border-color .2s ease, background .2s ease;
}

.form-field select,
.mode-form select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 2.3rem;
}

.form-field textarea {
  min-height: 7rem;
  resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--faint);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus,
.mode-form select:focus {
  border-color: rgba(186, 244, 207, .7);
  background: rgba(14, 17, 20, .9);
}

.field-hint {
  margin: -.15rem 0 .1rem;
  color: var(--faint);
  font-size: .82rem;
}

.field-validation,
.validation-summary {
  color: #ffb4a8;
  font-size: .82rem;
}

.validation-summary:empty {
  display: none;
}

.validation-summary ul {
  margin: 0;
  padding-left: 1.1rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .75rem;
  border-top: 1px solid var(--line);
  padding-top: 1.35rem;
}

.button-danger-quiet {
  border-color: rgba(255, 180, 168, .34);
  color: #ffb4a8;
}

.button-danger-quiet:hover {
  border-color: rgba(255, 180, 168, .7);
  background: rgba(255, 180, 168, .08);
}

.form-footnote {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
  color: var(--faint);
  font-size: .78rem;
}

.choice-editor {
  display: grid;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.choice-editor-heading,
.choice-form-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.choice-editor-heading h3 {
  margin-bottom: 0;
  font-size: 1.15rem;
}

.choice-editor-row {
  display: grid;
  grid-template-columns: auto minmax(0, .85fr) minmax(0, 1.15fr);
  align-items: start;
  gap: .8rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 1rem;
  background: rgba(14, 17, 20, .3);
}

.choice-number {
  padding-top: .75rem;
  color: var(--amber);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
}

.notice {
  margin: -1rem 0 1.5rem;
  border: 1px solid rgba(186, 244, 207, .25);
  border-radius: 7px;
  padding: .75rem .9rem;
  background: rgba(186, 244, 207, .08);
  color: var(--mint);
  font-size: .88rem;
}

.notice-error {
  border-color: rgba(255, 180, 168, .4);
  background: rgba(255, 180, 168, .08);
  color: #ffb4a8;
}

.notice-action {
  display: inline-block;
  margin-top: .7rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: .88rem;
}

.back-link:hover {
  color: var(--paper);
}

.scenario-spotlight {
  display: grid;
  grid-template-columns: minmax(240px, .72fr) 1.28fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(23, 29, 33, .78);
}

.spotlight-art {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.7rem;
}

.spotlight-content {
  align-self: center;
  padding: 2.2rem;
}

.spotlight-content h1 {
  margin-bottom: 1.15rem;
  font-size: clamp(2.5rem, 5vw, 4.7rem);
}

.spotlight-summary {
  max-width: 590px;
  margin-bottom: 1.4rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.5rem;
}

.creator-line {
  color: var(--faint);
  font-size: .86rem;
}

.opening-panel {
  margin-top: 1.25rem;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.opening-copy {
  max-width: 760px;
  border-left: 2px solid rgba(186, 244, 207, .45);
  padding: .25rem 0 .25rem 1.2rem;
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.play-placeholder {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-top: 2rem;
  color: var(--faint);
  font-size: .84rem;
}

.play-placeholder .text-link {
  margin-left: auto;
}

.play-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.play-toolbar .back-link {
  margin-bottom: 1.5rem;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
}

.text-button:hover {
  color: var(--paper);
}

.advanced-editor {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}

.advanced-editor summary {
  color: var(--mint);
  cursor: pointer;
  font-weight: 750;
}

.advanced-editor[open] {
  display: grid;
  gap: 1rem;
}

.form-grid-checks {
  align-items: center;
}

.scenario-editor-page {
  max-width: 1280px;
}

.scenario-editor-panel-shell {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.scenario-editor-form {
  gap: 0;
}

.scenario-editor-tabs {
  display: flex;
  gap: .35rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  padding: .15rem .15rem 0;
}

.scenario-editor-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  padding: .85rem 1rem .75rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.scenario-editor-tab:hover,
.scenario-editor-tab.is-active {
  color: var(--paper);
}

.scenario-editor-tab.is-active {
  border-bottom-color: var(--mint);
}

.scenario-mode-tab {
  color: #8ec7ff;
}

.scenario-mode-tab.is-active {
  border-bottom-color: #68bceb;
  color: #e8f4ff;
}

.scenario-editor-panel {
  padding-top: 1.35rem;
}

.scenario-details-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 1rem;
  align-items: start;
}

.scenario-details-main,
.scenario-details-side {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.scenario-editor-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(1rem, 2vw, 1.35rem);
  background: rgba(14, 17, 20, .45);
}

.scenario-editor-card h2,
.lore-editor-modal-section h3 {
  margin: 0 0 .8rem;
  color: var(--paper);
  font-size: 1rem;
  letter-spacing: .07em;
}

.scenario-editor-card > p,
.scenario-editor-card .scenario-type-option small {
  color: var(--faint);
}

.scenario-editor-card > p {
  margin: -.2rem 0 1rem;
  font-size: .83rem;
  line-height: 1.55;
}

.introduction-editor {
  --introduction-accent: #9a78ff;
  margin-top: 1rem;
}

.introduction-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .15rem;
  border: 1px solid #3c4049;
  border-radius: 7px 7px 0 0;
  padding: .4rem;
  background: #17191e;
}

.introduction-tool-select {
  display: inline-flex;
  min-width: 0;
}

.introduction-tool-select select {
  min-width: 7.2rem;
  height: 2rem;
  border: 1px solid transparent;
  border-radius: 4px;
  outline: none;
  padding: .2rem .35rem;
  background: #17191e;
  color: var(--paper);
  font: inherit;
  font-size: .76rem;
}

.introduction-font-select select {
  min-width: 9.2rem;
}

.introduction-color-select select {
  min-width: 5.6rem;
}

.introduction-tool-select select:hover,
.introduction-tool-select select:focus {
  border-color: var(--introduction-accent);
}

.introduction-tool-button {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 4px;
  padding: 4px 7px;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  font: inherit;
  font-size: .9rem;
}

.introduction-tool-button:hover,
.introduction-tool-button:focus-visible,
.introduction-tool-button.is-active {
  outline: none;
  background: rgba(255, 255, 255, .08);
  color: var(--introduction-accent);
}

.introduction-toolbar-divider {
  width: 1px;
  height: 1.35rem;
  margin: 0 .2rem;
  background: #3c4049;
}

.introduction-surface {
  min-height: 330px;
  max-height: 760px;
  overflow: auto;
  border: 1px solid #3c4049;
  border-top: 0;
  border-radius: 0 0 7px 7px;
  outline: none;
  padding: 1rem;
  background: #0a0c10;
  color: var(--paper);
  font-family: "Segoe UI", "Segoe UI Emoji", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

.introduction-surface:focus {
  border-color: var(--introduction-accent);
}

.introduction-surface p,
.introduction-surface h1,
.introduction-surface h2,
.introduction-surface blockquote {
  min-height: 1.55em;
  margin: 0 0 .75rem;
}

.introduction-surface h1 {
  font-size: 30px;
  line-height: 1.2;
}

.introduction-surface h2 {
  font-size: 22px;
  line-height: 1.25;
}

.introduction-surface blockquote {
  margin-left: 28px;
  border-left: 3px solid var(--introduction-accent);
  padding-left: .8rem;
  color: var(--muted);
  font-size: 16px;
  font-style: italic;
}

.introduction-surface ul,
.introduction-surface ol {
  margin: 0 0 .75rem 1.5rem;
  padding-left: 1.2rem;
}

.introduction-surface li {
  min-height: 1.55em;
  padding-left: .15rem;
}

.introduction-surface a {
  color: #5eb7ff;
  text-decoration: underline;
}

.introduction-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 1200px;
  margin: .65rem 0;
  border: 1px solid #3c4049;
  border-radius: 5px;
  object-fit: contain;
}

.introduction-editor .character-count {
  margin-top: .35rem;
}

.scenario-type-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}

.scenario-type-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .7rem;
  align-items: center;
  min-height: 5.3rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .8rem;
  background: rgba(23, 29, 33, .6);
  cursor: pointer;
}

.scenario-type-option:hover,
.scenario-type-option.is-selected {
  border-color: rgba(186, 244, 207, .62);
  background: rgba(186, 244, 207, .08);
}

.scenario-type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.scenario-type-icon {
  display: block;
  width: 3.35rem;
  height: 3.35rem;
  flex: none;
  background-color: var(--scenario-icon-color);
  -webkit-mask-image: var(--scenario-icon-image);
  mask-image: var(--scenario-icon-image);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: background-color .15s ease, opacity .15s ease;
}

.scenario-type-icon-standard {
  --scenario-icon-color: #9a78ff;
  --scenario-icon-image: url('/images/rpg-hud/ScenarioStandard.svg');
}

.scenario-type-icon-rpg {
  --scenario-icon-color: #ff1d58;
  --scenario-icon-image: url('/images/rpg-hud/Party.svg');
}

.scenario-type-icon-visual-novel {
  --scenario-icon-color: #1dd4ff;
  --scenario-icon-image: url('/images/rpg-hud/ScenarioVisualNovel.svg');
}

.scenario-type-option.is-selected .scenario-type-icon {
  background-color: #111111;
}

.scenario-type-option strong,
.scenario-type-option small {
  display: block;
}

.scenario-type-option strong {
  margin-bottom: .2rem;
  color: var(--paper);
  font-size: .92rem;
}

.scenario-type-option small {
  font-size: .72rem;
  line-height: 1.4;
}

.scenario-overview-grid {
  align-items: start;
}

.story-tags-control {
  position: relative;
}

.story-tags-holder {
  display: flex;
  min-height: 2.55rem;
  align-items: flex-start;
  gap: .35rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: .35rem;
  background: rgba(12, 13, 15, .85);
}

.story-tags-selected {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
}

.story-tags-open,
.story-tags-plus {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  text-align: left;
}

.story-tags-open {
  flex: 1;
  padding: .35rem .45rem;
}

.story-tags-open:hover,
.story-tags-plus:hover {
  color: var(--paper);
}

.story-tags-plus {
  padding: .2rem .35rem;
  color: var(--mint);
  font-size: 1.2rem;
  line-height: 1.1;
}

.story-tag-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: .3rem;
  border: 1px solid rgba(186, 244, 207, .2);
  border-radius: 5px;
  padding: .25rem .35rem .25rem .5rem;
  background: rgba(186, 244, 207, .1);
  color: var(--paper);
  font-size: .73rem;
  line-height: 1.1;
}

.story-tag-chip-remove {
  border: 0;
  padding: 0 .1rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: .95rem;
  line-height: 1;
}

.story-tag-chip-remove:hover {
  color: var(--paper);
}

.story-tags-picker {
  position: absolute;
  z-index: 30;
  top: calc(100% + .35rem);
  left: 0;
  width: min(660px, 100%);
  max-height: 510px;
  overflow: auto;
  border: 1px solid #666973;
  border-radius: 8px;
  padding: .9rem;
  background: #191a1f;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
}

.story-tags-picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .65rem;
  color: #cbcdd4;
  font-size: .75rem;
}

.story-tags-search {
  width: 100%;
  margin-bottom: .85rem;
}

.story-tags-categories {
  display: grid;
  gap: 1rem;
}

.story-tag-category h3 {
  margin: 0 0 .55rem;
  color: var(--paper);
  font-size: .84rem;
}

.story-tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.story-tag-option {
  border: 1px solid #41434b;
  border-radius: 5px;
  padding: .34rem .5rem;
  background: #27282d;
  color: var(--paper);
  cursor: pointer;
  font: inherit;
  font-size: .72rem;
}

.story-tag-option:hover,
.story-tag-option.is-selected {
  border-color: #b69af9;
  background: #42305f;
}

.story-tag-option:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.story-tags-empty {
  margin: .55rem 0 0;
  color: var(--faint);
  font-size: .78rem;
}

.mode-editor-stack {
  display: grid;
  gap: 1rem;
}

.mode-editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.mode-editor-heading h2 {
  margin-bottom: .35rem;
}

.mode-editor-heading p,
.mode-editor-card > p {
  margin: 0;
}

.mode-editor-badge {
  border: 1px solid rgba(242, 195, 76, .45);
  border-radius: 999px;
  padding: .35rem .6rem;
  color: #f2c34c;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .1em;
}

.rpg-editor-panel {
  --rpg-blue: #68bceb;
}

.rpg-editor-panel .scenario-editor-card {
  border-color: #3d5261;
}

.rpg-world-actions {
  display: grid;
  grid-template-columns: 130px minmax(180px, 1fr) auto;
  gap: .85rem;
  align-items: end;
  margin-top: 1.15rem;
}

.rpg-world-actions .form-field {
  margin: 0;
}

.rpg-world-name-field {
  max-width: 380px;
}

.rpg-editor-status {
  margin: .5rem 0 0;
  color: #8fd8c0;
  font-size: .78rem;
  line-height: 1.45;
}

.rpg-world-card {
  margin-top: 1rem;
}

.rpg-world-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.rpg-world-heading h2 {
  margin-bottom: .25rem;
  color: #f2c34c;
  font-size: 1.35rem;
}

.rpg-world-heading p {
  margin: 0;
  color: #b8c1cb;
  font-size: .78rem;
}

.rpg-seed {
  color: #929aa8;
  font-size: .75rem;
}

.rpg-map-surface {
  position: relative;
  min-height: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #526371;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 35% 25%, rgba(104, 188, 235, .2), transparent 30%),
    linear-gradient(145deg, #071019, #12252e 50%, #0b1118);
}

.rpg-map-surface::before,
.rpg-map-surface::after {
  display: none;
}

.rpg-map-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.rpg-map-coastline {
  fill: none;
  stroke: rgba(205, 227, 221, .42);
  stroke-width: 7;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.rpg-map-region {
  cursor: pointer;
  outline: none;
}

.rpg-map-region polygon {
  stroke: rgba(12, 18, 23, .92);
  stroke-width: 2.4;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: filter .15s ease, stroke .15s ease, stroke-width .15s ease;
}

.rpg-map-region:hover polygon,
.rpg-map-region:focus polygon {
  filter: brightness(1.16) saturate(1.08);
  stroke: #f2c34c;
  stroke-width: 4;
}

.rpg-map-region-label {
  fill: #f5f0d5;
  font-size: 23px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(10, 15, 18, .9);
  stroke-width: 7px;
  stroke-linejoin: round;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.rpg-map-region-marker {
  position: absolute;
  z-index: 1;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid #f2c34c;
  border-radius: 50%;
  background: #243b4a;
  box-shadow: 0 0 0 5px rgba(104, 188, 235, .12), 0 8px 16px rgba(0, 0, 0, .4);
  color: #fff3c1;
  cursor: pointer;
  font-weight: 800;
}

.rpg-map-region-marker:hover,
.rpg-map-region-marker:focus-visible {
  background: #3c6280;
  outline: 2px solid #8fd8c0;
  outline-offset: 2px;
}

.rpg-map-legend {
  position: absolute;
  right: .85rem;
  bottom: .75rem;
  left: .85rem;
  color: rgba(232, 244, 255, .68);
  font-size: .72rem;
  text-align: center;
}

.rpg-region-directory {
  display: grid;
  align-content: start;
  min-width: 0;
  border: 1px solid #3e4b56;
  border-radius: 9px;
  padding: .75rem;
  background: #0c1015;
}

.rpg-region-directory-heading {
  display: grid;
  gap: .2rem;
  margin: .1rem .25rem .65rem;
}

.rpg-region-directory-heading strong {
  color: #f2c34c;
  font-size: .75rem;
}

.rpg-region-directory-heading span {
  color: #919ba8;
  font-size: .7rem;
}

.rpg-region-list {
  display: grid;
  gap: .45rem;
  max-height: 405px;
  overflow: auto;
}

.rpg-region-directory-item {
  display: grid;
  gap: .2rem;
  width: 100%;
  border: 1px solid #354451;
  border-radius: 7px;
  padding: .65rem;
  background: #121820;
  color: var(--paper);
  cursor: pointer;
  text-align: left;
}

.rpg-region-directory-item:hover,
.rpg-region-directory-item:focus-visible {
  border-color: #68bceb;
  background: #17222c;
  outline: none;
}

.rpg-region-directory-item strong {
  overflow: hidden;
  color: #e4e8ed;
  font-size: .84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-region-directory-item span {
  overflow: hidden;
  color: #718596;
  font-size: .68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpg-dungeon-card {
  margin-top: 1rem;
}

.rpg-dungeon-grid {
  display: grid;
  grid-template-columns: 2.2fr 1.1fr 1fr 1fr 1.15fr;
  gap: .75rem;
  align-items: end;
  margin-top: 1rem;
}

.rpg-dungeon-grid .form-field {
  margin: 0;
}

.rpg-dungeon-size-inputs {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.rpg-dungeon-size-inputs input {
  min-width: 0;
}

.rpg-dungeon-size-inputs span {
  color: #8d98a4;
}

.rpg-dungeon-tuning-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}

.rpg-dungeon-buttons {
  display: flex;
  gap: .5rem;
  align-items: end;
}

.rpg-region-meta-grid {
  grid-template-columns: minmax(0, 1fr) 120px;
}

.rpg-subsection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .75rem;
}

.rpg-subsection-heading h3 {
  margin-bottom: 0;
}

.rpg-explorable-list {
  display: grid;
  gap: .7rem;
}

.rpg-explorable-row {
  display: grid;
  gap: .5rem;
  border: 1px solid #354451;
  border-radius: 8px;
  padding: .8rem;
  background: #0d1319;
}

.rpg-explorable-row-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.rpg-explorable-row-heading strong {
  color: #dce5ee;
  font-size: .8rem;
}

.rpg-empty-note {
  margin: .7rem 0 0;
  color: #8293a1;
  font-size: .76rem;
}

.rpg-lore-links {
  display: grid;
  gap: .5rem;
}

.rpg-lore-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 1fr);
  gap: .7rem;
  align-items: center;
  color: #c5ced7;
  font-size: .78rem;
}

.rpg-designer-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 1rem;
  margin-top: 1rem;
}

.rpg-map-placeholder {
  display: grid;
  min-height: 330px;
  place-items: center;
  align-content: center;
  gap: .45rem;
  border: 1px solid #526371;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 30%, rgba(104, 188, 235, .15), transparent 32%),
    linear-gradient(145deg, #050607, #101b24);
  color: #c4cad3;
  text-align: center;
}

.rpg-map-placeholder strong {
  color: var(--paper);
  font-size: 1.1rem;
}

.rpg-map-placeholder > span:last-child {
  max-width: 360px;
  color: var(--faint);
  font-size: .78rem;
  line-height: 1.5;
}

.rpg-map-glyph {
  display: grid;
  width: 3.2rem;
  height: 3.2rem;
  place-items: center;
  border: 1px solid rgba(104, 188, 235, .6);
  border-radius: 50%;
  color: #68bceb;
  font-size: 1.5rem;
}

.rpg-designer-summary {
  display: grid;
  align-content: start;
  gap: .55rem;
}

.rpg-designer-summary div {
  display: grid;
  gap: .25rem;
  border: 1px solid #36434e;
  border-radius: 7px;
  padding: .75rem;
  background: #0d1117;
}

.rpg-designer-summary span {
  color: #aeb5c1;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.rpg-designer-summary strong {
  color: var(--paper);
  font-size: .82rem;
}

.mode-editor-note {
  display: grid;
  gap: .35rem;
  margin-top: 1rem;
  border: 1px solid #36434e;
  border-radius: 7px;
  padding: .85rem;
  background: #0d1218;
  color: #9eaab5;
  font-size: .8rem;
  line-height: 1.5;
}

.mode-editor-note strong {
  color: #f2c34c;
}

.visual-novel-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 1rem;
  align-items: start;
}

.visual-novel-stage-card {
  min-width: 0;
  border: 1px solid #2b3a53;
  border-radius: 10px;
  padding: .75rem;
  background: #090a0d;
}

.visual-novel-stage {
  position: relative;
  min-height: 580px;
  overflow: hidden;
  border: 1px solid #1f2a3b;
  border-radius: 8px;
  background:
    radial-gradient(circle at 40% 22%, rgba(122, 154, 198, .16), transparent 28%),
    linear-gradient(160deg, #172133, #090d14 72%);
}

.visual-novel-stage-background {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: .8;
}

.visual-novel-stage-background.has-image {
  opacity: 1;
}

.visual-novel-stage-character {
  position: absolute;
  bottom: 12%;
  left: 50%;
  width: 30%;
  height: 62%;
  transform: translateX(-50%);
  border: 1px solid rgba(224, 190, 255, .75);
  border-radius: 48% 48% 12% 12%;
  background:
    radial-gradient(ellipse at 50% 20%, #d8b5ff 0 9%, transparent 9.5%),
    linear-gradient(90deg, rgba(73, 50, 104, .95), rgba(204, 133, 255, .72), rgba(73, 50, 104, .95));
  box-shadow: 0 0 36px rgba(160, 102, 220, .22);
}

.visual-novel-stage[data-layout="pair-close"] .visual-novel-stage-character,
.visual-novel-stage[data-layout="pair-wide"] .visual-novel-stage-character {
  left: 32%;
  width: 26%;
}

.visual-novel-stage[data-layout="pair-close"] .visual-novel-stage-character::after,
.visual-novel-stage[data-layout="pair-wide"] .visual-novel-stage-character::after {
  position: absolute;
  right: -135%;
  bottom: 0;
  width: 100%;
  height: 100%;
  border: inherit;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(42, 80, 110, .95), rgba(115, 183, 235, .72), rgba(42, 80, 110, .95));
  content: "";
}

.visual-novel-stage[data-layout="trio"] .visual-novel-stage-character,
.visual-novel-stage[data-layout="one-front-two-back"] .visual-novel-stage-character {
  left: 50%;
  width: 23%;
}

.visual-novel-stage[data-layout="trio"] .visual-novel-stage-character::before,
.visual-novel-stage[data-layout="one-front-two-back"] .visual-novel-stage-character::before,
.visual-novel-stage[data-layout="one-front-two-back"] .visual-novel-stage-character::after {
  position: absolute;
  bottom: 0;
  width: 82%;
  height: 85%;
  border: inherit;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(42, 80, 110, .8), rgba(115, 183, 235, .6), rgba(42, 80, 110, .8));
  content: "";
}

.visual-novel-stage[data-layout="trio"] .visual-novel-stage-character::before,
.visual-novel-stage[data-layout="one-front-two-back"] .visual-novel-stage-character::before {
  left: -125%;
}

.visual-novel-stage[data-layout="one-front-two-back"] .visual-novel-stage-character::after {
  right: -125%;
}

.visual-novel-dialogue {
  position: absolute;
  z-index: 2;
  right: 4%;
  bottom: 23%;
  width: 52%;
  min-height: 9rem;
  border: 2px solid rgba(228, 232, 242, .65);
  border-radius: 12px;
  padding: 1.2rem;
  background: rgba(20, 23, 29, .84);
}

.visual-novel-dialogue strong {
  color: #d887ff;
  font-size: 1.15rem;
}

.visual-novel-dialogue p {
  margin: .55rem 0 0;
  color: var(--paper);
  font-size: .93rem;
  line-height: 1.5;
}

.visual-novel-composer {
  position: absolute;
  z-index: 3;
  right: 8%;
  bottom: 2rem;
  left: 8%;
  border-radius: 999px;
  padding: .95rem 1.35rem;
  background: #3a3a39;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .72);
  color: #8d949f;
  font-size: .9rem;
}

.visual-novel-controls {
  display: grid;
  gap: .85rem;
  border-color: #2b3a53;
  background: linear-gradient(180deg, #182233, #0d1420);
}

.visual-novel-controls h2 {
  color: #e8edf5;
}

.visual-novel-controls .field-hint,
.visual-novel-controls p {
  color: #aeb9ca;
}

.visual-novel-controls select,
.visual-novel-controls input,
.visual-novel-controls textarea {
  border-color: #2b3a53;
  background: #111824;
  color: #e8edf5;
}

.visual-novel-controls select:focus,
.visual-novel-controls input:focus,
.visual-novel-controls textarea:focus {
  border-color: #347fd6;
}

.scenario-nsfw-field {
  margin-top: .8rem;
}

.scenario-nsfw-hint {
  margin: .15rem 0 0 1.55rem;
}

.media-editor-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

#media-heading {
  margin-bottom: 32px;
}

.saga-shell .scenario-editor-card[aria-labelledby="media-heading"] {
  border-color: #777a80;
  background: #1e1f23;
  padding: 22px 18px;
}

.saga-shell #media-heading {
  color: #fff;
}

.media-editor-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
}

.media-field-label {
  margin: 0;
  color: var(--paper);
  font-size: .82rem;
  font-weight: 700;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.media-action-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #e3e5ec;
  border-radius: 7px;
  padding: .55rem .85rem;
  background: #08090c;
  color: var(--paper);
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.1;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.media-action-button:hover {
  transform: translateY(-1px);
  background: #16191f;
}

.media-clear-button {
  border-color: #9a78ff;
}

.media-action-button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.media-clear-button svg {
  color: #9a78ff;
}

.media-file-input,
.media-clear-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
}

.media-editor-card > label:not(.media-clear) {
  color: var(--paper);
  font-size: .82rem;
  font-weight: 700;
}

.media-editor-card input[type="file"] {
  width: 100%;
  min-width: 0;
  color: var(--muted);
  font: inherit;
  font-size: .75rem;
}

.media-preview {
  display: grid;
  width: 100%;
  height: 300px;
  min-height: 300px;
  place-items: center;
  overflow: hidden;
  margin: 6px 0 7px;
  border: 1px solid #444852;
  border-radius: 9px;
  padding: 0;
  background: #0b0c0f;
  color: transparent;
  font-size: 0;
  text-align: center;
}

.media-preview-cover {
  width: 200px;
}

.media-preview-background {
  width: 100%;
}

.media-preview-avatar {
  width: 300px;
}

.media-preview.has-image {
  background-position: center;
  background-size: cover;
  color: transparent;
}

.media-preview:not(.has-image) {
  background-image: none !important;
}

.media-preview + .media-actions {
  min-height: 40px;
}

.media-clear {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: var(--faint);
  font-size: .75rem;
}

.media-clear input {
  accent-color: var(--mint);
}

/* Keep the three Odeyu media proportions when the details column is narrower. */
@media (max-width: 1250px) and (min-width: 701px) {
  .media-editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-editor-card-cover,
  .media-editor-card-background {
    min-width: 0;
  }

  .media-editor-card-avatar {
    grid-column: 1 / -1;
    width: 300px;
    max-width: 100%;
    justify-self: center;
  }

  .media-preview-cover,
  .media-preview-avatar {
    max-width: 100%;
  }
}

@media (max-width: 700px) {
  .media-preview-cover,
  .media-preview-avatar {
    max-width: 100%;
  }

  .player-preview-cover {
    max-width: 100%;
  }
}

.form-field {
  min-width: 0;
}

.character-count {
  display: block;
  margin-top: .2rem;
  color: var(--faint);
  font-size: .7rem;
  text-align: right;
}

.scenario-details-side {
  position: sticky;
  top: 1rem;
}

.player-preview-card {
  background: #000;
}

.saga-shell .scenario-editor-card.player-preview-card {
  border-color: transparent;
  background: #000;
}

.saga-shell .player-preview-card h2 {
  color: #fff;
}

.player-preview-phone {
  width: min(288px, 100%);
  min-height: 590px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #9598a1;
  border-radius: 12px;
  padding: 14px;
  background: #000;
}

.player-preview-header {
  display: grid;
  min-height: 72px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.player-preview-cover {
  display: grid;
  width: 250px;
  height: 378px;
  min-height: 0;
  place-items: start end;
  margin: 0 auto 12px;
  overflow: hidden;
  border: 1px solid #111;
  border-radius: 9px;
  background: #111319;
  background-position: center;
  background-size: cover;
}

.preview-nsfw {
  margin: 7px;
  border: 1px solid rgba(255, 180, 168, .65);
  border-radius: 999px;
  padding: .25rem .45rem;
  color: #ffb4a8;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.player-preview-title {
  margin: 0 12px 0 0;
  color: #fff;
  font-family: Questrian, Georgia, "Times New Roman", serif;
  font-size: 1.375rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.player-preview-meta {
  display: flex;
  min-height: 22px;
  align-items: center;
  justify-content: flex-end;
  margin: 0 2px;
}

.player-preview-views {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9a78ff;
  font-size: .72rem;
  font-weight: 700;
}

.player-preview-views svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.player-preview-description {
  margin: 12px 0 8px;
  color: #b4b6bd;
  font-size: .76rem;
  line-height: 1.5;
}

.player-preview-creator {
  margin: 2px 2px 2px 12px;
  color: #9a78ff;
  font-size: .875rem;
  text-align: right;
}

.readiness-heading-row,
.lore-cards-heading,
.lore-editor-modal-header,
.lore-editor-modal-actions {
  display: flex;
  align-items: center;
  gap: .8rem;
}

.readiness-heading-row {
  justify-content: space-between;
}

.readiness-heading-row h2 {
  margin-bottom: 0;
}

.readiness-heading-row > span {
  color: var(--mint);
  font-size: .8rem;
  font-weight: 800;
}

.readiness-item {
  display: flex;
  gap: .6rem;
  align-items: center;
  margin-top: .7rem;
  color: var(--muted);
  font-size: .82rem;
}

.readiness-item > span:first-child {
  color: #555a64;
  font-size: 1rem;
}

.readiness-item.is-complete > span:first-child {
  color: #4bd887;
}

.readiness-message {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: .7rem;
  color: var(--faint);
  font-size: .75rem;
  line-height: 1.45;
}

.scenario-visibility-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-color: rgba(154, 120, 255, .38);
  background: rgba(28, 19, 43, .74);
}

.scenario-visibility-copy {
  min-width: 0;
}

.scenario-visibility-copy h2 {
  margin: 0 0 .45rem;
}

.scenario-visibility-copy p {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
}

.scenario-visibility-toggle {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  flex: 0 0 auto;
  color: var(--paper);
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
}

.scenario-visibility-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.scenario-visibility-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex: 0 0 48px;
  border: 1px solid #686d79;
  border-radius: 99px;
  background: #363b45;
  transition: background .15s, border-color .15s;
}

.scenario-visibility-switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f7f5ff;
  box-shadow: 0 1px 4px #0008;
  transition: transform .15s;
}

.scenario-visibility-toggle input:checked + .scenario-visibility-switch {
  border-color: var(--mint);
  background: var(--mint);
}

.scenario-visibility-toggle input:checked + .scenario-visibility-switch::before {
  transform: translateX(22px);
}

.scenario-visibility-toggle input:focus-visible + .scenario-visibility-switch {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .scenario-visibility-card {
    align-items: flex-start;
    flex-direction: column;
  }
}

.lore-cards-heading {
  justify-content: space-between;
  margin-bottom: 1rem;
}

.lore-cards-heading h2 {
  margin: 0;
}

.lore-card-list {
  display: grid;
  gap: .7rem;
}

.lore-card-empty {
  margin: 0;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 1.2rem;
  color: var(--faint);
  font-size: .82rem;
  text-align: center;
}

.lore-card-summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(23, 29, 33, .6);
}

.lore-card-summary h3 {
  margin: 0 0 .25rem;
  color: var(--paper);
  font-size: 1rem;
}

.lore-card-summary p {
  max-width: 680px;
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}

.lore-card-summary .lore-card-type {
  color: var(--mint);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.lore-card-summary-actions {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lore-card-badges {
  color: var(--faint);
  font-size: .7rem;
  white-space: nowrap;
}

.lore-editor-modal {
  width: min(100% - 2rem, 1040px);
  max-height: calc(100vh - 2rem);
  margin: auto;
  overflow: auto;
  border: 1px solid #737782;
  border-radius: 10px;
  padding: 0;
  background: #15171c;
  color: var(--paper);
}

.lore-editor-modal::backdrop {
  background: rgba(0, 0, 0, .72);
}

.lore-editor-modal-content {
  padding: 1.25rem;
}

.lore-editor-modal-header {
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.lore-editor-modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: .08em;
}

.lore-editor-modal-header p {
  margin: .3rem 0 0;
  color: var(--faint);
  font-size: .75rem;
}

.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
}

.modal-close:hover {
  color: var(--paper);
}

.lore-editor-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}

.lore-editor-modal-section {
  border: 1px solid #3f434d;
  border-radius: 9px;
  padding: 1rem;
  background: #111319;
}

.lore-editor-modal-section h3 {
  color: #f2c34c;
}

.lore-activation-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .85rem;
}

.lore-activation-group legend {
  padding: 0 .35rem;
  color: var(--paper);
  font-size: .82rem;
  font-weight: 700;
}

.lore-switches {
  margin-top: .8rem;
}

.lore-media-group {
  display: grid;
  gap: .65rem;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .85rem;
}

.lore-media-group legend {
  padding: 0 .35rem;
  color: var(--paper);
  font-size: .82rem;
  font-weight: 700;
}

.lore-media-group .field-hint {
  margin: 0;
}

.lore-asset-list {
  display: grid;
  gap: .7rem;
}

.lore-asset-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: .75rem;
  border: 1px solid #414754;
  border-radius: 8px;
  padding: .65rem;
  background: #20242d;
}

.lore-asset-preview {
  min-height: 92px;
  border: 1px solid #3a3d46;
  border-radius: 7px;
  background: #111319;
  background-position: center;
  background-size: cover;
  color: #8f949e;
  font-size: .7rem;
  text-align: center;
}

.lore-asset-preview:not(.has-image) {
  display: grid;
  place-items: center;
}

.lore-asset-fields {
  display: grid;
  gap: .5rem;
  min-width: 0;
}

.lore-asset-fields label {
  display: grid;
  gap: .25rem;
  color: #b7bbc6;
  font-size: .72rem;
}

.lore-asset-fields input[type="file"] {
  padding: .35rem;
  font-size: .72rem;
}

.lore-asset-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}

.rpg-region-editor-modal {
  max-width: 900px;
}

.lore-editor-modal-actions {
  justify-content: flex-end;
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.lore-editor-modal-actions > span {
  flex: 1;
}

.check-field {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 2.4rem;
  color: var(--muted);
  font-size: .88rem;
}

.check-field input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--mint);
}

.play-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.play-header-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .55rem;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(241, 189, 116, .34);
  border-radius: 999px;
  padding: .25rem .55rem;
  color: var(--amber);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 285px);
  align-items: start;
  gap: 1rem;
}

.beginning-picker {
  max-width: 820px;
  margin: 0 auto;
}

.beginning-picker h2 {
  margin-bottom: .7rem;
}

.beginning-picker .intro-copy {
  margin-bottom: 1.5rem;
}

.beginning-form {
  display: grid;
  gap: 1.25rem;
}

.beginning-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.beginning-card {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 1rem;
  background: rgba(14, 17, 20, .4);
  cursor: pointer;
}

.beginning-card:has(input:checked) {
  border-color: rgba(186, 244, 207, .65);
  background: rgba(186, 244, 207, .08);
}

.beginning-card input {
  margin-top: .25rem;
  accent-color: var(--mint);
}

.beginning-card span {
  display: grid;
  gap: .35rem;
}

.beginning-card strong {
  color: var(--paper);
}

.beginning-card small {
  color: var(--muted);
  white-space: pre-wrap;
}

.play-sidebar {
  display: grid;
  gap: 1rem;
}

.state-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  background: rgba(23, 29, 33, .78);
}

.state-card .eyebrow {
  margin-bottom: .55rem;
}

.state-card strong {
  color: var(--paper);
  font-family: Georgia, serif;
  font-size: 1.25rem;
}

.state-card h2 {
  margin-bottom: .3rem;
  font-size: 1.35rem;
}

.state-card h3 {
  margin-top: 1.1rem;
  font-size: .9rem;
  letter-spacing: .02em;
}

.state-muted,
.turn-clock {
  color: var(--faint);
  font-size: .78rem;
}

.state-list {
  display: grid;
  gap: .45rem;
  margin: 0;
}

.state-list div,
.combatant-row,
.state-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  color: var(--muted);
  font-size: .8rem;
}

.state-list dt {
  color: var(--faint);
}

.state-list dd {
  margin: 0;
  color: var(--paper);
  text-align: right;
}

.state-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: .78rem;
}

.state-line {
  border-top: 1px solid rgba(235, 241, 238, .08);
  padding-top: .35rem;
}

.state-line span {
  color: var(--faint);
  font-size: .72rem;
}

.state-details {
  border-top: 1px solid rgba(235, 241, 238, .08);
  padding-top: .55rem;
}

.state-details + .state-details {
  margin-top: .75rem;
}

.state-details summary {
  color: var(--amber);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 750;
}

.continuity-item {
  display: grid;
  gap: .2rem;
  margin-top: .65rem;
  border-left: 2px solid rgba(186, 244, 207, .28);
  padding-left: .6rem;
}

.continuity-item strong {
  font-family: inherit;
  font-size: .78rem;
}

.continuity-item span {
  color: var(--faint);
  font-size: .75rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.play-card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  border-bottom: 1px solid var(--line);
  padding: .75rem 1.25rem;
}

.mode-form,
.play-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
}

.mode-form label {
  color: var(--faint);
  font-size: .75rem;
}

.mode-form select {
  min-width: 150px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background-color: rgba(14, 17, 20, .65);
  color: var(--paper);
  font: inherit;
  font-size: .78rem;
  padding: .35rem 1.8rem .35rem .5rem;
}

.multi-character-thread {
  display: grid;
  gap: .75rem;
}

.multi-character-block {
  border-left: 2px solid rgba(241, 189, 116, .4);
  padding-left: .9rem;
}

.block-character {
  border-left-color: rgba(186, 244, 207, .45);
}

.block-label,
.phone-event-heading {
  display: block;
  margin-bottom: .25rem;
  color: var(--amber);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.block-action {
  margin-bottom: .25rem;
  color: var(--muted);
  font-size: .9rem;
  font-style: italic;
  white-space: pre-wrap;
}

.phone-event {
  max-width: 420px;
  margin: 1rem 0;
  border: 1px solid rgba(29, 212, 255, .22);
  border-radius: 12px;
  padding: .8rem;
  background: rgba(29, 212, 255, .05);
}

.phone-event-heading {
  color: #8deaff;
}

.phone-bubble {
  width: fit-content;
  max-width: 86%;
  margin-top: .4rem;
  border-radius: 12px;
  padding: .45rem .65rem;
  font-size: .86rem;
  white-space: pre-wrap;
}

.phone-character {
  background: rgba(255, 255, 255, .1);
}

.phone-user {
  margin-left: auto;
  background: rgba(186, 244, 207, .18);
}

.action-log {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: .75rem;
  color: var(--muted);
  font-size: .82rem;
}

.action-log summary {
  color: var(--amber);
  cursor: pointer;
  font-weight: 750;
}

.action-log-entry {
  display: flex;
  gap: .45rem;
  padding-top: .45rem;
  white-space: pre-wrap;
}

.dice-mark {
  color: var(--mint);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.turn-clock {
  margin-top: .8rem;
}

.variant-picker {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: .75rem;
  color: var(--muted);
  font-size: .82rem;
}

.variant-picker summary {
  color: var(--amber);
  cursor: pointer;
  font-weight: 750;
}

.variant-list {
  display: grid;
  gap: .65rem;
  margin-top: .7rem;
}

.variant-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .8rem;
  border: 1px solid rgba(235, 241, 238, .1);
  border-radius: 8px;
  padding: .65rem .75rem;
  background: rgba(14, 17, 20, .28);
}

.variant-current {
  border-color: rgba(186, 244, 207, .34);
  background: rgba(186, 244, 207, .06);
}

.variant-row strong {
  color: var(--paper);
  font-size: .78rem;
}

.variant-row p {
  margin: .35rem 0 0;
  color: var(--faint);
  white-space: pre-wrap;
}

.play-header h1 {
  margin-bottom: .8rem;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
}

.play-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(23, 29, 33, .78);
}

.play-thread {
  display: grid;
  gap: 1rem;
  padding: clamp(1.15rem, 4vw, 2rem);
}

.play-turn {
  max-width: 780px;
}

.turn-player {
  justify-self: end;
  width: min(88%, 650px);
  border: 1px solid rgba(186, 244, 207, .18);
  border-radius: 12px 12px 3px 12px;
  padding: 1rem 1.1rem;
  background: rgba(186, 244, 207, .08);
}

.turn-narration {
  width: min(92%, 740px);
  border-left: 2px solid rgba(186, 244, 207, .42);
  padding: .25rem 0 .25rem 1.1rem;
}

.play-speaker {
  margin-bottom: .35rem;
  color: var(--mint);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.play-content {
  color: var(--paper);
  font-size: 1rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.play-header-text {
  margin-bottom: .7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .5rem .65rem;
  background: rgba(186, 244, 207, .05);
  color: var(--muted);
  font-size: .8rem;
  white-space: pre-wrap;
}

.turn-narration .play-content {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

.play-input-form {
  border-top: 1px solid var(--line);
  padding: clamp(1.15rem, 4vw, 2rem);
}

.play-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .8rem;
}

.play-input-footer .field-hint {
  margin: 0;
}

.request-status {
  margin: .7rem 0 0;
  color: var(--mint);
  font-size: .82rem;
}

button:disabled {
  cursor: wait;
  opacity: .62;
}

.continuity-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 1rem;
}

.continuity-card-list {
  display: grid;
  gap: .75rem;
}

.continuity-card {
  border: 1px solid rgba(235, 241, 238, .1);
  border-radius: 9px;
  padding: .9rem;
  background: rgba(14, 17, 20, .28);
}

.continuity-card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: .75rem;
}

.continuity-card h3 {
  margin: .2rem 0 0;
  font-size: 1.05rem;
}

.continuity-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .65rem;
}

.continuity-summary,
.continuity-body {
  margin: .7rem 0 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.continuity-body {
  color: var(--paper);
}

.continuity-form {
  display: grid;
  gap: .8rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}

.continuity-form h3 {
  margin: 0;
  font-size: 1rem;
}

.empty-copy {
  color: var(--faint);
}

.status-complete {
  border-color: rgba(241, 189, 116, .4);
  background: rgba(241, 189, 116, .1);
  color: var(--amber);
}

.choice-form,
.play-complete,
.play-empty {
  border-top: 1px solid var(--line);
  padding: clamp(1.15rem, 4vw, 2rem);
}

.choice-form {
  display: grid;
  gap: 1.25rem;
}

.choice-form-heading h2 {
  font-size: clamp(1.5rem, 3vw, 2.15rem);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}

.choice-card {
  position: relative;
  display: grid;
  min-height: 150px;
  align-content: space-between;
  gap: .9rem;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 1rem;
  background: rgba(14, 17, 20, .45);
  color: var(--paper);
  cursor: pointer;
  text-align: left;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.choice-card:hover {
  transform: translateY(-3px);
  border-color: rgba(186, 244, 207, .6);
  background: rgba(186, 244, 207, .08);
}

.choice-card-number {
  color: var(--amber);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
}

.choice-card-label {
  font-size: .98rem;
  font-weight: 700;
  line-height: 1.35;
}

.choice-card-arrow {
  justify-self: end;
  color: var(--mint);
  font-size: 1.25rem;
  transition: transform .2s ease;
}

.choice-card:hover .choice-card-arrow {
  transform: translateX(4px);
}

.play-complete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(241, 189, 116, .06);
}

.play-complete h2 {
  margin-bottom: .35rem;
  font-size: 1.45rem;
}

.play-complete p:last-child,
.play-empty p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.play-empty {
  color: var(--muted);
}

.settings-page {
  max-width: 1080px;
  margin: 0 auto;
}

.settings-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.settings-card,
.settings-profile {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(23, 29, 33, .76);
  padding: 1.35rem;
}

.settings-card-featured {
  border-color: rgba(186, 244, 207, .32);
  background: linear-gradient(135deg, rgba(186, 244, 207, .11), rgba(23, 29, 33, .8) 55%);
}

.settings-card h2 {
  margin-bottom: .5rem;
  font-size: 1.65rem;
}

.settings-status {
  margin-bottom: 1.2rem;
  font-size: .9rem;
  font-weight: 700;
}

.settings-good {
  color: var(--mint);
}

.settings-warning {
  color: var(--amber);
}

.settings-facts {
  display: grid;
  gap: .62rem;
  margin: 0;
}

.settings-facts div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: .55rem;
}

.settings-facts dt {
  color: var(--muted);
  font-size: .78rem;
}

.settings-facts dd {
  max-width: 70%;
  margin: 0;
  color: var(--paper);
  font-size: .82rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.settings-model-id {
  margin-bottom: 1rem;
  color: var(--mint);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .78rem;
  overflow-wrap: anywhere;
}

.settings-section {
  margin-bottom: 3rem;
}

.settings-profile-list {
  display: grid;
  gap: .85rem;
}

.settings-profile-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.settings-profile h3 {
  margin-bottom: .3rem;
  font-size: 1.12rem;
}

.settings-profile-heading p,
.settings-muted,
.settings-profile p {
  color: var(--muted);
  font-size: .86rem;
}

.settings-profile-facts {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .9rem;
  color: var(--muted);
  font-size: .78rem;
}

.settings-profile-facts strong {
  color: var(--paper);
  font-weight: 650;
}

.settings-instructions {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: .75rem;
  color: var(--muted);
  font-size: .83rem;
}

.settings-instructions summary {
  color: var(--paper);
  cursor: pointer;
  font-weight: 650;
}

.settings-instructions p {
  margin: .75rem 0 0;
  white-space: pre-wrap;
}

.settings-list {
  display: grid;
  gap: .7rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.settings-list li {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  border-top: 1px solid var(--line);
  padding-top: .6rem;
}

.settings-list strong {
  color: var(--paper);
}

.settings-list span {
  color: var(--muted);
  font-size: .82rem;
}

.studio-sessions-section {
  margin-top: 3.8rem;
}

.session-item {
  align-items: center;
}

.commander-card {
  border-color: rgba(186, 244, 207, .22);
}

.commander-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 1rem 0;
}

.commander-actions form {
  margin: 0;
}

.commander-actions .button {
  min-height: 38px;
  padding: .45rem .7rem;
  font-size: .78rem;
}

.commander-assessment {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: .75rem;
  color: var(--muted);
  font-size: .82rem;
}

.commander-assessment summary {
  color: var(--paper);
  cursor: pointer;
  font-weight: 650;
}

.commander-assessment p {
  margin: .65rem 0 0;
  white-space: pre-wrap;
}

.compact-actions {
  margin: 0 0 1rem;
}

.character-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .7rem 1rem;
  align-items: start;
  border-top: 1px solid var(--line);
  padding: 1rem 0 0;
  margin-top: 1rem;
}

.character-item-active {
  border-top-color: rgba(186, 244, 207, .38);
}

.character-item h3 {
  margin-bottom: .25rem;
  font-size: 1.05rem;
}

.character-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: .82rem;
}

.character-editor {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: .7rem;
  color: var(--muted);
  font-size: .84rem;
}

.character-editor summary {
  color: var(--paper);
  cursor: pointer;
  font-weight: 650;
}

.compact-form {
  margin-top: 1rem;
}

.compact-form .form-field {
  margin-bottom: .85rem;
}

.character-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: .9rem;
}

.character-secondary-actions form {
  margin: 0;
}

.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--mint);
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
}

.text-button-danger {
  color: var(--amber);
}

@media (max-width: 700px) {
  .scenario-details-layout,
  .lore-editor-modal-grid {
    grid-template-columns: 1fr;
  }

  .scenario-details-side {
    position: static;
  }

  .scenario-type-options,
  .media-editor-grid,
  .rpg-designer-preview,
  .visual-novel-editor-layout {
    grid-template-columns: 1fr;
  }

  .rpg-world-actions,
  .rpg-dungeon-grid,
  .rpg-dungeon-tuning-grid {
    grid-template-columns: 1fr;
  }

  .rpg-world-name-field {
    max-width: none;
  }

  .rpg-dungeon-buttons {
    align-items: stretch;
  }

  .rpg-dungeon-buttons .button {
    flex: 1;
  }

  .rpg-lore-link-row {
    grid-template-columns: 1fr;
    gap: .35rem;
  }

  .lore-asset-row {
    grid-template-columns: 1fr;
  }

  .visual-novel-stage {
    min-height: 420px;
  }

  .visual-novel-dialogue {
    right: 4%;
    bottom: 24%;
    width: 72%;
    padding: .85rem;
  }

  .visual-novel-dialogue strong {
    font-size: .95rem;
  }

  .visual-novel-dialogue p {
    font-size: .78rem;
  }

  .lore-card-summary,
  .lore-cards-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .lore-card-summary-actions {
    justify-content: flex-start;
  }

  .studio-heading,
  .studio-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .studio-heading {
    margin-bottom: 2rem;
  }

  .studio-item-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .form-grid,
  .scenario-spotlight,
  .continuity-layout {
    grid-template-columns: 1fr;
  }

  .choice-editor-row {
    grid-template-columns: auto 1fr;
  }

  .choice-editor-row .form-field:last-child {
    grid-column: 2;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .play-complete {
    align-items: flex-start;
    flex-direction: column;
  }

  .spotlight-art {
    min-height: 190px;
  }

  .spotlight-content {
    padding: 1.5rem;
  }

  .play-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .play-layout {
    grid-template-columns: 1fr;
  }

  .beginning-grid {
    grid-template-columns: 1fr;
  }

  .play-header-meta {
    justify-content: flex-start;
  }

  .play-card-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .play-input-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .play-input-footer .button {
    width: 100%;
  }

  .settings-status-grid {
    grid-template-columns: 1fr;
  }

  .settings-facts div {
    align-items: flex-start;
    flex-direction: column;
    gap: .15rem;
  }

  .settings-facts dd {
    max-width: 100%;
    text-align: left;
  }

  .settings-profile-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .character-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .empty-library,
  .studio-empty {
    grid-template-columns: 1fr;
    padding: 1.35rem;
  }

  .form-actions {
    justify-content: stretch;
  }

  .form-actions .button {
    flex: 1 1 100%;
  }

  .play-placeholder {
    align-items: flex-start;
    flex-direction: column;
  }

  .play-placeholder .text-link {
    margin-left: 0;
  }

  .choice-editor-heading,
  .choice-form-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
/* Lore editor: match Odeyu's media-first, category-colored dialog. */
[data-lore-editor]{width:min(1480px,calc(100vw - 40px));--lore-color:#c778ff}
[data-lore-editor] .lore-editor-modal-content{padding:18px}
[data-lore-editor] .lore-editor-modal-header{position:sticky;top:-18px;z-index:4;background:#15171c;padding:0 0 14px;gap:14px;align-items:center}
[data-lore-editor] .lore-editor-modal-header>div:not(.lore-header-actions){flex:1}
.lore-header-actions,.lore-primary-actions{display:flex;gap:8px;flex-wrap:wrap}
[data-lore-editor] .lore-editor-modal-header [data-lore-delete]{min-width:108px;background:#992727;border:1px solid #c24b4b;color:#fff}
[data-lore-editor] .lore-editor-modal-grid{gap:14px;align-items:stretch}
[data-lore-editor] .lore-editor-modal-section{padding:14px;min-width:0}
.lore-primary-media{display:grid;grid-template-columns:170px minmax(0,1fr);gap:22px;background:#101216;border:1px solid #3f434d;border-radius:10px;padding:16px;margin-bottom:16px}
.lore-primary-preview{width:170px;height:170px;border:2px solid var(--lore-color);border-radius:12px;background:#090a0d center/cover no-repeat;display:grid;place-items:center;color:#aeb4c0}
.lore-primary-controls{display:flex;flex-direction:column;gap:8px;min-width:0}
.lore-primary-controls h4{font-size:14px;margin:0;color:white}
.lore-primary-controls label{font-size:12px;margin-top:auto}
.lore-primary-controls textarea{min-height:58px;resize:vertical;width:100%}
.lore-primary-actions .button{font-size:11px;padding:8px 12px}
.lore-primary-actions [data-lore-primary-upload]{background:#2b2414;border-color:#f2c34c;color:#fff}
.lore-color-label{display:flex;flex-direction:column;justify-content:flex-end;font-size:12px;gap:6px}
[data-lore-editor] input[type=color]{padding:2px;height:36px;width:100%;border:1px solid #717580;border-radius:5px;background:#202125}
[data-lore-editor] .lore-activation-group{padding:18px 22px;background:#202125;border:1px solid #969aa2;border-radius:4px}
.lore-weight-intro{font-size:12px;font-weight:600;margin:6px 0 10px}
.lore-weight-picker{position:relative;margin:12px 0 22px;padding-top:25px}
.lore-weight-picker svg{display:block;width:100%;touch-action:none;cursor:pointer}
.lore-weight-readout{position:absolute;top:60%;left:50%;transform:translate(-50%,-50%);border:1px solid #3f434d;border-radius:8px;background:#111319;padding:10px 18px;min-width:145px;text-align:center;pointer-events:none}
.lore-weight-readout strong{display:block;font-size:18px;line-height:1.2}
.lore-weight-readout small{display:block;font-size:10px;margin-top:4px;color:#b6c4dc;white-space:nowrap}
.lore-weight-labels{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px}
.lore-weight-labels button{border:0;background:none;color:#b6c4dc;text-transform:uppercase;font-size:10px;padding:8px 0;cursor:pointer}
.lore-weight-labels button[aria-pressed=true]{color:white;font-weight:700}
.lore-weight-range{position:absolute!important;width:1px!important;height:1px!important;opacity:0;overflow:hidden}
.lore-weight-picker:focus-within{outline:2px solid var(--lore-color);outline-offset:4px;border-radius:8px}
[data-lore-editor] .lore-switches{display:flex;flex-wrap:wrap;gap:16px;margin-top:12px}
[data-lore-editor] .lore-switches .check-field{display:flex;align-items:center;gap:10px;font-size:12px;white-space:nowrap}
[data-lore-editor] input[type=checkbox]{appearance:none;width:48px;height:26px;flex:0 0 48px;border:1px solid #686d79;border-radius:99px;background:#363b45;position:relative;cursor:pointer;margin:0;vertical-align:middle;transition:background .15s}
[data-lore-editor] input[type=checkbox]::before{content:'';position:absolute;width:20px;height:20px;border-radius:50%;background:#f7f5ff;left:2px;top:2px;box-shadow:0 1px 4px #0008;transition:transform .15s}
[data-lore-editor] input[type=checkbox]:checked{background:var(--lore-color);border-color:var(--lore-color)}
[data-lore-editor] input[type=checkbox]:checked::before{transform:translateX(22px)}
[data-lore-editor] input:focus-visible,[data-lore-editor] button:focus-visible{outline:2px solid var(--lore-color);outline-offset:3px}
.lore-linked-group{margin-top:20px}
.lore-link-picker{display:flex;gap:8px}
.lore-link-picker select{min-width:0;flex:1}
.lore-linked-card{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid;border-left-width:4px;background:#252933;border-radius:8px;padding:10px;margin-top:8px}
.lore-linked-card strong{font-size:13px}.lore-linked-card p{font-size:12px;margin:4px 0;color:#b7bbc6}
@media(max-width:1100px){.lore-primary-media{grid-template-columns:110px minmax(0,1fr);gap:12px;padding:12px}.lore-primary-preview{width:110px;height:140px}.lore-weight-readout{min-width:115px;padding:7px}.lore-weight-readout strong{font-size:15px}.lore-weight-labels button{font-size:8px}}
@media(max-width:800px){[data-lore-editor]{width:calc(100vw - 16px)}[data-lore-editor] .lore-editor-modal-grid{grid-template-columns:1fr}[data-lore-editor] .lore-editor-modal-header{flex-wrap:wrap}[data-lore-editor] .lore-editor-modal-header p{display:none}.lore-primary-media{grid-template-columns:100px minmax(0,1fr)}.lore-primary-preview{width:100px;height:130px}.lore-weight-readout{top:58%}.lore-header-actions{margin-left:auto}}

.location-expanded-trigger{margin-left:28px;padding:6px 12px;color:#ffd447;border-color:#ffd447;background:#302607;}
.location-hierarchy-editor{margin-top:14px;border-color:#315b86;}
.location-hierarchy-editor-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0 8px;}
.location-hierarchy-editor-heading strong{display:block;color:#e5efff;font-size:12px;}
.location-hierarchy-editor-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end;}
.location-hierarchy-editor-actions select{min-width:190px;max-width:260px;}
.location-child-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:8px;}
.location-child-card{display:grid;grid-template-columns:72px minmax(0,1fr);gap:10px;text-align:left;padding:9px;border:1px solid #315b86;border-radius:8px;background:#252933;color:#fff;cursor:pointer;min-height:92px;}
.location-child-card:hover,.location-child-card:focus-visible{border-color:#fff;outline:2px solid var(--lore-category-color,#55a7ff);}
.location-child-image{width:72px;height:72px;border-radius:6px;background:#111319 center/cover no-repeat;border:1px solid #365a7d;display:grid;place-items:center;color:#52708d;}
.location-child-body{display:flex;min-width:0;flex-direction:column;gap:3px;}
.location-child-body strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.location-child-body small{color:#73b8ff;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.location-child-body span{color:#b7c0cf;font-size:11px;line-height:1.28;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;}
.location-proximity-controls{display:flex;align-items:center;gap:10px;margin-top:11px;padding-top:10px;border-top:1px solid #354252;}
.location-anchor-picker{display:flex;gap:8px;margin-top:9px;}
.location-anchor-picker select{min-width:0;flex:1;}
.location-anchor-list{display:grid;gap:7px;margin-top:8px;}
.location-anchor-chip{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 9px;background:#252933;border:1px solid #55a7ff;border-radius:8px;color:#dceeff;font-size:11px;}
.location-anchor-chip .button{padding:4px 8px;font-size:10px;}

.location-graph-modal{width:min(1540px,calc(100vw - 40px));height:min(92vh,900px);max-width:none;max-height:none;padding:0;border:0;background:transparent;color:#fff;}
.location-graph-modal::backdrop{background:rgba(0,0,0,.78);}
.location-graph-modal-content{display:grid;grid-template-rows:auto minmax(0,1fr) auto;height:100%;padding:20px;background:#101318;border:1px solid #354252;border-radius:10px;box-shadow:0 20px 70px rgba(0,0,0,.6);}
.location-graph-modal-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:11px 14px 14px;background:#15191f;border:1px solid #354252;border-radius:10px;margin-bottom:10px;}
.location-graph-modal-header h2{font-family:var(--display-font,inherit);font-size:18px;letter-spacing:-.02em;margin:0;color:#f7fbff;}
.location-graph-modal-header p{margin:5px 0 0;color:#8eb7df;font-size:11px;}
.location-graph-tools{display:flex;align-items:center;gap:6px;}
.location-graph-tools button{min-width:38px;height:34px;padding:4px 11px;}
.location-graph-tools output{min-width:66px;height:34px;display:grid;place-items:center;padding:0 9px;background:#111319;border:1px solid #3b4653;border-radius:6px;color:#dceeff;font-size:12px;}
.location-graph-tools [data-location-graph-close]{margin-left:7px;background:#302607;border-color:#ffd447;color:#ffd447;}
.location-graph-canvas{position:relative;overflow:hidden;min-height:0;border:1px solid #354252;border-radius:10px;background-color:#0f1217;background-image:radial-gradient(circle,#28435e 1px,transparent 1px);background-size:32px 32px;overscroll-behavior:contain;cursor:grab;}
.location-graph-canvas.is-panning{cursor:grabbing;}
.location-graph-world{position:absolute;left:0;top:0;transform-origin:0 0;will-change:transform;}
.location-graph-connectors{position:absolute;left:0;top:0;overflow:visible;pointer-events:none;}
.location-graph-nodes{position:absolute;left:0;top:0;}
.location-graph-node{position:absolute;display:grid;grid-template-columns:62px minmax(0,1fr);gap:10px;width:246px;height:112px;padding:10px;text-align:left;color:#fff;background:#171c23;border:1.5px solid #42627f;border-radius:9px;cursor:pointer;overflow:hidden;}
.location-graph-node.is-root{background:#0d3b6b;border:2px solid #78c5ff;}
.location-graph-node.is-direct{background:#16304a;border-color:#55a7ff;}
.location-graph-node:hover,.location-graph-node:focus-visible{border-color:#ffd447;outline:2px solid rgba(255,212,71,.3);}
.location-graph-node-image{width:62px;height:62px;border-radius:7px;background:#0a0d11 center/cover no-repeat;border:1px solid #365a7d;display:grid;place-items:center;color:#526f8c;}
.location-graph-node-body{display:flex;min-width:0;flex-direction:column;gap:3px;overflow:hidden;}
.location-graph-node-body small:first-child{color:#73b8ff;font-size:9px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.location-graph-node-body strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.location-graph-node-body span{color:#aeb8c5;font-size:10px;line-height:1.35;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;}
.location-graph-node-body small:last-child{color:#7892aa;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.location-graph-help{margin:8px 2px 0;color:#8c9aaa;font-size:11px;}

@media(max-width:800px){
  .location-hierarchy-editor-heading{align-items:flex-start;flex-direction:column;}
  .location-hierarchy-editor-actions{justify-content:flex-start;width:100%;}
  .location-child-list{grid-template-columns:1fr;}
  .location-graph-modal{width:calc(100vw - 16px);height:calc(100vh - 16px);}
  .location-graph-modal-header{align-items:flex-start;flex-direction:column;}
  .location-graph-tools{width:100%;justify-content:flex-end;}
}
.saga-shell [data-lore-editor] .lore-header-actions [data-lore-save]{background:#f2c34c;border-color:#ffe08a;color:#111}
.saga-shell [data-lore-editor] [data-lore-primary-upload]{background:#2b2414;border-color:#f2c34c;color:white}
.saga-shell [data-lore-editor] [data-lore-generate]{background:#16253a;border:1px solid #4294ff;color:#fff;white-space:nowrap;font-size:11px;padding:10px}
.lore-generation-row{display:flex;gap:8px}.lore-generation-row textarea{flex:1;min-width:0}
.lore-pin-owner{align-self:center;color:#ffd166;font-size:11px}
@media(max-width:1100px){.lore-generation-row{flex-wrap:wrap}.lore-generation-row textarea{flex-basis:100%}}
[data-lore-editor] .lore-weight-picker{padding-top:0}
[data-lore-editor] .lore-weight-picker svg{height:210px}
[data-lore-editor] .lore-category-grid{grid-template-columns:minmax(0,1fr) 112px;align-items:end}
[data-lore-editor] [data-lore-custom]{grid-column:1/-1}
.saga-shell [data-lore-editor] input[type=text],.saga-shell [data-lore-editor] select{font-size:12px;min-height:32px;height:34px;padding:6px 10px;border-radius:4px;background-color:#0c0d0f}
.saga-shell [data-lore-editor] textarea{font-size:12px;padding:8px 10px;border-radius:2px;background:#0c0d0f}
.saga-shell [data-lore-editor] #lore-summary{height:76px;min-height:76px}
.saga-shell [data-lore-editor] .form-field{margin-bottom:12px}
[data-lore-editor] .lore-primary-controls textarea{height:58px;min-height:58px}
@media(max-width:1100px){[data-lore-editor] .lore-weight-picker svg{height:auto}}
@media(max-width:520px){[data-lore-editor] .lore-primary-media{grid-template-columns:1fr}[data-lore-editor] .lore-primary-preview{width:140px;height:140px;justify-self:center}[data-lore-editor] .lore-primary-actions .button{white-space:normal;flex:1}[data-lore-editor] .lore-generation-row textarea{width:100%}[data-lore-editor] .lore-activation-group{padding:12px}[data-lore-editor] .lore-switches{gap:12px}[data-lore-editor] .lore-link-picker{flex-wrap:wrap}[data-lore-editor] .lore-link-picker select{flex-basis:100%}}

/* Lore Cards follow Odeyu's category-first library layout. */

/* Character behavior and relationship editor, following Odeyu's two-column
   workbench while keeping the values in the scenario's relationship seeds. */
[data-lore-editor] .character-editor-only{grid-column:1/-1;border-color:#315b86;background:#0f1825;display:grid;gap:14px}
[data-lore-editor] .character-editor-only[hidden]{display:none}
.character-editor-intro h3{margin:0;color:#78c5ff}
.character-editor-intro p{margin:5px 0 0;color:#aebdd0;font-size:12px}
.character-playable-panel,.character-starting-panel,.character-behavior-panel,.character-relationship-panel{border:1px solid #315b86;border-radius:8px;padding:16px;background:#0d1723}
.character-playable-panel{border-color:#6b3a99;background:#171027;position:relative;min-height:62px}
.character-playable-panel legend{padding:0 6px;color:#d68aff;font-size:14px;font-weight:700}
.character-playable-panel>.field-hint{max-width:calc(100% - 170px);margin:2px 0 0}
.character-playable-toggle{position:absolute;right:18px;top:28px;color:#edf3ff}
.character-starting-panel legend,.character-behavior-panel legend,.character-relationship-panel legend{padding:0 6px;color:#78c5ff;font-size:17px;font-weight:600}
.character-starting-panel legend{color:#d8a6ff}
.character-relationship-panel legend{font-size:22px;color:#f2f6fb}
.character-panel-legend{display:inline-flex;align-items:center;gap:10px;line-height:1.2}
.character-panel-icon{display:block;width:30px;height:30px;flex:0 0 30px;overflow:visible}
.character-panel-icon-starting{width:32px;height:32px;filter:drop-shadow(0 0 5px #b469ff66)}
.character-panel-icon-behavior{width:28px;height:28px;filter:drop-shadow(0 0 5px #4dda8666)}
.character-panel-icon-relationship{width:34px;height:34px;filter:drop-shadow(0 0 7px #4a98ff66)}
.character-starting-panel .field-hint,.character-behavior-panel .field-hint,.character-relationship-panel .field-hint{color:#aebdd0}
.character-defaults-toggle{align-items:flex-start;margin:14px 0 8px;color:#e8f1ff}
.character-defaults-toggle span{display:grid;gap:3px}
.character-defaults-toggle strong{font-size:12px}
.character-defaults-toggle small{color:#aebdd0;font-size:10px}
.character-qualities-field{margin:0}
.character-qualities-field label{font-size:11px;color:#d8e9ff}
.character-behavior-panel{border-color:#258955;background:#0d1b1e}
.character-behavior-panel legend{color:#43f28e}
.character-behavior-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:18px;margin-top:12px}
.character-subheading{color:#edf6ff;font-size:12px;font-weight:700;margin:12px 0 4px}
.character-behavior-main>.character-subheading:first-child{margin-top:0}
.behavior-conflict-options{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:10px 0 18px}
.behavior-conflict-option{min-height:48px;padding:7px 5px;border:1px solid #344452;border-radius:7px;background:#0e151b;color:#dae6f2;font-size:11px;cursor:pointer}
.behavior-conflict-option[aria-pressed=true]{border-color:#59d67d;background:#193525;color:#fff;box-shadow:0 0 8px #45c97a40}
.behavior-conflict-option::before{content:'✓ ';color:#8c9aaa}.behavior-conflict-option[aria-pressed=false]::before{visibility:hidden}
.behavior-metric-grid,.relationship-metric-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:22px;row-gap:10px}
.behavior-metric,.relationship-metric{display:grid;grid-template-columns:minmax(0,145px) minmax(80px,1fr) 52px;align-items:center;gap:8px;color:#e6f3ff;font-size:13px}
.behavior-metric label,.relationship-metric label{white-space:nowrap}
[data-lore-editor] .behavior-metric input[type=range],[data-lore-editor] .relationship-metric input[type=range]{width:100%;height:5px;accent-color:#4DDA86;cursor:pointer}
[data-lore-editor] .relationship-metric input[type=range]{accent-color:var(--metric-score,#4da8ff)}
.metric-value{display:grid;place-items:center;min-height:30px;border:1px solid #3ab96b;border-radius:4px;color:#73f394;font-size:15px;background:#07140d}
.relationship-metric .metric-value{border-color:var(--metric-score,#4da8ff);color:var(--metric-score,#72bdff);background:#081421}
.relationship-metric-trust{--metric-score:#4A98FF;--metric-start:#2264D4;--metric-end:#58A7FF}
.relationship-metric-affection{--metric-score:#FF4F83;--metric-start:#B62C5E;--metric-end:#FF5B8D}
.relationship-metric-respect{--metric-score:#23C9C3;--metric-start:#0C807E;--metric-end:#2ED9D1}
.relationship-metric-attraction{--metric-score:#A96CFF;--metric-start:#6730A5;--metric-end:#B975FF}
.relationship-metric-comfort{--metric-score:#45C97A;--metric-start:#1D7E49;--metric-end:#4DDA86}
.relationship-metric-resentment{--metric-score:#FF514A;--metric-start:#FF843F;--metric-end:#FF4D67}
.relationship-metric-fear{--metric-score:#FFC43D;--metric-start:#FF8A00;--metric-end:#FFCE3A}
.relationship-metric-attachment{--metric-score:#38BDF8;--metric-start:#147DB5;--metric-end:#48CAFF}
.behavior-preset-library{min-width:0;border:1px solid #258955;border-radius:9px;padding:12px;background:#071212;display:flex;flex-direction:column;min-height:340px}
.behavior-preset-library h4{display:flex;justify-content:space-between;gap:8px;margin:0;color:#43f28e;font-size:12px}
.behavior-preset-library h4 span{font-size:10px;font-weight:400;color:#a8dcbc;white-space:nowrap}
.behavior-preset-selected{margin-top:10px;border:1px solid #258955;border-radius:6px;padding:9px;color:#bfe8cb;font-size:11px}.behavior-preset-selected strong{color:#43f28e}
[data-lore-editor] .behavior-preset-library input[type=search]{margin-top:9px;min-height:30px;height:30px;background:#050809;border-color:#344452}
.behavior-preset-genres{display:flex;gap:5px;overflow-x:auto;padding:8px 0 5px;scrollbar-width:thin}
.behavior-preset-genre{border:1px solid #344452;border-radius:6px;background:#0d1718;color:#bad4c2;padding:6px 9px;font-size:10px;white-space:nowrap;cursor:pointer}.behavior-preset-genre[aria-pressed=true]{border-color:#43f28e;background:#123c2a;color:#fff}
.behavior-preset-list{display:grid;gap:5px;overflow:auto;max-height:180px;padding-right:2px}
.behavior-preset-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;border:1px solid #263b36;border-radius:6px;background:#0b1415;padding:8px 9px;text-align:left;color:#e5f4e8;cursor:pointer}.behavior-preset-card:hover,.behavior-preset-card[aria-current=true]{border-color:#43f28e;background:#123c2a}.behavior-preset-card strong{font-size:11px}.behavior-preset-card small{grid-column:1;color:#83a995;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.behavior-preset-card em{grid-column:2;grid-row:1/3;align-self:center;color:#43f28e;font-size:9px;font-style:normal}
.behavior-preset-values{margin-top:9px;border:1px solid #263b36;border-radius:6px;padding:8px;color:#9fd5ad;font-size:9px;line-height:1.45;min-height:40px}.behavior-preset-values strong{display:block;color:#43f28e;font-size:9px;margin-bottom:4px}
.character-relationship-panel{border-color:#3578b6;background:#0d1a2a}.character-relationship-panel legend{color:#78c5ff}
.relationship-status-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;align-items:center;border:1px solid #2e4c6b;border-radius:8px;padding:12px 14px;background:#0c1724}
.relationship-status-panel .character-subheading{margin:0 0 10px;text-transform:uppercase;color:#8fa6c2;font-size:14px}
.relationship-status-picker{position:relative;height:68px;min-height:68px;overflow:hidden;border-radius:4px}
.saga-shell [data-lore-editor] .relationship-status-panel .relationship-status-picker select{display:block;box-sizing:border-box;width:100%;height:68px;min-height:68px;padding:0 38px 0 10px;text-indent:74px;font-size:17px;font-weight:700;color:#edf6ff;background:#0b1624;border-color:#344c66}
.relationship-status-icon{position:absolute;left:7px;top:4px;width:60px;height:60px;display:grid;place-items:center;border:1px solid #4a98ff;border-radius:50%;background:#10243b;pointer-events:none}
.relationship-status-icon svg{width:30px;height:30px;display:block;overflow:visible}
.relationship-status-panel p{margin:0;border-left:1px solid #2e4c6b;padding-left:14px;color:#c8d9eb;font-size:12px}
.relationship-metrics-heading{margin-top:18px;text-transform:uppercase;color:#8fa6c2;font-size:14px;border-bottom:1px solid #2e4c6b;padding-bottom:6px}
@media(max-width:1050px){.character-behavior-layout{grid-template-columns:1fr}.behavior-preset-library{min-height:0}.behavior-preset-list{max-height:220px}}
@media(max-width:700px){.behavior-conflict-options{grid-template-columns:repeat(2,minmax(0,1fr))}.behavior-metric-grid,.relationship-metric-grid,.relationship-status-panel{grid-template-columns:1fr}.relationship-status-panel p{border-left:0;border-top:1px solid #2e4c6b;padding:10px 0 0}.behavior-metric,.relationship-metric{grid-template-columns:minmax(0,110px) minmax(70px,1fr) 40px}}
.lore-cards-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 1rem;
  align-items: stretch;
}

.lore-cards-main {
  min-width: 0;
  min-height: 520px;
  border: 1px solid #4a4d56;
  border-radius: 10px;
  padding: 1.15rem;
  background: #1d1e22;
}

.lore-cards-heading {
  margin-bottom: 1rem;
}

.lore-cards-heading p {
  margin: .35rem 0 0;
  color: var(--faint);
  font-size: .75rem;
}

.lore-category-sidebar {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-height: 520px;
  border: 1px solid #4a4d56;
  border-radius: 10px;
  padding: 1rem;
  background: #1d1e22;
}

.lore-category-sidebar h3 {
  margin: 0 0 .45rem;
  color: var(--paper);
  font-size: .8rem;
  letter-spacing: .03em;
}

.lore-category-filters {
  display: grid;
  gap: .45rem;
}

.lore-category-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid #343741;
  border-radius: 7px;
  padding: .65rem .75rem;
  background: #17181c;
  color: #bdc4d3;
  font: inherit;
  font-size: .75rem;
  text-align: left;
  cursor: pointer;
}

.lore-category-filter b {
  color: var(--faint);
  font-size: .7rem;
}

.lore-category-filter:hover,
.lore-category-filter.is-active {
  border-color: #f2c34c;
  background: #352b08;
  color: #ffe08a;
}

.lore-category-filter.is-active b {
  color: #ffe08a;
}

.lore-sidebar-add {
  width: 100%;
  margin-top: auto;
}

.lore-card-list {
  display: grid;
  gap: 1.35rem;
}

.lore-category-section {
  min-width: 0;
}

.lore-category-heading {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  margin-bottom: .65rem;
  border-bottom: 1px solid #383b45;
  padding-bottom: .5rem;
}

.lore-category-heading h3 {
  margin: 0;
  color: var(--lore-category-color);
  font-size: .88rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.lore-category-heading span {
  color: var(--faint);
  font-size: .72rem;
}

.lore-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.lore-card-summary {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  align-items: stretch;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid var(--lore-category-color, #8e9aaf);
  border-radius: 10px;
  padding: .7rem;
  background: linear-gradient(120deg, #322b42, #252630);
  color: var(--paper);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.lore-card-summary:hover,
.lore-card-summary:focus-visible {
  transform: translateY(-2px);
  background: linear-gradient(120deg, #3b3150, #2a2b37);
  box-shadow: 0 8px 22px #0005;
  outline: 2px solid var(--lore-category-color, #c879ff);
  outline-offset: 2px;
}

.lore-card-image {
  display: grid;
  min-height: 164px;
  place-items: center;
  border: 1px solid var(--lore-category-color, #8e9aaf);
  border-radius: 8px;
  background: #101115;
  color: var(--lore-category-color, #c879ff);
  font-size: 2.1rem;
}

.lore-card-image.has-image {
  background-position: center;
  background-size: cover;
}

.lore-card-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: .3rem 0 .2rem 1rem;
}

.lore-card-meta {
  display: flex;
  gap: .7rem;
  align-items: center;
  color: #bfc6d5;
  font-size: .66rem;
}

.lore-card-meta span:first-child {
  border: 1px solid var(--lore-category-color, #8e9aaf);
  border-radius: 5px;
  padding: .28rem .45rem;
  color: var(--lore-category-color, #c879ff);
  font-weight: 800;
}

.lore-card-body strong {
  margin-top: .7rem;
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
}

.lore-card-rule {
  display: block;
  width: 100%;
  height: 1px;
  margin: .55rem 0 .65rem;
  background: var(--lore-category-color, #8e9aaf);
  opacity: .8;
}

.lore-card-summary-text {
  display: -webkit-box;
  overflow: hidden;
  color: #c5cada;
  font-size: .78rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.lore-card-location-info{display:block;color:#73b8ff;font-size:10px;margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

.lore-card-badges {
  margin-top: auto;
  padding-top: .6rem;
  color: #ffd166;
  font-size: .67rem;
  white-space: normal;
}

.lore-card-add-tile {
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  gap: .45rem;
  border: 1px dashed var(--lore-category-color, #8e9aaf);
  border-radius: 10px;
  background: transparent;
  color: #d8dbea;
  font: inherit;
  cursor: pointer;
}

.lore-card-add-tile span {
  color: var(--lore-category-color, #c879ff);
  font-size: 1.65rem;
  line-height: 1;
}

.lore-card-add-tile:hover,
.lore-card-add-tile:focus-visible {
  background: #2a2632;
  outline: 2px solid var(--lore-category-color, #c879ff);
  outline-offset: 2px;
}

.lore-card-empty {
  margin-top: 1rem;
}

@media (max-width: 1100px) {
  .lore-cards-layout { grid-template-columns: minmax(0, 1fr) 190px; }
  .lore-card-summary { grid-template-columns: 120px minmax(0, 1fr); }
  .lore-card-image { min-height: 150px; }
}

@media (max-width: 800px) {
  .lore-cards-layout { grid-template-columns: 1fr; }
  .lore-category-sidebar { min-height: 0; order: -1; }
  .lore-category-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lore-sidebar-add { margin-top: .5rem; }
}

@media (max-width: 560px) {
  .lore-category-grid { grid-template-columns: 1fr; }
  .lore-category-filters { grid-template-columns: 1fr; }
  .lore-card-summary { grid-template-columns: 110px minmax(0, 1fr); min-height: 160px; }
  .lore-card-image { min-height: 138px; }
  .lore-card-body { padding-left: .7rem; }
  .lore-card-body strong { font-size: 1rem; }
}

/* Scenario artwork tools stay within narrow media cards and mobile layouts. */
.scenario-artwork-generator { margin-top: .8rem; min-width: 0; }
.scenario-artwork-generator summary { cursor: pointer; font-weight: 600; }
.scenario-artwork-generator label { display: grid; gap: .35rem; margin-top: .7rem; }
.scenario-artwork-generator select, .scenario-artwork-generator textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.scenario-artwork-generator small { display: block; margin: .5rem 0; }
.scenario-artwork-generator [role="status"] { overflow-wrap: anywhere; }
