:root {
  color: #20313a;
  background: #eff7f1;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  display: grid;
  place-items: center;
}

button,
a {
  font: inherit;
}

.scope-inbox {
  position: relative;
  width: min(100vw, 640px);
  height: 100vh;
  min-height: 520px;
  overflow: hidden;
  background: #eff7f1;
  box-shadow: 0 0 0 1px rgba(32, 49, 58, 0.08), 0 24px 80px rgba(32, 49, 58, 0.14);
}

#scope-inbox-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  transition: filter 280ms ease, opacity 280ms ease;
}

.scope-inbox-canvas--ended {
  filter: saturate(0.72);
  opacity: 0.56;
}

.screen {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(520px, calc(100vw - 32px));
  transform: translate(-50%, -46%);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transition: opacity 240ms ease, transform 240ms ease;
}

.screen--active {
  transform: translate(-50%, -50%);
  opacity: 1;
  pointer-events: auto;
}

.eyebrow {
  margin: 0 0 14px;
  color: #5f6d3d;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: #20313a;
  font-size: clamp(3rem, 10vw, 6.6rem);
  line-height: 0.88;
}

h2 {
  font-size: clamp(2.8rem, 9vw, 5.5rem);
}

.lede {
  max-width: 42rem;
  margin: 22px auto 0;
  color: #41515b;
  font-size: clamp(1rem, 2.8vw, 1.2rem);
  line-height: 1.55;
}

.controls-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 28px 0 0;
  color: #293a43;
  font-size: 0.95rem;
  font-weight: 700;
}

.controls-note span {
  padding: 8px 11px;
  border: 2px solid rgba(32, 49, 58, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 154px;
  min-height: 48px;
  margin-top: 28px;
  padding: 0 24px;
  border: 0;
  border-radius: 8px;
  background: #20313a;
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 14px 34px rgba(32, 49, 58, 0.2);
}

.primary-action:hover,
.primary-action:focus-visible {
  background: #31515c;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 22px;
}

.contact-links a {
  color: #1d5f70;
  font-weight: 800;
  text-decoration: none;
}

.contact-links a:hover,
.contact-links a:focus-visible {
  text-decoration: underline;
}

.contact-link-primary {
  padding: 10px 14px;
  border-radius: 8px;
  background: #1d5f70;
  color: #ffffff !important;
}

.leaderboard {
  display: grid;
  gap: 8px;
  max-width: 360px;
  margin: 26px auto 0;
  padding: 0;
  list-style: none;
}

.leaderboard li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;
  border: 2px solid rgba(32, 49, 58, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #20313a;
  font-weight: 850;
  box-shadow: 0 10px 26px rgba(32, 49, 58, 0.08);
}

.leaderboard strong {
  font-size: 1.1rem;
}

.contact-links--end {
  margin-top: 18px;
}

.hud {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  width: calc(100% - 28px);
  max-width: 600px;
  transform: translateX(-50%);
  color: #20313a;
}

.hud > div {
  min-width: 0;
  padding: 10px 12px;
  border: 2px solid rgba(32, 49, 58, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 26px rgba(32, 49, 58, 0.08);
}

.hud span {
  display: block;
  margin-bottom: 7px;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

meter {
  display: block;
  width: 100%;
  height: 12px;
}

.score-pill,
.milestone-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  white-space: nowrap;
  font-weight: 800;
}

.score-pill strong {
  margin-left: 8px;
  font-size: 1.2rem;
}

.milestone-pill {
  grid-column: 1 / -1;
  background: rgba(255, 247, 237, 0.88);
  color: #9a3412;
}

.gamer-note {
  position: absolute;
  left: 50%;
  top: 112px;
  z-index: 4;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border: 2px solid rgba(32, 49, 58, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #20313a;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.gamer-note--visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mobile-controls {
  position: absolute;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 3;
  display: none;
  grid-template-columns: 58px;
  gap: 10px;
  justify-content: center;
  width: min(100vw - 20px, 300px);
  transform: translateX(-50%);
  touch-action: none;
}

.touch-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border: 2px solid rgba(32, 49, 58, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: #20313a;
  cursor: pointer;
  font-size: 1.4rem;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(32, 49, 58, 0.12);
}

.touch-control:active,
.touch-control:focus-visible {
  background: #20313a;
  color: #ffffff;
}

.touch-control--quit {
  color: #9a3412;
}

[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .scope-inbox {
    width: 100vw;
    min-height: 480px;
    box-shadow: none;
  }

  .screen {
    top: 47%;
  }

  .hud {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .milestone-pill {
    grid-column: 1 / -1;
    min-height: 42px;
  }

  .gamer-note {
    top: 146px;
    font-size: 0.92rem;
  }

  .mobile-controls {
    display: grid;
  }
}
