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

html, body {
  height: 100%;
  overflow: hidden;
  background: #2b3a33;
  color: #f1ede4;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

canvas { display: block; touch-action: none; }

#hud {
  position: fixed;
  z-index: 2;
  top: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.switch {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(20, 26, 30, 0.55);
  backdrop-filter: blur(6px);
  pointer-events: auto;
}
.switch button {
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #f1ede4;
  background: transparent;
  opacity: 0.7;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.switch button.on { background: #8fb0cf; color: #15202a; opacity: 1; }

.pill {
  background: rgba(20, 26, 30, 0.55);
  backdrop-filter: blur(6px);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.pill b { margin-left: 4px; }

#overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(18, 24, 28, 0.35);
  cursor: pointer;
}
/* On phones X's panel covers the bottom 30%, so keep the card above it */
body.coarse #overlay { bottom: 30%; }
#overlay.hidden { display: none; }

.card {
  width: 100%;
  max-width: 300px;
  padding: 24px 26px;
  text-align: center;
  background: rgba(24, 31, 36, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  animation: pop 0.25s ease-out;
}

@keyframes pop {
  from { transform: scale(0.94); opacity: 0; }
}

h1 { font-size: 28px; letter-spacing: -0.02em; }

p { margin-top: 6px; font-size: 14px; line-height: 1.4; opacity: 0.75; }

#btn {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  background: #8fb0cf;
  color: #15202a;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
}
#btn:hover { background: #a3c0db; }
#btn:active { transform: scale(0.97); }

.share {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: #cfdbe6;
}
.share[hidden] { display: none; }

.hint { margin-top: 14px; font-size: 12px; opacity: 0.45; }
