@layer overlays {
.stat-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  max-width: 260px;
  padding: 0.35rem 0.48rem;
  font-size: 0.75rem;
  line-height: 1.2;
  white-space: pre-line;
  pointer-events: none;
}

[data-stat-tooltip] {
  cursor: help;
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 39;
  pointer-events: none;
}

.tutorial-overlay.input-locked {
  pointer-events: auto;
}

.tutorial-dim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  pointer-events: none;
}

.tutorial-dim-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tutorial-highlights {
  position: absolute;
  inset: 0;
}

.tutorial-highlight {
  position: fixed;
  border: 2px solid rgba(130, 241, 255, 0.95);
  border-radius: var(--radius-card);
  box-shadow:
    0 0 0 1px rgba(130, 241, 255, 0.22),
    0 0 22px rgba(59, 242, 255, 0.55),
    inset 0 0 14px rgba(59, 242, 255, 0.2);
  pointer-events: none;
}

.tutorial-highlight.dimmed {
  box-shadow:
    0 0 0 200vmax rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(130, 241, 255, 0.28),
    0 0 24px rgba(59, 242, 255, 0.62),
    inset 0 0 14px rgba(59, 242, 255, 0.2);
}

.tutorial-highlight.dimmed.dimmed-secondary {
  box-shadow:
    0 0 0 200vmax rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(130, 241, 255, 0.28),
    0 0 24px rgba(59, 242, 255, 0.62),
    inset 0 0 14px rgba(59, 242, 255, 0.2);
}

.tutorial-bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tutorial-bubble {
  position: fixed;
  max-width: min(360px, calc(100vw - 16px));
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: #e8faff;
  line-height: 1.28;
  overflow: visible;
  z-index: 3;
}

.tutorial-bubble-content {
  position: absolute;
  display: block;
  z-index: 1;
}

.tutorial-bubble-measure {
  position: fixed;
  left: -9999px;
  top: -9999px;
  visibility: hidden;
  pointer-events: none;
}

.tutorial-bubble-measure-content {
  position: static;
  display: inline-block;
  color: #e8faff;
  line-height: 1.28;
}

.tutorial-bubble-shape {
  position: absolute;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
  max-width: none;
  filter:
    drop-shadow(0 18px 30px rgba(0, 0, 0, 0.48))
    drop-shadow(0 0 10px rgba(59, 242, 255, 0.18));
}

.tutorial-bubble-shape-path {
  stroke-linejoin: miter;
  vector-effect: non-scaling-stroke;
}

.tutorial-pointer-target {
  position: fixed;
  pointer-events: none;
  z-index: 2;
}

.tutorial-pointer-target-brackets {
  --tutorial-bracket-size: 12px;
  --tutorial-bracket-top-size: 12px;
  --tutorial-bracket-thickness: 2px;
  background:
    linear-gradient(rgba(181, 246, 255, 0.96), rgba(181, 246, 255, 0.96)) left top / var(--tutorial-bracket-size) var(--tutorial-bracket-thickness) no-repeat,
    linear-gradient(rgba(181, 246, 255, 0.96), rgba(181, 246, 255, 0.96)) left top / var(--tutorial-bracket-thickness) var(--tutorial-bracket-top-size) no-repeat,
    linear-gradient(rgba(181, 246, 255, 0.96), rgba(181, 246, 255, 0.96)) right top / var(--tutorial-bracket-size) var(--tutorial-bracket-thickness) no-repeat,
    linear-gradient(rgba(181, 246, 255, 0.96), rgba(181, 246, 255, 0.96)) right top / var(--tutorial-bracket-thickness) var(--tutorial-bracket-top-size) no-repeat,
    linear-gradient(rgba(181, 246, 255, 0.96), rgba(181, 246, 255, 0.96)) left bottom / var(--tutorial-bracket-size) var(--tutorial-bracket-thickness) no-repeat,
    linear-gradient(rgba(181, 246, 255, 0.96), rgba(181, 246, 255, 0.96)) left bottom / var(--tutorial-bracket-thickness) var(--tutorial-bracket-size) no-repeat,
    linear-gradient(rgba(181, 246, 255, 0.96), rgba(181, 246, 255, 0.96)) right bottom / var(--tutorial-bracket-size) var(--tutorial-bracket-thickness) no-repeat,
    linear-gradient(rgba(181, 246, 255, 0.96), rgba(181, 246, 255, 0.96)) right bottom / var(--tutorial-bracket-thickness) var(--tutorial-bracket-size) no-repeat;
  filter:
    drop-shadow(0 0 10px rgba(59, 242, 255, 0.58))
    drop-shadow(0 0 18px rgba(59, 242, 255, 0.24));
  animation: tutorial-pointer-brackets-pulse 1.4s ease-in-out infinite;
}

@keyframes tutorial-pointer-brackets-pulse {
  0%,
  100% {
    opacity: 0.92;
  }
  50% {
    opacity: 1;
  }
}

.tutorial-inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
  vertical-align: -0.12rem;
}

.tutorial-inline-icon svg {
  width: 0.95rem;
  height: 0.95rem;
  stroke-width: 2.4;
}

.tutorial-queue-icon-row {
  display: flex;
  gap: 0.28rem;
  margin-top: 0.7rem;
}

.tutorial-queue-icon-box {
  --kbd-border-color: rgba(95, 170, 219, 0.65);
  --kbd-background: linear-gradient(180deg, rgba(14, 31, 46, 0.92), rgba(9, 20, 30, 0.95));
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #d1f3ff;
}

.tutorial-queue-icon-box svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.6;
}

.tutorial-center-text {
  --shell-card-border-color: rgba(130, 241, 255, 0.95);
  --shell-card-background: linear-gradient(180deg, rgba(4, 12, 19, 0.98), rgba(2, 7, 12, 0.98));
  --shell-card-shadow: var(--shadow-shell-soft);
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(620px, calc(100vw - 24px));
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 0.85rem 0.95rem;
  color: #e8faff;
  line-height: 1.32;
  pointer-events: auto;
}

.tutorial-choice-row {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.tutorial-choice-btn {
  --button-border-color: rgba(130, 241, 255, 0.9);
  --button-background: linear-gradient(180deg, rgba(13, 34, 48, 0.98), rgba(7, 18, 27, 0.98));
  --button-text-color: #e8faff;
  --button-shadow: 0 12px 24px rgba(0, 0, 0, 0.35), inset 0 0 8px rgba(59, 242, 255, 0.16);
  --button-hover-border-color: rgba(164, 247, 255, 1);
  --button-hover-text-color: #e8faff;
  --button-hover-shadow:
    0 0 16px rgba(59, 242, 255, 0.28),
    0 12px 24px rgba(0, 0, 0, 0.4),
    inset 0 0 10px rgba(59, 242, 255, 0.22);
  min-width: 170px;
  min-height: 44px;
  padding: 0.65rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.tutorial-choice-btn.secondary {
  --button-border-color: rgba(132, 174, 198, 0.72);
  --button-background: linear-gradient(180deg, rgba(20, 27, 33, 0.96), rgba(11, 15, 20, 0.98));
  --button-text-color: rgba(224, 240, 247, 0.92);
  --button-hover-text-color: rgba(224, 240, 247, 0.92);
}

.tutorial-next-btn {
  position: fixed;
  right: 200px;
  bottom: 60px;
  min-width: 168px;
  min-height: 66px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  border-width: 2px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: auto;
  box-shadow: 0 0 28px rgba(59, 242, 255, 0.4), inset 0 0 10px rgba(59, 242, 255, 0.2);
}

.tutorial-next-btn.centered-below {
  left: 50%;
  right: auto;
  top: calc(50% + 92px);
  bottom: auto;
  transform: translateX(-50%);
}

.tutorial-next-btn-label {
  display: inline-flex;
  align-items: center;
}

.tutorial-next-btn-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 24px;
  padding: 0.12rem 0.45rem;
  border: 1px solid rgba(130, 241, 255, 0.7);
  border-radius: var(--radius-pill);
  background: rgba(9, 22, 33, 0.88);
  color: rgba(216, 246, 255, 0.92);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tutorial-next-btn-hint svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.3;
}

.tutorial-attention-pulse {
  border-color: rgba(130, 241, 255, 0.98) !important;
  color: #d9fbff !important;
  box-shadow:
    0 0 14px rgba(59, 242, 255, 0.82),
    0 0 24px rgba(130, 241, 255, 0.32),
    inset 0 0 10px rgba(59, 242, 255, 0.22);
  animation: tutorial-attention-pulse 1.35s ease-in-out infinite;
}

@keyframes tutorial-attention-pulse {
  0% {
    box-shadow:
      0 0 10px rgba(59, 242, 255, 0.54),
      0 0 18px rgba(130, 241, 255, 0.2),
      inset 0 0 8px rgba(59, 242, 255, 0.18);
  }
  50% {
    box-shadow:
      0 0 18px rgba(59, 242, 255, 0.82),
      0 0 30px rgba(130, 241, 255, 0.36),
      inset 0 0 12px rgba(59, 242, 255, 0.28);
  }
  100% {
    box-shadow:
      0 0 10px rgba(59, 242, 255, 0.54),
      0 0 18px rgba(130, 241, 255, 0.2),
      inset 0 0 8px rgba(59, 242, 255, 0.18);
  }
}

.tutorial-attention-pulse.queue-key-btn {
  border-color: transparent !important;
  box-shadow: none;
}

.tutorial-attention-pulse.queue-key-btn .queue-key-shell,
.tutorial-attention-pulse.queue-key-btn .queue-command-shell {
  animation: tutorial-attention-shell-pulse 1.35s ease-in-out infinite;
}

.tutorial-attention-pulse.queue-key-btn .queue-key-shell-outline,
.tutorial-attention-pulse.queue-key-btn .queue-command-shell-outline {
  stroke: rgba(180, 245, 255, 0.98);
}

.tutorial-attention-pulse.queue-key-btn .queue-key-shell-inline,
.tutorial-attention-pulse.queue-key-btn .queue-command-shell-inline {
  stroke: rgba(214, 250, 255, 0.34);
}

.tutorial-attention-pulse.queue-key-btn .queue-key-shell-fill,
.tutorial-attention-pulse.queue-key-btn .queue-command-shell-fill {
  fill: rgba(12, 31, 43, 0.98);
}

.tutorial-attention-pulse.queue-key-btn .queue-command-shell-accent {
  stroke: rgba(209, 248, 255, 0.98);
  filter: drop-shadow(0 0 8px rgba(130, 241, 255, 0.72));
}

.tutorial-attention-pulse.queue-key-btn > i {
  color: #f3fdff;
  filter:
    drop-shadow(0 0 8px rgba(130, 241, 255, 0.92))
    drop-shadow(0 0 14px rgba(59, 242, 255, 0.42));
}

@keyframes tutorial-attention-shell-pulse {
  0%,
  100% {
    filter:
      drop-shadow(0 0 12px rgba(59, 242, 255, 0.22))
      drop-shadow(0 0 18px rgba(130, 241, 255, 0.12));
  }
  50% {
    filter:
      drop-shadow(0 0 18px rgba(59, 242, 255, 0.52))
      drop-shadow(0 0 28px rgba(130, 241, 255, 0.28));
  }
}

.active-loop-panel {
  flex: 0 0 auto;
  height: var(--game-stage-top-strip-height);
  min-width: 0;
  min-height: var(--game-stage-top-strip-height);
  max-height: var(--game-stage-top-strip-height);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.active-loop-panel-header {
  padding: 0.34rem 0.58rem 0.24rem;
  background:
    linear-gradient(180deg, rgba(13, 27, 39, 0.94), rgba(8, 18, 28, 0.98)),
    linear-gradient(90deg, rgba(72, 211, 255, 0.08), transparent 36%);
}

.active-loop-panel h2 {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: rgba(174, 232, 246, 0.92);
}

.active-loop-panel .active-loop-review-list {
  margin-top: 0;
}

.active-loop-append-btn {
  margin-top: 0;
  flex: 0 0 auto;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.active-loop-append-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.queue-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0;
  padding: 0.7rem 0.78rem 0.62rem;
  border-bottom: 1px solid rgba(79, 143, 183, 0.26);
  background:
    linear-gradient(180deg, rgba(13, 27, 39, 0.92), rgba(8, 18, 28, 0.96)),
    linear-gradient(90deg, rgba(72, 211, 255, 0.06), transparent 36%);
}

.queue-panel h2 {
  margin-bottom: 0;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  color: rgba(174, 232, 246, 0.88);
}

.queue-panel-header-btn {
  margin-top: 0;
  padding: 0.28rem 0.62rem;
  min-height: 30px;
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  --button-border-color: rgba(102, 168, 211, 0.42);
  --button-background: rgba(8, 18, 28, 0.72);
  --button-text-color: rgba(205, 240, 250, 0.86);
  --button-hover-border-color: rgba(156, 230, 252, 0.82);
}

.queue-panel .queue-editor-list {
  display: grid;
  margin: 0;
  padding: 0.34rem 0.38rem var(--queue-scroll-trailing-space, 0px);
  background:
    linear-gradient(180deg, rgba(8, 18, 27, 0.68), rgba(5, 11, 17, 0.78)),
    repeating-linear-gradient(
      to bottom,
      rgba(104, 199, 240, 0.03) 0,
      rgba(104, 199, 240, 0.03) 1px,
      transparent 1px,
      transparent 5px
    );
}

.queue-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.queue-runtime-status {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(75, 130, 170, 0.52);
  background: linear-gradient(180deg, rgba(7, 12, 18, 0.9), rgba(4, 8, 13, 0.94));
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.42),
    inset 0 0 18px rgba(90, 191, 255, 0.08);
  color: var(--ink);
  text-align: center;
  pointer-events: none;
}

.queue-runtime-status[data-runtime-state="prompt"] {
  border-color: rgba(255, 179, 71, 0.65);
  background: linear-gradient(180deg, rgba(30, 18, 6, 0.94), rgba(15, 9, 4, 0.96));
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.46),
    0 0 24px rgba(255, 176, 67, 0.15),
    inset 0 0 18px rgba(255, 176, 67, 0.09);
  color: #ffe4b5;
  pointer-events: auto;
}

.queue-runtime-status[data-runtime-state="active"] {
  border-color: rgba(59, 242, 255, 0.7);
  background: linear-gradient(180deg, rgba(5, 19, 26, 0.94), rgba(3, 11, 16, 0.96));
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.46),
    0 0 28px rgba(59, 242, 255, 0.16),
    inset 0 0 18px rgba(59, 242, 255, 0.09);
  color: #bffaff;
}

.queue-runtime-status-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.queue-runtime-status-body {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  line-height: 1.35;
  font-family: var(--font-mono);
}

.queue-runtime-status-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.queue-runtime-status-action {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 11.5rem;
  justify-content: center;
  padding: 0.62rem 0.9rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  --button-border-color: rgba(255, 188, 96, 0.52);
  --button-background: linear-gradient(180deg, rgba(59, 37, 10, 0.94), rgba(30, 18, 6, 0.98));
  --button-text-color: #fff0cf;
  --button-hover-border-color: rgba(255, 212, 143, 0.88);
  --button-hover-text-color: #fff6e4;
  --button-hover-shadow:
    0 0 18px rgba(255, 176, 67, 0.18),
    inset 0 0 10px rgba(255, 206, 128, 0.12);
}

.queue-runtime-status-hotkey {
  min-width: 1.45rem;
  padding: 0.12rem 0.36rem;
  border: 1px solid rgba(255, 222, 166, 0.34);
  border-radius: 999px;
  background: rgba(255, 226, 168, 0.08);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1;
}

.queue-bar[data-manual-control-state="prompt"] .queue-panel > :not(.queue-runtime-status),
.queue-bar[data-manual-control-state="active"] .queue-panel > :not(.queue-runtime-status) {
  opacity: 0.18;
  filter: saturate(0.45) blur(1.6px);
  transform: scale(0.988);
  transition: opacity 160ms ease, filter 160ms ease, transform 160ms ease;
}

.queue-bar[data-manual-control-state="prompt"] .queue-panel-header-btn,
.queue-bar[data-manual-control-state="active"] .queue-panel-header-btn {
  opacity: 0;
}

.queue-bar[data-manual-control-state="prompt"] .queue-editor-list,
.queue-bar[data-manual-control-state="active"] .queue-editor-list,
.active-loop-panel[data-manual-control-state="prompt"] .active-loop-review-list,
.active-loop-panel[data-manual-control-state="prompt"] .active-loop-append-btn,
.active-loop-panel[data-manual-control-state="active"] .active-loop-review-list,
.active-loop-panel[data-manual-control-state="active"] .active-loop-append-btn {
  pointer-events: none;
}

.panel .queue-controls button {
  --button-active-border-color: var(--accent);
  --button-active-text-color: var(--accent);
  width: 34px;
  height: 34px;
  margin-top: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.panel .queue-controls button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

#clear-queue {
  --clear-hold-progress: 0%;
  position: relative;
  overflow: hidden;
}

#clear-queue::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--clear-hold-progress);
  background: rgba(255, 73, 110, 0.34);
  pointer-events: none;
}

#clear-queue:is(.is-hold-active, .hold-active) {
  border-color: var(--bad);
}

#clear-queue > * {
  position: relative;
  z-index: 1;
}

.map-log-panel .action-log {
  max-height: none;
  pointer-events: none;
  flex: 1 1 auto;
}

.map-log-panel.expanded .action-log {
  max-height: 75dvh;
  overflow-y: auto;
  padding: 0.72rem 0.85rem;
  padding-right: 1rem;
  border: 1px solid rgba(75, 130, 170, 0.42);
  background: rgba(7, 12, 18, 0.72);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(2px);
  align-content: start;
  grid-auto-rows: max-content;
  pointer-events: auto;
}

#action-log {
  list-style: none;
  display: grid;
  gap: 0.26rem;
}

#action-log li {
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.15;
}

.queue-editor-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  flex: 1 1 auto;
  gap: 0.28rem;
  min-height: 0;
  overflow-y: auto;
  max-height: none;
  align-content: start;
  grid-auto-rows: max-content;
}

.queue-editor-list > li:not(.queue-editor-item) {
  padding: 0.85rem 0.75rem;
  border: 1px dashed rgba(95, 154, 190, 0.38);
  background: rgba(8, 18, 27, 0.72);
  color: rgba(177, 214, 229, 0.72);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

.active-loop-review-list {
  padding: 0.08rem 0.3rem 0.2rem;
  list-style: none;
  display: flex;
  gap: 0.26rem;
  overflow-y: hidden;
}

.queue-editor-entry {
  --queue-editor-entry-accent: rgba(122, 217, 246, 0.82);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.62rem;
  border: 1px solid rgba(76, 127, 160, 0.38);
  border-left: 3px solid var(--queue-editor-entry-accent);
  background:
    linear-gradient(90deg, rgba(122, 217, 246, 0.04), transparent 34%),
    linear-gradient(180deg, rgba(12, 24, 35, 0.88), rgba(7, 14, 22, 0.94));
  box-shadow: inset 0 0 0 1px rgba(4, 10, 15, 0.4);
  overflow: hidden;
  min-height: 36px;
  padding: 0.28rem 0.38rem 0.28rem 0.56rem;
  cursor: grab;
}

.queue-editor-entry[data-queue-type="move"] {
  --queue-editor-entry-accent: rgba(122, 217, 246, 0.82);
}

.queue-editor-entry[data-queue-type="interact"] {
  --queue-editor-entry-accent: rgba(84, 255, 193, 0.9);
}

.queue-editor-entry[data-queue-type="speak"] {
  --queue-editor-entry-accent: rgba(255, 196, 108, 0.88);
}

.queue-editor-entry[data-queue-type="fight"] {
  --queue-editor-entry-accent: rgba(255, 107, 135, 0.92);
}

.queue-editor-entry.is-zero {
  opacity: 0.5;
}

.queue-editor-entry.is-locked {
  cursor: default;
  opacity: 0.72;
}

.queue-editor-entry.is-dragging {
  opacity: 0.45;
}

.queue-editor-entry.is-hovered {
  background:
    linear-gradient(90deg, rgba(56, 186, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(14, 31, 44, 0.92), rgba(8, 19, 29, 0.96));
  border-color: rgba(88, 193, 240, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(56, 186, 255, 0.18),
    0 0 16px rgba(56, 186, 255, 0.08);
}

.queue-editor-entry.is-selected {
  background:
    linear-gradient(90deg, rgba(0, 255, 204, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(12, 30, 30, 0.94), rgba(7, 18, 20, 0.98));
  border-color: rgba(0, 255, 204, 0.54);
  box-shadow:
    inset 0 0 0 1px rgba(0, 255, 204, 0.16),
    0 0 18px rgba(0, 255, 204, 0.08);
}

.queue-editor-item-label {
  font-size: 0.8rem;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 0.42rem;
  min-height: 20px;
  min-width: 0;
}

.queue-editor-item-label svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.25;
  color: var(--queue-editor-entry-accent);
  filter: drop-shadow(0 0 8px rgba(73, 215, 255, 0.16));
}

.queue-editor-item-count {
  margin-left: auto;
  color: rgba(228, 247, 255, 0.9);
  font-size: 0.72rem;
  min-width: 2.25em;
  text-align: right;
  letter-spacing: 0.06em;
}

.queue-editor-entry .queue-editor-item-controls {
  display: flex;
  align-items: center;
  gap: 0.22rem;
  flex-shrink: 0;
}

.queue-editor-entry .queue-editor-item-controls button {
  --button-border-color: rgba(86, 145, 181, 0.34);
  --button-background: rgba(8, 18, 28, 0.76);
  --button-text-color: rgba(215, 240, 248, 0.86);
  --button-hover-border-color: rgba(159, 231, 251, 0.68);
  margin-top: 0;
  padding: 0.12rem;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.queue-editor-entry .queue-editor-item-controls button svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.25;
}

.loop-review-entry {
  --loop-review-entry-accent: rgba(122, 217, 246, 0.82);
  position: relative;
  cursor: default;
  display: flex;
  flex: 0 0 52px;
  height:34px;
  padding: 0.16rem 0.22rem 0.18rem;
  border: 1px solid rgba(76, 127, 160, 0.38);
  border-top: 3px solid var(--loop-review-entry-accent);
}

.loop-review-entry[data-queue-type="move"] {
  --loop-review-entry-accent: rgba(122, 217, 246, 0.82);
}

.loop-review-entry[data-queue-type="interact"] {
  --loop-review-entry-accent: rgba(84, 255, 193, 0.9);
}

.loop-review-entry[data-queue-type="speak"] {
  --loop-review-entry-accent: rgba(255, 196, 108, 0.88);
}

.loop-review-entry[data-queue-type="fight"] {
  --loop-review-entry-accent: rgba(255, 107, 135, 0.92);
}

.active-loop-panel[data-loop-review-preview="true"] .loop-review-entry.is-previewed {
  background:
    linear-gradient(180deg, rgba(10, 19, 30, 0.94), rgba(5, 11, 18, 0.98)),
    linear-gradient(180deg, color-mix(in srgb, var(--loop-review-entry-accent) 14%, transparent), transparent 55%);
  border-color: color-mix(in srgb, var(--loop-review-entry-accent) 72%, rgba(76, 127, 160, 0.38));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--loop-review-entry-accent) 42%, transparent),
    inset 0 0 0 1px rgba(4, 10, 15, 0.4),
    inset 0 10px 18px color-mix(in srgb, var(--loop-review-entry-accent) 10%, transparent);
}

.active-loop-panel[data-loop-review-preview="true"] {
  filter: hue-rotate(-10deg) saturate(0.88) brightness(1.02);
}

.queue-bar[data-loop-review-preview="true"] {
  filter: hue-rotate(-10deg) saturate(0.88) brightness(1.02);
}

.ui-bar[data-loop-review-preview="true"] {
  filter: hue-rotate(-10deg) saturate(0.88) brightness(1.02);
}

.loop-review-item-label {
  font-size: 0.8rem;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 0.42rem;
  min-height: 20px;
  min-width: 0;
}

.loop-review-entry .loop-review-item-label {
  justify-content: flex-start;
  width: 100%;
}

.active-loop-entry-content {
  position: relative;
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  justify-content: stretch;
  align-items: stretch;
}

.active-loop-main-row {
  position: absolute;
  left: 0;
  top: 50%;
  min-height: 0;
  width: auto;
  gap: 0.1rem;
  transform: translateY(-50%);
}

.loop-review-item-label svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.1;
  color: var(--loop-review-entry-accent);
  filter: drop-shadow(0 0 8px rgba(73, 215, 255, 0.16));
}

.loop-review-item-count {
  margin-left: 0;
  color: rgba(228, 247, 255, 0.92);
  font-size: 0.58rem;
  min-width: 0;
  text-align: left;
  letter-spacing: 0.04em;
}

.active-loop-badges {
  position: absolute;
  top: 50%;
  right: 0;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.18rem;
  min-height: 0;
  justify-content: center;
  align-items: flex-end;
  flex: 0 0 auto;
  z-index: 1;
  transform: translateY(-50%);
}

.active-loop-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.46rem;
  height: 0.46rem;
  min-height: 0.46rem;
  padding: 0;
  border: 1px solid rgba(92, 154, 196, 0.5);
  border-radius: var(--radius-pill);
  background: rgba(7, 18, 27, 0.9);
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
}

.active-loop-badge[data-badge-kind="data_card_gained"] {
  border-color: rgba(59, 242, 255, 0.72);
  background: rgba(59, 242, 255, 0.86);
}

.active-loop-badge[data-badge-kind="stat_upgrade"] {
  border-color: rgba(55, 255, 182, 0.7);
  background: rgba(55, 255, 182, 0.84);
}

.active-loop-badge[data-badge-kind="memory_archive"] {
  border-color: rgba(255, 179, 71, 0.72);
  background: rgba(255, 179, 71, 0.88);
}

.active-loop-badge[data-badge-kind="terminal_data_cards_left"] {
  border-color: rgba(255, 216, 107, 0.72);
  background: rgba(255, 216, 107, 0.9);
}

.active-loop-badge[data-badge-kind="fight_action"] {
  border-color: rgba(255, 109, 135, 0.7);
  background: rgba(255, 109, 135, 0.88);
}

.active-loop-badge[data-badge-kind="skill_level_up"] {
  border-color: rgba(140, 217, 255, 0.68);
  background: rgba(140, 217, 255, 0.84);
}

.active-loop-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.active-loop-slice {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.active-loop-slice-fill {
  height: 100%;
  width: 0%;
  background: rgba(59, 242, 255, 0.4);
}

.loop-review-entry[data-manual-executions="true"] .active-loop-slice-fill {
  background: rgba(255, 179, 71, 0.58);
}

.active-loop-current {
  border-color: rgba(59, 242, 255, 0.9);
}

.loop-review-entry > :not(.active-loop-bg) {
  position: relative;
  z-index: 1;
}

.active-loop-append-slot {
  margin: 0;
  border-left: 0;
}

.active-loop-review-list .active-loop-append-btn {
  --button-border-color: rgba(86, 145, 181, 0.42);
  --button-background:
    linear-gradient(180deg, rgba(12, 24, 35, 0.92), rgba(7, 14, 22, 0.96));
  --button-text-color: rgba(215, 240, 248, 0.9);
  --button-hover-border-color: rgba(159, 231, 251, 0.68);
  width: 34px;
  height: 34px;
  border-radius: 0;
  border-width: 1px;
  border-style: solid;
  box-shadow: inset 0 0 0 1px rgba(4, 10, 15, 0.4);
}

.active-loop-review-list .active-loop-append-btn:disabled {
  opacity: 1;
  cursor: default;
  --button-border-color: rgba(85, 196, 158, 0.52);
  --button-background:
    linear-gradient(180deg, rgba(10, 31, 28, 0.94), rgba(6, 18, 18, 0.98));
  --button-text-color: rgba(185, 255, 223, 0.96);
}

.skills-list {
  display: grid;
  gap: 0.45rem;
}

.skill-row {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(69, 130, 173, 0.55);
  background:
    linear-gradient(180deg, rgba(10, 22, 33, 0.84), rgba(6, 14, 21, 0.9)),
    repeating-linear-gradient(
      to bottom,
      rgba(104, 199, 240, 0.03) 0,
      rgba(104, 199, 240, 0.03) 1px,
      transparent 1px,
      transparent 4px
    );
  box-shadow:
    inset 0 0 18px rgba(59, 242, 255, 0.05),
    0 0 0 1px rgba(109, 194, 255, 0.08);
}

.skill-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.42rem 0.55rem 0.46rem;
  gap: 0.7rem;
}

.skill-main {
  min-width: 0;
  display: grid;
  gap: 0.16rem;
  flex: 1 1 auto;
}

.skill-header {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.skill-label {
  font-size: 0.9rem;
  line-height: 1.05;
  min-width: 0;
}

.skill-meta {
  display: grid;
  justify-items: end;
  align-self: center;
  flex: 0 0 auto;
}

.skill-level {
  flex: 0 0 auto;
  min-width: 1.7rem;
  padding: 0.12rem 0.38rem 0.08rem;
  border: 1px solid rgba(107, 205, 241, 0.52);
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, rgba(13, 39, 54, 0.85), rgba(8, 22, 32, 0.92));
  color: #dff9ff;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  box-shadow:
    inset 0 0 8px rgba(59, 242, 255, 0.12),
    0 0 12px rgba(59, 242, 255, 0.08);
}

.skill-bands {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.22rem;
  min-height: 30px;
}

.skill-band-column {
  height: 30px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: center;
  gap: 2px;
}

.skill-band {
  width: 14px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, rgba(55, 255, 182, 0.92), rgba(59, 242, 255, 0.95));
  box-shadow:
    0 0 10px rgba(59, 242, 255, 0.42),
    inset 0 0 6px rgba(227, 255, 255, 0.24);
}

.skill-band-ghost {
  background: linear-gradient(90deg, rgba(110, 183, 212, 0.18), rgba(102, 233, 255, 0.28));
  box-shadow:
    0 0 8px rgba(59, 242, 255, 0.08),
    inset 0 0 6px rgba(209, 247, 255, 0.08);
  opacity: 0.8;
}

.skill-next {
  font-size: 0.64rem;
  color: rgba(187, 234, 247, 0.86);
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.debug-menu {
  --shell-card-border-color: var(--line);
  --shell-card-background: rgba(5, 11, 17, 0.94);
  --shell-card-shadow: none;
  position: fixed;
  right: 12px;
  bottom: 12px;
  display: grid;
  gap: 0.4rem;
  padding: 0.55rem;
  z-index: 30;
  width: 280px;
}

.debug-menu.hidden {
  display: none;
}

#dev-speed,
#dev-combat,
#dev-efficiency {
  --button-active-border-color: var(--accent);
  --button-active-text-color: var(--accent);
}

.debug-metric {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.2;
}

.pause-menu {
  --scrim-background:
    radial-gradient(circle at 50% 22%, rgba(58, 193, 255, 0.08), transparent 30%),
    var(--surface-overlay-medium);
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.pause-menu-card {
  --shell-card-border-color: rgba(92, 196, 255, 0.46);
  --shell-card-background:
    linear-gradient(180deg, rgba(6, 14, 22, 0.98), rgba(3, 8, 14, 0.98)),
    repeating-linear-gradient(
      to bottom,
      rgba(95, 207, 255, 0.028) 0,
      rgba(95, 207, 255, 0.028) 1px,
      transparent 1px,
      transparent 5px
    );
  --shell-card-shadow:
    0 0 0 1px rgba(98, 218, 255, 0.16),
    0 26px 54px rgba(0, 0, 0, 0.58),
    inset 0 0 30px rgba(59, 242, 255, 0.05);
  width: min(420px, calc(100% - 2rem));
  padding: 1rem 1rem 1.05rem;
  display: grid;
  gap: 0.68rem;
  position: relative;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

.pause-menu-card h2,
.pause-menu-card p {
  margin: 0;
}

.pause-menu-card h2 {
  font-size: 1.12rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-accent-strong);
  text-shadow: 0 0 14px rgba(59, 242, 255, 0.12);
}

.pause-menu-card p {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: var(--color-text-soft);
  font-size: 0.72rem;
  line-height: 1.35;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: right;
}

.pause-menu-card button {
  --pause-button-accent: rgba(102, 233, 255, 0.32);
  --button-border-color: rgba(78, 144, 187, 0.44);
  --button-background:
    linear-gradient(180deg, rgba(10, 23, 35, 0.96), rgba(6, 13, 21, 0.98));
  --button-text-color: var(--color-text-soft);
  --button-shadow:
    inset 0 0 0 1px rgba(109, 194, 255, 0.05),
    0 12px 22px rgba(0, 0, 0, 0.24);
  --button-hover-border-color: rgba(124, 220, 255, 0.78);
  --button-hover-text-color: var(--color-text-bright);
  --button-hover-shadow:
    0 0 0 1px rgba(88, 212, 255, 0.18),
    0 0 22px rgba(59, 242, 255, 0.14),
    inset 0 0 12px rgba(59, 242, 255, 0.08);
  width: 100%;
  min-height: 52px;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
  padding: 0.76rem 0.95rem 0.76rem 2.7rem;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transform: translateX(0);
  transition:
    transform var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard),
    box-shadow var(--duration-base) var(--ease-standard),
    color var(--duration-base) var(--ease-standard),
    background var(--duration-base) var(--ease-standard);
}

.pause-menu-card button::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 1.85rem;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--pause-button-accent) 68%, transparent), transparent),
    linear-gradient(90deg, var(--pause-button-accent), transparent);
  border-right: 1px solid color-mix(in srgb, var(--pause-button-accent) 68%, transparent);
  opacity: 0.94;
}

.pause-menu-card button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(102, 233, 255, 0.12) 55%, transparent 100%);
  transform: translateX(-100%);
  opacity: 0;
  transition:
    transform var(--duration-slow) var(--ease-emphasis),
    opacity var(--duration-base) var(--ease-standard);
}

.pause-menu-card button:hover {
  transform: translateX(4px);
}

.pause-menu-card button:hover::after {
  transform: translateX(0);
  opacity: 1;
}

#pause-menu-resume {
  --pause-button-accent: rgba(96, 223, 255, 0.52);
  --button-border-color: rgba(96, 223, 255, 0.78);
  --button-background:
    linear-gradient(180deg, rgba(11, 40, 56, 0.98), rgba(6, 17, 27, 0.98));
  --button-text-color: #f0fdff;
  --button-shadow:
    0 0 0 1px rgba(88, 212, 255, 0.18),
    0 0 24px rgba(59, 242, 255, 0.14),
    inset 0 0 14px rgba(59, 242, 255, 0.1);
}

#pause-menu-settings {
  --pause-button-accent: rgba(89, 180, 235, 0.36);
  --button-border-color: rgba(89, 180, 235, 0.52);
}

#pause-menu-mechanics {
  --pause-button-accent: rgba(86, 241, 181, 0.34);
  --button-border-color: rgba(86, 241, 181, 0.44);
  --button-hover-border-color: rgba(118, 255, 206, 0.74);
  --button-hover-shadow:
    0 0 0 1px rgba(86, 241, 181, 0.16),
    0 0 22px rgba(86, 241, 181, 0.12),
    inset 0 0 12px rgba(86, 241, 181, 0.07);
}

#pause-menu-save-quit {
  --pause-button-accent: rgba(255, 179, 71, 0.34);
  --button-border-color: rgba(255, 179, 71, 0.46);
  --button-hover-border-color: rgba(255, 207, 138, 0.76);
  --button-hover-shadow:
    0 0 0 1px rgba(255, 179, 71, 0.16),
    0 0 22px rgba(255, 179, 71, 0.12),
    inset 0 0 12px rgba(255, 179, 71, 0.08);
}

.pause-menu kbd {
  --kbd-border-color: var(--line);
  padding: 0.08rem 0.36rem;
  font-size: 0.84em;
}

.story-intro-modal {
  position: fixed;
  inset: 0;
  z-index: 37;
  display: grid;
  place-items: center;
  background: #000;
}

.story-intro-content {
  width: min(800px, calc(100% - 3rem));
  padding: 0;
  display: grid;
  gap: 0.85rem;
  text-align: center;
  pointer-events: none;
  opacity: 1;
  transition: opacity 500ms linear;
}

.story-intro-content.is-faded {
  opacity: 0;
}

.story-intro-content p {
  margin: 0;
}

.story-intro-content p {
  color: #f2fbff;
  line-height: 1.4;
  font-size: 2.16rem;
  text-shadow: 0 0 10px rgba(88, 219, 255, 0.12);
}

.new-game-confirm-modal {
  --scrim-background: var(--surface-overlay-medium-strong);
  --scrim-blur: 2px;
  position: fixed;
  inset: 0;
  z-index: 38;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.new-game-confirm-card {
  --shell-card-border-color: var(--color-border-panel-strong);
  --shell-card-background: var(--gradient-surface-modal);
  --shell-card-shadow: var(--shadow-modal);
  width: min(430px, 100%);
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
}

.new-game-confirm-card h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-accent);
}

.new-game-confirm-card p {
  margin: 0;
  color: var(--color-text-soft);
}

.new-game-confirm-actions {
  display: flex;
  justify-content: flex-start;
  gap: 0.6rem;
}

.demo-notice-modal {
  --scrim-background: var(--surface-overlay-strong);
  --scrim-blur: 2px;
  position: fixed;
  inset: 0;
  z-index: 38;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.demo-notice-card {
  --shell-card-border-color: rgba(108, 210, 255, 0.5);
  --shell-card-background:
    linear-gradient(180deg, rgba(8, 19, 31, 0.98), rgba(4, 10, 18, 0.985));
  --shell-card-shadow:
    0 22px 46px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(109, 194, 255, 0.08);
  width: min(520px, 100%);
  display: grid;
  gap: 0.9rem;
  padding: 1rem 1rem 1.05rem;
}

.demo-notice-eyebrow {
  display: inline-flex;
  justify-self: start;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(108, 210, 255, 0.4);
  background: rgba(13, 29, 44, 0.82);
  color: rgba(195, 238, 255, 0.8);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.demo-notice-card h2 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-accent-strong);
}

.demo-notice-body {
  display: grid;
  gap: 0.7rem;
}

.demo-notice-body p {
  margin: 0;
  color: var(--color-text-soft);
  line-height: 1.4;
}

.demo-notice-actions {
  display: flex;
  justify-content: flex-end;
}

#confirm-new-game.is-holding {
  border-color: rgba(102, 233, 255, 0.9);
  color: #c8f6ff;
  background:
    linear-gradient(
      90deg,
      rgba(35, 118, 163, 0.45) 0,
      rgba(35, 118, 163, 0.45) var(--hold-progress, 0%),
      rgba(8, 15, 23, 0.95) var(--hold-progress, 0%),
      rgba(8, 15, 23, 0.95) 100%
    );
  box-shadow: 0 0 24px rgba(59, 242, 255, 0.34), inset 0 0 10px rgba(59, 242, 255, 0.16);
}

.new-game-fade {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 500ms linear;
}

.new-game-fade.active {
  opacity: 1;
}

.new-game-fade.no-transition {
  transition: none;
}

.session-loading-screen {
  position: fixed;
  inset: 0;
  z-index: 49;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(32, 76, 110, 0.16), transparent 38%),
    rgba(3, 6, 10, 0.96);
  pointer-events: auto;
}

.audio-unlock-overlay {
  position: fixed;
  inset: 0;
  z-index: 48;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  padding-bottom: min(10vh, 72px);
  background: linear-gradient(180deg, rgba(3, 6, 10, 0.08), rgba(3, 6, 10, 0.28));
  pointer-events: auto;
  opacity: 1;
  transition: opacity 320ms ease;
}

.audio-unlock-overlay.is-dismissing {
  opacity: 0;
  pointer-events: none;
}

.audio-unlock-hint {
  color: rgba(182, 226, 244, 0.5);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  width: 100%;
  text-align: center;
}

.session-loading-card {
  --shell-card-border-color: rgba(98, 218, 255, 0.42);
  --shell-card-background:
    linear-gradient(180deg, rgba(6, 16, 24, 0.96), rgba(3, 8, 13, 0.98)),
    repeating-linear-gradient(
      to bottom,
      rgba(95, 207, 255, 0.03) 0,
      rgba(95, 207, 255, 0.03) 1px,
      transparent 1px,
      transparent 4px
    );
  --shell-card-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), inset 0 0 28px rgba(59, 242, 255, 0.08);
  min-width: min(420px, calc(100vw - 32px));
  padding: 1rem 1.1rem;
  text-align: center;
}

.session-loading-label {
  color: var(--color-text-accent);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.session-loading-text {
  margin-top: 0.45rem;
  color: var(--color-text-bright);
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.story-word-static {
  color: #8adfff;
  display: inline-block;
  animation: story-word-jitter-static 1500ms steps(1, end) infinite;
}

.story-word-heat {
  color: #ff8b52;
  display: inline-flex;
}

.story-word-heat-letter {
  display: inline-block;
  animation: story-word-heat-wave 5600ms ease-in-out infinite;
  transform-origin: center bottom;
}

.story-word-heat-letter:nth-child(2) {
  animation-delay: 0.28s;
}

.story-word-heat-letter:nth-child(3) {
  animation-delay: 0.56s;
}

.story-word-heat-letter:nth-child(4) {
  animation-delay: 0.84s;
}

.story-word-hum {
  display: inline-block;
  animation: story-word-jitter-fast 180ms steps(1, end) infinite;
}

.story-word-emphasis {
  font-weight: 700;
}

.story-word-steel {
  display: inline-block;
  color: transparent;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  background-image: linear-gradient(
    115deg,
    #b9c2cc 0%,
    #b9c2cc 36%,
    #f5fbff 47%,
    #ffffff 50%,
    #d7e5ef 53%,
    #b9c2cc 64%,
    #b9c2cc 100%
  );
  background-size: 240% 100%;
  background-position: 150% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: story-word-steel-glint 3200ms ease-in-out infinite;
}

.story-word-muscle {
  transform: scaleX(1.36) scaleY(0.88);
  display: inline-block;
  margin: 0 0.5em;
}

.story-word-mind {
  color: #ffacc7;
  white-space: nowrap;
}

.story-word-mind-letter {
  display: inline-block;
  animation: story-word-mind-wave 2.2s ease-in-out infinite;
}

.story-word-mind-letter:nth-child(2) {
  animation-delay: 0.15s;
}

.story-word-mind-letter:nth-child(3) {
  animation-delay: 0.3s;
}

.story-word-mind-letter:nth-child(4) {
  animation-delay: 0.45s;
}

.story-word-housed {
  display: inline-block;
  line-height: 1.2;
  border: 3px solid rgba(242, 248, 255, 0.95);
  padding: 0 0.2em;
}

.story-word-hud-alert {
  color: #ff3f4d;
  display: inline-block;
  text-shadow: 0 0 10px rgba(255, 63, 77, 0.45);
  animation: story-word-hud-pulse var(--story-alert-pulse-duration, 2550ms) ease-in-out infinite;
  animation-delay: var(--story-alert-pulse-delay, 0ms);
  animation-fill-mode: both;
}

.story-word-critically-low {
  font-size: 0.68em;
}

.story-word-fast {
  display: inline-block;
  transform: skewX(-22deg);
}

.story-word-out-of-reach {
  display: inline-block;
  letter-spacing: 0.14em;
  padding-right: 0.14em;
}

.story-word-waver {
  display: inline-block;
  animation: story-word-jitter-soft 1600ms steps(1, end) infinite;
}

.story-word-battery {
  display: inline-block;
  font-weight: 700;
  color: transparent;
  background-image: linear-gradient(90deg, #ff5d55 0%, #ffb45a 44%, #a8ff8a 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.story-word-power-drain {
  display: inline;
}

.story-word-power-drain-word {
  display: inline-flex;
  white-space: nowrap;
}

.story-word-power-drain-letter {
  display: inline-block;
  opacity: calc(1 - (var(--story-dim, 0) * 0.018));
}

.story-word-scrapyard-word,
.story-word-rusted-frames-word {
  display: inline-flex;
  white-space: nowrap;
}

.story-word-scrapyard-word > span,
.story-word-rusted-frames-word > span {
  display: inline-block;
}

.story-word-scrapyard-word > span:nth-child(1) { font-size: 1.02em; }
.story-word-scrapyard-word > span:nth-child(2) { font-size: 0.9em; }
.story-word-scrapyard-word > span:nth-child(3) { font-size: 0.84em; }
.story-word-scrapyard-word > span:nth-child(4) { font-size: 1em; }
.story-word-scrapyard-word > span:nth-child(5) { font-size: 1.1em; }
.story-word-scrapyard-word > span:nth-child(6) { font-size: 0.94em; }
.story-word-scrapyard-word > span:nth-child(7) { font-size: 0.88em; }
.story-word-scrapyard-word > span:nth-child(8) { font-size: 1.12em; }

.story-word-rusted-frames-word > span:nth-child(1) { color: #ffbc8c; }
.story-word-rusted-frames-word > span:nth-child(2) { color: #f6af81; }
.story-word-rusted-frames-word > span:nth-child(3) { color: #eca276; }
.story-word-rusted-frames-word > span:nth-child(4) { color: #e3966c; }
.story-word-rusted-frames-word > span:nth-child(5) { color: #d98961; }
.story-word-rusted-frames-word > span:nth-child(6) { color: #cf7c56; }
.story-word-rusted-frames-word > span:nth-child(7) { color: #c66f4c; }
.story-word-rusted-frames-word > span:nth-child(8) { color: #bc6241; }
.story-word-rusted-frames-word > span:nth-child(9) { color: #b25536; }
.story-word-rusted-frames-word > span:nth-child(10) { color: #a8482c; }
.story-word-rusted-frames-word > span:nth-child(11) { color: #9f3b21; }
.story-word-rusted-frames-word > span:nth-child(12) { color: #952e16; }
.story-word-rusted-frames-word > span:nth-child(13) { color: #8b210c; }

.story-word-loops {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.02em;
  white-space: nowrap;
}

.story-word-loop-spinner {
  width: 0.6em;
  height: 0.6em;
  border-radius: var(--radius-pill);
  margin-bottom: 0.25em;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: rgba(255, 255, 255, 0.95);
  display: inline-block;
  vertical-align: text-bottom;
  transform-origin: center;
  animation: story-word-loop-spin 700ms linear infinite;
}

.story-word-blink-back {
  display: inline-block;
  animation: story-word-blink-back 1750ms steps(1, end) infinite;
}

.story-word-echo {
  display: inline-block;
  text-shadow: 4px 4px 0 rgb(64 166 255 / 55%);
}

.story-intro-hint {
  position: fixed;
  right: 1rem;
  bottom: 0.85rem;
  color: rgba(192, 236, 255, 0.85);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes story-word-mind-wave {
  0%,
  100% { transform: translateY(1px); }
  50% { transform: translateY(-4px); }
}

@keyframes story-word-loop-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes story-word-blink-back {
  0%,
  16%,
  100% {
    opacity: 1;
    text-shadow: 0 0 0 rgba(140, 220, 255, 0);
  }
  4% {
    opacity: 0.2;
    text-shadow: 0 0 10px rgba(140, 220, 255, 0.18);
  }
  8% {
    opacity: 0.92;
    text-shadow: 0 0 12px rgba(140, 220, 255, 0.22);
  }
  12% {
    opacity: 0.35;
    text-shadow: 0 0 8px rgba(140, 220, 255, 0.14);
  }
}

@keyframes story-word-jitter-soft {
  0%,
  84%,
  100% { transform: translate(0, 0); }
  85% { transform: translate(1px, 0); }
  86% { transform: translate(-1px, 0); }
}

@keyframes story-word-jitter-static {
  0% { transform: translate(0, 0); }
  18% { transform: translate(1px, -1px); }
  22% { transform: translate(-1px, 1px); }
  36% { transform: translate(0, 0); }
  52% { transform: translate(2px, 0); }
  58% { transform: translate(-2px, -1px); }
  70% { transform: translate(1px, 1px); }
  82% { transform: translate(0, 0); }
  100% { transform: translate(0, 0); }
}

@keyframes story-word-jitter-fast {
  0% { transform: translate(0, 0); }
  25% { transform: translate(1px, 0); }
  50% { transform: translate(-1px, 0); }
  75% { transform: translate(1px, -1px); }
  100% { transform: translate(0, 0); }
}

@keyframes story-word-wave {
  0%,
  100% { transform: translateY(0); }
  25% { transform: translateY(-2px); }
  75% { transform: translateY(2px); }
}

@keyframes story-word-heat-wave {
  0%,
  100% { transform: translateX(0) translateY(0) skewX(0deg) scaleY(1); }
  16% { transform: translateX(0.9px) translateY(-0.3px) skewX(1.8deg) scaleY(1.008); }
  32% { transform: translateX(-1px) translateY(0.55px) skewX(-2.2deg) scaleY(0.996); }
  48% { transform: translateX(1.35px) translateY(-0.7px) skewX(2.8deg) scaleY(1.012); }
  64% { transform: translateX(-1.35px) translateY(0.75px) skewX(-2.8deg) scaleY(0.994); }
  80% { transform: translateX(0.8px) translateY(-0.35px) skewX(1.5deg) scaleY(1.004); }
  90% { transform: translateX(-0.75px) translateY(0.3px) skewX(-1.4deg) scaleY(1.002); }
}

@keyframes story-word-steel-glint {
  0%,
  38%,
  100% {
    background-position: 150% 50%;
  }
  42% {
    background-position: 110% 50%;
  }
  49% {
    background-position: -35% 50%;
  }
}

@keyframes story-word-hud-pulse {
  0%,
  24%,
  100% {
    color: #ff4f5f;
    text-shadow:
      0 0 8px rgba(255, 63, 77, 0.45),
      0 0 16px rgba(255, 63, 77, 0.25);
  }
  8% {
    color: #ff2f43;
    text-shadow:
      0 0 12px rgba(255, 40, 66, 0.85),
      0 0 24px rgba(255, 40, 66, 0.55),
      0 0 36px rgba(255, 40, 66, 0.35);
  }
  15% {
    color: #ff394d;
    text-shadow:
      0 0 9px rgba(255, 48, 71, 0.58),
      0 0 18px rgba(255, 48, 71, 0.32);
  }
}

.memory-archive-modal {
  --scrim-background: var(--surface-overlay-soft);
  position: fixed;
  inset: 0;
  z-index: 34;
  display: grid;
  place-items: center;
}

.mechanics-modal {
  position: fixed;
  inset: 0;
  z-index: 36;
  display: grid;
  place-items: center;
}

.settings-modal {
  --scrim-background:
    radial-gradient(circle at 50% 16%, rgba(58, 193, 255, 0.08), transparent 32%),
    var(--surface-overlay-medium-strong);
  position: fixed;
  inset: 0;
  z-index: 36;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.queue-presets-modal {
  position: fixed;
  inset: 0;
  z-index: 36;
  display: grid;
  place-items: center;
}

.settings-modal-card {
  --modal-card-border-color: rgba(92, 196, 255, 0.48);
  --modal-card-background:
    linear-gradient(180deg, rgba(6, 14, 22, 0.98), rgba(3, 8, 14, 0.98)),
    repeating-linear-gradient(
      to bottom,
      rgba(95, 207, 255, 0.03) 0,
      rgba(95, 207, 255, 0.03) 1px,
      transparent 1px,
      transparent 5px
    );
  --modal-card-shadow:
    0 0 0 1px rgba(98, 218, 255, 0.18),
    0 28px 56px rgba(0, 0, 0, 0.62),
    inset 0 0 38px rgba(59, 242, 255, 0.06);
  width: min(900px, calc(100% - 2rem));
  height: min(760px, calc(100dvh - 2rem));
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.settings-modal-header {
  padding: 0.95rem 1.15rem 0.82rem;
  background:
    linear-gradient(90deg, rgba(12, 56, 78, 0.86), rgba(8, 18, 30, 0.48)),
    linear-gradient(180deg, rgba(76, 193, 255, 0.14), transparent 72%);
}

.settings-modal-header h2 {
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.settings-modal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.62rem 1rem 0.7rem;
  border-bottom: 1px solid rgba(70, 146, 184, 0.34);
  background: var(--gradient-surface-subheader);
}

.settings-tab-btn {
  --button-active-border-color: rgba(102, 233, 255, 0.9);
  --button-active-text-color: #c8f6ff;
  --button-active-shadow:
    0 0 0 1px rgba(88, 212, 255, 0.18),
    0 0 18px rgba(59, 242, 255, 0.16),
    inset 0 0 10px rgba(59, 242, 255, 0.12);
  margin: 0;
  padding: 0.34rem 0.72rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.settings-modal[data-settings-context="menu"] .settings-modal-tabs {
  display: none;
}

.settings-modal-content {
  padding: 1rem;
  overflow-y: auto;
  display: grid;
  gap: 0.9rem;
  align-content: start;
  min-height: 0;
}

.settings-tab-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 0.9rem;
  align-content: start;
}

.queue-presets-modal-card {
  width: min(760px, calc(100% - 2rem));
  max-height: min(720px, calc(100dvh - 2rem));
}

.queue-presets-modal-content {
  padding: 1rem;
  overflow-y: auto;
  display: grid;
  gap: 0.9rem;
}

.queue-presets-section {
  padding: 0.82rem;
  display: grid;
  gap: 0.45rem;
}

.queue-presets-section h3,
.queue-presets-list-header h3 {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-text-accent-soft);
}

.queue-presets-section p,
.queue-presets-list-header p {
  margin: 0;
  color: var(--color-text-soft);
  line-height: 1.3;
}

.queue-presets-create-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.queue-presets-create-row input,
.queue-preset-rename-input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 0.5rem 0.58rem;
}

.queue-presets-list {
  display: grid;
  gap: 0.55rem;
}

.queue-preset-card {
  --subcard-shadow: none;
  padding: 0.72rem;
  display: grid;
  gap: 0.45rem;
}

.queue-preset-card:is(.is-current, .current) {
  --subcard-border-color: rgba(102, 233, 255, 0.88);
  --subcard-shadow: inset 0 0 12px rgba(59, 242, 255, 0.1), 0 0 18px rgba(59, 242, 255, 0.12);
}

.queue-preset-card-header,
.queue-preset-rename-row,
.queue-preset-actions,
.queue-presets-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.queue-preset-name {
  margin: 0;
  font-size: 0.86rem;
  color: var(--color-text-bright);
  letter-spacing: 0.03em;
}

.queue-preset-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.queue-preset-chip {
  --chip-border-color: rgba(72, 157, 196, 0.45);
  --chip-background: rgba(10, 33, 48, 0.8);
  --chip-text-color: #91d9f5;
  padding: 0.12rem 0.42rem;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.queue-preset-chip:is(.is-current, .current) {
  --chip-border-color: rgba(102, 233, 255, 0.88);
  --chip-text-color: #d7fbff;
}

.queue-preset-chip:is(.is-modified, .modified) {
  --chip-border-color: rgba(255, 180, 97, 0.85);
  --chip-text-color: #ffd8ab;
}

.queue-preset-summary {
  color: #b7dbeb;
  font-size: 0.74rem;
}

.queue-preset-actions {
  justify-content: flex-start;
}

.queue-preset-actions button,
.queue-preset-rename-row button {
  margin-top: 0;
}

.queue-presets-empty {
  border: 1px dashed rgba(72, 157, 196, 0.45);
  padding: 0.8rem;
  color: #b7dbeb;
  text-align: center;
}

.queue-presets-runtime-note {
  font-size: 0.72rem;
}

.settings-section {
  position: relative;
  padding: 1rem 1rem 1.05rem;
  display: grid;
  gap: 0.72rem;
  align-content: start;
  border: 1px solid rgba(72, 157, 196, 0.34);
  background:
    linear-gradient(180deg, rgba(9, 24, 37, 0.88), rgba(4, 12, 20, 0.92)),
    linear-gradient(90deg, rgba(63, 186, 255, 0.05), transparent 48%);
  box-shadow:
    inset 0 0 0 1px rgba(111, 197, 255, 0.05),
    inset 0 0 20px rgba(59, 242, 255, 0.03);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

#settings-loop-end-section,
.settings-section-audio,
.settings-section-queue-projection {
  grid-column: 1 / -1;
}

.settings-section-audio {
  border-color: rgba(97, 201, 255, 0.4);
  background:
    linear-gradient(180deg, rgba(11, 29, 42, 0.94), rgba(4, 12, 20, 0.96)),
    linear-gradient(90deg, rgba(59, 242, 255, 0.07), transparent 56%);
}

.settings-section h3 {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-accent-soft);
}

.settings-section-queue-projection .settings-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-gameplay-note {
  grid-column: 1 / -1;
  display: block;
  color: var(--color-text-soft);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: none;
}

.settings-section p {
  margin: 0;
  color: var(--color-text-soft);
  line-height: 1.4;
}

.settings-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
}

.settings-options-single {
  grid-template-columns: minmax(180px, 240px);
}

.settings-option-btn {
  --button-border-color: rgba(78, 144, 187, 0.44);
  --button-background:
    linear-gradient(180deg, rgba(10, 23, 35, 0.96), rgba(6, 13, 21, 0.98));
  --button-text-color: var(--color-text-soft);
  --button-shadow:
    inset 0 0 0 1px rgba(109, 194, 255, 0.05),
    0 12px 22px rgba(0, 0, 0, 0.24);
  --button-hover-border-color: rgba(124, 220, 255, 0.78);
  --button-hover-text-color: var(--color-text-bright);
  --button-hover-shadow:
    0 0 0 1px rgba(88, 212, 255, 0.18),
    0 0 22px rgba(59, 242, 255, 0.14),
    inset 0 0 12px rgba(59, 242, 255, 0.08);
  --button-active-border-color: rgba(102, 233, 255, 0.9);
  --button-active-background:
    linear-gradient(180deg, rgba(12, 43, 60, 0.98), rgba(6, 18, 28, 0.98));
  --button-active-text-color: #c8f6ff;
  --button-active-shadow:
    0 0 0 1px rgba(88, 212, 255, 0.2),
    0 0 22px rgba(59, 242, 255, 0.22),
    inset 0 0 14px rgba(59, 242, 255, 0.14);
  margin-top: 0;
  min-height: 50px;
  justify-content: center;
  padding: 0.72rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.settings-slider-grid {
  display: grid;
  gap: 0.7rem;
}

.settings-slider-row {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(69, 141, 182, 0.36);
  background:
    linear-gradient(180deg, rgba(8, 18, 29, 0.94), rgba(5, 11, 19, 0.98)),
    linear-gradient(90deg, rgba(63, 186, 255, 0.04), transparent 42%);
  color: var(--color-text-bright);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.settings-slider-label {
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-accent-soft);
}

.settings-slider-input {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      rgba(47, 131, 168, 0.9) 0,
      rgba(102, 233, 255, 0.95) var(--slider-fill-percent, 50%),
      rgba(28, 48, 66, 0.92) var(--slider-fill-percent, 50%),
      rgba(17, 28, 39, 0.98) 100%
    );
  outline: none;
}

.settings-slider-input::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(171, 239, 255, 0.9);
  background: #d7fbff;
  box-shadow: 0 0 14px rgba(59, 242, 255, 0.28);
  cursor: pointer;
}

.settings-slider-input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(171, 239, 255, 0.9);
  border-radius: 0;
  background: #d7fbff;
  box-shadow: 0 0 14px rgba(59, 242, 255, 0.28);
  cursor: pointer;
}

.settings-slider-input::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      rgba(47, 131, 168, 0.9) 0,
      rgba(102, 233, 255, 0.95) var(--slider-fill-percent, 50%),
      rgba(28, 48, 66, 0.92) var(--slider-fill-percent, 50%),
      rgba(17, 28, 39, 0.98) 100%
    );
}

.settings-slider-value {
  text-align: right;
  font-family: var(--font-mono);
  color: var(--color-text-accent-strong);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.mechanics-modal-card {
  width: min(980px, calc(100% - 2rem));
  height: min(780px, calc(100dvh - 2rem));
}

.mechanics-modal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  padding: 0.56rem 1rem 0.62rem;
  border-bottom: 1px solid rgba(70, 146, 184, 0.34);
  background: var(--gradient-surface-subheader);
}

.mechanics-tab-btn {
  --button-active-border-color: rgba(102, 233, 255, 0.9);
  --button-active-text-color: #c8f6ff;
  --button-active-shadow: 0 0 18px rgba(59, 242, 255, 0.45), inset 0 0 10px rgba(59, 242, 255, 0.24);
  margin: 0;
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
}

.mechanics-modal-content {
  padding: 1rem;
  overflow-y: auto;
  color: var(--color-text-primary);
}

.mechanics-tab-panel {
  display: grid;
  gap: 0.72rem;
}

.mechanics-section {
  padding: 0.7rem 0.78rem;
  display: grid;
  gap: 0.3rem;
}

.mechanics-section h3 {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-text-accent-soft);
}

.mechanics-section p {
  margin: 0;
  line-height: 1.3;
  color: var(--color-text-primary);
}

.mechanics-section ul {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.2rem;
}

.mechanics-section li {
  color: var(--color-text-soft);
  line-height: 1.26;
}

.mechanics-term {
  text-decoration-line: underline;
  text-decoration-color: rgba(124, 224, 255, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.memory-archive-modal-card {
  width: min(860px, calc(100% - 2rem));
  height: 780px;
}

.memory-archive-sources {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.52rem 1rem 0.58rem;
  border-bottom: 1px solid rgba(70, 146, 184, 0.34);
  background: var(--gradient-surface-subheader);
}

.memory-archive-source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.memory-archive-source-nav-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  align-self: stretch;
  padding: 0.26rem 0.42rem;
  border: 1px solid rgba(83, 157, 192, 0.38);
  border-radius: var(--radius-button);
  background: linear-gradient(180deg, rgba(11, 31, 44, 0.9), rgba(5, 18, 28, 0.96));
  color: rgba(160, 216, 236, 0.82);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.memory-archive-source-nav-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.2rem;
  border: 1px solid rgba(132, 226, 250, 0.55);
  border-radius: 0.32rem;
  background: linear-gradient(180deg, rgba(31, 74, 95, 0.9), rgba(14, 39, 54, 0.96));
  color: #d7fbff;
  font-size: 0.62rem;
  box-shadow: inset 0 0 8px rgba(100, 231, 255, 0.14);
}

.memory-archive-source-nav-text {
  line-height: 1;
}

.memory-archive-source-tab {
  --button-active-border-color: rgba(102, 233, 255, 0.9);
  --button-active-text-color: #c8f6ff;
  --button-active-shadow: 0 0 18px rgba(59, 242, 255, 0.45), inset 0 0 10px rgba(59, 242, 255, 0.24);
  margin-top: 0;
  padding: 0.32rem 0.6rem;
  font-size: 0.68rem;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  position: relative;
  overflow: visible;
}

.memory-archive-source-tab:is(.is-unread, .unread) {
  --button-border-color: rgba(134, 250, 255, 0.96);
  --button-text-color: #f0feff;
  --button-background: linear-gradient(180deg, rgba(20, 64, 85, 0.82), rgba(8, 29, 42, 0.92));
  --button-shadow:
    0 0 16px rgba(59, 242, 255, 0.44),
    0 0 28px rgba(59, 242, 255, 0.24),
    inset 0 0 10px rgba(118, 248, 255, 0.28);
}

.memory-archive-source-tab:is(.is-unread, .unread)::after {
  content: attr(data-unread-count);
  position: absolute;
  top: -0.42rem;
  right: -0.42rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.22rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(187, 252, 255, 0.96);
  background: radial-gradient(circle at 30% 30%, #ecffff 0%, #66f4ff 46%, #18b6d7 100%);
  color: #012734;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  text-shadow: none;
  box-shadow: 0 0 10px rgba(107, 247, 255, 0.85);
}

.memory-archive-source-asset {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(97, 182, 220, 0.55);
  background: rgba(8, 20, 30, 0.9);
  image-rendering: pixelated;
  flex: 0 0 auto;
}

.memory-archive-source-label {
  display: inline-block;
  line-height: 1.1;
}

.memory-archive-source-hotkey {
  position: absolute;
  top: 0.18rem;
  right: 0.38rem;
  color: rgba(188, 232, 247, 0.76);
  font-size: 0.52rem;
  line-height: 1;
  letter-spacing: 0.08em;
}

.memory-archive-list {
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  list-style: none;
  display: grid;
  gap: 0.65rem;
  overflow-y: auto;
}

.memory-archive-entry {
  padding: 0.52rem 0.6rem;
  display: grid;
  gap: 0.2rem;
}

.memory-archive-entry-meta {
  color: #78b9d5;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.memory-archive-entry-text {
  color: var(--color-text-primary);
  line-height: 1.24;
  font-size: 0.9rem;
  white-space: pre-line;
}

.memory-archive-empty {
  color: var(--muted);
  font-size: 0.85rem;
}
}

