:root {
  --bg: #0b0c10;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.65);
  --green: #00f5a0;
  --gold: #ffd166;
  --red: #ff4d6d;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #161925 0%, #090a0f 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  touch-action: none;
  -webkit-font-smoothing: antialiased;
}

.hud-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  pointer-events: none;
}

.brand-logo {
  pointer-events: auto;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.88);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.4px;
  transition: color 0.15s;
}

.brand-logo:hover {
  color: #ffffff;
}

.hud-controls {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.best-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  font-variant-numeric: tabular-nums;
}

.star-icon {
  color: var(--gold);
  margin-right: 3px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.canvas-stage {
  position: relative;
  width: 100vw;
  height: 100dvh;
}

#circle-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.center-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.splash-card {
  pointer-events: auto;
  text-align: center;
  background: rgba(16, 18, 27, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(14px);
  padding: 38px 44px;
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  max-width: 420px;
  width: calc(100% - 32px);
  animation: fadeScale 0.3s ease-out;
}

.splash-card[hidden],
.score-readout[hidden] {
  display: none !important;
}

@keyframes fadeScale {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.splash-card h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 5vw, 36px);
  margin: 0 0 10px;
  letter-spacing: -0.5px;
}

.splash-card p {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.go-btn {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: radial-gradient(circle at 30% 30%, #00f5a0, #00b4d8);
  color: #061014;
  font-size: 26px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 36px rgba(0, 245, 160, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}

.go-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 48px rgba(0, 245, 160, 0.7);
}

.score-readout {
  text-align: center;
  transform: translateY(-54px);
  transition: transform 0.2s;
}

.score-value {
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 800;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.65);
}

.score-msg {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.score-msg.new-best {
  color: var(--gold);
  font-weight: 800;
}

.score-msg.error {
  color: var(--red);
  font-weight: 700;
}
