:root {
  --scope-size: 90vmin;
  --ink-dark: rgba(34, 28, 36, 0.9);
  --ink-soft: rgba(54, 45, 56, 0.72);
  --glass-bg: rgba(255, 246, 249, 0.72);
  --glass-border: rgba(120, 96, 108, 0.24);
  --accent: #c86d84;
  --accent-hover: #b85a72;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #e9d9e0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  touch-action: none;
}

#bg-canvas,
#scope-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

/* Blurred peripheral world outside the scope circle */
#bg-canvas {
  z-index: 1;
  filter: blur(18px) saturate(0.92) brightness(0.9);
  transform: scale(1.06);
  pointer-events: none;
}

#scope-canvas {
  z-index: 2;
  cursor: crosshair;
}

/* Centered circle overlay container matching the exact scope diameter */
#scope-ui {
  position: fixed;
  left: 50%;
  top: 50%;
  width: var(--scope-size);
  height: var(--scope-size);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hud {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: rgba(34, 28, 36, 0.65);
  background: rgba(255, 250, 252, 0.34);
  backdrop-filter: blur(4px);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(90, 75, 86, 0.14);
  transition: opacity 0.4s ease, color 0.5s ease, background 0.5s ease, border-color 0.5s ease;
  white-space: nowrap;
}

body.night-mode .hud {
  color: rgba(244, 234, 242, 0.78);
  background: rgba(28, 28, 46, 0.42);
  border-color: rgba(235, 215, 232, 0.18);
}

#hud-top {
  top: 4.5%;
}

#hud-bottom {
  bottom: 4.5%;
}

.dot {
  opacity: 0.45;
}

#kill-toast {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  font-size: clamp(12px, 1.8vmin, 16px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(42, 30, 38, 0.85);
  background: rgba(255, 245, 248, 0.62);
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(160, 100, 118, 0.25);
  transition: opacity 0.35s ease, transform 0.35s ease;
  white-space: nowrap;
}

body.night-mode #kill-toast {
  color: rgba(250, 236, 244, 0.92);
  background: rgba(34, 32, 54, 0.68);
  border-color: rgba(226, 185, 206, 0.28);
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8%;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

.overlay-card {
  width: min(390px, 86%);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: clamp(18px, 3.2vmin, 28px) clamp(18px, 3.4vmin, 30px);
  text-align: center;
  color: var(--ink-dark);
  box-shadow: 0 18px 45px rgba(72, 46, 58, 0.12);
}

body.night-mode .overlay-card {
  background: rgba(34, 34, 54, 0.78);
  color: #f4eaf0;
  border-color: rgba(228, 202, 220, 0.2);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.65;
}

h1,
h2 {
  margin: 0 0 10px;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  font-weight: 500;
  letter-spacing: 0.04em;
  font-size: clamp(24px, 4.2vmin, 34px);
}

.desc {
  margin: 0 0 18px;
  font-size: clamp(12px, 1.7vmin, 13.5px);
  line-height: 1.55;
  color: var(--ink-soft);
}

body.night-mode .desc {
  color: rgba(235, 222, 232, 0.78);
}

.desc.small {
  margin-bottom: 14px;
}

.btn-primary {
  appearance: none;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff9fb;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 12px 28px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  box-shadow: 0 6px 18px rgba(190, 96, 122, 0.25);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.controls-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
  opacity: 0.8;
}

.slider-wrap input[type="range"] {
  width: 88px;
  accent-color: var(--accent);
  cursor: pointer;
}

.btn-ghost {
  appearance: none;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.btn-ghost:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.28);
}

.btn-link {
  appearance: none;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.65;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.btn-link:hover {
  opacity: 1;
}

.meta-line {
  margin: 12px 0 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.stat {
  background: rgba(255, 255, 255, 0.36);
  border: 1px solid rgba(110, 86, 98, 0.14);
  border-radius: 12px;
  padding: 8px 10px;
}

body.night-mode .stat {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(235, 215, 232, 0.14);
}

.stat-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.62;
  margin-bottom: 2px;
}

.stat-val {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  font-size: 18px;
  font-weight: 600;
}

.new-best {
  margin: 0 0 12px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}
