:root {
  color-scheme: dark;
  --bg: #070909;
  --panel: rgba(20, 24, 24, 0.84);
  --panel-strong: rgba(33, 38, 38, 0.92);
  --panel-soft: rgba(12, 20, 18, 0.74);
  --text: #f2f5f2;
  --muted: #91a39b;
  --cyan: #00d8ff;
  --green: #3cff8f;
  --orange: #ffae42;
  --red: #ff6e6e;
  --disabled: #606865;
  --border: rgba(238, 246, 241, 0.74);
  --shadow-cyan: 0 0 18px rgba(0, 216, 255, 0.42);
  --font-small: 12px;
  --font-regular: 14px;
  --font-subtitle: 16px;
  --font-heading: 18px;
  --font-button: 16 px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }
.m-5 { margin: 20px; }
.m-6 { margin: 24px; }
.m-8 { margin: 32px; }
.mx-auto { margin-right: auto; margin-left: auto; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 22px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }
.p-half { padding: 2px; }
.px-1 { padding-right: 4px; padding-left: 4px; }
.px-2 { padding-right: 8px; padding-left: 8px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.pr-half { padding-right: 2px; }
.pt-half { padding-top: 2px; }
.pt-1 { padding-top: 4px; }
.pt-2 { padding-top: 8px; }
.pt-3 { padding-top: 9px; }
.p-safe-shell {
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
}
.p-safe-overlay {
  padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Courier New", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: var(--font-regular);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

button {
  font: inherit;
  font-size: var(--font-button);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 90ms ease, filter 90ms ease, box-shadow 90ms ease, background-color 90ms ease, border-color 90ms ease;
}

button:not(:disabled):active,
button:not(:disabled).button-pressed {
  transform: translateY(1px) scale(0.985);
  filter: brightness(1.35) saturate(1.15);
  box-shadow: 0 0 22px rgba(232, 255, 239, 0.28), inset 0 0 0 2px rgba(232, 255, 239, 0.32);
}

button:not(:disabled).can-afford:active,
button:not(:disabled).can-afford.button-pressed,
.menu-button.active:not(:disabled):active,
.menu-button.active:not(:disabled).button-pressed,
.subtab.active:not(:disabled):active,
.subtab.active:not(:disabled).button-pressed {
  box-shadow: 0 0 24px rgba(0, 216, 255, 0.6), inset 0 0 0 2px rgba(232, 255, 239, 0.42);
}

#matrix {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 38%, rgba(0, 216, 255, 0.08), transparent 34%), #070909;
}

.game-shell {
  position: relative;
  z-index: 1;
  height: 100svh;

  width: min(100%, 600px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
}

.hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(86px, auto) minmax(0, 1fr);
  align-items: start;
  min-height: 68px;
}

.metric {
  display: grid;
  gap: 2px;
  text-shadow: 0 0 12px currentColor;
}

.metric strong {
  font-size: var(--font-heading);
  line-height: 1;
  font-weight: 400;
}

.metric span {
  font-size: var(--font-small);
}

.metric-primary {
  color: var(--cyan);
}

.metric-core {
  color: var(--green);
  text-align: center;
}

.metric-secondary,
.metric-empty,
.metric-bots {
  color: var(--orange);
  text-align: right;
}

.metric-empty {
  visibility: hidden;
}

.metric-bots {
  color: #ff5fd2;
}

.page {

  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--cyan) rgba(255, 255, 255, 0.12);
  touch-action: pan-y;
}

.research-page {

  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.matrix-page {
  min-height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: stretch;
  gap: 10px;
}

.download-stage {

  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  overflow-y: auto;
}

.download-panel {
  width: min(280px, 74vw);
  display: grid;
  justify-items: start;
  gap: 8px;
  color: var(--cyan);
  text-shadow: var(--shadow-cyan);
}

.download-label {
  min-height: 20px;
  justify-self: center;
  font-size: var(--font-subtitle);
  letter-spacing: 0;
}

.download-bar {
  position: relative;
  width: 100%;
  height: 24px;
  overflow: hidden;
  border: 1px solid rgba(232, 255, 239, 0.32);
  background:
    repeating-linear-gradient(
      90deg,
      rgba(242, 245, 242, 0.45) 0 2px,
      transparent 2px 5px
    );
  box-shadow: 0 0 16px rgba(0, 216, 255, 0.18);
}

.download-bar-fill {
  height: 100%;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0, 255, 238, 0.96) 0 2px,
      rgba(0, 255, 238, 0.96) 2px 3px,
      transparent 3px 5px
    );
  box-shadow: 0 0 18px rgba(0, 255, 238, 0.72);
}

.download-percent {
  min-height: 18px;
  font-size: var(--font-heading);
  line-height: 1;
}

.upgrade-stack,
.card-grid {
  display: grid;
  gap: 8px;
}

.upgrade-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.upgrade-row.has-max {
  grid-template-columns: minmax(0, 1fr) minmax(68px, 0.22fr);
}

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

.subtab {
  min-height: 52px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--panel-strong);
  color: var(--text);
  font-size: var(--font-button);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.subtab.active {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(0, 216, 255, 0.12);
  box-shadow: var(--shadow-cyan);
}

.upgrade,
.upgrade-max,
.card,
.reboot-card {
  width: 100%;
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--panel-strong);
  color: var(--text);
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.upgrade,
.upgrade-max,
.card.actionable,
.reboot-button {
  cursor: pointer;
}

.upgrade-max {
  justify-content: center;
  text-align: center;
  color: var(--cyan);
  text-transform: lowercase;
}

.upgrade strong,
.upgrade small,
.card strong,
.card small,
.stat-row span,
.stat-row strong {
  display: block;
}

.upgrade strong,
.card strong {
  font-weight: 400;
  font-size: var(--font-subtitle);
}

.upgrade small,
.card small,
.muted {
  color: var(--muted);
  font-size: var(--font-small);
}

.meta {
  min-width: 102px;
  text-align: right;
}

.research-card-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 4px;
}

.research-card-footer small:first-child {
  color: inherit;
  text-align: left;
}

.research-card-footer small:last-child {
  color: var(--muted);
  text-align: right;
}

.research-copy {
  width: 100%;
  display: grid;
  gap: 8px;
  justify-items: center;
  align-content: center;
  text-align: center;
}

.research-panel .card,
.program-card {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto;
  align-self: start;
  align-items: start;
  justify-content: stretch;
  justify-items: stretch;
  border-width: 3px;
}

.research-panel .card > *,
.program-card > * {
  width: 100%;
  min-width: 0;
  justify-self: stretch;
}

.research-panel .card strong,
.program-card strong {
  font-size: var(--font-subtitle);
}

.research-panel .card small,
.program-card small {
  font-size: var(--font-regular);
}

.research-panel {

  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--cyan) rgba(255, 255, 255, 0.12);
}

.programs-page {
  height: 100%;

  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: start;
  gap: 12px;
  overflow: hidden;
  touch-action: pan-y;
}

.programs-status {
  min-height: 32px;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: var(--font-heading);
  text-align: center;
  text-shadow: 0 0 12px rgba(242, 245, 242, 0.24);
}

.operator-page {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 14px;
}

.operator-hint {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: var(--font-small);
  text-align: center;
}

.operator-choice-grid {

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  align-items: stretch;
  gap: 10px;
}

.operator-tier3-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  align-items: stretch;
  gap: 10px;
}

.programs-bar {
  position: relative;
  height: 24px;
  overflow: hidden;
  border: 2px solid rgba(0, 216, 255, 0.78);
  border-radius: 4px;
  background: rgba(8, 24, 27, 0.9);
  box-shadow: var(--shadow-cyan), inset 0 0 0 1px rgba(232, 255, 239, 0.24);
}

.programs-bar-fill {
  height: 100%;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0, 216, 255, 0.82) 0 3px,
      rgba(0, 216, 255, 0.62) 3px 6px
    );
  box-shadow: 0 0 18px rgba(0, 216, 255, 0.72);
  transition: width 140ms ease;
}

.program-list {

  height: 100%;
  display: grid;
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
  gap: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--cyan) rgba(255, 255, 255, 0.12);
  touch-action: pan-y;
}

.rogue-programs-page {
  grid-template-rows: minmax(0, 1fr);
}

.rogue-program-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}

.rogue-program-grid .program-card {
  height: 100%;
  min-height: 120px;
}

.program-card {
  width: 100%;
  gap: 6px;
  border: 3px solid var(--border);
  border-radius: 4px;
  background: var(--panel-strong);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  touch-action: pan-y;
}

.program-card strong {
  font-weight: 400;
}

.program-card small {
  line-height: 1.35;
}

.program-card .research-card-footer small:first-child {
  color: var(--cyan);
  text-shadow: var(--shadow-cyan);
}

.program-blocked .research-card-footer small:first-child,
.locked .research-card-footer small:first-child {
  color: inherit;
  text-shadow: none;
}

.operator-card {
  height: 100%;
  min-height: 180px;
  align-content: space-between;
  gap: 10px;
}

.operator-card strong {
  font-size: var(--font-subtitle);
}

.operator-card small {
  display: grid;
  gap: 12px;
  color: inherit;
  font-size: var(--font-regular);
  line-height: 1.35;
}

.operator-card .operator-effect {
  color: var(--cyan);
  text-shadow: var(--shadow-cyan);
}

.program-running {
  border-color: var(--cyan);
  background: rgba(0, 216, 255, 0.12);
  color: var(--cyan);
  box-shadow: var(--shadow-cyan), inset 0 0 0 1px rgba(0, 216, 255, 0.18);
}

.program-blocked {
  color: var(--disabled);
}

.can-afford {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: var(--shadow-cyan), inset 0 0 0 1px rgba(0, 216, 255, 0.16);
}

button:disabled,
.locked {
  cursor: not-allowed;
  color: var(--disabled);
  border-color: rgba(160, 165, 162, 0.44);
  box-shadow: none;
}

.operator-card.program-running:disabled {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(0, 216, 255, 0.12);
  box-shadow: var(--shadow-cyan), inset 0 0 0 1px rgba(0, 216, 255, 0.18);
}

.operator-card.program-running:disabled .operator-effect {
  color: var(--cyan);
  text-shadow: var(--shadow-cyan);
}

.page-title {
  color: var(--cyan);
  font-size: var(--font-heading);
  font-weight: 400;
  text-align: center;
}

.panel {
  border: 2px solid rgba(238, 246, 241, 0.58);
  border-radius: 4px;
  background: var(--panel-soft);
}

.accordion {
  display: grid;
  gap: 6px;
}

.accordion-item {
  border: 0;
  background: transparent;
  overflow: visible;
}

.accordion-item summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  border: 3px solid var(--border);
  border-radius: 4px;
  background: var(--panel-strong);
  color: var(--text);
  font-size: var(--font-subtitle);
  line-height: 1;
  cursor: pointer;
  list-style: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.accordion-item summary::-webkit-details-marker {
  display: none;
}

.accordion-item summary::after {
  content: "";
}

.accordion-item[open] summary::after {
  content: "";
}

.accordion-item p {
  border-top: 0;
  color: var(--text);
  font-size: var(--font-regular);
  line-height: 1.5;
  white-space: pre-line;
}

.stat-table {
  display: grid;
  gap: 0;
}

.stat-header,
.stat-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.15fr) minmax(90px, 0.9fr) minmax(90px, 0.9fr);
  gap: 12px;
  align-items: baseline;
}

.stat-header {
  color: var(--text);
  text-transform: capitalize;
}

.stat-row {
  min-height: 40px;
  color: var(--text);
}

.stat-row span:first-child {
  color: var(--text);
}

.stat-header span:not(:first-child),
.stat-row strong {
  text-align: right;
  font-weight: 400;
}

.statistics-page {
  background: transparent;
  border: 0;
}

.statistics-page .stat-header,
.statistics-page .stat-row {
  font-size: var(--font-regular);
}

.statistics-page .stat-header {
  font-size: var(--font-subtitle);
}

.stat-calculations-toggle {
  display: block;
  border: 0;
  background: transparent;
  color: var(--cyan);
  font-size: var(--font-button);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  box-shadow: none;
}

.stat-calculations {
  display: grid;
  gap: 10px;
  border-top: 2px solid rgba(242, 245, 242, 0.42);
}

.calc-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.7fr) minmax(0, 1.7fr) minmax(92px, 0.8fr);
  gap: 10px;
  align-items: baseline;
  color: var(--text);
}

.calc-row span,
.calc-row strong {
  font-weight: 400;
  font-size: var(--font-regular);
}

.calc-row small {
  color: var(--muted);
  font-size: var(--font-small);
  line-height: 1.35;
}

.calc-row strong {
  text-align: right;
  color: var(--cyan);
  text-shadow: var(--shadow-cyan);
}

.story-list {
  display: grid;
}

.story-entry {
  display: grid;
  justify-items: center;
  border-bottom: 2px solid rgba(242, 245, 242, 0.78);
  text-align: center;
}

.story-entry p {
  max-width: 760px;
  color: var(--text);
  font-size: var(--font-regular);
  line-height: 1.5;
}

.story-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #000;
  text-align: center;
}

.story-overlay-content {
  width: min(100%, 520px);
  display: grid;
  justify-items: center;
  gap: 32px;
}

.story-overlay p {
  color: var(--text);
  font-size: var(--font-regular);
  line-height: 1.5;
  text-shadow: 0 0 12px rgba(242, 245, 242, 0.2);
}

.intro-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(7, 9, 9, 0.72);
  text-align: center;
  transition: background-color 1800ms ease, opacity 900ms ease;
}

.intro-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(242, 245, 242, 0.12) 0 1px,
      transparent 1px 4px
    );
}

.intro-overlay::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 2px;
  pointer-events: none;
  background: rgba(232, 255, 239, 0.92);
  box-shadow: 0 0 22px rgba(232, 255, 239, 0.85);
  opacity: 0;
  transform: translate(-50%, -50%);
}

.intro-overlay-content {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  display: grid;
  justify-items: center;
  gap: 28px;
  color: var(--text);
  text-shadow: 0 0 16px rgba(242, 245, 242, 0.24);
}

.intro-question,
.intro-message {
  color: var(--text);
  font-size: var(--font-heading);
  line-height: 1.5;
}

.intro-message {
  max-width: 440px;
  font-size: var(--font-subtitle);
}

.intro-pill-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(118px, 1fr));
  gap: 18px;
  width: min(100%, 360px);
}

.intro-pill {
  min-height: 58px;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: rgba(7, 9, 9, 0.82);
  cursor: pointer;
}

.intro-pill-blue {
  color: var(--cyan);
  box-shadow: var(--shadow-cyan), inset 0 0 0 1px rgba(0, 216, 255, 0.22);
}

.intro-pill-red {
  color: var(--red);
  box-shadow: 0 0 18px rgba(255, 110, 110, 0.38), inset 0 0 0 1px rgba(255, 110, 110, 0.2);
}

.intro-fade-black {
  background: #000;
}

.intro-tv-off .intro-overlay-content {
  animation: intro-tv-collapse 900ms ease-in forwards;
}

.intro-tv-off::after {
  animation: intro-tv-line 900ms ease-in forwards;
}

.intro-rebooting {
  background: #000;
}

@keyframes intro-tv-collapse {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  55% {
    opacity: 0.85;
    transform: scaleY(0.04) scaleX(1);
  }
  100% {
    opacity: 0;
    transform: scaleY(0) scaleX(0.08);
  }
}

@keyframes intro-tv-line {
  0% {
    width: 0;
    opacity: 0;
  }
  45% {
    width: 82%;
    opacity: 1;
  }
  100% {
    width: 0;
    opacity: 0;
  }
}

.story-continue {
  min-width: 160px;
  min-height: 54px;
  border: 2px solid var(--cyan);
  border-radius: 4px;
  background: rgba(0, 216, 255, 0.12);
  color: var(--cyan);
  cursor: pointer;
  opacity: 0;
  box-shadow: var(--shadow-cyan), inset 0 0 0 1px rgba(0, 216, 255, 0.16);
  transition: opacity 700ms ease;
}

.story-continue.visible {
  opacity: 1;
}

.crash-screen {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 148px;
  left: 0;
  z-index: 14;
  display: grid;
  place-items: center;
  background: #070909;
}

.crash-game {
  width: min(100%, 520px);
  display: grid;
  gap: 10px;
  color: var(--cyan);
  text-shadow: var(--shadow-cyan);
}

.crash-title,
.crash-reward,
.crash-jumps,
.crash-countdown {
  text-align: center;
}

.crash-title {
  font-size: var(--font-heading);
  letter-spacing: 0.12em;
}

.crash-countdown {
  min-height: 18px;
  color: var(--orange);
  font-size: var(--font-heading);
  line-height: 1;
  text-shadow: 0 0 18px rgba(255, 174, 66, 0.5);
}

.crash-reward,
.crash-jumps {
  min-height: 18px;
  color: var(--text);
  font-size: var(--font-regular);
}

.crash-track {
  position: relative;
  height: 180px;
  overflow: hidden;
  border-block: 1px solid rgba(0, 216, 255, 0.28);
  background: linear-gradient(180deg, rgba(0, 216, 255, 0.045), transparent 62%);
  box-shadow: inset 0 0 28px rgba(0, 216, 255, 0.05);
}

.crash-ground,
.crash-runner,
.crash-obstacle,
.crash-cloud {
  image-rendering: pixelated;
  background-image: url("assets/chrome-dino-sprite.png");
  background-size: 1200px 73.5px;
  background-repeat: no-repeat;
  filter: brightness(0) saturate(100%) invert(77%) sepia(98%) saturate(2480%) hue-rotate(139deg) brightness(102%) contrast(104%) drop-shadow(0 0 4px rgba(0, 216, 255, 0.48));
}

.crash-ground {
  position: absolute;
  right: -1200px;
  bottom: 20px;
  left: 0;
  height: 14px;
  background-repeat: repeat-x;
  background-position: 0 -1px;
  opacity: 0.78;
  z-index: 1;
}

.crash-track.running .crash-ground {
  animation: crash-ground-scroll var(--crash-ground-duration, 4s) linear infinite;
}

@keyframes crash-ground-scroll {
  from { background-position: 0 -1px; }
  to { background-position: -1200px -1px; }
}

.crash-runner {
  position: absolute;
  left: 72px;
  bottom: 31px;
  width: 40px;
  height: 43px;
  background-position: -175px -15.5px;
  z-index: 2;
}

.crash-runner[data-frame="left"] {
  background-position: -216px -15.5px;
}

.crash-runner[data-frame="right"] {
  background-position: -257px -15.5px;
}

.crash-obstacle {
  position: absolute;
  left: 0;
  bottom: 31px;
  width: 23px;
  height: 46px;
  background-position: -35px -15.5px;
  z-index: 2;
}

.crash-obstacle[data-variant="1"] {
  width: 32px;
  height: 33px;
  background-position: -59px -15.5px;
}

.crash-obstacle[data-variant="2"] {
  width: 40px;
  height: 46px;
  background-position: -92px -15.5px;
}

.crash-obstacle[data-variant="3"] {
  width: 41px;
  height: 33px;
  background-position: -133px -15.5px;
}

.crash-cloud {
  position: absolute;
  width: 46px;
  height: 14px;
  background-position: -397px -15.5px;
  filter: brightness(0) invert(1) drop-shadow(0 0 3px rgba(242, 245, 242, 0.25));
  opacity: 0.22;
}

.crash-cloud-one {
  top: 42px;
  left: 56%;
}

.crash-cloud-two {
  top: 76px;
  left: 18%;
  transform: scale(0.75);
}

.crash-score {
  position: absolute;
  top: 12px;
  left: 16px;
  color: var(--green);
  font-size: var(--font-regular);
  letter-spacing: 0.14em;
  text-shadow: 0 0 10px rgba(60, 255, 143, 0.45);
  z-index: 3;
}

.crash-game-over {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  gap: 10px;
  background: rgba(7, 9, 9, 0.62);
  text-align: center;
}

.crash-game-over strong {
  color: var(--cyan);
  font-size: var(--font-heading);
  font-weight: 400;
  letter-spacing: 0.14em;
}

.crash-game-over span {
  color: var(--text);
  font-size: var(--font-regular);
}

.backdoor-list {
  display: grid;
}

.backdoor-entry {
  display: grid;
  gap: 12px;
  justify-items: center;
  border-bottom: 2px solid rgba(242, 245, 242, 0.78);
  text-align: center;
}

.backdoor-entry strong {
  font-size: var(--font-subtitle);
  font-weight: 400;
}

.backdoor-entry p {
  max-width: 760px;
  font-size: var(--font-regular);
  line-height: 1.45;
}

.backdoor-entry small {
  color: inherit;
  font-size: var(--font-small);
}

.backdoor-unlocked {
  color: var(--text);
  text-shadow: 0 0 10px rgba(242, 245, 242, 0.22);
}

.backdoor-unlocked small {
  color: var(--green);
  text-shadow: 0 0 12px rgba(60, 255, 143, 0.35);
}

.backdoor-locked {
  color: rgba(242, 245, 242, 0.42);
}

.backdoor-locked small {
  color: rgba(242, 245, 242, 0.5);
}

.expeditions-page {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: start;
  gap: 12px;
  overflow: hidden;
}

.expeditions-status {
  min-height: 32px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  color: var(--text);
  font-size: var(--font-heading);
  text-align: center;
}

.expeditions-bonus {
  font-size: var(--font-regular);
  color: var(--cyan);
  text-shadow: var(--shadow-cyan);
  text-align: right;
}

.expedition-list {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  align-items: stretch;
  grid-auto-rows: max-content;
  gap: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--cyan) rgba(255, 255, 255, 0.12);
  touch-action: pan-y;
}

.expedition-row {
  display: grid;
  gap: 10px;
  border: 3px solid var(--border);
  border-radius: 4px;
  background: var(--panel-strong);
  color: var(--text);
  text-align: center;
}

.expedition-header {
  display: grid;
  gap: 4px;
}

.expedition-row > .expedition-header > strong {
  font-size: var(--font-subtitle);
  font-weight: 400;
}

.expedition-row small {
  font-size: var(--font-regular);
  line-height: 1.35;
}

.expedition-requirements {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}

.expedition-requirement {
  min-height: 158px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 2px solid rgba(242, 245, 242, 0.42);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.025);
}

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

.expedition-requirement-copy strong {
  font-size: var(--font-regular);
  font-weight: 400;
  line-height: 1.35;
}

.expedition-requirement-index,
.expedition-requirement-copy small:last-child {
  color: var(--muted);
  text-transform: lowercase;
}

.expedition-review {
  min-height: 42px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
}

.requirement-ready {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: inset 0 0 10px rgba(0, 216, 255, 0.12);
}

.requirement-ready .expedition-review,
.requirement-done .expedition-review {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: var(--shadow-cyan);
}

.requirement-done {
  border-color: rgba(60, 255, 143, 0.58);
}

.requirement-hidden {
  color: rgba(242, 245, 242, 0.3);
  border-color: rgba(242, 245, 242, 0.14);
}

.expedition-review:disabled {
  color: rgba(242, 245, 242, 0.25);
  border-color: rgba(242, 245, 242, 0.14);
}

.expedition-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.expedition-complete {
  border-color: rgba(60, 255, 143, 0.65);
  box-shadow: 0 0 14px rgba(60, 255, 143, 0.18), inset 0 0 8px rgba(60, 255, 143, 0.1);
}

.expedition-relic-name {
  color: var(--green);
  text-shadow: 0 0 12px rgba(60, 255, 143, 0.35);
}

.expedition-effect {
  color: var(--green);
  text-shadow: 0 0 10px rgba(60, 255, 143, 0.28);
}

.expedition-locked {
  color: rgba(242, 245, 242, 0.5);
  border-color: rgba(242, 245, 242, 0.2);
}

.expedition-locked .expedition-footer small:last-child {
  color: var(--muted);
}

.expedition-empty {
  display: grid;
  gap: 8px;
  justify-items: center;
  border: 2px solid rgba(242, 245, 242, 0.28);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 680px) {
  .expedition-requirement {
    min-height: 0;
  }
}

.menu-shell {
  display: grid;
  gap: 5px;
  justify-items: center;
  position: relative;
  z-index: 2;
}

.page-name {
  min-height: 20px;
  color: var(--text);
  font-size: var(--font-subtitle);
}

.menu-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.menu-button {
  width: 50px;
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--panel-strong);
  color: var(--text);
  font-size: var(--font-button);
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.menu-button.active {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(0, 216, 255, 0.12);
  box-shadow: var(--shadow-cyan);
}

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

.reboot-page {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  text-align: center;
}

.reboot-page p {
  max-width: 780px;
  color: var(--text);
  font-size: var(--font-regular);
  line-height: 1.45;
}

.reboot-page span {
  color: var(--cyan);
  text-shadow: var(--shadow-cyan);
}

.reboot-page .reboot-small {
  color: var(--muted);
  font-size: var(--font-small);
}

.reboot-button {
  justify-self: center;
  min-width: 152px;
  min-height: 54px;
  border: 2px solid var(--orange);
  border-radius: 4px;
  background: rgba(255, 174, 66, 0.12);
  color: var(--orange);
}

.about-page {
  min-height: 100%;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 24px;
  text-align: center;
}

.about-page p {
  max-width: 760px;
  color: var(--text);
  font-size: var(--font-regular);
  line-height: 1.5;
}

.about-page .muted {
  color: var(--muted);
}

.about-page a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dev-multiplier-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: min(100%, 420px);
}

.dev-multiplier {
  min-height: 44px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
}

.dev-multiplier.active {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(0, 216, 255, 0.12);
  box-shadow: var(--shadow-cyan);
}

.danger {
  color: var(--red);
}

.hidden {
  display: none;
}

@media (min-width: 760px) {
  .game-shell {
    gap: 8px;
  }

  .menu-row {
    width: min(620px, 100%);
  }

}

@media (max-width: 380px) {
  .menu-row {
    gap: 6px;
  }

  .menu-button {
    width: 44px;
  }
}
