:root {
  --ink: rgba(255, 255, 255, 0.82);
  --ink-dim: rgba(255, 255, 255, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #2b2f45;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

/* Camera flash */
#flash {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
}
#flash.fire {
  animation: flash 420ms ease-out;
}
@keyframes flash {
  0%   { opacity: 0; }
  8%   { opacity: 0.85; }
  100% { opacity: 0; }
}

#ui {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 10;
  text-align: center;
  pointer-events: none;
  padding: 0 18px;
}

#message {
  color: var(--ink);
  font-size: clamp(15px, 2.4vw, 22px);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

#hint {
  margin-top: 8px;
  color: var(--ink-dim);
  font-size: clamp(11px, 1.6vw, 13px);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: opacity 1.2s ease;
}
#hint.faded { opacity: 0; }

kbd {
  font: inherit;
  font-size: 0.95em;
  border: 1px solid var(--ink-dim);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 7px;
}

#counter {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: 20px;
  z-index: 10;
  color: var(--ink-dim);
  font-size: clamp(11px, 1.5vw, 13px);
  letter-spacing: 0.05em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
#counter.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  #flash.fire { animation-duration: 260ms; }
  #flash.fire { animation-timing-function: ease; }
}
