:root {
  /* Everything is Crab kit fallbacks keep the original bridge usable before
     the runtime applies its asset variables. */
  --eic-genetic-box-url: url('./assets/eic-kit/textures/genetic_box_large.png');
  --eic-genetic-box-hovered-url: url('./assets/eic-kit/textures/genetic_box_large_hovered.png');
  --eic-genetic-box-clicked-url: url('./assets/eic-kit/textures/genetic_box_large_clicked.png');
  color-scheme: dark;
  --ink: #18251f;
  --ink-soft: #33463c;
  --paper: #f2dfac;
  --paper-light: #fff2c8;
  --paper-shadow: #ad8750;
  --moss: #3e7d58;
  --moss-bright: #72ba67;
  --sun: #f4c95b;
  --coral: #ef7463;
  --water: #65c9d0;
  --night: #15283c;
  --danger: #e65249;
  --outline: 3px solid var(--ink);
  --shadow: 7px 8px 0 rgb(10 23 18 / 52%);
  font-family: "Trebuchet MS", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #102019;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
  background:
    radial-gradient(circle at 30% 20%, rgb(107 172 103 / 22%), transparent 32%),
    #102019;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  outline: 0;
  touch-action: none;
}

.grain {
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: 0.14;
  pointer-events: none;
  mix-blend-mode: multiply;
  background-image:
    repeating-radial-gradient(circle at 17% 23%, #000 0 0.6px, transparent 0.7px 4px),
    repeating-linear-gradient(13deg, transparent 0 7px, rgb(255 255 255 / 7%) 8px 9px);
}

.is-hidden {
  display: none !important;
}

.screen,
.modal-layer {
  position: absolute;
  z-index: 20;
  inset: 0;
}

.screen--language {
  overflow: auto;
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vw, 44px);
  background:
    linear-gradient(rgb(72 54 36 / 20%), rgb(72 54 36 / 20%)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgb(68 47 29 / 5%) 32px 33px),
    #9d8b68;
}

.screen--language::before {
  content: "";
  position: fixed;
  inset: clamp(14px, 2.2vw, 34px);
  border: 4px solid rgb(75 46 37 / 62%);
  border-radius: 22px 9px 20px 7px;
  box-shadow: inset 0 0 0 8px rgb(242 223 172 / 15%);
  pointer-events: none;
}

.language-card {
  position: relative;
  width: min(1180px, calc(100vw - 80px));
  min-height: min(820px, calc(100vh - 88px));
  padding: clamp(34px, 5vw, 74px);
  border: 4px solid #5d372f;
  border-radius: 8px 18px 9px 15px;
  background:
    linear-gradient(rgb(255 255 255 / 12%), transparent 18%),
    repeating-linear-gradient(0deg, transparent 0 27px, rgb(83 55 35 / 6%) 28px 29px),
    #c9b17d;
  box-shadow: 12px 14px 0 rgb(48 31 24 / 32%);
}

.language-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px solid rgb(93 55 47 / 35%);
  border-radius: 4px 13px 5px 10px;
  pointer-events: none;
}

.language-card > .eyebrow,
.language-card > h1,
.language-note {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #663732;
}

.language-card > h1 {
  margin: 0;
  font-family: Rockwell, "Bookman Old Style", Georgia, "Microsoft YaHei", serif;
  font-size: clamp(2.7rem, 6vw, 5.8rem);
  letter-spacing: 0.035em;
}

.language-card > .eyebrow {
  margin-bottom: 8px;
}

.language-note {
  margin: 12px auto 28px;
  max-width: 44ch;
  line-height: 1.55;
}

.language-options {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: column;
  grid-template-rows: repeat(7, minmax(64px, 1fr));
  gap: 6px clamp(28px, 7vw, 110px);
}

.language-option {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 28px);
  min-width: 0;
  border: 3px solid transparent;
  border-radius: 2px;
  padding: 8px 18px;
  background: transparent;
  color: #683b34;
  font-family: Rockwell, "Bookman Old Style", Georgia, "Microsoft YaHei", serif;
  font-size: clamp(1.2rem, 2.3vw, 2.25rem);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: background 110ms ease, border-color 110ms ease, transform 110ms ease;
}

.language-option:hover,
.language-option:focus-visible,
.language-option.is-selected {
  border-color: rgb(93 55 47 / 28%);
  background: rgb(255 239 190 / 64%);
  outline: 0;
  transform: translate(-2px, -1px);
}

.language-flag {
  width: 1.6em;
  flex: 0 0 auto;
  font-size: 1.38em;
  line-height: 1;
  filter: saturate(0.88) contrast(0.95);
}

.screen--title {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgb(63 112 143 / 72%) 0 14%, rgb(45 139 163 / 76%) 14% 58%, rgb(38 149 163 / 76%) 58% 72%, rgb(27 100 119 / 78%) 72% 100%),
    var(--eic-background-url, url('./assets/background.png')) center / cover,
    #1b6477;
}

.title-continue {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: transparent;
  color: #fff4cf;
  cursor: pointer;
  isolation: isolate;
}

.title-continue::before,
.title-continue::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.title-continue::before {
  z-index: -3;
  inset: 10% -8% auto;
  height: 36%;
  opacity: 0.46;
  background:
    linear-gradient(164deg, transparent 0 22%, #d6c79f 22.3% 32%, transparent 32.3% 57%, #b8a58c 57.3% 69%, transparent 69.3%),
    repeating-linear-gradient(0deg, transparent 0 21px, rgb(255 255 255 / 4%) 22px 24px);
  clip-path: polygon(0 18%, 8% 18%, 8% 10%, 17% 10%, 17% 22%, 30% 22%, 30% 8%, 43% 8%, 43% 19%, 58% 19%, 58% 4%, 69% 4%, 69% 23%, 84% 23%, 84% 12%, 100% 12%, 100% 100%, 0 100%);
}

.title-continue::after {
  z-index: -2;
  inset: auto -4% -8%;
  height: 39%;
  background:
    linear-gradient(18deg, #0b2834 0 38%, transparent 38.5%),
    linear-gradient(162deg, transparent 0 46%, #0d303b 46.5% 69%, transparent 69.5%),
    linear-gradient(8deg, #163e48 0 57%, transparent 57.5%);
  clip-path: polygon(0 44%, 5% 28%, 9% 45%, 15% 22%, 22% 48%, 31% 31%, 39% 52%, 48% 24%, 57% 49%, 67% 30%, 75% 51%, 84% 20%, 90% 45%, 96% 27%, 100% 38%, 100% 100%, 0 100%);
}

.title-scenery,
.title-scenery i {
  position: absolute;
  display: block;
  pointer-events: none;
}

.title-scenery {
  z-index: -1;
  inset: 0;
}

.title-cloud {
  height: 11%;
  background: #b9b6a2;
  opacity: 0.68;
  clip-path: polygon(0 46%, 15% 46%, 15% 24%, 35% 24%, 35% 7%, 57% 7%, 57% 29%, 77% 29%, 77% 48%, 100% 48%, 100% 100%, 0 100%);
}

.title-cloud--one {
  top: 4%;
  left: -3%;
  width: 33%;
}

.title-cloud--two {
  top: 20%;
  right: -4%;
  width: 29%;
  transform: scaleX(-1);
}

.title-shore {
  bottom: 8%;
  height: 19%;
  background: #8d9a87;
  opacity: 0.78;
}

.title-shore--one {
  left: 8%;
  width: 40%;
  clip-path: polygon(0 100%, 8% 57%, 17% 68%, 26% 35%, 38% 48%, 49% 21%, 60% 45%, 72% 31%, 85% 59%, 100% 47%, 100% 100%);
}

.title-shore--two {
  right: 5%;
  width: 36%;
  clip-path: polygon(0 100%, 0 61%, 13% 49%, 23% 67%, 35% 31%, 48% 50%, 60% 27%, 74% 56%, 86% 35%, 100% 54%, 100% 100%);
}

.title-lockup {
  position: absolute;
  z-index: 2;
  top: 47%;
  left: 50%;
  width: min(1140px, 88vw);
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: clamp(17px, 2.5vw, 38px);
}

.original-title-logo {
  position: absolute;
  z-index: 3;
  width: min(78vw, 720px);
  max-height: 54vh;
  object-fit: contain;
  filter: drop-shadow(0 12px 0 rgb(13 24 20 / 42%));
  transition: opacity 180ms ease, transform 180ms ease;
}

.original-title-logo[data-original-loaded="false"] {
  display: none;
}

.original-title-logo[data-original-loaded="true"] + .title-mark {
  opacity: 0.08;
  transform: scale(0.92);
}

.title-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-wordmark {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  font-family: Rockwell, "Bookman Old Style", Georgia, serif;
  font-size: clamp(5.2rem, 12vw, 12.6rem);
  font-weight: 1000;
  line-height: 0.72;
  letter-spacing: -0.11em;
  -webkit-text-stroke: clamp(5px, 0.62vw, 11px) #101c20;
  paint-order: stroke fill;
  filter: drop-shadow(0 0 0 #eee4cf) drop-shadow(0 10px 0 #101c20);
}

.title-wordmark span {
  color: #43c6bd;
}

.title-wordmark strong {
  color: #ed9b2f;
  font: inherit;
}

.title-eyes {
  position: absolute;
  z-index: 1;
  top: clamp(-114px, -8vw, -72px);
  left: 50%;
  display: flex;
  gap: clamp(42px, 7vw, 92px);
  transform: translateX(-50%);
}

.title-eyes i {
  position: relative;
  width: clamp(34px, 4.2vw, 66px);
  height: clamp(88px, 9vw, 142px);
  border: clamp(6px, 0.7vw, 10px) solid #101c20;
  border-radius: 48% 48% 24% 24%;
  background: repeating-linear-gradient(145deg, #e18c25 0 17px, #c76e18 18px 29px);
  box-shadow: 0 0 0 clamp(6px, 0.7vw, 11px) #e7dfc9;
  transform: rotate(-3deg);
}

.title-eyes i:last-child {
  transform: rotate(4deg) translateY(-18px);
}

.title-eyes i::before,
.title-eyes i::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.title-eyes i::before {
  top: -28%;
  left: 50%;
  width: 1.45em;
  aspect-ratio: 1;
  border: clamp(6px, 0.7vw, 10px) solid #101c20;
  background: #ece9df;
  transform: translateX(-50%);
}

.title-eyes i::after {
  top: -3%;
  left: 50%;
  width: 0.58em;
  aspect-ratio: 1;
  background: #101c20;
  transform: translateX(-50%);
}

.title-claw {
  position: absolute;
  z-index: 1;
  top: 52%;
  width: clamp(82px, 10vw, 158px);
  height: clamp(64px, 7vw, 112px);
  border: clamp(7px, 0.7vw, 11px) solid #101c20;
  border-radius: 70% 30% 55% 45%;
  background: repeating-radial-gradient(circle at 38% 48%, #f0aa33 0 12px, #cc6917 13px 27px);
  box-shadow: 0 0 0 clamp(5px, 0.55vw, 9px) #e7dfc9;
}

.title-claw::after {
  content: "";
  position: absolute;
  top: 16%;
  right: -9%;
  width: 52%;
  height: 43%;
  border: clamp(6px, 0.58vw, 9px) solid #101c20;
  border-radius: 50%;
  background: #2e8fa1;
}

.title-claw--left {
  right: calc(100% - clamp(60px, 6vw, 94px));
  transform: rotate(10deg);
}

.title-claw--right {
  left: calc(100% - clamp(60px, 6vw, 94px));
  transform: scaleX(-1) rotate(10deg);
}

.title-subtitle {
  display: block;
  color: #f1a31f;
  font-family: Rockwell, "Microsoft JhengHei", "Microsoft YaHei", serif;
  font-size: clamp(2.2rem, 5vw, 5.4rem);
  font-weight: 1000;
  letter-spacing: 0.1em;
  line-height: 1;
  -webkit-text-stroke: clamp(3px, 0.35vw, 6px) #152126;
  paint-order: stroke fill;
  text-shadow: 0 6px 0 #f3dfae;
}

.title-prompt {
  position: absolute;
  z-index: 3;
  bottom: clamp(34px, 7vh, 92px);
  left: 50%;
  transform: translateX(-50%);
  color: rgb(255 242 203 / 88%);
  font-family: Rockwell, "Microsoft JhengHei", "Microsoft YaHei", serif;
  font-size: clamp(1.15rem, 2.6vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-shadow: 0 3px 0 rgb(15 48 58 / 55%);
  animation: title-prompt-pulse 1.35s ease-in-out infinite alternate;
}

@keyframes title-prompt-pulse {
  from { opacity: 0.42; }
  to { opacity: 1; }
}

.screen--menu {
  overflow: auto;
  padding: clamp(24px, 5vw, 72px);
  background:
    linear-gradient(90deg, rgb(9 24 18 / 96%) 0 44%, rgb(9 24 18 / 68%) 68%, rgb(9 24 18 / 88%)),
    radial-gradient(circle at 82% 18%, rgb(247 205 95 / 22%), transparent 23%);
}

.screen--menu::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(118deg, transparent 0 71%, rgb(240 194 79 / 16%) 71.2% 72%, transparent 72.2%),
    repeating-linear-gradient(90deg, transparent 0 58px, rgb(122 170 105 / 7%) 59px 60px),
    repeating-linear-gradient(0deg, transparent 0 58px, rgb(122 170 105 / 7%) 59px 60px);
}

.menu-layout {
  min-height: calc(100vh - clamp(48px, 10vw, 144px));
  display: grid;
  grid-template-columns: minmax(290px, 0.82fr) minmax(440px, 1.25fr) minmax(230px, 0.62fr);
  align-items: center;
  gap: clamp(22px, 3vw, 48px);
  max-width: 1540px;
  margin: 0 auto;
}

.title-block {
  color: var(--paper-light);
  align-self: center;
}

.eyebrow {
  margin: 0 0 9px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.title-block .eyebrow {
  color: var(--sun);
}

.title-block h1 {
  position: relative;
  width: max-content;
  margin: 0;
  font-family: Rockwell, "Bookman Old Style", Georgia, serif;
  font-size: clamp(4.6rem, 7vw, 7.4rem);
  line-height: 0.72;
  letter-spacing: -0.09em;
  color: var(--paper-light);
  text-shadow: 7px 8px 0 #2d704e, 13px 14px 0 #09140f;
  transform: rotate(-2deg) scaleX(0.78);
  transform-origin: left center;
}

.title-block h1 span {
  color: var(--sun);
}

.subtitle {
  width: max-content;
  margin: 20px 0 28px 8px;
  padding: 5px 11px;
  border: 2px solid var(--paper-light);
  font-family: Consolas, monospace;
  font-size: clamp(0.72rem, 1.3vw, 1rem);
  font-weight: 900;
  letter-spacing: 0.36em;
  color: var(--paper-light);
  transform: rotate(1deg);
}

.lede {
  max-width: 32ch;
  margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.7;
  color: #c8d6c2;
}

.feature-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 28px;
}

.feature-stamps span {
  padding: 6px 9px 5px;
  border: 2px solid #7dab75;
  border-radius: 2px;
  font-family: Consolas, monospace;
  font-size: 0.7rem;
  color: #bad6b4;
  transform: rotate(var(--stamp-angle, -1deg));
}

.feature-stamps span:nth-child(even) {
  --stamp-angle: 1.2deg;
}

.journal-card,
.modal-card {
  position: relative;
  border: var(--outline);
  border-radius: 5px 13px 6px 9px;
  background:
    linear-gradient(rgb(255 255 255 / 20%), transparent 15%),
    repeating-linear-gradient(0deg, transparent 0 23px, rgb(87 97 66 / 8%) 24px 25px),
    var(--paper);
  box-shadow: var(--shadow);
}

.journal-card::before,
.modal-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgb(55 65 45 / 28%);
  pointer-events: none;
}

.start-card {
  min-height: 610px;
  padding: clamp(24px, 3vw, 42px);
  transform: rotate(0.35deg);
}

.archive-card {
  align-self: end;
  padding: 27px 24px 22px;
  transform: rotate(-0.8deg);
}

.card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 23px;
}

.card-heading h2,
.archive-card h2,
.modal-card h2 {
  margin: 0;
  font-family: Rockwell, "Bookman Old Style", Georgia, serif;
  font-size: clamp(1.65rem, 2.8vw, 2.5rem);
  letter-spacing: -0.04em;
}

.save-status {
  padding: 6px 9px;
  border: 2px solid var(--moss);
  border-radius: 50%;
  font-family: Consolas, monospace;
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--moss);
  transform: rotate(7deg);
}

.genetic-list {
  display: grid;
  gap: 13px;
}

.genetic-option {
  position: relative;
  display: grid;
  grid-template-columns: 62px 1fr auto;
  align-items: center;
  gap: 15px;
  min-height: 94px;
  padding: 12px 14px;
  border: 2px solid var(--ink-soft);
  border-radius: 10px 4px 11px 5px;
  background-color: rgb(255 247 213 / 50%);
  background-image: var(--eic-genetic-box-url, none);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
  text-align: left;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.genetic-option:hover:not(:disabled) {
  transform: translate(-3px, -2px) rotate(-0.25deg);
  box-shadow: 5px 5px 0 rgb(39 63 49 / 25%);
  background-image: var(--eic-genetic-box-hovered-url, var(--eic-genetic-box-url, none));
}

.genetic-option.is-selected {
  background-color: #d5e3a9;
  background-image: var(--eic-genetic-box-clicked-url, var(--eic-genetic-box-url, none));
  box-shadow: inset 0 0 0 3px var(--moss), 5px 5px 0 rgb(39 63 49 / 25%);
}

.genetic-option:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.7);
}

.genetic-icon {
  width: 58px;
  height: 58px;
  border: 2px solid var(--ink);
  border-radius: 48% 52% 44% 56%;
  display: grid;
  place-items: center;
  background: var(--genetic-color, var(--sun));
  box-shadow: inset -7px -5px 0 rgb(0 0 0 / 14%);
  font-family: Georgia, serif;
  font-size: 1.7rem;
  font-weight: 900;
}

.genetic-copy strong {
  display: block;
  margin-bottom: 4px;
  font-family: Rockwell, Georgia, serif;
  font-size: 1.05rem;
}

.genetic-copy small {
  display: block;
  line-height: 1.35;
  color: #4b5a4e;
}

.genetic-stats {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 4px 10px;
  font-family: Consolas, monospace;
  font-size: 0.65rem;
  font-weight: 800;
  text-align: right;
}

.lock-mark {
  position: absolute;
  inset: 8px 8px auto auto;
  padding: 3px 6px;
  background: var(--ink);
  color: var(--paper);
  font-family: Consolas, monospace;
  font-size: 0.58rem;
}

.start-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 27px;
}

.control-note {
  max-width: 25ch;
  font-family: Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1.55;
  color: #536253;
}

.control-note-extra {
  display: block;
  margin-top: 0.35rem;
  color: rgb(245 226 177 / 78%);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.primary-button,
.secondary-button {
  position: relative;
  min-height: 48px;
  border: 3px solid var(--ink);
  border-radius: 4px 8px 5px 9px;
  padding: 10px 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 4px 5px 0 var(--ink);
  transition: transform 100ms ease, box-shadow 100ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  background: var(--sun);
}

.secondary-button {
  background: var(--paper-light);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 7px 0 var(--ink);
}

.primary-button:active,
.secondary-button:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.archive-stats,
.result-stats {
  display: grid;
  gap: 8px;
  margin: 20px 0;
}

.archive-stats div,
.result-stats div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 7px;
  border-bottom: 1px dashed rgb(39 55 45 / 40%);
}

.archive-stats dt,
.result-stats dt {
  font-size: 0.75rem;
  color: #596458;
}

.archive-stats dd,
.result-stats dd {
  margin: 0;
  font-family: Rockwell, Georgia, serif;
  font-size: 1.15rem;
  font-weight: 900;
}

.settings-fold {
  margin-top: 18px;
  border-top: 2px solid var(--ink);
}

.settings-fold summary {
  padding: 12px 0 8px;
  font-weight: 900;
  cursor: pointer;
}

.settings-fold label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  font-size: 0.75rem;
}

.settings-fold input[type="range"] {
  width: 92px;
  accent-color: var(--moss);
}

.settings-fold input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--moss);
}

.language-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  font-size: 0.75rem;
}

.compact-button {
  min-height: 34px;
  padding: 5px 9px;
  border-width: 2px;
  box-shadow: 2px 3px 0 var(--ink);
  font-size: 0.68rem;
}

.cleanroom-note {
  margin: 15px 0 0;
  font-family: Consolas, monospace;
  font-size: 0.58rem;
  line-height: 1.4;
  color: #677065;
}

.hud {
  position: absolute;
  z-index: 10;
  inset: 18px 20px auto;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) auto minmax(390px, 1fr);
  align-items: start;
  gap: 18px;
  pointer-events: none;
}

.hud-cluster {
  display: flex;
  gap: 10px;
  min-height: 68px;
  padding: 9px 11px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: rgb(248 228 178 / 92%);
  box-shadow: 4px 5px 0 rgb(13 31 23 / 55%);
}

.hud-cluster--actions {
  justify-content: end;
}

.portrait {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50% 44% 51% 46%;
  background: var(--sun);
  font-size: 1.5rem;
}

.meter-stack {
  display: grid;
  flex: 1;
  gap: 6px;
}

.meter-row {
  display: grid;
  grid-template-columns: 35px 1fr 62px;
  align-items: center;
  gap: 7px;
  font-family: Consolas, monospace;
  font-size: 0.63rem;
  font-weight: 800;
}

.meter {
  position: relative;
  height: 13px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: rgb(24 37 31 / 25%);
}

.meter i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: var(--moss-bright);
  transform-origin: left;
}

.meter--health i {
  background: var(--coral);
}

.meter--growth i {
  background: var(--water);
}

.run-ribbon {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 11px;
  padding: 8px 13px;
  border: 2px solid var(--ink);
  background: rgb(248 228 178 / 92%);
  box-shadow: 4px 5px 0 rgb(13 31 23 / 55%);
  font-family: Consolas, monospace;
  font-size: 0.65rem;
  transform: rotate(-0.6deg);
}

.run-ribbon strong {
  font-family: Rockwell, Georgia, serif;
  font-size: 1.08rem;
}

.skill-chip {
  position: relative;
  width: 78px;
  height: 48px;
  overflow: hidden;
  display: grid;
  place-content: center;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: #e9cd8d;
  text-align: center;
}

.skill-chip kbd {
  font-family: Consolas, monospace;
  font-size: 0.58rem;
  font-weight: 900;
}

.skill-chip span {
  font-size: 0.63rem;
  font-weight: 900;
}

.skill-chip i {
  position: absolute;
  inset: auto 0 0;
  height: 0;
  background: rgb(24 37 31 / 48%);
  transition: height 60ms linear;
}

.boss-bar {
  position: absolute;
  top: 82px;
  left: 50%;
  width: min(560px, 58vw);
  transform: translateX(-50%);
  padding: 8px 12px 10px;
  border: 2px solid var(--ink);
  background: rgb(248 228 178 / 94%);
  box-shadow: 4px 5px 0 rgb(13 31 23 / 55%);
}

.boss-bar__title {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-family: Rockwell, Georgia, serif;
  font-weight: 900;
}

.meter--boss {
  height: 16px;
}

.meter--boss i {
  background: linear-gradient(90deg, #a63436, #e75a42);
}

.icon-button {
  position: absolute;
  right: 0;
  top: 79px;
  width: 42px;
  height: 42px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 3px 4px 0 rgb(13 31 23 / 55%);
  font-weight: 900;
  cursor: pointer;
  pointer-events: auto;
}

.modal-layer {
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(8 20 15 / 68%);
  backdrop-filter: blur(5px) saturate(0.75);
}

.modal-card {
  width: min(980px, 94vw);
  padding: clamp(27px, 4vw, 48px);
  animation: card-arrive 240ms cubic-bezier(0.2, 0.9, 0.2, 1.2) both;
}

.compact-card,
.result-card {
  width: min(560px, 92vw);
  text-align: center;
}

.modal-card > p:not(.eyebrow) {
  color: #526052;
}

.evolution-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 28px;
}

.evolution-option {
  position: relative;
  min-height: 285px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 3px solid var(--ink);
  border-radius: 9px 4px 12px 5px;
  padding: 19px;
  background: #fff0bc;
  cursor: pointer;
  text-align: left;
  box-shadow: 5px 6px 0 rgb(27 49 36 / 28%);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.evolution-option::after {
  content: "";
  position: absolute;
  right: -35px;
  bottom: -40px;
  width: 130px;
  height: 130px;
  border: 18px double rgb(63 116 81 / 18%);
  border-radius: 50%;
}

.evolution-option:hover {
  transform: translateY(-8px) rotate(var(--tilt, -0.7deg));
  box-shadow: 8px 13px 0 rgb(27 49 36 / 32%);
}

.evolution-option:nth-child(2) {
  --tilt: 0.7deg;
}

.mutation-glyph {
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 44% 56% 49% 51%;
  background: var(--mutation-color, var(--moss-bright));
  box-shadow: inset -9px -7px 0 rgb(0 0 0 / 12%);
  font-family: Georgia, serif;
  font-size: 2rem;
  font-weight: 900;
}

.mutation-meta {
  display: flex;
  gap: 7px;
  margin-bottom: 8px;
  font-family: Consolas, monospace;
  font-size: 0.61rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mutation-meta span {
  padding: 3px 5px;
  border: 1px solid currentColor;
}

.evolution-option h3 {
  margin: 0 0 9px;
  font-family: Rockwell, Georgia, serif;
  font-size: 1.35rem;
}

.evolution-option p {
  flex: 1;
  margin: 0;
  line-height: 1.5;
  color: #536052;
}

.evolution-option strong {
  margin-top: 15px;
  font-family: Consolas, monospace;
  font-size: 0.68rem;
}

.button-row {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 25px;
}

.result-stats {
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 30px;
  text-align: left;
}

.toast {
  position: absolute;
  z-index: 35;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) rotate(-0.4deg);
  padding: 10px 15px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 4px 5px 0 rgb(13 31 23 / 55%);
  font-weight: 900;
  animation: toast-in 180ms ease both;
}

.modal-layer:not(.is-hidden) ~ .toast {
  display: none;
}

.mobile-controls {
  position: absolute;
  z-index: 11;
  inset: auto 18px max(18px, env(safe-area-inset-bottom));
  display: none;
  align-items: end;
  justify-content: space-between;
  pointer-events: none;
}

.touch-pad {
  position: relative;
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  border: 2px solid rgb(245 226 177 / 75%);
  border-radius: 50%;
  background: rgb(19 38 31 / 38%);
  color: rgb(255 240 197 / 70%);
  font-family: Consolas, monospace;
  font-size: 0.65rem;
  pointer-events: auto;
  touch-action: none;
}

.touch-pad i {
  position: absolute;
  width: 48px;
  height: 48px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: rgb(245 226 177 / 82%);
  transform: translate(var(--stick-x, 0), var(--stick-y, 0));
}

.touch-actions {
  display: grid;
  grid-template-columns: repeat(2, 48px);
  gap: 8px;
  pointer-events: auto;
}

.touch-actions button {
  width: 48px;
  height: 48px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: rgb(245 226 177 / 88%);
  box-shadow: 3px 4px 0 rgb(13 31 23 / 50%);
  font-weight: 900;
  touch-action: none;
}

.touch-right {
  display: flex;
  align-items: end;
  gap: 10px;
  pointer-events: none;
}

.touch-pad--aim {
  width: 120px;
  height: 120px;
  border-color: rgb(244 201 91 / 88%);
  background: rgb(47 72 48 / 48%);
}

.touch-pad--aim i {
  background: rgb(244 201 91 / 90%);
}

@keyframes card-arrive {
  from { opacity: 0; transform: translateY(20px) scale(0.97) rotate(-0.5deg); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translateX(-50%) rotate(-0.4deg); }
}

@media (max-width: 1180px) {
  .menu-layout {
    grid-template-columns: minmax(260px, 0.72fr) minmax(430px, 1.15fr);
  }

  .archive-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    align-items: center;
    gap: 20px;
  }

  .archive-card .eyebrow,
  .archive-card h2,
  .archive-card .cleanroom-note {
    display: none;
  }

  .archive-stats {
    grid-template-columns: repeat(4, 1fr);
    margin: 0;
  }

  .settings-fold {
    margin: 0;
    border: 0;
  }

  .hud {
    grid-template-columns: 1fr auto;
  }

  .hud-cluster--actions {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (max-width: 780px) {
  .title-lockup {
    top: 43%;
    width: 94vw;
    gap: 22px;
  }

  .title-wordmark {
    font-size: clamp(3.2rem, 17vw, 5.8rem);
    -webkit-text-stroke-width: 5px;
    filter: drop-shadow(0 0 0 #eee4cf) drop-shadow(0 6px 0 #101c20);
  }

  .title-eyes {
    top: -72px;
    gap: 38px;
  }

  .title-eyes i {
    width: 30px;
    height: 72px;
    border-width: 5px;
    box-shadow: 0 0 0 5px #e7dfc9;
  }

  .title-eyes i::before {
    border-width: 5px;
  }

  .title-claw {
    width: 64px;
    height: 52px;
    border-width: 5px;
    box-shadow: 0 0 0 4px #e7dfc9;
  }

  .title-claw--left {
    right: calc(100% - 38px);
  }

  .title-claw--right {
    left: calc(100% - 38px);
  }

  .title-subtitle {
    max-width: 88vw;
    font-size: clamp(1.55rem, 8vw, 2.7rem);
    line-height: 1.18;
    -webkit-text-stroke-width: 2px;
    text-shadow: 0 4px 0 #f3dfae;
  }

  .title-prompt {
    bottom: max(42px, calc(env(safe-area-inset-bottom) + 24px));
    font-size: clamp(1rem, 5.2vw, 1.45rem);
  }

  .screen--language {
    place-items: stretch;
    padding:
      max(14px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }

  .screen--language::before {
    inset: 8px;
    border-width: 3px;
    box-shadow: inset 0 0 0 5px rgb(242 223 172 / 15%);
  }

  .language-card {
    width: 100%;
    min-height: 0;
    max-height: calc(100dvh - 28px);
    padding: 42px 20px 24px;
    overflow: hidden;
    box-shadow: 6px 7px 0 rgb(48 31 24 / 32%);
  }

  .language-card::before {
    inset: 9px;
  }

  .language-card > h1 {
    font-size: clamp(2.05rem, 11vw, 3.35rem);
    line-height: 1.05;
  }

  .language-card > .eyebrow {
    margin-bottom: 5px;
    font-size: 0.64rem;
  }

  .language-note {
    margin: 8px auto 16px;
    font-size: 0.9rem;
  }

  .language-options {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-auto-flow: row;
    grid-auto-rows: minmax(52px, auto);
    gap: 2px;
    max-height: calc(100dvh - 226px);
    padding: 2px 5px 12px 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .language-option {
    gap: 14px;
    min-height: 52px;
    padding: 7px 12px;
    font-size: clamp(1.04rem, 5.2vw, 1.35rem);
  }

  .screen--menu {
    padding: 24px 16px 46px;
  }

  .menu-layout {
    display: block;
  }

  .title-block {
    margin: 15px 4px 42px;
  }

  .title-block h1 {
    font-size: clamp(4.5rem, 23vw, 7rem);
    transform: rotate(-2deg) scaleX(0.78);
  }

  .lede {
    max-width: none;
  }

  .start-card {
    min-height: 0;
    padding: 24px 18px;
  }

  .archive-card {
    display: block;
    margin-top: 24px;
  }

  .archive-card .eyebrow,
  .archive-card h2,
  .archive-card .cleanroom-note {
    display: block;
  }

  .archive-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .genetic-option {
    grid-template-columns: 54px 1fr;
  }

  .genetic-stats {
    grid-column: 1 / -1;
    display: flex;
    justify-content: end;
  }

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

  .primary-button {
    justify-content: space-between;
  }

  .hud {
    inset: max(8px, env(safe-area-inset-top)) 8px auto;
    display: flex;
    align-items: start;
    gap: 7px;
  }

  .hud-cluster--vitals {
    min-width: 0;
    flex: 1;
  }

  .portrait,
  .meter-label,
  .meter-row output,
  .hud-cluster--actions,
  .run-ribbon span {
    display: none;
  }

  .meter-row {
    grid-template-columns: 1fr;
  }

  .run-ribbon {
    grid-template-columns: auto;
    min-height: 55px;
  }

  .icon-button {
    position: static;
    flex: 0 0 auto;
  }

  .boss-bar {
    top: 68px;
    width: calc(100vw - 26px);
  }

  .evolution-options {
    grid-template-columns: 1fr;
    max-height: 63vh;
    overflow: auto;
    padding: 3px 7px 14px 3px;
  }

  .evolution-option {
    min-height: 184px;
    display: grid;
    grid-template-columns: 70px 1fr;
    column-gap: 14px;
  }

  .mutation-glyph {
    grid-row: 1 / span 4;
    width: 62px;
    height: 62px;
  }

  .evolution-option p,
  .evolution-option strong {
    grid-column: 2;
  }

  .mobile-controls {
    display: flex;
  }
}

@media (pointer: coarse) {
  .mobile-controls:not(.is-hidden) {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Archive navigation and Selective Pressure */
.screen--menu {
  padding: 0;
  background:
    radial-gradient(circle at 86% 12%, rgb(238 185 65 / 18%), transparent 23%),
    linear-gradient(112deg, #0b1e17 0 31%, #12291f 31.2% 100%);
}

.menu-layout {
  min-height: 100%;
  max-width: none;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(285px, 360px) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
}

.menu-sidebar {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(32px, 4vw, 62px) clamp(24px, 3vw, 42px) 28px;
  border-right: 3px solid #07130e;
  background:
    linear-gradient(155deg, rgb(235 174 54 / 12%), transparent 31%),
    repeating-linear-gradient(0deg, transparent 0 32px, rgb(129 174 107 / 5%) 33px 34px),
    #0a1b14;
  box-shadow: 18px 0 44px rgb(0 0 0 / 24%);
}

.menu-sidebar::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed rgb(210 224 174 / 18%);
  pointer-events: none;
}

.menu-sidebar .title-block {
  position: relative;
  z-index: 1;
  min-width: 0;
  align-self: stretch;
  margin-bottom: clamp(28px, 5vh, 58px);
}

.menu-sidebar .title-block h1 {
  font-size: clamp(4rem, 6vw, 6.8rem);
  transform: rotate(-2deg) scaleX(0.62);
}

.menu-sidebar .subtitle {
  margin-bottom: 0;
}

.menu-navigation {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 7px;
}

.menu-nav-button {
  position: relative;
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 30px 1fr 20px;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid rgb(202 221 177 / 22%);
  padding: 8px 9px;
  background: transparent;
  background-image: var(--eic-menu-box-url, url('./assets/game_menu_box.png'));
  background-size: 100% 100%;
  background-repeat: no-repeat;
  color: #b8c8ad;
  cursor: pointer;
  text-align: left;
  transition: color 140ms ease, padding 140ms ease, background 140ms ease;
}

.menu-nav-button::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--sun);
  transition: width 140ms ease;
}

.menu-nav-button > span,
.menu-nav-button > i {
  position: relative;
  font-family: Consolas, monospace;
  font-size: 0.62rem;
  font-style: normal;
  opacity: 0.62;
}

.menu-nav-button > strong {
  position: relative;
  font-family: Rockwell, "Bookman Old Style", Georgia, "Microsoft YaHei", serif;
  font-size: clamp(1rem, 1.5vw, 1.28rem);
  letter-spacing: 0.015em;
}

.menu-nav-button > i {
  transform: translateX(-8px);
  opacity: 0;
  transition: transform 140ms ease, opacity 140ms ease;
}

.menu-nav-button:hover,
.menu-nav-button:focus-visible,
.menu-nav-button.is-active {
  padding-left: 16px;
  background: linear-gradient(90deg, rgb(239 184 59 / 12%), transparent);
  color: #fff0bd;
  outline: 0;
}

.menu-nav-button:hover,
.menu-nav-button:focus-visible {
  background-image: var(--eic-menu-box-hovered-url, url('./assets/game_menu_box_hovered.png'));
}

.menu-nav-button:active,
.menu-nav-button.is-active {
  background-image: var(--eic-menu-box-clicked-url, url('./assets/game_menu_box_clicked.png'));
}

.menu-nav-button:hover::before,
.menu-nav-button:focus-visible::before,
.menu-nav-button.is-active::before {
  width: 4px;
}

.menu-nav-button:hover > i,
.menu-nav-button:focus-visible > i,
.menu-nav-button.is-active > i {
  transform: none;
  opacity: 1;
}

.menu-nav-button--pressure {
  margin-top: 13px;
  border: 2px solid rgb(235 189 77 / 55%);
  color: #efd47f;
}

.menu-sidebar-footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 30px;
}

.menu-sidebar-footer .save-status {
  display: inline-block;
  border-color: #98bd78;
  color: #b8d99c;
}

.menu-sidebar-footer .cleanroom-note {
  max-width: 34ch;
  color: #758878;
}

.menu-stage {
  min-width: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: clamp(24px, 4vw, 62px) clamp(22px, 5vw, 84px) 52px;
}

.menu-stage-topline {
  max-width: 1180px;
  margin: 0 auto clamp(22px, 4vh, 42px);
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 28px;
}

.menu-stage-topline .lede {
  color: #bccbb6;
}

.selected-pressure-chip {
  flex: 0 0 auto;
  min-width: 178px;
  display: grid;
  gap: 2px;
  border: 2px solid #e0bb5e;
  border-radius: 2px 8px 3px 7px;
  padding: 9px 14px;
  background: #e6ca77;
  color: #18271e;
  box-shadow: 5px 6px 0 #07150f;
  cursor: pointer;
  text-align: left;
  transform: rotate(0.6deg);
}

.selected-pressure-chip small {
  font-family: Consolas, monospace;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.selected-pressure-chip strong {
  font-family: Rockwell, Georgia, serif;
  font-size: 1.05rem;
}

.menu-panel {
  max-width: 1180px;
  margin: 0 auto;
  color: var(--paper-light);
  animation: menu-panel-arrive 180ms ease both;
}

.panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(20px, 3vh, 34px);
}

.panel-heading h2 {
  margin: 0;
  font-family: Rockwell, "Bookman Old Style", Georgia, "Microsoft YaHei", serif;
  font-size: clamp(2.6rem, 5vw, 5.5rem);
  line-height: 0.9;
  letter-spacing: -0.055em;
  color: #f5e4ad;
  text-shadow: 5px 6px 0 #0a1812;
}

.panel-heading > div > p:not(.eyebrow) {
  max-width: 62ch;
  margin: 14px 0 0;
  color: #b3c3ae;
  line-height: 1.6;
}

.new-run-grid {
  display: grid;
  grid-template-columns: minmax(430px, 1.45fr) minmax(230px, 0.62fr);
  align-items: start;
  gap: clamp(18px, 3vw, 32px);
}

.menu-panel .journal-card {
  color: var(--ink);
}

.menu-panel .start-card {
  min-height: 0;
  padding: clamp(22px, 3vw, 36px);
}

.menu-panel .archive-card {
  align-self: stretch;
  padding: 25px 22px;
}

.card-heading h3,
.archive-card h3,
.pressure-detail h3,
.settings-card h3 {
  margin: 0;
  font-family: Rockwell, "Bookman Old Style", Georgia, serif;
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
}

.menu-panel .start-footer {
  margin-top: 28px;
  padding: 18px 2px 0;
  border-top: 1px solid rgb(222 236 199 / 22%);
}

.menu-panel .control-note {
  color: #a8baa3;
}

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

.challenge-card,
.codex-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 18px;
  border: 2px solid #2c4c39;
  border-radius: 3px 11px 4px 8px;
  padding: 20px;
  background:
    repeating-linear-gradient(0deg, transparent 0 27px, rgb(89 128 89 / 7%) 28px 29px),
    rgb(15 38 28 / 94%);
  box-shadow: 6px 7px 0 #07150f;
  color: #e8dfb7;
}

.challenge-card:nth-child(3n + 2),
.codex-card:nth-child(even) {
  transform: rotate(0.35deg);
}

.challenge-mark,
.codex-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 2px solid #d7b457;
  border-radius: 48% 52% 44% 56%;
  background: #203d2b;
  color: #f1c95b;
  font-family: Georgia, serif;
  font-size: 1.6rem;
}

.challenge-card h3,
.codex-card h3 {
  margin: 4px 0 7px;
  font-family: Rockwell, Georgia, serif;
  font-size: 1.25rem;
}

.challenge-card p,
.codex-card p {
  margin: 0;
  color: #aebda8;
  line-height: 1.55;
}

.challenge-status {
  display: inline-block;
  border: 1px solid #7fac76;
  padding: 2px 6px;
  color: #a9d097;
  font-family: Consolas, monospace;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.codex-card-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.codex-card-heading strong {
  font-family: Consolas, monospace;
  font-size: 0.72rem;
  color: #f0cb68;
}

.codex-meter {
  position: relative;
  height: 8px;
  overflow: hidden;
  display: block;
  margin-top: 16px;
  border: 1px solid #81977d;
  background: #091a12;
}

.codex-meter i {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--codex-progress, 0) * 100%);
  background: linear-gradient(90deg, #6fae76, #e2c45f);
}

.settings-card {
  width: min(720px, 100%);
  display: grid;
  gap: 0;
  padding: clamp(24px, 4vw, 42px);
}

.settings-card label,
.settings-card .language-setting-row {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px dashed rgb(39 55 45 / 36%);
  font-weight: 800;
}

.settings-card input[type="range"] {
  width: min(260px, 45vw);
  accent-color: var(--moss);
}

.settings-card input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--moss);
}

.pressure-heading {
  align-items: start;
}

.pressure-progress {
  min-width: 160px;
  display: grid;
  gap: 3px;
  border: 2px solid #e0bb5e;
  padding: 9px 13px;
  background: rgb(10 28 20 / 72%);
  color: #f0d37e;
  transform: rotate(0.7deg);
}

.pressure-progress small {
  font-family: Consolas, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.pressure-progress strong {
  font-family: Rockwell, Georgia, serif;
  font-size: 1rem;
}

.pressure-layout {
  display: grid;
  grid-template-columns: minmax(430px, 1.25fr) minmax(300px, 0.75fr);
  align-items: start;
  gap: clamp(18px, 3vw, 34px);
}

.pressure-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(72px, 1fr));
  gap: 9px;
}

.pressure-option {
  position: relative;
  min-height: 92px;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  gap: 6px;
  border: 2px solid #47664e;
  border-radius: 2px 8px 3px 6px;
  padding: 9px;
  background: #132c20;
  color: #cad5b9;
  cursor: pointer;
  text-align: left;
  box-shadow: 3px 4px 0 #07150f;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.pressure-option--exploration {
  grid-column: span 2;
}

.pressure-option small {
  font-family: Consolas, monospace;
  font-size: 0.6rem;
  color: #83ae7e;
}

.pressure-option strong {
  font-family: Rockwell, Georgia, "Microsoft YaHei", serif;
  font-size: 0.82rem;
  line-height: 1.15;
}

.pressure-option i {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #80b57b;
  font-size: 0.55rem;
}

.pressure-option:hover:not([aria-disabled="true"]),
.pressure-option:focus-visible,
.pressure-option.is-selected {
  z-index: 1;
  border-color: #efd174;
  background: #294e34;
  outline: 0;
  transform: translate(-2px, -2px) rotate(-0.25deg);
}

.pressure-option.is-selected {
  box-shadow: inset 0 0 0 2px #e9c75f, 5px 6px 0 #07150f;
  color: #fff0b8;
}

.pressure-option[aria-disabled="true"] {
  border-color: #273b2e;
  background: #0d2017;
  color: #657268;
  cursor: not-allowed;
  filter: saturate(0.45);
}

.pressure-option[aria-disabled="true"] i {
  color: #805f57;
}

.pressure-detail {
  position: sticky;
  top: 0;
  min-height: 440px;
  padding: clamp(22px, 3vw, 34px);
}

.pressure-detail h3 {
  font-size: clamp(1.9rem, 3vw, 3rem);
}

.pressure-detail > p:not(.eyebrow) {
  line-height: 1.55;
  color: #526052;
}

.pressure-detail h4 {
  margin: 22px 0 8px;
  font-family: Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.pressure-detail ul {
  max-height: 215px;
  overflow-y: auto;
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0 4px 0 22px;
  color: #394a3d;
  font-size: 0.78rem;
  line-height: 1.4;
}

.pressure-unlock-copy {
  border-top: 1px dashed rgb(39 55 45 / 36%);
  padding-top: 12px;
  font-family: Consolas, monospace;
  font-size: 0.66rem;
}

.pressure-detail .primary-button {
  width: 100%;
  justify-content: space-between;
  margin-top: 12px;
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.7);
}

.run-ribbon {
  grid-template-columns: auto auto auto auto;
}

.pressure-badge {
  border-left: 1px solid rgb(37 55 43 / 36%);
  padding-left: 10px;
  color: #865720;
  font-weight: 900;
}

@keyframes menu-panel-arrive {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 1180px) {
  .menu-layout {
    grid-template-columns: minmax(245px, 300px) minmax(0, 1fr);
  }

  .menu-stage {
    padding-inline: clamp(20px, 4vw, 48px);
  }

  .new-run-grid,
  .pressure-layout {
    grid-template-columns: 1fr;
  }

  .menu-panel .archive-card {
    display: block;
    grid-column: auto;
  }

  .pressure-detail {
    position: relative;
    min-height: 0;
  }

  .pressure-options {
    grid-template-columns: repeat(6, minmax(64px, 1fr));
  }
}

@media (max-width: 780px) {
  .screen--menu {
    overflow-y: auto;
    padding: 0 0 max(34px, env(safe-area-inset-bottom));
  }

  .menu-layout {
    min-height: 100%;
    display: block;
  }

  .menu-sidebar {
    min-height: 0;
    overflow: visible;
    padding: max(22px, env(safe-area-inset-top)) 16px 16px;
    border-right: 0;
    border-bottom: 3px solid #07130e;
  }

  .menu-sidebar::before {
    inset: 7px;
  }

  .menu-sidebar .title-block {
    margin: 0 4px 18px;
  }

  .menu-sidebar .title-block .eyebrow,
  .menu-sidebar .subtitle,
  .menu-sidebar-footer {
    display: none;
  }

  .menu-sidebar .title-block h1 {
    font-size: clamp(3.2rem, 18vw, 5rem);
    transform: rotate(-2deg) scaleX(0.76);
  }

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

  .menu-nav-button,
  .menu-nav-button--pressure {
    min-height: 45px;
    margin: 0;
    grid-template-columns: 22px 1fr;
    border: 1px solid rgb(202 221 177 / 20%);
    padding: 6px 8px;
  }

  .menu-nav-button--pressure {
    grid-column: 1 / -1;
  }

  .menu-nav-button > strong {
    font-size: 0.86rem;
  }

  .menu-nav-button > i {
    display: none;
  }

  .menu-stage {
    max-height: none;
    overflow: visible;
    padding: 22px 15px 40px;
  }

  .menu-stage-topline {
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
  }

  .menu-stage-topline .lede {
    font-size: 0.82rem;
    line-height: 1.45;
  }

  .selected-pressure-chip {
    min-width: 116px;
    padding: 7px 9px;
  }

  .selected-pressure-chip strong {
    font-size: 0.82rem;
  }

  .panel-heading {
    display: block;
  }

  .panel-heading h2 {
    font-size: clamp(2.45rem, 13vw, 4rem);
  }

  .panel-heading .feature-stamps {
    margin-top: 18px;
  }

  .new-run-grid,
  .challenge-list,
  .codex-list,
  .pressure-layout {
    grid-template-columns: 1fr;
  }

  .menu-panel .start-card,
  .menu-panel .archive-card,
  .settings-card,
  .pressure-detail {
    padding: 22px 17px;
  }

  .menu-panel .archive-card {
    margin-top: 0;
  }

  .challenge-card,
  .codex-card {
    grid-template-columns: 48px 1fr;
    gap: 13px;
    padding: 16px;
  }

  .challenge-mark,
  .codex-mark {
    width: 46px;
    height: 46px;
    font-size: 1.2rem;
  }

  .settings-card label,
  .settings-card .language-setting-row {
    min-height: 58px;
  }

  .pressure-heading .pressure-progress {
    width: max-content;
    margin-top: 17px;
  }

  .pressure-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .pressure-option {
    min-height: 82px;
    padding: 8px;
  }

  .pressure-option--exploration {
    grid-column: span 3;
  }

  .pressure-detail ul {
    max-height: none;
  }

  .run-ribbon {
    grid-template-columns: auto;
  }

  .run-ribbon .pressure-badge {
    display: block;
    border-left: 0;
    border-top: 1px solid rgb(37 55 43 / 26%);
    padding: 4px 0 0;
    text-align: center;
  }

  .result-stats {
    grid-template-columns: 1fr 1fr;
  }
}
