* {
  box-sizing: border-box;
}
html,
body,
main {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: #aacfd0;
  color: #15343a;
}
main {
  position: relative;
  isolation: isolate;
  user-select: none;
  touch-action: none;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
}
header,
footer,
.course,
.timer,
#tip {
  position: absolute;
}
header,
footer {
  left: max(4vw, env(safe-area-inset-left));
  right: max(4vw, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header {
  top: max(3.6vh, env(safe-area-inset-top));
  pointer-events: none;
}
nav {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
  touch-action: manipulation;
}
button:focus-visible {
  outline: 3px solid #ec6b28;
  outline-offset: 3px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 0.95;
}
.brand strong {
  font-size: clamp(20px, 2.15vw, 34px);
  font-weight: 950;
  letter-spacing: -1.5px;
  font-style: italic;
}
.brand small {
  display: block;
  font-weight: 850;
  font-size: 10px;
  letter-spacing: 3.7px;
  margin: 6px 0 0 2px;
}
.brand i {
  width: 30px;
  height: 34px;
  background: repeating-linear-gradient(
    122deg,
    transparent 0 4px,
    #173940 4px 10px
  );
  clip-path: polygon(30% 0, 100% 0, 70% 100%, 0 100%);
}
nav button {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid #23464a4a;
  border-radius: 12px;
  background: #f1f7eec9;
}
button:hover {
  filter: brightness(1.08);
}
svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.course {
  left: 4vw;
  top: 17%;
  pointer-events: none;
}
.tag,
.timer,
.pedal span,
kbd,
.eyebrow {
  font-family: "Courier New", monospace;
  font-weight: bold;
}
.tag,
.eyebrow {
  font-size: 12px;
  letter-spacing: 1.4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.flag {
  width: 17px;
  height: 12px;
  display: inline-block;
  transform: skew(-9deg);
  background: repeating-conic-gradient(#214347 0% 25%, transparent 0% 50%) 0
    0/8px 8px;
}
.course h1 {
  margin: 4px 0 10px;
  font-size: clamp(28px, 3.7vw, 61px);
  letter-spacing: -0.055em;
  font-weight: 870;
  line-height: 1;
}
.progress {
  width: 105px;
  height: 4px;
  border-radius: 3px;
  background: #16393c36;
}
.progress i {
  display: block;
  height: 100%;
  background: #d96928;
  border-radius: 3px;
  width: 0;
}
.timer {
  right: 4vw;
  top: 17%;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.timer svg {
  width: 18px;
}
footer {
  bottom: max(4.8vh, env(safe-area-inset-bottom));
  pointer-events: none;
}
.pedal {
  pointer-events: auto;
  touch-action: none;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f4f5e9;
  border: 1px solid #94b3ab70;
  background: #183738ed;
  border-radius: 14px;
  padding: 9px 13px;
  box-shadow: 0 4px 0 #102e34;
}
.pedal b {
  background: #f1f0d9;
  color: #213b39;
  border-radius: 8px;
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  font-size: 23px;
}
.pedal.gas b {
  background: #ffbe4d;
}
.pedal span {
  font-size: 13px;
  letter-spacing: 1px;
}
.pedal kbd {
  font-size: 12px;
  padding: 2px 5px;
  border: 1px solid #ffffff55;
  border-radius: 4px;
  letter-spacing: 0;
}
.pedal.active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #102e34;
}
.pedal.active b {
  background: #ff9632;
}
#tip {
  left: 50%;
  bottom: 7%;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
  color: #fcf4db;
  font-size: 14px;
  font-weight: 660;
  text-shadow: 0 1px 3px #102d37;
  background: #173b40cf;
  border-radius: 99px;
  padding: 8px 15px;
  transition: opacity 0.25s;
}
#tip span {
  padding: 0 3px;
  color: #ffc86a;
}
dialog {
  color: #17383e;
  border: 1px solid #aec1ab;
  border-radius: 22px;
  background: #f4f3e3;
  padding: 28px;
  width: min(400px, 90vw);
  max-height: 87dvh;
  box-shadow: 0 18px 80px #0e252d66;
}
dialog::backdrop {
  background: #12303b80;
}
.eyebrow {
  color: #73512a;
}
dialog h2 {
  font-size: clamp(30px, 5vw, 45px);
  letter-spacing: -0.055em;
  margin: 8px 0 12px;
}
dialog p {
  font-size: 16px;
  margin: 0 0 20px;
}
dialog button {
  min-height: 44px;
  border: 1px solid #9fae9e;
  border-radius: 9px;
  background: #e3e8d9;
  font-weight: 750;
}
dialog button:disabled {
  opacity: 0.45;
  cursor: default;
}
.actions {
  display: grid;
  gap: 8px;
}
.actions button:first-child,
.levels button.current {
  background: #ffbf58;
  border-color: #bf8937;
}
.levels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin: 16px 0;
}
.fine {
  font: 600 13px/1.5 monospace;
  color: #51675d;
  margin: 12px 0;
}
@media (max-width: 640px) {
  .brand i {
    width: 23px;
    height: 26px;
  }
  nav {
    gap: 5px;
  }
  nav button {
    width: 38px;
    height: 38px;
  }
  .course,
  .timer {
    top: 15%;
  }
  .pedal {
    gap: 6px;
    padding: 7px;
  }
  .pedal kbd {
    display: none;
  }
  #tip {
    bottom: 15%;
    font-size: 12px;
  }
  .pedal span {
    font-size: 11px;
  }
  .timer {
    font-size: 13px;
  }
}
@media (max-height: 480px) {
  .course,
  .timer {
    top: 22%;
  }
  .course h1 {
    font-size: 27px;
  }
  #tip {
    bottom: 5%;
  }
  nav button {
    width: 37px;
    height: 37px;
  }
  .pedal {
    padding: 5px 9px;
  }
  .pedal b {
    width: 32px;
    height: 32px;
  }
}
