:root {
  color-scheme: dark;
  --cream: #fff0d3;
  --muted: #9fa9b7;
  --orange: #ed5424;
  --yellow: #ffc650;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #11141b;
  color: var(--cream);
  font:
    13px/1.5 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  background-image: radial-gradient(
    ellipse at 50% 35%,
    #243242 0,
    transparent 65%
  );
}
button,
a,
input {
  touch-action: manipulation;
}
button {
  font: 700 11px/1.4 inherit;
  font-family: inherit;
  border: 1px solid #435064;
  background: #1c2430;
  color: var(--cream);
  cursor: pointer;
  padding: 10px 13px;
  min-height: 40px;
}
button:hover {
  border-color: var(--yellow);
  background: #2c3543;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.topbar {
  height: 76px;
  max-width: 1260px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 28px;
}
.back {
  font-size: 10px;
  letter-spacing: 1px;
  color: #b2bdcc;
  text-decoration: none;
}
.edition {
  letter-spacing: 2px;
  font-size: 10px;
  color: #a7b0bd;
}
.edition i {
  color: var(--orange);
  font-style: normal;
  margin: 0 8px;
}
.tools {
  display: flex;
  gap: 8px;
}
.tools button {
  font-size: 10px;
}
.tools #fullscreen {
  font-size: 22px;
  padding: 0 13px;
}
main {
  max-width: 1050px;
  padding: 0 30px 30px;
  margin: auto;
}
.cabinet {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: auto;
  background: #6385f6;
  overflow: hidden;
  border: 6px solid #222b37;
  box-shadow:
    0 0 0 1px #4c5665,
    0 22px 70px #0007;
}
canvas {
  width: 100%;
  display: block;
  image-rendering: pixelated;
  aspect-ratio: 4/3;
  outline: none;
}
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  padding: 3.5% 5%;
  font-size: clamp(10px, 1.65vw, 18px);
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1.1;
  text-shadow: 2px 2px #172153;
  pointer-events: none;
}
.hud strong {
  display: block;
  font: inherit;
}
.coin-count {
  padding-top: 1em;
  white-space: nowrap;
}
.coin-count strong {
  display: inline;
}
.coin-count span {
  color: #ffd15b;
  text-shadow: 2px 2px #ad460f;
}
.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(#05102032, #10141bc9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
}
.panel {
  width: 83%;
  text-align: center;
  padding: 18px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 4px;
  color: #fff0ce;
  margin: 0 0 12px;
}
h1 {
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(40px, 8vw, 90px);
  line-height: 0.88;
  margin: 0;
  color: #fff0cc;
  letter-spacing: 1px;
  text-shadow:
    4px 4px #973513,
    7px 7px #351706;
  background: #e95015;
  padding: 20px 12px;
  border: 3px solid #ffd289;
  box-shadow: 0 7px #391b13;
}
h1 span {
  color: #ffc450;
}
#message {
  font-size: clamp(12px, 1.7vw, 17px);
  margin: 24px 0 18px;
}
.route {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 18px 0 25px;
}
.route span {
  color: #ffcb6b;
  font-size: 16px;
}
.route small {
  display: block;
  font-size: 8px;
  letter-spacing: 1px;
  color: #dddacb;
}
.primary {
  display: block;
  margin: 0 auto;
  background: var(--yellow);
  border: 2px solid #ffefa8;
  color: #352616;
  box-shadow: 0 4px #a26b1a;
  padding: 13px 24px;
  font-weight: 900;
  font-size: 13px;
}
.primary:hover {
  background: #ffe38d;
}
.secondary {
  display: block;
  margin: 15px auto 0;
  background: #17212e;
}
.hint {
  font-size: 9px;
  letter-spacing: 2px;
  margin: 20px 0 0;
  color: #bcbec5;
}
.intro {
  position: absolute;
  inset: 0;
  background: #07080c;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  font-size: 20px;
  letter-spacing: 2px;
}
.intro strong {
  font-size: 12px;
  color: #f7c46b;
}
.touch {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  z-index: 3;
  display: none;
  justify-content: space-between;
  pointer-events: none;
}
.touch button {
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: #1018269c;
  border: 2px solid #fff7cc80;
  border-radius: 5px;
  width: 52px;
  height: 50px;
  min-height: 44px;
  font-size: 18px;
  padding: 4px;
}
.touch button[data-action="jump"] {
  border-color: #ffa464;
  background: #9c381599;
}
.touch button.active {
  background: #f8c651;
  color: #201912;
}
.touch small {
  display: block;
  font-size: 7px;
  letter-spacing: 1px;
}
.dpad,
.ab {
  display: flex;
  gap: 6px;
  align-items: end;
}
.ab button {
  border-radius: 50%;
  height: 57px;
  width: 57px;
}
.ab button:last-child {
  margin-bottom: 9px;
}
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  color: #a4afbd;
  font-size: 10px;
  padding: 14px 0;
}
footer p {
  margin: 0;
}
footer span {
  color: #edbd73;
  white-space: nowrap;
}
kbd {
  display: inline-block;
  border: 1px solid #3f4d5f;
  background: #1a222d;
  padding: 2px 5px;
  margin: 0 3px 0 7px;
  font: 10px monospace;
  border-radius: 2px;
}
.instructions {
  color: #aab5c3;
  border-top: 1px solid #2c3745;
  padding: 14px 0;
  max-width: 960px;
  margin: auto;
  font-size: 12px;
}
.instructions summary {
  cursor: pointer;
  color: #d4deec;
}
.instructions p {
  max-width: 800px;
}
.audio-settings {
  display: flex;
  gap: 20px;
  align-items: center;
}
.audio-settings label {
  display: flex;
  gap: 10px;
  align-items: center;
}
input {
  max-width: 130px;
  accent-color: #ffc650;
}
.rotate {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #11141bf5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 25px;
}
.rotate span {
  font-size: 64px;
  color: #ffc650;
}
.rotate h2 {
  font-size: 22px;
}
.rotate p {
  color: #bdc7d2;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (pointer: coarse) {
  .touch {
    display: flex;
  }
  footer p {
    display: none;
  }
  .instructions {
    font-size: 11px;
  }
}
@media (max-height: 650px) and (orientation: landscape) {
  .topbar {
    height: 44px;
    padding: 0 16px;
  }
  .edition {
    display: none;
  }
  main {
    padding: 0 12px 14px;
    max-width: calc((100dvh - 88px) * 1.3333 + 24px);
  }
  .cabinet {
    border-width: 3px;
  }
  .hud {
    font-size: 11px;
  }
  .panel {
    padding: 8px;
  }
  h1 {
    font-size: 40px;
    padding: 10px;
  }
  .eyebrow {
    font-size: 8px;
    margin-bottom: 7px;
  }
  #message {
    margin: 12px 0;
    font-size: 12px;
  }
  .route {
    margin: 8px 0 12px;
    gap: 10px;
  }
  .route span {
    font-size: 11px;
  }
  .route small {
    font-size: 6px;
  }
  .primary {
    padding: 8px 15px;
    font-size: 10px;
    min-height: 36px;
  }
  .hint {
    margin: 12px 0 0;
    font-size: 7px;
  }
  .secondary {
    margin-top: 8px;
    min-height: 32px;
    padding: 6px 10px;
  }
  footer {
    padding: 6px 0;
  }
  .touch {
    bottom: 5px;
    left: 5px;
    right: 5px;
  }
  .touch button {
    width: 44px;
    height: 44px;
  }
  .ab button {
    width: 48px;
    height: 48px;
  }
  .topbar button {
    min-height: 32px;
    padding: 6px 9px;
  }
  .instructions {
    margin-top: 8px;
  }
  .intro {
    gap: 12px;
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}

@media (max-height: 650px) and (orientation: landscape) {
  .eyebrow {
    display: none;
  }
  footer p {
    display: none;
  }
}

@media (pointer: coarse) and (max-height: 650px) and (orientation: landscape) {
  .touch {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
  }
}


body.play-mode {
  --play-touch-left: 0px;
  --play-touch-right: 0px;
  overflow: hidden;
  background: #080a13;
}
.play-mode .topbar {
  position: fixed;
  inset: 0 0 auto;
  height: calc(44px + env(safe-area-inset-top));
  max-width: none;
  padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
  justify-content: center;
  z-index: 8;
  background: #080a13;
}
.play-mode .back,
.play-mode .edition,
.play-mode footer,
.play-mode .instructions {
  display: none;
}
.play-mode .tools { gap: 8px; }
.play-mode .tools button {
  min-height: 40px;
  padding: 6px 12px;
}
.play-mode main {
  position: fixed;
  inset: calc(44px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  max-width: none;
  margin: 0;
  padding: 0 var(--play-touch-right) 0 var(--play-touch-left);
  display: flex;
  align-items: center;
  justify-content: center;
}
.play-mode .cabinet {
  flex: none;
  width: min(100%, calc((100dvh - 44px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 4 / 3));
  max-width: none;
  margin: 0;
  border: 0;
  box-shadow: none;
}
@media (pointer: coarse) {
  body.play-mode { --play-touch-left: 156px; --play-touch-right: 112px; }
  .play-mode .touch {
    position: fixed;
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
  }
  .play-mode .touch button { width: 44px; height: 44px; }
  .play-mode .ab button { width: 48px; height: 48px; }
}
