:root {
  color-scheme: dark;
  --bg: #0f1117;
  --surface: #171b24;
  --surface-2: #202736;
  --surface-3: #263244;
  --line: #3a465a;
  --text: #f7f0e4;
  --muted: #b8c0ce;
  --soft: #8e99aa;
  --gold: #f0bc5e;
  --orange: #f28a43;
  --jade: #70d0aa;
  --rose: #e9837f;
  --ink: #10131a;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, rgba(112, 208, 170, 0.16), transparent 34rem),
    radial-gradient(circle at 92% 10%, rgba(240, 188, 94, 0.13), transparent 28rem),
    linear-gradient(135deg, #0f1117 0%, #151925 48%, #221b22 100%);
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
.primary-action,
.secondary-action,
.nav-button {
  min-height: 42px;
  border: 1px solid rgba(240, 188, 94, 0.42);
  border-radius: 8px;
  padding: 0 16px;
  color: #16120a;
  background: var(--gold);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

button:hover,
.primary-action:hover,
.secondary-action:hover,
.nav-button:hover {
  transform: translateY(-1px);
  background: #f5ca78;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(7, 9, 13, 0.58);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 128px;
  line-height: 1.7;
}

select {
  appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(112, 208, 170, 0.18);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(15, 17, 23, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  color: var(--text);
  font-size: 1.22rem;
  font-weight: 900;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

nav a:not(.nav-button) {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 8px;
}

nav a:not(.nav-button):hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

main {
  padding: 0 clamp(18px, 4vw, 56px) 54px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--jade);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.portal-hero {
  min-height: min(680px, calc(100vh - 74px));
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  align-items: center;
  gap: clamp(26px, 5vw, 82px);
  padding: 52px 0 34px;
}

.hero-content {
  max-width: 800px;
}

.portal-hero h1,
.library-hero h1,
.dashboard-hero h1,
.auth-card h1 {
  margin: 0;
  letter-spacing: 0;
}

.portal-hero h1 {
  font-size: clamp(2.55rem, 6vw, 5.9rem);
  line-height: 0.98;
}

.portal-hero p:not(.eyebrow),
.library-hero p,
.dashboard-hero p {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.35vw, 1.18rem);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.secondary-action,
.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.secondary-action:hover,
.ghost-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hero-art {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(16, 19, 26, 0.04), rgba(16, 19, 26, 0.92)),
    linear-gradient(145deg, #263649, #171c27 52%, #32252d);
  box-shadow: var(--shadow);
}

.sun {
  position: absolute;
  top: 42px;
  right: 52px;
  width: 96px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f7dd9d;
  box-shadow: 0 0 58px rgba(247, 221, 157, 0.36);
}

.archive {
  position: absolute;
  left: 11%;
  bottom: 74px;
  width: 280px;
  height: 190px;
  border: 2px solid rgba(247, 240, 228, 0.22);
  background: linear-gradient(90deg, rgba(112, 208, 170, 0.2), rgba(240, 188, 94, 0.16));
  clip-path: polygon(0 100%, 0 28%, 12% 28%, 12% 12%, 88% 12%, 88% 28%, 100% 28%, 100% 100%);
}

.gate {
  position: absolute;
  left: 25%;
  bottom: 0;
  width: 42%;
  height: 210px;
  border-radius: 180px 180px 0 0;
  background: linear-gradient(180deg, rgba(15, 17, 23, 0.12), rgba(15, 17, 23, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.sigil {
  position: absolute;
  right: 15%;
  bottom: 76px;
  display: grid;
  place-items: center;
  width: 122px;
  aspect-ratio: 1;
  border: 2px solid rgba(247, 240, 228, 0.52);
  border-radius: 28px;
  color: var(--gold);
  background: rgba(9, 11, 16, 0.56);
  font-size: 2.1rem;
  font-weight: 1000;
  transform: rotate(10deg);
}

.feature-strip,
.dashboard-grid,
.library-grid,
.stat-grid {
  display: grid;
  gap: 18px;
}

.feature-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 10px 0 46px;
}

.feature-strip article,
.stat-grid article,
.panel,
.record-card,
.auth-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(23, 27, 36, 0.88);
  box-shadow: var(--shadow);
}

.feature-strip article {
  padding: 22px;
}

.stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 18px;
}

.stat-grid article {
  padding: 20px;
}

.stat-grid span {
  display: block;
  color: var(--gold);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 1000;
  line-height: 1;
}

.stat-grid p {
  margin: 8px 0 0;
  color: var(--muted);
}

.feature-strip span {
  color: var(--gold);
  font-weight: 900;
}

.feature-strip h2,
.panel h2,
.record-card h2,
.record-card h3,
.section-heading h2 {
  margin: 8px 0 0;
  letter-spacing: 0;
}

.feature-strip p,
.record-card p {
  color: var(--muted);
  line-height: 1.75;
}

.section-heading {
  margin: 42px 0 16px;
}

.library-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.record-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
  padding: 20px;
}

.record-card p {
  white-space: pre-wrap;
}

.record-card small,
.record-meta,
.form-link {
  color: var(--soft);
}

.monster-grid {
  align-items: start;
}

.monster-card {
  gap: 10px;
  min-height: 0;
}

.monster-card h2 {
  color: var(--text);
}

.monster-stat-strip,
.monster-abilities {
  display: grid;
  gap: 6px;
}

.monster-stat-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.monster-abilities {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.monster-stat-strip span,
.monster-abilities span {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 7px 6px;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
}

.monster-stat-strip small,
.monster-stat-strip strong,
.monster-abilities small,
.monster-abilities strong {
  display: block;
}

.monster-stat-strip small,
.monster-abilities small {
  color: var(--soft);
  font-size: 0.68rem;
}

.monster-stat-strip strong,
.monster-abilities strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 0.88rem;
}

.monster-stat-strip em {
  display: block;
  color: var(--soft);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 400;
}

.monster-line {
  margin: 0;
  font-size: 0.84rem;
}

.monster-line strong {
  color: var(--text);
}

.monster-block {
  margin-top: 4px;
}

.monster-block h3 {
  margin: 0;
  color: var(--gold);
  font-size: 0.9rem;
}

.monster-block .feature-list {
  margin-top: 6px;
}

.monster-source {
  margin-top: auto;
  overflow-wrap: anywhere;
}

.archive-feature-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.item-grid {
  align-items: start;
}

.item-card,
.item-rule-card {
  gap: 10px;
  min-height: 0;
}

.item-card h2,
.item-rule-card h2 {
  color: var(--text);
}

.item-english {
  margin: -7px 0 0;
  color: var(--gold) !important;
  font-size: 0.82rem;
}

.item-stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.item-stat-strip span {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.035);
}

.item-stat-strip small,
.item-stat-strip strong {
  display: block;
}

.item-stat-strip small {
  color: var(--soft);
  font-size: 0.68rem;
}

.item-stat-strip strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.item-effect-summary {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 3px solid #b97832;
  background: #fff7e8;
}

.item-effect-summary small {
  color: #80501f;
  font-weight: 700;
}

.item-effect-summary p {
  margin: 4px 0 0;
}

.item-tags span {
  border: 1px solid rgba(240, 188, 94, 0.26);
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--gold);
  background: rgba(240, 188, 94, 0.08);
  font-size: 0.7rem;
}

.item-details {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  padding-top: 8px;
}

.item-details summary {
  cursor: pointer;
  color: var(--jade);
  font-size: 0.82rem;
  font-weight: 900;
}

.item-details p {
  margin-bottom: 0;
  font-size: 0.86rem;
}

.item-source {
  margin-top: auto;
  overflow-wrap: anywhere;
}

.item-category-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.item-search-form {
  grid-template-columns: minmax(150px, 0.75fr) minmax(130px, 0.55fr) minmax(130px, 0.55fr) minmax(220px, 1.2fr) auto;
  max-width: none;
}

.item-guide-actions {
  align-items: center;
  justify-content: space-between;
}

.item-range {
  color: var(--soft);
  font-size: 0.84rem;
}

.item-rule-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.item-rule-card {
  align-self: start;
}

.item-rule-list {
  margin: 0;
}

.item-rule-table-wrap {
  overflow-x: auto;
}

.item-rule-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--muted);
  font-size: 0.84rem;
}

.item-rule-table th,
.item-rule-table td {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 9px;
  text-align: left;
  white-space: nowrap;
}

.item-rule-table th {
  color: var(--text);
  background: rgba(240, 188, 94, 0.09);
}

.item-rule-table td {
  background: rgba(255, 255, 255, 0.025);
}

.spell-grid {
  align-items: start;
}

.spell-card {
  gap: 10px;
  min-height: 0;
}

.spell-card h2 {
  margin-bottom: 0;
  color: var(--text);
}

.spell-english {
  margin: -7px 0 0;
  color: var(--gold) !important;
  font-size: 0.82rem;
}

.spell-stat-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.spell-stat-strip span {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.035);
}

.spell-stat-strip small,
.spell-stat-strip strong {
  display: block;
}

.spell-stat-strip small {
  color: var(--soft);
  font-size: 0.68rem;
}

.spell-stat-strip strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.spell-source {
  margin-top: auto;
  overflow-wrap: anywhere;
}

.spellbook-hero,
.spellbook-manager {
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.spell-level-nav,
.spell-school-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.spellbook-character-select {
  max-width: 520px;
  grid-template-columns: 1fr;
}

.spellbook-character-select label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.spellbook-editor {
  display: grid;
  gap: 16px;
  margin: 24px 0 48px;
}

.spellbook-editor-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.spellbook-editor-head h2 {
  margin: 4px 0 0;
}

.spell-level-editor {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

.spell-level-editor summary {
  cursor: pointer;
  color: var(--gold);
  font-weight: 900;
}

.dnd-spell-choice-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.dnd-spell-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.dnd-spell-choice input {
  width: auto;
}

.dnd-spell-choice span,
.dnd-spell-choice strong,
.dnd-spell-choice small {
  display: block;
  min-width: 0;
}

.dnd-spell-choice strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dnd-spell-choice small {
  margin-top: 2px;
  color: var(--soft);
  font-size: 0.68rem;
}

.dnd-spell-choice em {
  color: var(--soft);
  font-size: 0.68rem;
  font-style: normal;
}

.roll-card h2 {
  color: var(--gold);
}

.roll-card.success {
  border-color: rgba(112, 208, 170, 0.36);
}

.roll-card.danger {
  border-color: rgba(233, 131, 127, 0.42);
}

.roll-card.danger h2 {
  color: var(--rose);
}

.record-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.86rem;
}

.library-hero,
.dashboard-hero {
  padding: 48px 0 28px;
}

.library-hero h1,
.dashboard-hero h1 {
  font-size: clamp(2.1rem, 5vw, 4.4rem);
  line-height: 1;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(0, 1fr) auto;
  gap: 10px;
  max-width: 960px;
  margin-top: 26px;
}

.category-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}

.category-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  text-decoration: none;
}

.category-nav a:hover,
.category-nav a.active {
  border-color: rgba(240, 188, 94, 0.42);
  color: var(--text);
  background: rgba(240, 188, 94, 0.1);
}

.category-nav span {
  color: var(--gold);
  font-weight: 900;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 32px auto 0;
}

.pagination a {
  min-width: 38px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  text-align: center;
  text-decoration: none;
}

.pagination a:hover,
.pagination a.active {
  border-color: rgba(240, 188, 94, 0.62);
  color: var(--ink);
  background: var(--gold);
}

.pagination a.disabled {
  pointer-events: none;
  opacity: 0.45;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-shell {
  width: min(480px, calc(100vw - 28px));
  padding: 28px 0;
}

.auth-card {
  margin-top: 18px;
  padding: 24px;
}

.auth-card h1 {
  font-size: clamp(2rem, 8vw, 3.2rem);
  line-height: 1;
}

.stack-form,
.profile-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.form-link {
  margin: 18px 0 0;
}

.form-hint {
  margin: 0;
  color: var(--soft);
  font-size: 0.86rem;
  line-height: 1.6;
}

.level-up-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.level-up-form label {
  min-width: 180px;
}

.level-up-form button {
  min-height: 42px;
}

.form-link a {
  color: var(--jade);
  font-weight: 800;
}

.notice {
  border: 1px solid rgba(112, 208, 170, 0.28);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(112, 208, 170, 0.12);
}

.dashboard {
  padding-bottom: 70px;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.dashboard-hero img {
  width: 112px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
  align-items: start;
}

.panel {
  min-width: 0;
  padding: 20px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-divider {
  height: 1px;
  margin: 22px 0;
  background: rgba(255, 255, 255, 0.1);
}

.profile-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-form .full,
.profile-form button {
  grid-column: span 2;
}

.coc-form {
  display: grid;
  gap: 18px;
}

.coc-stat-grid,
.skill-grid,
.derived-grid {
  display: grid;
  gap: 12px;
}

.coc-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.skill-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.skill-field span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.skill-field button {
  min-height: 42px;
  padding: 0 12px;
}

.derived-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 16px;
}

.derived-grid span {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
}

.derived-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 1.2rem;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 0;
  background: linear-gradient(180deg, rgba(15, 17, 23, 0), rgba(15, 17, 23, 0.96) 28%);
}

.ghost-button {
  min-height: 36px;
  padding: 0 12px;
}

.ghost-link {
  color: var(--jade);
  font-weight: 800;
  text-decoration: none;
}

.compact-action {
  min-height: 36px;
  padding: 0 12px;
}

.invite-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border: 1px solid rgba(240, 188, 94, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(240, 188, 94, 0.09);
}

.invite-code strong {
  color: var(--gold);
  letter-spacing: 0.08em;
}

.campaign-actions {
  margin-top: 14px;
}

.campaign-summary {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.campaign-summary span {
  border: 1px solid rgba(112, 208, 170, 0.28);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(112, 208, 170, 0.08);
  font-weight: 800;
}

.room-card.active {
  border-color: rgba(112, 208, 170, 0.42);
}

.room-count {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  width: fit-content;
  border: 1px solid rgba(240, 188, 94, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(240, 188, 94, 0.09);
}

.room-count strong {
  color: var(--gold);
  font-size: 1.25rem;
}

.participant-list,
.status-list {
  display: grid;
  gap: 8px;
}

.participant-list span,
.status-list span {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
}

.status-list strong {
  display: block;
  color: var(--text);
}

.resource-list span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.resource-list small {
  display: block;
  margin-top: 3px;
  color: var(--soft);
}

.feature-list {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  padding-left: 18px;
}

.feature-list li {
  color: var(--muted);
  line-height: 1.55;
}

.feature-list strong,
.feature-list span {
  display: block;
}

.feature-list strong {
  color: var(--text);
}

.feature-list span {
  margin-top: 3px;
  font-size: 0.86rem;
}

.dnd-skill-section {
  margin-top: 18px;
}

.character-card-rules-line {
  color: var(--soft);
  font-size: .78rem;
  line-height: 1.6;
}

.dnd-skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.dnd-skill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  border-left: 3px solid rgba(255, 255, 255, 0.12);
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.035);
}

.dnd-skill-row.is-proficient {
  border-left-color: var(--jade);
  background: rgba(112, 208, 170, 0.08);
}

.dnd-skill-row span,
.dnd-skill-row strong,
.dnd-skill-row small {
  display: block;
}

.dnd-skill-row span {
  min-width: 0;
}

.dnd-skill-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dnd-skill-row small {
  margin-top: 2px;
  color: var(--soft);
  font-size: 0.7rem;
}

.dnd-skill-row b {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 0.9rem;
}

.skill-editor {
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  padding-top: 12px;
}

.skill-editor summary {
  cursor: pointer;
  color: var(--jade);
  font-weight: 800;
}

.dnd-skill-editor {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.dnd-skill-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.dnd-skill-choice {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.035);
}

.dnd-skill-choice input {
  flex: 0 0 auto;
  width: auto;
}

.dnd-skill-choice span,
.dnd-skill-choice strong,
.dnd-skill-choice small {
  display: block;
  min-width: 0;
}

.dnd-skill-choice strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dnd-skill-choice small {
  color: var(--soft);
  font-size: 0.68rem;
}

.dnd-skill-choice.is-disabled {
  opacity: 0.42;
}

.compact-stack {
  margin-top: 4px;
  gap: 8px;
}

.stack-actions {
  display: grid;
  gap: 10px;
}

.shop-section {
  margin-top: 34px;
}

.shop-toolbar {
  margin-top: -12px;
}

.shop-toolbar label {
  max-width: 620px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.shop-card {
  display: flex;
  flex-direction: column;
}

.buy-form {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}

.buy-form button {
  min-width: 92px;
}

.buy-form button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.inventory-list {
  display: grid;
  gap: 18px;
}

.inventory-action-form {
  margin: 0 0 8px;
}

.inventory-action-form input {
  width: 76px;
  min-height: 36px;
  padding: 8px 10px;
}

.shop-admin-filter {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.7fr) minmax(120px, 0.35fr) auto;
  margin-bottom: 16px;
}

.shop-admin-table {
  min-width: 920px;
}

.shop-admin-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

.shop-admin-description {
  grid-column: span 2;
}

.shop-admin-form textarea {
  min-height: 86px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.check-row input {
  width: auto;
}

.inline-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.inline-form select {
  width: auto;
  min-width: 108px;
}

.inline-form button {
  min-height: 36px;
  padding: 0 12px;
}

.password-reset-form {
  margin-top: 8px;
}

.password-reset-form input {
  width: 150px;
  min-height: 36px;
  padding: 8px 10px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--jade);
  font-size: 0.82rem;
  text-transform: uppercase;
}

td {
  color: var(--text);
}

td span {
  display: block;
  margin-top: 4px;
  color: var(--soft);
  font-size: 0.86rem;
}

.solo-hero {
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.solo-setup-grid {
  margin-top: 42px;
}

.character-builder-form {
  gap: 18px;
}

.character-builder-section {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.character-builder-section legend {
  padding: 0 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.character-builder-mode-row {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 10px;
}

.character-builder-mode-row label {
  min-width: min(100%, 290px);
}

.character-builder-mode-row .form-hint {
  margin: 0 0 9px;
}

.character-builder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.character-builder-grid .full {
  grid-column: 1 / -1;
}

.ability-assignment-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.ability-assignment-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
  text-align: center;
}

.ability-assignment-grid label span {
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.ability-assignment-grid select {
  min-width: 0;
  padding: 8px 4px;
  text-align: center;
}

.ability-assignment-grid small {
  color: var(--gold);
  font-weight: 900;
}

.character-builder-validation {
  margin: 12px 0 0;
  color: #e8a5a5;
  font-size: 0.82rem;
}

.character-builder-validation.is-valid {
  color: var(--jade);
}

.character-builder-info {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 11px 12px;
  border-left: 3px solid var(--gold);
  background: rgba(212, 166, 92, 0.08);
}

.character-builder-info strong {
  color: var(--text);
}

.character-builder-info span,
.character-builder-info p {
  margin: 0;
  color: var(--soft);
  font-size: 0.84rem;
}

.creation-skill-section {
  display: grid;
  gap: 12px;
}

.creation-skill-heading,
.creation-skill-summary-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.creation-skill-heading h3,
.creation-skill-heading p,
.creation-skill-summary-heading h3 {
  margin: 0;
}

.creation-skill-heading strong,
.creation-skill-summary-heading span {
  color: var(--gold);
  font-size: 0.78rem;
}

.creation-skill-picker label[hidden] {
  display: none;
}

.creation-skill-summary {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.creation-skill-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.creation-skill-row.is-background {
  border-left-color: var(--gold);
  background: rgba(240, 188, 94, 0.08);
}

.creation-skill-row.is-class {
  border-left-color: var(--jade);
}

.creation-skill-row em {
  color: inherit;
  font-style: normal;
}

.creation-spell-section {
  display: grid;
  gap: 12px;
}

.creation-spell-panel[hidden],
.creation-spell-section [hidden] {
  display: none;
}

.creation-spell-panel {
  display: grid;
  gap: 14px;
}

.creation-spell-panel-heading,
.creation-spell-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.creation-spell-panel-heading {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.creation-spell-panel-heading span,
.creation-spell-group-heading span {
  color: var(--soft);
  font-size: 0.78rem;
}

.creation-spell-group {
  display: grid;
  gap: 8px;
}

.creation-spell-group-heading h4 {
  margin: 0;
  color: var(--text);
}

.creation-spell-group-heading span.is-valid {
  color: var(--jade);
}

.creation-spell-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.14);
}

.creation-spell-tabs button {
  min-width: 0;
  min-height: 48px;
  border: 0;
  border-radius: 5px;
  padding: 7px 10px;
  background: transparent;
  color: var(--soft);
  font-size: 0.82rem;
}

.creation-spell-tabs button[aria-selected="true"] {
  background: rgba(212, 166, 92, 0.16);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(212, 166, 92, 0.34);
}

.creation-spell-tabs span {
  display: block;
  margin-top: 2px;
  color: inherit;
  font-size: 0.68rem;
  font-weight: 500;
}

.creation-spell-tabs span.is-valid {
  color: var(--jade);
}

.creation-spell-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.6fr);
  align-items: end;
  gap: 10px;
}

.creation-spell-toolbar label {
  display: grid;
  gap: 4px;
  color: var(--soft);
  font-size: 0.72rem;
}

.creation-spell-toolbar input {
  min-height: 38px;
}

.creation-spell-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.creation-spell-filters button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 5px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--soft);
  font-size: 0.74rem;
}

.creation-spell-filters button[aria-pressed="true"] {
  border-color: rgba(212, 166, 92, 0.48);
  background: rgba(212, 166, 92, 0.14);
  color: var(--text);
}

.creation-spell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 7px;
}

.creation-spell-tile {
  min-width: 0;
}

.creation-spell-tile-button {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 74px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  padding: 9px 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
}

.creation-spell-tile-button:hover,
.creation-spell-tile-button:focus-visible {
  border-color: rgba(212, 166, 92, 0.45);
  background: rgba(255, 255, 255, 0.065);
}

.creation-spell-tile.is-selected .creation-spell-tile-button {
  border-color: rgba(112, 208, 170, 0.52);
  background: rgba(112, 208, 170, 0.09);
}

.creation-spell-tile.is-unavailable .creation-spell-tile-button {
  opacity: 0.55;
}

.creation-spell-school-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: #44515b;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 900;
}

.creation-spell-school-icon[data-school="abjuration"] { background: #287f86; }
.creation-spell-school-icon[data-school="conjuration"] { background: #9a6a22; }
.creation-spell-school-icon[data-school="divination"] { background: #3b709d; }
.creation-spell-school-icon[data-school="enchantment"] { background: #a34f6b; }
.creation-spell-school-icon[data-school="evocation"] { background: #a54842; }
.creation-spell-school-icon[data-school="illusion"] { background: #72568f; }
.creation-spell-school-icon[data-school="necromancy"] { background: #536858; }
.creation-spell-school-icon[data-school="transmutation"] { background: #4f7d55; }

.creation-spell-tile-copy {
  display: block;
  min-width: 0;
}

.creation-spell-tile-copy strong,
.creation-spell-tile-copy small {
  display: block;
  overflow-wrap: anywhere;
}

.creation-spell-tile-copy strong {
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.25;
}

.creation-spell-tile-copy small {
  margin-top: 3px;
  color: var(--soft);
  font-size: 0.66rem;
  line-height: 1.25;
}

.creation-spell-flags {
  position: absolute;
  right: 5px;
  bottom: 4px;
  display: flex;
  gap: 2px;
}

.creation-spell-flags i {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--soft);
  font-size: 0.56rem;
  font-style: normal;
}

.creation-spell-selected-mark {
  position: absolute;
  top: 4px;
  right: 5px;
  display: none;
  color: var(--jade);
  font-size: 0.76rem;
  font-weight: 900;
}

.creation-spell-tile.is-selected .creation-spell-selected-mark {
  display: block;
}

.creation-spell-filter-empty {
  margin: 8px 0 0;
  color: var(--soft);
  font-size: 0.8rem;
}

.creation-spell-dialog-title {
  display: flex;
  align-items: center;
  gap: 11px;
}

.creation-spell-dialog-title h2,
.creation-spell-dialog-title small {
  display: block;
  margin: 0;
}

.creation-spell-dialog-title small {
  margin-top: 2px;
  color: var(--soft);
}

.creation-spell-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
}

.creation-spell-detail-grid span {
  padding: 10px;
  background: var(--panel, #172026);
}

.creation-spell-detail-grid small,
.creation-spell-detail-grid strong {
  display: block;
}

.creation-spell-detail-grid small {
  color: var(--soft);
  font-size: 0.68rem;
}

.creation-spell-detail-grid strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 0.82rem;
}

.creation-spell-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.creation-spell-detail-badges span {
  border: 1px solid rgba(212, 166, 92, 0.34);
  border-radius: 4px;
  padding: 4px 7px;
  background: rgba(212, 166, 92, 0.1);
  color: var(--gold);
  font-size: 0.7rem;
}

.creation-spell-detail-description {
  margin: 0;
  color: var(--text);
  line-height: 1.65;
  white-space: pre-line;
}

.creation-spell-dialog-status {
  min-height: 20px;
  margin: 0;
  color: var(--soft);
  font-size: 0.78rem;
}

.creation-spell-dialog-toggle {
  width: 100%;
}

@media (max-width: 720px) {
  .creation-spell-panel-heading,
  .creation-spell-group-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .creation-spell-toolbar {
    grid-template-columns: 1fr;
  }

  .creation-spell-tabs {
    grid-template-columns: 1fr;
  }

  .creation-spell-tabs button {
    min-height: 42px;
  }

  .creation-spell-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .creation-spell-grid {
    grid-template-columns: 1fr;
  }
}

.character-builder-preview {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(212, 166, 92, 0.3);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(212, 166, 92, 0.12), rgba(255, 255, 255, 0.03));
}

.character-builder-preview h3,
.character-builder-preview p {
  margin: 0;
}

.character-builder-preview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.character-builder-preview-stats span {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
}

.character-builder-preview-stats small {
  color: var(--soft);
  font-size: 0.72rem;
}

.character-builder-preview-stats strong {
  color: var(--text);
}

.character-card-details {
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

.character-card-details summary {
  cursor: pointer;
  color: var(--gold);
  font-weight: 800;
}

.character-card-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.character-card-detail-grid span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
}

.character-card-detail-grid small,
.character-card-notes small {
  color: var(--soft);
}

.character-card-detail-grid strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.84rem;
}

.character-card-notes {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.character-card-notes p {
  margin: 0;
  color: var(--soft);
  font-size: 0.84rem;
}

.character-card-notes small {
  display: block;
  margin-bottom: 3px;
  font-weight: 800;
}

.solo-section-heading {
  margin-top: 0;
}

.solo-module-card {
  min-height: 0;
}

.solo-module-card form {
  margin-top: auto;
}

.solo-ready {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(112, 208, 170, 0.3);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--jade);
  background: rgba(112, 208, 170, 0.08);
  font-weight: 800;
}

.ability-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.ability-strip span {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  background: rgba(255, 255, 255, 0.045);
}

.ability-strip small,
.ability-strip strong,
.ability-strip em {
  display: block;
}

.ability-strip small {
  color: var(--soft);
  font-size: 0.72rem;
}

.ability-strip strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 1.12rem;
}

.ability-strip em {
  color: var(--gold);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
}

.solo-play-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 0 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.solo-header-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
}

.abandon-adventure-form {
  margin: 0;
}

.abandon-adventure-form .danger-action {
  min-height: 42px;
  border-color: rgba(233, 131, 127, .5);
  color: #ffd0ce;
  background: rgba(233, 131, 127, .12);
}

.abandon-adventure-form .danger-action:hover:not(:disabled) {
  border-color: rgba(233, 131, 127, .8);
  background: rgba(233, 131, 127, .2);
}

.world-clock-card {
  min-width: 176px;
  border-left: 3px solid var(--gold);
  padding: 8px 12px;
  background: rgba(240, 188, 94, .08);
}

.world-clock-card .eyebrow {
  margin: 0;
}

.world-clock-card strong,
.world-clock-card span {
  display: block;
}

.world-clock-card strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1.15;
}

.world-clock-card span {
  margin-top: 4px;
  color: var(--gold);
  font-size: .72rem;
}

.solo-location-line {
  display: flex;
  align-items: center;
  gap: 7px;
}

.solo-location-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: #241a0d;
  background: var(--gold);
  font-size: .68rem;
  font-weight: 950;
}

.solo-play-header h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.solo-play-header p:not(.eyebrow),
.solo-character-line {
  margin: 10px 0 0;
  color: var(--muted);
}

.solo-notice {
  margin: 18px 0 0;
}

.solo-play-grid {
  display: grid;
  grid-template-columns: minmax(190px, 230px) minmax(0, 1fr) minmax(220px, 280px);
  align-items: start;
  gap: 20px;
  margin-top: 20px;
}

.solo-sidebar,
.solo-story,
.turn-feed {
  display: grid;
  gap: 16px;
}

.solo-sidebar {
  position: sticky;
  top: 92px;
}

.solo-people-column {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 92px;
  min-width: 0;
}

.solo-people-column .turn-log-panel {
  min-width: 0;
  padding: 12px;
}

.solo-people-column .turn-log-scroll {
  max-height: min(44vh, 430px);
}

.solo-people-column .turn-entry {
  padding: 10px;
}

.solo-people-column .turn-entry p {
  font-size: .78rem;
  line-height: 1.5;
}

.solo-sidebar .panel {
  padding: 16px;
}

.character-rail {
  text-align: left;
}

.character-rail-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: #241a0d;
  background: var(--gold);
  font-weight: 950;
}

.character-rail h2 {
  margin: 4px 0 0;
  font-size: 1.12rem;
}

.character-rail-vitals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 14px 0;
}

.character-rail-vitals span {
  padding: 8px;
  border-left: 3px solid var(--jade);
  background: rgba(112, 208, 170, .06);
}

.character-rail-vitals small,
.character-rail-vitals strong {
  display: block;
}

.character-rail-vitals small {
  color: var(--muted);
  font-size: .68rem;
}

.character-rail-vitals strong {
  margin-top: 3px;
  font-size: .92rem;
}

.character-status-button {
  width: 100%;
  min-height: 40px;
  border-color: var(--gold);
  color: #241a0d;
  background: var(--gold);
  font-weight: 900;
}

.character-status-button:hover,
.character-status-button:focus-visible {
  background: #f6d28a;
}

.character-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.character-tool-button {
  display: grid;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid rgba(240, 188, 94, .3);
  border-radius: 8px;
  color: var(--text);
  background: rgba(240, 188, 94, .07);
  text-align: left;
}

.character-tool-button strong,
.character-tool-button span {
  display: block;
}

.character-tool-button strong {
  font-size: .84rem;
}

.character-tool-button span {
  margin-top: 4px;
  color: var(--muted);
  font-size: .68rem;
}

.character-tool-button:hover,
.character-tool-button:focus-visible {
  border-color: var(--gold);
  background: rgba(240, 188, 94, .14);
}

.solo-sidebar h2 {
  margin: 4px 0 0;
}

.solo-sidebar p {
  color: var(--muted);
  line-height: 1.65;
}

.solo-vitals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.solo-vitals span {
  border-left: 3px solid var(--jade);
  padding: 8px 10px;
  background: rgba(112, 208, 170, 0.06);
}

.solo-vitals small,
.solo-vitals strong {
  display: block;
}

.solo-vitals small {
  color: var(--soft);
}

.solo-vitals strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 1.12rem;
}

.ability-strip.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.solo-table {
  min-width: 0;
}

.scene-panel {
  border-left: 4px solid var(--gold);
  padding: 20px 22px;
  background: rgba(240, 188, 94, 0.07);
}

.scene-kicker {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
}

.scene-panel h2 {
  margin: 5px 0 0;
  font-size: 1.55rem;
  letter-spacing: 0;
}

.scene-panel p,
.turn-entry p,
.action-console p {
  color: var(--muted);
  line-height: 1.85;
  white-space: pre-wrap;
}

.world-map-panel {
  overflow: hidden;
}

.world-map-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.world-map-heading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.world-map-mode-form {
  margin: 0;
}

.world-map-mode-form button {
  min-height: 34px;
  padding: 6px 10px;
  white-space: nowrap;
}

.world-map-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 7px;
  color: var(--soft);
  background: rgba(255, 255, 255, .05);
  font-size: .75rem;
  white-space: nowrap;
}

.world-map-toggle:hover,
.world-map-toggle:focus-visible {
  border-color: rgba(240, 188, 94, .58);
  color: var(--gold);
}

.world-map-toggle-icon {
  color: var(--gold);
  font-size: 1rem;
  line-height: 1;
}

.world-map-panel.is-collapsed .world-map-heading {
  margin-bottom: 0;
}

.world-map-heading h2 {
  margin: 4px 0 0;
}

.world-map-heading p:not(.eyebrow) {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.world-map-current {
  flex: 0 0 auto;
  border: 1px solid rgba(240, 188, 94, .35);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--gold);
  background: rgba(240, 188, 94, .08);
  font-size: .75rem;
  font-weight: 900;
}

.world-map-viewport {
  position: relative;
  height: clamp(330px, 32vw, 460px);
  min-height: 330px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  touch-action: none;
  cursor: grab;
  background: rgba(10, 16, 24, .72);
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.world-map-viewport * {
  -webkit-user-drag: none;
}

.world-map-viewport.is-dragging {
  cursor: grabbing;
}

.world-map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background-color: rgba(10, 16, 24, .72);
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 36px 36px;
  transform-origin: 0 0;
  will-change: transform;
}

.world-map-canvas:not(.global-world-map-canvas) {
  right: auto;
  bottom: auto;
  width: 1500px;
  height: 900px;
  max-width: none;
  max-height: none;
}

.global-world-map-viewport {
  height: clamp(380px, 36vw, 520px);
  min-height: 380px;
}

.global-world-map-canvas {
  right: auto;
  bottom: auto;
  width: 2400px;
  height: 1400px;
  max-width: none;
  max-height: none;
  min-height: 0;
  aspect-ratio: auto;
  background-color: rgba(12, 28, 36, .82);
  background-image: linear-gradient(rgba(117, 218, 193, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(117, 218, 193, .055) 1px, transparent 1px);
  background-size: 48px 48px;
}

.global-world-map .world-map-node {
  width: 132px;
}

.dense-region-map-canvas {
  width: 2400px;
  height: 1600px;
  max-width: none;
  max-height: none;
}

.dense-city-map-canvas {
  width: 3000px;
  height: 2200px;
  max-width: none;
  max-height: none;
}

.world-map-controls {
  position: absolute;
  z-index: 12;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: rgba(10, 16, 24, .88);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
}

.world-map-compass {
  position: absolute;
  z-index: 12;
  top: 12px;
  left: 12px;
  width: 62px;
  height: 62px;
  border: 1px solid rgba(240, 188, 94, .38);
  border-radius: 50%;
  color: #f1d59d;
  background: rgba(22, 20, 17, .86);
  box-shadow: 0 5px 14px rgba(0, 0, 0, .28);
  pointer-events: none;
}

.world-map-compass span {
  position: absolute;
  font-size: .62rem;
  font-weight: 900;
  line-height: 1;
}

.world-map-compass .north { top: 5px; left: 50%; transform: translateX(-50%); }
.world-map-compass .east { top: 50%; right: 5px; transform: translateY(-50%); }
.world-map-compass .south { bottom: 5px; left: 50%; transform: translateX(-50%); }
.world-map-compass .west { top: 50%; left: 5px; transform: translateY(-50%); }

.world-map-compass i {
  position: absolute;
  top: 20px;
  left: 26px;
  width: 8px;
  height: 20px;
  background: linear-gradient(to bottom, var(--orange) 0 50%, rgba(194, 214, 222, .76) 50% 100%);
  clip-path: polygon(50% 0, 100% 50%, 64% 50%, 64% 100%, 36% 100%, 36% 50%, 0 50%);
}

.world-map-controls button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 5px;
  color: var(--soft);
  background: rgba(255, 255, 255, .06);
  font-size: 1rem;
  line-height: 1;
}

.world-map-controls button:hover,
.world-map-controls button:focus-visible {
  border-color: rgba(240, 188, 94, .62);
  color: var(--gold);
}

.world-map-controls input[type="range"] {
  width: 128px;
  min-width: 0;
  height: 18px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: ew-resize;
  accent-color: var(--gold);
}

.world-map-controls input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
}

.world-map-controls input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: #101923;
  box-shadow: 0 0 0 2px rgba(240, 188, 94, .14);
  appearance: none;
  -webkit-appearance: none;
}

.world-map-controls input[type="range"]::-moz-range-track {
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
}

.world-map-controls input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: #101923;
  box-shadow: 0 0 0 2px rgba(240, 188, 94, .14);
}

.world-map-canvas svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.map-terrain-layer,
.map-road-layer,
.map-river-layer,
.map-bridge-layer {
  pointer-events: none;
}

.map-terrain {
  vector-effect: non-scaling-stroke;
}

.map-terrain-water {
  fill: rgba(20, 74, 92, .72);
  stroke: rgba(83, 154, 174, .72);
  stroke-width: 1.4;
}

.map-terrain-river-bank,
.map-terrain-river {
  fill: none;
  vector-effect: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-terrain-river-bank {
  stroke: rgba(93, 150, 155, .72);
  stroke-width: calc(var(--terrain-width, 5) + 1.2);
}

.map-terrain-river {
  stroke: rgba(35, 104, 124, .82);
  stroke-width: var(--terrain-width, 5);
}

.map-terrain-wall {
  fill: none;
  stroke: rgba(160, 148, 126, .78);
  stroke-width: var(--terrain-width, 1.5);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-terrain-hill {
  fill: rgba(95, 111, 72, .3);
  stroke: rgba(146, 158, 104, .55);
  stroke-width: 1.2;
}

.map-terrain-green {
  fill: rgba(47, 105, 73, .27);
  stroke: rgba(93, 151, 104, .48);
  stroke-width: 1.1;
}

.map-terrain-marsh {
  fill: rgba(54, 103, 91, .3);
  stroke: rgba(91, 153, 132, .56);
  stroke-width: 1.1;
  stroke-dasharray: 5 4;
}

.map-terrain-ruins {
  fill: rgba(118, 101, 84, .24);
  stroke: rgba(171, 147, 113, .5);
  stroke-width: 1.1;
  stroke-dasharray: 4 3;
}

.map-terrain-district {
  fill: rgba(176, 123, 69, .12);
  stroke: rgba(229, 178, 107, .68);
  stroke-width: 1.1;
  stroke-dasharray: 5 3;
}

.map-terrain-district.zone-civic,
.map-terrain-district.zone-affluent,
.map-terrain-district.zone-dock,
.map-terrain-district.zone-poor,
.map-terrain-district.zone-artisan,
.map-terrain-district.zone-mining {
  fill: rgba(176, 123, 69, .12);
  stroke: rgba(229, 178, 107, .68);
}

.map-terrain-cliff {
  fill: none;
  stroke: rgba(166, 151, 127, .78);
  stroke-width: var(--terrain-width, 2.2);
  stroke-linecap: round;
  stroke-dasharray: 3 2;
}

.map-terrain-cavern {
  fill: rgba(80, 83, 91, .22);
  stroke: rgba(148, 143, 132, .62);
  stroke-width: 1.8;
}

.map-terrain-chasm {
  fill: none;
  stroke: rgba(87, 70, 91, .74);
  stroke-width: var(--terrain-width, 7);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-terrain-label {
  position: absolute;
  z-index: 7;
  transform: translate(-50%, -50%);
  color: rgba(208, 221, 220, .72);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: 0;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(8, 13, 18, .95);
  white-space: nowrap;
}

.map-terrain-label-district {
  padding: 3px 7px;
  border: 1px solid rgba(240, 188, 94, .5);
  border-radius: 2px;
  color: #f4d9a4;
  background: rgba(38, 28, 18, .9);
  box-shadow: 0 2px 7px rgba(5, 9, 13, .48);
  text-shadow: 0 1px 2px rgba(8, 13, 18, .95);
}

.map-terrain-label-water,
.map-terrain-label-river {
  color: rgba(139, 203, 215, .82);
}

.world-map-structure {
  position: absolute;
  z-index: 2;
  width: var(--structure-width, 2.8%);
  height: var(--structure-height, 2.2%);
  transform: translate(-50%, -50%);
  border: 1px solid rgba(155, 148, 132, .5);
  border-radius: 2px;
  background: rgba(72, 73, 70, .9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035), 0 2px 4px rgba(5, 9, 13, .28);
  pointer-events: none;
}

.world-map-structure::after {
  content: "";
  position: absolute;
  inset: 18% 12%;
  border-top: 1px solid rgba(225, 218, 196, .15);
  border-bottom: 1px solid rgba(8, 13, 18, .2);
}

.world-map-structure.zone-affluent,
.world-map-structure.zone-civic,
.world-map-building.zone-affluent .world-map-building-button,
.world-map-building.zone-civic .world-map-building-button {
  border-color: rgba(185, 176, 150, .62);
  background: rgba(91, 88, 79, .94);
}

.world-map-structure.zone-poor,
.world-map-building.zone-poor .world-map-building-button {
  border-color: rgba(124, 116, 104, .42);
  background: rgba(58, 60, 59, .9);
}

.world-map-structure.zone-dock,
.world-map-building.zone-dock .world-map-building-button {
  border-color: rgba(112, 139, 142, .5);
  background: rgba(60, 76, 77, .92);
}

.world-map-structure.zone-artisan,
.world-map-structure.zone-mining,
.world-map-building.zone-artisan .world-map-building-button,
.world-map-building.zone-mining .world-map-building-button {
  border-color: rgba(157, 135, 108, .52);
  background: rgba(76, 69, 61, .93);
}

.world-map-structure.zone-academic,
.world-map-structure.zone-religious,
.world-map-building.zone-academic .world-map-building-button,
.world-map-building.zone-religious .world-map-building-button {
  border-color: rgba(142, 153, 164, .58);
  background: rgba(70, 75, 80, .94);
}

.world-map-structure.zone-rural,
.world-map-building.zone-rural .world-map-building-button {
  border-color: rgba(126, 143, 104, .48);
  background: rgba(67, 76, 61, .9);
}

.world-map-structure.zone-underdark,
.world-map-building.zone-underdark .world-map-building-button {
  border-color: rgba(123, 109, 133, .5);
  background: rgba(62, 58, 67, .92);
}

.world-map-path {
  fill: none;
  stroke: rgba(194, 214, 222, .52);
  stroke-width: 1.5;
  stroke-dasharray: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.world-map-path.is-city-street {
  stroke: rgba(194, 214, 222, .52);
  stroke-width: 1.5;
}

.world-map-path.is-building-access {
  stroke: rgba(194, 214, 222, .52);
  stroke-width: 1.5;
}

.world-map-path.is-bridge {
  stroke: rgba(214, 195, 154, .9);
  stroke-width: 3.2;
}

.world-map-path.is-world-exit {
  stroke: rgba(240, 188, 94, .82);
  stroke-width: 2.2;
}

.world-map-path.is-available {
  stroke: var(--gold);
  stroke-width: 2.2;
  stroke-dasharray: none;
}

.world-map-path.is-bridge.is-available {
  stroke-width: 3.6;
}

.world-map-path-label {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  padding: 2px 5px;
  color: var(--soft);
  background: rgba(10, 16, 24, .85);
  font-size: .65rem;
  white-space: nowrap;
}

.world-map-path-label.is-available {
  color: var(--gold);
}

.world-map-node {
  position: absolute;
  z-index: 3;
  width: 136px;
  margin: 0;
  transform: translate(-50%, -50%);
}

.world-map-node button {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 48px;
  gap: 5px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  color: var(--soft);
  background: rgba(18, 24, 32, .94);
  text-align: left;
}

.world-map-node button strong,
.world-map-node button small {
  grid-column: 2;
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.2;
}

.world-map-node button strong {
  color: var(--text);
  font-size: .75rem;
}

.world-map-node button small {
  color: var(--muted);
  font-size: .63rem;
}

.world-map-node::after,
.world-map-junction::after,
.world-map-building::after,
.world-map-landmark::after {
  content: "坐标 " attr(data-map-coordinate);
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 50%;
  padding: 4px 6px;
  visibility: hidden;
  border: 1px solid rgba(240, 188, 94, .42);
  border-radius: 4px;
  color: #f1d59d;
  background: rgba(10, 16, 24, .96);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .32);
  font-size: .62rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  opacity: 0;
  transform: translate(-50%, -2px);
  transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
  white-space: nowrap;
  pointer-events: none;
}

.world-map-node:hover,
.world-map-node:focus-within,
.world-map-junction:hover,
.world-map-junction:focus-within,
.world-map-building:hover,
.world-map-building:focus-within,
.world-map-landmark:hover,
.world-map-landmark:focus-within {
  z-index: 19;
}

.world-map-node:hover::after,
.world-map-node:focus-within::after,
.world-map-junction:hover::after,
.world-map-junction:focus-within::after,
.world-map-building:hover::after,
.world-map-building:focus-within::after,
.world-map-landmark:hover::after,
.world-map-landmark:focus-within::after {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}

.world-map-node-dot {
  grid-row: 1 / span 2;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
}

.world-map-player-icon {
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: #241a0d;
  background: var(--gold);
  font-size: .64rem;
  font-weight: 950;
}

.world-map-player-dot {
  display: block;
  grid-row: 1 / span 2;
  place-self: center;
  width: 11px;
  height: 11px;
  border: 2px solid #ffd0a2;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(242, 138, 67, .2), 0 0 12px rgba(242, 138, 67, .72);
}

.world-map-landmark {
  position: absolute;
  z-index: 6;
  width: 22px;
  height: 22px;
  margin: 0;
  transform: translate(-50%, -50%);
}

.world-map-landmark-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(229, 178, 107, .62);
  border-radius: 50%;
  color: var(--soft);
  background: rgba(25, 25, 23, .9);
  box-shadow: 0 0 0 2px rgba(229, 178, 107, .08);
}

.world-map-landmark-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(229, 178, 107, .78);
}

.world-map-landmark-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  transform: translateX(-50%);
  color: #f1dfbc;
  font-size: .68rem;
  line-height: 1.1;
  text-shadow: 0 1px 3px rgba(5, 9, 13, .98), 0 0 5px rgba(5, 9, 13, .9);
  white-space: nowrap;
  pointer-events: none;
}

.world-map-landmark.is-available .world-map-landmark-button {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240, 188, 94, .14);
  cursor: pointer;
}

.world-map-landmark.is-current .world-map-landmark-button {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(242, 138, 67, .18);
}

.world-map-landmark.is-world-exit .world-map-landmark-button {
  border-color: rgba(240, 188, 94, .88);
  background: rgba(55, 39, 20, .94);
  box-shadow: 0 0 0 3px rgba(240, 188, 94, .16);
}

.world-map-landmark.is-world-exit .world-map-landmark-label {
  color: #f4cf86;
}

.world-map-landmark.is-locked {
  opacity: .72;
}

.world-map-junction {
  position: absolute;
  z-index: 4;
  width: 20px;
  height: 20px;
  margin: 0;
  transform: translate(-50%, -50%);
}

.world-map-junction-button {
  display: grid;
  place-items: center;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: 1px solid rgba(194, 214, 222, .66);
  border-radius: 50%;
  background: rgba(15, 22, 30, .72);
}

.world-map-junction-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(194, 214, 222, .82);
}

.world-map-junction.is-available .world-map-junction-button {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(240, 188, 94, .12);
  cursor: pointer;
}

.world-map-junction.is-available .world-map-junction-dot {
  background: var(--gold);
}

.world-map-junction.is-current .world-map-junction-button {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(242, 138, 67, .16);
}

.world-map-junction.is-locked {
  opacity: .7;
}

.world-map-building {
  position: absolute;
  z-index: 5;
  width: var(--building-width, 7.5%);
  height: var(--building-height, 5.5%);
  margin: 0;
  transform: translate(-50%, -50%);
}

.world-map-building-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 3px 5px;
  overflow: visible;
  border: 1px solid rgba(155, 148, 132, .5);
  border-radius: 2px;
  color: var(--soft);
  background: rgba(72, 73, 70, .9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035), 0 2px 4px rgba(5, 9, 13, .28);
  text-align: center;
}

.world-map-building-button::after {
  content: "";
  position: absolute;
  inset: 18% 12%;
  border-top: 1px solid rgba(225, 218, 196, .15);
  border-bottom: 1px solid rgba(8, 13, 18, .2);
  pointer-events: none;
}

.world-map-building-button strong {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  color: var(--text);
  font-size: .66rem;
  line-height: 1.1;
  overflow: visible;
  text-align: center;
  white-space: nowrap;
}

.world-map-building .world-map-player-dot {
  position: absolute;
  z-index: 2;
  top: -6px;
  right: -6px;
}

.world-map-building.is-available .world-map-building-button {
  border-color: rgba(240, 188, 94, .68);
  cursor: pointer;
}

.world-map-building.is-current .world-map-building-button {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(242, 138, 67, .16);
}

.world-map-building.is-locked .world-map-building-button {
  opacity: .82;
}

.world-map-node.is-current button {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(242, 138, 67, .16);
}

.world-map-node.is-current .world-map-node-dot,
.world-map-node.is-available .world-map-node-dot {
  color: var(--gold);
  background: var(--gold);
}

.world-map-node.is-available button {
  border-color: rgba(240, 188, 94, .48);
  cursor: pointer;
}

.world-map-node.is-visited button {
  border-color: rgba(112, 208, 170, .3);
}

.world-map-node.is-locked button {
  opacity: .62;
}

.world-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: .72rem;
}

.world-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.map-legend-dot {
  width: 9px;
  height: 9px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.map-legend-dot.current {
  border-color: var(--orange);
  background: var(--orange);
}

.map-legend-dot.available {
  border-color: var(--gold);
}

.map-legend-dot.visited {
  border-color: var(--jade);
}

.scene-stage {
  display: block;
}

.scene-npc-sidebar {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
}

.scene-npc-sidebar .panel-heading {
  margin-bottom: 0;
}

.scene-npc-sidebar h2 {
  margin: 4px 0 0;
}

.scene-npc-list {
  display: grid;
  gap: 10px;
}

.scene-people-list {
  display: grid;
  gap: 8px;
}

.scene-person-button {
  display: grid;
  width: 100%;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid rgba(240, 188, 94, .3);
  border-radius: 8px;
  color: var(--text);
  background: rgba(240, 188, 94, .06);
  text-align: left;
}

.scene-person-button strong,
.scene-person-button small {
  display: block;
}

.scene-person-button strong {
  font-size: .85rem;
}

.scene-person-button small {
  margin-top: 4px;
  color: var(--muted);
  font-size: .68rem;
}

.scene-person-button:hover,
.scene-person-button:focus-visible {
  border-color: var(--gold);
  background: rgba(240, 188, 94, .14);
}

.npc-dialog-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.npc-profile-collapsible {
  margin: 14px 0 0;
  border: 1px solid rgba(240, 188, 94, .22);
  border-radius: 6px;
  background: rgba(240, 188, 94, .035);
}

.npc-profile-collapsible > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 9px 12px;
  cursor: pointer;
  list-style: none;
  color: var(--gold);
  font-size: .78rem;
  font-weight: 700;
}

.npc-profile-collapsible > summary::-webkit-details-marker {
  display: none;
}

.npc-profile-collapsible > summary::after {
  content: "+";
  color: var(--muted);
  font-size: 1rem;
  font-weight: 400;
}

.npc-profile-collapsible[open] > summary::after {
  content: "−";
}

.npc-profile-collapsible > summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 400;
}

.npc-profile-collapsible[open] .npc-role-card {
  margin: 0;
  border-width: 1px 0 0;
  border-radius: 0;
}

.npc-dialog-relation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  background: rgba(240, 188, 94, .07);
}

.npc-dialog-relation span {
  color: var(--muted);
  font-size: .78rem;
}

.npc-dialog-relation strong {
  color: var(--gold);
  font-size: .8rem;
}

.npc-info-dialog {
  width: min(720px, calc(100vw - 24px));
}

.npc-dialogue-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: -4px 0 14px;
}

.npc-topic-button {
  min-height: 32px;
  padding: 6px 10px;
  border-color: rgba(255, 255, 255, .14);
  color: var(--muted);
  background: rgba(255, 255, 255, .035);
  font-size: .74rem;
}

.npc-dialogue-thread {
  min-height: 180px;
  max-height: min(340px, 42vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 -4px 14px;
  border-top: 1px solid rgba(255, 255, 255, .09);
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  padding: 14px 4px;
  scrollbar-color: rgba(240, 188, 94, .5) rgba(255, 255, 255, .04);
}

.npc-dialogue-empty {
  margin: 58px 0;
  color: var(--muted);
  text-align: center;
}

.npc-dialogue-exchange {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.npc-dialogue-exchange:last-child {
  margin-bottom: 0;
}

.npc-dialogue-bubble {
  width: fit-content;
  max-width: 86%;
  border: 1px solid rgba(255, 255, 255, .1);
  padding: 9px 11px;
  background: rgba(255, 255, 255, .045);
}

.npc-dialogue-bubble.player {
  justify-self: end;
  border-color: rgba(96, 174, 214, .3);
  background: rgba(56, 128, 166, .12);
}

.npc-dialogue-bubble.npc {
  justify-self: start;
  border-color: rgba(240, 188, 94, .28);
  background: rgba(240, 188, 94, .07);
}

.npc-dialogue-bubble small,
.npc-dialogue-bubble em {
  display: block;
  color: var(--muted);
  font-size: .7rem;
  font-style: normal;
}

.npc-dialogue-bubble p {
  margin: 5px 0 0;
  line-height: 1.65;
  white-space: pre-wrap;
}

.npc-dialogue-bubble em {
  margin-top: 7px;
  color: rgba(231, 236, 242, .68);
}

.npc-role-card {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(240, 188, 94, .22);
  border-radius: 6px;
  background: rgba(240, 188, 94, .045);
}

.npc-role-card-heading,
.npc-role-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.npc-role-card-heading h3,
.npc-role-card-heading p {
  margin: 0;
}

.npc-role-card-heading > span {
  color: var(--gold);
  font-size: .75rem;
}

.npc-role-card-meta {
  justify-content: flex-start;
  color: var(--muted);
  font-size: .75rem;
}

.npc-card-copy {
  display: grid;
  gap: 3px;
}

.npc-card-copy small,
.npc-card-details small {
  color: var(--muted);
  font-size: .7rem;
}

.npc-card-copy p,
.npc-card-details p {
  margin: 0;
  color: rgba(231, 236, 242, .86);
  font-size: .8rem;
  line-height: 1.6;
}

.npc-card-details summary {
  cursor: pointer;
  color: var(--gold);
  font-size: .76rem;
}

.npc-ability-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  margin: 10px 0;
}

.npc-ability-grid span {
  display: grid;
  gap: 2px;
  padding: 6px 4px;
  border: 1px solid rgba(255, 255, 255, .1);
  text-align: center;
}

.npc-ability-grid small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.npc-ability-grid strong {
  color: var(--text);
  font-size: .86rem;
}

.npc-dialogue-check {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: min(92%, 520px);
  justify-self: center;
  border: 1px solid rgba(255, 255, 255, .12);
  padding: 7px 10px;
  color: var(--muted);
  background: rgba(8, 11, 16, .42);
  font-size: .72rem;
}

.npc-dialogue-check.success {
  border-color: rgba(112, 208, 170, .38);
  color: var(--jade);
}

.npc-dialogue-check.failure {
  border-color: rgba(233, 131, 127, .38);
  color: var(--rose);
}

.npc-dialogue-transfers {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.npc-dialogue-transfer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 6px;
  color: var(--muted);
  font-size: .74rem;
  background: rgba(255, 255, 255, .035);
}

.npc-dialogue-transfer.completed {
  border-color: rgba(112, 208, 170, .38);
  color: var(--jade);
}

.npc-dialogue-transfer.requested {
  border-color: rgba(240, 188, 94, .38);
  color: var(--gold);
}

.npc-dialogue-transfer.rejected {
  border-color: rgba(233, 131, 127, .38);
  color: var(--rose);
}

.npc-dialogue-transfer button {
  min-height: 28px;
  padding: 4px 9px;
  font-size: .7rem;
}

.npc-dialogue-form {
  display: grid;
  gap: 10px;
}

.npc-intent-control {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.npc-intent-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 38px;
  padding: 6px 7px;
  border-color: rgba(255, 255, 255, .12);
  color: var(--muted);
  background: rgba(255, 255, 255, .035);
  font-size: .75rem;
}

.npc-intent-button small {
  color: var(--gold);
  font-size: .6rem;
}

.npc-intent-button.is-active {
  border-color: rgba(240, 188, 94, .58);
  color: var(--text);
  background: rgba(240, 188, 94, .13);
}

.npc-dialogue-input {
  display: grid;
  gap: 5px;
}

.npc-dialogue-input span {
  color: var(--muted);
  font-size: .72rem;
}

.npc-dialogue-input textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
}

.npc-dialogue-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.npc-dialogue-submit button {
  min-width: 92px;
}

.npc-dialogue-error {
  margin: 0;
  color: var(--rose);
  font-size: .76rem;
}

.npc-trade-button {
  width: 100%;
  margin: -6px 0 14px;
  border-color: rgba(112, 208, 170, .45);
  color: var(--jade);
  background: rgba(112, 208, 170, .08);
}

.trade-dialog {
  width: min(920px, calc(100vw - 24px));
  max-height: min(820px, calc(100vh - 24px));
}

.trade-summary,
.trade-tabs,
.trade-item-row,
.trade-item-row form,
.trade-item-row label {
  display: flex;
  align-items: center;
}

.trade-summary {
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  color: var(--muted);
  background: rgba(240, 188, 94, .07);
  font-size: .78rem;
}

.trade-summary strong {
  margin-left: 5px;
  color: var(--gold);
  font-size: .92rem;
}

.trade-tabs {
  gap: 0;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .11);
}

.trade-tabs button {
  min-width: 92px;
  min-height: 38px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
}

.trade-tabs button.is-active {
  border-bottom-color: var(--gold);
  color: var(--text);
  background: rgba(240, 188, 94, .06);
}

.trade-message {
  min-height: 20px;
  margin: 6px 0;
  color: var(--muted);
  font-size: .76rem;
}

.trade-message.is-success {
  color: var(--jade);
}

.trade-message.is-error {
  color: var(--rose);
}

.trade-pane {
  max-height: min(540px, 58vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(240, 188, 94, .5) rgba(255, 255, 255, .04);
}

.trade-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px 190px;
  gap: 14px;
  min-height: 88px;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.trade-item-row.is-sold-out {
  opacity: .55;
}

.trade-item-copy {
  min-width: 0;
}

.trade-item-copy > span {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.trade-item-copy strong,
.trade-item-copy small {
  display: block;
}

.trade-item-copy strong {
  color: var(--text);
  font-size: .88rem;
}

.trade-item-copy small,
.trade-item-copy p,
.trade-item-price small {
  color: var(--muted);
  font-size: .7rem;
}

.trade-item-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 5px 0 0;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.trade-item-price {
  display: grid;
  align-content: center;
  gap: 3px;
}

.trade-item-price strong {
  color: var(--gold);
  font-size: .86rem;
}

.trade-item-row form {
  justify-content: flex-end;
  gap: 7px;
}

.trade-item-row label {
  gap: 5px;
  color: var(--muted);
  font-size: .68rem;
}

.trade-item-row input {
  width: 58px;
  min-height: 36px;
  padding: 6px;
}

.trade-item-row form button {
  min-width: 66px;
  min-height: 36px;
  padding: 6px 10px;
}

.scene-npc-card {
  border-left: 3px solid var(--gold);
  padding: 10px 11px;
  background: rgba(240, 188, 94, .055);
}

.scene-npc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.scene-npc-head strong,
.scene-npc-head small {
  display: block;
}

.scene-npc-head strong {
  color: var(--text);
  font-size: .88rem;
}

.scene-npc-head small,
.scene-npc-head span {
  color: var(--muted);
  font-size: .68rem;
}

.scene-npc-head span {
  flex: 0 0 auto;
  color: var(--gold);
  text-align: right;
}

.scene-npc-card p {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.6;
}

.scene-npc-actions {
  display: grid;
  gap: 6px;
}

.scene-npc-actions form {
  margin: 0;
}

.scene-npc-actions button {
  width: 100%;
  min-height: 32px;
  padding: 5px 7px;
  font-size: .72rem;
  text-align: left;
}

.turn-log-panel {
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  padding: 14px;
  background: rgba(23, 27, 36, .58);
}

.turn-log-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.turn-log-heading h2 {
  margin: 3px 0 0;
  font-size: 1.05rem;
}

.turn-log-heading > span {
  color: var(--muted);
  font-size: .72rem;
}

.turn-log-scroll {
  max-height: 390px;
  overflow-y: scroll;
  padding-right: 9px;
  scrollbar-color: var(--gold) rgba(255, 255, 255, .08);
  scrollbar-gutter: stable;
}

.turn-log-scroll::-webkit-scrollbar {
  width: 10px;
}

.turn-log-scroll::-webkit-scrollbar-track {
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
}

.turn-log-scroll::-webkit-scrollbar-thumb {
  border: 2px solid rgba(23, 27, 36, .9);
  border-radius: 8px;
  background: var(--gold);
}

.turn-entry {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 20px;
  background: rgba(23, 27, 36, 0.86);
}

.turn-entry.opening {
  border-color: rgba(240, 188, 94, 0.3);
}

.turn-entry p {
  margin: 14px 0 0;
}

.dice-result {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.dice-result.success {
  border-color: rgba(112, 208, 170, 0.38);
  color: var(--jade);
}

.dice-result.failure {
  border-color: rgba(233, 131, 127, 0.38);
  color: var(--rose);
}

.action-console {
  border: 1px solid rgba(112, 208, 170, 0.3);
  border-radius: 8px;
  padding: 20px;
  background: rgba(112, 208, 170, 0.07);
}

.primary-action-console {
  border-width: 2px;
  border-color: rgba(240, 188, 94, .55);
  background: rgba(240, 188, 94, .09);
  box-shadow: 0 12px 28px rgba(12, 14, 20, .18);
}

.primary-action-console h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
}

.action-scene-summary {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.action-scene-summary h2 {
  margin: 4px 0 8px;
}

.action-scene-summary p:not(.eyebrow) {
  max-width: 72ch;
  margin: 0;
  color: var(--soft);
  line-height: 1.75;
}

.scene-action-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 22px;
  align-items: start;
  margin-top: 18px;
}

.scene-action-columns.only-movement {
  grid-template-columns: minmax(220px, 280px);
  justify-content: end;
}

.scene-movement-control {
  min-width: 0;
  padding-left: 20px;
  border-left: 1px solid rgba(255, 255, 255, .1);
}

.scene-movement-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.scene-movement-heading h3 {
  margin: 4px 0 0;
  font-size: 1rem;
}

.scene-movement-heading > span {
  color: var(--muted);
  font-size: .78rem;
}

.scene-direction-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(64px, 88px));
  grid-template-rows: repeat(3, minmax(64px, auto));
  grid-template-areas: ". up ." "left center right" ". down .";
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 12px;
}

.scene-direction-form {
  min-width: 0;
  margin: 0;
}

.scene-direction-form.up {
  grid-area: up;
}

.scene-direction-form.left {
  grid-area: left;
}

.scene-direction-form.right {
  grid-area: right;
}

.scene-direction-form.down {
  grid-area: down;
}

.scene-direction-button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 100%;
  min-height: 64px;
  gap: 4px;
  padding: 8px 6px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, .04);
}

.scene-direction-button.is-available {
  border-color: rgba(240, 188, 94, .42);
  color: var(--gold);
  background: rgba(240, 188, 94, .1);
}

.scene-direction-button.is-available:hover,
.scene-direction-button.is-available:focus-visible {
  border-color: var(--gold);
  background: rgba(240, 188, 94, .18);
}

.scene-direction-arrow {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.scene-direction-button small {
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: .62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-direction-center {
  display: grid;
  grid-area: center;
  place-items: center;
  min-height: 64px;
  border: 1px solid rgba(112, 208, 170, .28);
  border-radius: 8px;
  color: var(--jade);
  background: rgba(112, 208, 170, .07);
  font-size: .7rem;
  font-weight: 800;
  text-align: center;
}

.action-recommendations {
  margin-top: 18px;
}

.scene-action-columns .action-recommendations {
  margin-top: 0;
}

.action-recommendations-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.action-recommendations-heading h3 {
  margin: 4px 0 0;
  font-size: 1rem;
}

.action-recommendations-heading > span {
  color: var(--muted);
  font-size: .78rem;
}

.action-state-note {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(233, 131, 127, .34);
  border-radius: 8px;
  background: rgba(233, 131, 127, .08);
}

.action-state-note h3 {
  margin: 4px 0 6px;
}

.action-state-note p:last-child {
  margin-bottom: 0;
  color: var(--soft);
}

.primary-action-console .suggested-actions {
  margin-top: 18px;
}

.primary-action-console .action-recommendations .suggested-actions button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  text-align: left;
  gap: 14px;
  width: 100%;
}

.primary-action-console .action-recommendations .suggested-actions {
  display: flex;
  flex-direction: column;
}

.primary-action-console .action-recommendations .suggested-actions form {
  width: 100%;
}

.primary-action-console .action-recommendations .suggested-actions button span {
  min-width: 0;
  font-weight: 800;
}

.recommendation-summary,
.recommendation-empty > p:last-child {
  margin: 10px 0 0;
  color: var(--soft);
  line-height: 1.6;
}

.primary-action-console .action-recommendations .suggested-actions button .recommendation-reason {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.45;
}

.primary-action-console .action-recommendations .suggested-actions button small.action-time {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: .75rem;
  font-weight: 800;
  white-space: nowrap;
}

.primary-action-console .suggested-actions button {
  border-color: rgba(240, 188, 94, .32);
  background: rgba(240, 188, 94, .12);
}

.action-result-console {
  border-color: rgba(112, 208, 170, .52);
  background: rgba(112, 208, 170, .08);
}

.action-result-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.action-result-heading h2 {
  margin: 4px 0 0;
}

.action-result-heading > span {
  color: var(--jade);
  font-size: .78rem;
  font-weight: 800;
}

.action-result-narrative {
  margin-top: 18px;
  color: var(--text);
  line-height: 1.8;
  white-space: pre-line;
}

.action-result-effects {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.action-result-effects ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.action-result-effects li {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(0, 1fr);
  gap: 12px;
  color: var(--soft);
}

.action-result-effects li span {
  color: var(--muted);
}

.action-result-effects li strong {
  font-weight: 650;
}

.action-result-confirm {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

.action-result-confirm button {
  min-width: 120px;
}

.solo-live-contents {
  display: contents;
}

.solo-action-result-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 28px));
  margin: auto;
  border: 0;
  padding: 0;
  overflow: visible;
  color: var(--text);
  background: transparent;
}

.solo-action-result-dialog::backdrop {
  background: rgba(5, 7, 10, .78);
  backdrop-filter: blur(3px);
}

.solo-action-result-dialog .action-result-console {
  max-height: min(820px, calc(100vh - 28px));
  margin: 0;
  overflow-y: auto;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .48);
}

.solo-async-status {
  position: fixed;
  z-index: 10000;
  top: 78px;
  right: 18px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 2px 10px;
  width: min(320px, calc(100vw - 36px));
  border: 1px solid rgba(240, 188, 94, .52);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(18, 21, 27, .97);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .36);
}

.solo-async-status > span {
  grid-row: 1 / 3;
  align-self: center;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(240, 188, 94, .3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: solo-request-spin .8s linear infinite;
}

.solo-async-status strong,
.solo-async-status small {
  min-width: 0;
}

.solo-async-status small {
  color: var(--muted);
}

.solo-request-pending {
  cursor: progress;
}

.async-ui-status {
  position: fixed;
  z-index: 10000;
  top: 78px;
  right: 18px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 2px 10px;
  width: min(320px, calc(100vw - 36px));
  border: 1px solid rgba(112, 208, 170, .48);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(18, 21, 27, .97);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .36);
}

.async-ui-status > span {
  grid-row: 1 / 3;
  align-self: center;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(112, 208, 170, .3);
  border-top-color: var(--jade);
  border-radius: 50%;
  animation: solo-request-spin .8s linear infinite;
}

.async-ui-status strong,
.async-ui-status small {
  min-width: 0;
}

.async-ui-status small {
  color: var(--muted);
}

.async-ui-pending {
  cursor: progress;
}

@keyframes solo-request-spin {
  to { transform: rotate(360deg); }
}

.solo-info-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  margin: auto;
  border: 1px solid rgba(240, 188, 94, .52);
  border-radius: 8px;
  padding: 22px;
  color: var(--text);
  background: rgba(19, 24, 33, .98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .48);
}

.solo-info-dialog::backdrop {
  background: rgba(5, 8, 13, .72);
  backdrop-filter: blur(3px);
}

.inventory-dialog {
  width: min(760px, calc(100vw - 32px));
}

.quest-dialog {
  width: min(760px, calc(100vw - 32px));
}

.quest-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.quest-summary-strip span {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
}

.quest-summary-strip small,
.quest-kicker,
.quest-giver,
.quest-stage small,
.quest-reward small {
  color: var(--muted);
  font-size: .7rem;
}

.quest-summary-strip strong {
  color: var(--gold);
  font-size: 1.1rem;
}

.quest-section {
  margin-top: 18px;
}

.quest-section-heading,
.quest-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.quest-section-heading {
  margin-bottom: 9px;
}

.quest-section-heading h3 {
  margin: 0;
  font-size: .95rem;
}

.quest-section-heading > span {
  color: var(--muted);
  font-size: .72rem;
}

.quest-list {
  display: grid;
  gap: 9px;
}

.quest-card {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-left: 3px solid rgba(240, 188, 94, .48);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
}

.quest-card h3 {
  margin: 3px 0 0;
  color: var(--text);
  font-size: .95rem;
}

.quest-card > p {
  margin: 9px 0 0;
  color: var(--soft);
  line-height: 1.65;
}

.quest-card-heading .quest-kicker {
  display: block;
}

.quest-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid rgba(112, 208, 170, .35);
  border-radius: 999px;
  color: var(--jade);
  font-size: .68rem;
  white-space: nowrap;
}

.quest-status.offer {
  border-color: rgba(240, 188, 94, .42);
  color: var(--gold);
}

.quest-status-completed {
  border-left-color: rgba(112, 208, 170, .55);
  opacity: .82;
}

.quest-status-failed,
.quest-status-abandoned {
  border-left-color: rgba(233, 131, 127, .55);
}

.quest-giver {
  margin-top: 8px !important;
}

.quest-objectives {
  display: grid;
  gap: 5px;
  margin: 11px 0 0;
  padding-left: 20px;
  color: var(--soft);
  font-size: .8rem;
  line-height: 1.55;
}

.quest-objectives li.is-complete {
  color: var(--jade);
  text-decoration: line-through;
}

.quest-stage,
.quest-reward {
  display: grid;
  gap: 3px;
}

.quest-accept-button {
  min-height: 34px;
  margin-top: 12px;
  padding: 6px 12px;
  border-color: rgba(240, 188, 94, .5);
  color: #241a0d;
  background: var(--gold);
  font-size: .76rem;
  font-weight: 800;
}

.quest-accept-button:hover,
.quest-accept-button:focus-visible {
  background: #f6d28a;
}

.quest-empty,
.quest-dialog-note,
.quest-dialog-error {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.65;
}

.quest-dialog-error {
  color: var(--rose);
}

.npc-quest-offer {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid rgba(240, 188, 94, .42);
  border-radius: 6px;
  color: var(--soft);
  background: rgba(240, 188, 94, .08);
}

.npc-quest-offer strong {
  color: var(--gold);
  font-size: .76rem;
}

.npc-quest-offer span {
  font-size: .72rem;
  line-height: 1.55;
}

.npc-quest-offer button {
  justify-self: start;
  min-height: 28px;
  padding: 4px 9px;
  font-size: .7rem;
}

.npc-quest-offer.accepted {
  border-color: rgba(112, 208, 170, .38);
  background: rgba(112, 208, 170, .07);
}

.npc-quest-offer.accepted strong {
  color: var(--jade);
}

.npc-quest-offer.declined {
  border-color: rgba(233, 131, 127, .35);
  background: rgba(233, 131, 127, .06);
}

.npc-quest-offer.declined strong {
  color: var(--rose);
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.inventory-burden {
  display: grid;
  gap: 9px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid rgba(112, 208, 170, .34);
  border-radius: 8px;
  background: rgba(112, 208, 170, .06);
}

.inventory-burden.encumbered,
.inventory-burden.heavily_encumbered,
.inventory-burden.over_capacity {
  border-color: rgba(240, 188, 94, .48);
  background: rgba(240, 188, 94, .07);
}

.inventory-burden.over_capacity {
  border-color: rgba(233, 131, 127, .5);
  background: rgba(233, 131, 127, .07);
}

.inventory-burden-heading,
.inventory-burden-thresholds {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inventory-burden-heading span {
  display: grid;
  gap: 2px;
}

.inventory-burden-heading small,
.inventory-burden-thresholds,
.inventory-burden p {
  color: var(--muted);
  font-size: .72rem;
}

.inventory-burden-heading b {
  color: var(--jade);
  font-size: .76rem;
}

.inventory-burden.encumbered .inventory-burden-heading b,
.inventory-burden.heavily_encumbered .inventory-burden-heading b {
  color: var(--gold);
}

.inventory-burden.over_capacity .inventory-burden-heading b,
.inventory-burden .inventory-weight-warning {
  color: var(--rose);
}

.inventory-burden-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, .1);
}

.inventory-burden-track i {
  display: block;
  height: 100%;
  background: var(--jade);
}

.inventory-burden.encumbered .inventory-burden-track i,
.inventory-burden.heavily_encumbered .inventory-burden-track i {
  background: var(--gold);
}

.inventory-burden.over_capacity .inventory-burden-track i {
  background: var(--rose);
}

.inventory-burden-track em {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(8, 12, 15, .72);
}

.inventory-burden p {
  margin: 0;
  line-height: 1.55;
}

.inventory-item-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  flex-direction: column;
  min-width: 0;
  min-height: 122px;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, .045);
  text-align: left;
}

.inventory-item-card:hover,
.inventory-item-card:focus-visible {
  border-color: rgba(240, 188, 94, .62);
  background: rgba(240, 188, 94, .1);
}

.inventory-item-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.inventory-item-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(240, 188, 94, .42);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(240, 188, 94, .1);
  font-size: 1rem;
  font-weight: 900;
}

.inventory-item-quantity {
  color: var(--jade);
  font-size: .78rem;
  font-weight: 900;
}

.inventory-item-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-item-card small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 180px;
  padding: 24px;
  border: 1px dashed rgba(255, 255, 255, .16);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.inventory-empty-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  color: var(--gold);
  font-size: 1.35rem;
}

.inventory-detail-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inventory-detail-title h2 {
  margin-top: 4px;
}

.inventory-detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.inventory-detail-stats span {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
}

.inventory-detail-stats small {
  color: var(--muted);
  font-size: .72rem;
}

.inventory-detail-stats strong {
  color: var(--text);
}

.inventory-detail-description p:last-child {
  margin-bottom: 0;
  color: var(--soft);
  line-height: 1.8;
  white-space: pre-wrap;
}

.solo-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.solo-dialog-header h2 {
  margin: 4px 0 0;
}

.dialog-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.dialog-section h3 {
  margin: 4px 0 10px;
  font-size: 1rem;
}

.character-detail-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.character-detail-heading h3 {
  margin-bottom: 0;
}

.character-detail-heading > span {
  color: var(--muted);
  font-size: .72rem;
  white-space: nowrap;
}

.character-overview-grid,
.character-spell-meta,
.character-equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.character-overview-grid span,
.character-spell-meta span,
.character-equipment-grid span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.character-overview-grid small,
.character-spell-meta small,
.character-equipment-grid small,
.character-training-row small {
  color: var(--muted);
  font-size: .7rem;
}

.character-overview-grid strong,
.character-spell-meta strong,
.character-equipment-grid strong,
.character-training-row strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: .82rem;
}

.character-equipment-slot em {
  color: var(--muted);
  font-size: .68rem;
  font-style: normal;
  line-height: 1.45;
}

.character-rule-warning {
  margin: 10px 0 0;
  padding: 9px 10px;
  border-left: 3px solid var(--gold);
  color: #f7d895;
  background: rgba(240, 188, 94, .08);
  font-size: .78rem;
  line-height: 1.55;
}

.inventory-equipment-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.inventory-equipment-action strong {
  display: block;
  color: var(--text);
  font-size: .82rem;
}

.inventory-equipment-action form {
  flex: 0 0 auto;
}

.inventory-discard-action {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(233, 131, 127, .25);
}

.inventory-discard-action form {
  display: flex;
  align-items: end;
  gap: 8px;
  margin-top: 8px;
}

.inventory-discard-action label {
  display: grid;
  flex: 1 1 auto;
  gap: 4px;
  color: var(--muted);
  font-size: .7rem;
}

.inventory-discard-action input {
  width: 100%;
  min-height: 36px;
}

.inventory-discard-action .danger-action {
  min-height: 36px;
  border-color: rgba(233, 131, 127, .5);
  color: #ffd0ce;
  background: rgba(233, 131, 127, .12);
}

.inventory-discard-action .danger-action:hover:not(:disabled) {
  border-color: rgba(233, 131, 127, .8);
  background: rgba(233, 131, 127, .2);
}

.inventory-discard-error,
.inventory-message {
  margin: 10px 0 0;
  color: var(--rose);
  font-size: .74rem;
  line-height: 1.5;
}

.inventory-message {
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid rgba(112, 208, 170, .35);
  border-radius: 6px;
  color: var(--jade);
  background: rgba(112, 208, 170, .07);
}

.character-save-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.character-save-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 8px;
  padding: 8px 9px;
  border-left: 3px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .035);
}

.character-save-row.is-proficient {
  border-left-color: var(--jade);
  background: rgba(112, 208, 170, .08);
}

.character-save-row strong,
.character-save-row small {
  display: block;
  min-width: 0;
}

.character-save-row small {
  color: var(--soft);
  font-size: .68rem;
}

.character-save-row b {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--gold);
  font-size: .88rem;
}

.character-training-grid {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.character-training-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.character-subheading {
  margin: 18px 0 0;
  color: var(--soft);
  font-size: .82rem;
}

.character-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.character-slot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding: 8px 9px;
  border: 1px solid rgba(240, 188, 94, .24);
  border-radius: 8px;
  background: rgba(240, 188, 94, .07);
}

.character-slot-row b {
  color: var(--gold);
}

.character-slot-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: .68rem;
}

.character-known-spells {
  margin-top: 16px;
}

.character-spell-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.character-spell-row:first-of-type {
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.character-spell-row > span,
.character-spell-row strong,
.character-spell-row small {
  display: block;
  min-width: 0;
}

.character-spell-row strong {
  color: var(--text);
  font-size: .82rem;
}

.character-spell-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .68rem;
}

.character-spell-row em {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .68rem;
  font-style: normal;
}

.character-spell-row.is-prepared em {
  color: var(--jade);
  font-weight: 800;
}

.character-empty-detail {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.6;
}

.solo-dialog-close {
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, .05);
  font-size: 1.15rem;
}

.solo-dialog-close:hover,
.solo-dialog-close:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
}

.action-console h2 {
  margin: 4px 0 0;
  letter-spacing: 0;
}

.battle-panel {
  margin: 0 0 22px;
  border: 1px solid rgba(240, 188, 94, 0.32);
  border-radius: 8px;
  padding: 20px;
  background: rgba(24, 29, 40, 0.94);
}

.battle-is-updating .battle-panel {
  pointer-events: none;
  opacity: 0.72;
}

.battle-panel-updated {
  animation: battle-panel-update 180ms ease-out;
}

@keyframes battle-panel-update {
  from { opacity: 0.78; }
  to { opacity: 1; }
}

.battle-panel-header,
.battle-unit-head,
.battle-hp-label,
.battle-action-bar,
.hex-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.battle-panel-header {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.battle-panel-header h2 {
  margin: 4px 0 0;
}

.battle-panel-header p:not(.eyebrow),
.battle-unit-card p {
  color: var(--muted);
  line-height: 1.65;
}

.battle-turn-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(112, 208, 170, 0.42);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--jade);
  font-size: 0.82rem;
  font-weight: 900;
}

.battle-initiative {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.battle-initiative > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  font-size: .72rem;
}

.battle-initiative > span.is-player {
  border-color: rgba(190, 91, 75, .5);
  color: var(--accent-deep);
}

.battle-initiative > span.is-active {
  border-color: var(--gold);
  background: rgba(240, 188, 94, 0.14);
  box-shadow: inset 0 0 0 1px rgba(240, 188, 94, 0.22);
  color: var(--gold);
}

.battle-initiative small {
  color: var(--muted);
}

.battle-panel-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.battle-panel-tools form {
  margin: 0;
}

.battle-panel-tools button {
  white-space: nowrap;
}

.battle-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  gap: 18px;
  align-items: start;
  padding-top: 18px;
}

.hex-board-shell {
  min-width: 0;
  overflow: hidden;
  padding: 10px 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(7, 10, 16, 0.68);
}

.battle-camera-toolbar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.battle-camera-toolbar label {
  display: flex;
  flex: 1 1 150px;
  align-items: center;
  gap: 8px;
  min-width: 110px;
  color: var(--muted);
  font-size: 0.72rem;
}

.battle-camera-toolbar input[type="range"] {
  width: 100%;
  margin: 0;
}

.battle-camera-toolbar button {
  width: auto;
  min-height: 30px;
  margin: 0;
  padding: 5px 9px;
}

.battle-camera-toolbar .battle-camera-icon {
  width: 32px;
  padding: 0;
  font-size: 1.05rem;
}

.hex-board-viewport {
  min-width: 0;
  min-height: 470px;
  overflow: auto;
  overscroll-behavior: contain;
  perspective: 1050px;
  perspective-origin: 50% 36%;
  scrollbar-gutter: stable;
}

.hex-board-scene {
  --camera-tilt: 45deg;
  --camera-rotation: 0deg;
  display: grid;
  width: max-content;
  min-width: 100%;
  min-height: 455px;
  place-items: center;
  padding: 56px 76px 72px;
  transform: rotateX(var(--camera-tilt)) rotateZ(var(--camera-rotation));
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  transition: transform 220ms ease;
  will-change: transform;
}

.hex-board {
  --hex-column-step: 64px;
  --hex-width: 63px;
  --hex-height: 73px;
  --hex-row-step: 55px;
  display: grid;
  grid-auto-rows: var(--hex-row-step);
  row-gap: 0;
  min-width: calc(var(--hex-column-step) * 8.5);
  padding: 8px 0 26px;
  transform-style: preserve-3d;
}

.hex-row {
  display: grid;
  grid-template-columns: repeat(8, var(--hex-column-step));
  gap: 0;
  width: max-content;
  height: var(--hex-height);
  transform-style: preserve-3d;
}

.hex-row.offset-row {
  margin-left: calc(var(--hex-column-step) / 2);
}

.hex-cell-form {
  display: block;
  flex: 0 0 auto;
  width: var(--hex-width);
  height: var(--hex-height);
  margin: 0;
  pointer-events: none;
  transform-style: preserve-3d;
}

.hex-player-token-wrap {
  position: relative;
  z-index: 12;
  width: var(--hex-width);
  height: var(--hex-height);
}

.hex-cell {
  position: relative;
  display: flex;
  width: var(--hex-width);
  height: var(--hex-height);
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  padding: 0;
  pointer-events: auto;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  filter: brightness(calc(0.72 + var(--terrain-light, 0.65) * 0.42)) drop-shadow(0 var(--terrain-depth, 0) 0 rgba(8, 12, 18, 0.82)) drop-shadow(0 0 1px rgba(226, 233, 240, 0.72));
  transform: translateZ(var(--terrain-height, 0));
  transform-style: preserve-3d;
  will-change: transform;
  transition: background 140ms ease, color 140ms ease, filter 140ms ease, transform 140ms ease;
}

button.hex-cell:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.16);
  filter: brightness(calc(0.84 + var(--terrain-light, 0.65) * 0.42)) drop-shadow(0 var(--terrain-depth, 0) 0 rgba(8, 12, 18, 0.82)) drop-shadow(0 0 1px rgba(240, 188, 94, 0.88));
}

.hex-cell.is-reachable {
  cursor: pointer;
  background: rgba(112, 208, 170, 0.22);
  box-shadow: inset 0 0 0 1px rgba(112, 208, 170, 0.42);
}

.hex-cell.is-jump-target {
  box-shadow: inset 0 0 0 2px rgba(111, 190, 224, 0.78);
}

.hex-cell.has-cover {
  background: rgba(218, 173, 94, .14);
}

.hex-cell.has-cover small {
  color: var(--gold);
  font-size: .54rem;
}

.hex-cell.terrain-surface-vegetation { background-color: rgba(70, 119, 77, 0.48); }
.hex-cell.terrain-surface-grass { background-color: rgba(80, 132, 82, 0.46); }
.hex-cell.terrain-surface-water { background-color: rgba(58, 124, 160, 0.54); }
.hex-cell.terrain-surface-grease { background-color: rgba(93, 80, 48, 0.72); }
.hex-cell.terrain-surface-oil { background-color: rgba(75, 63, 48, 0.72); }
.hex-cell.terrain-surface-poison { background-color: rgba(91, 132, 55, 0.64); }
.hex-cell.terrain-surface-fire { background-color: rgba(177, 75, 42, 0.7); }
.hex-cell.terrain-surface-ice { background-color: rgba(113, 172, 190, 0.58); }
.hex-cell.terrain-surface-rubble { background-color: rgba(111, 108, 102, 0.5); }

.hex-cell.terrain-blocked {
  cursor: not-allowed;
  background-color: rgba(48, 51, 58, 0.9);
}

.hex-cell.terrain-gas-poison_gas::before,
.hex-cell.terrain-gas-fog::before,
.hex-cell.terrain-gas-darkness::before,
.hex-cell.terrain-gas-black_fog::before,
.hex-cell.terrain-gas-steam::before,
.hex-cell.terrain-gas-smoke::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.66;
  background-size: 9px 9px;
}

.hex-cell.terrain-gas-poison_gas::before {
  background-image: repeating-linear-gradient(135deg, rgba(139, 190, 71, 0.45) 0 3px, transparent 3px 8px);
}

.hex-cell.terrain-gas-fog::before {
  background-image: repeating-linear-gradient(135deg, rgba(220, 226, 224, 0.48) 0 4px, transparent 4px 9px);
}

.hex-cell.terrain-gas-darkness::before {
  background-image: repeating-linear-gradient(135deg, rgba(1, 2, 5, 0.78) 0 5px, transparent 5px 9px);
}

.hex-cell.terrain-gas-black_fog::before {
  background-image: repeating-linear-gradient(135deg, rgba(3, 5, 8, 0.68) 0 4px, transparent 4px 9px);
}

.hex-cell.terrain-gas-steam::before {
  background-image: repeating-linear-gradient(135deg, rgba(224, 234, 235, 0.34) 0 3px, transparent 3px 9px);
}

.hex-cell.terrain-gas-smoke::before {
  background-image: repeating-linear-gradient(135deg, rgba(89, 91, 94, 0.52) 0 4px, transparent 4px 9px);
}

.hex-cell > span,
.hex-cell > small {
  position: relative;
  z-index: 2;
}

.terrain-cell-badges {
  position: absolute !important;
  inset: 5px 7px auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3px;
  pointer-events: none;
}

.terrain-cell-badges i {
  max-width: 42px;
  overflow: hidden;
  padding: 2px 3px;
  border-radius: 3px;
  color: #f4f6f8;
  background: rgba(8, 12, 18, 0.72);
  font-size: 0.48rem;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terrain-cell-badges .terrain-height-mark {
  color: var(--gold);
}

.terrain-cell-badges .terrain-gas-mark {
  color: #c7e690;
}

.terrain-cell-badges .terrain-block-mark {
  color: #f0a19b;
}

.hex-cell.player-token,
.hex-cell.enemy-token {
  cursor: default;
}

.hex-cell.player-token {
  color: #101821;
  background: var(--jade);
  font-weight: 950;
}

.hex-player-token-wrap .player-token {
  cursor: pointer;
}

.hex-player-token-wrap .player-token[aria-expanded="true"] {
  outline: 3px solid var(--gold);
  outline-offset: -4px;
}

.battle-action-popover {
  position: absolute;
  top: 50%;
  left: 66px;
  display: block;
  width: 226px;
  max-height: min(330px, calc(100vh - 32px));
  overflow-y: auto;
  padding: 10px;
  border: 1px solid rgba(218, 173, 94, .48);
  border-radius: 8px;
  background: rgba(18, 24, 32, .98);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .36);
  transform: translateY(-50%);
}

.battle-action-popover[hidden] {
  display: none;
}

.battle-action-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: .8rem;
}

.battle-action-popover-close {
  width: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  border: 0 !important;
  color: var(--muted) !important;
  background: transparent !important;
  font-size: 1.1rem;
}

.battle-action-popover-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.battle-action-popover-grid form,
.battle-popover-spells,
.battle-popover-spells form {
  min-width: 0;
  margin: 0;
}

.battle-action-popover-grid form:first-child,
.battle-popover-spells {
  grid-column: 1 / -1;
}

.battle-weapon-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 7px 0;
  border-block: 1px solid rgba(255, 255, 255, .1);
}

.battle-weapon-actions form {
  margin: 0;
}

.battle-action-popover-grid button small {
  display: block;
  margin-top: 2px;
  color: var(--soft);
  font-size: .62rem;
  line-height: 1.2;
}

.battle-condition-list .is-concentrating {
  border: 1px solid rgba(218, 165, 69, .5);
  background: rgba(218, 165, 69, .16);
  color: #f4cf7a;
}

.battle-action-popover-grid button {
  width: 100%;
  min-height: 34px;
  padding: 6px 7px;
  font-size: .74rem;
}

.battle-popover-spells {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding-top: 3px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

@media (max-width: 640px) {
  .battle-camera-toolbar {
    flex-wrap: wrap;
  }

  .battle-camera-toolbar label {
    order: 2;
    flex-basis: 100%;
  }

  .hex-board-viewport {
    min-height: 430px;
  }

  .hex-board-scene {
    min-height: 415px;
  }

  .battle-action-popover {
    width: 156px;
    padding: 8px;
  }

  .battle-action-popover-grid button {
    padding: 5px 4px;
    font-size: .7rem;
  }
}

.hex-cell.enemy-token {
  flex-direction: column;
  gap: 1px;
  color: #251318;
  background: var(--rose);
  font-weight: 950;
}

.hex-cell.enemy-token small {
  max-width: 54px;
  overflow: hidden;
  color: #251318;
  font-size: 0.55rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hex-cell.enemy-token.is-targetable {
  cursor: pointer;
  outline: 2px solid var(--gold);
  outline-offset: -3px;
}

.hex-cell.enemy-token.is-out-of-range {
  opacity: 0.72;
}

.hex-cell:disabled:not(.player-token):not(.enemy-token) {
  cursor: not-allowed;
  opacity: 0.58;
}

/* Terrain elevation is physical battlefield state, independent of button availability. */
button.hex-cell:disabled {
  transform: translateZ(var(--terrain-height, 0));
}

.hex-legend {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.hex-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
}

.legend-swatch.player {
  background: var(--jade);
}

.legend-swatch.enemy {
  background: var(--rose);
}

.legend-swatch.reachable {
  background: rgba(112, 208, 170, 0.42);
}

.legend-swatch.cover {
  background: rgba(218, 173, 94, .62);
}

.legend-swatch.terrain {
  background: #4f8063;
}

.legend-swatch.gas {
  background: repeating-linear-gradient(135deg, #91b35f 0 3px, #354332 3px 7px);
}

.legend-swatch.blocked {
  border: 1px solid #b76d68;
  background: #30333a;
}

.legend-swatch.elevation {
  border-bottom: 3px solid #111722;
  background: var(--gold);
}

.battle-sidebar {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.battle-combat-log {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(240, 188, 94, 0.22);
  border-radius: 8px;
  background: rgba(7, 10, 16, 0.52);
}

.battle-combat-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.battle-combat-log-head span,
.battle-log-entry small {
  color: var(--muted);
  font-size: 0.68rem;
}

.battle-combat-log-scroll {
  max-height: 300px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 6px 10px 10px;
}

.battle-log-entry {
  padding: 9px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.battle-log-entry:last-child {
  border-bottom: 0;
}

.battle-log-entry p {
  margin: 3px 0 0;
  color: var(--soft);
  font-size: 0.76rem;
  line-height: 1.55;
}

.battle-log-entry.is-system p,
.battle-log-entry.is-miss p {
  color: var(--muted);
}

.combat-log-roll {
  border-bottom: 1px dotted var(--gold);
  color: var(--gold);
  cursor: help;
  font-weight: 800;
}

.battle-unit-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.045);
}

.battle-unit-card.enemy-card {
  border-color: rgba(233, 131, 127, 0.34);
}

.battle-unit-head span,
.battle-hp-label span {
  color: var(--soft);
  font-size: 0.78rem;
}

.battle-hp-label {
  margin-top: 12px;
  color: var(--text);
}

.hp-track {
  height: 7px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.hp-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--jade);
}

.hp-track.enemy-hp i {
  background: var(--rose);
}

.battle-unit-card p {
  margin: 9px 0 0;
  font-size: 0.78rem;
}

.battle-unit-card form,
.battle-action-bar form {
  margin: 12px 0 0;
}

.battle-unit-card button,
.battle-action-bar button {
  width: 100%;
}

.battle-action-bar {
  display: grid;
  align-items: stretch;
  gap: 10px;
  padding-top: 2px;
}

.battle-action-bar > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.battle-action-bar > div span {
  padding: 8px 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--soft);
  font-size: 0.72rem;
  text-align: center;
}

.battle-utility-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.battle-utility-actions form,
.battle-utility-actions button {
  min-width: 0;
}

.battle-condition-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}

.battle-condition-list span {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(190, 91, 75, .1);
  color: var(--accent-deep);
  font-size: .72rem;
}

.battle-spell-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.battle-spell-actions form {
  margin: 0;
}

.battle-spell-actions button {
  min-height: 38px;
  padding: 7px 6px;
  font-size: 0.75rem;
}

.battle-spell-actions button small {
  display: block;
  margin-top: 2px;
  color: var(--soft);
  font-size: 0.65rem;
}

.suggested-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.suggested-actions form {
  margin: 0;
}

.rest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.rest-actions form {
  margin: 0;
}

.suggested-actions button {
  height: auto;
  min-height: 38px;
  padding: 8px 11px;
  white-space: normal;
  text-align: left;
}

.solo-action-form label > span {
  display: block;
  margin-bottom: 7px;
}

.solo-action-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 16px;
}

.solo-action-form textarea {
  min-height: 104px;
}

.solo-action-form button {
  min-width: 112px;
}

.event-log summary {
  cursor: pointer;
  color: var(--jade);
  font-weight: 900;
}

.event-log[open] summary {
  margin-bottom: 16px;
}

@media (max-width: 1200px) {
  .solo-play-grid {
    grid-template-columns: minmax(190px, 220px) minmax(0, 1fr);
  }

  .solo-people-column {
    position: static;
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .portal-hero,
  .feature-strip,
  .stat-grid,
  .dashboard-grid,
  .library-grid,
  .archive-feature-grid,
  .category-nav,
  .shop-grid,
  .derived-grid,
  .solo-play-grid {
    grid-template-columns: 1fr;
  }

  .solo-sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .solo-people-column {
    grid-column: auto;
  }

  .scene-stage {
    grid-template-columns: 1fr;
  }

  .portal-hero {
    min-height: auto;
    padding-top: 42px;
  }

  .hero-art {
    min-height: 330px;
  }
}

@media (max-width: 680px) {
  .site-header {
    position: static;
    display: grid;
    align-items: start;
  }

  nav {
    justify-content: flex-start;
  }

  main {
    padding-inline: 14px;
  }

  .world-map-controls input[type="range"] {
    width: 86px;
  }

  .portal-hero h1 {
    font-size: clamp(2.2rem, 13vw, 3.4rem);
  }

  .profile-form,
  .coc-stat-grid,
  .skill-grid,
  .buy-form,
  .shop-admin-form,
  .shop-admin-filter,
  .search-form {
    grid-template-columns: 1fr;
  }

  .shop-admin-description {
    grid-column: auto;
  }

  .profile-form .full,
  .profile-form button {
    grid-column: auto;
  }

  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .solo-play-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .world-map-heading {
    flex-direction: column;
    gap: 12px;
  }

  .world-map-heading-actions {
    width: 100%;
    justify-content: space-between;
  }

  .solo-header-actions {
    width: 100%;
    align-items: stretch;
    justify-content: space-between;
  }

  .world-clock-card {
    flex: 1 1 auto;
  }

  .solo-sidebar,
  .solo-action-form {
    grid-template-columns: 1fr;
  }

  .ability-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .character-builder-grid,
  .character-card-detail-grid {
    grid-template-columns: 1fr;
  }

  .ability-assignment-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .character-builder-preview-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .character-builder-mode-row {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
  }

  .character-builder-mode-row .form-hint {
    margin: 0;
  }

  .dnd-skill-grid,
  .dnd-skill-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dnd-spell-choice-list {
    grid-template-columns: 1fr;
  }

  .spellbook-editor-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .monster-abilities {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .solo-action-form button {
    width: 100%;
  }

  .inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }

  .inventory-equipment-action {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-equipment-action .secondary-action {
    width: 100%;
  }

  .inventory-discard-action form {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-discard-action .danger-action {
    width: 100%;
  }

  .npc-ability-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .action-recommendations-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .primary-action-console .action-recommendations .suggested-actions button {
    align-items: flex-start;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .primary-action-console .action-recommendations .suggested-actions button .recommendation-reason {
    grid-column: 1;
  }

  .action-result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .action-result-effects li {
    grid-template-columns: 1fr;
  }

  .scene-direction-pad {
    grid-template-columns: repeat(3, minmax(54px, 76px));
  }

  .scene-action-columns {
    grid-template-columns: 1fr;
  }

  .scene-action-columns.only-movement {
    grid-template-columns: 1fr;
  }

  .scene-movement-control {
    padding-top: 16px;
    padding-left: 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
    border-left: 0;
  }

  .world-map-viewport {
    height: 330px;
    min-height: 0;
  }

  .global-world-map-viewport {
    height: 370px;
    min-height: 0;
  }

  .world-map-node {
    width: 116px;
  }

  .world-map-node button {
    min-height: 44px;
    padding: 6px;
  }

  .world-map-node button strong {
    font-size: .68rem;
  }

  .world-map-node button small {
    font-size: .56rem;
  }

  .world-map-path-label {
    font-size: .56rem;
  }

  .turn-log-scroll {
    max-height: 320px;
  }

  .battle-panel {
    padding: 14px;
  }

  .battle-panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .battle-layout {
    grid-template-columns: 1fr;
  }

  .hex-board-shell {
    margin-inline: -6px;
  }

  .npc-info-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 16px;
  }

  .npc-intent-control {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .npc-dialogue-thread {
    max-height: 38vh;
  }

  .npc-dialogue-bubble {
    max-width: 94%;
  }

  .npc-dialogue-check,
  .npc-dialogue-submit {
    align-items: stretch;
    flex-direction: column;
  }

  .npc-dialogue-submit button {
    width: 100%;
  }

  .trade-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 14px;
  }

  .trade-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .trade-item-row {
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 8px 10px;
  }

  .trade-item-row form {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .trade-item-row form label {
    flex: 1 1 auto;
  }

  .trade-item-row form button {
    flex: 0 0 84px;
  }
}
