@font-face {
  font-family: "DM Sans";
  src: url("./dm-sans.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: "DM Sans", Arial, sans-serif;
  background: #07120e;
  color: #effaf3;
  --mint: #71f5ae;
  --muted: #96b2a1;
  --line: #253b31;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; background: radial-gradient(ellipse at 48% 0, #0d251b 0, #07120e 57%); }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
button:focus-visible, .viewport:focus-visible { outline: 2px solid var(--mint); outline-offset: -3px; }
.page { max-width: 1320px; padding: 0 46px; margin: 0 auto; }

.hero {
  height: clamp(240px, 24vw, 345px);
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-art {
  position: absolute;
  z-index: -1;
  inset: 0 -9px 0 auto;
  height: 100%;
  aspect-ratio: 11 / 7;
  pointer-events: none;
}
.hero-frame { position: absolute; inset: 0; }
.hero-sky, .hero-ground, .hero-moon { position: absolute; background-image: url("./banner.jpg"); background-repeat: no-repeat; }
.hero-sky {
  inset: 0;
  background-size: 190.909% 100%;
  background-position: right top;
  mask-image: linear-gradient(90deg, transparent 19%, #000 33%, #000 92%, transparent 100%);
}
.hero-ground {
  inset: 52% 0 0;
  background-size: 190.909% 208.333%;
  background-position: right bottom;
  mask-image: linear-gradient(90deg, transparent 0%, #000 16%, #000 26%, transparent 42%), radial-gradient(ellipse 6.5% 21.35% at 10.36% 44.94%, transparent 92%, #000 106%), radial-gradient(ellipse 16% 39% at 0 0, transparent, #000), linear-gradient(transparent, #000 15%), radial-gradient(ellipse 15% 20% at 25% 21%, #000 64%, transparent);
  mask-composite: intersect, intersect, intersect, add;
}
.hero-frame::before {
  content: "";
  position: absolute;
  left: 10.36%;
  top: 73.57%;
  width: 16%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, #286445 2%, #133d2a 44%, transparent 69%);
}
.hero-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #0a1811 0%, #0a181100 13%);
}
.hero-moon {
  left: 10.36%;
  top: 73.57%;
  width: 13.5%;
  aspect-ratio: 1;
  background-size: 1414.141% 471.38%;
  background-position: 53.279% 79.918%;
  border-radius: 50%;
  mask-image: radial-gradient(circle, #000 60%, transparent 71%);
  transform: translate(-50%, -50%);
  animation: moon-hover 7s ease-in-out infinite;
}
@keyframes moon-hover {
  0%, 100% { transform: translate(-50%, -46%); }
  50% { transform: translate(-50%, -56%); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-moon { animation: none; }
}
.hero-wordmark { padding-left: clamp(4px, 3vw, 50px); padding-bottom: 6px; display: grid; justify-items: start; gap: 6px; }
h1 { font-family: "Arial Black", "DM Sans", Arial, sans-serif; font-size: clamp(61px, 8.1vw, 121px); font-weight: 900; letter-spacing: -.086em; line-height: .95; margin: 0 0 6px; color: #f6fcf8; text-shadow: 0 4px 22px #06221766; }
.cat-word { font-family: "Arial Black", "DM Sans", Arial, sans-serif; font-size: clamp(25px, 3.4vw, 48px); font-weight: 900; letter-spacing: -.07em; line-height: .97; padding: .11em .82em .17em; border-radius: 100px; background: var(--mint); color: #073320; box-shadow: 0 0 30px #46fda130; }

.game { position: relative; overflow: hidden; border-radius: 20px; border: 1px solid #2a4939; background: #101d17; box-shadow: 0 24px 70px #0006, 0 0 1px #4ce89650; }
.game-bar, .control-bar { display: flex; align-items: center; justify-content: space-between; }
.game-bar { min-height: 64px; padding: 9px 15px 9px 20px; border-bottom: 1px solid var(--line); }
.game-name, .game-tools { display: flex; align-items: center; gap: 11px; }
.game-logo { width: 28px; height: 14px; border-radius: 99px; transform: rotate(-36deg); background: linear-gradient(90deg, #e4f8e9 49%, #72f2a6 50%); border: 1px solid #d4ffdfaa; box-shadow: 0 0 16px #7bffad3d; }
.game-name h2 { margin: 0; font-size: 17px; line-height: 1.15; font-weight: 850; letter-spacing: -.035em; }
.game-name p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.15; }
.game-tools { gap: 7px; }
.tool-button { display: grid; place-items: center; width: 37px; height: 35px; padding: 0; border: 1px solid #344b3e; color: #d6eee0; border-radius: 8px; background: #182b20; }
.tool-button:hover:enabled { border-color: #6fab89; background: #223e2e; }
.tool-button:disabled { opacity: .42; }
.reset-icon { font-size: 22px; line-height: 1; transform: translateY(-1px); }
.expand-icon { width: 15px; height: 15px; background: linear-gradient(currentColor,currentColor) left top/5px 1px, linear-gradient(currentColor,currentColor) left top/1px 5px, linear-gradient(currentColor,currentColor) right top/5px 1px, linear-gradient(currentColor,currentColor) right top/1px 5px, linear-gradient(currentColor,currentColor) left bottom/5px 1px, linear-gradient(currentColor,currentColor) left bottom/1px 5px, linear-gradient(currentColor,currentColor) right bottom/5px 1px, linear-gradient(currentColor,currentColor) right bottom/1px 5px; background-repeat: no-repeat; }

.viewport { isolation: isolate; position: relative; height: clamp(420px, 41vw, 540px); overflow: hidden; background: radial-gradient(ellipse at 50% 45%, #143b2b, #07120e 70%); }
.scene, .scene-shade { position: absolute; inset: 0; }
.scene canvas { width: 100%; height: 100%; display: block; touch-action: pan-y; }
.viewport.playing .scene canvas { touch-action: none; cursor: grab; }
.viewport.playing .scene canvas:active { cursor: grabbing; }
.scene-shade { pointer-events: none; box-shadow: inset 0 0 70px #01090662; background: linear-gradient(0deg, #010a0685, transparent 26%); }
.location, .floor-map { position: absolute; top: 16px; pointer-events: none; }
.location { left: 16px; display: flex; align-items: center; gap: 8px; border: 1px solid #6ca78866; border-radius: 6px; padding: 8px 10px; background: #061710df; font: 700 10px/1 var(--mono); color: #d0efdb; letter-spacing: .055em; }
.location-dot { background: var(--mint); width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 8px #75ffb2; }
.floor-map { width: 124px; height: auto; right: 16px; border: 1px solid #71ac8b60; border-radius: 8px; background: #061710e8; }
.intro {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.play-button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; white-space: nowrap; min-height: 47px; padding: 0 22px; border: 1px solid #9bffca; border-radius: 8px; background: var(--mint); color: #09271a; font-size: 14px; font-weight: 900; box-shadow: 0 5px 28px #0006, 0 0 22px #6affad36; }
.play-button:hover:enabled { background: #a1ffd0; }
.play-button:disabled { opacity: .82; }
.play-button:focus-visible { outline-color: #073320; }
.play-icon { width: 0; height: 0; border-block: 5px solid transparent; border-left: 8px solid #09271a; }
.launch-button {
  min-width: clamp(156px, 22vw, 224px);
  min-height: clamp(64px, 8vw, 84px);
  gap: 13px;
  padding-inline: 26px;
  border-radius: 13px;
  font-size: clamp(27px, 3.2vw, 38px);
  line-height: 1;
  pointer-events: auto;
}
.launch-button .play-icon { border-block-width: 8px; border-left-width: 13px; }
.fallback { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; padding: 20px; text-align: center; background: #05120bdd; }
.retry-button { width: auto; padding: 0 14px; }
.station-prompt { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: 85%; display: flex; align-items: center; gap: 10px; color: #f4fff6; background: #10291ff2; border: 1px solid #77efac; border-radius: 7px; min-height: 42px; padding: 6px 12px; font-weight: 800; white-space: nowrap; }
.station-prompt:hover { background: #225239; }
.station-prompt kbd { background: var(--mint); border-color: var(--mint); color: #08291b; }
.station-overlay { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 16px; background: #010b08c9; }
.station-panel { max-width: 430px; width: 100%; max-height: 100%; overflow: auto; border: 1px solid #6e806a; border-radius: 19px; padding: clamp(18px, 4vw, 30px); background: linear-gradient(148deg, #253a2c, #172a20 68%); box-shadow: 0 20px 60px #0008; }
.station-location { color: #acd3b6; font: 700 12px/1.4 "DM Sans", Arial, sans-serif; letter-spacing: .035em; margin: 0 0 10px; }
.station-panel h3 { font-size: clamp(26px, 4vw, 39px); line-height: 1; letter-spacing: -.06em; margin: 0; }
.station-description, .station-result { color: #c0d7c9; line-height: 1.48; margin: 13px 0 17px; }
.station-result { color: #edf1dc; background: #cad9a811; border-left: 2px solid #afc79a; border-radius: 0 8px 8px 0; padding: 11px 13px; }
.station-result.greentext { color: #b9e28b; border-left-color: #9abf6b; white-space: pre-line; }
.station-actions .play-button { background: #a6deb0; border-color: #bdedc3; box-shadow: none; }
.station-actions .play-button:hover { background: #c1f3c8; }
.station-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.close-button { border: 1px solid #53705f; background: transparent; color: #e0f3e7; min-height: 43px; border-radius: 8px; padding: 0 15px; }
.close-button:hover { background: #223e2e; }

.control-bar { min-height: 49px; padding: 6px 15px 6px 18px; gap: 10px; border-top: 1px solid var(--line); color: #aec3b6; font-size: 11px; }
.keyboard-controls, .keyboard-controls > span, .progress, .progress-dots { display: flex; align-items: center; }
.keyboard-controls { gap: clamp(12px, 2vw, 28px); }
.keyboard-controls > span { gap: 3px; white-space: nowrap; }
.keyboard-controls kbd:last-of-type { margin-right: 3px; }
kbd { display: inline-grid; place-items: center; border: 1px solid #426151; border-radius: 4px; padding: 2px 4px; min-width: 17px; height: 18px; color: #ecf9f0; background: #23372b; font: 700 10px/1 var(--mono); }
.progress { gap: 8px; white-space: nowrap; }
.progress-dots { gap: 4px; }
.progress-dots i { display: block; width: 5px; height: 5px; background: #3b5748; border-radius: 50%; }
.progress-dots .lit { background: var(--mint); box-shadow: 0 0 7px #7bffad72; }
.touch-help, .touch-controls { display: none; }
.moon-status {
  position: absolute;
  top: 52px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 2px 9px;
  border: 1px solid #73a88978;
  border-radius: 6px;
  color: #d5f5e1;
  background: #061710df;
  font: 700 11px/1 var(--mono);
}
.moon-status-icon { font-size: 16px; color: #b8ffdb; }
.moon-status.unlocked { border-color: #9effc9; color: #a9ffd0; }
.game-toast {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 60%;
  margin: 0;
  padding: 8px 11px;
  border: 1px solid #71ac8b80;
  border-radius: 7px;
  background: #061710ed;
  color: #e0ffeb;
  font-size: 12px;
  text-align: center;
  pointer-events: none;
}
.game-toast:empty { display: none; }
.footer { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 75px; color: #9fb6a9; font: 500 12px/1.4 var(--mono); }
.footer p { margin: 0; padding: 18px 0; }
.footer strong { color: var(--mint); font-weight: 700; }
.social-link {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #12231a;
  color: #e0f8e9;
  font: 800 20px/1 var(--mono);
  text-decoration: none;
}
.social-link:hover { border-color: #70bd90; color: var(--mint); }
.social-link:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.noscript { padding: 10px 18px; }

.game:fullscreen, .game.expanded { display: grid; grid-template-rows: auto 1fr auto; border-radius: 0; background: #07120e; }
.game.expanded { position: fixed; inset: 0; height: 100dvh; z-index: 10; }
.game:fullscreen .viewport, .game.expanded .viewport { height: 100%; min-height: 0; }
body.game-expanded { overflow: hidden; }

@media (max-width: 920px) {
  .page { padding: 0 24px; }
  .hero-wordmark { padding-left: 12px; }
  .hero-art { right: -13px; }
}
@media (max-width: 780px) {
  .keyboard-controls { gap: 13px; }
  .sprint-tip, .progress-dots { display: none !important; }
}
@media (max-width: 620px) {
  .page { padding: 0 12px; }
  .hero { height: clamp(174px, 50vw, 244px); }
  .hero-wordmark { align-self: flex-start; padding-top: clamp(22px, 8vw, 42px); padding-left: 5px; gap: 2px; }
  h1 { font-size: clamp(36px, 10.2vw, 62px); }
  .cat-word { font-size: clamp(23px, 6vw, 34px); }
  .hero-art { right: -38px; }
  .game { border-radius: 13px; }
  .game-bar { min-height: 54px; padding-inline: 12px; }
  .game-name h2 { font-size: 15px; }
  .viewport { height: clamp(365px, 65svh, 530px); }
  .floor-map { width: 84px; right: 9px; top: 9px; }
  .location { left: 9px; top: 9px; }
  .moon-status { top: 40px; left: 9px; }
  .game-toast { top: 87px; max-width: calc(100% - 24px); width: max-content; }
  .control-bar { min-height: 42px; padding-inline: 9px; }
  .keyboard-controls { gap: 8px; }
  .sprint-tip, .progress-dots { display: none !important; }
  .station-prompt { bottom: 14px; }
  .footer { min-height: 59px; }
}
@media (max-width: 620px), (any-pointer: coarse), (orientation: landscape) and (max-height: 500px) {
  .touch-help { display: block; }
  .keyboard-controls { display: none; }
  .touch-controls { position: absolute; inset: 0; display: block; pointer-events: none; }
  .joystick, .touch-actions { position: absolute; bottom: max(12px, env(safe-area-inset-bottom)); pointer-events: auto; }
  .joystick {
    left: max(13px, env(safe-area-inset-left));
    display: grid;
    place-items: center;
    width: clamp(92px, 26vw, 116px);
    aspect-ratio: 1;
    border: 1px solid #b6f8d279;
    border-radius: 50%;
    background: #10271cbe;
    box-shadow: inset 0 0 17px #07160eb2, 0 4px 16px #0005;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }
  .joystick-thumb {
    width: 43%;
    aspect-ratio: 1;
    border: 1px solid #a4edc1;
    border-radius: 50%;
    background: linear-gradient(145deg, #549873, #234a37);
    box-shadow: 0 3px 9px #05150ccf;
    pointer-events: none;
  }
  .joystick-tick { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #a8d8b8; pointer-events: none; }
  .tick-top { top: 9px; left: calc(50% - 2px); }
  .tick-bottom { bottom: 9px; left: calc(50% - 2px); }
  .tick-left { left: 9px; top: calc(50% - 2px); }
  .tick-right { right: 9px; top: calc(50% - 2px); }
  .touch-actions { right: max(13px, env(safe-area-inset-right)); display: grid; justify-items: end; gap: 9px; }
  .touch-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    min-width: 48px;
    min-height: 48px;
    padding: 0 12px;
    border: 1px solid #b6f8d279;
    border-radius: 30px;
    background: #102c20e8;
    color: #edfff4;
    font-size: 12px;
    font-weight: 800;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }
  .touch-button:active { background: #337b54; }
  .jump-button { min-width: 76px; min-height: 53px; background: #1b5739f0; }
  .jump-button span { font-size: 18px; }
  .camera-icon { display: grid; place-items: center; width: 15px; height: 15px; border: 1px solid #dcffe8; border-radius: 50%; }
  .camera-icon::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #9efdc6; }
  .station-prompt { bottom: 128px; max-width: calc(100% - 22px); min-height: 46px; white-space: normal; }
  .station-prompt kbd { display: none; }
  .moon-status { min-height: 44px; }

}
@media (orientation: landscape) and (max-height: 500px) {
  .game.expanded .game-bar, .game:fullscreen .game-bar { min-height: 44px; padding-block: 4px; }
  .game.expanded .control-bar, .game:fullscreen .control-bar { min-height: 31px; }
  .touch-actions { display: flex; align-items: end; }
  .joystick { width: 88px; }
  .station-prompt { bottom: 75px; }
  .game-toast { top: 8px; }
}
@media (max-width: 350px) {
  .control-bar { font-size: 10px; }
  .keyboard-controls { gap: 5px; }
  .keyboard-controls kbd { min-width: 13px; padding-inline: 2px; }
}
