*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f4f1e6; /* warm paper-like backdrop, avoids blue/purple */
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* HUD overlay */
#hud {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  color: #333;
  font-size: 0.8rem;
}

.hud-section {
  background: rgba(255, 252, 244, 0.9);
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.hud-section .label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  font-size: 0.65rem;
  color: #777;
}

#score,
#zone {
  font-weight: 700;
  color: #222;
}

/* Touch controls container (for nipple.js) */
#touch-controls {
  position: fixed;
  left: 0.75rem;
  bottom: 0.75rem;
  width: 140px;
  height: 140px;
  pointer-events: none; /* nipple.js will manage pointer events */
}

/* CRT overlay for 1951 newsreel aesthetic */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.05) 50%),
              radial-gradient(circle at center, transparent 60%, rgba(0, 0, 0, 0.15) 100%);
  background-size: 100% 4px, 100% 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.8;
}

/* Start Modal */
#start-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9000; /* Behind CRT overlay, but above everything else */
}

.modal-content {
  background: #f4f1e6;
  border: 4px solid #c0392b;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  max-width: 90%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.modal-content h1 {
  margin: 0 0 0.5rem 0;
  color: #c0392b;
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-content p {
  margin: 0 0 1.5rem 0;
  color: #333;
  font-size: 1.1rem;
  font-weight: 500;
}

#start-btn {
  background: #2980b9;
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s, background 0.2s;
}

#start-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

#countdown {
  display: none;
  font-size: 4rem;
  font-weight: 800;
  color: #c0392b;
  margin: 1rem 0;
}

/* Remove selection / touch highlights */
body {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}