:root {
  --bg: #f2eedf;
  --bg-alt: #e6ddc4;
  --panel: #fff9ec;
  --panel-alt: #f5edd8;
  --panel-soft: #fbf6ea;
  --ink: #2f2a24;
  --muted: #6f675a;
  --line: #5e503c;
  --line-soft: #bfae88;
  --accent: #4e8f6f;
  --accent-2: #e0a94a;
  --accent-3: #6ea7b8;
  --accent-4: #97a270;
  --grass-tint: #edf3df;
  --lake-tint: #e8f0f2;
  --forest-tint: #eef0e1;
  --danger: #b76452;
  --shadow: rgba(65, 52, 31, 0.18);
  --pixel: 2px;
  --radius: 0;
  --font-main: "Courier New", "Cascadia Mono", "Monaco", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-main);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.25), rgba(255,255,255,0)) 0 0 / 100% 200px no-repeat,
    linear-gradient(0deg, rgba(78,143,111,0.06), rgba(78,143,111,0.06)),
    var(--bg);
  letter-spacing: 0.01em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(47,42,36,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47,42,36,0.08) 1px, transparent 1px);
  background-size: 12px 12px;
}

.app-shell {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 12px;
}

.notice-bar {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: var(--pixel) solid var(--line);
  background: linear-gradient(180deg, #f7efcf 0%, #eddcb0 100%);
  box-shadow: 4px 4px 0 rgba(65, 52, 31, 0.14);
  font-size: 13px;
  line-height: 1.6;
}

.notice-bar[data-tone="rare"] {
  background: linear-gradient(180deg, #f7e8b5 0%, #ddb25d 100%);
  border-color: #8e6425;
  box-shadow: 4px 4px 0 rgba(142, 100, 37, 0.2);
}

.panel {
  position: relative;
  background: var(--panel);
  border: var(--pixel) solid var(--line);
  box-shadow:
    0 0 0 var(--pixel) var(--panel-alt),
    4px 4px 0 0 rgba(65, 52, 31, 0.11);
  padding: 14px;
}

.panel::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(94, 80, 60, 0.12);
  pointer-events: none;
}

.subtle-panel {
  background: #f8f2e4;
}

.primary-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.42), rgba(255,255,255,0)),
    var(--panel);
}

.secondary-panel {
  background: var(--panel-soft);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-direction: column;
  margin-bottom: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.5), rgba(255,255,255,0)),
    var(--panel);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border: var(--pixel) solid var(--line);
  background:
    linear-gradient(180deg, #9ed6a7 0 50%, #7db0d9 50% 100%);
  box-shadow: inset -4px -4px 0 rgba(47,42,36,0.18);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 6px;
  width: 10px;
  height: 10px;
  background: rgba(255,255,255,0.45);
}

.brand h1,
.panel-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.brand h1 {
  font-size: 24px;
}

.eyebrow {
  margin: 0 0 4px 0;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.topbar-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: stretch;
  width: 100%;
}

.status-chip,
.park-rank,
.mini-pill {
  padding: 8px 10px;
  background: var(--panel-alt);
  border: var(--pixel) solid var(--line-soft);
}

.status-chip {
  min-width: 88px;
  flex: 1 1 0;
  background: linear-gradient(180deg, #fff8e9 0%, #f1e3be 100%);
}

.park-rank {
  align-self: start;
  background: linear-gradient(180deg, #fff0cf 0%, #ead4a0 100%);
  border-color: #b99955;
  font-size: 13px;
}

.status-label,
.mini-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.decision-grid,
.overview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

.view-switcher {
  position: sticky;
  top: 10px;
  z-index: 6;
  margin-bottom: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(248,242,228,0.96));
}

.view-switcher-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-direction: column;
  margin-bottom: 10px;
}

.view-switcher-head h2 {
  margin: 0;
  font-size: 18px;
}

.view-tab-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  gap: 8px;
  overflow-x: auto;
}

.view-tab {
  box-shadow: none;
  position: relative;
  background: linear-gradient(180deg, #f8f1df 0%, #eadaba 100%);
  border-color: rgba(94, 80, 60, 0.55);
  color: rgba(47, 42, 36, 0.78);
}

.view-tab.is-active {
  background: linear-gradient(180deg, #eef7e7 0%, #dce9cb 100%);
  border-color: #90aa76;
  color: var(--ink);
  box-shadow: inset 0 3px 0 rgba(78, 143, 111, 0.38);
}

.view-tab.is-active::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 0;
  height: 3px;
  background: var(--accent);
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.hero-summary {
  margin: 0 0 14px 0;
  font-size: 14px;
  line-height: 1.65;
  max-width: 34ch;
  color: #4a443b;
}

.hero-copy {
  display: grid;
  align-content: start;
  gap: 8px;
}

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

.snapshot-card {
  padding: 8px 9px;
  background: rgba(255,255,255,0.66);
  border: 1px solid rgba(94, 80, 60, 0.14);
}

.snapshot-card strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.hero-brief {
  margin-top: 2px;
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(244,237,223,0.96));
}

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

.quick-stats,
.dex-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.resource-strip {
  overflow-x: auto;
}

.stat-card {
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(94, 80, 60, 0.2);
  border-left: 4px solid rgba(78, 143, 111, 0.65);
  padding: 9px 10px;
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.hero-panel .stat-card:nth-child(2n) {
  border-left-color: rgba(110, 167, 184, 0.7);
}

.hero-panel .stat-card:nth-child(3n) {
  border-left-color: rgba(224, 169, 74, 0.7);
}

.spotlight-card,
.sub-card {
  background: rgba(255,255,255,0.58);
  border: 1px solid rgba(94, 80, 60, 0.18);
  padding: 11px;
}

.spotlight-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.spotlight-primary {
  min-height: 128px;
  background: linear-gradient(180deg, rgba(255,247,225,0.96), rgba(240,226,184,0.92));
  border-color: rgba(184, 145, 63, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}

.spotlight-card.alt {
  background: linear-gradient(180deg, #eef3e1 0%, #e6ecd5 100%);
}

.longterm-card {
  background: linear-gradient(180deg, rgba(238,243,225,0.82), rgba(247,241,227,0.94));
  border-color: rgba(151, 162, 112, 0.2);
}

.longterm-card .sub-card-head strong {
  font-size: 16px;
}

.spotlight-card[data-tone="rare"] {
  background: linear-gradient(180deg, #fff2cf 0%, #efd895 100%);
  border-color: #b8913f;
  box-shadow: inset 0 0 0 1px rgba(184, 145, 63, 0.24);
}

.spotlight-card strong {
  display: block;
  margin: 2px 0 8px 0;
  font-size: 16px;
  line-height: 1.45;
}

.spotlight-card {
  min-height: 108px;
}

.spotlight-card p,
.summary-list,
.sub-card p {
  margin: 0;
}

.summary-list {
  padding-left: 18px;
  display: grid;
  gap: 6px;
  line-height: 1.5;
}

.compact-list {
  gap: 6px;
  font-size: 12px;
  line-height: 1.55;
}

.summary-cluster,
.decision-cluster {
  display: grid;
  gap: 8px;
  padding: 10px 0 0;
}

.summary-cluster-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.summary-task-cluster {
  margin-top: 16px;
  padding: 10px 12px 0;
  background: linear-gradient(180deg, rgba(238,243,225,0.55), rgba(255,255,255,0));
  border: 1px solid rgba(151, 162, 112, 0.12);
}

.decision-more {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.decision-more-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.decision-extra-wrap {
  display: grid;
  gap: 10px;
}

.event-cluster {
  padding-top: 0;
}

.goal-block {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.effect-block,
.task-block {
  padding-top: 8px;
  border-top: 1px dashed rgba(94, 80, 60, 0.14);
}

.main-frame,
.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.page-subtabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.subtab-btn {
  box-shadow: none;
}

.subtab-btn.is-active {
  background: linear-gradient(180deg, #eef7e7 0%, #dce9cb 100%);
  border-color: #90aa76;
}

.growth-subpanel {
  display: none;
}

.growth-subpanel.is-active {
  display: block;
}

.sidebar-stack {
  display: block;
  gap: 16px;
  align-self: start;
}

.feature-panel {
  display: none;
}

.feature-panel.is-active {
  display: block;
}

.home-page {
  display: none;
}

.home-page.is-active {
  display: block;
}

.home-page .decision-grid {
  margin-bottom: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(94, 80, 60, 0.14);
}

.secondary-panel .panel-head {
  border-bottom-color: rgba(94, 80, 60, 0.1);
}

.region-grid,
.dex-grid,
.goal-list,
.effect-list {
  display: grid;
  gap: 12px;
}

.habitat-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.habitat-chip {
  padding: 9px 10px;
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(94, 80, 60, 0.14);
  border-left: 4px solid rgba(78, 143, 111, 0.4);
}

.habitat-chip:nth-child(2) {
  border-left-color: rgba(110, 167, 184, 0.48);
}

.habitat-chip:nth-child(3) {
  border-left-color: rgba(224, 169, 74, 0.52);
}

.habitat-chip strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.dex-badge-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin: 14px 0 16px;
}

.dex-badge-card {
  display: grid;
  gap: 8px;
  padding: 14px 14px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(242,234,218,0.94));
  border: 1px solid rgba(94, 80, 60, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
  position: relative;
  overflow: hidden;
}

.dex-badge-card::before {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 54px;
  height: 54px;
  transform: rotate(45deg);
  background: rgba(255,255,255,0.25);
}

.dex-badge-card::after {
  content: "";
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 46px;
  height: 6px;
  background:
    linear-gradient(
      90deg,
      rgba(94, 80, 60, 0.2) 0 8px,
      transparent 8px 12px,
      rgba(94, 80, 60, 0.2) 12px 20px,
      transparent 20px 24px,
      rgba(94, 80, 60, 0.2) 24px 32px,
      transparent 32px 36px,
      rgba(94, 80, 60, 0.2) 36px 44px
    );
  opacity: 0.4;
}

.dex-badge-card.complete {
  background: linear-gradient(180deg, #f7f3d9 0%, #e8deb1 100%);
  border-color: rgba(151, 162, 112, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45), 0 0 0 1px rgba(180, 144, 61, 0.08);
}

.dex-badge-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

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

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

.region-card,
.dex-card,
.goal-card {
  background: rgba(255,255,255,0.58);
  border: 1px solid rgba(94, 80, 60, 0.18);
  padding: 10px;
}

.region-card {
  position: relative;
  padding-top: 14px;
  overflow: hidden;
}

.region-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 6px;
  background: rgba(94, 80, 60, 0.15);
}

.region-card::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 14px;
  width: 18px;
  height: 18px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.34) 50%, transparent 50%),
    linear-gradient(rgba(255,255,255,0.34) 50%, transparent 50%);
  background-size: 6px 6px;
  opacity: 0.55;
  pointer-events: none;
}

.region-card-grassland {
  background: linear-gradient(180deg, rgba(237,243,223,0.95), rgba(255,255,255,0.58));
}

.region-card-grassland::before {
  background: #8db07f;
}

.region-card-lakeside {
  background: linear-gradient(180deg, rgba(232,240,242,0.95), rgba(255,255,255,0.58));
}

.region-card-lakeside::before {
  background: #7fa7b7;
}

.region-card-forest {
  background: linear-gradient(180deg, rgba(238,240,225,0.95), rgba(255,255,255,0.58));
}

.region-card-forest::before {
  background: #97a270;
}

.goal-card {
  display: grid;
  gap: 8px;
}

.dex-card {
  position: relative;
  overflow: hidden;
  gap: 8px;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.dex-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0)),
    linear-gradient(90deg, rgba(255,255,255,0.14) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.14) 1px, transparent 1px);
  background-size: auto, 12px 12px, 12px 12px;
  pointer-events: none;
  opacity: 0.28;
}

.dex-card::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 10px;
  width: 24px;
  height: 24px;
  border-top: 1px solid rgba(94, 80, 60, 0.12);
  border-right: 1px solid rgba(94, 80, 60, 0.12);
  opacity: 0.6;
  pointer-events: none;
}

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

.dex-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(65, 52, 31, 0.06);
}

.dex-card-seen {
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(243,235,220,0.92));
}

.dex-card-housed {
  background: linear-gradient(180deg, rgba(238,243,225,0.9), rgba(247,241,227,0.95));
}

.dex-card-complete {
  background: linear-gradient(180deg, rgba(255,242,207,0.95), rgba(239,216,149,0.82));
  border-color: rgba(184, 145, 63, 0.45);
}

.dex-card-complete .tag {
  background: rgba(255,252,240,0.9);
}

.dex-card.unknown {
  border-style: dashed;
}

.dex-card.unknown .dex-card-head strong,
.dex-card.unknown .dex-desc,
.dex-card.unknown .dex-tags .tag {
  color: rgba(94, 80, 60, 0.7);
}

.dex-card.unknown .dex-card-head strong {
  letter-spacing: 2px;
}

.effect-card {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  background: rgba(255,255,255,0.58);
  border: 1px solid rgba(94, 80, 60, 0.18);
  border-left: 4px solid rgba(110, 167, 184, 0.55);
}

.effect-card strong {
  font-size: 13px;
}

.effect-card .muted-text {
  font-size: 12px;
}

.goal-card.complete {
  background: #eef3e1;
  border-color: rgba(141, 176, 127, 0.5);
}

.task-block .goal-card:not(.complete) {
  background: linear-gradient(180deg, rgba(255,248,233,0.92), rgba(243,234,212,0.88));
}

.goal-head,
.goal-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.recommendation-card {
  margin-bottom: 10px;
  background: linear-gradient(180deg, rgba(245,241,228,0.96), rgba(236,232,217,0.92));
  border-color: rgba(94, 80, 60, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.26);
}

.recommendation-title {
  display: block;
  margin: 0 0 4px;
  font-size: 14px;
}

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

.clue-item {
  display: grid;
  gap: 4px;
  padding: 6px 0;
  border-top: 1px dashed rgba(94, 80, 60, 0.12);
}

.clue-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.goal-title {
  font-size: 14px;
  max-width: 18ch;
}

.goal-reward {
  font-size: 12px;
  color: var(--muted);
}

.region-card.locked,
.dex-card.unknown {
  opacity: 0.7;
  background: #ece4d3;
}

.region-card.locked::before {
  background: rgba(94, 80, 60, 0.2);
}

.region-card-header,
.sub-card-head,
.resident-row,
.egg-row,
.research-row,
.event-option,
.log-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.region-card-header strong,
.sub-card-head strong {
  font-size: 15px;
}

.region-card-subline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 5px;
}

.region-state-tag {
  background: rgba(255,255,255,0.86);
}

.region-intro,
.region-status-box,
.region-lore,
.region-residents-block,
.region-actions-block {
  display: grid;
  gap: 8px;
  padding: 10px 0;
}

.region-intro {
  padding-top: 6px;
}

.region-status-box,
.region-residents-block,
.region-actions-block {
  border-top: 1px dashed rgba(94, 80, 60, 0.16);
}

.region-card-actions-inline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px dashed rgba(94, 80, 60, 0.14);
}

.region-detail-wrap {
  display: grid;
  gap: 0;
}

.region-card.collapsed .region-intro {
  padding-bottom: 8px;
}

.region-card.collapsed .region-status-box {
  padding-bottom: 8px;
}

.toggle-btn {
  min-width: 94px;
}

.region-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.region-block-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--ink);
}

.sub-card-head {
  align-items: center;
}

.region-desc,
.region-note,
.muted-text,
.dex-desc,
.log-meta,
.event-preview {
  color: var(--muted);
  line-height: 1.5;
  font-size: 12px;
}

.region-meta,
.resident-list,
.stack-list,
.research-box,
.event-box,
.log-list {
  display: grid;
  gap: 8px;
}

.region-meta {
  gap: 6px;
}

.meta-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.resident-row,
.egg-row,
.research-row,
.log-row {
  padding: 8px 9px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(94, 80, 60, 0.12);
}

.region-residents-block .resident-list {
  gap: 6px;
}

.region-card.collapsed .region-card-header,
.region-card.collapsed .region-intro,
.region-card.collapsed .region-status-box,
.region-card.collapsed .region-card-actions-inline {
  position: relative;
  z-index: 1;
}

.region-card.expanded .region-card-actions-inline {
  padding-bottom: 4px;
}

.resident-row.clickable {
  width: 100%;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  border: var(--pixel) solid rgba(94, 80, 60, 0.24);
}

.resident-row.clickable:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 rgba(65, 52, 31, 0.08);
  border-color: var(--line);
  background: rgba(255,255,255,0.88);
}

.resident-row.clickable:focus-visible,
.pixel-btn:focus-visible,
.event-button:focus-visible {
  outline: 2px solid rgba(78, 143, 111, 0.55);
  outline-offset: 2px;
}

.resident-tags,
.dex-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.tag {
  display: inline-block;
  padding: 3px 6px;
  border: 1px solid var(--line-soft);
  background: #fffdf6;
  font-size: 11px;
  white-space: nowrap;
}

.region-card .tag {
  background: rgba(255,255,255,0.78);
}

.action-row {
  margin-top: 10px;
}

.action-stack {
  display: grid;
  gap: 6px;
}

.action-hint {
  font-size: 12px;
  color: var(--muted);
}

.action-hint.warn {
  color: var(--danger);
}

.pixel-btn,
.event-button {
  width: 100%;
  font: inherit;
  color: var(--ink);
  border: var(--pixel) solid var(--line);
  background: linear-gradient(180deg, #fff8e9 0%, #eddcb3 100%);
  box-shadow: 2px 2px 0 rgba(65, 52, 31, 0.12);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.pixel-btn {
  padding: 9px 11px;
}

.pixel-btn.soft-disabled {
  opacity: 0.82;
  background: linear-gradient(180deg, #f3ead4 0%, #e2d2ae 100%);
  border-style: dashed;
  cursor: help;
}

.compact-btn {
  width: auto;
  min-width: 76px;
  justify-self: end;
}

.pixel-btn:disabled {
  cursor: default;
  opacity: 0.72;
}

.pixel-btn:not(:disabled):hover,
.event-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 rgba(65, 52, 31, 0.16);
  background: linear-gradient(180deg, #fffaf0 0%, #edd39c 100%);
}

.pixel-btn.soft-disabled:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(183, 100, 82, 0.16);
}

.pixel-btn:not(:disabled):active,
.event-button:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(65, 52, 31, 0.18);
}

.pixel-bar {
  width: 100%;
  height: 14px;
  border: var(--pixel) solid var(--line);
  background: #efe5cd;
  padding: 1px;
}

.pixel-bar-fill {
  height: 100%;
  background:
    repeating-linear-gradient(
      90deg,
      var(--accent) 0 10px,
      #76b493 10px 20px
    );
}

.goal-card .pixel-bar-fill {
  background:
    repeating-linear-gradient(
      90deg,
      var(--accent-2) 0 10px,
      #e8bc67 10px 20px
    );
}

.dex-badge-card .pixel-bar-fill {
  background:
    repeating-linear-gradient(
      90deg,
      var(--accent-4) 0 10px,
      #b0bb86 10px 20px
    );
}

.event-box {
  gap: 12px;
}

.production-layout {
  display: grid;
  gap: 12px;
}

.production-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(243,236,223,0.95));
}

.production-summary-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.compact-stat {
  padding: 9px 10px;
}

.compact-stat strong {
  font-size: 18px;
}

.production-detail-list,
.research-overview,
.research-perk-list {
  display: grid;
  gap: 8px;
}

.research-perk-list {
  gap: 4px;
}

.production-row {
  align-items: center;
}

.event-card {
  display: grid;
  gap: 9px;
  padding: 2px 0;
}

.event-box .sub-card,
.stack-block .sub-card {
  background: rgba(255,255,255,0.48);
}

.event-title {
  margin: 0;
  font-size: 17px;
}

.event-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.event-options {
  display: grid;
  gap: 8px;
}

.event-option {
  padding: 10px;
  border: 1px solid rgba(94, 80, 60, 0.15);
  background: rgba(255,255,255,0.72);
}

.event-button {
  text-align: left;
  padding: 10px;
}

.event-button::after {
  content: "点击选择";
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

.inline-hint {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.research-choice-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.research-choice {
  text-align: left;
  padding: 10px 11px;
  box-shadow: none;
}

.research-choice.active {
  background: linear-gradient(180deg, #eef7e7 0%, #dce9cb 100%);
  border-color: #90aa76;
  box-shadow: inset 0 0 0 1px rgba(144, 170, 118, 0.18);
}

.research-choice strong {
  display: block;
  margin-bottom: 2px;
}

.side-panel .sub-card-head {
  padding-bottom: 2px;
}

.option-label {
  font-weight: 700;
  font-size: 13px;
}

.log-list {
  max-height: 280px;
  overflow: auto;
  gap: 6px;
}

.log-highlight-list {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.log-highlight-row {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(255,249,232,0.92), rgba(243,232,203,0.88));
  border: 1px solid rgba(184, 145, 63, 0.18);
}

.log-card-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin: 6px 0 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(94, 80, 60, 0.14);
}

.log-row {
  flex-direction: column;
  background: rgba(255,255,255,0.58);
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(47, 42, 36, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 30;
}

.modal-mask[hidden] {
  display: none !important;
}

.modal-card {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
}

.discovery-card {
  width: min(620px, 100%);
}

.discovery-body {
  display: grid;
  gap: 12px;
}

.discovery-hero {
  padding: 14px;
  background: linear-gradient(180deg, #fff2cf 0%, #efd895 100%);
  border: var(--pixel) solid #b8913f;
}

.discovery-hero strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.discovery-card .panel-head,
.modal-card .panel-head {
  margin-bottom: 14px;
}

.discovery-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.resident-detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 10px;
}

.offline-item {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(94, 80, 60, 0.16);
  padding: 12px;
}

.detail-card {
  background: rgba(255,255,255,0.68);
  border: 1px solid rgba(94, 80, 60, 0.16);
  padding: 12px;
}

.detail-card strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.detail-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.detail-actions .pixel-btn {
  width: 100%;
}

.offline-item strong {
  display: block;
  margin-top: 6px;
  font-size: 17px;
}

.offline-list {
  margin: 6px 0 0 16px;
  padding: 0;
  line-height: 1.6;
  color: var(--ink);
  font-size: 13px;
}

.log-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  align-items: center;
}

.log-kind {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--line-soft);
  background: #fffdf6;
}

.log-kind[data-kind="growth"] {
  background: #eef3e1;
}

.log-kind[data-kind="visitor"] {
  background: #eaf1f4;
}

.log-kind[data-kind="dex"] {
  background: #fff2cf;
}

.log-kind[data-kind="event"] {
  background: #f3ead4;
}

.log-kind[data-kind="offline"] {
  background: #ece4d3;
}

.log-row:first-child {
  border-color: rgba(94, 80, 60, 0.24);
  background: rgba(255,255,255,0.76);
}

.log-body {
  font-size: 13px;
  line-height: 1.6;
}

.rarity-common {
  color: var(--ink);
}

.rarity-uncommon {
  color: var(--accent);
}

.rarity-rare {
  color: var(--accent-3);
}

.rarity-epic {
  color: var(--danger);
}

.empty {
  padding: 12px;
  border: 1px dashed var(--line-soft);
  color: var(--muted);
  font-size: 13px;
}

.hero-panel {
  min-height: 0;
  overflow: hidden;
}

.decision-panel,
.production-panel,
.collection-panel,
.log-panel,
.habitat-panel {
  align-self: start;
  position: relative;
  overflow: hidden;
}

.collection-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.2), transparent 18%),
    linear-gradient(90deg, rgba(94, 80, 60, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(94, 80, 60, 0.03) 1px, transparent 1px);
  background-size: auto, 18px 18px, 18px 18px;
  pointer-events: none;
  opacity: 0.55;
}

.hero-panel::before {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224,169,74,0.14) 0%, rgba(224,169,74,0) 70%);
  pointer-events: none;
}

.hero-panel::after {
  border-color: rgba(94, 80, 60, 0.1);
}

.decision-panel::before,
.log-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), transparent 20%),
    linear-gradient(90deg, rgba(94, 80, 60, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(94, 80, 60, 0.02) 1px, transparent 1px);
  background-size: auto, 16px 16px, 16px 16px;
  opacity: 0.45;
  pointer-events: none;
}

.decision-panel .panel-head,
.log-panel .panel-head {
  margin-bottom: 8px;
}

.collection-panel .dex-card strong {
  font-size: 14px;
  margin-bottom: 2px;
}

.collection-panel .dex-desc {
  min-height: 3.2em;
}

.collection-panel .dex-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(243,235,220,0.95));
  display: flex;
  flex-direction: column;
  min-height: 210px;
  box-shadow: inset 0 0 0 1px rgba(94, 80, 60, 0.05);
  padding: 14px 12px 12px;
}

.collection-panel .dex-card.unknown {
  background:
    radial-gradient(circle at top center, rgba(255,255,255,0.28), transparent 42%),
    linear-gradient(180deg, #eee7d7 0%, #e4dac5 100%);
  justify-content: center;
}

.collection-panel .dex-grid {
  gap: 10px;
}

.collection-panel .dex-badge-strip {
  margin-top: 14px;
  margin-bottom: 18px;
}

.collection-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin: 2px 0 14px;
  padding-top: 8px;
  border-top: 1px dashed rgba(94, 80, 60, 0.14);
}

.collection-panel .dex-badge-card {
  min-height: 132px;
}

.collection-panel .dex-badge-card.complete::before {
  background: rgba(255, 249, 231, 0.42);
}

.collection-panel .dex-badge-head strong {
  font-size: 14px;
}

.collection-panel .dex-tags {
  margin-top: auto;
}

.collection-panel .dex-card.unknown .dex-tags {
  margin-top: 10px;
}

.collection-panel .dex-card-head .tag {
  flex-shrink: 0;
}

.collection-panel .dex-card.unknown::after {
  inset: auto 12px 12px auto;
  width: 46px;
  height: 46px;
  border: 0;
  background:
    linear-gradient(90deg, rgba(94, 80, 60, 0.16) 0 8px, transparent 8px 14px),
    linear-gradient(rgba(94, 80, 60, 0.16) 0 8px, transparent 8px 14px);
  background-size: 14px 14px, 14px 14px;
  opacity: 0.35;
}

.collection-panel .dex-card-complete::after {
  width: auto;
  height: auto;
  top: 10px;
  right: 10px;
  padding: 2px 6px;
  border: 1px solid rgba(184, 145, 63, 0.2);
  background: rgba(255,250,229,0.9);
  color: rgba(130, 92, 24, 0.86);
  font-size: 10px;
  letter-spacing: 1px;
  content: "完整记录";
}

.decision-panel .goal-block:first-of-type .sub-card-head,
.decision-panel .goal-block:last-of-type .sub-card-head {
  padding: 2px 0 6px 0;
}

.decision-panel .summary-list li::marker,
.hero-brief .summary-list li::marker {
  color: rgba(78, 143, 111, 0.8);
}

.decision-panel .event-box {
  min-height: 146px;
}

.log-panel .log-card {
  min-height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(244,237,223,0.96));
}

.progress-panel .panel-head,
.log-panel .panel-head,
.production-panel .panel-head {
  margin-bottom: 10px;
}

@media (min-width: 901px) {
  .app-shell {
    max-width: 1320px;
    padding: 18px;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
  }

  .topbar-right {
    width: auto;
    justify-content: flex-end;
  }

  .status-chip {
    flex: initial;
  }

  .decision-grid,
  .overview-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  }

  .view-switcher {
    position: static;
  }

  .view-switcher-head {
    align-items: center;
    flex-direction: row;
  }

  .view-tab-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.96fr);
  }

  .main-frame,
  .main-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.92fr);
  }

  .sidebar-stack {
    display: grid;
  }

  .feature-panel {
    display: block;
  }

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

  .region-grid {
    grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  }

  .dex-grid {
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  }
}

@media (max-width: 1100px) {
  .decision-grid,
  .overview-grid,
  .main-frame,
  .main-grid,
  .hero-layout {
    grid-template-columns: 1fr;
  }

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

  .collection-panel .dex-card {
    min-height: 0;
  }

  .region-card-actions-inline {
    align-items: flex-start;
    flex-direction: column;
  }

  .collection-actions,
  .log-card-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 10px 10px 96px;
  }

  .brand h1,
  .panel-head h2 {
    font-size: 18px;
  }

  .eyebrow {
    font-size: 10px;
    margin-bottom: 3px;
  }

  .decision-grid,
  .main-frame {
    gap: 12px;
  }

  .decision-panel {
    order: -1;
  }

  .decision-more-head,
  .collection-actions,
  .log-card-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-right {
    width: 100%;
    justify-content: stretch;
  }

  .status-chip {
    flex: 1 1 0;
  }

  .view-switcher {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    top: auto;
    z-index: 20;
    margin-bottom: 0;
    box-shadow:
      0 0 0 var(--pixel) var(--panel-alt),
      0 -2px 12px rgba(65, 52, 31, 0.12);
  }

  .view-switcher-head {
    display: none;
  }

  .view-tab-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: hidden;
    gap: 4px;
  }

  .view-tab {
    min-width: 0;
    padding: 8px 4px;
    font-size: 11px;
    line-height: 1.2;
    white-space: normal;
    word-break: keep-all;
  }

  .view-tab.is-active::before {
    left: 6px;
    right: 6px;
  }

  .main-frame {
    grid-template-columns: 1fr;
  }

  .sidebar-stack {
    display: block;
  }

  .feature-panel {
    display: none;
  }

  .feature-panel.is-active {
    display: block;
  }

  .hero-summary {
    margin-bottom: 6px;
    font-size: 12px;
    line-height: 1.5;
  }

  .home-snapshot {
    grid-template-columns: repeat(3, minmax(92px, 1fr));
    overflow-x: auto;
  }

  .snapshot-card {
    min-width: 92px;
  }

  .spotlight-card strong,
  .recommendation-title {
    font-size: 14px;
  }

  .hero-brief {
    display: none;
  }

  .resource-strip {
    grid-template-columns: repeat(4, minmax(88px, 1fr));
    overflow-x: auto;
  }

  .resource-strip .stat-card {
    min-width: 88px;
    padding: 9px 10px;
  }

  .resource-strip .stat-card strong {
    font-size: 16px;
  }

  .spotlight-card.alt p,
  .longterm-card .muted-text,
  .collection-actions .muted-text,
  .log-card-actions .muted-text {
    display: none;
  }

  .decision-more-head .muted-text,
  .region-card-actions-inline .muted-text,
  .region-block-head .muted-text,
  .action-hint {
    font-size: 11px;
  }

  .summary-list li:nth-child(n+3),
  .effect-list .effect-card:nth-child(n+2),
  .goal-list .goal-card:nth-child(n+2),
  .log-highlight-list .log-highlight-row:nth-child(n+3) {
    display: none;
  }

  .recommendation-card .clue-item:nth-child(n+3) {
    display: none;
  }

  .decision-panel .event-box {
    min-height: 0;
  }

  .log-list {
    max-height: 180px;
  }

  .decision-panel .panel-head,
  .production-panel .panel-head,
  .collection-panel .panel-head,
  .log-panel .panel-head,
  .habitat-panel .panel-head {
    margin-bottom: 8px;
    padding-bottom: 6px;
  }

  .region-intro {
    padding-top: 2px;
  }

  .region-intro .region-desc,
  .region-lore .region-note:last-child {
    display: none;
  }

  .habitat-overview {
    grid-template-columns: repeat(3, minmax(88px, 1fr));
    overflow-x: auto;
    margin-bottom: 10px;
  }

  .habitat-chip {
    min-width: 88px;
    padding: 8px 9px;
  }

  .habitat-chip strong {
    font-size: 14px;
  }

  .region-card-actions-inline {
    gap: 6px;
    padding-top: 8px;
  }

  .region-residents-block .resident-list .resident-row:nth-child(n+3) {
    display: none;
  }

  .collection-panel .dex-card:nth-child(n+7) {
    display: none;
  }

  .collection-actions,
  .log-card-actions {
    margin-top: 6px;
    padding-top: 6px;
  }

  .quick-stats,
  .dex-metrics,
  .offline-grid,
  .resident-detail-grid {
    grid-template-columns: 1fr;
  }
}
