:root {
  color-scheme: dark;
  --ink-0: #050608;
  --ink-1: #090b10;
  --ink-2: #10141b;
  --ink-3: #171d25;
  --ink-4: #222b35;
  --bone: #e9e1d0;
  --muted: #9a9b99;
  --faint: #646b70;
  --readable-muted: #a6aaa8;
  --gold: #c7a15c;
  --gold-bright: #efd08b;
  --copper: #9c6041;
  --jade: #58bba4;
  --jade-dark: #174d47;
  --blood: #bc5c59;
  --blue: #678cb3;
  --mana: #6c79d8;
  --line: rgba(224, 206, 166, 0.14);
  --line-strong: rgba(224, 206, 166, 0.28);
  --glow: 0 0 40px rgba(199, 161, 92, 0.1);
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-width: 320px;
  overflow: hidden;
  background: var(--ink-0);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
  color: var(--bone);
  background:
    radial-gradient(circle at 65% -10%, rgba(52, 97, 94, 0.18), transparent 34rem),
    radial-gradient(circle at 3% 70%, rgba(112, 57, 39, 0.12), transparent 28rem),
    var(--ink-0);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
}

body::before {
  position: fixed;
  z-index: 100;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.17;
  background-image: url("/assets/astonia/world/cameron/00012000.png");
  background-repeat: repeat;
  background-size: 160px;
  mix-blend-mode: soft-light;
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[draggable="true"]:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

img {
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: var(--ink-0);
  background: var(--gold-bright);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.boot-screen {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background:
    radial-gradient(circle, rgba(27, 71, 65, 0.18), transparent 24rem),
    #050608;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.boot-screen[hidden] {
  display: none;
}

.boot-rune {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 36px;
  transform: rotate(45deg);
  animation: boot-pulse 1.8s ease-in-out infinite;
}

.boot-rune::first-letter {
  transform: rotate(-45deg);
}

.boot-screen p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.boot-track {
  width: min(240px, 70vw);
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.boot-track span {
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: boot-track 1.2s linear infinite;
}

@keyframes boot-pulse {
  50% {
    box-shadow: 0 0 60px rgba(199, 161, 92, 0.18);
    transform: rotate(45deg) scale(1.05);
  }
}

@keyframes boot-track {
  from { transform: translateX(-120%); }
  to { transform: translateX(350%); }
}

.game-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template:
    "top top top" 52px
    "roster main sheet" minmax(0, 1fr)
    / clamp(160px, 11vw, 184px) minmax(0, 1fr) clamp(306px, 23vw, 352px);
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.topbar {
  position: relative;
  z-index: 30;
  top: 0;
  grid-area: top;
  display: grid;
  grid-template-columns: clamp(160px, 11vw, 184px) 1fr auto;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 6, 8, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 700;
  transform: rotate(45deg);
}

.brand-mark::first-line {
  transform: rotate(-45deg);
}

.brand > span:last-child {
  display: grid;
  line-height: 1.1;
}

.brand strong {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.brand small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.account-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(9px, 2.4vw, 28px);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-chip i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px currentColor;
}

.status-chip.is-online i {
  background: var(--jade);
}

.status-chip.is-offline i {
  background: var(--blood);
}

.account-metric {
  display: grid;
  gap: 1px;
  min-width: 56px;
  text-align: center;
}

.account-metric small {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.account-metric strong {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
}

.top-actions {
  display: flex;
  align-items: stretch;
}

.icon-button {
  min-width: 48px;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-size: 17px;
  transition: color 150ms ease, background 150ms ease;
}

.icon-button:hover,
.icon-button[aria-pressed="true"]:hover {
  color: var(--gold-bright);
  background: rgba(255, 255, 255, 0.025);
}

.icon-button[aria-pressed="false"] {
  color: var(--faint);
  text-decoration: line-through;
}

.roster-rail {
  position: relative;
  grid-area: roster;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 12px 10px;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: rgba(8, 10, 13, 0.86);
}

.rail-heading {
  display: flex;
  justify-content: space-between;
  padding: 0 4px 12px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.roster-card {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 60px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  text-align: left;
  background: rgba(255, 255, 255, 0.025);
  transition: border 150ms ease, background 150ms ease, transform 150ms ease;
}

.roster-card::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: var(--progress, 0%);
  height: 2px;
  content: "";
  background: var(--jade);
}

.roster-card:hover {
  transform: translateX(2px);
  border-color: var(--line-strong);
}

.roster-card.is-active {
  border-color: rgba(199, 161, 92, 0.48);
  color: var(--bone);
  background: linear-gradient(90deg, rgba(199, 161, 92, 0.09), transparent);
}

.roster-card.is-risk::after {
  background: var(--blood);
}

.roster-avatar {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #0c1014;
}

.roster-avatar img {
  width: 30px;
  height: 50px;
  max-width: none;
  object-fit: contain;
  transform: translateY(6px);
  image-rendering: pixelated;
}

.roster-avatar canvas {
  width: 30px;
  height: 50px;
  max-width: none;
  transform: translateY(6px);
  image-rendering: pixelated;
}

.roster-copy {
  display: grid;
  min-width: 0;
}

.roster-copy strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-copy small {
  overflow: hidden;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.roster-add {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.roster-add:hover:not(:disabled) {
  color: var(--gold-bright);
  border-color: var(--gold);
}

.rail-legend {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding: 12px 5px 0;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 10px;
  text-transform: uppercase;
}

.dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
}

.dot-working { background: var(--jade); }
.dot-risk { background: var(--blood); }

.game-main {
  grid-area: main;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.018), transparent 46%),
    rgba(13, 16, 21, 0.88);
  box-shadow: var(--glow);
}

.world-card {
  overflow: hidden;
}

.scene-wrap {
  position: relative;
  min-height: clamp(280px, 38vh, 430px);
  overflow: hidden;
  background:
    linear-gradient(to top, rgba(6, 7, 9, 0.92), transparent 55%),
    radial-gradient(circle at 50% 45%, #183530, #0a1114 55%, #06080b);
}

.world-scene,
.world-scene canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.world-scene canvas {
  display: block;
}

.scene-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(5, 6, 8, 0.35), transparent 24%, transparent 65%, rgba(5, 6, 8, 0.72)),
    radial-gradient(ellipse, transparent 45%, rgba(3, 4, 5, 0.58));
}

.location-hud {
  position: absolute;
  z-index: 3;
  top: 24px;
  left: 26px;
  display: flex;
  max-width: calc(100% - 52px);
  align-items: flex-start;
  gap: 34px;
  text-shadow: 0 2px 14px #000;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.location-hud h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(29px, 4vw, 48px);
  font-weight: 400;
  letter-spacing: -0.025em;
}

.location-hud p {
  max-width: 510px;
  margin: 2px 0 0;
  color: rgba(233, 225, 208, 0.7);
  font-family: var(--serif);
  font-size: 13px;
}

.location-stats {
  display: flex;
  gap: 22px;
  padding-top: 8px;
}

.location-stats span {
  display: grid;
  gap: 2px;
}

.location-stats small,
.active-order small {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.location-stats strong {
  color: var(--bone);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
}

.readiness-safe { color: var(--jade) !important; }
.readiness-risk { color: var(--gold-bright) !important; }
.readiness-lethal { color: var(--blood) !important; }

.active-order {
  position: absolute;
  z-index: 3;
  bottom: 24px;
  left: 24px;
  display: grid;
  grid-template-columns: 38px auto 10px;
  gap: 10px;
  align-items: center;
  min-width: 185px;
  padding: 10px 13px 10px 10px;
  border: 1px solid rgba(88, 187, 164, 0.28);
  border-radius: 6px;
  background: rgba(5, 10, 11, 0.78);
  backdrop-filter: blur(8px);
}

.order-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(88, 187, 164, 0.35);
  border-radius: 50%;
  color: var(--jade);
  font-size: 16px;
}

.active-order > span:nth-child(2) {
  display: grid;
}

.active-order strong {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
}

.order-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 12px var(--jade);
  animation: order-pulse 1.5s ease-in-out infinite;
}

@keyframes order-pulse {
  50% { opacity: 0.35; transform: scale(0.7); }
}

.map-button {
  position: absolute;
  z-index: 3;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--bone);
  background: rgba(5, 7, 9, 0.76);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.map-button:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
}

.activity-deck {
  padding: 9px 12px 11px;
  border-top: 1px solid var(--line);
  background: rgba(5, 6, 8, 0.52);
}

.section-label,
.inventory-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-label small,
.inventory-heading small {
  color: var(--faint);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
}

.activity-buttons {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.activity-button {
  display: grid;
  grid-template-columns: auto 1fr;
  min-width: 0;
  gap: 5px;
  align-items: center;
  min-height: 42px;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  text-align: left;
  background: rgba(255, 255, 255, 0.018);
}

.activity-button > span:first-child {
  color: var(--faint);
  font-size: 16px;
}

.activity-button strong {
  display: block;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-button small {
  display: none;
  color: var(--readable-muted);
  font-size: 10px;
  line-height: 1.35;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.activity-button:disabled {
  opacity: 0.68;
}

.activity-button:hover:not(:disabled) {
  color: var(--bone);
  border-color: var(--line-strong);
}

.activity-button.is-active {
  color: var(--bone);
  border-color: rgba(88, 187, 164, 0.5);
  background: rgba(88, 187, 164, 0.07);
}

.activity-button.is-active > span:first-child {
  color: var(--jade);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.1fr);
  gap: 10px;
  margin-top: 10px;
}

.dashboard-grid > .panel {
  min-height: 238px;
  padding: 15px;
}

.quest-dock {
  display: grid;
  grid-template-columns: minmax(128px, 0.2fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  margin-bottom: 8px;
  border-color: rgba(199, 161, 92, 0.22);
  background:
    linear-gradient(90deg, rgba(199, 161, 92, 0.055), transparent 38%),
    rgba(13, 16, 21, 0.94);
}

.quest-dock > .panel-heading {
  align-items: center;
  margin: 0;
}

.quest-dock > .panel-heading h2 {
  font-size: 15px;
}

.quest-dock .quest-card {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 4px 9px;
  align-items: center;
  min-width: 0;
}

.quest-dock .quest-seal {
  width: 28px;
  height: 28px;
  grid-row: 1 / 4;
}

.quest-dock .quest-card > div:nth-child(2) {
  min-width: 0;
  grid-column: 2;
  grid-row: 1;
}

.quest-dock .quest-card h3,
.quest-dock .quest-card p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quest-dock .quest-progress {
  grid-column: 2;
  grid-row: 2;
}

.quest-dock .quest-detail {
  min-height: 0;
  grid-column: 2;
  grid-row: 3;
  margin: 0;
}

.quest-dock .quest-card .primary-button {
  width: auto;
  min-width: 112px;
  min-height: 34px;
  grid-column: 3;
  grid-row: 1 / 4;
  margin: 0;
}

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

.panel-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
}

.canonical-badge {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.realm-board {
  padding: 15px;
  margin-top: 10px;
  min-width: 0;
  overflow: clip;
}

.realm-tabs {
  display: flex;
  gap: 5px;
  padding-bottom: 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.realm-tabs button {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--faint);
  background: transparent;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.realm-tabs button[aria-selected="true"] {
  border-color: rgba(199, 161, 92, 0.45);
  color: var(--gold-bright);
  background: rgba(199, 161, 92, 0.07);
}

.realm-tabs .realm-tab-stack {
  display: grid;
  min-height: 38px;
  place-items: center;
  line-height: 1;
}

.realm-tab-stack small {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.realm-tab-stack[aria-selected="true"] small {
  color: var(--gold);
}

.realm-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 8px;
  padding-top: 12px;
}

.realm-card {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.016);
}

.realm-card.is-wide {
  grid-column: span 2;
}

.realm-card h3 {
  margin: 0;
  color: var(--bone);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
}

.realm-card p,
.realm-card small {
  margin: 0;
  color: var(--readable-muted);
  font-size: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.realm-card strong {
  min-width: 0;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
}

.realm-card button,
.realm-card select,
.realm-card input {
  max-width: 100%;
  min-height: 32px;
}

.realm-card button {
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--bone);
  background: rgba(199, 161, 92, 0.05);
  font-size: 10px;
}

.realm-card button:hover:not(:disabled) {
  border-color: var(--gold);
}

.realm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.realm-actions > input,
.realm-actions > select {
  min-width: 0;
  flex: 1 1 125px;
}

.realm-actions > button {
  min-width: 0;
  flex: 1 1 auto;
  white-space: normal;
}

.rd-entry-gate {
  flex: 1 0 100%;
  min-height: 16px;
  color: var(--readable-muted);
}

.realm-meter {
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
}

.realm-meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--jade-dark), var(--jade));
}

.clan-conflict-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(188, 92, 89, 0.28);
  background:
    linear-gradient(135deg, rgba(128, 48, 45, 0.07), transparent 62%),
    rgba(255, 255, 255, 0.016);
}

.clan-conflict-card::after {
  position: absolute;
  top: -20px;
  right: 12px;
  content: "⚑";
  color: rgba(188, 92, 89, 0.07);
  font-family: var(--serif);
  font-size: 82px;
  pointer-events: none;
}

.catacomb-controls {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(145px, 1fr) minmax(145px, 1fr) auto auto;
  gap: 6px;
}

.catacomb-controls > select {
  min-width: 0;
}

.catacomb-controls .catacomb-raid-button {
  border-color: rgba(188, 92, 89, 0.5);
  color: #e0a6a2;
  background: rgba(188, 92, 89, 0.09);
}

.catacomb-rival-readout {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 22px;
  color: var(--faint);
  font-size: 10px;
}

.clan-relation {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.clan-relation.is-war,
.clan-relation.is-feud {
  border-color: rgba(188, 92, 89, 0.48);
  color: #e0a6a2;
  background: rgba(188, 92, 89, 0.1);
}

.clan-relation.is-alliance,
.clan-relation.is-treaty {
  border-color: rgba(88, 187, 164, 0.42);
  color: var(--jade);
  background: rgba(88, 187, 164, 0.08);
}

.catacomb-gates {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 0;
  margin: 2px 0 0;
  list-style: none;
}

.catacomb-gates li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.018);
}

.catacomb-gates li > span:first-child {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 10px;
}

.catacomb-gates li strong,
.catacomb-gates li small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catacomb-gates li strong {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
}

.catacomb-gates li small {
  margin-top: 1px;
  font-size: 10px;
}

.catacomb-gates li.is-ready {
  border-color: rgba(88, 187, 164, 0.27);
  color: var(--jade);
  background: rgba(88, 187, 164, 0.045);
}

.catacomb-gates li.is-blocked {
  border-color: rgba(188, 92, 89, 0.24);
  color: #c47975;
}

.catacomb-runner-list {
  display: grid;
  gap: 4px;
}

.catacomb-runner {
  display: block;
  overflow: hidden;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.018);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catacomb-runner.is-held {
  border-color: rgba(199, 161, 92, 0.35);
  color: var(--gold);
  background: rgba(199, 161, 92, 0.05);
}

.catacomb-stakes {
  border-color: rgba(188, 92, 89, 0.22);
}

.catacomb-empty {
  position: relative;
  z-index: 1;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  color: var(--faint);
  font-size: 10px;
}

.catacomb-active-status {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 7px;
}

.catacomb-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.catacomb-metrics > span {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.12);
}

.catacomb-metrics small {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.catacomb-metrics strong {
  overflow: hidden;
  color: var(--bone);
  font-family: var(--sans);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catacomb-meter {
  height: 6px;
}

.catacomb-meter i {
  background: linear-gradient(90deg, #7d3d3a, var(--gold), var(--jade));
  transition: width 250ms ease;
}

.rd-fidelity-card {
  border-color: rgba(108, 121, 216, 0.26);
  background:
    linear-gradient(135deg, rgba(108, 121, 216, 0.06), transparent 65%),
    rgba(255, 255, 255, 0.016);
}

.rd-run-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 8px;
}

.rd-run-card {
  align-content: start;
  min-width: 0;
  min-height: 182px;
  overflow: clip;
}

.rd-run-card.is-ready {
  border-style: dashed;
  background:
    linear-gradient(135deg, rgba(88, 187, 164, 0.035), transparent 60%),
    rgba(255, 255, 255, 0.012);
}

.rd-run-card.is-active {
  border-color: rgba(199, 161, 92, 0.3);
  background:
    linear-gradient(135deg, rgba(199, 161, 92, 0.055), transparent 58%),
    rgba(255, 255, 255, 0.016);
}

.rd-prior-run {
  padding: 5px 7px;
  border-left: 2px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.018);
}

.rd-creator-controls {
  display: grid;
  grid-template-columns: minmax(70px, 0.42fr) minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  margin-top: auto;
}

.rd-creator-controls > input,
.rd-creator-controls > select {
  width: 100%;
  min-width: 0;
}

.rd-creator-controls > button {
  width: 100%;
  grid-column: 1 / -1;
  white-space: nowrap;
}

.rd-creator-controls .rd-entry-gate {
  grid-column: 1 / -1;
}

.rd-run-meter {
  height: 6px;
  margin: 2px 0;
}

.rd-run-meter i {
  background: linear-gradient(
    90deg,
    var(--jade-dark),
    var(--jade),
    var(--gold-bright)
  );
  transition: width 250ms ease;
}

.rd-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 0;
  margin: 0;
}

.rd-telemetry-grid > div {
  display: grid;
  min-width: 0;
  gap: 1px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.13);
}

.rd-telemetry-grid dt {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.rd-telemetry-grid dd {
  margin: 0;
  color: var(--bone);
  font-family: var(--serif);
  font-size: 13px;
}

.rd-telemetry-grid small {
  overflow-wrap: anywhere;
  font-size: 10px;
}

.rd-resource-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.rd-resource-chip {
  display: grid;
  min-width: 0;
  gap: 1px;
  padding: 6px 7px;
  border: 1px solid rgba(108, 121, 216, 0.2);
  border-radius: 4px;
  background: rgba(108, 121, 216, 0.035);
}

.rd-resource-chip small {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rd-resource-chip strong {
  overflow: hidden;
  color: var(--bone);
  font-family: var(--sans);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rd-run-section,
.rd-event-telemetry {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.014);
}

.rd-run-section h4,
.rd-event-telemetry h4 {
  margin: 0;
  color: var(--gold);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.rd-run-section p {
  overflow-wrap: anywhere;
}

.rd-shrine-section {
  border-color: rgba(108, 121, 216, 0.27);
  background: rgba(108, 121, 216, 0.04);
}

.rd-shrine-section select {
  width: 100%;
  min-width: 0;
  margin-top: 3px;
}

.rd-event-telemetry > small {
  font-size: 10px;
}

.rd-event-telemetry ol,
.rd-history-card ol {
  display: grid;
  gap: 4px;
  padding: 0;
  margin: 2px 0 0;
  list-style: none;
}

.rd-event-telemetry li,
.rd-history-card li {
  display: grid;
  min-width: 0;
  gap: 1px;
  padding: 5px 7px;
  border-left: 2px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.1);
  color: var(--readable-muted);
  font-size: 10px;
}

.rd-event-telemetry li strong,
.rd-history-card li strong {
  overflow: hidden;
  color: var(--bone);
  font-family: var(--sans);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rd-event-telemetry li span,
.rd-history-card li span {
  overflow-wrap: anywhere;
}

.rd-run-actions {
  justify-content: flex-end;
}

.rd-run-actions button {
  border-color: rgba(188, 92, 89, 0.3);
  color: #d79995;
  background: rgba(188, 92, 89, 0.05);
}

.rd-history-card {
  grid-column: 1 / -1;
}

.rd-history-card ol {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.late-campaign-realm {
  grid-column: 1 / -1;
  border-color: rgba(88, 187, 164, 0.24);
  background:
    linear-gradient(135deg, rgba(88, 187, 164, 0.045), transparent 55%),
    rgba(255, 255, 255, 0.016);
}

.late-campaign-roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.late-campaign-runner {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.12);
}

.late-campaign-runner-heading {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.late-campaign-runner-heading h4 {
  margin: 0;
  color: var(--bone);
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 500;
}

.late-campaign-runner-heading small {
  color: var(--faint);
  font-size: 10px;
  text-align: right;
}

.late-campaign-runner-systems {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.late-campaign-mini {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.015);
}

.late-campaign-mini > strong {
  overflow: hidden;
  color: var(--gold-bright);
  font-family: var(--sans);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.late-campaign-mini > small {
  min-height: 28px;
  overflow-wrap: anywhere;
  font-size: 10px;
}

.late-campaign-mini select {
  width: 100%;
  min-width: 0;
}

.safe-pvp-header,
.earth-arena-preview {
  grid-column: 1 / -1;
}

.safe-pvp-header {
  border-color: rgba(88, 187, 164, 0.28);
}

.earth-arena-preview {
  position: relative;
  overflow: hidden;
  border-color: rgba(188, 92, 89, 0.42);
  background:
    radial-gradient(circle at 11% 42%, rgba(188, 92, 89, 0.15), transparent 17rem),
    linear-gradient(135deg, rgba(96, 31, 28, 0.13), transparent 58%),
    rgba(255, 255, 255, 0.016);
}

.earth-arena-preview::after {
  position: absolute;
  z-index: 0;
  top: -44px;
  right: 12px;
  content: "12";
  color: rgba(188, 92, 89, 0.055);
  font-family: var(--serif);
  font-size: 132px;
  line-height: 1;
  pointer-events: none;
}

.earth-arena-preview > * {
  position: relative;
  z-index: 1;
}

.earth-arena-layout {
  display: grid;
  grid-template-columns: minmax(210px, 0.7fr) minmax(0, 1.3fr);
  gap: 10px;
}

.earth-arena-visual {
  display: grid;
  min-width: 0;
  gap: 7px;
  justify-items: center;
  padding: 10px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(188, 92, 89, 0.25);
  border-radius: 5px;
  background:
    radial-gradient(circle at 50% 38%, rgba(199, 161, 92, 0.12), transparent 9rem),
    repeating-linear-gradient(
      135deg,
      transparent 0 18px,
      rgba(188, 92, 89, 0.022) 18px 19px
    ),
    rgba(0, 0, 0, 0.18);
}

.earth-arena-visual > img {
  width: auto;
  height: 184px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.7));
}

.earth-arena-suit {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

.earth-arena-suit-piece {
  display: grid;
  min-width: 0;
  min-height: 45px;
  place-items: center;
  padding: 4px 2px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.2);
}

.earth-arena-suit-piece img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: auto;
}

.earth-arena-suit-piece small {
  overflow: hidden;
  width: 100%;
  color: var(--readable-muted);
  font-size: 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.earth-arena-visual figcaption {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.earth-arena-copy {
  display: grid;
  min-width: 0;
  gap: 7px;
  align-content: start;
}

.earth-arena-copy h4 {
  margin: 0;
  color: #d79995;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
}

.earth-arena-copy ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: arena-rule;
}

.earth-arena-copy li {
  position: relative;
  min-width: 0;
  padding: 7px 7px 7px 27px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--readable-muted);
  background: rgba(0, 0, 0, 0.12);
  font-size: 10px;
  line-height: 1.45;
  counter-increment: arena-rule;
}

.earth-arena-copy li::before {
  position: absolute;
  top: 7px;
  left: 7px;
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border: 1px solid rgba(188, 92, 89, 0.42);
  border-radius: 50%;
  content: counter(arena-rule);
  color: #d79995;
  font-size: 10px;
}

.earth-arena-lock {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid rgba(188, 92, 89, 0.4);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(188, 92, 89, 0.11), transparent),
    rgba(0, 0, 0, 0.16);
}

.earth-arena-lock strong {
  color: #e0a6a2;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.earth-arena-lock small {
  color: var(--readable-muted);
  font-size: 10px;
  line-height: 1.45;
}

.quest-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 8px;
}

.quest-seal {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(199, 161, 92, 0.3);
  border-radius: 50%;
  color: var(--gold);
}

.quest-card h3 {
  margin: 1px 0 0;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
}

.quest-card p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.quest-progress {
  grid-column: 1 / -1;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.quest-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width 300ms ease;
}

.quest-detail {
  grid-column: 1 / -1;
  min-height: 30px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.primary-button {
  border: 1px solid #d1b272;
  color: #17130c;
  background: linear-gradient(#e4c884, #b99553);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.32);
}

.primary-button:hover:not(:disabled) {
  filter: brightness(1.09);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: transparent;
}

.danger-button {
  border: 1px solid rgba(188, 92, 89, 0.45);
  color: #dd9c98;
  background: rgba(188, 92, 89, 0.08);
}

.wide {
  width: 100%;
}

.quest-card .primary-button {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 2px;
}

.pent-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.pent-card {
  position: relative;
  display: grid;
  min-height: 58px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--serif);
  font-size: 12px;
}

.pent-card::before {
  position: absolute;
  inset: 7px;
  content: "✦";
  color: currentColor;
  font-size: 32px;
  line-height: 1;
  opacity: 0.08;
}

.pent-card[data-color="red"] {
  color: #e07c75;
  border-color: rgba(224, 124, 117, 0.38);
  background: rgba(130, 48, 43, 0.11);
}

.pent-card[data-color="green"] {
  color: #65c391;
  border-color: rgba(101, 195, 145, 0.38);
  background: rgba(35, 113, 71, 0.11);
}

.pent-card[data-color="blue"] {
  color: #76a6df;
  border-color: rgba(118, 166, 223, 0.38);
  background: rgba(47, 82, 130, 0.11);
}

.pent-combo {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--faint);
  font-size: 10px;
  text-transform: uppercase;
}

.pent-combo strong {
  overflow: hidden;
  color: var(--muted);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pent-meter {
  height: 3px;
  margin-top: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.pent-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #9f524e, #64ad87, #648fbd);
}

.microcopy {
  color: var(--faint);
  font-size: 10px;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--gold);
  background: transparent;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.event-list {
  display: grid;
  max-height: 166px;
  gap: 7px;
  padding: 0;
  margin: 0;
  overflow: auto;
  list-style: none;
}

.event-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 10px;
}

.event-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--serif);
}

.event-item p {
  margin: 0;
}

.event-item time {
  display: block;
  color: var(--faint);
  font-size: 10px;
  text-transform: uppercase;
}

.character-panel {
  position: relative;
  grid-area: sheet;
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  background:
    linear-gradient(to bottom, rgba(31, 44, 45, 0.2), transparent 230px),
    rgba(8, 10, 13, 0.96);
}

.paperdoll {
  position: relative;
  display: grid;
  min-height: 185px;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.paperdoll::before,
.paperdoll::after {
  position: absolute;
  width: 120px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
  transform: rotate(45deg);
}

.paperdoll::after {
  transform: rotate(-45deg);
}

.portrait-aura {
  position: absolute;
  width: 145px;
  height: 145px;
  border: 1px solid rgba(199, 161, 92, 0.16);
  border-radius: 50%;
  box-shadow: inset 0 0 60px rgba(51, 122, 107, 0.14);
}

#character-portrait {
  position: absolute;
  z-index: 1;
  top: 1px;
  width: 94px;
  height: 158px;
  image-rendering: pixelated;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.7));
}

.character-identity {
  position: absolute;
  z-index: 2;
  right: 16px;
  bottom: 12px;
  left: 16px;
  padding: 10px 44px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(5, 7, 9, 0.78);
  backdrop-filter: blur(7px);
}

.character-identity h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}

.character-identity p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.character-identity .character-description {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: var(--faint);
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1.25;
  text-transform: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.profile-edit-button {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(199, 161, 92, 0.06);
}

.profile-edit-button:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.resource-bars {
  display: grid;
  gap: 5px;
  padding: 12px 14px 8px;
}

.resource-row {
  display: grid;
  grid-template-columns: 35px 1fr 70px;
  gap: 7px;
  align-items: center;
  color: var(--faint);
  font-size: 10px;
  text-transform: uppercase;
}

.resource-row > div {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.resource-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 300ms ease;
}

.resource-row strong {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-xp i { background: linear-gradient(90deg, #8f743f, var(--gold-bright)); }
.resource-hp i { background: linear-gradient(90deg, #743332, var(--blood)); }
.resource-mana i { background: linear-gradient(90deg, #373d85, var(--mana)); }
.resource-end i { background: linear-gradient(90deg, #2e7163, var(--jade)); }

.wallet-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 14px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.wallet-row span {
  padding: 6px;
  color: var(--faint);
  font-size: 10px;
  text-align: center;
  text-transform: uppercase;
}

.wallet-row span + span {
  border-left: 1px solid var(--line);
}

.wallet-row i {
  display: inline-grid;
  width: 15px;
  height: 15px;
  place-items: center;
  margin-right: 3px;
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 10px;
  font-style: normal;
}

.wallet-row strong {
  color: var(--bone);
  font-weight: 600;
}

.sheet-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.sheet-tabs button {
  min-height: 40px;
  border: 0;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.01);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-tabs button + button {
  border-left: 1px solid var(--line);
}

.sheet-tabs button[aria-selected="true"] {
  color: var(--gold-bright);
  box-shadow: inset 0 -2px var(--gold);
  background: rgba(199, 161, 92, 0.05);
}

.sheet-section {
  padding: 12px 14px 18px;
}

.sheet-section[hidden] {
  display: none;
}

.equipment-grid {
  display: grid;
  grid-template-columns: repeat(5, 46px);
  justify-content: center;
  gap: 5px;
  margin-bottom: 14px;
}

.item-action-status {
  min-height: 28px;
  margin: -6px 0 10px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.company-item-actions {
  position: sticky;
  z-index: 8;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: -3px 0 12px;
  padding: 7px;
  border: 1px solid rgba(199, 161, 92, 0.2);
  border-radius: 4px;
  background: rgba(199, 161, 92, 0.035);
  backdrop-filter: blur(12px);
}

.company-item-actions[hidden] {
  display: none;
}

.company-item-actions span {
  width: 100%;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.company-item-actions button,
.company-treasury button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.company-item-actions button:hover:not(:disabled),
.company-treasury button:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.company-item-actions button:disabled,
.company-treasury button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.equipment-slot,
.inventory-slot,
.quickbar-slot {
  appearance: none;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.035), transparent 65%),
    rgba(3, 5, 7, 0.76);
}

.equipment-slot {
  width: 46px;
  height: 46px;
}

.equipment-slot::after {
  position: absolute;
  right: 3px;
  bottom: 2px;
  color: rgba(255, 255, 255, 0.2);
  content: attr(data-short);
  font-size: 10px;
  text-transform: uppercase;
}

.equipment-slot.is-drop-target,
.inventory-slot.is-drop-target,
.quickbar-slot.is-drop-target,
.equipment-slot.is-action-target,
.quickbar-slot.is-action-target,
.inventory-slot.is-selected {
  border-color: var(--gold-bright);
  box-shadow: inset 0 0 18px rgba(199, 161, 92, 0.17);
}

.inventory-slot.is-selected {
  outline: 2px solid rgba(225, 201, 141, 0.72);
  outline-offset: 1px;
}

.item-icon {
  width: 86%;
  height: 86%;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px #000);
}

.item-icon--expanded {
  width: 92%;
  height: 92%;
}

.item-icon--source-view image {
  image-rendering: pixelated;
}

.item-fallback {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 21px;
}

.item-qty {
  position: absolute;
  z-index: 2;
  right: 2px;
  bottom: 1px;
  min-width: 13px;
  padding: 0 2px;
  border-radius: 2px;
  color: white;
  background: rgba(0, 0, 0, 0.78);
  font-size: 10px;
  text-align: center;
}

.item-enchant {
  position: absolute;
  z-index: 2;
  top: 2px;
  left: 2px;
  color: #a6e5d5;
  font-size: 10px;
  text-shadow: 0 1px 2px #000;
}

.quickbar {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  margin-bottom: 13px;
}

.quickbar-slot {
  aspect-ratio: 1;
  min-width: 0;
}

.quickbar-slot::before {
  position: absolute;
  z-index: 2;
  top: 1px;
  left: 3px;
  color: var(--faint);
  content: attr(data-key);
  font-size: 10px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.company-inventory-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 3px 0 8px;
}

.company-inventory-heading > div {
  display: grid;
  gap: 2px;
}

.company-inventory-heading .eyebrow {
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.company-inventory-heading strong {
  color: var(--bone);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
}

.company-inventory-heading small {
  color: var(--faint);
  font-size: 10px;
}

.company-inventory-heading > b {
  color: var(--gold-bright);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.company-treasury {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(199, 161, 92, 0.08), transparent 66%),
    rgba(255, 255, 255, 0.015);
}

.company-treasury > span {
  display: grid;
  gap: 2px;
}

.company-treasury small {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.company-treasury strong {
  color: var(--gold-bright);
  font-size: 10px;
  font-weight: 600;
}

.company-inventory {
  display: grid;
  gap: 9px;
}

.company-bag {
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.012);
}

.company-bag.is-active {
  border-color: rgba(199, 161, 92, 0.42);
  background: rgba(199, 161, 92, 0.035);
}

.company-bag-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.company-bag-heading > span:first-child {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.company-bag-heading h3 {
  margin: 0;
  overflow: hidden;
  color: var(--bone);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-bag-heading small {
  overflow: hidden;
  color: var(--faint);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-bag-purse {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 10px;
}

button.company-bag-purse {
  min-height: 27px;
  padding: 0 7px;
  border: 1px solid rgba(199, 161, 92, 0.28);
  border-radius: 3px;
  background: rgba(199, 161, 92, 0.05);
  cursor: pointer;
}

button.company-bag-purse:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.supply-heading {
  margin-top: 12px;
}

.merchant-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.merchant-button {
  min-height: 42px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.018);
  font: inherit;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
}

.merchant-button strong {
  display: block;
  margin-top: 3px;
  color: var(--gold-bright);
  font-size: 10px;
}

.merchant-button:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--text);
}

.merchant-button:disabled {
  opacity: 0.35;
}

.inventory-slot {
  aspect-ratio: 1;
  min-width: 0;
}

.inventory-slot[draggable="true"] {
  cursor: grab;
}

.inventory-slot[draggable="true"]:active {
  cursor: grabbing;
}

.build-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.build-summary > span,
.build-summary label {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--faint);
  font-size: 10px;
  text-transform: uppercase;
}

.build-summary strong {
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
}

.build-summary .build-plan {
  grid-column: 1 / -1;
}

select,
input[type="text"],
input[type="search"],
input[type="number"],
input:not([type]),
textarea {
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--bone);
  background: #0b0e12;
}

textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  line-height: 1.45;
}

.build-summary select {
  min-height: 28px;
  padding: 3px;
  font-size: 10px;
  text-transform: none;
}

.stat-grid {
  display: grid;
  gap: 5px;
}

.stat-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 5px 7px;
  align-items: center;
  min-width: 0;
  padding: 7px 7px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.stat-abbr {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 10px;
}

.stat-copy {
  display: grid;
  min-width: 0;
}

.stat-copy strong {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
}

.stat-copy small {
  overflow: hidden;
  color: var(--faint);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-raise {
  display: flex;
  align-items: center;
  gap: 7px;
}

.stat-meter {
  position: relative;
  display: block;
  height: 7px;
  grid-column: 2 / -1;
  overflow: visible;
  border: 0;
  background: transparent;
}

.stat-meter::before {
  position: absolute;
  top: 3px;
  right: 0;
  left: 0;
  height: 1px;
  content: "";
  background: rgba(222, 181, 181, 0.24);
}

.stat-meter i {
  position: absolute;
  z-index: 1;
  top: 2px;
  bottom: auto;
  left: 0;
  display: block;
  width: var(--stat-footprint, 0%);
  height: 3px;
  transition: width 180ms ease;
}

.stat-meter.is-affordable i {
  background: #1952b5;
  box-shadow: 0 0 4px rgba(49, 105, 211, 0.5);
}

.stat-meter.is-unaffordable i {
  background: #b50000;
  box-shadow: 0 0 4px rgba(181, 0, 0, 0.4);
}

.stat-meter.is-blocked::before {
  background: rgba(100, 107, 112, 0.18);
}

.stat-raise span {
  min-width: 24px;
  font-family: var(--serif);
  font-size: 14px;
  text-align: right;
}

.stat-raise button {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(199, 161, 92, 0.35);
  border-radius: 3px;
  color: #739ce8;
  background:
    linear-gradient(135deg, rgba(115, 156, 232, 0.2), transparent 54%),
    rgba(25, 82, 181, 0.12);
  font-size: 10px;
  line-height: 1;
}

.stat-raise button.is-unaffordable {
  border-color: rgba(181, 0, 0, 0.45);
  color: #b74a4a;
  background: rgba(181, 0, 0, 0.09);
}

.stat-raise button.is-blocked {
  border-color: var(--line);
  color: var(--faint);
  background: transparent;
}

.profession-section {
  margin-top: 16px;
}

.profession-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.profession-card {
  display: grid;
  gap: 2px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  text-align: left;
  background: transparent;
}

.profession-card strong {
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 500;
}

.profession-card small {
  color: var(--faint);
  font-size: 10px;
}

.profession-card:hover:not(:disabled) {
  border-color: var(--gold);
}

.labyrinth-list {
  display: grid;
  gap: 5px;
}

.legacy-system-card {
  display: grid;
  gap: 7px;
  padding: 9px;
  margin-bottom: 10px;
  border: 1px solid rgba(199, 161, 92, 0.24);
  border-radius: 5px;
  background:
    linear-gradient(90deg, rgba(199, 161, 92, 0.06), transparent),
    rgba(6, 8, 11, 0.68);
}

.legacy-system-card[hidden] {
  display: none;
}

.legacy-system-heading {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 7px;
  align-items: center;
}

.legacy-system-heading > span:first-child {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--gold);
}

.legacy-system-heading > span:nth-child(2) {
  display: grid;
}

.legacy-system-heading small,
.legacy-system-card > small {
  color: var(--faint);
  font-size: 10px;
}

.legacy-system-heading strong {
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 500;
}

.legacy-system-heading b {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.legacy-system-card p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.legacy-campaign-grid {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
}

.legacy-campaign-card {
  min-width: 0;
  margin: 0;
}

.legacy-campaign-card .legacy-system-heading small,
.legacy-campaign-card > small {
  color: var(--readable-muted);
  font-size: 10px;
  line-height: 1.45;
}

.legacy-campaign-card p {
  color: var(--readable-muted);
  font-size: 10px;
  line-height: 1.45;
}

.legacy-campaign-card.is-tunnel {
  border-color: rgba(88, 187, 164, 0.25);
  background:
    linear-gradient(90deg, rgba(88, 187, 164, 0.055), transparent),
    rgba(6, 8, 11, 0.68);
}

.legacy-campaign-card.is-warped {
  border-color: rgba(108, 121, 216, 0.3);
  background:
    linear-gradient(90deg, rgba(108, 121, 216, 0.065), transparent),
    rgba(6, 8, 11, 0.68);
}

.legacy-campaign-meter {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
}

.legacy-campaign-meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--jade-dark), var(--jade));
  transition: width 220ms ease;
}

.legacy-campaign-card.is-warped .legacy-campaign-meter i {
  background: linear-gradient(90deg, #343f86, var(--mana), var(--gold));
}

.late-policy-control {
  display: grid;
  grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.late-policy-control select {
  width: 100%;
  min-width: 0;
  min-height: 32px;
}

.warped-sphere-legend {
  padding: 5px 6px;
  border: 1px solid rgba(108, 121, 216, 0.18);
  border-radius: 3px;
  color: var(--readable-muted) !important;
  background: rgba(108, 121, 216, 0.035);
  line-height: 1.45;
}

.legacy-reward-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.legacy-reward-buttons button {
  min-height: 38px;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--bone);
  font-family: var(--serif);
  font-size: 10px;
  background: rgba(12, 15, 20, 0.88);
}

.legacy-reward-buttons button:hover {
  border-color: var(--gold);
}

.lab-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.lab-state {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--faint);
  font-size: 10px;
}

.lab-row.is-complete .lab-state {
  color: var(--jade);
  border-color: rgba(88, 187, 164, 0.4);
}

.lab-row strong {
  display: block;
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 500;
}

.lab-row small {
  color: var(--faint);
  font-size: 10px;
}

.lab-row > span:last-child {
  color: var(--faint);
  font-size: 10px;
  text-transform: uppercase;
}

.gatekeeper-button {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid rgba(199, 161, 92, 0.32);
  border-radius: 5px;
  color: var(--bone);
  text-align: left;
  background:
    linear-gradient(90deg, rgba(199, 161, 92, 0.08), transparent),
    #0b0d10;
}

.gatekeeper-button > span:first-child {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 20px;
}

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

.gatekeeper-button strong {
  font-family: var(--serif);
  font-weight: 500;
}

.gatekeeper-button small {
  color: var(--faint);
  font-size: 10px;
}

.gatekeeper-button:hover {
  border-color: rgba(199, 161, 92, 0.6);
  background:
    linear-gradient(90deg, rgba(199, 161, 92, 0.13), transparent),
    #0b0d10;
}

.gatekeeper-button.is-active {
  border-color: rgba(88, 187, 164, 0.5);
  background:
    linear-gradient(90deg, rgba(88, 187, 164, 0.1), transparent),
    #0b0d10;
}

.gatekeeper-button.is-active > span:first-child {
  border-color: var(--jade);
  color: var(--jade);
  box-shadow: 0 0 24px rgba(88, 187, 164, 0.16);
}

.gatekeeper-button.is-terminal[data-phase="lost"],
.gatekeeper-button.is-terminal[data-phase="timed-out"] {
  border-color: rgba(174, 76, 68, 0.44);
}

.level-hold-control {
  display: grid;
  gap: 7px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 10px;
}

.level-hold-control span {
  display: grid;
}

.level-hold-control small {
  color: var(--faint);
  font-size: 10px;
}

.fidelity-note {
  padding: 10px;
  margin-top: 13px;
  border-left: 2px solid var(--gold);
  color: var(--muted);
  background: rgba(199, 161, 92, 0.04);
}

.fidelity-note strong {
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 500;
}

.fidelity-note p {
  margin: 4px 0 0;
  font-size: 10px;
}

.game-dialog {
  width: min(540px, calc(100vw - 30px));
  max-height: calc(100vh - 30px);
  padding: 22px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--bone);
  background:
    linear-gradient(145deg, rgba(199, 161, 92, 0.06), transparent 30%),
    #0c0f14;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72);
}

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

.character-form {
  display: grid;
  gap: 12px;
}

.character-creator {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.character-preview-card {
  display: grid;
  gap: 9px;
  justify-items: stretch;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 44%, rgba(88, 187, 164, 0.12), transparent 58%),
    rgba(255, 255, 255, 0.018);
}

.character-preview-card canvas {
  width: 120px;
  height: 200px;
  justify-self: center;
  image-rendering: pixelated;
  filter: drop-shadow(0 12px 12px rgba(0, 0, 0, 0.65));
}

.character-preview-card small {
  color: var(--faint);
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}

.character-form-fields {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.character-form-fields > label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.character-form-fields fieldset {
  margin: 0;
}

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

.palette-choice legend {
  grid-column: 1 / -1;
}

.palette-choice label {
  display: grid;
  gap: 6px;
  color: var(--faint);
  font-size: 10px;
  text-align: center;
}

.palette-choice input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #0b0e12;
}

.field-counter {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: normal;
  text-align: right;
  text-transform: none;
}

.profile-record {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.18);
}

.profile-record strong {
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
}

.profile-record p {
  margin: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
}

.profile-record p:nth-child(2) {
  margin-bottom: 4px;
  color: var(--bone);
  font-family: var(--serif);
  font-size: 11px;
}

.game-dialog::backdrop {
  background: rgba(3, 4, 6, 0.78);
  backdrop-filter: blur(8px);
}

.game-dialog h2 {
  margin: 0 0 7px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
}

.game-dialog p {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 13px;
}

.game-dialog form > label {
  display: grid;
  gap: 5px;
  margin: 13px 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-dialog fieldset {
  display: grid;
  gap: 7px;
  padding: 0;
  margin: 17px 0;
  border: 0;
}

.game-dialog legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.class-choice {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.class-choice:has(input:checked) {
  border-color: rgba(199, 161, 92, 0.5);
  background: rgba(199, 161, 92, 0.05);
}

.class-choice span {
  display: grid;
}

.class-choice strong {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
}

.class-choice small {
  color: var(--faint);
  font-size: 10px;
}

.gender-choice {
  grid-template-columns: 1fr 1fr;
}

.gender-choice legend {
  grid-column: 1 / -1;
}

.gender-choice label {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.dialog-close {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
}

.location-dialog,
.route-dialog {
  width: min(940px, calc(100vw - 30px));
}

.location-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0;
}

.location-filters label {
  flex: 1 1 260px;
}

.location-filters input {
  width: 100%;
}

.filter-chip {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  text-transform: uppercase;
}

.filter-chip.is-active {
  color: var(--gold-bright);
  border-color: var(--gold);
  background: rgba(199, 161, 92, 0.07);
}

.location-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.location-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 14px;
  min-height: 100px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  text-align: left;
  background: rgba(255, 255, 255, 0.018);
}

.location-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  content: "";
  background: var(--faint);
}

.location-card[data-readiness="safe"]::before { background: var(--jade); }
.location-card[data-readiness="risk"]::before { background: var(--gold); }
.location-card[data-readiness="lethal"]::before { background: var(--blood); }

.location-card:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
}

.location-card h3 {
  margin: 0;
  color: var(--bone);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
}

.location-card > strong {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
}

.location-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 10px;
}

.location-tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.location-tags span {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--faint);
  font-size: 10px;
  text-transform: uppercase;
}

.gatekeeper-dialog {
  width: min(780px, calc(100vw - 30px));
  text-align: left;
}

.gatekeeper-dialog form {
  display: grid;
  gap: 12px;
}

.gatekeeper-heading {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.gatekeeper-heading h2 {
  margin-bottom: 3px;
}

.gatekeeper-heading p {
  max-width: 650px;
  margin: 0;
  line-height: 1.45;
}

.gatekeeper-mark {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  margin: 0;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 32px;
  box-shadow: 0 0 40px rgba(199, 161, 92, 0.12);
}

.gatekeeper-path-ledger,
.gatekeeper-trial-status,
.gatekeeper-exchange-status {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(199, 161, 92, 0.035), transparent 44%),
    rgba(0, 0, 0, 0.16);
}

.gatekeeper-trial-status {
  border-left: 2px solid var(--gold);
}

.gatekeeper-exchange-status {
  border-left: 2px solid var(--jade);
}

.gatekeeper-section-heading,
.gatekeeper-readiness-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.gatekeeper-section-heading > span,
.gatekeeper-readiness-heading > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.gatekeeper-section-heading small,
.gatekeeper-readiness-heading small {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gatekeeper-section-heading strong,
.gatekeeper-readiness-heading strong {
  color: var(--bone);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
}

.gatekeeper-section-heading > b {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-align: right;
  text-transform: uppercase;
}

.gatekeeper-table-wrap {
  margin-top: 9px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 4px;
}

.gatekeeper-path-ledger table {
  width: 100%;
  border-collapse: collapse;
  color: var(--muted);
  font-size: 10px;
}

.gatekeeper-path-ledger th,
.gatekeeper-path-ledger td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  text-align: left;
  vertical-align: top;
}

.gatekeeper-path-ledger tr:last-child th,
.gatekeeper-path-ledger tr:last-child td {
  border-bottom: 0;
}

.gatekeeper-path-ledger thead th {
  color: var(--faint);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gatekeeper-path-ledger tbody th {
  color: var(--bone);
  font-family: var(--serif);
  font-weight: 500;
}

.gatekeeper-path-ledger code {
  color: var(--gold-bright);
  font-size: 10px;
}

.gatekeeper-rule-strip,
.gatekeeper-entry-grid,
.gatekeeper-readiness-grid,
.gatekeeper-exchange-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.gatekeeper-metric {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 58px;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.018);
}

.gatekeeper-metric small {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gatekeeper-metric strong {
  overflow-wrap: anywhere;
  color: var(--bone);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
}

.gatekeeper-metric span {
  color: var(--faint);
  font-size: 10px;
  line-height: 1.35;
}

.gatekeeper-source-note,
.gatekeeper-deterministic-note,
.gatekeeper-exchange-integrity,
.gatekeeper-exchange-preview,
.gatekeeper-paused-order {
  margin: 9px 0 0 !important;
  color: var(--muted) !important;
  font-family: var(--sans) !important;
  font-size: 10px !important;
  line-height: 1.45;
}

.gatekeeper-deterministic-note,
.gatekeeper-exchange-preview {
  padding: 7px 8px;
  border-left: 2px solid var(--jade);
  background: rgba(88, 187, 164, 0.045);
}

.gatekeeper-phase-badge,
.gatekeeper-verdict {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid rgba(199, 161, 92, 0.35);
  border-radius: 999px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gatekeeper-phase-badge[data-phase="recovering"],
.gatekeeper-phase-badge[data-phase="engaging"],
.gatekeeper-phase-badge[data-phase="resolving"],
.gatekeeper-verdict[data-outcome="win"] {
  border-color: rgba(88, 187, 164, 0.4);
  color: var(--jade);
}

.gatekeeper-phase-badge[data-phase="lost"],
.gatekeeper-phase-badge[data-phase="timed-out"],
.gatekeeper-verdict[data-outcome="loss"],
.gatekeeper-verdict[data-outcome="timeout"] {
  border-color: rgba(174, 76, 68, 0.45);
  color: #d98d84;
}

.gatekeeper-live-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 10px;
}

.gatekeeper-progress-block {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.018);
}

.gatekeeper-progress-heading {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.gatekeeper-progress-heading strong {
  color: var(--bone);
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 500;
}

.gatekeeper-progress-heading span {
  color: var(--faint);
  font-size: 10px;
  text-align: right;
}

.gatekeeper-meter {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.gatekeeper-meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--jade));
  transition: width 180ms linear;
}

.gatekeeper-result-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(174, 76, 68, 0.3);
  border-radius: 5px;
  background: rgba(174, 76, 68, 0.045);
}

.gatekeeper-result-card[data-outcome="win"] {
  border-color: rgba(88, 187, 164, 0.34);
  background: rgba(88, 187, 164, 0.045);
}

.gatekeeper-result-card > span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid currentColor;
  color: #d98d84;
  font-size: 18px;
}

.gatekeeper-result-card[data-outcome="win"] > span {
  color: var(--jade);
}

.gatekeeper-result-card > div {
  display: grid;
  gap: 3px;
}

.gatekeeper-result-card strong {
  color: var(--bone);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
}

.gatekeeper-result-card p {
  margin: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
}

.gatekeeper-result-card small {
  color: var(--faint);
  font-size: 10px;
}

.gatekeeper-readiness {
  display: grid;
  gap: 9px;
  padding: 10px;
  margin-top: 10px;
  border: 1px solid rgba(88, 187, 164, 0.18);
  border-radius: 5px;
  background: rgba(88, 187, 164, 0.025);
}

.gatekeeper-readiness-grid {
  margin-top: 0;
}

.gatekeeper-formula {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  margin: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 4px;
  font-family: var(--sans) !important;
}

.gatekeeper-formula span {
  color: var(--faint);
  font-size: 10px;
  text-transform: uppercase;
}

.gatekeeper-formula code {
  overflow-wrap: anywhere;
  color: var(--gold-bright);
  font-size: 10px;
  text-align: right;
}

.gatekeeper-snapshot {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
}

.gatekeeper-snapshot > div {
  display: grid;
  gap: 2px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 3px;
}

.gatekeeper-snapshot dt {
  color: var(--faint);
  font-size: 10px;
  text-transform: uppercase;
}

.gatekeeper-snapshot dd {
  margin: 0;
  color: var(--bone);
  font-size: 10px;
}

.gatekeeper-entry-grid {
  margin-top: 10px;
}

.gatekeeper-paused-order {
  padding-left: 8px;
  border-left: 2px solid var(--gold);
}

.gatekeeper-choice-fieldset {
  margin: 0 !important;
}

.gatekeeper-choices {
  display: grid;
  gap: 6px;
  margin: 0;
  text-align: left;
}

.gatekeeper-choice {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.gatekeeper-choice:has(input:checked) {
  border-color: var(--gold);
  background: rgba(199, 161, 92, 0.05);
}

.gatekeeper-choice:has(input:disabled) {
  cursor: default;
  opacity: 0.64;
}

.gatekeeper-choice span {
  display: grid;
  gap: 2px;
}

.gatekeeper-choice strong {
  font-family: var(--serif);
  font-weight: 500;
}

.gatekeeper-choice small {
  color: var(--faint);
  font-size: 10px;
}

.gatekeeper-choice > b {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.game-dialog menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0;
  margin: 14px 0 0;
}

.toggle-row,
.range-row {
  grid-template-columns: 1fr auto !important;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.toggle-row > span,
.range-row > span {
  display: grid;
}

.toggle-row strong,
.range-row strong {
  color: var(--bone);
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
}

.toggle-row small,
.range-row small {
  color: var(--faint);
  font-size: 10px;
  text-transform: none;
}

.toggle-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--gold);
}

.range-row input {
  width: 130px;
  accent-color: var(--gold);
}

.offline-loot {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 16px 0;
}

.offline-loot span {
  display: grid;
  padding: 10px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--faint);
  font-size: 10px;
  text-align: center;
  text-transform: uppercase;
}

.offline-loot strong {
  color: var(--bone);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
}

.route-timeline {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-top: 15px;
}

.route-stage {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.route-level {
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 14px;
}

.route-stage strong {
  display: block;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 500;
}

.route-stage p {
  margin: 2px 0 0;
  font-family: var(--sans);
  font-size: 10px;
}

.debug-drawer {
  position: fixed;
  z-index: 40;
  right: 8px;
  bottom: 8px;
  width: min(430px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow: auto;
  border: 1px solid rgba(199, 161, 92, 0.4);
  border-radius: 5px;
  background: rgba(5, 7, 9, 0.94);
}

.debug-drawer summary {
  padding: 8px 10px;
  color: var(--gold);
  cursor: pointer;
  font-size: 10px;
  text-transform: uppercase;
}

.debug-drawer form {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--line);
}

.debug-drawer label {
  display: grid;
  grid-template-columns: 1fr 80px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
}

.debug-drawer input,
.debug-drawer select,
.debug-drawer textarea {
  min-height: 28px;
}

.debug-drawer textarea {
  width: 100%;
  min-height: 150px;
  padding: 7px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--bone);
  background: #080b0f;
  font: 10px/1.45 var(--mono);
}

.debug-scenario {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
}

.debug-scenario legend {
  padding: 0 5px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 10px;
}

.debug-drawer .debug-scenario-json {
  grid-template-columns: 1fr;
}

.debug-scenario-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.debug-drawer button {
  min-height: 30px;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  background: rgba(199, 161, 92, 0.08);
}

.debug-drawer small {
  color: var(--faint);
  font-size: 10px;
}

.toast-region {
  position: fixed;
  z-index: 300;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 7px;
  pointer-events: none;
}

.toast {
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--gold);
  border-radius: 5px;
  color: var(--bone);
  background: rgba(8, 10, 13, 0.95);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  font-size: 10px;
  animation: toast-in 180ms ease-out;
}

.toast.is-error {
  border-left-color: var(--blood);
}

.fast-tooltip {
  position: fixed;
  z-index: 450;
  width: max-content;
  max-width: min(350px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  padding: 7px 9px;
  border: 1px solid rgba(199, 161, 92, 0.48);
  border-radius: 4px;
  color: var(--bone);
  background: rgba(5, 7, 9, 0.97);
  box-shadow: 0 9px 30px rgba(0, 0, 0, 0.58);
  font-size: 11px;
  line-height: 1.4;
  overflow-y: auto;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  pointer-events: none;
  white-space: normal;
  transform: translateZ(0);
}

.fast-tooltip[hidden] {
  display: none;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

.mobile-nav {
  display: none;
}

.noscript {
  position: fixed;
  z-index: 999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  color: var(--bone);
  background: var(--ink-0);
  text-align: center;
}

@media (max-width: 1240px) {
  .game-shell {
    grid-template:
      "top top top" 52px
      "roster main sheet" minmax(0, 1fr)
      / 154px minmax(0, 1fr) 312px;
  }

  .topbar {
    grid-template-columns: 154px 1fr auto;
  }

  .activity-buttons {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .quest-dock {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .quest-dock > .panel-heading {
    margin-bottom: 2px;
  }

  .quest-dock > .panel-heading h2,
  .quest-dock > .panel-heading .canonical-badge {
    display: none;
  }

  .late-campaign-roster {
    grid-template-columns: 1fr;
  }

  .chronicle-panel {
    grid-column: 1 / -1;
  }

  .equipment-grid {
    grid-template-columns: repeat(5, 42px);
  }

  .equipment-slot {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 980px) {
  html {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-padding-top: calc(58px + env(safe-area-inset-top, 0px));
  }

  body {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: calc(54px + env(safe-area-inset-bottom, 0px));
  }

  .game-shell {
    display: block;
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .topbar {
    position: sticky;
    display: grid;
    height: 58px;
    grid-template-columns: 1fr auto;
  }

  .brand {
    min-width: 0;
  }

  .account-strip {
    display: none;
  }

  .roster-rail,
  .character-panel {
    position: static;
    display: none;
    width: auto;
    height: auto;
    min-height: calc(100vh - 112px);
    border: 0;
  }

  .game-main {
    display: block;
    padding: 8px;
    overflow: visible;
  }

  .game-main,
  .roster-rail,
  .character-panel {
    scroll-margin-top: calc(58px + env(safe-area-inset-top, 0px));
  }

  body[data-mobile-view="roster"] .game-main,
  body[data-mobile-view="roster"] .character-panel,
  body[data-mobile-view="character"] .game-main,
  body[data-mobile-view="character"] .roster-rail {
    display: none;
  }

  body[data-mobile-view="roster"] .roster-rail,
  body[data-mobile-view="character"] .character-panel {
    display: flex;
  }

  body[data-mobile-view="character"] .character-panel {
    display: block;
  }

  .roster-rail {
    padding: 14px;
  }

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

  .mobile-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    min-height: 54px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line-strong);
    background: rgba(5, 6, 8, 0.96);
    backdrop-filter: blur(12px);
  }

  .mobile-nav[hidden] {
    display: none !important;
  }

  .mobile-nav button {
    border: 0;
    color: var(--faint);
    background: transparent;
    font-size: 11px;
    text-transform: uppercase;
  }

  .mobile-nav button.is-active {
    color: var(--gold-bright);
    box-shadow: inset 0 2px var(--gold);
  }

  .character-panel {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    overflow: visible;
  }

  .paperdoll {
    min-height: 220px;
  }

  #character-portrait {
    width: 110px;
    height: 184px;
  }

  .inventory-grid {
    grid-template-columns: repeat(8, 1fr);
  }

}

@media (max-width: 680px) {
  .brand small,
  .hide-small {
    display: none;
  }

  .icon-button {
    min-width: 46px;
  }

  .scene-wrap {
    min-height: 520px;
  }

  .quest-dock .quest-card {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .quest-dock .quest-card .primary-button {
    width: 100%;
    grid-column: 1 / -1;
    grid-row: 4;
  }

  .location-hud {
    top: 18px;
    left: 18px;
    display: block;
    max-width: calc(100% - 36px);
  }

  .location-hud h1 {
    font-size: 32px;
  }

  .location-hud p {
    max-width: 85%;
  }

  .location-stats {
    gap: 15px;
    margin-top: 8px;
  }

  .active-order {
    right: 18px;
    bottom: 70px;
    left: 18px;
  }

  .map-button {
    right: 18px;
    bottom: 18px;
    left: 18px;
    justify-content: center;
  }

  .activity-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .activity-button {
    min-height: 64px;
  }

  .activity-button small {
    font-size: 10px;
  }

  .realm-card p,
  .realm-card small {
    font-size: 11px;
  }

  .dashboard-grid {
    display: block;
  }

  .realm-content {
    grid-template-columns: 1fr;
  }

  .realm-card.is-wide {
    grid-column: auto;
  }

  .rd-run-grid {
    grid-template-columns: 1fr;
  }

  .rd-creator-controls {
    grid-template-columns: minmax(70px, 0.42fr) minmax(0, 1fr);
  }

  .rd-creator-controls > button {
    grid-column: 1 / -1;
    min-height: 40px;
  }

  .rd-telemetry-grid,
  .rd-resource-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rd-history-card,
  .rd-history-card ol {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .late-campaign-roster,
  .late-campaign-runner-systems {
    grid-template-columns: 1fr;
  }

  .late-campaign-mini > small {
    min-height: 0;
  }

  .earth-arena-layout,
  .earth-arena-copy ul {
    grid-template-columns: 1fr;
  }

  .earth-arena-visual > img {
    height: 156px;
  }

  .earth-arena-suit-piece small {
    font-size: 10px;
  }

  .earth-arena-copy li {
    font-size: 10px;
  }

  .catacomb-controls,
  .catacomb-gates {
    grid-template-columns: 1fr;
  }

  .catacomb-controls > button {
    min-height: 40px;
  }

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

  .dashboard-grid > .panel {
    min-height: 0;
    margin-top: 8px;
  }

  .section-label small {
    display: none;
  }

  .location-list,
  .route-timeline {
    grid-template-columns: 1fr;
  }

  .offline-loot {
    grid-template-columns: repeat(3, 1fr);
  }

  .inventory-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .company-treasury {
    align-items: stretch;
  }

  .company-treasury button {
    min-height: 40px;
  }

  .game-dialog {
    padding: 17px;
  }

  .game-dialog h2 {
    font-size: 24px;
  }

  .gatekeeper-heading {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 11px;
  }

  .gatekeeper-mark {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }

  .gatekeeper-heading p {
    font-size: 11px;
  }

  .gatekeeper-path-ledger,
  .gatekeeper-trial-status,
  .gatekeeper-exchange-status {
    padding: 10px;
  }

  .gatekeeper-path-ledger table {
    min-width: 560px;
    font-size: 10px;
  }

  .gatekeeper-path-ledger thead th,
  .gatekeeper-section-heading small,
  .gatekeeper-readiness-heading small,
  .gatekeeper-metric small {
    font-size: 10px;
  }

  .gatekeeper-section-heading strong,
  .gatekeeper-readiness-heading strong {
    font-size: 12px;
  }

  .gatekeeper-section-heading > b,
  .gatekeeper-phase-badge,
  .gatekeeper-verdict {
    font-size: 10px;
  }

  .gatekeeper-rule-strip,
  .gatekeeper-entry-grid,
  .gatekeeper-readiness-grid,
  .gatekeeper-exchange-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gatekeeper-live-grid {
    grid-template-columns: 1fr;
  }

  .gatekeeper-metric span,
  .gatekeeper-progress-heading span,
  .gatekeeper-result-card small {
    font-size: 10px;
  }

  .gatekeeper-source-note,
  .gatekeeper-deterministic-note,
  .gatekeeper-exchange-integrity,
  .gatekeeper-exchange-preview,
  .gatekeeper-paused-order,
  .gatekeeper-result-card p,
  .gatekeeper-formula code {
    font-size: 10px !important;
  }

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

  .gatekeeper-snapshot dt,
  .gatekeeper-snapshot dd,
  .gatekeeper-formula span {
    font-size: 10px;
  }

  .gatekeeper-formula {
    display: grid;
  }

  .gatekeeper-formula code {
    text-align: left;
  }

  .gatekeeper-choice {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .gatekeeper-choice > b {
    grid-column: 2;
    justify-self: start;
    font-size: 10px;
  }

  .gatekeeper-choice small {
    font-size: 10px;
  }

  .character-creator {
    grid-template-columns: 1fr;
  }

  .character-preview-card {
    grid-template-columns: 90px 1fr;
    align-items: center;
  }

  .character-preview-card canvas {
    width: 72px;
    height: 120px;
    grid-row: 1 / span 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
