@font-face {
  font-family: Round;
  src: url(round.woff2);
}
@font-face {
  font-family: Narrow;
  src: url(narrow.woff2);
}
:root {
  --ink: #283248;
  --cream: #fff3cf;
  --pink: #fb86a6;
  --orange: #ffcb59;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  color: var(--ink);
  font-family: Round, system-ui, sans-serif;
  background: #a1dadb;
}
button {
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible {
  outline: 4px dashed #954265;
  outline-offset: 5px;
}
button:hover {
  filter: brightness(1.045);
}
button:active {
  translate: 0 2px;
}
#sky,
#world,
.frame {
  position: fixed;
  inset: 0;
}
#sky {
  background: url(sky.svg) center/cover;
}
.frame {
  inset: 12px;
  border: 2px solid #30455777;
  border-radius: 12px;
  pointer-events: none;
  z-index: 3;
}
.frame:before,
.frame:after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 5px;
  background: repeating-linear-gradient(
    -50deg,
    #d76667 0 13px,
    transparent 13px 26px,
    #689598 26px 39px,
    transparent 39px 52px
  );
  opacity: 0.76;
}
.frame:before {
  top: 0;
}
.frame:after {
  bottom: 0;
}
header {
  position: fixed;
  top: 5.4%;
  left: 4.5%;
  right: 4.5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
  pointer-events: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand svg {
  width: 53px;
}
.brand span {
  font: 700 19px/0.86 Narrow;
  letter-spacing: 1px;
}
.tools {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}
.circle {
  background: var(--cream);
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  box-shadow: 0 3px var(--ink);
  display: grid;
  place-items: center;
  font: 700 25px/1 Arial;
}
.circle svg {
  width: 21px;
  height: 21px;
}
#world {
  display: none;
}
#world canvas {
  display: block;
  width: 100%;
  height: 100%;
}
#menu {
  position: fixed;
  inset: 0;
}
.poster {
  position: absolute;
  top: 50%;
  right: 1%;
  width: min(60vw, 91vh);
  transform: translateY(-48%);
  pointer-events: none;
}
.title-block {
  position: absolute;
  left: 9%;
  top: 49%;
  transform: translateY(-50%);
  z-index: 1;
}
.route,
small {
  font: 700 15px/1.1 Narrow;
  letter-spacing: 2px;
}
.route {
  display: flex;
  align-items: center;
  gap: 9px;
}
.route i {
  width: 22px;
  height: 3px;
  background: currentColor;
}
h1 {
  margin: 18px 0 12px;
  transform: rotate(-5deg) skewX(-5deg);
  transform-origin: 35% center;
  font: 800 clamp(84px, min(10.8vw, 17vh), 170px)/0.78 Round;
  letter-spacing: -0.057em;
  color: #fff6d9;
  -webkit-text-stroke: clamp(4px, 0.75vw, 11px) var(--ink);
  paint-order: stroke fill;
  text-shadow: 0.014em 0.067em var(--ink);
}
h1 span {
  display: block;
}
h1 span + span {
  color: #ff91ad;
  position: relative;
  padding-bottom: 0.09em;
}
h1 b {
  font: 800 0.31em/.98 Round;
  letter-spacing: -0.04em;
  -webkit-text-stroke: 0;
  color: var(--ink);
  background: var(--orange);
  text-shadow: none;
  display: inline-block;
  transform: rotate(12deg) skewX(4deg);
  padding: 0.11em 0.17em 0;
  border: 0.075em solid var(--ink);
  border-radius: 0.22em;
  box-shadow: 0 0.08em var(--ink);
  vertical-align: 0.28em;
  margin-left: 0.26em;
}
.title-block p {
  font:
    600 clamp(14px, 1.4vw, 20px)/1.48 system-ui,
    sans-serif;
  margin: 18px 0 22px;
}
.primary {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  font: 800 clamp(23px, 2.5vw, 33px)/1 Round;
  padding: 12px 27px 9px;
  border: 3px solid var(--ink);
  border-radius: 13px;
  background: var(--orange);
  box-shadow: 1px 5px var(--ink);
  transition: transform 0.13s;
}
.primary:hover {
  transform: translateY(-2px);
}
.primary svg {
  width: 18px;
  fill: currentColor;
}
.legend,
.touch-note {
  position: fixed;
  bottom: 5.3%;
  left: 4.5%;
  align-items: center;
  gap: 23px;
  font: 700 17px Narrow;
  display: flex;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.legend em {
  margin: 0 3px;
  color: #758378;
}
.legend kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 23px;
  padding: 0 4px;
  border: 1.5px solid #59605c;
  background: #fff8df;
  border-radius: 4px;
  box-shadow: 0 2px #959785;
  font: 700 14px Narrow;
}
.legend kbd:last-of-type {
  margin-right: 5px;
}
.touch-note {
  display: none;
}
.playing,
#touch {
  display: none;
}
body:not([data-mode="menu"]) #world {
  display: block;
}
body:not([data-mode="menu"]) #menu,
body:not([data-mode="menu"]) .legend,
body:not([data-mode="menu"]) .touch-note,
body:not([data-mode="menu"]) .frame {
  display: none;
}
body[data-mode="race"] .playing {
  display: flex;
}
body:not([data-mode="menu"]) header {
  top: 16px;
  left: 20px;
  right: 20px;
}
body:not([data-mode="menu"]) .brand {
  padding: 6px 9px;
  background: var(--cream);
  border: 2px solid;
  border-radius: 9px;
}
#hud {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cream);
  border: 2px solid;
  border-radius: 12px;
  box-shadow: 0 3px;
  align-items: center;
  padding: 7px 18px;
  gap: 18px;
  text-align: center;
}
#hud div + div {
  border-left: 1px dashed;
  padding-left: 18px;
}
#hud small,
.ticket small {
  display: block;
  font-size: 12px;
}
#hud strong {
  font: 800 23px/1.2 Round;
  font-variant-numeric: tabular-nums;
}
#toast,
#hint {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}
#toast {
  top: 20%;
  color: var(--cream);
  font: 800 clamp(27px, 4vw, 52px)/1.1 Round;
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  white-space: nowrap;
  text-shadow: 0 4px var(--ink);
}
#hint {
  bottom: 16%;
  background: var(--cream);
  padding: 5px 14px;
  border: 2px solid;
  border-radius: 20px;
  font: 700 16px Narrow;
  white-space: nowrap;
}
#hint:empty {
  display: none;
}
#modal:not([hidden]) {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #25374967;
  z-index: 6;
}
.ticket {
  background: #fff3d1;
  border: 3px solid;
  border-radius: 16px;
  box-shadow: 5px 7px var(--ink);
  width: min(380px, 87vw);
  padding: 32px 26px;
  text-align: center;
}
.ticket h2 {
  font: 800 48px/0.95 Round;
  letter-spacing: -2px;
  margin: 18px 0;
}
.ticket p {
  font: 600 15px/1.5 system-ui;
}
.ticket #secondary {
  display: block;
  margin: 20px auto 0;
  background: none;
  border: 0;
  text-decoration: underline;
  font: 700 17px Narrow;
}
#metrics {
  display: flex;
  justify-content: center;
  gap: 20px;
}
#metrics strong {
  font: 800 23px Round;
}
.ticket .primary {
  font-size: 25px;
}
#touch {
  pointer-events: none;
  position: fixed;
  bottom: max(36px, env(safe-area-inset-bottom));
  left: 19px;
  right: 22px;
  align-items: end;
  justify-content: space-between;
}
#touch > * {
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#stick {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: #fff3cf9c;
  display: grid;
  place-items: center;
}
#stick i {
  width: 43px;
  height: 43px;
  border-radius: 50%;
  border: 2px solid;
  background: #ffcab0;
}
#jump {
  border: 2px solid;
  border-radius: 50%;
  background: var(--orange);
  width: 74px;
  height: 74px;
  box-shadow: 0 4px;
  font-size: 21px;
}
@media (pointer: coarse) {
  body[data-mode="race"] #touch {
    display: flex;
  }
  .legend {
    display: none;
  }
  .touch-note {
    display: block;
  }
}
@media (min-width: 641px) and (pointer: coarse) {
  #touch {
    bottom: 88px;
  }
}
@media (max-width: 650px) and (orientation: portrait) {
  header {
    top: 30px;
    left: 7%;
    right: 7%;
  }
  .title-block {
    top: 17%;
    left: 8%;
    transform: none;
  }
  h1 {
    font-size: min(22vw, 11vh);
    margin: 13px 0 8px;
  }
  .title-block p {
    font-size: 13px;
    margin: 10px 0 14px;
  }
  .route {
    font-size: 12px;
  }
  .primary {
    font-size: 22px;
    padding: 10px 19px 8px;
  }
  .poster {
    width: min(88vw, 48vh);
    top: auto;
    bottom: 6%;
    right: 1%;
    transform: none;
  }
  .legend,
  .touch-note {
    bottom: 4%;
    left: 7%;
    font-size: 14px;
    gap: 10px;
  }
  .legend em,
  .legend kbd:nth-of-type(n + 5) {
    display: none;
  }
  .brand svg {
    width: 42px;
  }
  .brand span {
    font-size: 16px;
  }
  body:not([data-mode="menu"]) header .brand {
    display: none;
  }
  body:not([data-mode="menu"]) .tools {
    margin-left: auto;
  }
  #hud {
    left: 14px;
    transform: none;
    padding: 5px 10px;
    gap: 9px;
  }
  #hud div + div {
    padding-left: 9px;
  }
  #hint {
    top: 82px;
    bottom: auto;
  }
  .circle {
    width: 36px;
    height: 36px;
  }
}
@media (max-height: 460px) and (orientation: landscape) {
  .brand span {
    font-size: 14px;
  }
  .brand svg {
    width: 39px;
  }
  .route {
    font-size: 11px;
  }
  h1 {
    font-size: 18vh;
    margin: 6px 0;
  }
  .title-block p {
    font-size: 12px;
    margin: 8px 0;
  }
  .primary {
    font-size: 20px;
    padding: 7px 14px;
  }
  .legend {
    bottom: 5%;
    font-size: 13px;
  }
  .ticket {
    padding: 18px;
  }
  .ticket h2 {
    font-size: 35px;
  }
  .poster {
    width: 92vh;
  }
}
