:root {
  --ink: #1c2a24;
  --leaf: #2f9e6b;
  --leaf-dark: #1d6f4a;
  --sun: #f4c430;
  --panel: rgba(255, 252, 244, 0.94);
  --shadow: 0 16px 40px rgba(18, 40, 28, 0.22);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
}

body.site {
  background:
    radial-gradient(circle at 20% 10%, #ffe27a 0, transparent 28%),
    linear-gradient(180deg, #7ec8f5 0%, #d7f2a6 70%, #8fd18a 100%);
}

body.play {
  background: #123226;
  height: 100dvh;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
}

.brand {
  color: #143322;
  font-weight: 800;
  text-decoration: none;
  font-size: 1.25rem;
}

.topbar nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.topbar a {
  color: #143322;
  font-weight: 700;
}

.page {
  display: flex;
  justify-content: center;
  padding: 12px 16px 48px;
}

.auth-card,
.panel {
  width: min(460px, 100%);
  background: var(--panel);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-card h1,
.panel h1,
.panel h2 {
  margin: 0 0 8px;
}

.lede {
  margin-top: 0;
  color: #3d5348;
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

input {
  border: 2px solid #c9d7cc;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}

.btn,
.hud-btn,
.level-pick {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: #e7efe6;
  color: var(--ink);
}

.btn.primary,
.level-pick:not(:disabled) {
  background: linear-gradient(180deg, #43c07d, var(--leaf-dark));
  color: #fff;
}

.btn + .btn {
  margin-top: 8px;
}

.alert {
  background: #ffe1d6;
  border-radius: 12px;
  padding: 10px 14px;
  color: #8a2a16;
}

.site-foot {
  text-align: center;
  padding: 8px 16px 24px;
  color: #245038;
}

#game-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  background: #0e241c;
  overflow: hidden;
}

#stage {
  position: relative;
  width: min(100%, 177.7778dvh);
  min-width: 0;
  min-height: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #7ec8f5;
}

body.play.game-intro #game-wrap {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: 100dvh;
}

body.play.game-intro #stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: auto;
}

body.play.game-intro #game {
  inset: auto !important;
  top: 50% !important;
  left: 50% !important;
  width: max(100vw, 177.7778dvh) !important;
  height: max(56.25vw, 100dvh) !important;
  max-width: none !important;
  max-height: none !important;
  transform: translate(-50%, -50%);
}

#game {
  position: absolute;
  inset: 0;
  display: block;
  background: #7ec8f5;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  touch-action: none;
}

#hud {
  position: absolute;
  inset: 10px 12px auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  pointer-events: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  color: #fff;
  font-weight: 800;
}

.hud-left,
.hud-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.hud-right {
  justify-content: flex-end;
  flex-wrap: wrap;
}

#hud-level {
  text-align: center;
  padding-top: 4px;
}

.hud-btn {
  pointer-events: auto;
  padding: 6px 12px;
  font-size: 0.9rem;
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(10, 28, 20, 0.38);
  padding: 16px;
  z-index: 10;
}

.overlay.visible {
  display: grid;
}

.panel.wide {
  width: min(720px, 100%);
  max-height: 92dvh;
  overflow: auto;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.level-pick {
  display: grid;
  gap: 4px;
  text-align: left;
  border-radius: 18px;
}

.level-pick:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.level-pick em {
  font-style: normal;
  font-size: 0.85rem;
  opacity: 0.9;
}

.help,
.board,
.status {
  background: #eef7ea;
  border-radius: 16px;
  padding: 12px 14px;
}

.board ol {
  padding-left: 18px;
}

.board li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0;
}

.player-chip {
  display: inline-block;
  background: #d9f4df;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
}

.logout-row {
  text-align: center;
}

#touch-controls {
  display: none;
  position: absolute;
  inset: auto 12px 14px;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  z-index: 5;
}

#touch-controls button {
  pointer-events: auto;
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

#touch-roll,
#touch-jump {
  border-radius: 22px;
  width: 88px;
}

#touch-controls button.active {
  background: #ffe27a;
}

.touch-move,
.touch-actions {
  display: flex;
  gap: 10px;
}

@media (hover: none), (max-width: 900px) {
  #touch-controls {
    display: flex;
  }

  #hud {
    font-size: 0.92rem;
  }
}

@media (max-width: 640px) {
  #hud {
    display: block;
    inset: 6px 8px auto;
    height: 46px;
    font-size: 12px;
  }

  .hud-left {
    position: absolute;
    top: 0;
    left: 0;
    gap: 5px;
  }

  .hud-left #hud-hearts {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .hud-right {
    position: absolute;
    top: 0;
    right: 0;
    display: grid;
    grid-template-columns: auto auto;
    column-gap: 6px;
    row-gap: 0;
    justify-items: end;
    font-size: 11px;
  }

  .hud-right > div {
    flex-shrink: 0;
    white-space: nowrap;
  }

  #hud-timer {
    grid-column: 1 / -1;
  }

  #hud-level {
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    padding: 0;
    font-size: 11px;
  }

  .hud-btn {
    padding: 4px 8px;
    font-size: 11px;
  }

  .hud-right {
    font-size: 11px;
  }

  #touch-controls button {
    width: 64px;
    height: 64px;
  }
}

@media (orientation: portrait) {
  .overlay {
    position: fixed;
  }

  #touch-controls {
    position: fixed;
    inset: auto 12px max(14px, env(safe-area-inset-bottom));
  }
}

.adventure-shell {
  --world-accent: #f2d35b;
  --world-ground: #55ad4d;
  --world-void: #285f75;
  width: min(1120px, 100%);
  height: min(690px, calc(100dvh - 32px));
  display: grid;
  grid-template-rows: auto auto auto minmax(132px, 1fr) auto auto;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 26px;
  color: #17312d;
  background: linear-gradient(145deg, rgba(249, 255, 242, 0.96), rgba(224, 247, 233, 0.94));
  box-shadow: 0 24px 70px rgba(9, 39, 42, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  animation: map-arrive 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.adventure-topbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-radius: 16px;
  color: #f5fff1;
  background: linear-gradient(100deg, #173d39, #205849 58%, #254e48);
  box-shadow: 0 8px 18px rgba(28, 75, 65, 0.17);
}

.game-logo {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.logo-bird {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}

.logo-bird::before {
  position: absolute;
  inset: 6px 4px 3px 5px;
  border: 2px solid #812d3d;
  border-radius: 58% 42% 48% 52% / 46% 52% 48% 54%;
  background: radial-gradient(circle at 33% 25%, #ff9a72, #e94b46 60%, #bd3043);
  box-shadow: inset -3px -4px 0 rgba(92, 27, 48, 0.2), 0 3px 0 rgba(0, 0, 0, 0.14);
  content: "";
}

.logo-bird-crest,
.logo-bird-eye,
.logo-bird-brow,
.logo-bird-beak,
.logo-bird-wing {
  position: absolute;
  content: "";
}

.logo-bird-crest {
  z-index: 2;
  top: 0;
  left: 17px;
  width: 10px;
  height: 14px;
  border-radius: 90% 10% 70% 15%;
  background: #f3c65e;
  transform: rotate(22deg);
}

.logo-bird-eye {
  z-index: 3;
  top: 14px;
  left: 17px;
  width: 5px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 7px 1px 0 -0.3px #fff;
}

.logo-bird-eye::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 2px;
  height: 3px;
  border-radius: 50%;
  background: #283044;
  box-shadow: 7px 1px 0 #283044;
  content: "";
}

.logo-bird-brow {
  z-index: 4;
  top: 12px;
  left: 15px;
  width: 9px;
  height: 2px;
  border-radius: 2px;
  background: #51283c;
  transform: rotate(13deg);
}

.logo-bird-beak {
  z-index: 3;
  top: 20px;
  left: 27px;
  width: 10px;
  height: 8px;
  background: #f4b747;
  clip-path: polygon(0 0, 100% 48%, 0 100%);
}

.logo-bird-wing {
  z-index: 2;
  top: 24px;
  left: 10px;
  width: 13px;
  height: 8px;
  border-radius: 80% 40% 70% 50%;
  background: #4e8991;
  transform: rotate(-17deg);
}

.logo-type {
  display: grid;
  line-height: 0.93;
}

.logo-type strong {
  font-size: 15px;
  letter-spacing: 0;
}

.logo-type small {
  margin-top: 4px;
  color: #b8dbc1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.wallet,
.player-profile {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border: 1px solid rgba(231, 255, 224, 0.18);
  border-radius: 13px;
  background: rgba(8, 34, 31, 0.27);
}

.wallet {
  color: #ffe590;
  font-size: 15px;
}

.player-profile {
  max-width: 180px;
}

.profile-avatar {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 50%;
  color: #ffe8c9;
  background: linear-gradient(145deg, #f77958, #c73537);
  font-size: 13px;
}

.profile-copy {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.profile-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy small {
  color: #bad7c8;
  font-size: 10px;
}

.icon-button,
.world-arrow {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 13px;
  color: #eff9ea;
  background: rgba(7, 34, 29, 0.28);
  font: inherit;
  font-size: 20px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.icon-button:hover,
.world-arrow:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.16);
}

.map-logout {
  color: #c5ddcf;
  font-size: 11px;
  text-decoration: none;
}

.map-logout:hover {
  color: #fff;
}

.world-banner {
  position: relative;
  display: grid;
  min-height: 104px;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  padding: 14px 20px;
  border-radius: 18px;
  color: #f7fff0;
  background:
    linear-gradient(90deg, rgba(14, 49, 54, 0.94), rgba(18, 71, 67, 0.86) 57%, rgba(29, 83, 69, 0.54)),
    linear-gradient(155deg, var(--world-ground), var(--world-void));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.world-banner::before,
.world-banner::after {
  position: absolute;
  right: -2%;
  bottom: -58px;
  width: 54%;
  height: 118px;
  border-radius: 50% 50% 0 0;
  background: color-mix(in srgb, var(--world-ground) 62%, transparent);
  content: "";
  pointer-events: none;
}

.world-banner::after {
  right: 26%;
  bottom: -77px;
  width: 46%;
  opacity: 0.55;
  background: color-mix(in srgb, var(--world-accent) 36%, transparent);
}

.world-arrow {
  position: relative;
  z-index: 1;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
  font-size: 30px;
  line-height: 1;
}

.world-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  animation: world-enter 260ms ease both;
}

.world-kicker,
.section-kicker {
  margin: 0;
  color: #a9d7be;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.world-kicker span {
  color: var(--world-accent);
}

.world-copy h1 {
  overflow: hidden;
  margin: 3px 0 1px;
  color: #fffef1;
  font-size: 26px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-copy > p:last-child {
  margin: 0;
  color: #d4eadb;
  font-size: 12px;
}

.map-heading {
  display: flex;
  min-height: 22px;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.map-heading > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.map-heading .section-kicker,
.map-footer .section-kicker {
  color: #648676;
}

.map-progress {
  color: #8ba69a;
  font-size: 11px;
}

.difficulty-chip {
  padding: 5px 9px;
  border-radius: 999px;
  color: #3c7658;
  background: #e0f0d9;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
}

.map-scroll {
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 6px 14px;
  border: 1px solid rgba(74, 127, 96, 0.13);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 247, 0.68), rgba(232, 247, 229, 0.72));
  scrollbar-color: #a8c8ad transparent;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.map-nodes {
  display: flex;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  align-items: center;
  justify-content: space-around;
  padding: 10px 8px 2px;
}

.map-entry {
  position: relative;
  display: grid;
  width: 78px;
  height: 124px;
  flex: 0 0 78px;
  grid-template-rows: 76px 14px 14px;
  align-content: start;
  justify-items: center;
}

.map-node {
  position: relative;
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(150deg, #6aab73, #377c5a);
  box-shadow: 0 7px 0 #286247, 0 10px 18px rgba(43, 102, 73, 0.18);
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.map-node:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.05);
  filter: saturate(1.12);
}

.node-symbol {
  display: grid;
  width: 100%;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
}

.node-caption {
  max-width: 100%;
  overflow: hidden;
  color: #718a7d;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-best {
  margin-top: 2px;
  color: #91a49a;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.map-node.is-complete {
  color: #4f672d;
  background: linear-gradient(145deg, #ffe98d, #f4c85c);
  box-shadow: 0 7px 0 #c49a36, 0 10px 18px rgba(184, 143, 49, 0.2);
}

.map-node.is-current {
  width: 76px;
  height: 76px;
  margin-top: -5px;
  color: #fff;
  background: radial-gradient(circle at 31% 25%, #ff9f7c, #f15345 58%, #bd302d);
  box-shadow: 0 7px 0 #9e2928, 0 0 0 7px rgba(239, 91, 68, 0.13), 0 0 26px rgba(239, 91, 68, 0.44);
  animation: node-breathe 2.4s ease-in-out infinite;
}

.map-entry.is-current .node-caption {
  color: #a34236;
}

.map-node.is-locked {
  border-color: #f0f2ea;
  color: #a8b3aa;
  background: linear-gradient(145deg, #c7d2c7, #aab9ad);
  box-shadow: 0 6px 0 #91a296;
  cursor: not-allowed;
}

.map-node:focus-visible,
.world-arrow:focus-visible,
.icon-button:focus-visible,
.play-button:focus-visible {
  outline: 3px solid #f0b949;
  outline-offset: 4px;
}

.map-link {
  width: clamp(15px, 2.4vw, 31px);
  height: 4px;
  flex: 1 1 22px;
  margin: -42px 2px 0;
  border-radius: 99px;
  background: repeating-linear-gradient(90deg, #b9d0ba 0 7px, transparent 7px 12px);
}

.map-footer {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
  padding: 0 4px;
}

.current-adventure {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.current-adventure strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-button {
  display: flex;
  min-width: 176px;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-left: auto;
  padding: 0 18px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(100deg, #eb5748, #ca3938);
  box-shadow: 0 5px 0 #9d2f30, 0 10px 20px rgba(197, 62, 52, 0.2);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.play-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.play-button:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 #9d2f30;
}

.leaderboard-details {
  position: relative;
  color: #507064;
  font-size: 11px;
}

.leaderboard-details summary {
  padding: 8px 10px;
  border: 1px solid rgba(66, 120, 86, 0.18);
  border-radius: 10px;
  cursor: pointer;
  list-style-position: inside;
  white-space: nowrap;
}

.leaderboard-details > div {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: min(310px, 78vw);
  max-height: 220px;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(66, 120, 86, 0.18);
  border-radius: 14px;
  background: #f9fff4;
  box-shadow: 0 12px 30px rgba(22, 65, 51, 0.2);
}

.leaderboard-details ol {
  margin: 0;
  padding-left: 18px;
}

.leaderboard-details li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
}

.map-status {
  min-height: 0;
  margin: -8px 4px 0;
  padding: 0;
  color: #6c8475;
  background: transparent;
  font-size: 11px;
}

.settings-panel {
  display: grid;
  gap: 18px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-block: 1px solid #d7e5d8;
}

.setting-row input {
  width: 22px;
  height: 22px;
  accent-color: #287955;
}

@keyframes map-arrive {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes world-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes node-breathe {
  0%, 100% { box-shadow: 0 7px 0 #9e2928, 0 0 0 7px rgba(239, 91, 68, 0.13), 0 0 22px rgba(239, 91, 68, 0.34); }
  50% { box-shadow: 0 7px 0 #9e2928, 0 0 0 10px rgba(239, 91, 68, 0.08), 0 0 30px rgba(239, 91, 68, 0.5); }
}

@media (max-width: 760px) {
  .adventure-shell {
    gap: 10px;
    padding: 12px;
    border-radius: 20px;
  }

  .adventure-topbar {
    padding: 8px 10px;
  }

  .logo-bird {
    width: 33px;
    height: 33px;
  }

  .logo-type strong {
    font-size: 12px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .wallet,
  .player-profile {
    min-height: 36px;
    padding: 4px 7px;
  }

  .player-profile {
    max-width: 122px;
  }

  .profile-avatar {
    width: 25px;
    height: 25px;
  }

  .profile-copy strong {
    max-width: 72px;
    font-size: 10px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .map-logout {
    display: none;
  }
}

@media (max-width: 640px) {
  #screen-menu.overlay {
    padding: 10px;
  }

  .adventure-shell {
    width: 100%;
    height: 100%;
    grid-template-rows: auto auto auto minmax(140px, 1fr) auto auto;
    padding: 10px;
  }

  .world-banner {
    min-height: 94px;
    grid-template-columns: 34px 1fr 34px;
    gap: 8px;
    padding: 10px;
  }

  .world-arrow {
    width: 34px;
    height: 34px;
  }

  .world-copy h1 {
    font-size: 20px;
  }

  .world-copy > p:last-child {
    max-width: 245px;
    font-size: 10px;
  }

  .map-scroll {
    overflow-x: hidden;
    overflow-y: auto;
    padding: 8px;
  }

  .map-nodes {
    display: grid;
    width: 100%;
    height: 100%;
    min-height: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(5, minmax(62px, 1fr));
    align-content: start;
    gap: 8px;
    padding: 0;
  }

  .map-entry {
    width: 100%;
    height: 100%;
    min-height: 62px;
    grid-template-columns: 54px minmax(0, 1fr);
    grid-template-rows: 1fr 1fr;
    align-items: center;
    justify-items: start;
    column-gap: 9px;
    padding: 3px 6px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.57);
  }

  .map-node,
  .map-node.is-current {
    width: 50px;
    height: 50px;
    margin: 0;
    border-width: 2px;
    box-shadow: 0 3px 0 #286247;
    animation: none;
  }

  .map-node.is-current {
    box-shadow: 0 3px 0 #9e2928, 0 0 0 3px rgba(239, 91, 68, 0.13);
  }

  .node-symbol {
    font-size: 15px;
  }

  .node-caption,
  .map-entry.is-current .node-caption {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    overflow: hidden;
    max-width: 100%;
    color: #355f4a;
    font-size: 9px;
    text-overflow: ellipsis;
  }

  .map-entry .node-best {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    margin: 2px 0 0;
    font-size: 8px;
  }

  .map-entry > .map-node {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .map-link {
    display: none;
  }

  .map-footer {
    gap: 8px;
  }

  .current-adventure {
    flex: 1 1 auto;
  }

  .current-adventure strong {
    font-size: 11px;
  }

  .play-button {
    min-width: 130px;
    min-height: 46px;
    padding: 0 12px;
    font-size: 11px;
  }

  .leaderboard-details summary {
    width: 42px;
    overflow: hidden;
    padding: 8px 6px;
    font-size: 0;
  }

  .leaderboard-details summary::after {
    content: "★";
    font-size: 15px;
  }
}

@media (max-width: 380px) {
  .logo-type small {
    margin-top: 2px;
    font-size: 7px;
  }

  .logo-type strong {
    font-size: 10px;
  }

  .adventure-topbar {
    gap: 6px;
  }

  .topbar-actions {
    gap: 4px;
  }

  .player-profile {
    max-width: 98px;
    gap: 5px;
    padding: 3px 5px;
  }

  .profile-avatar {
    width: 22px;
    height: 22px;
  }

  .profile-copy strong {
    max-width: 60px;
    font-size: 9px;
  }

  .profile-copy small {
    display: none;
  }

  .icon-button {
    width: 33px;
    height: 33px;
  }

  .map-nodes {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: 0.01ms !important;
}

#hud[hidden],
#touch-controls[hidden] {
  display: none;
}

#screen-title.overlay {
  align-items: stretch;
  padding: 0;
  background: rgba(7, 31, 33, 0.2);
}

.title-layout {
  display: flex;
  width: min(1360px, 100%);
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
  margin: 0 auto;
  padding: 30px 7.2% 24px;
  color: #fffdf0;
  text-shadow: 0 2px 18px rgba(13, 41, 43, 0.28);
}

.title-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.title-nav .logo-type strong {
  font-size: 16px;
}

.title-edition {
  color: rgba(255, 255, 240, 0.82);
  font-size: 10px;
  font-weight: 900;
}

.title-content {
  width: min(570px, 58%);
  margin-top: -8px;
  animation: map-arrive 550ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.title-world {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 17px;
  color: #fff4bb;
  font-size: 11px;
  font-weight: 900;
}

.title-world span:first-child {
  color: #ffe27d;
}

.title-world-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d2ed9d;
}

.title-content h1 {
  margin: 0;
  color: #fffef5;
  font-size: 76px;
  font-weight: 900;
  line-height: 0.91;
  text-shadow: 0 5px 0 rgba(24, 72, 60, 0.2), 0 10px 35px rgba(13, 41, 43, 0.23);
}

.title-tagline {
  margin: 17px 0 8px;
  color: #ffdf7c;
  font-size: 23px;
  font-weight: 900;
}

.title-description {
  max-width: 410px;
  margin: 0;
  color: rgba(255, 255, 244, 0.93);
  font-size: 15px;
  line-height: 1.5;
  text-shadow: 0 2px 12px rgba(11, 43, 43, 0.6);
}

.title-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 25px;
}

.title-play {
  display: flex;
  min-width: 214px;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  color: #263d32;
  background: #f5d46d;
  box-shadow: 0 5px 0 #c3903f, 0 14px 25px rgba(23, 53, 42, 0.22);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.title-play:hover {
  transform: translateY(-3px);
  background: #ffe68a;
}

.title-play:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 #c3903f;
}

.title-play span {
  font-size: 20px;
}

.title-map-link {
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 241, 0.66);
  color: #fffef1;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.title-map-link:hover {
  color: #ffe27d;
  border-color: #ffe27d;
}

.title-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 24px;
  color: rgba(255, 255, 239, 0.88);
  font-size: 11px;
  font-weight: 800;
}

.title-footer strong {
  color: #ffe27d;
  font-size: 15px;
}

.title-footer-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 241, 0.5);
}

.title-scene-note {
  margin-left: auto;
  color: rgba(255, 255, 239, 0.76);
  font-size: 10px;
}

.title-play:focus-visible,
.title-map-link:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

@media (max-width: 760px) {
  .title-layout {
    padding: 22px 6% 18px;
  }

  .title-content {
    width: min(500px, 72%);
    margin-top: 0;
  }

  .title-content h1 {
    font-size: 60px;
  }

  .title-tagline {
    font-size: 20px;
  }

  .title-scene-note {
    display: none;
  }
}

@media (max-width: 640px) {
  #screen-title.overlay {
    padding: 0;
  }

  .title-layout {
    padding: max(22px, env(safe-area-inset-top)) 22px max(18px, env(safe-area-inset-bottom));
  }

  .title-edition {
    max-width: 106px;
    text-align: right;
    font-size: 8px;
  }

  .title-content {
    width: min(100%, 410px);
    margin-top: -30px;
  }

  .title-content h1 {
    font-size: 52px;
  }

  .title-tagline {
    margin-top: 13px;
    font-size: 18px;
  }

  .title-description {
    max-width: 320px;
    font-size: 13px;
  }

  .title-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
  }

  .title-play {
    min-width: 206px;
    min-height: 50px;
  }

  .title-footer {
    flex-wrap: wrap;
    gap: 7px 12px;
    font-size: 9px;
  }
}

@media (max-width: 360px) {
  .title-layout {
    padding-right: 16px;
    padding-left: 16px;
  }

  .title-content h1 {
    font-size: 46px;
  }

  .title-tagline {
    font-size: 16px;
  }
}
