:root {
  color-scheme: dark;
  --bg: #10191b;
  --panel: #142023;
  --line: #2b393a;
  --muted: #8c9d9c;
  --text: #edf0e8;
  --lime: #d4edaf;
  --amber: #ebbc76;
  --coral: #e79282;
  --font:
    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(
    ellipse at 42% 0%,
    #23332b44,
    transparent 50%
  );
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
a {
  color: inherit;
  text-decoration: none;
}
/* Translated out of the viewport rather than offset off-screen, so it cannot
   add horizontal scroll to the page. */
.skip-link {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--lime);
  color: #1a3022;
  font-size: 12px;
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus-visible {
  transform: none;
}
button,
a,
canvas {
  outline-offset: 5px;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--lime);
}
button {
  touch-action: manipulation;
}
button svg,
svg.icon {
  pointer-events: none;
}
.icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.page-shell {
  max-width: 1400px;
  margin: auto;
  padding: 0 60px;
}
.site-header {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 19px;
  letter-spacing: -0.7px;
  font-weight: 650;
}
.brand img {
  border: 1px solid #33403c;
  border-radius: 10px;
}
.brand-dot {
  color: var(--lime);
}
nav {
  display: flex;
  gap: 30px;
  align-items: center;
}
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: none;
  padding: 8px 0;
  color: #b4c1bc;
  font-size: 12px;
  transition: color 0.15s ease;
}
.text-button:hover {
  color: var(--lime);
}
.source-link {
  font-size: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  border: 1px solid #46534c;
  border-radius: 6px;
  color: #dce3d5;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}
.source-link:hover {
  background: #d4edaf12;
  border-color: var(--lime);
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 42px 0 36px;
  gap: 30px;
}
.eyebrow,
.tiny-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1.9px;
  color: var(--muted);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 17px;
  color: #b0c1a8;
}
.status-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--lime);
  border-radius: 50%;
  box-shadow: 0 0 10px #d4edaf33;
}
.intro h1 {
  font-size: clamp(38px, 4.1vw, 57px);
  line-height: 1.06;
  letter-spacing: -2.6px;
  font-weight: 500;
  margin: 0;
  text-wrap: balance;
}
.intro h1 span {
  color: var(--lime);
}
.intro-note {
  padding: 0 1px 2px 0;
  min-width: 270px;
}
.intro-note .tiny-label {
  font-size: 9px;
  letter-spacing: 1.4px;
}
.intro-note p {
  font-size: 13px;
  line-height: 1.85;
  color: #adbab5;
  margin: 13px 0 0;
}
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: 23px;
  align-items: stretch;
}
.game-column {
  min-width: 0;
}
.cavern-frame {
  border: 1px solid #3a4c46;
  border-radius: 10px;
  overflow: hidden;
  background: #121c1d;
  box-shadow: 0 16px 60px #0002;
}
.map-header {
  height: 53px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 21px;
  color: #d1dcd1;
  background: #1c2929;
  font-size: 12px;
}
.map-header > span {
  display: flex;
  align-items: center;
  gap: 13px;
}
.map-header .tiny-label {
  color: var(--lime);
  letter-spacing: 1px;
}
.header-divider {
  height: 13px;
  width: 1px;
  background: #425148;
}
.live-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.3px;
  color: #b7c3b2;
}
.live-label .status-dot {
  width: 4px;
  height: 4px;
}
.canvas-wrap {
  position: relative;
  background: #0e1719;
  aspect-ratio: 5/3;
  overflow: hidden;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline-offset: -3px;
  touch-action: pan-y;
}
.map-footer {
  min-height: 61px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: #1b2828;
  border-top: 1px solid #314039;
  gap: 12px;
}
.keyboard-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #95a59f;
  font-size: 10px;
}
.key-group {
  display: flex;
  gap: 4px;
}
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 25px;
  border: 1px solid #46554f;
  border-bottom-width: 3px;
  border-radius: 4px;
  font: 10px var(--mono);
  color: #c5cec2;
  background: #293631;
}
.map-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}
.icon-button {
  border: 0;
  background: none;
  width: 28px;
  height: 32px;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #a5b5a8;
  position: relative;
  transition: color 0.15s ease;
}
.icon-button:hover {
  color: var(--lime);
}
.sound-strike {
  width: 22px;
  height: 1px;
  background: currentColor;
  position: absolute;
  transform: rotate(-50deg);
  box-shadow: 0 1px #1b2828;
}
.icon-button[aria-pressed="true"] .sound-strike {
  display: none;
}
.action-divider {
  height: 17px;
  width: 1px;
  background: #425044;
}
.restart-button {
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #c6d0be;
  padding: 3px 0;
  transition: color 0.15s ease;
}
.restart-button:hover {
  color: var(--lime);
}
.restart-button .icon {
  width: 15px;
  height: 15px;
}
.below-map {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  font-size: 10px;
  color: #82958c;
  padding: 16px 2px 0;
}
.below-map .text-button {
  font-size: 10px;
  padding: 0;
}
.small-diamond {
  color: #aabf94;
  font-size: 18px;
  vertical-align: -1px;
  margin-right: 7px;
}
.expedition {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(135deg, #1c2a2944, transparent);
  padding: 22px 23px 17px;
  align-self: start;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 22px;
}
.panel-heading h2 {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}
.panel-heading .tiny-label {
  font-size: 9px;
  letter-spacing: 1px;
}
.stat-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #afbeb3;
}
.stat-heading > span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
}
.stat-value {
  font-size: 23px;
  color: var(--lime);
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.8px;
  font-variant-numeric: tabular-nums;
}
.stat-denominator {
  font-size: 14px;
  color: #8a9b89;
  letter-spacing: 0;
}
.crystal-slots {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 16px 0 13px;
}
.crystal-slot {
  height: 41px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e2b2a;
  border: 1px solid #37443e;
  border-radius: 5px;
  transition:
    background 0.25s,
    border-color 0.25s;
}
.crystal-slot svg {
  width: 18px;
  height: 25px;
  fill: #2f3c36;
  stroke: #62735b;
  stroke-width: 1;
}
.crystal-slot.found {
  background: #344632;
  border-color: #92b579;
}
.crystal-slot.found svg {
  fill: #d4edaf;
  stroke: #e5ffd3;
  filter: drop-shadow(0 0 5px #bcffab55);
}
.stat-caption {
  color: #83958b;
  font-size: 10px;
  margin: 0;
  line-height: 1.6;
}
.resource-section {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 18px;
}
.flame-icon {
  color: var(--amber);
  width: 15px;
  height: 18px;
}
.resource-section .stat-value {
  color: var(--amber);
  font-size: 22px;
}
.stat-unit {
  font-size: 10px;
  letter-spacing: 0;
  color: #8d9c8d;
}
.torch-track {
  height: 5px;
  background: #354037;
  border-radius: 5px;
  margin: 13px 0 10px;
  overflow: hidden;
}
.torch-track > span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #a7814d, #ebc389);
  border-radius: 5px;
  transform-origin: left center;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}
.torch-track.low > span {
  background: #e79282;
}
.health-section {
  padding-top: 16px;
  margin-top: 17px;
}
.small-value {
  font-family: var(--mono);
  color: #94a28f;
  font-size: 11px;
}
.hearts {
  display: flex;
  gap: 10px;
  margin-top: 13px;
}
.hearts .icon {
  width: 23px;
  height: 23px;
  fill: #e3a193;
  stroke: none;
  transition: fill 0.25s ease;
}
.hearts .empty {
  fill: #3b453f;
}
.journal {
  padding: 16px 14px 12px;
  border: 1px solid #3a493b;
  border-radius: 6px;
  background: #27322466;
  margin-top: 23px;
  min-height: 127px;
}
.journal .tiny-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #b0c298;
  display: flex;
  align-items: center;
  gap: 6px;
}
.journal-dot {
  width: 4px;
  height: 4px;
  background: #c6d5a6;
  border-radius: 1px;
}
.journal p {
  color: #c7d0bd;
  font-size: 11px;
  line-height: 1.7;
  margin: 10px 0 13px;
  min-height: 36px;
}
.journal-position {
  font: 9px var(--mono);
  letter-spacing: 1px;
  color: #86997f;
}
.best-score {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 19px;
  padding: 0 1px;
  font: 9px var(--mono);
  letter-spacing: 1px;
  color: #84917f;
}
.best-score strong {
  margin-left: auto;
  color: #c9d7b6;
  font: 20px var(--font);
  letter-spacing: -1px;
}
.best-unit {
  letter-spacing: 0;
}
.field-guide {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 23px;
  padding: 31px 0 28px;
  margin-top: 27px;
  border-top: 1px solid var(--line);
  align-items: center;
}
.guide-heading .tiny-label {
  font-size: 9px;
  letter-spacing: 1.2px;
}
.guide-heading h2 {
  margin: 8px 0 0;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.3px;
}
.guide-item {
  display: flex;
  align-items: center;
  gap: 15px;
}
.guide-item h3 {
  font-size: 12px;
  font-weight: 500;
  margin: 0 0 5px;
  color: #cbd5c3;
}
.guide-item p {
  font-size: 10px;
  color: #849487;
  margin: 0;
}
.guide-art {
  width: 39px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.crystal-art {
  font-size: 32px;
  color: #c6e2a1;
  text-shadow: 0 0 24px #cdffa847;
}
.spikes-art {
  font-size: 24px;
  letter-spacing: -8px;
  color: #a6b2a9;
  text-shadow: 2px 3px #4e615a;
}
.potion-art {
  position: relative;
}
.potion-art:before {
  content: "";
  width: 11px;
  height: 8px;
  background: #a4b599;
  position: absolute;
  top: 3px;
  border-radius: 1px;
  box-shadow: 0 5px #5d7d6b;
}
.potion-art span {
  width: 23px;
  height: 25px;
  background: linear-gradient(0deg, #abd2a1 55%, #6f9488 55%);
  border: 3px solid #82ab94;
  border-radius: 5px 5px 8px 8px;
  margin-top: 8px;
  box-shadow: 0 0 17px #d4edaf16;
}
.site-footer {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 21px 0 26px;
  color: #788a7f;
  font-size: 10px;
}
.site-footer .text-button {
  font-size: 10px;
  color: #8c9d90;
  gap: 8px;
}
.site-footer .icon {
  width: 13px;
  height: 13px;
}
.footer-edition {
  font: 9px var(--mono);
  letter-spacing: 1px;
}
.footer-edition span {
  font-size: 18px;
  margin-left: 18px;
  color: #9cb58c;
}
.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #08121166;
  backdrop-filter: blur(1px);
  padding: 18px;
}
.game-overlay[hidden] {
  display: none;
}
.overlay-card {
  width: 315px;
  text-align: center;
  padding: 25px 24px 21px;
  border-radius: 9px;
  border: 1px solid #8ca77a66;
  background: linear-gradient(145deg, #21332ef5, #152725f5);
  box-shadow: 0 20px 70px #0007;
}
.overlay-gem {
  display: inline-flex;
  width: 30px;
  height: 33px;
  align-items: center;
  justify-content: center;
  margin-bottom: 7px;
}
.overlay-gem svg {
  width: 27px;
  height: 33px;
  fill: #c9e9a1;
  stroke: #edffd7;
  stroke-width: 0.65;
  filter: drop-shadow(0 0 10px #e1ffaa44);
}
.overlay-card .tiny-label {
  font-size: 9px;
  color: #a8bf93;
  letter-spacing: 1.4px;
  margin: 3px 0 12px;
}
.overlay-card h2 {
  font-size: 30px;
  font-weight: 450;
  letter-spacing: -1px;
  line-height: 1.1;
  margin: 0 0 12px;
  text-wrap: balance;
}
.overlay-card > p:not(.tiny-label):not(.overlay-footnote) {
  font-size: 11px;
  line-height: 1.8;
  color: #acbda9;
  margin: 0 0 18px;
}
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--lime);
  border: 1px solid var(--lime);
  color: #1a3022;
  padding: 12px 17px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  transition:
    background 0.15s,
    transform 0.15s;
  text-decoration: none;
}
.primary-button:hover {
  background: #e7ffbf;
  transform: translateY(-1px);
}
.primary-button:active {
  transform: translateY(1px);
}
.overlay-card .primary-button {
  width: 100%;
}
.overlay-footnote {
  font-size: 9px;
  color: #93a98f;
  margin: 14px -8px 0;
}
.result-stats {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin: 10px 0 20px;
}
.result-stats[hidden] {
  display: none;
}
.result-stats strong {
  display: block;
  font-size: 26px;
  font-weight: 500;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
}
.result-stats span {
  font: 9px var(--mono);
  color: #a5b89c;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.pickup-label {
  position: absolute;
  pointer-events: none;
  color: #e2ffb7;
  font: 600 15px var(--font);
  text-shadow: 0 2px 6px #000;
  opacity: 0;
  transform: translate(-50%, -50%);
  z-index: 2;
  white-space: nowrap;
}
.pickup-label.active {
  animation: pickup 1s ease-out forwards;
}
@keyframes pickup {
  0% {
    opacity: 1;
    translate: 0 0;
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    translate: 0 -30px;
  }
}
dialog {
  border: 1px solid #52644b;
  border-radius: 12px;
  padding: 35px;
  background: #1b2a27;
  color: var(--text);
  width: min(510px, calc(100% - 32px));
  box-shadow: 0 30px 100px #0007;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #081311bd;
  backdrop-filter: blur(5px);
}
dialog[open] {
  animation: dialog-in 0.19s cubic-bezier(0.16, 0.84, 0.3, 1);
}
dialog[open]::backdrop {
  animation: backdrop-in 0.19s ease-out;
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(9px) scale(0.985);
  }
}
@keyframes backdrop-in {
  from {
    opacity: 0;
  }
}
dialog h2 {
  font-size: 32px;
  letter-spacing: -1px;
  line-height: 1.15;
  font-weight: 450;
  margin: 0 0 18px;
  text-wrap: balance;
}
dialog > p:not(.eyebrow) {
  color: #acb9a7;
  font-size: 13px;
  line-height: 1.8;
}
dialog .eyebrow {
  font-size: 9px;
  margin-bottom: 16px;
}
dialog .primary-button {
  margin-top: 14px;
}
.dialog-close {
  position: absolute;
  right: 17px;
  top: 16px;
}
.guide-rules {
  list-style: none;
  padding: 0;
  margin: 25px 0 14px;
}
.guide-rules li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 15px;
  border-top: 1px solid #354739;
  padding: 13px 0;
  font-size: 12px;
}
.guide-rules strong {
  font-weight: 500;
  color: #d3e5b9;
}
.guide-rules span {
  color: #a7b6a3;
  font-size: 11px;
  line-height: 1.7;
}
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 23px;
  flex-wrap: wrap;
}
.tech-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 22px 0 12px;
}
.tech-tags span {
  background: #293d2d;
  color: #c4d9a8;
  padding: 6px 10px;
  border-radius: 5px;
  font: 10px var(--mono);
}
.touch-controls {
  display: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.noscript {
  position: fixed;
  bottom: 0;
  padding: 20px;
  background: #633b2b;
  color: white;
  width: 100%;
  text-align: center;
}
@media (min-width: 1450px) {
  .intro {
    padding-top: 50px;
    padding-bottom: 43px;
  }
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 292px;
  }
  .expedition {
    padding: 25px;
  }
  .resource-section {
    margin-top: 26px;
  }
  .journal {
    margin-top: 26px;
    min-height: 139px;
  }
  .field-guide {
    padding-top: 36px;
    padding-bottom: 33px;
  }
}
@media (max-width: 1100px) {
  .page-shell {
    padding: 0 32px;
  }
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 18px;
  }
  .expedition {
    padding: 18px;
  }
  .intro h1 {
    font-size: 47px;
  }
  .intro-note {
    min-width: 240px;
  }
  .keyboard-hint {
    gap: 8px;
  }
  .keyboard-hint > span:last-child {
    font-size: 0;
  }
  .keyboard-hint > span:last-child:after {
    content: "or ↑ ← ↓ →";
    font-size: 11px;
  }
  .map-actions {
    gap: 8px;
  }
  .map-header {
    padding: 0 15px;
  }
  .map-header > span {
    gap: 8px;
  }
  .overlay-card {
    padding: 16px 20px;
    width: 280px;
  }
  .overlay-gem {
    height: 25px;
    margin: 0;
  }
  .overlay-gem svg {
    height: 26px;
  }
  .overlay-card h2 {
    font-size: 25px;
  }
  .overlay-card .tiny-label {
    margin-bottom: 8px;
  }
  .overlay-card > p:not(.tiny-label):not(.overlay-footnote) {
    margin-bottom: 14px;
  }
  .overlay-footnote {
    margin-top: 10px;
  }
  .field-guide {
    gap: 15px;
  }
  .guide-item {
    gap: 8px;
  }
  .guide-art {
    width: 32px;
  }
  .guide-item p {
    font-size: 9px;
  }
}
@media (max-width: 820px) {
  .page-shell {
    max-width: 730px;
    padding: 0 25px;
  }
  .site-header {
    height: 78px;
  }
  .brand {
    font-size: 17px;
  }
  nav {
    gap: 20px;
  }
  .source-link {
    padding: 8px 12px;
  }
  .intro {
    padding: 32px 0 28px;
  }
  .intro h1 {
    font-size: 46px;
  }
  .intro-note {
    display: none;
  }
  .game-layout {
    grid-template-columns: 1fr;
  }
  .expedition {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
    padding: 20px;
  }
  .panel-heading {
    grid-column: 1/-1;
    padding-bottom: 17px;
  }
  .crystal-section {
    grid-column: 1;
  }
  .resource-section {
    border: 0;
    margin: 0;
    padding: 0;
  }
  .crystal-slots {
    margin-top: 13px;
  }
  .health-section {
    grid-column: 2;
    grid-row: 2;
    padding-top: 1px;
  }
  .hearts {
    margin-top: 22px;
    gap: 11px;
  }
  .resource-section:not(.health-section) {
    grid-column: 1;
    grid-row: 3;
    margin-top: 18px;
  }
  .journal {
    grid-column: 2;
    grid-row: 3;
    margin-top: 15px;
    min-height: 100px;
    padding: 12px;
  }
  .journal p {
    margin: 8px 0;
    font-size: 10px;
    min-height: 0;
  }
  .journal-position {
    font-size: 9px;
  }
  .best-score {
    grid-column: 1/-1;
    border-top: 1px solid var(--line);
    padding-top: 12px;
    margin-top: 18px;
  }
  .below-map {
    padding-top: 13px;
  }
  .map-footer {
    padding: 11px 18px;
  }
  .keyboard-hint > span:last-child {
    font-size: 10px;
  }
  .keyboard-hint > span:last-child:after {
    display: none;
  }
  .overlay-card {
    width: 315px;
    padding: 25px 24px;
  }
  .overlay-gem {
    height: 30px;
    margin-bottom: 8px;
  }
  .overlay-card h2 {
    font-size: 30px;
  }
  .field-guide {
    grid-template-columns: 1fr 1fr;
    row-gap: 25px;
    padding: 27px 0;
  }
  .guide-item p {
    font-size: 10px;
  }
  .guide-item {
    gap: 14px;
  }
  .guide-heading h2 br {
    display: none;
  }
  .guide-heading h2 {
    font-size: 15px;
  }
  .site-footer {
    flex-wrap: wrap;
    row-gap: 2px;
    padding: 17px 0;
  }
  .footer-edition {
    display: none;
  }
  .touch-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 10px 4px;
  }
  .touch-controls > p {
    font-size: 13px;
    color: #c2d2b6;
  }
  .touch-controls > p > span {
    font-size: 11px;
    color: #849582;
  }
  .dpad {
    display: grid;
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(3, 44px);
    gap: 4px;
  }
  .dpad button {
    border: 1px solid #4a5c43;
    border-radius: 7px;
    background: #273629;
    color: #c6dfa8;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    user-select: none;
    transition:
      background 0.12s ease,
      transform 0.08s ease;
  }
  .dpad button:hover {
    border-color: #6c8a5e;
  }
  /* Pointer capture swallows :active, so the pressed class carries the press. */
  .dpad button:active,
  .dpad button.pressed {
    background: #55704a;
    transform: scale(0.94);
  }
  .dpad button:nth-child(1) {
    grid-column: 2;
    grid-row: 1;
  }
  .dpad button:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }
  .dpad button:nth-child(2) svg {
    rotate: -90deg;
  }
  .dpad > span {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #83a16e;
  }
  .dpad button:nth-child(4) {
    grid-column: 3;
    grid-row: 2;
  }
  .dpad button:nth-child(4) svg {
    rotate: 90deg;
  }
  .dpad button:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
  }
  .dpad button:nth-child(5) svg {
    rotate: 180deg;
  }
}
@media (max-width: 480px) {
  .page-shell {
    padding: 0 16px;
  }
  .site-header {
    height: 70px;
  }
  .brand {
    font-size: 16px;
    gap: 7px;
  }
  .brand img {
    width: 29px;
    height: 29px;
  }
  nav {
    gap: 16px;
  }
  nav > .text-button {
    font-size: 11px;
  }
  .source-link {
    border: 0;
    padding: 5px;
  }
  .source-link span {
    display: none;
  }
  .source-link .icon {
    width: 21px;
  }
  .intro {
    padding: 27px 0 25px;
  }
  .intro h1 {
    font-size: 42px;
    letter-spacing: -2px;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 1.4px;
  }
  .map-header {
    padding: 0 11px;
    height: 43px;
    font-size: 10px;
  }
  .live-label {
    font-size: 8px;
    letter-spacing: 0.5px;
  }
  .map-header > span {
    gap: 7px;
  }
  .canvas-wrap {
    aspect-ratio: 5/3;
  }
  .game-overlay {
    padding: 10px;
    backdrop-filter: none;
  }
  .overlay-card {
    padding: 13px 18px;
    width: 245px;
    max-height: 100%;
    overflow: auto;
  }
  .overlay-gem {
    display: none;
  }
  .overlay-card .tiny-label {
    margin: 0 0 6px;
  }
  .overlay-card h2 {
    font-size: 24px;
    margin-bottom: 7px;
  }
  .overlay-card > p:not(.tiny-label):not(.overlay-footnote) {
    font-size: 10px;
    line-height: 1.5;
    margin-bottom: 10px;
  }
  .overlay-card .primary-button {
    font-size: 11px;
    padding: 9px 12px;
  }
  .overlay-footnote {
    font-size: 9px;
    margin: 10px -8px 0;
  }
  .result-stats {
    gap: 20px;
    margin: 5px 0 8px;
  }
  .result-stats strong {
    font-size: 21px;
  }
  .result-stats span {
    font-size: 8px;
  }
  .map-footer {
    padding: 7px 10px;
    min-height: 49px;
  }
  .keyboard-hint > span:last-child {
    display: none;
  }
  kbd {
    width: 18px;
    height: 22px;
    font-size: 9px;
  }
  .key-group {
    gap: 3px;
  }
  .map-actions {
    gap: 7px;
  }
  .map-actions .icon-button {
    width: 24px;
  }
  .restart-button {
    font-size: 10px;
  }
  .below-map {
    font-size: 10px;
    gap: 8px;
  }
  .below-map .text-button {
    font-size: 10px;
    gap: 5px;
  }
  .small-diamond {
    margin-right: 3px;
  }
  .touch-controls {
    padding: 14px 5px 3px;
  }
  .expedition {
    gap: 0 18px;
    padding: 17px;
  }
  .crystal-slots {
    gap: 5px;
  }
  .crystal-slot {
    height: 34px;
  }
  .hearts {
    gap: 7px;
  }
  .hearts .icon {
    width: 20px;
    height: 20px;
  }
  .stat-heading {
    font-size: 10px;
  }
  .journal {
    padding: 9px;
  }
  .journal .tiny-label {
    letter-spacing: 1px;
  }
  .journal p {
    font-size: 10px;
  }
  .field-guide {
    gap: 23px 14px;
  }
  .guide-heading .tiny-label {
    letter-spacing: 0.8px;
  }
  .guide-item {
    gap: 8px;
  }
  .guide-item h3 {
    font-size: 11px;
  }
  .guide-item p {
    font-size: 9px;
  }
  .guide-art {
    width: 30px;
  }
  .site-footer {
    font-size: 9px;
  }
  .site-footer .text-button {
    font-size: 9px;
    gap: 5px;
  }
  dialog {
    padding: 29px 23px;
  }
  dialog h2 {
    font-size: 29px;
  }
  .guide-rules li {
    grid-template-columns: 69px 1fr;
    gap: 11px;
  }
}
.mobile-hud {
  display: none;
}
@media (max-width: 820px) {
  .mobile-hud {
    display: flex;
    justify-content: space-between;
    padding: 9px 17px;
    border-top: 1px solid #35423c;
    border-bottom: 1px solid #35423c;
    background: #172522;
  color: #c8dab3;
  font: 10px var(--mono);
}
  .mobile-hud > span {
    display: flex;
    align-items: center;
    gap: 7px;
  }
  .mobile-hud .icon {
    width: 14px;
    height: 14px;
  }
  .mobile-hud > span:nth-child(2) {
    color: var(--amber);
  }
  .mobile-hud > span:nth-child(3) {
    color: #e3a193;
  }
  .mobile-hud > span:nth-child(3) .icon {
    fill: currentColor;
    stroke: none;
  }
}
@media (max-width: 380px) {
  /* Five crystal slots plus a journal column stop fitting side by side here. */
  .expedition {
    column-gap: 13px;
    padding: 15px;
  }
  .crystal-slots {
    gap: 4px;
  }
  .crystal-slot svg {
    width: 15px;
    height: 21px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
