* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #202039;
  background: #f5f3fa;
}
button {
  font: inherit;
  cursor: pointer;
}
button:focus-visible {
  outline: 3px solid #29aadd;
  outline-offset: 4px;
}
.game {
  max-width: 1100px;
  margin: auto;
  padding: 25px 40px 18px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  gap: 15px;
}
header img {
  width: 190px;
  height: 63px;
  object-fit: contain;
  mix-blend-mode: multiply;
}
header .edition {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
}
header button {
  border: 1px solid #d5d0e5;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  background: transparent;
  font-size: 20px;
  color: #62509b;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0 24px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #7764a8;
}
h1 {
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -2.8px;
  margin: 6px 0 0;
  line-height: 1;
}
h1 em {
  font-style: normal;
  color: #6953a0;
}
.stamp {
  font-size: 13px;
  line-height: 1.5;
  border-left: 2px solid #b7a9d6;
  padding-left: 20px;
  color: #716781;
}
.hud {
  display: flex;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #e8e3ef;
  border-radius: 14px;
  padding: 16px 22px;
}
.hud > div {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.hud span {
  font-size: 9px;
  letter-spacing: 1.6px;
  color: #827990;
  font-weight: bold;
}
.hud strong {
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.hud b {
  font-weight: inherit;
}
.hud small {
  font-size: 14px;
  color: #9890a6;
  font-weight: normal;
}
.round {
  text-align: center;
}
.instruction {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 20px 5px;
  color: #625577;
  min-height: 55px;
}
.station {
  position: relative;
  margin: 0 -40px;
  background: #292d3b;
  overflow: hidden;
}
.rail-label {
  height: 32px;
  background: #373b4a;
  color: #c2c7d5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  border-bottom: 4px solid #a8abb7;
}
.rail-label.bottom {
  border-bottom: 0;
  border-top: 4px solid #a8abb7;
}
.live-dot:before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  background: #94d5f0;
  border-radius: 50%;
}
canvas {
  width: 100%;
  height: 310px;
  display: block;
  touch-action: none;
  cursor: crosshair;
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #2627386e;
  backdrop-filter: blur(5px);
  padding: 12px;
}
.overlay[hidden] {
  display: none;
}
.modal {
  max-width: 450px;
  background: #f9f7fd;
  padding: 24px 32px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 12px 60px #16132340;
}
.modal h2 {
  font-size: 34px;
  letter-spacing: -1px;
  margin: 10px 0;
  color: #322746;
  line-height: 1.05;
}
.modal p {
  font-size: 13px;
  line-height: 1.5;
  color: #776c86;
  margin: 12px 0 18px;
}
.modal button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #6953a0;
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 13px 18px;
  width: 100%;
  font-weight: bold;
}
.modal small {
  display: block;
  font-size: 10px;
  color: #8d849a;
  margin-top: 12px;
}
.feedback {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 18px;
  min-height: 46px;
}
.feedback-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: #e5def2;
  color: #6953a0;
  border-radius: 12px;
  font-size: 24px;
}
.feedback > div:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.feedback span {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #84798f;
  font-weight: bold;
}
.feedback strong {
  font-size: 13px;
}
#precision {
  margin-left: auto;
  font-size: 26px;
  letter-spacing: -1px;
  color: #009f46;
  white-space: nowrap;
}
.progress {
  display: flex;
  gap: 8px;
}
.progress i {
  height: 5px;
  border-radius: 5px;
  background: #e1dbe9;
  flex: 1;
}
.progress i.done {
  background: #6953a0;
}
.progress i.active {
  background: #91d5f0;
}
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 17px;
  font-size: 10px;
  color: #908699;
}
footer button {
  border: 0;
  background: none;
  color: #70637e;
  font-size: 11px;
  padding: 6px;
}
@media (max-width: 540px) {
  .game {
    padding: 18px 20px 15px;
  }
  header .edition {
    display: none;
  }
  header img {
    width: 158px;
    height: 52px;
  }
  header {
    height: 35px;
  }
  .heading {
    margin: 23px 0 18px;
  }
  .stamp {
    font-size: 10px;
    padding-left: 12px;
  }
  h1 {
    font-size: 38px;
    letter-spacing: -2px;
  }
  .eyebrow {
    font-size: 8px;
  }
  .hud {
    padding: 14px 16px;
  }
  .hud strong {
    font-size: 23px;
  }
  .hud span {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .station {
    margin: 0 -20px;
  }
  canvas {
    height: 290px;
  }
  .rail-label {
    padding: 0 18px;
    font-size: 7px;
    letter-spacing: 1px;
  }
  .instruction {
    font-size: 11px;
    padding: 16px 0;
    min-height: 46px;
  }
  .feedback {
    gap: 10px;
    margin: 18px 0 15px;
  }
  .feedback strong {
    font-size: 11px;
  }
  #precision {
    font-size: 23px;
  }
  .modal {
    padding: 22px;
    max-width: 340px;
  }
  .modal h2 {
    font-size: 31px;
  }
  .modal p {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
@media (max-width: 540px) and (max-height: 750px) {
  .game {
    padding-top: 12px;
    padding-bottom: 10px;
  }
  .heading {
    margin: 16px 0 14px;
  }
  .stamp {
    display: none;
  }
  h1 {
    font-size: 34px;
  }
  .hud {
    padding: 12px 16px;
  }
  .instruction {
    padding: 13px 0;
    min-height: 40px;
  }
  canvas {
    height: clamp(170px, 31svh, 230px);
  }
  .feedback {
    margin: 12px 0 10px;
  }
  .feedback-icon {
    width: 32px;
    height: 32px;
  }
  .feedback strong {
    font-size: 10px;
  }
  footer {
    margin-top: 8px;
  }
  .modal {
    padding: 16px 20px;
  }
  .modal h2 {
    font-size: 27px;
    margin: 8px 0;
  }
  .modal p {
    font-size: 11px;
    margin: 9px 0 12px;
  }
  .modal small {
    margin-top: 8px;
  }
}

/* The intro demonstrates the gesture on an unobstructed conveyor. */
.station:has(.intro-overlay:not([hidden])) {
  overflow: visible;
}
.overlay.intro-overlay {
  position: relative;
  inset: auto;
  display: block;
  background: transparent;
  backdrop-filter: none;
  padding: 18px 20px;
  background: #f5f3fa;
}
.overlay.intro-overlay[hidden] {
  display: none;
}
.intro-overlay .modal {
  max-width: 560px;
  margin: auto;
  padding: 0;
  background: transparent !important;
  box-shadow: none;
  border: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 24px;
  text-align: left;
  align-items: center;
}
.intro-overlay #modal-tag,
.intro-overlay #modal-hint {
  display: none;
}
.intro-overlay .modal h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  margin: 0;
  line-height: 1.2;
}
.intro-overlay .modal p {
  font-size: 12px;
  margin: 5px 0 0;
  grid-column: 1;
}
.intro-overlay .modal button {
  grid-column: 2;
  grid-row: 1/3;
  width: 130px;
  gap: 20px;
}
html[data-theme="dark"] .overlay.intro-overlay {
  background: #15141e;
}
@media (max-width: 540px) {
  .intro-overlay .modal {
    column-gap: 12px;
  }
  .intro-overlay .modal h2 {
    font-size: 16px;
  }
  .intro-overlay .modal p {
    font-size: 10px;
  }
  .intro-overlay .modal button {
    width: 100px;
    padding: 12px;
  }
  .overlay.intro-overlay {
    padding: 14px 20px;
  }
}
/* Intro stays inside the scene, softly blurred to distinguish it from gameplay. */
.station:has(.intro-overlay:not([hidden])) {
  overflow: hidden;
}
.overlay.intro-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px 20px;
  background: rgba(245, 243, 250, 0.08);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
html[data-theme="dark"] .overlay.intro-overlay {
  background: rgba(21, 20, 30, 0.08);
}
.intro-overlay .modal {
  display: block;
  width: auto;
  text-align: center;
  margin: 0;
  padding: 0;
}
.intro-overlay .modal h2,
.intro-overlay .modal p {
  display: none;
}
.intro-overlay .modal button {
  display: flex;
  width: 190px;
  min-height: 48px;
  padding: 13px 20px;
  box-shadow: 0 5px 20px #16132340;
}
.overlay.intro-overlay[hidden] {
  display: none;
}
@media (max-width: 540px) {
  .overlay.intro-overlay {
    padding: 14px 20px;
  }
  .intro-overlay .modal button {
    width: 170px;
    min-height: 46px;
  }
}
