:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #071016;
  color: #edf7f4;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.seo-content {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.no-script-message {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 24px;
  background: #071016;
  color: #edf7f4;
  text-align: center;
}

body {
  background:
    radial-gradient(circle at 18% 15%, rgba(79, 185, 165, 0.22), transparent 28rem),
    linear-gradient(180deg, #0c1a22 0%, #071016 58%, #05080a 100%);
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

.hud {
  position: fixed;
  z-index: 5;
  top: 18px;
  left: 18px;
  display: grid;
  gap: 8px;
  max-width: calc(100vw - 36px);
  padding: 12px 14px;
  border: 1px solid rgba(145, 213, 198, 0.28);
  border-radius: 8px;
  background: rgba(6, 14, 18, 0.68);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.hud__title {
  font-size: 15px;
  font-weight: 700;
}

.hud__tagline {
  color: #f4cc71;
  font-size: 13px;
  font-weight: 800;
}

.hud__controls-button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(145, 213, 198, 0.34);
  border-radius: 6px;
  background: rgba(237, 247, 244, 0.08);
  color: #edf7f4;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.hud__controls-button:hover,
.hud__controls-button:focus-visible {
  border-color: rgba(244, 204, 113, 0.64);
  background: rgba(244, 204, 113, 0.16);
  outline: none;
}

.hud__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: rgba(237, 247, 244, 0.76);
  font-size: 12px;
}

kbd {
  min-width: 24px;
  padding: 3px 7px;
  border: 1px solid rgba(237, 247, 244, 0.22);
  border-bottom-color: rgba(237, 247, 244, 0.42);
  border-radius: 5px;
  background: rgba(237, 247, 244, 0.09);
  color: #edf7f4;
  font-family: inherit;
  font-size: 11px;
  text-align: center;
}

.start-tip {
  position: fixed;
  z-index: 4;
  top: 18px;
  left: 50%;
  max-width: calc(100vw - 36px);
  transform: translateX(-50%);
  padding: 10px 14px;
  border: 1px solid rgba(244, 204, 113, 0.28);
  border-radius: 8px;
  background: rgba(6, 14, 18, 0.68);
  color: #f4cc71;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  backdrop-filter: blur(12px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.start-tip.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -8px);
}

.status {
  position: fixed;
  z-index: 5;
  top: 18px;
  right: 18px;
  min-width: 168px;
  max-width: calc(100vw - 36px);
  padding: 11px 13px;
  border: 1px solid rgba(244, 204, 113, 0.22);
  border-radius: 8px;
  background: rgba(6, 14, 18, 0.66);
  color: rgba(237, 247, 244, 0.88);
  font-size: 13px;
  line-height: 1.35;
  text-align: right;
  backdrop-filter: blur(12px);
}

.challenge-button {
  position: fixed;
  z-index: 5;
  right: 18px;
  bottom: 18px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(145, 213, 198, 0.34);
  border-radius: 6px;
  background: rgba(6, 14, 18, 0.72);
  color: #edf7f4;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.challenge-button:hover,
.challenge-button:focus-visible {
  border-color: rgba(244, 204, 113, 0.64);
  background: rgba(244, 204, 113, 0.16);
  outline: none;
}

.controls-modal,
.challenge-modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 8, 11, 0.58);
  backdrop-filter: blur(10px);
}

.controls-modal[hidden],
.challenge-modal[hidden] {
  display: none;
}

.controls-modal__panel,
.challenge-modal__panel {
  width: min(520px, 100%);
  padding: 18px;
  border: 1px solid rgba(244, 204, 113, 0.34);
  border-radius: 8px;
  background: rgba(8, 18, 23, 0.94);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

.controls-modal__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.controls-modal__title,
.challenge-modal__title {
  font-size: 20px;
  font-weight: 800;
}

.controls-modal__subtitle,
.challenge-modal__text {
  margin-top: 7px;
  color: rgba(237, 247, 244, 0.78);
  font-size: 14px;
  line-height: 1.35;
}

.controls-modal button,
.challenge-modal button {
  height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(244, 204, 113, 0.42);
  border-radius: 6px;
  background: rgba(244, 204, 113, 0.16);
  color: #edf7f4;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.challenge-modal__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 14px;
}

.challenge-modal input {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(145, 213, 198, 0.34);
  border-radius: 6px;
  background: rgba(237, 247, 244, 0.08);
  color: #edf7f4;
  font: inherit;
}

.challenge-modal__close {
  width: 100%;
  margin-top: 14px;
}

.score-modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 8, 11, 0.58);
  backdrop-filter: blur(10px);
}

.score-modal[hidden] {
  display: none;
}

.score-modal__panel {
  width: min(360px, 100%);
  padding: 18px;
  border: 1px solid rgba(244, 204, 113, 0.34);
  border-radius: 8px;
  background: rgba(8, 18, 23, 0.94);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

.score-modal__title {
  font-size: 20px;
  font-weight: 800;
}

.score-modal__text {
  margin-top: 7px;
  color: rgba(237, 247, 244, 0.78);
  font-size: 14px;
  line-height: 1.35;
}

.score-modal__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 14px;
}

.score-modal input {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(145, 213, 198, 0.34);
  border-radius: 6px;
  background: rgba(237, 247, 244, 0.08);
  color: #edf7f4;
  font: inherit;
}

.score-modal button {
  height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(244, 204, 113, 0.42);
  border-radius: 6px;
  background: rgba(244, 204, 113, 0.16);
  color: #edf7f4;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.score-modal__list {
  display: grid;
  gap: 5px;
  margin: 15px 0 0;
  padding-left: 26px;
  color: rgba(237, 247, 244, 0.88);
  font-size: 14px;
}

.score-modal__list li::marker {
  color: #f4cc71;
  font-weight: 800;
}

.score-modal__list .is-current {
  color: #f4cc71;
  font-weight: 800;
}

.score-modal__close {
  width: 100%;
  margin-top: 14px;
}

@media (max-width: 640px) {
  .hud {
    top: 10px;
    left: 10px;
    padding: 10px;
  }

  .start-tip {
    top: 104px;
    font-size: 13px;
  }

  .status {
    top: 10px;
    right: 10px;
    text-align: right;
  }

  .challenge-button {
    right: 10px;
    bottom: 10px;
  }
}
