:root {
  color-scheme: dark;
  font-family: Inter, ui-rounded, system-ui, sans-serif;
  background: #082f49;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body {
  color: #f8fafc;
  background: radial-gradient(circle at 50% 10%, #38bdf8, #082f49 70%);
}
#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}
#camera {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  width: min(26vw, 230px);
  aspect-ratio: 4/3;
  object-fit: cover;
  transform: scaleX(-1);
  opacity: 0.15;
  border-radius: 18px;
  pointer-events: none;
}
.hidden {
  display: none !important;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: max(18px, env(safe-area-inset-top)) 16px
    max(18px, env(safe-area-inset-bottom));
  background: #082f49d9;
  backdrop-filter: blur(12px);
}
.card {
  width: min(720px, 100%);
  padding: 24px;
  text-align: center;
  border: 1px solid #bae6fd66;
  border-radius: 30px;
  background: linear-gradient(145deg, #0c4a6eee, #164e63ee);
  box-shadow: 0 28px 90px #0009;
}
.card.compact {
  width: min(480px, 100%);
}
.top {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
}
.top a {
  color: white;
  font-size: 28px;
  text-decoration: none;
}
.top select {
  width: auto;
  min-height: 40px;
}
.icon {
  margin-top: 10px;
  font-size: 58px;
}
.kicker {
  color: #bae6fd;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.2em;
}
h1 {
  margin: 5px 0 10px;
  font-size: clamp(34px, 7vw, 58px);
  line-height: 1;
}
h2 {
  font-size: clamp(25px, 5vw, 36px);
}
p {
  line-height: 1.5;
}
.settings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0 14px;
}
label {
  display: grid;
  gap: 6px;
  text-align: left;
  color: #e0f2fe;
  font-size: 12px;
  font-weight: 800;
}
select,
button {
  min-height: 48px;
  border: 1px solid #bae6fd66;
  border-radius: 14px;
  padding: 10px 13px;
  color: white;
  background: #0f172acc;
  font: inherit;
  font-weight: 800;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button.primary {
  border-color: transparent;
  color: #082f49;
  background: #fef08a;
}
button.danger {
  border-color: #fecdd3;
  background: #be123c;
}
.check {
  grid-template-columns: 24px 1fr;
  align-items: center;
  padding: 12px;
  line-height: 1.4;
  border-radius: 14px;
  background: #ffffff0d;
}
.check input {
  width: 20px;
  height: 20px;
}
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
small {
  display: block;
  color: #bae6fd;
  line-height: 1.45;
}
.progress {
  height: 14px;
  margin: 18px 0;
  overflow: hidden;
  border-radius: 99px;
  background: #ffffff18;
}
.progress i {
  display: block;
  width: 0;
  height: 100%;
  background: #fef08a;
}
.hud {
  position: fixed;
  z-index: 5;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  width: min(850px, calc(100% - 20px));
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hud > div {
  min-width: 72px;
  min-height: 52px;
  display: grid;
  place-items: center;
  padding: 6px 10px;
  border: 1px solid #bae6fd55;
  border-radius: 14px;
  background: #082f49dd;
}
.hud span {
  font-size: 10px;
  color: #bae6fd;
}
.hud b {
  font-size: 20px;
}
.hud button {
  min-height: 52px;
}
.cue {
  position: fixed;
  z-index: 5;
  top: 22%;
  left: 50%;
  width: min(620px, calc(100% - 24px));
  transform: translateX(-50%);
  text-align: center;
  text-shadow: 0 4px 18px #000;
}
.cue div {
  font-size: clamp(64px, 13vw, 120px);
}
.cue strong {
  display: block;
  font-size: clamp(28px, 6vw, 52px);
}
.controls {
  position: fixed;
  z-index: 6;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  width: min(760px, calc(100% - 24px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.controls button {
  min-height: 88px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  border: 2px solid #fff8;
  background: #0369a1e8;
}
.controls button:nth-child(2) {
  background: #0f766ee8;
}
.controls button:nth-child(3) {
  background: #4338cae8;
}
.controls button:nth-child(4) {
  grid-column: 1/4;
}
.controls span {
  grid-row: 1/3;
  font-size: 32px;
}
.controls b {
  font-size: 15px;
}
.controls kbd {
  color: #bae6fd;
  font-size: 10px;
}
.tracking {
  position: fixed;
  z-index: 7;
  top: 92px;
  left: 50%;
  width: min(560px, calc(100% - 24px));
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: 14px;
  color: #082f49;
  background: #fef08a;
  font-weight: 900;
  text-align: center;
}
.warning {
  padding: 12px;
  border-radius: 14px;
  color: #fecdd3;
  background: #be123c55;
}
@media (max-width: 680px) {
  .card {
    padding: 18px;
    border-radius: 24px;
  }
  .settings {
    grid-template-columns: 1fr;
  }
  .actions {
    grid-template-columns: 1fr;
  }
  .hud {
    justify-content: flex-start;
  }
  .hud > div {
    min-width: 58px;
    min-height: 44px;
  }
  .hud button {
    min-height: 44px;
    font-size: 12px;
    padding: 7px;
  }
  #camera {
    width: 32vw;
    bottom: calc(108px + env(safe-area-inset-bottom));
  }
  .controls button {
    min-height: 80px;
    padding: 6px;
  }
  .controls span {
    font-size: 26px;
  }
}
@media (max-height: 690px) {
  .icon {
    margin-top: 3px;
    font-size: 40px;
  }
  .card p {
    margin: 6px 0;
  }
  .settings {
    margin: 9px 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
