:root {
  color-scheme: dark;
  --bg: #050b16;
  --bg-deep: #02050c;
  --ink: #effbff;
  --ink-soft: #8aa5bc;
  --ink-dim: #5c7891;
  --panel: rgba(7, 18, 31, 0.8);
  --panel-strong: rgba(10, 24, 42, 0.94);
  --panel-elevated: rgba(11, 30, 52, 0.98);
  --line: rgba(108, 242, 255, 0.14);
  --line-strong: rgba(125, 255, 178, 0.3);
  --accent: #6cf2ff;
  --accent-2: #7dffb2;
  --accent-3: #ffb36c;
  --accent-soft: rgba(108, 242, 255, 0.12);
  --accent-soft-2: rgba(125, 255, 178, 0.12);
  --gain: #70ffb0;
  --gain-soft: rgba(112, 255, 176, 0.16);
  --loss: #ff6e94;
  --loss-soft: rgba(255, 110, 148, 0.16);
  --warn: #ffb36c;
  --warn-soft: rgba(255, 179, 108, 0.16);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius: 28px;
  --radius-sm: 20px;
}

* {
  box-sizing: border-box;
}

*::selection {
  background: rgba(108, 242, 255, 0.22);
  color: #f5feff;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    radial-gradient(
      circle at 12% 14%,
      rgba(108, 242, 255, 0.14),
      transparent 24%
    ),
    radial-gradient(
      circle at 84% 14%,
      rgba(125, 255, 178, 0.14),
      transparent 20%
    ),
    radial-gradient(
      circle at 52% 118%,
      rgba(255, 179, 108, 0.12),
      transparent 32%
    ),
    linear-gradient(180deg, #07111f 0%, var(--bg) 48%, var(--bg-deep) 100%);
  font-family: "Noto Sans SC", sans-serif;
}

body {
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03),
    transparent 24%
  );
  mix-blend-mode: screen;
}

.page-glow,
.page-grid,
.page-noise {
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.page-grid,
.page-noise {
  inset: 0;
}

.page-glow {
  width: 38rem;
  height: 38rem;
  border-radius: 999px;
  filter: blur(100px);
  opacity: 0.72;
  animation: glowFloat 16s ease-in-out infinite;
}

.page-glow-a {
  top: -16rem;
  left: -8rem;
  background: rgba(108, 242, 255, 0.18);
}

.page-glow-b {
  right: -14rem;
  bottom: -16rem;
  background: rgba(125, 255, 178, 0.16);
  animation-delay: -8s;
}

.page-grid {
  background-image:
    linear-gradient(rgba(108, 242, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 242, 255, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 94%);
}

.page-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(108, 242, 255, 0.1),
    transparent
  );
  transform: translateX(-100%);
  animation: scannerMove 14s linear infinite;
}

.page-noise {
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.7) 0.7px,
    transparent 0.7px
  );
  background-size: 16px 16px;
  opacity: 0.035;
  mix-blend-mode: screen;
}

#app {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.shell {
  display: grid;
  gap: 18px;
}

.protocol-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(7, 18, 31, 0.96), rgba(5, 12, 22, 0.84)),
    radial-gradient(
      circle at top right,
      rgba(108, 242, 255, 0.08),
      transparent 30%
    );
  box-shadow: var(--shadow);
  overflow: hidden;
}

.protocol-bar::before,
.card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(108, 242, 255, 0.86),
    rgba(125, 255, 178, 0.8),
    transparent
  );
}

.protocol-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  min-width: 88px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(108, 242, 255, 0.22);
  background: rgba(108, 242, 255, 0.08);
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong {
  display: block;
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.brand-sub,
.protocol-route span,
.status-pill,
.eyebrow,
.section-id,
.stat-code,
.talent-code,
.signal-node span,
.tile-label,
.summary-label,
.kpi-label,
.chart-caption,
.panel-code,
.history-pill,
.turn-choice-code,
.hero-seq {
  font-family: "IBM Plex Mono", monospace;
}

.brand-sub {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-dim);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.protocol-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.protocol-route {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.protocol-route span {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
}

.protocol-route small {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.protocol-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid rgba(108, 242, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-soft);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.status-pill::before,
.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 14px currentColor;
}

.status-pill.is-live {
  color: var(--accent);
}

.status-pill.is-gain {
  color: var(--accent-2);
}

.status-pill.is-muted {
  color: var(--ink-dim);
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(8, 21, 37, 0.96), rgba(7, 15, 26, 0.9)),
    radial-gradient(
      circle at top left,
      rgba(108, 242, 255, 0.06),
      transparent 34%
    );
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 24%),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.014) 0,
      rgba(255, 255, 255, 0.014) 1px,
      transparent 1px,
      transparent 10px
    );
  pointer-events: none;
}

.hero,
.section {
  padding: 22px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 18px;
}

.hero-copy,
.hero-side,
.section-inner {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.hero-seq {
  color: var(--ink-dim);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.hero-title,
.ending-title,
.section-title,
.sub-title,
.turn-title,
.phase-line,
.history-name,
.talent-name,
.stat-name {
  font-family: "Chakra Petch", sans-serif;
}

.hero-title {
  margin: 0 0 12px;
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.hero-title strong,
.ending-title strong {
  display: block;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(108, 242, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-soft);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.hero-text,
.ending-text,
.section-caption,
.hint,
.muted,
.event-text,
.stack-mini-text,
.turn-text {
  color: var(--ink-soft);
}

.hero-text {
  max-width: 42rem;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.85;
}

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

.summary-actions-top {
  justify-content: flex-start;
}

.summary-bottom-action {
  display: flex;
  justify-content: center;
  margin-top: 22px;
  padding-bottom: 10px;
}

.button-restart-large {
  min-width: min(360px, 100%);
  min-height: 58px;
  padding: 16px 28px;
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  justify-content: center;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.signal-strip-compact {
  margin-top: 0;
  margin-bottom: 18px;
}

.signal-node,
.tile,
.summary-item,
.kpi,
.chart-wrap,
.history-row,
.footer-card,
.draft-card,
.summary-card,
.stack-card,
.action-panel,
.event-item,
.stat-card,
.talent-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(108, 242, 255, 0.12);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(10, 24, 42, 0.95), rgba(8, 18, 31, 0.92)),
    radial-gradient(
      circle at top right,
      rgba(108, 242, 255, 0.06),
      transparent 34%
    );
}

.signal-node::before,
.tile::before,
.summary-item::before,
.kpi::before,
.chart-wrap::before,
.history-row::before,
.footer-card::before,
.draft-card::before,
.summary-card::before,
.stack-card::before,
.action-panel::before,
.event-item::before,
.stat-card::before,
.talent-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(108, 242, 255, 0.55),
    transparent
  );
}

.signal-node {
  padding: 15px 16px;
}

.signal-node span,
.tile-label,
.summary-label,
.kpi-label,
.chart-caption,
.history-pill,
.turn-choice-code,
.stat-code,
.talent-code,
.section-id,
.panel-code {
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.signal-node strong,
.tile-value,
.summary-value,
.kpi-value {
  display: block;
  margin-top: 8px;
  font-weight: 700;
  line-height: 1.35;
}

.signal-node strong,
.tile-value,
.summary-value,
.kpi-value,
.history-value,
.stat-value {
  font-family: "Chakra Petch", sans-serif;
  overflow-wrap: anywhere;
}

.signal-node strong,
.tile-value {
  font-size: clamp(0.98rem, 2vw, 1.34rem);
  color: var(--ink);
}

.hero-side {
  display: grid;
  gap: 16px;
  align-content: start;
}

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

.tile {
  padding: 16px;
}

.quote-card {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(108, 242, 255, 0.16);
  background:
    linear-gradient(160deg, rgba(6, 17, 30, 0.98), rgba(10, 28, 48, 0.98)),
    radial-gradient(
      circle at top right,
      rgba(108, 242, 255, 0.1),
      transparent 38%
    );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.panel-head,
.section-header,
.timeline-head,
.action-head,
.stack-mini-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.timeline-head {
  margin-bottom: 14px;
}

.panel-head h3,
.section-title,
.sub-title {
  margin: 0;
}

.panel-head h3,
.sub-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.panel-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}

.panel-code::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.signal-stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.signal-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(108, 242, 255, 0.08);
}

.signal-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.signal-row span {
  color: var(--ink-soft);
}

.signal-row strong {
  text-align: right;
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
}

.section-header {
  align-items: flex-end;
  margin-bottom: 18px;
}

.section-id {
  margin-bottom: 6px;
  color: var(--accent);
}

.section-title {
  font-size: 1.36rem;
  letter-spacing: 0.02em;
}

.section-caption,
.hint,
.muted,
.turn-text,
.event-text {
  font-size: 0.94rem;
  line-height: 1.78;
}

.muted {
  margin-top: 6px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:disabled {
  opacity: 0.34;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button-primary {
  color: #031018;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 32px rgba(108, 242, 255, 0.18);
}

.button-secondary {
  color: var(--ink);
  border-color: rgba(108, 242, 255, 0.22);
  background: rgba(7, 18, 31, 0.9);
}

.button-ghost {
  color: var(--ink-soft);
  border-color: rgba(108, 242, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

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

.talent-card {
  width: 100%;
  padding: 16px;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.talent-card:hover {
  transform: translateY(-2px);
  border-color: rgba(108, 242, 255, 0.22);
}

.talent-card.is-selected {
  border-color: rgba(125, 255, 178, 0.36);
  box-shadow:
    0 0 0 1px rgba(125, 255, 178, 0.14),
    0 18px 36px rgba(13, 38, 30, 0.42);
  background:
    linear-gradient(180deg, rgba(9, 30, 34, 0.96), rgba(9, 24, 31, 0.94)),
    radial-gradient(
      circle at top right,
      rgba(125, 255, 178, 0.1),
      transparent 34%
    );
}

.talent-card.is-disabled {
  opacity: 0.42;
}

.talent-head,
.stat-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.talent-name,
.stat-name,
.history-name,
.phase-line {
  font-size: 1.08rem;
  font-weight: 700;
}

.talent-code,
.stat-code {
  margin-bottom: 6px;
}

.rarity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.rarity.common {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.06);
}

.rarity.rare {
  color: var(--accent-2);
  background: rgba(125, 255, 178, 0.12);
  border-color: rgba(125, 255, 178, 0.18);
}

.rarity.epic {
  color: var(--accent);
  background: rgba(108, 242, 255, 0.12);
  border-color: rgba(108, 242, 255, 0.2);
}

.talent-desc,
.stat-desc {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.93rem;
  line-height: 1.72;
}

.talent-tags,
.year-kpi,
.event-deltas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.talent-tags {
  margin-top: 14px;
}

.chip,
.delta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.chip {
  border: 1px solid rgba(108, 242, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-soft);
}

.chip-accent {
  color: var(--accent);
  background: rgba(108, 242, 255, 0.12);
  border-color: rgba(108, 242, 255, 0.16);
}

.chip-gain,
.delta.gain {
  color: var(--accent-2);
  background: var(--gain-soft);
  border-color: rgba(125, 255, 178, 0.12);
}

.chip-loss,
.delta.loss {
  color: var(--loss);
  background: var(--loss-soft);
  border-color: rgba(255, 110, 148, 0.14);
}

.delta.flat {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.05);
}

.life-board {
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(108, 242, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(9, 18, 28, 0.96), rgba(10, 20, 31, 0.96)),
    radial-gradient(
      circle at top right,
      rgba(108, 242, 255, 0.08),
      transparent 34%
    );
}

.life-log {
  max-height: 62vh;
  overflow: auto;
  border-top: 1px solid rgba(108, 242, 255, 0.1);
  border-bottom: 1px solid rgba(108, 242, 255, 0.1);
}

.life-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.life-row:nth-child(2n) {
  background: rgba(255, 255, 255, 0.035);
}

.life-age {
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.life-text {
  min-width: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.76;
}

.life-board-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

.life-board-note {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.7;
}

.life-deck {
  align-items: stretch;
}

.life-scene {
  min-height: 480px;
  padding-top: 96px;
}

.life-progress-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.life-progress-panel .summary-grid,
.life-progress-panel .row-actions {
  margin-top: 0;
}

.life-finale {
  display: grid;
  gap: 14px;
}

.event-item.life {
  background:
    linear-gradient(180deg, rgba(12, 20, 34, 0.96), rgba(10, 17, 28, 0.92)),
    radial-gradient(
      circle at top right,
      rgba(148, 172, 194, 0.08),
      transparent 38%
    );
  border-color: rgba(148, 172, 194, 0.14);
}

.stats-panel,
.sim-layout,
.deck-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 18px;
}

.stat-list,
.sim-side,
.footer-row,
.summary-grid,
.summary-kpis {
  display: grid;
  gap: 12px;
}

.stat-card,
.draft-card,
.summary-card,
.footer-card {
  padding: 18px;
}

.stat-value,
.history-value {
  font-size: 1.36rem;
  letter-spacing: -0.03em;
}

.stat-meter {
  margin-top: 14px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.stat-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgba(108, 242, 255, 0.34);
}

.stat-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.stat-button {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(108, 242, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-size: 1.2rem;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.stat-button:hover {
  transform: translateY(-1px);
  border-color: rgba(108, 242, 255, 0.28);
}

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

.summary-item,
.kpi {
  padding: 14px 15px;
}

.summary-value,
.kpi-value {
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.chart-wrap {
  padding: 16px;
}

.sparkline {
  display: block;
  width: 100%;
  height: 180px;
}

.chart-caption {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.deck-main {
  display: grid;
  gap: 18px;
}

.stack-scene {
  position: relative;
  min-height: 520px;
  padding-top: 120px;
  isolation: isolate;
}

.stack-card {
  padding: 18px;
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.36);
}

.stack-card-shadow {
  position: absolute;
  left: 18px;
  right: 18px;
  pointer-events: none;
}

.stack-card-active {
  position: relative;
  z-index: 5;
}

.stack-card-intro {
  border-style: dashed;
}

.stack-card-final {
  background:
    linear-gradient(180deg, rgba(11, 31, 48, 0.98), rgba(8, 18, 31, 0.96)),
    radial-gradient(
      circle at top right,
      rgba(125, 255, 178, 0.12),
      transparent 36%
    );
  border-color: rgba(125, 255, 178, 0.2);
}

.depth-1 {
  top: 78px;
  transform: scale(0.985);
  opacity: 0.8;
  z-index: 4;
}

.depth-2 {
  top: 56px;
  transform: scale(0.965);
  opacity: 0.64;
  z-index: 3;
}

.depth-3 {
  top: 36px;
  transform: scale(0.945);
  opacity: 0.48;
  z-index: 2;
}

.depth-4 {
  top: 16px;
  transform: scale(0.925);
  opacity: 0.34;
  z-index: 1;
}

.stack-mini-head {
  margin-bottom: 10px;
}

.stack-mini-title {
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
}

.stack-mini-text {
  margin-top: 8px;
  font-size: 0.9rem;
  line-height: 1.66;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.action-panel {
  padding: 18px;
}

.action-panel .summary-grid,
.action-panel .row-actions {
  margin-top: 16px;
}

.action-panel.is-finished {
  border-color: rgba(125, 255, 178, 0.2);
}

.action-head {
  margin-bottom: 12px;
}

.turn-title {
  margin: 6px 0 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
}

.turn-text {
  margin: 0;
}

.turn-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.turn-choice {
  appearance: none;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(108, 242, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(10, 24, 42, 0.96), rgba(8, 18, 31, 0.92)),
    radial-gradient(
      circle at top right,
      rgba(108, 242, 255, 0.06),
      transparent 38%
    );
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.turn-choice:hover {
  transform: translateY(-2px);
}

.turn-choice-steady:hover {
  border-color: rgba(125, 255, 178, 0.28);
  box-shadow: 0 18px 34px rgba(6, 32, 24, 0.38);
}

.turn-choice-balanced:hover {
  border-color: rgba(108, 242, 255, 0.28);
  box-shadow: 0 18px 34px rgba(7, 24, 38, 0.38);
}

.turn-choice-aggressive:hover {
  border-color: rgba(255, 179, 108, 0.32);
  box-shadow: 0 18px 34px rgba(42, 24, 6, 0.38);
}

.turn-choice-title {
  margin-top: 8px;
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
}

.turn-choice-desc {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.68;
}

.timeline-phase {
  display: grid;
  gap: 8px;
}

.phase-line {
  line-height: 1;
}

.year-badge,
.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(108, 242, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
  font-weight: 700;
}

.year-kpi {
  justify-content: flex-end;
}

.event-item {
  padding: 14px 15px;
}

.entry-list {
  display: grid;
  gap: 12px;
}

.event-item.market {
  background:
    linear-gradient(135deg, rgba(8, 19, 31, 0.98), rgba(12, 35, 49, 0.96)),
    radial-gradient(
      circle at top right,
      rgba(108, 242, 255, 0.1),
      transparent 36%
    );
}

.event-item.choice {
  background:
    linear-gradient(180deg, rgba(12, 22, 37, 0.96), rgba(11, 18, 29, 0.9)),
    radial-gradient(
      circle at top right,
      rgba(255, 179, 108, 0.08),
      transparent 38%
    );
  border-style: dashed;
  border-color: rgba(255, 179, 108, 0.22);
}

.event-head {
  margin-bottom: 8px;
}

.event-title {
  font-weight: 800;
}

.event-deltas {
  margin-top: 10px;
}

.delta {
  border: 1px solid transparent;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
}

.rank {
  min-width: 42px;
  padding-inline: 0;
  color: var(--accent);
}

.history-meta {
  min-width: 0;
}

.history-sub {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.66;
}

.history-stats {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.history-value {
  font-size: 1.2rem;
}

.empty {
  padding: 18px;
  border: 1px dashed rgba(108, 242, 255, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-soft);
  line-height: 1.74;
}

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

.footer-card strong {
  display: block;
  margin-bottom: 8px;
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.04rem;
  color: var(--ink);
}

.ending-title {
  margin: 10px 0 8px;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.ending-text {
  margin: 0;
  line-height: 1.82;
}

.tone-bear {
  --tone-border: rgba(125, 169, 255, 0.28);
  --tone-glow: rgba(125, 169, 255, 0.12);
}

.tone-crab {
  --tone-border: rgba(148, 172, 194, 0.24);
  --tone-glow: rgba(148, 172, 194, 0.1);
}

.tone-mixed {
  --tone-border: rgba(108, 242, 255, 0.24);
  --tone-glow: rgba(108, 242, 255, 0.1);
}

.tone-bull {
  --tone-border: rgba(125, 255, 178, 0.28);
  --tone-glow: rgba(125, 255, 178, 0.12);
}

.tone-mania {
  --tone-border: rgba(255, 179, 108, 0.3);
  --tone-glow: rgba(255, 179, 108, 0.12);
}

.stack-card.tone-bear,
.stack-card.tone-crab,
.stack-card.tone-mixed,
.stack-card.tone-bull,
.stack-card.tone-mania {
  border-color: var(--tone-border, rgba(108, 242, 255, 0.12));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.015);
}

.stack-card.tone-bear::after,
.stack-card.tone-crab::after,
.stack-card.tone-mixed::after,
.stack-card.tone-bull::after,
.stack-card.tone-mania::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--tone-glow, transparent);
}

.year-badge.tone-bear {
  color: #b4d2ff;
  border-color: rgba(125, 169, 255, 0.24);
  background: rgba(125, 169, 255, 0.12);
}

.year-badge.tone-crab {
  color: #c4d3df;
  border-color: rgba(148, 172, 194, 0.22);
  background: rgba(148, 172, 194, 0.1);
}

.year-badge.tone-mixed {
  color: #aef7ff;
  border-color: rgba(108, 242, 255, 0.22);
  background: rgba(108, 242, 255, 0.1);
}

.year-badge.tone-bull {
  color: #b7ffd5;
  border-color: rgba(125, 255, 178, 0.24);
  background: rgba(125, 255, 178, 0.1);
}

.year-badge.tone-mania {
  color: #ffd6b0;
  border-color: rgba(255, 179, 108, 0.24);
  background: rgba(255, 179, 108, 0.12);
}

@keyframes glowFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(18px, 12px, 0) scale(1.08);
  }
}

@keyframes scannerMove {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 1040px) {
  .hero,
  .stats-panel,
  .sim-layout,
  .deck-layout {
    grid-template-columns: 1fr;
  }

  .stack-scene {
    min-height: 480px;
  }

  .protocol-meta,
  .protocol-route,
  .protocol-pills {
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .protocol-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .signal-strip,
  .stats-overview,
  .summary-grid,
  .summary-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .talent-grid,
  .footer-row,
  .turn-choices {
    grid-template-columns: 1fr;
  }

  .stack-card-shadow.depth-3,
  .stack-card-shadow.depth-4 {
    display: none;
  }

  .life-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 640px) {
  #app {
    width: min(100vw - 18px, 1180px);
    padding-top: 12px;
  }

  .hero,
  .section {
    padding: 16px;
  }

  .protocol-bar,
  .draft-card,
  .summary-card,
  .footer-card,
  .action-panel,
  .stack-card,
  .quote-card {
    padding: 16px;
  }

  .signal-strip,
  .stats-overview,
  .summary-grid,
  .summary-kpis {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .summary-actions,
  .row-actions {
    width: 100%;
  }

  .summary-bottom-action {
    width: 100%;
  }

  .button-restart-large {
    width: 100%;
    min-width: 0;
  }

  .button {
    flex: 1 1 auto;
    justify-content: center;
  }

  .history-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .history-stats {
    justify-items: start;
  }

  .stack-scene {
    min-height: 420px;
    padding-top: 70px;
  }

  .stack-card-shadow {
    left: 8px;
    right: 8px;
  }

  .life-scene {
    min-height: 420px;
    padding-top: 80px;
  }

  .depth-2,
  .depth-3,
  .depth-4 {
    display: none;
  }

  .hero-title {
    font-size: clamp(2.4rem, 12vw, 4rem);
  }

  .turn-title,
  .ending-title {
    font-size: clamp(1.9rem, 8vw, 2.6rem);
  }

  .life-log {
    max-height: 58vh;
  }

  .life-board-footer {
    align-items: stretch;
  }
}

:root {
  --bg: #120b1f;
  --bg-deep: #08060d;
  --ink: #fbfaf9;
  --ink-soft: #c8c2dc;
  --ink-dim: #8e82b6;
  --panel: rgba(28, 18, 49, 0.78);
  --panel-strong: rgba(31, 20, 54, 0.94);
  --panel-elevated: rgba(34, 22, 60, 0.98);
  --line: rgba(131, 110, 249, 0.18);
  --line-strong: rgba(251, 250, 249, 0.18);
  --accent: #836ef9;
  --accent-2: #a0055d;
  --accent-3: #fbfaf9;
  --accent-soft: rgba(131, 110, 249, 0.18);
  --accent-soft-2: rgba(160, 5, 93, 0.16);
  --gain: #bcaeff;
  --gain-soft: rgba(188, 174, 255, 0.16);
  --loss: #ff8ac9;
  --loss-soft: rgba(255, 138, 201, 0.16);
  --warn: #d39cff;
  --warn-soft: rgba(211, 156, 255, 0.16);
  --shadow: 0 34px 110px rgba(7, 0, 18, 0.52);
  --pointer-x: 50vw;
  --pointer-y: 28vh;
}

html,
body {
  background:
    radial-gradient(
      circle at 16% 12%,
      rgba(131, 110, 249, 0.3),
      transparent 24%
    ),
    radial-gradient(circle at 82% 16%, rgba(160, 5, 93, 0.24), transparent 20%),
    radial-gradient(
      circle at 55% 82%,
      rgba(67, 29, 146, 0.26),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      #241345 0%,
      #150c28 36%,
      var(--bg) 72%,
      var(--bg-deep) 100%
    );
}

body::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 18%),
    radial-gradient(circle at top, rgba(251, 250, 249, 0.06), transparent 28%);
}

body.has-custom-cursor,
body.has-custom-cursor * {
  cursor: none !important;
}

.page-glow {
  filter: blur(130px);
  opacity: 0.82;
}

.page-glow-a {
  background: rgba(131, 110, 249, 0.26);
}

.page-glow-b {
  background: rgba(160, 5, 93, 0.24);
}

.page-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.38;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 95%);
}

.page-grid::after {
  background: linear-gradient(
    135deg,
    transparent 18%,
    rgba(131, 110, 249, 0.14),
    transparent 78%
  );
  transform: none;
  animation: none;
}

.page-noise {
  opacity: 0.02;
}

.page-spotlight {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      720px circle at var(--pointer-x) var(--pointer-y),
      rgba(131, 110, 249, 0.16),
      transparent 42%
    ),
    radial-gradient(
      320px circle at var(--pointer-x) var(--pointer-y),
      rgba(251, 250, 249, 0.08),
      transparent 20%
    ),
    radial-gradient(
      540px circle at calc(var(--pointer-x) - 14%) calc(var(--pointer-y) + 18%),
      rgba(160, 5, 93, 0.14),
      transparent 46%
    );
  mix-blend-mode: screen;
  opacity: 0.9;
}

.cursor-shell {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  mix-blend-mode: screen;
}

.cursor-shell.is-visible {
  opacity: 1;
}

.cursor-aura,
.cursor-core {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 999px;
  transform-origin: center;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.cursor-aura {
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  background: radial-gradient(
    circle,
    rgba(131, 110, 249, 0.28),
    rgba(160, 5, 93, 0.18) 42%,
    transparent 74%
  );
  filter: blur(6px);
}

.cursor-core {
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  background: rgba(251, 250, 249, 0.96);
  box-shadow:
    0 0 0 10px rgba(131, 110, 249, 0.14),
    0 0 28px rgba(131, 110, 249, 0.34);
}

.cursor-shell.is-pressed .cursor-aura {
  transform: scale(0.88);
  opacity: 0.9;
}

.cursor-shell.is-pressed .cursor-core {
  transform: scale(1.18);
}

body.cursor-hover .cursor-aura {
  transform: scale(1.36);
  opacity: 0.94;
}

body.cursor-hover .cursor-core {
  transform: scale(0.72);
  background: rgba(131, 110, 249, 0.98);
  box-shadow:
    0 0 0 16px rgba(131, 110, 249, 0.12),
    0 0 42px rgba(160, 5, 93, 0.34);
}

.brand-copy strong,
.hero-title,
.ending-title,
.section-title,
.sub-title,
.turn-title,
.phase-line,
.history-name,
.talent-name,
.stat-name,
.stack-mini-title,
.footer-card strong {
  font-family: "Noto Sans SC", sans-serif;
}

.protocol-bar {
  padding: 18px 20px;
  border-color: rgba(131, 110, 249, 0.2);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(36, 21, 69, 0.9), rgba(17, 11, 30, 0.92)),
    radial-gradient(
      circle at top right,
      rgba(160, 5, 93, 0.18),
      transparent 34%
    );
  box-shadow: var(--shadow);
}

.protocol-bar::before,
.card::after {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(131, 110, 249, 0.92),
    rgba(251, 250, 249, 0.46),
    transparent
  );
}

.brand-mark {
  border-color: rgba(251, 250, 249, 0.12);
  background: rgba(251, 250, 249, 0.96);
  color: #200052;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.brand-copy strong {
  font-size: 1.14rem;
  letter-spacing: -0.02em;
}

.brand-sub {
  color: #b0a6d3;
}

.protocol-route span,
.section-id,
.panel-code {
  color: #d2caff;
}

.status-pill,
.eyebrow {
  border-color: rgba(251, 250, 249, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #dbd4ef;
}

.status-pill.is-live {
  color: #c4b6ff;
}

.status-pill.is-gain {
  color: #f0d0ff;
}

.status-pill.is-muted {
  color: #978abf;
}

.card {
  border-color: rgba(131, 110, 249, 0.14);
  background:
    linear-gradient(180deg, rgba(34, 21, 61, 0.94), rgba(15, 10, 27, 0.96)),
    radial-gradient(
      circle at top left,
      rgba(131, 110, 249, 0.14),
      transparent 30%
    );
  backdrop-filter: blur(24px);
}

.card::before {
  background:
    radial-gradient(
      circle at top left,
      rgba(131, 110, 249, 0.2),
      transparent 24%
    ),
    radial-gradient(circle at 82% 18%, rgba(160, 5, 93, 0.14), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 30%);
}

.hero {
  gap: 28px;
  min-height: 34rem;
  padding-block: 28px;
}

.hero-kicker {
  margin-bottom: 16px;
}

.hero-seq {
  color: #a89dcf;
}

.hero-title {
  max-width: 12ch;
  margin-bottom: 16px;
  font-size: clamp(3rem, 8vw, 5.9rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.hero-title strong,
.ending-title strong {
  background: linear-gradient(135deg, #fbfaf9 8%, #cbc2ff 38%, #836ef9 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-text,
.ending-text {
  max-width: 42rem;
  color: #d0c9e2;
  font-size: 1.03rem;
  line-height: 1.86;
}

.signal-node,
.tile,
.summary-item,
.kpi,
.chart-wrap,
.history-row,
.footer-card,
.draft-card,
.summary-card,
.stack-card,
.action-panel,
.event-item,
.stat-card,
.talent-card,
.quote-card,
.turn-choice {
  border-color: rgba(251, 250, 249, 0.08);
  background:
    linear-gradient(180deg, rgba(41, 26, 74, 0.92), rgba(23, 15, 41, 0.94)),
    radial-gradient(
      circle at top right,
      rgba(131, 110, 249, 0.14),
      transparent 36%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 22px 48px rgba(8, 0, 22, 0.22);
}

.signal-node::before,
.tile::before,
.summary-item::before,
.kpi::before,
.chart-wrap::before,
.history-row::before,
.footer-card::before,
.draft-card::before,
.summary-card::before,
.stack-card::before,
.action-panel::before,
.event-item::before,
.stat-card::before,
.talent-card::before {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(131, 110, 249, 0.72),
    transparent
  );
}

.signal-node strong,
.tile-value,
.summary-value,
.kpi-value,
.history-value,
.stat-value,
.signal-row strong {
  color: var(--ink);
}

.signal-node span,
.tile-label,
.summary-label,
.kpi-label,
.chart-caption,
.history-pill,
.turn-choice-code,
.stat-code,
.talent-code,
.section-id,
.panel-code {
  color: #9c8fc5;
}

.signal-row {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.section-title {
  font-size: 1.52rem;
  letter-spacing: -0.03em;
}

.section-caption,
.hint,
.muted,
.turn-text,
.event-text,
.history-sub,
.empty {
  color: #cdc6df;
}

.button-primary {
  color: #fbfaf9;
  background: linear-gradient(135deg, #705cf8, #a0055d);
  box-shadow: 0 18px 40px rgba(86, 33, 162, 0.34);
}

.button-secondary {
  border-color: rgba(251, 250, 249, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.button-ghost {
  border-color: rgba(251, 250, 249, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.button:hover,
.talent-card:hover,
.turn-choice:hover,
.stat-button:hover {
  box-shadow: 0 18px 36px rgba(17, 7, 37, 0.28);
}

.talent-card:hover,
.turn-choice-balanced:hover {
  border-color: rgba(131, 110, 249, 0.34);
}

.talent-card.is-selected {
  border-color: rgba(251, 250, 249, 0.18);
  box-shadow:
    0 0 0 1px rgba(131, 110, 249, 0.14),
    0 22px 42px rgba(28, 11, 59, 0.34);
  background:
    linear-gradient(180deg, rgba(55, 32, 100, 0.94), rgba(24, 14, 45, 0.96)),
    radial-gradient(
      circle at top right,
      rgba(160, 5, 93, 0.18),
      transparent 38%
    );
}

.rarity.common,
.chip,
.delta.flat {
  border-color: rgba(251, 250, 249, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #d2cbe4;
}

.rarity.rare,
.chip-accent {
  color: #d9d0ff;
  background: rgba(131, 110, 249, 0.18);
  border-color: rgba(131, 110, 249, 0.22);
}

.rarity.epic,
.chip-gain,
.delta.gain {
  color: #ffd0ec;
  background: rgba(160, 5, 93, 0.16);
  border-color: rgba(160, 5, 93, 0.18);
}

.chip-loss,
.delta.loss {
  color: #ffd2e9;
  background: rgba(255, 138, 201, 0.14);
  border-color: rgba(255, 138, 201, 0.18);
}

.stat-meter {
  background: rgba(255, 255, 255, 0.06);
}

.stat-meter span {
  background: linear-gradient(90deg, #fbfaf9, #bfb1ff 42%, #836ef9 100%);
  box-shadow: 0 0 22px rgba(131, 110, 249, 0.42);
}

.stat-button {
  border-color: rgba(251, 250, 249, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.stack-card,
.action-panel {
  box-shadow: 0 28px 54px rgba(7, 0, 18, 0.34);
}

.stack-card-final,
.action-panel.is-finished {
  border-color: rgba(160, 5, 93, 0.24);
  background:
    linear-gradient(180deg, rgba(59, 24, 85, 0.95), rgba(22, 13, 40, 0.96)),
    radial-gradient(circle at top right, rgba(160, 5, 93, 0.2), transparent 38%);
}

.turn-choice-steady:hover {
  border-color: rgba(251, 250, 249, 0.2);
  box-shadow: 0 18px 34px rgba(20, 10, 40, 0.36);
}

.turn-choice-aggressive:hover {
  border-color: rgba(160, 5, 93, 0.28);
  box-shadow: 0 18px 34px rgba(49, 8, 33, 0.38);
}

.event-item.market {
  background:
    linear-gradient(135deg, rgba(31, 20, 54, 0.96), rgba(22, 13, 40, 0.96)),
    radial-gradient(
      circle at top right,
      rgba(131, 110, 249, 0.18),
      transparent 40%
    );
}

.event-item.choice {
  background:
    linear-gradient(180deg, rgba(46, 20, 67, 0.94), rgba(22, 13, 40, 0.94)),
    radial-gradient(
      circle at top right,
      rgba(160, 5, 93, 0.16),
      transparent 40%
    );
  border-style: solid;
  border-color: rgba(160, 5, 93, 0.2);
}

.empty {
  border-color: rgba(251, 250, 249, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.tone-bear {
  --tone-border: rgba(166, 151, 255, 0.24);
  --tone-glow: rgba(166, 151, 255, 0.12);
}

.tone-crab {
  --tone-border: rgba(213, 205, 241, 0.18);
  --tone-glow: rgba(213, 205, 241, 0.08);
}

.tone-mixed {
  --tone-border: rgba(131, 110, 249, 0.24);
  --tone-glow: rgba(131, 110, 249, 0.12);
}

.tone-bull {
  --tone-border: rgba(202, 180, 255, 0.24);
  --tone-glow: rgba(202, 180, 255, 0.12);
}

.tone-mania {
  --tone-border: rgba(160, 5, 93, 0.3);
  --tone-glow: rgba(160, 5, 93, 0.14);
}

.year-badge {
  border-color: rgba(251, 250, 249, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.year-badge.tone-bear {
  color: #ddd4ff;
  border-color: rgba(166, 151, 255, 0.22);
  background: rgba(166, 151, 255, 0.12);
}

.year-badge.tone-crab {
  color: #ece7ff;
  border-color: rgba(213, 205, 241, 0.18);
  background: rgba(213, 205, 241, 0.08);
}

.year-badge.tone-mixed {
  color: #dcd4ff;
  border-color: rgba(131, 110, 249, 0.22);
  background: rgba(131, 110, 249, 0.12);
}

.year-badge.tone-bull {
  color: #ffe1f6;
  border-color: rgba(202, 180, 255, 0.22);
  background: rgba(202, 180, 255, 0.12);
}

.year-badge.tone-mania {
  color: #ffd5ea;
  border-color: rgba(160, 5, 93, 0.22);
  background: rgba(160, 5, 93, 0.14);
}

@media (max-width: 1040px) {
  .hero {
    min-height: unset;
  }
}

@media (max-width: 820px) {
  .hero {
    gap: 18px;
  }

  .hero-title {
    max-width: none;
  }
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  body.has-custom-cursor,
  body.has-custom-cursor * {
    cursor: auto !important;
  }

  .page-spotlight,
  .cursor-shell {
    display: none !important;
  }
}

:root {
  --bg: #0b1020;
  --bg-deep: #070b14;
  --ink: #f3f6ff;
  --ink-soft: #c4ccdf;
  --ink-dim: #8691ab;
  --panel: rgba(14, 20, 34, 0.78);
  --panel-strong: rgba(11, 16, 29, 0.92);
  --panel-elevated: rgba(11, 16, 29, 0.97);
  --line: rgba(114, 134, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.1);
  --accent: #7286ff;
  --accent-2: #4dc4ff;
  --accent-3: #f3f6ff;
  --accent-soft: rgba(114, 134, 255, 0.14);
  --accent-soft-2: rgba(77, 196, 255, 0.12);
  --gain: #aab8ff;
  --gain-soft: rgba(170, 184, 255, 0.14);
  --loss: #ff9abb;
  --loss-soft: rgba(255, 154, 187, 0.14);
  --warn: #9fe1ff;
  --warn-soft: rgba(159, 225, 255, 0.12);
  --shadow: 0 18px 52px rgba(2, 7, 18, 0.28);
}

html,
body {
  background:
    radial-gradient(
      circle at 16% 12%,
      rgba(114, 134, 255, 0.24),
      transparent 22%
    ),
    radial-gradient(
      circle at 84% 14%,
      rgba(77, 196, 255, 0.14),
      transparent 18%
    ),
    radial-gradient(
      circle at 54% 82%,
      rgba(73, 96, 168, 0.18),
      transparent 30%
    ),
    linear-gradient(
      180deg,
      #151d34 0%,
      #0d1323 42%,
      var(--bg) 74%,
      var(--bg-deep) 100%
    );
}

body::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 18%),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.04), transparent 26%);
}

.page-glow {
  filter: blur(160px);
  opacity: 0.36;
}

.page-glow-a {
  background: rgba(114, 134, 255, 0.2);
}

.page-glow-b {
  background: rgba(77, 196, 255, 0.16);
}

.page-grid {
  background-size: 88px 88px;
  opacity: 0.16;
}

.page-grid::after {
  background: linear-gradient(
    135deg,
    transparent 20%,
    rgba(114, 134, 255, 0.08),
    transparent 74%
  );
}

.page-noise {
  opacity: 0.012;
}

.page-spotlight {
  background:
    radial-gradient(
      520px circle at var(--pointer-x) var(--pointer-y),
      rgba(114, 134, 255, 0.14),
      transparent 42%
    ),
    radial-gradient(
      180px circle at var(--pointer-x) var(--pointer-y),
      rgba(255, 255, 255, 0.05),
      transparent 18%
    );
  mix-blend-mode: normal;
  opacity: 0.55;
}

.cursor-shell {
  mix-blend-mode: normal;
}

.cursor-aura {
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  background: radial-gradient(
    circle,
    rgba(114, 134, 255, 0.22),
    rgba(77, 196, 255, 0.1) 46%,
    transparent 72%
  );
  filter: blur(8px);
}

.cursor-core {
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 0 0 6px rgba(114, 134, 255, 0.12),
    0 0 16px rgba(114, 134, 255, 0.18);
}

.cursor-shell.is-pressed .cursor-aura {
  transform: scale(0.92);
  opacity: 0.82;
}

.cursor-shell.is-pressed .cursor-core {
  transform: scale(1.06);
}

body.cursor-hover .cursor-aura {
  transform: scale(1.18);
  opacity: 0.88;
}

body.cursor-hover .cursor-core {
  transform: scale(0.9);
  background: rgba(223, 229, 255, 0.98);
  box-shadow:
    0 0 0 9px rgba(114, 134, 255, 0.12),
    0 0 20px rgba(77, 196, 255, 0.16);
}

.protocol-bar {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(10, 15, 27, 0.78);
  box-shadow: 0 14px 40px rgba(3, 7, 18, 0.24);
  backdrop-filter: blur(18px);
}

.protocol-bar::before,
.card::after {
  opacity: 0.36;
}

.brand-mark {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  box-shadow: none;
}

.brand-copy strong {
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}

.brand-sub {
  color: #97a3c3;
}

.protocol-route span,
.section-id,
.panel-code {
  color: #afbbff;
}

.status-pill,
.eyebrow {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: #cad3ef;
}

.card {
  border-color: rgba(114, 134, 255, 0.12);
  background: linear-gradient(
    180deg,
    rgba(14, 20, 34, 0.94),
    rgba(10, 14, 25, 0.96)
  );
  backdrop-filter: blur(20px);
}

.card::before {
  background:
    radial-gradient(
      circle at top left,
      rgba(114, 134, 255, 0.12),
      transparent 24%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 28%);
}

.hero {
  gap: 24px;
  min-height: unset;
  padding-block: 12px 6px;
  align-items: start;
}

.hero-kicker {
  margin-bottom: 12px;
}

.hero-seq {
  color: #8e9bc0;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
}

.hero-title {
  max-width: 11ch;
  margin-bottom: 14px;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero-title strong,
.ending-title strong {
  background: linear-gradient(135deg, #ffffff 10%, #d0d9ff 46%, #84a1ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-text,
.ending-text {
  max-width: 34rem;
  color: #c7d0e8;
  font-size: 1rem;
  line-height: 1.75;
}

.section-title {
  font-size: 1.42rem;
  letter-spacing: -0.025em;
}

.signal-node,
.tile,
.summary-item,
.kpi,
.chart-wrap,
.history-row,
.footer-card,
.draft-card,
.summary-card,
.stack-card,
.action-panel,
.event-item,
.stat-card,
.talent-card,
.quote-card,
.turn-choice {
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(14, 20, 34, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 28px rgba(3, 7, 18, 0.2);
}

.signal-node::before,
.tile::before,
.summary-item::before,
.kpi::before,
.chart-wrap::before,
.history-row::before,
.footer-card::before,
.draft-card::before,
.summary-card::before,
.stack-card::before,
.action-panel::before,
.event-item::before,
.stat-card::before,
.talent-card::before {
  opacity: 0.22;
}

.signal-node span,
.tile-label,
.summary-label,
.kpi-label,
.chart-caption,
.history-pill,
.turn-choice-code,
.stat-code,
.talent-code,
.section-id,
.panel-code {
  color: #93a1c7;
}

.section-caption,
.hint,
.muted,
.turn-text,
.event-text,
.history-sub,
.empty {
  color: #c4cde3;
}

.button-primary {
  background: linear-gradient(135deg, #6a80ff, #4bb5ff);
  box-shadow: 0 10px 24px rgba(74, 112, 255, 0.22);
}

.button-secondary {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.button-ghost {
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.button:hover,
.talent-card:hover,
.turn-choice:hover,
.stat-button:hover {
  box-shadow: 0 12px 26px rgba(3, 7, 18, 0.24);
}

.talent-card:hover,
.turn-choice-balanced:hover,
.turn-choice-steady:hover,
.turn-choice-aggressive:hover {
  border-color: rgba(114, 134, 255, 0.28);
}

.talent-card.is-selected {
  border-color: rgba(171, 184, 255, 0.22);
  box-shadow:
    0 0 0 1px rgba(114, 134, 255, 0.16),
    0 12px 30px rgba(3, 7, 18, 0.26);
  background: linear-gradient(
    180deg,
    rgba(20, 27, 46, 0.96),
    rgba(11, 16, 29, 0.96)
  );
}

.rarity.common,
.chip,
.delta.flat {
  background: rgba(255, 255, 255, 0.035);
}

.rarity.rare,
.chip-accent {
  color: #d8e0ff;
  background: rgba(114, 134, 255, 0.16);
  border-color: rgba(114, 134, 255, 0.2);
}

.rarity.epic,
.chip-gain,
.delta.gain {
  color: #d6efff;
  background: rgba(77, 196, 255, 0.14);
  border-color: rgba(77, 196, 255, 0.18);
}

.chip-loss,
.delta.loss {
  color: #ffd6e0;
  background: rgba(255, 154, 187, 0.14);
  border-color: rgba(255, 154, 187, 0.18);
}

.stat-meter span {
  background: linear-gradient(90deg, #eef3ff, #8fa6ff 54%, #58d0ff 100%);
  box-shadow: none;
}

.stat-button {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.stack-card,
.action-panel {
  box-shadow: 0 16px 36px rgba(3, 7, 18, 0.24);
}

.stack-card-final,
.action-panel.is-finished {
  border-color: rgba(114, 134, 255, 0.2);
  background: linear-gradient(
    180deg,
    rgba(20, 27, 46, 0.96),
    rgba(11, 16, 29, 0.96)
  );
}

.event-item.market,
.event-item.choice {
  background: rgba(16, 22, 38, 0.8);
}

.event-item.choice {
  border-color: rgba(114, 134, 255, 0.18);
}

.empty {
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.tone-bear {
  --tone-border: rgba(136, 153, 255, 0.2);
  --tone-glow: rgba(136, 153, 255, 0.08);
}

.tone-crab {
  --tone-border: rgba(186, 198, 231, 0.18);
  --tone-glow: rgba(186, 198, 231, 0.08);
}

.tone-mixed {
  --tone-border: rgba(114, 134, 255, 0.2);
  --tone-glow: rgba(114, 134, 255, 0.08);
}

.tone-bull {
  --tone-border: rgba(119, 203, 255, 0.2);
  --tone-glow: rgba(119, 203, 255, 0.08);
}

.tone-mania {
  --tone-border: rgba(255, 154, 187, 0.22);
  --tone-glow: rgba(255, 154, 187, 0.1);
}

.year-badge {
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
}

.year-badge.tone-bear {
  color: #d9e0ff;
  border-color: rgba(136, 153, 255, 0.18);
  background: rgba(136, 153, 255, 0.08);
}

.year-badge.tone-crab {
  color: #e6ebfa;
  border-color: rgba(186, 198, 231, 0.16);
  background: rgba(186, 198, 231, 0.08);
}

.year-badge.tone-mixed {
  color: #d9e0ff;
  border-color: rgba(114, 134, 255, 0.18);
  background: rgba(114, 134, 255, 0.08);
}

.year-badge.tone-bull {
  color: #d9f3ff;
  border-color: rgba(119, 203, 255, 0.18);
  background: rgba(119, 203, 255, 0.08);
}

.year-badge.tone-mania {
  color: #ffe0e9;
  border-color: rgba(255, 154, 187, 0.18);
  background: rgba(255, 154, 187, 0.08);
}

@media (max-width: 820px) {
  .hero-title {
    max-width: none;
  }
}

.protocol-bar {
  overflow: visible;
  z-index: 20;
}

.protocol-tools {
  position: relative;
  display: grid;
  gap: 8px;
  justify-items: end;
  align-self: flex-start;
}

.utility-button {
  min-width: 104px;
  min-height: 38px;
  padding: 10px 14px;
  border-radius: 14px;
  justify-content: space-between;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.utility-button strong {
  color: var(--ink);
  font-size: 0.92rem;
  letter-spacing: 0;
}

.language-toggle {
  min-width: 92px;
  justify-content: center;
  gap: 8px;
}

.language-toggle-label {
  color: var(--ink-dim);
  transition: color 160ms ease;
}

.language-toggle-label.is-active {
  color: var(--ink);
}

.language-toggle-divider {
  color: var(--ink-dim);
}

.history-shell {
  position: relative;
}

.history-shell.is-open .history-toggle {
  border-color: var(--theme-history-toggle-active-border);
  background: var(--theme-history-toggle-active-bg);
  color: var(--theme-history-toggle-active-ink);
}

.history-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 40;
  width: min(420px, calc(100vw - 32px));
  max-height: min(68vh, 560px);
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--theme-history-popover-border);
  border-radius: 22px;
  background: var(--theme-history-popover-bg);
  box-shadow: var(--theme-history-popover-shadow);
  backdrop-filter: blur(24px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.history-shell.is-open .history-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.history-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-popover-head .sub-title {
  margin: 0;
}

.history-popover-caption {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.7;
}

.history-list-compact {
  margin-top: 16px;
}

.history-list-compact .history-row {
  padding: 13px 14px;
}

.history-popover .empty {
  margin-top: 16px;
  border-radius: 18px;
}

.page-toolbar {
  position: relative;
  z-index: 25;
  display: flex;
  justify-content: flex-end;
}

.page-toolbar .protocol-tools {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

@media (max-width: 820px) {
  .page-toolbar {
    justify-content: flex-start;
  }

  .page-toolbar .protocol-tools {
    justify-content: flex-start;
  }

  .protocol-meta {
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
  }

  .protocol-route,
  .protocol-pills {
    justify-items: start;
    justify-content: flex-start;
  }

  .history-popover {
    width: min(420px, calc(100vw - 28px));
  }
}

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #edf3ff;
  --bg-deep: #dfe8fb;
  --ink: #182234;
  --ink-soft: #5a6884;
  --ink-dim: #7c89a4;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --panel-elevated: rgba(248, 250, 255, 0.96);
  --line: rgba(95, 115, 255, 0.12);
  --line-strong: rgba(95, 115, 255, 0.2);
  --accent: #5d72ff;
  --accent-2: #49b5ff;
  --accent-3: #ffffff;
  --gain: #3da6d8;
  --gain-soft: rgba(61, 166, 216, 0.14);
  --loss: #d86f8e;
  --loss-soft: rgba(216, 111, 142, 0.14);
  --warn: #6f8cff;
  --warn-soft: rgba(111, 140, 255, 0.12);
  --shadow: 0 18px 52px rgba(96, 118, 160, 0.18);
  --theme-body-bg:
    radial-gradient(
      circle at 16% 12%,
      rgba(114, 134, 255, 0.16),
      transparent 22%
    ),
    radial-gradient(
      circle at 84% 14%,
      rgba(77, 196, 255, 0.1),
      transparent 18%
    ),
    radial-gradient(
      circle at 54% 82%,
      rgba(109, 145, 255, 0.12),
      transparent 30%
    ),
    linear-gradient(180deg, #f9fbff 0%, #eef4ff 44%, #e8effd 74%, #dfe8fb 100%);
  --theme-body-before:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent 18%),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.58), transparent 28%);
  --theme-glow-blur: 180px;
  --theme-glow-opacity: 0.46;
  --theme-glow-a: rgba(114, 134, 255, 0.14);
  --theme-glow-b: rgba(77, 196, 255, 0.12);
  --theme-grid-line: rgba(107, 127, 188, 0.08);
  --theme-grid-opacity: 0.22;
  --theme-grid-accent: linear-gradient(
    135deg,
    transparent 20%,
    rgba(114, 134, 255, 0.05),
    transparent 74%
  );
  --theme-noise-opacity: 0.01;
  --theme-spotlight-bg:
    radial-gradient(
      520px circle at var(--pointer-x) var(--pointer-y),
      rgba(114, 134, 255, 0.1),
      transparent 42%
    ),
    radial-gradient(
      180px circle at var(--pointer-x) var(--pointer-y),
      rgba(255, 255, 255, 0.48),
      transparent 18%
    );
  --theme-spotlight-opacity: 0.42;
  --theme-cursor-aura-bg: radial-gradient(
    circle,
    rgba(114, 134, 255, 0.16),
    rgba(77, 196, 255, 0.08) 46%,
    transparent 72%
  );
  --theme-cursor-core-bg: rgba(255, 255, 255, 0.96);
  --theme-cursor-core-shadow:
    0 0 0 6px rgba(114, 134, 255, 0.12), 0 0 16px rgba(77, 196, 255, 0.14);
  --theme-cursor-core-hover-bg: rgba(247, 250, 255, 0.98);
  --theme-cursor-core-hover-shadow:
    0 0 0 9px rgba(114, 134, 255, 0.12), 0 0 20px rgba(77, 196, 255, 0.14);
  --theme-bar-bg: rgba(255, 255, 255, 0.78);
  --theme-bar-shadow: 0 14px 40px rgba(96, 118, 160, 0.16);
  --theme-brand-mark-border: rgba(95, 115, 255, 0.14);
  --theme-brand-mark-bg: rgba(95, 115, 255, 0.08);
  --theme-brand-mark-ink: #4f63dd;
  --theme-brand-sub: #7d8aa5;
  --theme-label-accent: #5d72ff;
  --theme-pill-border: rgba(95, 115, 255, 0.1);
  --theme-pill-bg: rgba(95, 115, 255, 0.05);
  --theme-pill-ink: #687799;
  --theme-card-border: rgba(125, 146, 187, 0.16);
  --theme-card-bg: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92),
    rgba(247, 250, 255, 0.96)
  );
  --theme-card-overlay:
    radial-gradient(
      circle at top left,
      rgba(95, 115, 255, 0.06),
      transparent 24%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 28%);
  --theme-shine-opacity: 0.32;
  --theme-hero-seq: #7a88ab;
  --theme-headline-gradient: linear-gradient(
    135deg,
    #3247bb 10%,
    #6174ff 48%,
    #43aef5 100%
  );
  --theme-body-copy: #576784;
  --theme-surface-border: rgba(125, 146, 187, 0.14);
  --theme-surface-bg: rgba(255, 255, 255, 0.78);
  --theme-surface-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 12px 28px rgba(104, 123, 166, 0.12);
  --theme-life-board-border: rgba(125, 146, 187, 0.16);
  --theme-life-board-bg: rgba(248, 250, 255, 0.96);
  --theme-life-log-border: rgba(125, 146, 187, 0.18);
  --theme-life-row-border: rgba(125, 146, 187, 0.14);
  --theme-life-row-bg: rgba(255, 255, 255, 0.82);
  --theme-life-row-alt-bg: rgba(244, 247, 255, 0.96);
  --theme-life-current-border: rgba(95, 115, 255, 0.28);
  --theme-life-current-bg: linear-gradient(180deg, #7296ff, #5f84ea);
  --theme-life-current-ink: #ffffff;
  --theme-surface-shine: linear-gradient(
    90deg,
    transparent,
    rgba(95, 115, 255, 0.28),
    transparent
  );
  --theme-meta-ink: #7080a2;
  --theme-copy-soft: #5a6884;
  --theme-button-primary-ink: #ffffff;
  --theme-button-primary-bg: linear-gradient(135deg, #5d72ff, #47b1ff);
  --theme-button-primary-shadow: 0 10px 24px rgba(93, 115, 255, 0.22);
  --theme-button-secondary-border: rgba(95, 115, 255, 0.12);
  --theme-button-secondary-bg: rgba(255, 255, 255, 0.72);
  --theme-button-ghost-border: rgba(95, 115, 255, 0.08);
  --theme-button-ghost-bg: rgba(255, 255, 255, 0.54);
  --theme-history-toggle-active-border: rgba(95, 115, 255, 0.18);
  --theme-history-toggle-active-bg: rgba(95, 115, 255, 0.12);
  --theme-history-toggle-active-ink: #3347bb;
  --theme-history-popover-border: rgba(95, 115, 255, 0.12);
  --theme-history-popover-bg:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.96),
      rgba(245, 249, 255, 0.98)
    ),
    radial-gradient(
      circle at top right,
      rgba(95, 115, 255, 0.12),
      transparent 36%
    );
  --theme-history-popover-shadow: 0 28px 70px rgba(104, 123, 166, 0.18);
  --theme-interactive-shadow: 0 12px 26px rgba(104, 123, 166, 0.16);
  --theme-interactive-border: rgba(114, 134, 255, 0.22);
  --theme-selected-border: rgba(95, 115, 255, 0.18);
  --theme-selected-shadow:
    0 0 0 1px rgba(95, 115, 255, 0.1), 0 12px 30px rgba(104, 123, 166, 0.16);
  --theme-selected-bg: linear-gradient(
    180deg,
    rgba(248, 250, 255, 0.96),
    rgba(240, 245, 255, 0.96)
  );
  --theme-chip-bg: rgba(255, 255, 255, 0.56);
  --theme-chip-ink: #5a6884;
  --theme-chip-border: rgba(125, 146, 187, 0.12);
  --theme-accent-chip-ink: #4f63df;
  --theme-accent-chip-bg: rgba(95, 115, 255, 0.12);
  --theme-accent-chip-border: rgba(95, 115, 255, 0.18);
  --theme-gain-chip-ink: #277ea7;
  --theme-gain-chip-bg: rgba(77, 196, 255, 0.12);
  --theme-gain-chip-border: rgba(77, 196, 255, 0.18);
  --theme-loss-chip-ink: #b35b79;
  --theme-loss-chip-bg: rgba(255, 154, 187, 0.14);
  --theme-loss-chip-border: rgba(255, 154, 187, 0.18);
  --theme-meter-fill: linear-gradient(
    90deg,
    #eef3ff,
    #8fa6ff 54%,
    #58d0ff 100%
  );
  --theme-stat-button-border: rgba(125, 146, 187, 0.12);
  --theme-stat-button-bg: rgba(255, 255, 255, 0.56);
  --theme-stack-shadow: 0 16px 36px rgba(104, 123, 166, 0.16);
  --theme-final-border: rgba(95, 115, 255, 0.18);
  --theme-final-bg: linear-gradient(
    180deg,
    rgba(248, 250, 255, 0.96),
    rgba(240, 245, 255, 0.96)
  );
  --theme-event-bg: rgba(248, 250, 255, 0.74);
  --theme-event-choice-border: rgba(95, 115, 255, 0.14);
  --theme-empty-border: rgba(125, 146, 187, 0.12);
  --theme-empty-bg: rgba(255, 255, 255, 0.46);
  --theme-bear-ink: #5d72ff;
  --theme-bear-border: rgba(95, 115, 255, 0.16);
  --theme-bear-bg: rgba(95, 115, 255, 0.08);
  --theme-crab-ink: #7482a5;
  --theme-crab-border: rgba(116, 130, 165, 0.16);
  --theme-crab-bg: rgba(116, 130, 165, 0.08);
  --theme-mixed-ink: #4d67da;
  --theme-mixed-border: rgba(114, 134, 255, 0.16);
  --theme-mixed-bg: rgba(114, 134, 255, 0.08);
  --theme-bull-ink: #268fc2;
  --theme-bull-border: rgba(77, 196, 255, 0.18);
  --theme-bull-bg: rgba(77, 196, 255, 0.08);
  --theme-mania-ink: #c06184;
  --theme-mania-border: rgba(255, 154, 187, 0.18);
  --theme-mania-bg: rgba(255, 154, 187, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-deep: #070b14;
  --ink: #f3f6ff;
  --ink-soft: #c4ccdf;
  --ink-dim: #8691ab;
  --panel: rgba(14, 20, 34, 0.78);
  --panel-strong: rgba(11, 16, 29, 0.92);
  --panel-elevated: rgba(11, 16, 29, 0.97);
  --line: rgba(114, 134, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.1);
  --accent: #7286ff;
  --accent-2: #4dc4ff;
  --accent-3: #f3f6ff;
  --gain: #aab8ff;
  --gain-soft: rgba(170, 184, 255, 0.14);
  --loss: #ff9abb;
  --loss-soft: rgba(255, 154, 187, 0.14);
  --warn: #9fe1ff;
  --warn-soft: rgba(159, 225, 255, 0.12);
  --shadow: 0 18px 52px rgba(2, 7, 18, 0.28);
  --theme-body-bg:
    radial-gradient(
      circle at 16% 12%,
      rgba(114, 134, 255, 0.24),
      transparent 22%
    ),
    radial-gradient(
      circle at 84% 14%,
      rgba(77, 196, 255, 0.14),
      transparent 18%
    ),
    radial-gradient(
      circle at 54% 82%,
      rgba(73, 96, 168, 0.18),
      transparent 30%
    ),
    linear-gradient(
      180deg,
      #151d34 0%,
      #0d1323 42%,
      var(--bg) 74%,
      var(--bg-deep) 100%
    );
  --theme-body-before:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 18%),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.04), transparent 26%);
  --theme-glow-blur: 160px;
  --theme-glow-opacity: 0.36;
  --theme-glow-a: rgba(114, 134, 255, 0.2);
  --theme-glow-b: rgba(77, 196, 255, 0.16);
  --theme-grid-line: rgba(107, 127, 188, 0.14);
  --theme-grid-opacity: 0.16;
  --theme-grid-accent: linear-gradient(
    135deg,
    transparent 20%,
    rgba(114, 134, 255, 0.08),
    transparent 74%
  );
  --theme-noise-opacity: 0.012;
  --theme-spotlight-bg:
    radial-gradient(
      520px circle at var(--pointer-x) var(--pointer-y),
      rgba(114, 134, 255, 0.14),
      transparent 42%
    ),
    radial-gradient(
      180px circle at var(--pointer-x) var(--pointer-y),
      rgba(255, 255, 255, 0.05),
      transparent 18%
    );
  --theme-spotlight-opacity: 0.55;
  --theme-cursor-aura-bg: radial-gradient(
    circle,
    rgba(114, 134, 255, 0.22),
    rgba(77, 196, 255, 0.1) 46%,
    transparent 72%
  );
  --theme-cursor-core-bg: rgba(255, 255, 255, 0.96);
  --theme-cursor-core-shadow:
    0 0 0 6px rgba(114, 134, 255, 0.12), 0 0 16px rgba(114, 134, 255, 0.18);
  --theme-cursor-core-hover-bg: rgba(223, 229, 255, 0.98);
  --theme-cursor-core-hover-shadow:
    0 0 0 9px rgba(114, 134, 255, 0.12), 0 0 20px rgba(77, 196, 255, 0.16);
  --theme-bar-bg: rgba(10, 15, 27, 0.78);
  --theme-bar-shadow: 0 14px 40px rgba(3, 7, 18, 0.24);
  --theme-brand-mark-border: rgba(255, 255, 255, 0.12);
  --theme-brand-mark-bg: rgba(255, 255, 255, 0.07);
  --theme-brand-mark-ink: var(--ink);
  --theme-brand-sub: #97a3c3;
  --theme-label-accent: #afbbff;
  --theme-pill-border: rgba(255, 255, 255, 0.08);
  --theme-pill-bg: rgba(255, 255, 255, 0.035);
  --theme-pill-ink: #cad3ef;
  --theme-card-border: rgba(114, 134, 255, 0.12);
  --theme-card-bg: linear-gradient(
    180deg,
    rgba(14, 20, 34, 0.94),
    rgba(10, 14, 25, 0.96)
  );
  --theme-card-overlay:
    radial-gradient(
      circle at top left,
      rgba(114, 134, 255, 0.12),
      transparent 24%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 28%);
  --theme-shine-opacity: 0.36;
  --theme-hero-seq: #8e9bc0;
  --theme-headline-gradient: linear-gradient(
    135deg,
    #ffffff 10%,
    #d0d9ff 46%,
    #84a1ff 100%
  );
  --theme-body-copy: #c7d0e8;
  --theme-surface-border: rgba(255, 255, 255, 0.07);
  --theme-surface-bg: rgba(14, 20, 34, 0.72);
  --theme-surface-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 28px rgba(3, 7, 18, 0.2);
  --theme-life-board-border: rgba(255, 255, 255, 0.07);
  --theme-life-board-bg: rgba(63, 63, 68, 0.98);
  --theme-life-log-border: rgba(255, 255, 255, 0.16);
  --theme-life-row-border: rgba(255, 255, 255, 0.18);
  --theme-life-row-bg: rgba(74, 74, 78, 0.98);
  --theme-life-row-alt-bg: rgba(78, 78, 82, 0.98);
  --theme-life-current-border: rgba(154, 186, 255, 0.44);
  --theme-life-current-bg: linear-gradient(
    180deg,
    rgba(115, 157, 255, 0.96),
    rgba(95, 139, 244, 0.96)
  );
  --theme-life-current-ink: #f8fbff;
  --theme-surface-shine: linear-gradient(
    90deg,
    transparent,
    rgba(114, 134, 255, 0.28),
    transparent
  );
  --theme-meta-ink: #93a1c7;
  --theme-copy-soft: #c4cde3;
  --theme-button-primary-ink: #ffffff;
  --theme-button-primary-bg: linear-gradient(135deg, #6a80ff, #4bb5ff);
  --theme-button-primary-shadow: 0 10px 24px rgba(74, 112, 255, 0.22);
  --theme-button-secondary-border: rgba(255, 255, 255, 0.08);
  --theme-button-secondary-bg: rgba(255, 255, 255, 0.035);
  --theme-button-ghost-border: rgba(255, 255, 255, 0.07);
  --theme-button-ghost-bg: rgba(255, 255, 255, 0.02);
  --theme-history-toggle-active-border: rgba(114, 134, 255, 0.22);
  --theme-history-toggle-active-bg: rgba(114, 134, 255, 0.12);
  --theme-history-toggle-active-ink: var(--ink);
  --theme-history-popover-border: rgba(255, 255, 255, 0.08);
  --theme-history-popover-bg:
    linear-gradient(180deg, rgba(18, 25, 42, 0.98), rgba(10, 15, 28, 0.98)),
    radial-gradient(
      circle at top right,
      rgba(114, 134, 255, 0.16),
      transparent 36%
    );
  --theme-history-popover-shadow: 0 28px 70px rgba(3, 7, 18, 0.34);
  --theme-interactive-shadow: 0 12px 26px rgba(3, 7, 18, 0.24);
  --theme-interactive-border: rgba(114, 134, 255, 0.28);
  --theme-selected-border: rgba(171, 184, 255, 0.22);
  --theme-selected-shadow:
    0 0 0 1px rgba(114, 134, 255, 0.16), 0 12px 30px rgba(3, 7, 18, 0.26);
  --theme-selected-bg: linear-gradient(
    180deg,
    rgba(20, 27, 46, 0.96),
    rgba(11, 16, 29, 0.96)
  );
  --theme-chip-bg: rgba(255, 255, 255, 0.035);
  --theme-chip-ink: #d2cbe4;
  --theme-chip-border: rgba(255, 255, 255, 0.08);
  --theme-accent-chip-ink: #d8e0ff;
  --theme-accent-chip-bg: rgba(114, 134, 255, 0.16);
  --theme-accent-chip-border: rgba(114, 134, 255, 0.2);
  --theme-gain-chip-ink: #d6efff;
  --theme-gain-chip-bg: rgba(77, 196, 255, 0.14);
  --theme-gain-chip-border: rgba(77, 196, 255, 0.18);
  --theme-loss-chip-ink: #ffd6e0;
  --theme-loss-chip-bg: rgba(255, 154, 187, 0.14);
  --theme-loss-chip-border: rgba(255, 154, 187, 0.18);
  --theme-meter-fill: linear-gradient(
    90deg,
    #eef3ff,
    #8fa6ff 54%,
    #58d0ff 100%
  );
  --theme-stat-button-border: rgba(255, 255, 255, 0.08);
  --theme-stat-button-bg: rgba(255, 255, 255, 0.035);
  --theme-stack-shadow: 0 16px 36px rgba(3, 7, 18, 0.24);
  --theme-final-border: rgba(114, 134, 255, 0.2);
  --theme-final-bg: linear-gradient(
    180deg,
    rgba(20, 27, 46, 0.96),
    rgba(11, 16, 29, 0.96)
  );
  --theme-event-bg: rgba(16, 22, 38, 0.8);
  --theme-event-choice-border: rgba(114, 134, 255, 0.18);
  --theme-empty-border: rgba(255, 255, 255, 0.07);
  --theme-empty-bg: rgba(255, 255, 255, 0.02);
  --theme-bear-ink: #d9e0ff;
  --theme-bear-border: rgba(136, 153, 255, 0.18);
  --theme-bear-bg: rgba(136, 153, 255, 0.08);
  --theme-crab-ink: #e6ebfa;
  --theme-crab-border: rgba(186, 198, 231, 0.16);
  --theme-crab-bg: rgba(186, 198, 231, 0.08);
  --theme-mixed-ink: #d9e0ff;
  --theme-mixed-border: rgba(114, 134, 255, 0.18);
  --theme-mixed-bg: rgba(114, 134, 255, 0.08);
  --theme-bull-ink: #d9f3ff;
  --theme-bull-border: rgba(119, 203, 255, 0.18);
  --theme-bull-bg: rgba(119, 203, 255, 0.08);
  --theme-mania-ink: #ffe0e9;
  --theme-mania-border: rgba(255, 154, 187, 0.18);
  --theme-mania-bg: rgba(255, 154, 187, 0.08);
}

html,
body {
  background: var(--theme-body-bg);
}

body::before {
  background: var(--theme-body-before);
}

.page-glow {
  filter: blur(var(--theme-glow-blur));
  opacity: var(--theme-glow-opacity);
}

.page-glow-a {
  background: var(--theme-glow-a);
}

.page-glow-b {
  background: var(--theme-glow-b);
}

.page-grid {
  background-image:
    linear-gradient(var(--theme-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--theme-grid-line) 1px, transparent 1px);
  opacity: var(--theme-grid-opacity);
}

.page-grid::after {
  background: var(--theme-grid-accent);
}

.page-noise {
  opacity: var(--theme-noise-opacity);
}

.page-spotlight {
  background: var(--theme-spotlight-bg);
  opacity: var(--theme-spotlight-opacity);
}

.cursor-aura {
  background: var(--theme-cursor-aura-bg);
}

.cursor-core {
  background: var(--theme-cursor-core-bg);
  box-shadow: var(--theme-cursor-core-shadow);
}

body.cursor-hover .cursor-core {
  background: var(--theme-cursor-core-hover-bg);
  box-shadow: var(--theme-cursor-core-hover-shadow);
}

.protocol-meta {
  gap: 12px;
}

.protocol-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-toggle {
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.protocol-bar {
  background: var(--theme-bar-bg);
  box-shadow: var(--theme-bar-shadow);
}

.protocol-bar::before,
.card::after {
  opacity: var(--theme-shine-opacity);
}

.brand-mark {
  border-color: var(--theme-brand-mark-border);
  background: var(--theme-brand-mark-bg);
  color: var(--theme-brand-mark-ink);
}

.brand-sub {
  color: var(--theme-brand-sub);
}

.protocol-route span,
.section-id,
.panel-code {
  color: var(--theme-label-accent);
}

.status-pill,
.eyebrow {
  border-color: var(--theme-pill-border);
  background: var(--theme-pill-bg);
  color: var(--theme-pill-ink);
}

.card {
  border-color: var(--theme-card-border);
  background: var(--theme-card-bg);
}

.card::before {
  background: var(--theme-card-overlay);
}

.hero-seq {
  color: var(--theme-hero-seq);
}

.hero-title strong,
.ending-title strong {
  background: var(--theme-headline-gradient);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-text,
.ending-text {
  color: var(--theme-body-copy);
}

.signal-node,
.tile,
.summary-item,
.kpi,
.chart-wrap,
.history-row,
.footer-card,
.draft-card,
.summary-card,
.stack-card,
.action-panel,
.event-item,
.stat-card,
.talent-card,
.quote-card,
.turn-choice {
  border-color: var(--theme-surface-border);
  background: var(--theme-surface-bg);
  box-shadow: var(--theme-surface-shadow);
}

.signal-node::before,
.tile::before,
.summary-item::before,
.kpi::before,
.chart-wrap::before,
.history-row::before,
.footer-card::before,
.draft-card::before,
.summary-card::before,
.stack-card::before,
.action-panel::before,
.event-item::before,
.stat-card::before,
.talent-card::before {
  background: var(--theme-surface-shine);
}

.life-board {
  border-color: var(--theme-life-board-border);
  background: var(--theme-life-board-bg);
}

.life-log {
  border-top-color: var(--theme-life-log-border);
  border-bottom-color: var(--theme-life-log-border);
}

.life-row {
  border-bottom-color: var(--theme-life-row-border);
  background: var(--theme-life-row-bg);
}

.life-row:nth-child(2n) {
  background: var(--theme-life-row-alt-bg);
}

.signal-node span,
.tile-label,
.summary-label,
.kpi-label,
.chart-caption,
.history-pill,
.turn-choice-code,
.stat-code,
.talent-code,
.section-id,
.panel-code {
  color: var(--theme-meta-ink);
}

.section-caption,
.hint,
.muted,
.turn-text,
.event-text,
.history-sub,
.empty {
  color: var(--theme-copy-soft);
}

.button-primary {
  color: var(--theme-button-primary-ink);
  background: var(--theme-button-primary-bg);
  box-shadow: var(--theme-button-primary-shadow);
}

.button-secondary {
  border-color: var(--theme-button-secondary-border);
  background: var(--theme-button-secondary-bg);
}

.button-ghost {
  border-color: var(--theme-button-ghost-border);
  background: var(--theme-button-ghost-bg);
}

.button:hover,
.talent-card:hover,
.turn-choice:hover,
.stat-button:hover {
  box-shadow: var(--theme-interactive-shadow);
}

.talent-card:hover,
.turn-choice-balanced:hover,
.turn-choice-steady:hover,
.turn-choice-aggressive:hover {
  border-color: var(--theme-interactive-border);
}

.talent-card.is-selected {
  border-color: var(--theme-selected-border);
  box-shadow: var(--theme-selected-shadow);
  background: var(--theme-selected-bg);
}

.rarity.common,
.chip,
.delta.flat {
  color: var(--theme-chip-ink);
  background: var(--theme-chip-bg);
  border-color: var(--theme-chip-border);
}

.rarity.rare,
.chip-accent {
  color: var(--theme-accent-chip-ink);
  background: var(--theme-accent-chip-bg);
  border-color: var(--theme-accent-chip-border);
}

.rarity.epic,
.chip-gain,
.delta.gain {
  color: var(--theme-gain-chip-ink);
  background: var(--theme-gain-chip-bg);
  border-color: var(--theme-gain-chip-border);
}

.chip-loss,
.delta.loss {
  color: var(--theme-loss-chip-ink);
  background: var(--theme-loss-chip-bg);
  border-color: var(--theme-loss-chip-border);
}

.stat-meter span {
  background: var(--theme-meter-fill);
}

.stat-button {
  border-color: var(--theme-stat-button-border);
  background: var(--theme-stat-button-bg);
}

.stack-card,
.action-panel {
  box-shadow: var(--theme-stack-shadow);
}

.stack-card-final,
.action-panel.is-finished {
  border-color: var(--theme-final-border);
  background: var(--theme-final-bg);
}

.event-item.market,
.event-item.choice {
  background: var(--theme-event-bg);
}

.event-item.choice {
  border-color: var(--theme-event-choice-border);
}

.empty {
  border-color: var(--theme-empty-border);
  background: var(--theme-empty-bg);
}

.year-badge.tone-bear {
  color: var(--theme-bear-ink);
  border-color: var(--theme-bear-border);
  background: var(--theme-bear-bg);
}

.year-badge.tone-crab {
  color: var(--theme-crab-ink);
  border-color: var(--theme-crab-border);
  background: var(--theme-crab-bg);
}

.year-badge.tone-mixed {
  color: var(--theme-mixed-ink);
  border-color: var(--theme-mixed-border);
  background: var(--theme-mixed-bg);
}

.year-badge.tone-bull {
  color: var(--theme-bull-ink);
  border-color: var(--theme-bull-border);
  background: var(--theme-bull-bg);
}

.year-badge.tone-mania {
  color: var(--theme-mania-ink);
  border-color: var(--theme-mania-border);
  background: var(--theme-mania-bg);
}

@media (max-width: 1040px) {
  .protocol-tools {
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .protocol-meta,
  .protocol-tools {
    width: 100%;
  }
}

.protocol-bar {
  overflow: visible;
  z-index: 20;
}

.protocol-tools {
  position: relative;
  display: grid;
  gap: 8px;
  justify-items: end;
  align-self: flex-start;
  width: auto;
}

.theme-toggle {
  border-radius: 14px;
}

@media (max-width: 1040px) {
  .protocol-tools {
    justify-items: end;
  }
}

@media (max-width: 820px) {
  .protocol-meta {
    width: 100%;
  }

  .protocol-tools {
    width: auto;
  }
}

.simulation-shell {
  display: grid;
  gap: 14px;
}

.simulation-head {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
}

.simulation-head > div {
  display: grid;
  width: 100%;
  justify-items: center;
}

.simulation-title {
  margin: 8px 0 0;
  font-family: "Chakra Petch", sans-serif;
  font-size: clamp(2rem, 4.6vw, 2.9rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.simulation-caption {
  margin-top: 8px;
  max-width: 780px;
  color: var(--theme-copy-soft);
  font-size: 0.96rem;
  line-height: 1.72;
  text-align: center;
}

.simulation-build {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  width: 100%;
  justify-items: center;
}

.simulation-build-row {
  display: grid;
  gap: 8px;
  width: 100%;
  justify-items: center;
}

.simulation-build-label {
  font-size: 0.76rem;
  line-height: 1;
  letter-spacing: 0.12em;
  color: var(--theme-meta-ink);
  text-align: center;
}

.simulation-talent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.simulation-talent-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(20, 25, 34, 0.16);
  border-radius: 10px;
  background: #2d333c;
  color: #f8f9fb;
  font-size: 0.92rem;
  line-height: 1;
}

.simulation-starting-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  max-width: 760px;
  margin: 0 auto;
}

.simulation-starting-card {
  overflow: hidden;
  border: 1px solid rgba(24, 31, 41, 0.22);
  border-radius: 8px;
  background: #e8eaed;
}

.simulation-starting-key {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 8px;
  background: #2b313a;
  color: #ffffff;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.simulation-starting-value {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  color: #232a34;
  font-size: 1.08rem;
  font-weight: 600;
}

.simulation-shell.is-click-reveal .life-board-plain {
  cursor: pointer;
}

.life-board-plain {
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--theme-life-board-border);
  background: var(--theme-life-board-bg);
}

.life-board-plain .life-log {
  max-height: min(68vh, 820px);
  overflow: auto;
  border-top: 1px solid var(--theme-life-log-border);
  border-bottom: 1px solid var(--theme-life-log-border);
  scrollbar-gutter: stable;
}

.life-board-plain .life-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 0;
  align-items: center;
  min-height: 48px;
  padding: 0;
  border-bottom: 1px solid var(--theme-life-row-border);
  background: var(--theme-life-row-bg);
}

.life-board-plain .life-row:nth-child(2n) {
  background: var(--theme-life-row-alt-bg);
}

.life-board-plain .life-row:last-child {
  border-bottom: none;
}

.life-board-plain .life-age {
  padding: 11px 12px 11px 20px;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--ink);
}

.life-board-plain .life-text {
  padding: 11px 18px 11px 0;
  color: var(--theme-copy-soft);
  font-size: 1rem;
  line-height: 1.48;
}

.life-board-plain .life-row.is-current {
  position: relative;
  z-index: 1;
  background: var(--theme-life-current-bg);
  box-shadow: inset 0 0 0 1px var(--theme-life-current-border);
}

.life-board-plain .life-row.is-current .life-age,
.life-board-plain .life-row.is-current .life-text {
  color: var(--theme-life-current-ink);
}

.life-board-footer-plain {
  padding: 14px 16px 16px;
}

.life-board-footer-plain .life-board-note {
  flex: 1 1 420px;
  max-width: 760px;
}

.life-board-footer-plain .row-actions {
  margin-top: 0;
}

.life-board-footer-plain .button {
  min-width: 180px;
}

.life-empty {
  padding: 22px 18px;
  color: var(--theme-copy-soft);
  font-size: 0.95rem;
  line-height: 1.7;
}

@media (max-width: 820px) {
  .simulation-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .simulation-starting-grid {
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    max-width: none;
  }

  .life-board-plain .life-row {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .life-board-plain .life-age {
    padding-left: 14px;
  }
}

@media (max-width: 640px) {
  .simulation-title {
    font-size: clamp(1.76rem, 8.8vw, 2.3rem);
  }

  .simulation-build {
    gap: 12px;
  }

  .simulation-talent-pill {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.88rem;
  }

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

  .simulation-starting-key {
    min-height: 30px;
    font-size: 0.9rem;
  }

  .simulation-starting-value {
    min-height: 38px;
    font-size: 1rem;
  }

  .life-board-plain .life-log {
    max-height: 60vh;
  }

  .life-board-plain .life-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .life-board-plain .life-age {
    padding: 10px 8px 10px 12px;
    font-size: 0.94rem;
  }

  .life-board-plain .life-text {
    padding: 10px 12px 10px 0;
    font-size: 0.95rem;
  }

  .life-board-footer-plain .button {
    width: 100%;
    min-width: 0;
  }
}

:root,
:root[data-theme="light"] {
  --theme-flat-bg: #eef1f4;
  --theme-home-title: #20262f;
  --theme-home-subtitle: #4e5867;
  --theme-home-button-bg: rgba(255, 255, 255, 0.28);
  --theme-home-button-border: rgba(32, 38, 47, 0.2);
  --theme-home-button-ink: #20262f;
}

:root[data-theme="dark"] {
  --theme-flat-bg: #272d36;
  --theme-home-title: #f5f7fb;
  --theme-home-subtitle: rgba(245, 247, 251, 0.88);
  --theme-home-button-bg: rgba(255, 255, 255, 0.08);
  --theme-home-button-border: rgba(255, 255, 255, 0.42);
  --theme-home-button-ink: #f5f7fb;
}

html,
body {
  background: var(--theme-flat-bg) !important;
}

body::before,
.page-glow,
.page-grid,
.page-noise,
.page-spotlight {
  display: none !important;
}

.shell-home {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
}

.hero-home {
  width: min(760px, 100%);
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: block;
}

.hero-home::before,
.hero-home::after {
  display: none;
}

.hero-copy-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
}

.hero-title-home {
  width: 100%;
  max-width: none;
  margin: 0;
  color: var(--theme-home-title);
  font-family: "Noto Sans SC", sans-serif;
  font-size: clamp(3.2rem, 10vw, 5.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.05em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.hero-text-home {
  max-width: none;
  margin-top: 20px;
  color: var(--theme-home-subtitle);
  font-size: clamp(1.2rem, 4vw, 2rem);
  line-height: 1.45;
  font-weight: 600;
}

.hero-actions-home {
  justify-content: center;
  margin-top: clamp(72px, 16vh, 160px);
}

.button-home {
  min-width: min(380px, 100%);
  min-height: 78px;
  padding: 18px 28px;
  border: 1px solid var(--theme-home-button-border);
  border-radius: 8px;
  background: var(--theme-home-button-bg);
  color: var(--theme-home-button-ink);
  box-shadow: none;
  font-family: "Noto Sans SC", sans-serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0;
}

.button-home:hover {
  transform: none;
  box-shadow: none;
  background: var(--theme-home-button-bg);
}

@media (max-width: 820px) {
  .shell-home {
    min-height: calc(100vh - 48px);
  }

  .hero-title-home {
    font-size: clamp(2.8rem, 12vw, 4.3rem);
  }

  .hero-text-home {
    font-size: clamp(1.06rem, 4.6vw, 1.6rem);
  }

  .button-home {
    min-height: 68px;
  }
}

html {
  -webkit-text-size-adjust: 100%;
}

@media (max-width: 820px) {
  #app {
    width: min(100vw - 22px, 1180px);
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }

  .shell {
    gap: 14px;
  }

  .section-header {
    align-items: flex-start;
    gap: 14px;
  }

  .section-header > div:first-child {
    width: 100%;
  }

  .section-header .row-actions {
    width: 100%;
    gap: 10px;
  }

  .section-header .row-actions .button {
    flex: 1 1 180px;
    min-width: 0;
  }

  .signal-strip {
    gap: 10px;
  }

  .signal-node,
  .summary-item,
  .draft-card,
  .summary-card,
  .stat-card,
  .talent-card,
  .chart-wrap {
    border-radius: 18px;
  }

  .signal-node {
    padding: 14px 15px;
  }

  .talent-card {
    padding: 15px;
  }

  .talent-head {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .rarity {
    justify-self: start;
  }

  .talent-name,
  .stat-name {
    font-size: 1rem;
  }

  .talent-desc,
  .stat-desc,
  .section-caption,
  .hint,
  .muted,
  .turn-text,
  .event-text {
    font-size: 0.92rem;
    line-height: 1.68;
  }

  .stat-card,
  .draft-card,
  .summary-card {
    padding: 16px;
  }

  .stat-head {
    align-items: center;
  }

  .stat-controls {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  .stat-button {
    width: 44px;
    height: 44px;
  }

  .summary-actions-top,
  .summary-bottom-action {
    width: 100%;
  }

  .summary-actions-top .button,
  .summary-bottom-action .button,
  .draft-card .row-actions .button {
    width: 100%;
    min-width: 0;
  }

  .simulation-shell {
    gap: 12px;
  }

  .simulation-build {
    margin-top: 14px;
  }

  .simulation-talent-list {
    gap: 6px;
  }

  .simulation-starting-grid {
    gap: 5px;
  }

  .life-board-plain {
    border-radius: 16px;
  }

  .life-board-plain .life-log {
    max-height: min(58dvh, 620px);
  }

  .life-board-footer-plain {
    padding: 13px 14px 14px;
  }

  .life-board-footer-plain .life-board-note {
    max-width: none;
    font-size: 0.92rem;
    line-height: 1.62;
  }

  .chart-wrap {
    padding: 14px;
  }

  .sparkline {
    height: 156px;
  }
}

@media (max-width: 640px) {
  #app {
    width: min(100vw - 18px, 1180px);
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .shell {
    gap: 12px;
  }

  .shell-home {
    min-height: calc(
      100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px
    );
  }

  .hero-home {
    width: 100%;
  }

  .hero-title-home {
    font-size: clamp(1.82rem, 8.8vw, 2.7rem);
    max-width: 7.1em;
    line-height: 1.08;
    letter-spacing: -0.04em;
  }

  .hero-text-home {
    max-width: 20rem;
    margin-top: 14px;
    font-size: 1rem;
    line-height: 1.58;
  }

  .hero-actions-home {
    width: 100%;
    margin-top: clamp(48px, 10vh, 88px);
  }

  .button-home {
    width: 100%;
    min-width: 0;
    min-height: 60px;
    padding: 16px 18px;
    font-size: clamp(1.18rem, 5vw, 1.5rem);
  }

  .page-toolbar .protocol-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    gap: 8px;
    width: 100%;
  }

  .page-toolbar .utility-button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 11px 12px;
    justify-content: center;
    gap: 6px;
    font-size: 0.74rem;
  }

  .language-toggle {
    min-width: 0;
  }

  .section-header {
    margin-bottom: 14px;
  }

  .section-title {
    font-size: 1.16rem;
    line-height: 1.34;
  }

  .section-caption,
  .hint,
  .muted,
  .turn-text,
  .event-text,
  .life-board-note {
    font-size: 0.9rem;
    line-height: 1.62;
  }

  .row-actions,
  .hero-actions,
  .summary-actions {
    gap: 10px;
  }

  .row-actions > .button,
  .hero-actions > .button,
  .summary-actions > .button {
    width: 100%;
    min-width: 0;
  }

  .signal-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .signal-node {
    padding: 12px 13px;
  }

  .signal-node span,
  .tile-label,
  .summary-label,
  .kpi-label,
  .chart-caption,
  .history-pill,
  .turn-choice-code,
  .stat-code,
  .talent-code,
  .section-id,
  .panel-code {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
  }

  .summary-item,
  .kpi {
    padding: 12px 13px;
  }

  .summary-grid,
  .summary-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .summary-value,
  .kpi-value,
  .stat-value {
    font-size: 1.08rem;
  }

  .talent-grid,
  .stats-panel,
  .sim-layout,
  .deck-layout {
    gap: 14px;
  }

  .talent-card,
  .stat-card,
  .draft-card,
  .summary-card {
    padding: 15px 14px;
  }

  .talent-tags {
    gap: 6px;
  }

  .chip,
  .delta {
    padding: 6px 9px;
    font-size: 0.74rem;
  }

  .chart-wrap {
    padding: 12px;
  }

  .sparkline {
    height: 136px;
  }

  .chart-caption {
    margin-top: 10px;
    font-size: 0.74rem;
  }

  .ending-title {
    font-size: clamp(1.7rem, 8vw, 2.35rem);
    line-height: 1.1;
  }

  .simulation-build {
    width: 100%;
    gap: 10px;
  }

  .simulation-build-row {
    gap: 7px;
  }

  .simulation-talent-pill {
    padding: 0 9px;
    font-size: 0.84rem;
  }

  .simulation-starting-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
  }

  .simulation-starting-card {
    border-radius: 7px;
  }

  .simulation-starting-key {
    min-height: 28px;
    padding: 0 4px;
    font-size: 0.82rem;
  }

  .simulation-starting-value {
    min-height: 34px;
    font-size: 0.94rem;
  }

  .life-board-plain .life-log {
    max-height: min(54dvh, 520px);
  }

  .life-board-plain .life-row {
    grid-template-columns: 64px minmax(0, 1fr);
    min-height: 44px;
  }

  .life-board-plain .life-age {
    padding: 10px 6px 10px 10px;
    font-size: 0.9rem;
  }

  .life-board-plain .life-text {
    padding: 10px 10px 10px 0;
    font-size: 0.91rem;
    line-height: 1.56;
  }

  .life-empty {
    padding: 18px 14px;
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .life-board-footer-plain {
    padding: 12px 12px 14px;
  }

  .life-board-footer-plain .row-actions {
    width: 100%;
  }

  .button-restart-large {
    min-height: 52px;
    padding: 14px 18px;
    font-size: 0.94rem;
  }

  .summary-bottom-action {
    margin-top: 16px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  #app {
    width: min(100vw - 14px, 1180px);
  }

  .hero-title-home {
    font-size: clamp(1.68rem, 8.4vw, 2.2rem);
  }

  .hero-text-home {
    font-size: 0.95rem;
  }

  .signal-strip,
  .summary-grid,
  .summary-kpis {
    grid-template-columns: 1fr;
  }

  .button-home {
    min-height: 56px;
    font-size: 1.08rem;
  }

  .simulation-starting-key {
    font-size: 0.78rem;
  }

  .simulation-starting-value {
    font-size: 0.9rem;
  }
}

.attribute-stage {
  max-width: 760px;
  margin-inline: auto;
  padding: 34px 32px 30px;
  border-radius: 24px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(29, 34, 43, 0.94);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.32);
}

.attribute-stage::before {
  display: none;
}

.attribute-stage-head {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.attribute-stage-step {
  color: rgba(255, 255, 255, 0.42);
}

.attribute-stage-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.65rem);
  line-height: 1.06;
  letter-spacing: -0.04em;
  color: #f4f7fb;
}

.attribute-stage-points {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  color: #f4f7fb;
}

.attribute-stage-points strong {
  font-size: 1.08em;
}

.attribute-stage-body {
  display: grid;
  gap: 26px;
  margin-top: 28px;
}

.attribute-list {
  display: grid;
  gap: 24px;
}

.attribute-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
}

.attribute-name {
  font-size: clamp(1.18rem, 2.2vw, 1.44rem);
  font-weight: 700;
  color: #f1f4fa;
  letter-spacing: 0.01em;
}

.attribute-stepper {
  display: grid;
  grid-template-columns: 56px 154px 56px;
  min-height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.attribute-stepper-button,
.attribute-stepper-value {
  display: flex;
  align-items: center;
  justify-content: center;
}

.attribute-stepper-button {
  appearance: none;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.38);
  background: transparent;
  color: #f7f9fd;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

.attribute-stepper-button:last-child {
  border-right: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.38);
}

.attribute-stepper-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.attribute-stepper-button:disabled {
  cursor: not-allowed;
  opacity: 0.28;
}

.attribute-stepper-value {
  font-size: clamp(1.5rem, 2.6vw, 1.95rem);
  font-weight: 700;
  color: #f4f7fb;
  letter-spacing: -0.04em;
}

.attribute-talents {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.attribute-talents-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.attribute-talents-label {
  font-size: 1.06rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
}

.attribute-back-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.92rem;
  cursor: pointer;
}

.attribute-back-link:hover {
  color: rgba(255, 255, 255, 0.82);
}

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

.attribute-talent-item {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.attribute-talent-item[data-rarity="rare"] {
  border-color: rgba(121, 209, 255, 0.42);
  background: rgba(121, 209, 255, 0.08);
}

.attribute-talent-item[data-rarity="epic"] {
  border-color: rgba(240, 160, 255, 0.5);
  background: rgba(240, 160, 255, 0.12);
}

.attribute-talent-item[data-rarity="legendary"] {
  border-color: rgba(255, 176, 131, 0.56);
  background: rgba(255, 176, 131, 0.12);
}

.attribute-talent-name {
  font-size: 1rem;
  font-weight: 700;
  color: #f6f8fc;
}

.attribute-talent-note {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.94rem;
  line-height: 1.45;
}

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

.attribute-action {
  min-height: 54px;
  border-radius: 6px;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.attribute-action-random {
  color: #f2f5fb;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.attribute-action-start {
  color: #2f1708;
  border: 1px solid rgba(255, 184, 148, 0.5);
  background: linear-gradient(180deg, #ffb18c 0%, #ff976a 100%);
  box-shadow: 0 14px 32px rgba(255, 151, 106, 0.2);
}

@media (max-width: 720px) {
  .attribute-stage {
    padding: 28px 18px 22px;
  }

  .attribute-stage-body {
    gap: 22px;
  }

  .attribute-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .attribute-stepper {
    width: 100%;
    grid-template-columns: 54px minmax(0, 1fr) 54px;
  }

  .attribute-actions {
    grid-template-columns: 1fr;
  }
}
