:root {
  --ink: #0d0e1b;
  --bg: #1a1c2c;
  --bg-alt: #1e2136;
  --panel: #252a44;
  --panel-deep: #181b30;
  --panel-raise: #2e3457;
  --text: #f4f4f4;
  --muted: #94b0c2;
  --dim: #566c86;
  --yellow: #ffcd75;
  --green: #a7f070;
  --green-deep: #38b764;
  --cyan: #73eff7;
  --blue: #3b5dc9;
  --red: #ff6973;
  --pixel: "Press Start 2P", "Silkscreen", "Courier New", monospace;
  --body: "Silkscreen", "PingFang SC", "Microsoft YaHei", "SimHei", sans-serif;
  --bevel-up: inset 3px 3px 0 rgba(255, 255, 255, 0.14), inset -3px -3px 0 rgba(0, 0, 0, 0.38);
  --bevel-down: inset 3px 3px 0 rgba(0, 0, 0, 0.38), inset -3px -3px 0 rgba(255, 255, 255, 0.1);
  --drop: 6px 6px 0 rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  border-radius: 0 !important;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
}

body {
  color: var(--text);
  font-family: var(--body);
  image-rendering: pixelated;
  background-image: repeating-conic-gradient(var(--bg) 0% 25%, var(--bg-alt) 0% 50%);
  background-size: 48px 48px;
}

button {
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.8);
  opacity: 0.5;
}

::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

::-webkit-scrollbar-track {
  background: var(--panel-deep);
  border: 3px solid var(--ink);
}

::-webkit-scrollbar-thumb {
  background: var(--dim);
  border: 3px solid var(--ink);
  box-shadow: var(--bevel-up);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.pixel-sky,
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
}

.pixel-sky::before,
.pixel-sky::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  background: transparent;
}

.pixel-sky::before {
  box-shadow:
    8vw 12vh 0 var(--yellow),
    22vw 6vh 0 var(--dim),
    31vw 22vh 0 var(--cyan),
    44vw 9vh 0 var(--dim),
    58vw 16vh 0 var(--yellow),
    71vw 7vh 0 var(--dim),
    83vw 20vh 0 var(--cyan),
    93vw 11vh 0 var(--dim),
    12vw 84vh 0 var(--dim),
    27vw 91vh 0 var(--cyan),
    49vw 87vh 0 var(--dim),
    66vw 93vh 0 var(--yellow),
    81vw 86vh 0 var(--dim),
    94vw 90vh 0 var(--cyan);
  animation: starBlink 2.4s steps(2) infinite;
}

.pixel-sky::after {
  box-shadow:
    5vw 46vh 0 var(--dim),
    16vw 34vh 0 var(--cyan),
    38vw 52vh 0 var(--dim),
    52vw 40vh 0 var(--yellow),
    64vw 55vh 0 var(--dim),
    77vw 44vh 0 var(--cyan),
    89vw 58vh 0 var(--dim),
    97vw 37vh 0 var(--yellow);
  animation: starBlink 3.1s steps(2) 0.9s infinite;
}

.scanlines {
  background-image: linear-gradient(rgba(13, 14, 27, 0.35) 2px, transparent 2px);
  background-size: 100% 4px;
  opacity: 0.4;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  width: min(1780px, calc(100vw - 24px));
  height: 100dvh;
  margin: 0 auto;
  padding: 12px 0;
}

.panel,
.game-dialog {
  border: 3px solid var(--ink);
  background: var(--panel);
  box-shadow: var(--drop), inset 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(160px, 0.48fr) minmax(0, 1.52fr);
  gap: 12px;
  align-items: stretch;
  padding: 12px;
  min-height: 0;
}

.brand-block {
  min-width: 0;
  align-self: center;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-family: var(--pixel);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 var(--ink);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 0;
  font-family: var(--pixel);
  font-weight: 400;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(1.1rem, 2.1vw, 2.2rem);
  line-height: 1.15;
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--ink), 6px 6px 0 rgba(59, 93, 201, 0.55);
}

h1 span {
  display: block;
  margin-top: 6px;
  color: var(--cyan);
  font-size: clamp(0.5rem, 0.75vw, 0.72rem);
  text-shadow: 2px 2px 0 var(--ink);
}

h2 {
  font-size: clamp(0.8rem, 1.15vw, 1.15rem);
  line-height: 1.35;
  text-shadow: 2px 2px 0 var(--ink);
}

.stat-strip {
  display: grid;
  grid-template-columns: 1.6fr repeat(8, minmax(72px, 1fr));
  gap: 8px;
  min-width: 0;
}

.stat-card {
  min-width: 0;
  border: 3px solid var(--ink);
  padding: 8px 9px;
  background: var(--panel-deep);
  box-shadow: var(--bevel-down);
}

.stat-card span,
.mini-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-family: var(--pixel);
  font-size: 0.44rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-card strong,
.mini-grid strong {
  display: block;
  overflow: hidden;
  color: var(--green);
  font-family: var(--pixel);
  font-size: clamp(0.58rem, 0.8vw, 0.82rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-stat {
  background: var(--blue);
  box-shadow: var(--bevel-up);
}

.hero-stat span {
  color: var(--text);
}

.hero-stat strong {
  color: var(--yellow);
  text-shadow: 2px 2px 0 var(--ink);
}

.goal-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.36fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}

.goal-title h2 span:last-child {
  color: var(--cyan);
  font-size: 0.7rem;
}

.goal-requirement {
  display: -webkit-box;
  overflow: hidden;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.goal-track {
  position: relative;
  height: 22px;
  overflow: hidden;
  border: 3px solid var(--ink);
  background: var(--panel-deep);
  box-shadow: var(--bevel-down);
}

.goal-fill {
  position: relative;
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--green) 0 10px,
    var(--green-deep) 10px 14px
  );
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.3), inset 0 3px 0 rgba(255, 255, 255, 0.3);
  transition: width 220ms steps(8);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(300px, 0.72fr) minmax(300px, 0.74fr);
  gap: 12px;
  min-height: 0;
}

.core-panel,
.command-panel,
.status-panel {
  min-height: 0;
  padding: 16px;
}

.core-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(190px, 1fr) auto auto;
  overflow: hidden;
}

.panel-heading {
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
}

.compact-heading,
.dialog-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.data-core {
  position: relative;
  align-self: center;
  justify-self: center;
  display: grid;
  width: min(42vh, 300px, 80%);
  max-height: 100%;
  aspect-ratio: 1;
  border: 4px solid var(--ink);
  color: var(--text);
  cursor: pointer;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(115, 239, 247, 0.12) 3px, transparent 3px) 0 0 / 24px 24px,
    linear-gradient(rgba(115, 239, 247, 0.12) 3px, transparent 3px) 0 0 / 24px 24px,
    #29366f;
  box-shadow:
    var(--bevel-up),
    var(--drop),
    0 0 0 4px var(--blue);
  transition: transform 80ms steps(2), filter 80ms steps(2);
}

.data-core::before,
.data-core::after {
  content: "";
  position: absolute;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--muted) 0 8px, transparent 8px 20px);
}

.data-core::before {
  top: -16px;
  left: 12%;
  width: 76%;
  height: 9px;
}

.data-core::after {
  bottom: -16px;
  left: 12%;
  width: 76%;
  height: 9px;
}

.data-core:hover {
  filter: brightness(1.15);
}

.data-core:active {
  transform: translate(3px, 3px);
  box-shadow: var(--bevel-down), 0 0 0 4px var(--blue);
}

.core-ring {
  position: absolute;
  pointer-events: none;
}

.ring-one {
  inset: 9%;
  border: 3px dashed rgba(244, 244, 244, 0.45);
  animation: starBlink 1.6s steps(2) infinite;
}

.ring-two {
  inset: 20%;
  border: 3px solid var(--cyan);
  box-shadow: 0 0 0 3px rgba(115, 239, 247, 0.18);
  animation: framePulse 2.2s steps(3) infinite;
}

.core-chip {
  position: relative;
  z-index: 2;
  display: grid;
  width: 38%;
  aspect-ratio: 1;
  border: 4px solid var(--ink);
  color: var(--ink);
  font-family: var(--pixel);
  font-size: clamp(0.6rem, 1vw, 0.9rem);
  letter-spacing: 0.06em;
  background: var(--yellow);
  box-shadow: var(--bevel-up), 4px 4px 0 rgba(0, 0, 0, 0.45);
  place-items: center;
}

.cache-flash {
  position: absolute;
  z-index: 4;
  top: 14%;
  right: 4%;
  padding: 8px 10px;
  border: 3px solid var(--ink);
  color: var(--ink);
  font-family: var(--pixel);
  font-size: 0.5rem;
  background: var(--cyan);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
  opacity: 0;
}

.cache-flash.show {
  animation: badgePop 720ms steps(6) both;
}

.click-float {
  pointer-events: none;
  position: fixed;
  z-index: 20;
  color: var(--green);
  font-family: var(--pixel);
  font-size: 0.72rem;
  text-shadow: 2px 2px 0 var(--ink);
  animation: floatUp 900ms steps(9) forwards;
}

.core-copy {
  position: relative;
  z-index: 1;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: clamp(0.86rem, 0.95vw, 0.98rem);
  line-height: 1.5;
  text-align: center;
}

.mini-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.mini-grid > div,
.relic-card,
.coverage-card {
  border: 3px solid var(--ink);
  padding: 9px;
  background: var(--panel-deep);
  box-shadow: var(--bevel-down);
}

.ghost-button,
.primary-button,
.danger-button,
.chip-toggle,
.command-card,
.buy-button,
.tech-button {
  border: 3px solid var(--ink);
  color: var(--text);
  cursor: pointer;
  background: var(--panel-raise);
  box-shadow: var(--bevel-up), 4px 4px 0 rgba(0, 0, 0, 0.45);
  transition: filter 80ms steps(2);
}

.ghost-button,
.primary-button,
.danger-button,
.chip-toggle {
  padding: 10px 14px;
  font-family: var(--pixel);
  font-size: 0.56rem;
}

.ghost-button:hover,
.primary-button:hover,
.danger-button:hover,
.chip-toggle:hover,
.command-card:hover,
.buy-button:not(:disabled):hover,
.tech-button:not(:disabled):hover {
  filter: brightness(1.18);
}

.ghost-button:active,
.primary-button:active,
.danger-button:active,
.chip-toggle:active,
.command-card:active,
.buy-button:not(:disabled):active,
.tech-button:not(:disabled):active {
  transform: translate(3px, 3px);
  box-shadow: var(--bevel-down);
}

.primary-button {
  color: var(--ink);
  background: var(--green);
}

.danger-button {
  color: var(--text);
  background: #7a2a3a;
}

.danger-button:hover {
  background: var(--red);
  color: var(--ink);
}

.chip-toggle[aria-pressed="true"] {
  color: var(--ink);
  background: var(--cyan);
  box-shadow: var(--bevel-down);
}

.era-badge,
.hint {
  flex: none;
  border: 3px solid var(--ink);
  padding: 7px 9px;
  color: var(--ink);
  font-family: var(--pixel);
  font-size: 0.5rem;
  background: var(--yellow);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
}

.command-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

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

.command-card {
  display: grid;
  align-content: center;
  min-height: 104px;
  padding: 14px;
  text-align: left;
  background: var(--panel-deep);
}

.command-card:first-child {
  grid-column: span 2;
  background: var(--blue);
}

.command-card span,
.command-card em {
  color: var(--muted);
  font-family: var(--pixel);
  font-size: 0.46rem;
  font-style: normal;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.command-card:first-child span,
.command-card:first-child em {
  color: rgba(244, 244, 244, 0.75);
}

.command-card strong {
  margin: 7px 0;
  font-size: clamp(0.95rem, 1.1vw, 1.15rem);
}

.core-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.core-actions > button {
  flex: 1;
}

.status-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
}

.era-chapter,
.active-event-wrap,
.quick-note {
  border: 3px solid var(--ink);
  padding: 12px;
  background: var(--panel-deep);
  box-shadow: var(--bevel-down);
}

.era-chapter h3,
.quick-note p:last-child {
  margin: 0;
}

.era-chapter h3 {
  font-size: 0.98rem;
  color: var(--cyan);
}

.era-chapter p:not(.eyebrow),
.quick-note p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.active-event {
  margin-top: 2px;
  border: 3px solid var(--ink);
  padding: 11px;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.45;
  background: var(--yellow);
  box-shadow: var(--bevel-up);
}

.active-event.empty {
  color: var(--muted);
  background: var(--panel);
  box-shadow: var(--bevel-down);
}

.game-dialog {
  width: min(1080px, calc(100vw - 28px));
  max-width: none;
  max-height: min(760px, calc(100dvh - 28px));
  margin: auto;
  padding: 0;
  color: var(--text);
  background: var(--panel);
}

.wide-dialog {
  width: min(1360px, calc(100vw - 28px));
}

.game-dialog::backdrop {
  background: rgba(13, 14, 27, 0.82);
  background-image: repeating-conic-gradient(transparent 0% 25%, rgba(13, 14, 27, 0.5) 0% 50%);
  background-size: 8px 8px;
}

.dialog-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  max-height: min(760px, calc(100dvh - 28px));
  margin: 0;
  padding: 16px;
  overflow: hidden;
}

#shopDialog .dialog-shell,
#ladderDialog .dialog-shell {
  grid-template-rows: auto minmax(0, 1fr);
}

.dialog-header {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -16px -16px 0;
  padding: 12px 16px;
  border-bottom: 3px solid var(--ink);
  background: var(--blue);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.18);
}

.dialog-header .eyebrow {
  color: var(--cyan);
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.dialog-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.dialog-scroll {
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
  overscroll-behavior: contain;
}

.shop-list,
.tech-grid,
.ladder-list,
.event-catalog-list,
.relic-grid {
  display: grid;
  gap: 10px;
}

.shop-card,
.tech-card,
.ladder-card,
.event-catalog-item {
  border: 3px solid var(--ink);
  padding: 12px;
  background: var(--panel-deep);
  box-shadow: var(--bevel-down);
}

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

.shop-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.shop-card.affordable,
.tech-card.affordable {
  border-color: var(--green-deep);
  box-shadow: var(--bevel-down), 0 0 0 2px rgba(167, 240, 112, 0.35);
}

.shop-card.locked,
.tech-card.locked,
.ladder-card.locked {
  opacity: 0.5;
  filter: grayscale(0.6);
}

.shop-icon,
.ladder-icon {
  display: grid;
  width: 48px;
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  font-size: 1.4rem;
  background: var(--panel-raise);
  box-shadow: var(--bevel-up);
  place-items: center;
}

.shop-copy,
.tech-copy,
.ladder-copy {
  min-width: 0;
}

.shop-copy h3,
.tech-copy h3,
.ladder-copy h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.shop-copy p,
.tech-copy p,
.ladder-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.shop-stats,
.tech-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.shop-stats span,
.tech-meta span,
.ladder-meta span {
  border: 2px solid var(--ink);
  padding: 4px 7px;
  color: var(--muted);
  font-family: var(--pixel);
  font-size: 0.44rem;
  background: var(--panel);
}

.buy-button,
.tech-button {
  min-width: 92px;
  padding: 11px 12px;
  font-family: var(--pixel);
  font-size: 0.52rem;
  background: var(--green-deep);
}

.buy-button:disabled,
.tech-button:disabled {
  background: var(--panel-raise);
}

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

.tech-card {
  display: grid;
  align-content: space-between;
  min-height: 170px;
}

.tech-card.owned {
  border-color: var(--cyan);
  box-shadow: var(--bevel-down), 0 0 0 2px rgba(115, 239, 247, 0.3);
}

.tech-card.owned .tech-button {
  color: var(--ink);
  background: var(--cyan);
  box-shadow: var(--bevel-down);
}

.ladder-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.ladder-card.active {
  border-color: var(--green-deep);
  background: #1d2b26;
}

.ladder-card.current {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.ladder-card.current .ladder-copy h3::after {
  content: " ◄ 当前";
  color: var(--cyan);
  font-family: var(--pixel);
  font-size: 0.5rem;
}

.ladder-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
  min-width: 150px;
}

.event-catalog {
  min-height: 0;
  color: var(--muted);
}

.event-catalog summary {
  cursor: pointer;
  font-family: var(--pixel);
  font-size: 0.56rem;
}

.event-catalog-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 260px;
  margin-top: 10px;
  overflow: auto;
}

.event-catalog-item strong,
.event-catalog-item span {
  display: block;
}

.event-catalog-item strong {
  color: var(--text);
  font-size: 0.86rem;
}

.event-catalog-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.event-catalog-item.buff {
  border-left: 6px solid var(--green-deep);
}

.event-catalog-item.bad {
  border-left: 6px solid var(--red);
}

.event-log {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-log li {
  border: 3px solid var(--ink);
  border-left: 6px solid var(--cyan);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.88rem;
  background: var(--panel-deep);
}

.event-log time {
  display: block;
  margin-bottom: 4px;
  color: var(--cyan);
  font-family: var(--pixel);
  font-size: 0.48rem;
}

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

.relic-card {
  border-color: var(--ink);
  background: #2c2440;
}

.relic-card span,
.relic-card em {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relic-card strong {
  display: block;
  margin: 5px 0;
  color: var(--yellow);
  font-family: var(--pixel);
  font-size: 0.7rem;
}

.coverage-card {
  margin-top: 10px;
  color: var(--muted);
}

.coverage-card p:last-child {
  margin-bottom: 0;
  line-height: 1.55;
}

.vault-dialog {
  width: min(560px, calc(100vw - 28px));
}

.vault-dialog .dialog-shell,
.vault-dialog form {
  padding: 16px;
  margin: 0;
}

.vault-dialog p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

.vault-dialog menu {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin: 12px 0 0;
  padding: 0;
}

@keyframes starBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

@keyframes framePulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(115, 239, 247, 0.1); }
  50% { box-shadow: 0 0 0 6px rgba(115, 239, 247, 0.3); }
}

@keyframes floatUp {
  from { opacity: 1; transform: translate(-50%, 0); }
  to { opacity: 0; transform: translate(-50%, -64px); }
}

@keyframes badgePop {
  0% { opacity: 0; transform: scale(0.6); }
  20% { opacity: 1; transform: scale(1.1); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.8); }
}

@media (max-width: 1180px) {
  .app-shell {
    width: min(100vw - 18px, 1100px);
    gap: 9px;
    padding: 9px 0;
  }

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

  .brand-block {
    display: flex;
    gap: 12px;
    align-items: end;
    justify-content: space-between;
  }

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

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.86fr);
  }

  .status-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
  }

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

@media (max-width: 760px) {
  .app-shell {
    width: calc(100vw - 12px);
    height: 100dvh;
    padding: 6px 0;
    gap: 6px;
  }

  .panel,
  .game-dialog {
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(255, 255, 255, 0.06);
  }

  .topbar {
    gap: 7px;
    padding: 8px;
  }

  .brand-block {
    display: grid;
    gap: 2px;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 0.42rem;
  }

  h1 {
    font-size: clamp(0.95rem, 5.2vw, 1.35rem);
  }

  h2 {
    font-size: 0.82rem;
  }

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

  .stat-card {
    padding: 6px 7px;
  }

  .stat-card span {
    font-size: 0.38rem;
  }

  .stat-card strong {
    font-size: 0.56rem;
  }

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

  .goal-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    padding: 8px;
  }

  .goal-track {
    grid-column: 1 / -1;
    order: 3;
    height: 16px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto auto;
    gap: 6px;
  }

  .core-panel,
  .command-panel,
  .status-panel {
    padding: 10px;
  }

  .core-panel {
    grid-template-rows: auto minmax(118px, 1fr);
  }

  .compact-heading {
    align-items: flex-start;
  }

  .era-badge {
    font-size: 0.42rem;
    padding: 5px 7px;
  }

  .data-core {
    width: min(18dvh, 150px, 42vw);
  }

  .data-core::before,
  .data-core::after {
    display: none;
  }

  .core-copy {
    display: none;
  }

  .mini-grid {
    display: none;
  }

  .command-panel {
    grid-template-rows: auto auto;
  }

  .command-panel .panel-heading {
    display: none;
  }

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

  .command-card,
  .command-card:first-child {
    grid-column: auto;
    min-height: 54px;
    padding: 7px 4px;
    text-align: center;
    background: var(--panel-deep);
  }

  .command-card span,
  .command-card em {
    display: none;
  }

  .command-card strong {
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.2;
  }

  .core-actions {
    margin-top: 7px;
  }

  .ghost-button,
  .primary-button,
  .danger-button,
  .chip-toggle {
    padding: 8px 10px;
    font-size: 0.48rem;
  }

  .status-panel {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    gap: 6px;
  }

  .quick-note {
    display: none;
  }

  .era-chapter,
  .active-event-wrap {
    padding: 8px;
  }

  .era-chapter p:not(.eyebrow) {
    display: none;
  }

  .era-chapter h3 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.78rem;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .active-event {
    display: -webkit-box;
    overflow: hidden;
    padding: 8px;
    font-size: 0.66rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .game-dialog,
  .wide-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
  }

  .dialog-shell {
    max-height: calc(100dvh - 12px);
    padding: 10px;
  }

  .dialog-header {
    align-items: flex-start;
    margin: -10px -10px 0;
    padding: 10px;
  }

  .dialog-actions {
    flex-direction: column;
    align-items: flex-end;
  }

  .shop-list,
  .tech-grid,
  .event-catalog-list,
  .relic-grid {
    grid-template-columns: 1fr;
  }

  .shop-card,
  .ladder-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .buy-button,
  .ladder-meta {
    grid-column: 1 / -1;
    width: 100%;
  }

  .ladder-meta {
    justify-content: flex-start;
    min-width: 0;
  }

  .tech-card {
    min-height: 145px;
  }

  .vault-dialog menu {
    flex-direction: column;
  }
}

@media (max-height: 720px) and (min-width: 761px) {
  .app-shell {
    gap: 8px;
    padding: 8px 0;
  }

  .topbar,
  .goal-panel,
  .core-panel,
  .command-panel,
  .status-panel {
    padding: 10px;
  }

  .data-core {
    width: min(38vh, 260px, 78%);
  }

  .command-card {
    min-height: 86px;
  }

  .quick-note p:last-child,
  .era-chapter p:not(.eyebrow) {
    font-size: 0.8rem;
  }
}
