:root {
  --cream: #f7edd6;
  --gold: #efc578;
  --cyan: #8cf1d5;
  --ink: #112a29;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
#viewport,
#viewport canvas,
#shade,
#damage,
#coin-flash {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}
#viewport {
  touch-action: none;
}
#shade {
  pointer-events: none;
  background:
    linear-gradient(90deg, #092927f2, #092927a0 38%, transparent 75%),
    linear-gradient(0deg, #0a262ccc, transparent 35%);
}
header {
  position: fixed;
  top: 30px;
  left: 38px;
  right: 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
}
.brand {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--cream);
  text-decoration: none;
  font-weight: 650;
}
.brand > span {
  font-size: 28px;
  color: var(--gold);
  vertical-align: middle;
  margin-right: 10px;
}
.header-right {
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: 10px;
  letter-spacing: 2px;
}
#pause {
  background: #112a29aa;
  color: var(--cream);
  border: 1px solid #ffffff40;
  padding: 8px 12px;
}
#menu {
  position: fixed;
  top: 24%;
  left: 8%;
  max-width: 540px;
  z-index: 4;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gold);
}
h1 {
  font-size: clamp(52px, 6vw, 88px);
  line-height: 1.1;
  letter-spacing: 7px;
  margin: 28px 0;
}
h1 span {
  color: var(--gold);
}
.intro {
  color: #d3ddd0;
  font-size: 15px;
  line-height: 1.9;
  margin: 24px 0 30px;
}
.primary {
  display: flex;
  gap: 70px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 25px;
  min-width: 235px;
  color: var(--ink);
  background: var(--gold);
  border: 1px solid var(--gold);
  font-size: 15px;
  font-weight: 650;
}
.primary > span {
  font-size: 23px;
  font-weight: 400;
}
.primary:hover {
  background: #ffe0a1;
}
.best-line {
  font-size: 11px;
  color: #bfccbf;
  margin: 22px 0 32px;
  letter-spacing: 1px;
}
.best-line b {
  color: var(--gold);
  font-size: 16px;
  margin: 0 5px;
}
.best-line > span {
  margin: 0 7px;
}
.controls {
  border-top: 1px solid #e9e9ce30;
  padding-top: 13px;
}
.controls p {
  font-size: 11px;
  color: #becfc5;
  line-height: 1.8;
  margin: 9px 0;
}
.controls kbd {
  border: 1px solid #e3eacf40;
  background: #102c2970;
  color: #eff1df;
  font-size: 10px;
  padding: 3px 6px;
  margin-right: 9px;
}
.controls .hint {
  max-width: 400px;
  color: #93b4a7;
  font-size: 10px;
  margin-top: 17px;
}
.menu-goals {
  display: flex;
  gap: 22px;
  margin-top: 24px;
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 1px;
}
footer {
  position: fixed;
  bottom: 25px;
  left: 38px;
  right: 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 2px;
  color: #c7d4c4;
  z-index: 6;
}
footer > div {
  display: flex;
  gap: 25px;
}
footer label {
  display: flex;
  align-items: center;
  gap: 9px;
}
select {
  background: #1d3835;
  border: 1px solid #ffffff40;
  color: var(--cream);
  font-size: 11px;
  padding: 3px;
}
input {
  accent-color: var(--gold);
}
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  text-shadow: 0 2px 8px #102925;
}
.distance {
  position: absolute;
  top: 107px;
  left: 38px;
}
.distance > span {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gold);
}
.distance strong {
  display: block;
  font-size: 48px;
  font-weight: 450;
  letter-spacing: 1px;
  line-height: 1.35;
}
.distance small {
  font-size: 13px;
  margin-left: 7px;
  color: #d4e3cf;
}
.distance > div {
  font-size: 10px;
  color: #b3d2c9;
  letter-spacing: 1px;
}
.score {
  position: absolute;
  right: 38px;
  top: 112px;
  text-align: right;
}
.score > span {
  font-size: 28px;
  letter-spacing: 3px;
}
.score > div {
  font-size: 11px;
  color: #d6d8b9;
  margin: 10px 0;
}
.score i {
  color: var(--gold);
  font-style: normal;
  margin-right: 6px;
}
.score b {
  font-size: 21px;
  font-weight: 500;
  color: var(--gold);
  margin-right: 5px;
}
.score > small {
  font-size: 10px;
  color: var(--cyan);
}
#turn-cue {
  position: absolute;
  left: 50%;
  top: 95px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  background: #112b29d9;
  border-top: 2px solid var(--gold);
  padding: 12px 24px;
  min-width: 275px;
}
#turn-arrow {
  font-size: 42px;
  color: var(--gold);
  line-height: 1;
}
#turn-cue strong {
  display: block;
  font-size: 17px;
  letter-spacing: 3px;
}
#turn-cue small {
  display: block;
  font-size: 10px;
  color: #c4d6c5;
  margin-top: 7px;
}
#turn-cue.ready {
  border-color: var(--cyan);
}
#turn-cue.ready #turn-arrow {
  color: var(--cyan);
}
#obstacle-hint {
  position: absolute;
  left: 50%;
  top: 27%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--gold);
  white-space: nowrap;
}
#notice {
  position: absolute;
  left: 50%;
  bottom: 23%;
  transform: translateX(-50%);
  width: 90%;
  text-align: center;
  color: var(--cyan);
  font-size: 14px;
  letter-spacing: 2px;
}
.bottom-status {
  position: absolute;
  left: 38px;
  right: 38px;
  bottom: 68px;
  display: flex;
  justify-content: space-between;
  align-items: end;
}
.health > span {
  font-size: 10px;
  letter-spacing: 2px;
  color: #d3ded0;
}
#hearts {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
#hearts i {
  display: block;
  width: 38px;
  height: 5px;
  background: var(--cyan);
  box-shadow: 0 0 10px #72e0c722;
}
#hearts i.empty {
  background: #9db7ab30;
}
.health small {
  font-size: 10px;
  color: #aecbc0;
}
.missions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 10px;
  color: #c8d3bc;
  margin-left: -30px;
}
.missions .done {
  color: var(--gold);
}
.powers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 11px;
  text-align: right;
  color: #b9cbc1;
}
.powers .active {
  color: var(--cyan);
}
.bottom-hint {
  position: absolute;
  bottom: 25px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 10px;
  letter-spacing: 2px;
  color: #b7c8bc;
}
#damage {
  pointer-events: none;
  z-index: 4;
  box-shadow: inset 0 0 140px 35px #df4137;
  opacity: 0;
}
#coin-flash {
  pointer-events: none;
  z-index: 4;
  box-shadow: inset 0 0 90px 10px #ffdb76;
  opacity: 0;
}
#overlay {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: #0d282bd9;
  backdrop-filter: blur(8px);
  padding: 25px;
}
.result-panel {
  width: 100%;
  max-width: 470px;
  border-top: 2px solid var(--gold);
  padding: 36px;
  background: #132e2dee;
}
.result-panel h2 {
  font-size: 36px;
  letter-spacing: 3px;
  margin: 25px 0 14px;
}
.result-panel p {
  color: #b5cbbf;
  font-size: 13px;
  line-height: 1.8;
}
.result-panel .primary {
  width: 100%;
  margin-top: 28px;
}
.secondary {
  display: block;
  background: transparent;
  border: 0;
  color: #c9d7c9;
  font-size: 12px;
  margin: 20px auto 0;
}
#result-stats {
  display: flex;
  gap: 28px;
  margin: 28px 0;
  color: var(--gold);
  font-size: 26px;
}
#result-stats small {
  display: block;
  font-size: 10px;
  color: #b2c5b6;
  letter-spacing: 2px;
  margin-top: 6px;
}
#touch-controls {
  display: none;
}
body.playing #shade {
  background: linear-gradient(
    180deg,
    #0b2426bb,
    transparent 30%,
    transparent 63%,
    #102a2beb
  );
}
body.playing footer {
  display: none;
}
@media (max-height: 740px) {
  #menu {
    top: 17%;
  }
  h1 {
    font-size: 62px;
    margin: 21px 0;
  }
  .intro {
    margin: 18px 0 22px;
  }
  .best-line {
    margin: 17px 0 21px;
  }
  .menu-goals {
    margin-top: 17px;
  }
}
@media (max-width: 700px) {
  header {
    top: 18px;
    left: 20px;
    right: 20px;
  }
  .brand {
    font-size: 10px;
    letter-spacing: 2px;
  }
  .brand > span {
    font-size: 22px;
  }
  .header-right {
    gap: 12px;
  }
  #menu {
    left: 7%;
    top: 21%;
    width: 86%;
  }
  h1 {
    font-size: 52px;
  }
  .intro {
    font-size: 13px;
  }
  .controls .hint {
    max-width: 270px;
  }
  .menu-goals {
    gap: 12px;
    font-size: 9px;
  }
  .best-line {
    font-size: 9px;
  }
  footer {
    left: 20px;
    right: 20px;
    bottom: 17px;
  }
  footer > span {
    display: none;
  }
  footer > div {
    width: 100%;
    justify-content: space-between;
  }
  .distance {
    left: 20px;
    top: 79px;
  }
  .distance strong {
    font-size: 36px;
  }
  .score {
    right: 20px;
    top: 85px;
  }
  .score > span {
    font-size: 22px;
  }
  #turn-cue {
    top: 165px;
    min-width: 235px;
    padding: 9px 17px;
  }
  #turn-arrow {
    font-size: 33px;
  }
  #turn-cue strong {
    font-size: 14px;
  }
  #obstacle-hint {
    top: 32%;
    font-size: 10px;
  }
  .bottom-status {
    left: 20px;
    right: 20px;
    bottom: 140px;
  }
  .missions {
    display: none;
  }
  .bottom-hint {
    display: none;
  }
  #notice {
    bottom: 34%;
    font-size: 12px;
  }
  #touch-controls {
    display: flex;
    position: absolute;
    bottom: 26px;
    left: 18px;
    right: 18px;
    justify-content: space-between;
    pointer-events: auto;
  }
  #touch-controls > div {
    display: flex;
    gap: 10px;
  }
  #touch-controls button {
    width: 52px;
    height: 52px;
    border: 1px solid #d7e8ce50;
    background: #183b39bd;
    color: var(--cream);
    font-size: 26px;
    border-radius: 50%;
    touch-action: manipulation;
  }
  .result-panel {
    padding: 25px;
  }
  .result-panel h2 {
    font-size: 30px;
  }
  #result-stats {
    gap: 25px;
  }
}
@media (max-height: 570px) {
  #menu {
    top: 18%;
  }
  h1 {
    font-size: 43px;
    margin: 15px 0;
  }
  .intro {
    font-size: 13px;
    margin: 15px 0;
  }
  .controls,
  .menu-goals {
    display: none;
  }
  .best-line {
    margin: 14px 0;
  }
  .primary {
    padding: 12px 20px;
  }
  .bottom-status {
    bottom: 55px;
  }
  .missions {
    display: none;
  }
}
