* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
#scope {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
}
#readout {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 0.5em);
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 2em;
  padding: 0.5em;
  z-index: 5;
  pointer-events: none;
  opacity: 0.7;
}
/* Lifetime score. Six green pips for the two scoring banks, then a gold
   diamond for the seventh — visible from the first visit, so there is
   something to aim at long before it is reachable. */
#score {
  position: fixed;
  top: env(safe-area-inset-top, 0);
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  padding: 0.5em;
  z-index: 11;  /* above the start overlay: returning players see their score first */
  pointer-events: none;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: #777;
}
#pips {
  display: flex;
  align-items: center;
  gap: 0.4em;
}
.pip {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  border: 1px solid #333;
  transition: background 0.4s, box-shadow 0.4s, border-color 0.4s;
}
.pip.on {
  background: #2bff5e;
  border-color: #2bff5e;
  box-shadow: 0 0 6px hsla(130, 100%, 55%, 0.7);
}
.pip.bonus {
  border-radius: 1px;
  transform: rotate(45deg);
  margin-left: 0.4em;
  border-color: #4a3d1a;
}
/* earned its way into reach, but not yet cracked */
.pip.bonus.ready {
  border-color: #c9a227;
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.5);
}
.pip.bonus.on {
  background: #ffcc44;
  border-color: #ffcc44;
  box-shadow: 0 0 12px rgba(255, 204, 68, 0.85);
}
#targets {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 2.3em);
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 1.2em;
  padding: 0.8em;
  z-index: 5;
  pointer-events: none;
}
.target {
  position: relative;
  border-radius: 10px;
  transition: opacity 0.4s;
}
.target canvas {
  display: block;
  width: 80px;
  height: 80px;
  background: #000;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
}
.target .count {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 4px;
  border-radius: 2px;
  background: #1a1a1a;
  overflow: hidden;
}
.target .count-bar {
  height: 100%;
  background: linear-gradient(to right, #2bff5e, #0a4);
  width: 0%;
  transition: width 0.05s linear;
  border-radius: 2px;
}
.target .badge {
  position: absolute;
  top: -0.4em;
  right: -0.4em;
  width: 1.4em;
  height: 1.4em;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #0a4;
  color: #fff;
  font-size: 0.9rem;
}
.target.done {
  opacity: 0.3;
}
.target.done .badge {
  display: flex;
}
.target.done.echo {
  opacity: 0.85;
  box-shadow: 0 0 20px hsla(130, 100%, 55%, 0.6);
}
#banner {
  position: fixed;
  top: 40%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 2rem;
  letter-spacing: 0.2em;
  color: #8f8;
  text-shadow: 0 0 20px hsla(130, 100%, 55%, 0.8);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 6;
  pointer-events: none;
}
#banner.show {
  opacity: 1;
}
.angle {
  text-align: center;
}
.angle .label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 0.1em;
}
.angle span:not(.label) {
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}
#start {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 10;
}
#start.hidden {
  display: none;
}
#startOverlay {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4em;
  padding: 3em 2em 2em;
  text-align: center;
  /* the overlay now carries real copy, so let it scroll on short screens
     rather than clipping the start button out of reach */
  overflow-y: auto;
}
#wordmark {
  font-size: 2.2rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-indent: 0.3em;  /* balance the trailing letter-space */
  text-transform: uppercase;
  color: #8f8;
  text-shadow: 0 0 24px hsla(130, 100%, 55%, 0.55);
}
#about {
  max-width: 34em;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #6e6e6e;
  text-align: left;
}
#about p + p {
  margin-top: 0.8em;
}
#about strong {
  color: #8a8;
  font-weight: 600;
}
#readoutStart {
  display: flex;
  gap: 2em;
}
#startButton {
  font-size: 1.5rem;
  padding: 1em 2em;
  border-radius: 0.5em;
  border: 1px solid #fff;
  background: #111;
  color: #fff;
  cursor: pointer;
}
#instructions {
  font-size: 0.9rem;
  color: #999;
  max-width: 400px;
  line-height: 1.4;
}
/* In-game share control. Play is driven by orientation, not touch, so a
   persistent button costs nothing on a phone; it sits clear of the targets. */
#shareButton {
  position: fixed;
  right: 1em;
  bottom: 1em;
  z-index: 7;
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.6em 1.1em;
  border-radius: 2em;
  border: 1px solid #2a2a2a;
  background: rgba(0, 0, 0, 0.55);
  color: #6a6;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
#shareButton:hover {
  opacity: 1;
}
/* pulsed after a lock — the moment worth telling someone about */
#shareButton.pulse {
  opacity: 1;
  color: #8f8;
  border-color: hsla(130, 100%, 55%, 0.6);
  box-shadow: 0 0 16px hsla(130, 100%, 55%, 0.45);
}
.share-link {
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: none;
  border: none;
  border-bottom: 1px solid #444;
  padding: 0.2em 0;
  color: #888;
  cursor: pointer;
}
.share-link:hover {
  color: #8f8;
  border-bottom-color: hsla(130, 100%, 55%, 0.6);
}
#capabilityWarning {
  display: none;
  font-size: 0.85rem;
  color: #f88;
  max-width: 400px;
  line-height: 1.4;
  padding-top: 1em;
  border-top: 1px solid #442;
  margin-top: 1em;
}
