:root {
  --ink: #25150d;
  --ink-soft: #624938;
  --forest: #3b1a0d;
  --forest-light: #673316;
  --moss: #6b5724;
  --lime: #f1d477;
  --cream: #f6e7c6;
  --paper: #fbf5e6;
  --paper-deep: #e8d6b4;
  --rust: #9b351b;
  --gold: #d4a23c;
  --line: rgba(59, 26, 13, 0.18);
  --shadow: 0 18px 50px rgba(59, 26, 13, 0.18);
  --canvas: #cbb28a;
  --canvas-glow: rgba(255, 248, 224, 0.78);
  --topbar-bg: rgba(251, 245, 230, 0.92);
  --hero-wash: rgba(37, 21, 13, 0.92);
  --hero-wash-soft: rgba(37, 21, 13, 0.5);
  --hero-wash-mobile: rgba(37, 21, 13, 0.76);
  --radius: 22px;
  --safe-bottom: max(14px, env(safe-area-inset-bottom));
  --compact-scale: 1;
  color-scheme: light;
  font-family: "Trebuchet MS", "Avenir Next", Avenir, system-ui, sans-serif;
  background: var(--canvas);
  color: var(--ink);
}

:root[data-game-theme="zelda-nes-first-quest"] {
  --ink: #25150d;
  --ink-soft: #624938;
  --forest: #3b1a0d;
  --forest-light: #673316;
  --moss: #6b5724;
  --lime: #f1d477;
  --cream: #f6e7c6;
  --paper: #fbf5e6;
  --paper-deep: #e8d6b4;
  --rust: #9b351b;
  --gold: #d4a23c;
  --line: rgba(59, 26, 13, 0.18);
  --shadow: 0 18px 50px rgba(59, 26, 13, 0.18);
  --canvas: #cbb28a;
  --canvas-glow: rgba(255, 248, 224, 0.78);
  --topbar-bg: rgba(251, 245, 230, 0.92);
  --hero-wash: rgba(37, 21, 13, 0.92);
  --hero-wash-soft: rgba(37, 21, 13, 0.5);
  --hero-wash-mobile: rgba(37, 21, 13, 0.76);
}

:root[data-game-theme="zelda-ii-adventure-of-link"] {
  --ink: #17221d;
  --ink-soft: #4c584b;
  --forest: #183d3e;
  --forest-light: #2d6260;
  --moss: #576b25;
  --lime: #d8e67c;
  --cream: #f2e8c8;
  --paper: #faf5e5;
  --paper-deep: #e5d8b8;
  --rust: #9a3c13;
  --gold: #d6a334;
  --line: rgba(24, 61, 62, 0.17);
  --shadow: 0 18px 50px rgba(24, 61, 62, 0.16);
  --canvas: #aebfbb;
  --canvas-glow: rgba(248, 238, 186, 0.74);
  --topbar-bg: rgba(250, 245, 229, 0.92);
  --hero-wash: rgba(23, 34, 29, 0.92);
  --hero-wash-soft: rgba(23, 34, 29, 0.5);
  --hero-wash-mobile: rgba(23, 34, 29, 0.76);
}

:root[data-game-theme="links-awakening-dx"] {
  --ink: #291e24;
  --ink-soft: #5d4a4e;
  --forest: #30233e;
  --forest-light: #514369;
  --moss: #755b18;
  --lime: #ffd66d;
  --cream: #f8e4b8;
  --paper: #fff8e9;
  --paper-deep: #ebd8b5;
  --rust: #9b371b;
  --gold: #d99a25;
  --line: rgba(48, 35, 62, 0.17);
  --shadow: 0 18px 50px rgba(48, 35, 62, 0.17);
  --canvas: #c7aa8a;
  --canvas-glow: rgba(255, 222, 126, 0.42);
  --topbar-bg: rgba(255, 248, 233, 0.92);
  --hero-wash: rgba(41, 30, 36, 0.92);
  --hero-wash-soft: rgba(41, 30, 36, 0.5);
  --hero-wash-mobile: rgba(41, 30, 36, 0.76);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 18% 12%, var(--canvas-glow), transparent 34rem),
    var(--canvas);
  transition: background-color 240ms ease;
}

.compact-preview-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px 18px;
  padding: 14px 16px 16px;
  overflow: hidden;
  background: #000;
  color: #fff;
}

.compact-preview-label {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 44px;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.compact-preview-label strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  letter-spacing: 0;
}

.compact-preview-label span {
  color: rgba(255, 255, 255, 0.62);
}

.compact-preview-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.compact-preview-actions button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.compact-preview-actions button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.compact-preview-stage {
  grid-column: 1 / -1;
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  overflow: hidden;
}

.compact-preview-canvas {
  position: relative;
  width: calc(414px * var(--compact-scale));
  height: calc(896px * var(--compact-scale));
  flex: none;
}

.compact-preview-canvas iframe {
  display: block;
  width: 414px;
  height: 896px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
  transform: scale(var(--compact-scale));
  transform-origin: top left;
}

body.compact-preview-mode {
  min-width: 0;
  overflow: hidden;
  background: #000;
}

body.compact-preview-mode > .paper-grain,
body.compact-preview-mode > .app-shell,
body.compact-preview-mode > .toast {
  display: none;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 0.2;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(38, 50, 42, 0.025) 4px),
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(38, 50, 42, 0.02) 6px);
  mix-blend-mode: multiply;
}

.app-shell {
  width: min(100%, 1180px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 80px rgba(35, 43, 37, 0.14);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: max(14px, env(safe-area-inset-top)) clamp(18px, 5vw, 54px) 12px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand > span:last-child {
  display: grid;
}

.brand-logo {
  display: block;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid color-mix(in srgb, var(--gold) 72%, var(--paper));
  border-radius: 10px;
  object-fit: cover;
  box-shadow:
    0 5px 14px rgba(31, 20, 9, 0.2),
    0 0 0 2px color-mix(in srgb, var(--paper) 72%, transparent);
}

.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-kicker {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.status-pill {
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--forest) 15%, transparent);
  border-radius: 99px;
  background: color-mix(in srgb, var(--paper) 62%, transparent);
  color: var(--forest);
  font-size: 11px;
  font-weight: 800;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--moss) 14%, transparent);
}

.status-pill.online .status-dot {
  background: #4c8b64;
}

.view {
  min-height: calc(100vh - 76px);
  min-height: calc(100dvh - 76px);
  padding-bottom: 110px;
}

.hero {
  position: relative;
  display: grid;
  min-height: 390px;
  overflow: hidden;
  background: var(--forest);
  color: var(--paper);
  transition: background-color 240ms ease;
}

.hero-copy {
  position: relative;
  z-index: 2;
  align-self: end;
  max-width: 720px;
  padding: 64px clamp(22px, 6vw, 68px) 54px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.42);
}

.eyebrow,
.micro-label {
  margin: 0 0 12px;
  color: var(--rust);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--lime);
}

.hero h1,
.subpage-intro h1,
.chapter-hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(46px, 9vw, 86px);
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.hero h1 em {
  color: var(--lime);
  font-weight: 400;
}

.hero-lede {
  max-width: 440px;
  margin: 23px 0 0;
  color: color-mix(in srgb, var(--paper) 80%, transparent);
  font-size: 15px;
  line-height: 1.55;
}

.hero-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-title-image {
  position: absolute;
  top: 0;
  right: 0;
  display: block;
  width: auto;
  max-width: none;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 15%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 15%);
}

.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      var(--hero-wash) 0%,
      var(--hero-wash) 28%,
      var(--hero-wash-soft) 52%,
      transparent 78%
    ),
    linear-gradient(0deg, var(--hero-wash-soft) 0%, transparent 50%);
}

.progress-card {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 15px;
  align-items: center;
  width: min(calc(100% - 36px), 920px);
  margin: -26px auto 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper) 97%, transparent);
  box-shadow: var(--shadow);
}

.progress-orb {
  --progress: 0deg;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--paper) 55%, transparent 57%),
    conic-gradient(var(--forest) var(--progress), var(--paper-deep) 0);
}

.progress-orb span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 800;
}

.progress-copy h2,
.section-heading h2,
.offline-card h2,
.source-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  letter-spacing: -0.025em;
}

.progress-copy .micro-label {
  margin-bottom: 5px;
}

.progress-copy p:last-child {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease;
}

.primary-button {
  background: var(--rust);
  color: white;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--rust) 24%, transparent);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--forest);
}

.primary-button:active,
.secondary-button:active,
.chapter-row:active,
.nav-item:active {
  transform: translateY(1px) scale(0.99);
}

.game-strip {
  width: min(calc(100% - 36px), 760px);
  margin: 30px auto 0;
}

.chapter-section {
  width: min(calc(100% - 36px), 920px);
  margin: 38px auto 0;
}

.section-heading {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-heading .micro-label {
  margin-bottom: 5px;
}

.library-count {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.game-strip-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.game-strip-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.game-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.game-card {
  position: relative;
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 52px;
  padding: 8px 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--paper) 56%, var(--paper-deep));
  color: inherit;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

button.game-card {
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

button.game-card:hover {
  border-color: color-mix(in srgb, var(--forest) 32%, transparent);
  background: color-mix(in srgb, var(--paper) 35%, var(--paper-deep));
}

.active-game {
  border-color: transparent;
  background: var(--forest);
  color: var(--paper);
  box-shadow: 0 7px 16px color-mix(in srgb, var(--forest) 15%, transparent);
}

button.active-game:hover {
  border-color: transparent;
  background: var(--forest);
}

.game-selected-mark {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--lime) 16%, transparent);
  color: var(--lime);
  font-size: 10px;
}

.game-card:not(.active-game) .game-selected-mark {
  display: none;
}

.chapter-heading {
  align-items: center;
}

.chapter-heading-copy {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.chapter-heading-copy h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  letter-spacing: -0.025em;
}

.chapter-heading-copy span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.search-field {
  display: flex;
  align-items: center;
  width: min(100%, 300px);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.search-field input::placeholder {
  color: #829086;
}

.search-field > span:last-child {
  color: var(--forest);
  font-size: 18px;
}

.chapter-list {
  border-top: 1px solid var(--line);
}

.chapter-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 28px;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 15px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease;
}

.chapter-row:hover {
  background: color-mix(in srgb, var(--forest) 4%, transparent);
}

.chapter-index {
  color: var(--rust);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-style: italic;
}

.chapter-main {
  display: grid;
  min-width: 0;
}

.chapter-meta {
  margin-bottom: 4px;
  color: var(--moss);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.chapter-main strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.chapter-main > span:last-child {
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-progress {
  display: grid;
  gap: 6px;
  width: 70px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 900;
  text-align: right;
}

.mini-progress {
  display: block;
  width: 70px;
  height: 3px;
  overflow: hidden;
  background: var(--paper-deep);
}

.mini-progress i {
  display: block;
  height: 100%;
  background: var(--moss);
}

.chapter-arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--forest);
}

.chapter-complete .chapter-arrow {
  border-color: var(--forest);
  background: var(--forest);
  color: var(--lime);
}

.empty-state {
  padding: 54px 20px;
  text-align: center;
}

.empty-state > span {
  color: var(--moss);
  font-size: 34px;
}

.empty-state h3 {
  margin: 12px 0 5px;
  font-family: Georgia, "Times New Roman", serif;
}

.empty-state p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.back-button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin: 26px clamp(18px, 5vw, 54px);
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--forest);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.chapter-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 18px clamp(22px, 7vw, 80px) 42px;
  border-bottom: 1px solid var(--line);
}

.chapter-hero .eyebrow {
  color: var(--moss);
}

.chapter-hero h1 {
  font-size: clamp(48px, 9vw, 90px);
}

.chapter-hero h1 span {
  display: block;
  margin-bottom: 12px;
  color: var(--rust);
  font-family: "Trebuchet MS", sans-serif;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.chapter-hero > div > p:last-child {
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}

.chapter-meter {
  display: grid;
  justify-items: end;
  padding: 14px 0;
}

.chapter-meter strong {
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
}

.chapter-meter span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.spoiler-note {
  display: flex;
  gap: 15px;
  width: min(calc(100% - 36px), 880px);
  margin: 28px auto;
  padding: 15px 18px;
  border: 1px solid rgba(123, 141, 78, 0.28);
  border-radius: 14px;
  background: rgba(216, 229, 144, 0.16);
}

.spoiler-note > span {
  color: var(--moss);
  font-size: 23px;
}

.spoiler-note strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
}

.spoiler-note p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.section-stack {
  width: min(calc(100% - 36px), 880px);
  margin: 0 auto;
}

.guide-section + .guide-section {
  margin-top: 42px;
}

.guide-section-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.guide-section-heading span {
  color: var(--rust);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-style: italic;
}

.guide-section-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.step-list {
  display: grid;
  gap: 9px;
}

.step-card {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  transition: opacity 160ms ease, border-color 160ms ease;
}

.step-card.step-done {
  border-color: rgba(47, 110, 80, 0.2);
  background: rgba(47, 110, 80, 0.05);
}

.step-card.step-highlight {
  border-color: var(--gold);
  animation: step-map-highlight 1.35s ease-out;
  scroll-margin-top: 96px;
}

@keyframes step-map-highlight {
  0% {
    background: rgba(216, 229, 144, 0.48);
    box-shadow:
      0 0 0 5px rgba(211, 166, 76, 0.26),
      0 12px 28px rgba(22, 63, 48, 0.16);
  }

  45% {
    background: rgba(216, 229, 144, 0.23);
    box-shadow:
      0 0 0 3px rgba(211, 166, 76, 0.18),
      0 8px 20px rgba(22, 63, 48, 0.1);
  }

  100% {
    background: rgba(255, 255, 255, 0.58);
    box-shadow: 0 0 0 0 rgba(211, 166, 76, 0);
  }
}

.step-card.step-done .step-content > *:not(.exact-direction) {
  opacity: 0.63;
}

.step-check {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin: -11px;
  cursor: pointer;
}

.step-check input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.step-check > span:not(.visually-hidden) {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(23, 35, 30, 0.3);
  border-radius: 6px;
  background: var(--paper);
}

.step-check input:checked + span {
  border-color: var(--forest);
  background: var(--forest);
}

.step-check input:checked + span::after {
  content: "✓";
  color: var(--lime);
  font-size: 13px;
  font-weight: 900;
}

.step-check input:focus-visible + span {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.step-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--paper-deep);
  color: var(--forest);
  font-weight: 900;
}

.kind-heart,
.kind-boss {
  background: rgba(185, 71, 46, 0.12);
  color: var(--rust);
}

.kind-triforce,
.kind-finish,
.kind-crystal {
  background: rgba(211, 166, 76, 0.17);
  color: #9c6f13;
}

.kind-spell,
.kind-technique {
  background: rgba(70, 103, 147, 0.14);
  color: #355d82;
}

.kind-doll {
  background: rgba(94, 70, 113, 0.13);
  color: #644a76;
}

.step-content {
  min-width: 0;
}

.step-title-line {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.step-title-line h3 {
  margin: 2px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
}

.item-chip {
  flex: none;
  padding: 4px 7px;
  border-radius: 99px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.step-content > p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.reveal-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  margin-top: 3px;
  padding: 0 4px 0 0;
  border: 0;
  background: transparent;
  color: var(--rust);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.exact-direction {
  margin-top: 12px;
  padding: 13px 14px;
  border-left: 3px solid var(--gold);
  background: #f1e9d5;
}

.exact-direction > span {
  color: #936710;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.exact-direction p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.55;
}

.chapter-finish {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  width: min(calc(100% - 36px), 880px);
  margin: 40px auto 0;
}

.subpage-intro {
  padding: 56px clamp(22px, 7vw, 80px) 38px;
  border-bottom: 1px solid var(--line);
}

.subpage-intro h1 {
  font-size: clamp(48px, 9vw, 86px);
}

.subpage-intro > p:last-child {
  max-width: 540px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.map-page-intro {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 88% 12%,
      color-mix(in srgb, var(--lime) 22%, transparent) 0 82px,
      transparent 83px
    ),
    linear-gradient(
      135deg,
      var(--forest),
      color-mix(in srgb, var(--forest) 72%, #050505)
    );
  color: var(--paper);
}

.map-page-intro::after {
  content: "";
  position: absolute;
  right: clamp(22px, 8vw, 100px);
  bottom: -44px;
  width: 180px;
  height: 180px;
  border: 1px solid color-mix(in srgb, var(--lime) 18%, transparent);
  transform: rotate(45deg);
}

.map-page-intro .eyebrow {
  color: var(--lime);
}

.map-page-intro > p:last-child {
  position: relative;
  z-index: 1;
  color: color-mix(in srgb, var(--paper) 76%, transparent);
}

.map-filter-bar {
  position: sticky;
  z-index: 8;
  top: 76px;
  display: flex;
  gap: 8px;
  width: min(calc(100% - 36px), 1040px);
  margin: 0 auto;
  padding: 14px 0;
  overflow-x: auto;
  scrollbar-width: none;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--paper) 98%, transparent) 0 82%,
    transparent 100%
  );
}

.map-filter-bar::-webkit-scrollbar,
.atlas-order-track::-webkit-scrollbar,
.chapter-map-grid::-webkit-scrollbar,
.route-blueprint-track::-webkit-scrollbar {
  display: none;
}

.map-filter {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.map-filter:hover {
  border-color: color-mix(in srgb, var(--forest) 32%, transparent);
  color: var(--forest);
}

.map-filter.active,
.map-filter[aria-pressed="true"] {
  border-color: var(--forest);
  background: var(--forest);
  color: var(--lime);
}

.map-atlas {
  width: min(calc(100% - 36px), 1040px);
  margin: 8px auto 0;
}

#journey-feature:empty {
  display: none;
}

.seashell-feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1.38fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--lime) 24%, transparent);
  border-radius: var(--radius);
  background:
    radial-gradient(
      circle at 82% 12%,
      color-mix(in srgb, var(--lime) 14%, transparent),
      transparent 31%
    ),
    color-mix(in srgb, var(--forest) 72%, #050505);
  color: var(--paper);
  box-shadow: 0 17px 42px rgba(18, 45, 34, 0.2);
}

.seashell-feature-journey {
  width: min(calc(100% - 36px), 1040px);
  margin: 42px auto 0;
}

.seashell-feature-atlas {
  margin-top: 20px;
}

.seashell-feature-map {
  position: relative;
  display: grid;
  min-height: 286px;
  overflow: hidden;
  place-items: center;
  border-right: 1px solid color-mix(in srgb, var(--lime) 15%, transparent);
  background:
    linear-gradient(rgba(250, 247, 236, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(250, 247, 236, 0.025) 1px, transparent 1px),
    color-mix(in srgb, var(--forest) 48%, #050505);
  background-size: 22px 22px;
}

.seashell-feature-map::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      transparent 55%,
      color-mix(in srgb, var(--forest) 72%, #050505) 100%
    );
}

.seashell-feature-map img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
  image-rendering: auto;
}

.seashell-feature-glyph {
  position: absolute;
  z-index: 1;
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border: 1px solid rgba(250, 247, 236, 0.32);
  border-radius: 50%;
  background: rgba(9, 19, 15, 0.82);
  font-size: 34px;
  box-shadow: 0 13px 32px rgba(0, 0, 0, 0.35);
}

.seashell-feature-copy {
  display: grid;
  align-content: center;
  gap: 15px;
  min-width: 0;
  padding: clamp(22px, 4vw, 38px);
}

.seashell-feature-heading {
  display: flex;
  gap: 18px;
  align-items: start;
  justify-content: space-between;
}

.seashell-feature-heading .micro-label {
  color: var(--lime);
}

.seashell-feature-heading h2 {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.seashell-feature-heading > strong {
  display: grid;
  flex: none;
  min-width: 62px;
  min-height: 62px;
  padding: 8px;
  place-items: center;
  border: 1px solid rgba(216, 229, 144, 0.34);
  border-radius: 50%;
  background: rgba(216, 229, 144, 0.1);
  color: var(--lime);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.seashell-feature-copy > p {
  max-width: 560px;
  margin: 0;
  color: rgba(250, 247, 236, 0.7);
  font-size: 12px;
  line-height: 1.55;
}

.seashell-feature-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(250, 247, 236, 0.12);
}

.seashell-feature-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c9db68, var(--lime));
  transition: width 220ms ease;
}

.seashell-feature-reward {
  display: flex;
  gap: 11px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid rgba(216, 229, 144, 0.15);
  border-radius: 13px;
  background: rgba(216, 229, 144, 0.065);
}

.seashell-feature-reward > span:first-child {
  color: var(--lime);
  font-size: 18px;
}

.seashell-feature-reward strong,
.seashell-feature-reward small {
  display: block;
}

.seashell-feature-reward strong {
  color: var(--paper);
  font-size: 11px;
}

.seashell-feature-reward small {
  margin-top: 4px;
  color: rgba(250, 247, 236, 0.58);
  font-size: 9px;
  line-height: 1.45;
}

.seashell-feature-button {
  justify-self: start;
  min-width: 190px;
}

.atlas-order {
  position: relative;
  padding: clamp(20px, 4vw, 32px);
  overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(216, 229, 144, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 229, 144, 0.035) 1px, transparent 1px),
    var(--forest);
  background-size: 24px 24px;
  color: var(--paper);
  box-shadow: 0 16px 42px rgba(22, 63, 48, 0.16);
}

.atlas-order-heading,
.atlas-section-heading,
.chapter-map-heading,
.route-blueprint-heading {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
}

.atlas-order-heading {
  margin-bottom: 18px;
}

.atlas-order-heading h2,
.atlas-section-heading h2,
.chapter-map-heading h2,
.route-blueprint-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing: -0.025em;
}

.atlas-order-heading p,
.atlas-section-heading p,
.chapter-map-heading p,
.route-blueprint-heading p {
  max-width: 420px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.atlas-order-heading p {
  color: rgba(250, 247, 236, 0.64);
}

.atlas-order-track {
  display: flex;
  gap: 8px;
  padding: 2px 0 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.atlas-order-step {
  display: flex;
  flex: 1 0 126px;
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 52px;
  padding: 9px 12px;
  border: 1px solid rgba(250, 247, 236, 0.14);
  border-radius: 13px;
  background: rgba(250, 247, 236, 0.07);
  color: var(--paper);
  text-align: left;
  scroll-snap-align: start;
}

button.atlas-order-step {
  cursor: pointer;
}

.atlas-order-step:hover {
  border-color: rgba(216, 229, 144, 0.5);
  background: rgba(216, 229, 144, 0.11);
}

.atlas-order-number,
.route-node-number {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(216, 229, 144, 0.45);
  border-radius: 50%;
  background: rgba(216, 229, 144, 0.12);
  color: var(--lime);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 800;
}

.atlas-order-step > span:last-child {
  min-width: 0;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
}

.atlas-order-step strong,
.atlas-order-step small {
  display: block;
}

.atlas-order-step strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-order-step small {
  margin-top: 4px;
  color: rgba(250, 247, 236, 0.56);
  font-family: "Trebuchet MS", "Avenir Next", Avenir, system-ui, sans-serif;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.2;
}

.atlas-order-heading > span,
.chapter-map-heading > span,
.route-blueprint-heading > span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
  text-align: right;
}

.atlas-order-heading > span {
  color: rgba(250, 247, 236, 0.62);
}

.atlas-section {
  margin-top: 38px;
}

.atlas-section + .atlas-section {
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

.atlas-section-heading {
  margin-bottom: 16px;
}

.atlas-section-heading > span {
  display: grid;
  width: 30px;
  min-width: 30px;
  height: 30px;
  place-items: center;
  justify-self: start;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--forest);
  font-size: 10px;
  font-weight: 900;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.map-card {
  position: relative;
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 7px 22px color-mix(in srgb, var(--ink) 6%, transparent);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

button.map-card {
  width: 100%;
  padding: 0;
  font: inherit;
  cursor: zoom-in;
}

.map-card:hover {
  border-color: color-mix(in srgb, var(--forest) 34%, transparent);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--ink) 12%, transparent);
  transform: translateY(-2px);
}

.map-card:active {
  transform: translateY(0);
}

.map-card-visual {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  min-height: 150px;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(rgba(250, 247, 236, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(250, 247, 236, 0.04) 1px, transparent 1px),
    color-mix(in srgb, var(--forest) 72%, #050505);
  background-size: 18px 18px;
}

.map-card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 200ms ease;
}

.map-card:hover .map-card-image {
  transform: scale(1.025);
}

.map-card-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-thumb-marker {
  position: absolute;
  top: var(--marker-y);
  left: var(--marker-x);
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--rust);
  color: white;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.38);
  transform: translate(-50%, -50%);
}

.map-card-copy {
  display: grid;
  gap: 5px;
  min-height: 98px;
  padding: 15px 16px 16px;
}

.map-card-type {
  color: var(--rust);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.map-card-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.018em;
}

.map-card-source {
  align-self: end;
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.35;
}

.maze-thumb {
  display: grid;
  width: 100%;
  height: 100%;
  padding: 16px;
  place-items: center;
  background:
    radial-gradient(circle at 50% 46%, rgba(216, 229, 144, 0.16), transparent 42%),
    #10271f;
}

.maze-thumb-arrows {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  max-width: 210px;
}

.maze-thumb-arrows span {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(216, 229, 144, 0.32);
  border-radius: 8px;
  background: rgba(216, 229, 144, 0.1);
  color: var(--lime);
  font-size: 16px;
  font-weight: 900;
}

.chapter-map-deck,
.route-blueprint {
  width: min(calc(100% - 36px), 880px);
  margin: 28px auto;
}

.chapter-map-heading,
.route-blueprint-heading {
  margin-bottom: 13px;
}

.chapter-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.chapter-map-grid .map-card {
  grid-template-columns: minmax(130px, 42%) minmax(0, 1fr);
}

.chapter-map-grid .map-card-visual {
  min-height: 132px;
  aspect-ratio: auto;
}

.chapter-map-grid .map-card-copy {
  min-height: 132px;
  align-content: center;
}

.route-blueprint {
  padding: 18px;
  border: 1px solid rgba(22, 63, 48, 0.14);
  border-radius: 18px;
  background: rgba(22, 63, 48, 0.055);
}

.route-blueprint-track {
  position: relative;
  display: flex;
  gap: 8px;
  padding-top: 1px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.route-blueprint-track::before {
  content: "";
  position: absolute;
  top: 25px;
  right: 24px;
  left: 24px;
  height: 1px;
  background: rgba(22, 63, 48, 0.18);
}

.route-node {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  flex: 1 0 150px;
  gap: 9px;
  align-items: center;
  min-height: 50px;
  padding: 8px 11px;
  border: 1px solid rgba(22, 63, 48, 0.15);
  border-radius: 13px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  scroll-snap-align: start;
}

button.route-node {
  cursor: pointer;
}

.route-node:hover {
  border-color: rgba(22, 63, 48, 0.38);
  background: white;
}

.route-node-number {
  border-color: rgba(22, 63, 48, 0.3);
  background: var(--forest);
  color: var(--lime);
}

.route-node-copy {
  min-width: 0;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.map-viewer {
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #09130f;
  color: var(--paper);
}

body.map-viewer-open {
  overflow: hidden;
}

.map-viewer[open] {
  display: block;
}

.map-viewer::backdrop {
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
}

.map-viewer-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding:
    max(10px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}

.map-viewer-header {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 2px 2px 10px;
}

.map-viewer-header > div {
  min-width: 0;
}

.map-viewer-header .micro-label {
  margin-bottom: 4px;
  color: var(--lime);
}

.map-viewer-header h2 {
  margin: 0;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(21px, 4vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-close-button,
.map-toolbar button {
  display: grid;
  flex: none;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  border: 1px solid rgba(250, 247, 236, 0.18);
  background: rgba(250, 247, 236, 0.08);
  color: var(--paper);
  font-weight: 900;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.map-close-button:hover,
.map-toolbar button:not(:disabled):hover {
  border-color: rgba(216, 229, 144, 0.58);
  background: rgba(216, 229, 144, 0.13);
}

.map-close-button {
  border-radius: 50%;
  font-family: system-ui, sans-serif;
  font-size: 26px;
  line-height: 1;
}

.map-toolbar {
  display: grid;
  grid-template-columns: 44px 44px minmax(54px, 90px) 54px 44px 44px;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 0 0 10px;
}

.map-toolbar button {
  border-radius: 11px;
  font-size: 15px;
}

.map-toolbar button[data-map-action="fit"] {
  padding-inline: 12px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.map-toolbar button:disabled {
  opacity: 0.32;
  cursor: default;
}

#map-zoom-label {
  display: grid;
  min-width: 0;
  min-height: 44px;
  place-items: center;
  color: rgba(250, 247, 236, 0.65);
  font-size: 9px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.map-gesture-hint {
  grid-column: 1 / -1;
  margin-top: 1px;
  color: rgba(250, 247, 236, 0.72);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.025em;
  line-height: 1.3;
  text-align: center;
}

.map-canvas {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  place-items: safe center;
  overscroll-behavior: contain;
  border: 1px solid rgba(250, 247, 236, 0.13);
  border-radius: 16px;
  background:
    linear-gradient(rgba(250, 247, 236, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(250, 247, 236, 0.025) 1px, transparent 1px),
    #050a08;
  background-size: 24px 24px;
  scrollbar-color: rgba(216, 229, 144, 0.32) transparent;
  touch-action: pan-x pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.map-canvas.gesture-enabled {
  touch-action: none;
  cursor: grab;
}

.map-canvas.gesture-enabled:active,
.map-canvas.is-dragging {
  cursor: grabbing;
}

.map-stage {
  position: relative;
  flex: none;
  max-width: none;
  transform-origin: center center;
}

.map-stage > img {
  display: block;
  width: auto;
  max-width: none;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.map-viewer-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-seashell-marker {
  position: absolute;
  z-index: 2;
  top: var(--marker-y);
  left: var(--marker-x);
  display: grid;
  width: 31px;
  height: 31px;
  padding: 0;
  place-items: center;
  border: 2px solid #fff4c7;
  border-radius: 50%;
  background: #c98b2f;
  color: #fff8df;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  box-shadow:
    0 5px 13px rgba(0, 0, 0, 0.52),
    0 0 0 4px rgba(201, 139, 47, 0.2);
  transform: translate(calc(-50% + var(--marker-shift-x, 0px)), -50%);
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.map-seashell-marker::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
}

.map-seashell-marker:hover,
.map-seashell-marker.selected {
  z-index: 4;
  background: #e0a33f;
  box-shadow:
    0 7px 17px rgba(0, 0, 0, 0.58),
    0 0 0 5px rgba(216, 229, 144, 0.32);
  transform:
    translate(calc(-50% + var(--marker-shift-x, 0px)), -50%)
    scale(1.1);
}

.map-seashell-marker:focus-visible {
  z-index: 5;
  outline: 3px solid var(--lime);
  outline-offset: 4px;
}

.map-seashell-marker.missable:not(.found) {
  border-color: #ffb39f;
  box-shadow:
    0 5px 13px rgba(0, 0, 0, 0.52),
    0 0 0 5px rgba(185, 71, 46, 0.42);
}

.map-seashell-marker.found {
  border-color: var(--lime);
  background: var(--forest-light);
  color: white;
  box-shadow:
    0 5px 13px rgba(0, 0, 0, 0.48),
    0 0 0 4px rgba(216, 229, 144, 0.25);
}

.seashell-marker-glyph {
  display: grid;
  place-items: center;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.seashell-marker-number {
  position: absolute;
  right: -7px;
  bottom: -7px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid rgba(250, 247, 236, 0.8);
  border-radius: 50%;
  background: #09130f;
  color: white;
  font-size: 7px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.map-seashell-marker.found .seashell-marker-number {
  background: var(--forest-light);
}

.map-viewer-marker {
  position: absolute;
  top: var(--marker-y);
  left: var(--marker-x);
  display: grid;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  place-items: center;
  border: 2px solid var(--paper);
  border-radius: 999px;
  background: var(--rust);
  color: white;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    0 5px 14px rgba(0, 0, 0, 0.48),
    0 0 0 4px rgba(185, 71, 46, 0.2);
  transform: translate(-50%, -50%);
}

.map-viewer-marker.start-marker,
.map-viewer-marker[data-marker-label="Start"] {
  background: var(--forest-light);
  box-shadow:
    0 5px 14px rgba(0, 0, 0, 0.48),
    0 0 0 4px rgba(47, 110, 80, 0.24);
}

.map-stage.maze-map {
  display: grid;
  width: min(100%, 760px);
  height: 100%;
  min-height: 0;
  place-items: center;
}

.map-stage.maze-map > img,
.map-stage.maze-map .map-viewer-markers {
  display: none;
}

.map-maze-panel {
  width: min(100%, 720px);
  padding: clamp(16px, 4vw, 32px);
}

.maze-panel-intro {
  max-width: 560px;
  margin: 0 auto 20px;
  text-align: center;
}

.maze-panel-intro h3 {
  margin: 0;
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 4vw, 32px);
}

.maze-panel-intro p {
  margin: 8px 0 0;
  color: rgba(250, 247, 236, 0.62);
  font-size: 11px;
  line-height: 1.55;
}

.maze-sequence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.maze-sequence {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 78px;
  padding: 13px;
  border: 1px solid rgba(216, 229, 144, 0.18);
  border-radius: 14px;
  background: rgba(216, 229, 144, 0.065);
  color: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.maze-sequence:hover {
  border-color: rgba(216, 229, 144, 0.48);
  background: rgba(216, 229, 144, 0.11);
}

.maze-sequence.active,
.maze-sequence[aria-pressed="true"] {
  border-color: var(--lime);
  background: rgba(216, 229, 144, 0.17);
  box-shadow: 0 0 0 3px rgba(216, 229, 144, 0.12);
}

.maze-sequence-number {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 900;
}

.maze-sequence-arrows {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.maze-sequence-arrows span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(250, 247, 236, 0.15);
  border-radius: 7px;
  background: rgba(250, 247, 236, 0.075);
  color: var(--paper);
  font-size: 15px;
  font-weight: 900;
}

.map-tracker-panel {
  display: grid;
  grid-template-columns: minmax(150px, 0.34fr) minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  max-height: 224px;
  margin-top: 9px;
  padding: 11px;
  overflow: auto;
  border: 1px solid rgba(216, 229, 144, 0.2);
  border-radius: 15px;
  background: #10271f;
  scrollbar-color: rgba(216, 229, 144, 0.32) transparent;
}

.map-tracker-panel[hidden] {
  display: none;
}

.map-tracker-summary {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 11px;
  background: rgba(216, 229, 144, 0.07);
}

.map-tracker-summary .micro-label {
  margin-bottom: 4px;
  color: var(--lime);
  font-size: 8px;
}

.map-tracker-summary strong {
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.map-tracker-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(250, 247, 236, 0.13);
}

.map-tracker-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
  transition: width 180ms ease;
}

.map-tracker-detail {
  min-width: 0;
}

.map-tracker-empty {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 10px 12px;
}

.map-tracker-empty > span {
  display: grid;
  flex: none;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(216, 229, 144, 0.25);
  border-radius: 50%;
  background: rgba(216, 229, 144, 0.08);
  font-size: 22px;
}

.map-tracker-empty p {
  margin: 0;
  color: rgba(250, 247, 236, 0.64);
  font-size: 10px;
  line-height: 1.5;
}

.map-tracker-empty strong {
  display: block;
  margin-bottom: 2px;
  color: var(--paper);
  font-size: 11px;
}

.seashell-detail-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 11px;
  min-width: 0;
}

.seashell-detail-number {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(216, 229, 144, 0.34);
  border-radius: 50%;
  background: rgba(216, 229, 144, 0.11);
  color: var(--lime);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.seashell-detail-copy {
  min-width: 0;
}

.seashell-detail-heading {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

.seashell-detail-heading > div {
  min-width: 0;
}

.seashell-detail-heading span {
  color: var(--lime);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.seashell-detail-heading h3 {
  margin: 3px 0 0;
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.1;
}

.seashell-caution {
  display: inline-flex;
  margin-left: 5px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(185, 71, 46, 0.25);
  color: #ffc0af !important;
  font-size: 7px !important;
}

.seashell-found-button {
  display: inline-flex;
  flex: none;
  gap: 6px;
  align-items: center;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(216, 229, 144, 0.3);
  border-radius: 11px;
  background: rgba(216, 229, 144, 0.1);
  color: var(--paper);
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}

.seashell-found-button.found {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--forest);
}

.seashell-found-button > span {
  font-size: 14px;
}

.seashell-requirement,
.seashell-directions {
  margin: 7px 0 0;
  color: rgba(250, 247, 236, 0.62);
  font-size: 9px;
  line-height: 1.42;
}

.seashell-requirement strong {
  color: var(--paper);
}

.seashell-interior-note {
  display: block;
  margin-top: 6px;
  color: #e8ad9d;
  font-size: 8px;
  line-height: 1.35;
}

.map-viewer-footer {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 10px 2px 0;
}

.map-viewer-footer p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: rgba(250, 247, 236, 0.54);
  font-size: 9px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-viewer-footer a {
  display: inline-flex;
  flex: none;
  align-items: center;
  min-height: 44px;
  color: var(--lime);
  font-size: 10px;
  font-weight: 900;
}

.gear-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: min(calc(100% - 36px), 920px);
  margin: 30px auto;
}

.gear-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.52);
  opacity: 0.55;
}

.gear-acquired {
  border-color: rgba(47, 110, 80, 0.22);
  background: rgba(47, 110, 80, 0.07);
  opacity: 1;
}

.gear-glyph {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--paper-deep);
  color: var(--forest);
}

.gear-card span {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gear-card h2 {
  margin: 3px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
}

.gear-card .gear-check {
  color: var(--forest);
  font-size: 15px;
}

.notes-card,
.offline-card,
.source-card {
  display: block;
  width: min(calc(100% - 36px), 780px);
  margin: 28px auto 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
}

.notes-card > span {
  display: block;
  margin-bottom: 12px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 800;
}

.notes-card textarea {
  width: 100%;
  padding: 16px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background:
    repeating-linear-gradient(transparent 0 27px, rgba(23, 35, 30, 0.08) 28px),
    var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 28px;
}

.notes-card textarea:focus {
  border-color: var(--moss);
}

.notes-card small {
  display: block;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  text-align: right;
}

.offline-card {
  display: flex;
  gap: 22px;
  align-items: center;
  justify-content: space-between;
  background: var(--forest);
  color: var(--paper);
}

.offline-card .micro-label {
  color: var(--lime);
}

.offline-card p:last-child {
  max-width: 460px;
  margin: 7px 0 0;
  color: rgba(250, 247, 236, 0.68);
  font-size: 12px;
  line-height: 1.5;
}

.source-card p:not(.micro-label) {
  margin: 9px 0 14px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.source-card a {
  color: var(--rust);
  font-size: 11px;
  font-weight: 900;
}

.bottom-nav {
  position: fixed;
  z-index: 15;
  left: 50%;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 1180px);
  min-height: calc(64px + var(--safe-bottom));
  padding: 6px clamp(14px, 7vw, 100px) var(--safe-bottom);
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.nav-item {
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 48px;
  padding: 6px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #7b877f;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}

.nav-item.active {
  background: color-mix(in srgb, var(--forest) 8%, transparent);
  color: var(--forest);
}

.nav-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
}

.trail-icon {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.trail-icon::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 8px;
  width: 2px;
  height: 8px;
  background: currentColor;
  transform: rotate(35deg);
}

.map-icon {
  border: 2px solid currentColor;
  border-radius: 3px;
  transform: skewY(-5deg);
}

.map-icon::before,
.map-icon::after {
  content: "";
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: currentColor;
}

.map-icon::before {
  left: 5px;
  transform: skewY(18deg);
}

.map-icon::after {
  right: 5px;
  transform: skewY(-18deg);
}

.gear-icon {
  border: 2px solid currentColor;
  border-radius: 5px 5px 9px 9px;
}

.gear-icon::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 5px;
  width: 6px;
  height: 6px;
  border: 2px solid currentColor;
  border-bottom: 0;
}

.note-icon {
  border: 2px solid currentColor;
  border-radius: 3px;
}

.note-icon::before,
.note-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  width: 8px;
  height: 2px;
  background: currentColor;
}

.note-icon::before {
  top: 5px;
}

.note-icon::after {
  top: 11px;
}

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(86px + var(--safe-bottom));
  max-width: calc(100% - 32px);
  padding: 11px 15px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  font-size: 11px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .app-shell,
  .bottom-nav {
    width: min(100%, 414px);
  }

  .topbar {
    min-height: 62px;
    padding: max(10px, env(safe-area-inset-top)) 14px 8px;
  }

  .status-pill {
    min-height: 30px;
    padding-inline: 9px;
    font-size: 9px;
  }

  .hero {
    min-height: 292px;
  }

  .hero-copy {
    padding: 36px 18px 34px;
  }

  .hero-title-image {
    width: 100%;
    height: 100%;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .hero-art::after {
    background:
      linear-gradient(
        90deg,
        var(--hero-wash) 0%,
        var(--hero-wash-mobile) 72%,
        rgba(0, 0, 0, 0.08) 100%
      ),
      linear-gradient(0deg, var(--hero-wash) 0%, transparent 62%);
  }

  .hero h1 {
    font-size: clamp(42px, 12vw, 52px);
  }

  .hero-lede {
    max-width: 290px;
    margin-top: 15px;
    font-size: 11px;
    line-height: 1.45;
  }

  .progress-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    width: calc(100% - 24px);
    margin-top: -20px;
    padding: 12px;
    border-radius: 16px;
  }

  .progress-card .primary-button {
    grid-column: auto;
    gap: 7px;
    width: auto;
    min-height: 44px;
    padding-inline: 12px;
  }

  .progress-orb {
    width: 50px;
    height: 50px;
  }

  .progress-orb span {
    font-size: 14px;
  }

  .progress-copy {
    min-width: 0;
  }

  .progress-copy .micro-label {
    margin-bottom: 3px;
    font-size: 8px;
  }

  .progress-copy h2 {
    overflow: hidden;
    font-size: 16px;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .progress-copy p:last-child {
    margin-top: 4px;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-strip {
    width: calc(100% - 24px);
    margin-top: 22px;
  }

  .chapter-section {
    width: calc(100% - 24px);
    margin-top: 26px;
  }

  .game-strip-heading {
    margin-bottom: 8px;
  }

  .game-strip-heading h2 {
    font-size: 15px;
  }

  .library-count {
    font-size: 9px;
  }

  .seashell-feature {
    grid-template-columns: 1fr;
  }

  .seashell-feature-journey {
    grid-template-columns: 56px minmax(0, 1fr);
    width: calc(100% - 24px);
    min-height: 70px;
    margin-top: 24px;
    border-radius: 14px;
  }

  .seashell-feature-journey .seashell-feature-map {
    min-height: 70px;
    border-right: 1px solid color-mix(in srgb, var(--lime) 15%, transparent);
    border-bottom: 0;
  }

  .seashell-feature-journey .seashell-feature-glyph {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .seashell-feature-journey .seashell-feature-copy {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 9px 10px;
  }

  .seashell-feature-journey .seashell-feature-heading {
    gap: 7px;
    align-items: center;
  }

  .seashell-feature-journey .seashell-feature-heading .micro-label,
  .seashell-feature-journey .seashell-feature-copy > p,
  .seashell-feature-journey .seashell-feature-progress,
  .seashell-feature-journey .seashell-feature-reward {
    display: none;
  }

  .seashell-feature-journey .seashell-feature-heading h2 {
    margin: 0;
    font-size: 15px;
    white-space: nowrap;
  }

  .seashell-feature-journey .seashell-feature-heading h2 small {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin-left: 4px;
    padding: 5px 7px;
    border: 1px solid rgba(216, 229, 144, 0.28);
    border-radius: 999px;
    background: rgba(216, 229, 144, 0.1);
    color: var(--lime);
    font-family: "Trebuchet MS", sans-serif;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
  }

  .seashell-feature-journey .seashell-feature-button {
    min-width: 0;
    min-height: 44px;
    padding-inline: 11px;
    white-space: nowrap;
  }

  .seashell-feature-map {
    min-height: 176px;
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--lime) 15%, transparent);
  }

  .seashell-feature-map::after {
    background:
      linear-gradient(
        0deg,
        color-mix(in srgb, var(--forest) 72%, #050505) 0,
        transparent 58%
      );
  }

  .seashell-feature-copy {
    padding: 22px;
  }

  .game-card {
    min-height: 48px;
    padding-inline: 7px;
    font-size: 11px;
  }

  .chapter-heading {
    display: grid;
    gap: 10px;
    align-items: start;
  }

  .search-field {
    width: 100%;
    min-height: 44px;
  }

  .chapter-row {
    grid-template-columns: 34px minmax(0, 1fr) 38px 24px;
    gap: 8px;
    padding-block: 13px;
  }

  .chapter-progress {
    display: grid;
    width: 38px;
    font-size: 9px;
  }

  .mini-progress {
    width: 38px;
  }

  .chapter-main > span:last-child {
    max-width: 100%;
    font-size: 10px;
  }

  .chapter-hero {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 8px 18px 28px;
  }

  .chapter-hero h1 {
    font-size: clamp(40px, 12vw, 54px);
  }

  .chapter-hero > div > p:last-child {
    margin-top: 12px;
    font-size: 12px;
  }

  .subpage-intro {
    padding: 28px 18px 22px;
  }

  .subpage-intro h1 {
    font-size: clamp(36px, 10vw, 44px);
  }

  .subpage-intro > p:last-child {
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.45;
  }

  .map-filter-bar {
    top: 62px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: calc(100% - 24px);
    overflow: visible;
  }

  .map-filter {
    width: 100%;
    min-width: 0;
    padding-inline: 7px;
  }

  .map-atlas {
    width: calc(100% - 24px);
  }

  .map-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chapter-map-deck,
  .route-blueprint {
    width: calc(100% - 24px);
  }

  .chapter-map-grid {
    grid-auto-columns: minmax(292px, 72%);
    grid-template-columns: none;
    grid-auto-flow: column;
    padding: 2px 1px 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
  }

  .chapter-map-grid .map-card {
    scroll-snap-align: start;
  }

  .map-viewer-header h2 {
    font-size: 22px;
  }

  .map-tracker-panel {
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 260px;
  }

  .map-tracker-summary {
    grid-template-columns: auto minmax(90px, 1fr);
    align-items: center;
  }

  .chapter-meter {
    justify-items: start;
    padding: 0;
  }

  .step-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .step-icon {
    display: none;
  }

  .step-title-line {
    display: grid;
    justify-items: start;
  }

  .item-chip {
    grid-row: 1;
  }

  .chapter-finish {
    display: grid;
  }

  .gear-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: calc(100% - 24px);
    margin-top: 22px;
  }

  .gear-card {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
    min-width: 0;
    padding: 11px;
  }

  .gear-glyph {
    width: 34px;
    height: 34px;
  }

  .gear-card h2 {
    overflow-wrap: anywhere;
    font-size: 14px;
  }

  .offline-card {
    display: grid;
  }

  .notes-card,
  .offline-card,
  .source-card {
    width: calc(100% - 24px);
    margin-top: 18px;
    padding: 17px;
    border-radius: 15px;
  }
}

@media (max-width: 520px) {
  .compact-preview-screen {
    gap: 8px;
    padding: 10px;
  }

  .compact-preview-label {
    min-height: 40px;
  }

  .compact-preview-actions {
    gap: 6px;
  }

  .compact-preview-actions button {
    min-height: 40px;
    padding-inline: 11px;
  }

  .map-page-intro::after {
    right: -46px;
    bottom: -74px;
  }

  .map-filter-bar {
    padding-block: 10px 13px;
  }

  .map-filter {
    padding-inline: 7px;
  }

  .seashell-feature {
    border-radius: 18px;
  }

  .seashell-feature-map {
    min-height: 150px;
  }

  .seashell-feature-glyph {
    width: 58px;
    height: 58px;
    font-size: 28px;
  }

  .seashell-feature-copy {
    gap: 12px;
    padding: 19px;
  }

  .seashell-feature-heading h2 {
    font-size: 25px;
  }

  .seashell-feature-heading > strong {
    min-width: 54px;
    min-height: 54px;
    font-size: 15px;
  }

  .seashell-feature-button {
    width: 100%;
  }

  .atlas-order {
    padding: 18px;
    border-radius: 18px;
  }

  .atlas-order-heading,
  .atlas-section-heading,
  .chapter-map-heading,
  .route-blueprint-heading {
    display: grid;
    gap: 6px;
    align-items: start;
  }

  .atlas-order-heading h2,
  .atlas-section-heading h2,
  .chapter-map-heading h2,
  .route-blueprint-heading h2 {
    font-size: 22px;
  }

  .atlas-order-step {
    flex-basis: 138px;
  }

  .atlas-section {
    margin-top: 30px;
  }

  .atlas-section + .atlas-section {
    padding-top: 29px;
  }

  .map-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .map-card-visual {
    min-height: 108px;
  }

  .map-grid .map-card {
    border-radius: 14px;
  }

  .map-grid .map-card-copy {
    min-height: 76px;
    padding: 11px 12px 12px;
  }

  .map-grid .map-card-title {
    font-size: 14px;
  }

  .map-grid .map-card-source {
    display: none;
  }

  .chapter-map-grid {
    grid-auto-columns: minmax(270px, 88%);
  }

  .chapter-map-grid .map-card {
    grid-template-columns: 1fr;
  }

  .chapter-map-grid .map-card-visual {
    min-height: 160px;
    aspect-ratio: 16 / 9;
  }

  .chapter-map-grid .map-card-copy {
    min-height: 98px;
  }

  .route-blueprint {
    padding: 15px;
  }

  .route-node {
    flex-basis: 148px;
  }

  .map-viewer-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));
  }

  .map-viewer-header {
    padding-inline: 4px;
  }

  .map-viewer-header .micro-label {
    font-size: 8px;
  }

  .map-viewer-header h2 {
    font-size: 19px;
  }

  .map-toolbar {
    grid-template-columns: 44px 44px minmax(48px, 90px) 48px 44px 44px;
    gap: 4px;
  }

  .map-canvas {
    border-radius: 12px;
  }

  .map-tracker-panel {
    max-height: 230px;
    padding: 8px;
  }

  .map-tracker-summary {
    padding: 7px 9px;
  }

  .map-tracker-summary strong {
    font-size: 18px;
  }

  .seashell-detail-card {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px;
  }

  .seashell-detail-number {
    width: 38px;
    height: 38px;
    font-size: 13px;
  }

  .seashell-detail-heading {
    display: grid;
    gap: 7px;
  }

  .seashell-detail-heading h3 {
    font-size: 15px;
  }

  .seashell-found-button {
    width: 100%;
    justify-content: center;
  }

  .map-viewer-marker {
    min-width: 28px;
    height: 28px;
    padding-inline: 5px;
    font-size: 9px;
  }

  .map-maze-panel {
    padding: 14px;
  }

  .maze-panel-intro {
    margin-bottom: 14px;
  }

  .maze-sequence-grid {
    grid-template-columns: 1fr;
  }

  .maze-sequence {
    min-height: 66px;
    padding: 10px;
  }

  .maze-sequence-arrows span {
    width: 28px;
    height: 28px;
  }

  .map-viewer-footer {
    display: grid;
    gap: 0;
    align-items: start;
  }

  .map-viewer-footer p {
    width: 100%;
  }

  .map-viewer-footer a {
    min-height: 38px;
  }
}

@media (max-width: 430px) {
  .brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }

  .brand-kicker {
    display: none;
  }

  .status-pill {
    padding-inline: 9px;
  }

  .chapter-main > span:last-child {
    max-width: 205px;
  }

  .gear-card {
    min-height: 76px;
  }
}

@media (max-width: 359px) {
  .gear-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.offline-panel {
  position: relative;
  z-index: 6;
  display: grid;
  gap: 10px;
  margin: 12px clamp(16px, 4vw, 42px) 0;
  padding: 13px 15px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--forest) 22%, transparent);
  border-radius: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--gold) 14%, transparent), transparent 58%),
    var(--paper);
  box-shadow: 0 10px 25px color-mix(in srgb, var(--forest) 12%, transparent);
}

.offline-copy {
  display: grid;
  gap: 3px;
}

.offline-copy strong {
  color: var(--forest);
  font-size: 12px;
  line-height: 1.35;
}

.offline-copy small {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.4;
}

.offline-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--forest) 12%, transparent);
}

.offline-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rust), var(--gold));
  transition: width 180ms ease;
}

.offline-panel[data-state="ready"] {
  border-color: color-mix(in srgb, #34845a 55%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, #4c9a6b 14%, transparent), transparent 58%),
    var(--paper);
}

.offline-panel[data-state="ready"] .offline-progress span {
  background: #4c8b64;
}

.offline-panel[data-state="error"] {
  border-color: color-mix(in srgb, var(--rust) 55%, transparent);
}

@media (min-width: 820px) {
  .offline-panel {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 34%);
