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

:root {
  --bg0: #0a0612;
  --bg1: #1a0f2e;
  --accent: #a855f7;
  --accent2: #22d3ee;
  --glass: rgba(255, 255, 255, 0.06);
  --text: #f8fafc;
  --muted: #94a3b8;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(ellipse 120% 80% at 50% 0%, #2e1064 0%, var(--bg0) 55%);
  color: var(--text);
  touch-action: manipulation;
  user-select: none;
}

#game-root {
  position: relative;
  width: 100vw;
  height: 100vh;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  pointer-events: none;
  position: relative;
  z-index: 0;
}

#reticle-wrap {
  position: absolute;
  left: 50%;
  top: 56%;
  z-index: 12;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

#reticle {
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border: 2px solid rgba(34, 211, 238, 0.95);
  border-radius: 50%;
  box-shadow:
    0 0 24px rgba(34, 211, 238, 0.45),
    inset 0 0 14px rgba(34, 211, 238, 0.15);
  transition: transform 0.04s linear;
}

#ui-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  z-index: 6;
}

#hud {
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: clamp(10px, 2.5vw, 18px);
  gap: 10px;
}

.hud-card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.hud-card h2 {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.hud-card .big {
  font-size: clamp(1.1rem, 3.5vw, 1.35rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#wind-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--accent2);
}

#hint-bar {
  margin-top: auto;
  padding: 12px 16px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  background: linear-gradient(165deg, rgba(26, 15, 46, 0.97) 0%, rgba(10, 6, 18, 0.98) 100%);
  pointer-events: auto;
  z-index: 100;
}

.screen.hidden {
  display: none !important;
}

.badge {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent2);
  border: 1px solid rgba(34, 211, 238, 0.35);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.screen h1 {
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  font-weight: 800;
  text-align: center;
  line-height: 1.15;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 0%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.screen p {
  max-width: 340px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 28px;
}

.ui-btn {
  pointer-events: auto;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 36px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: #0f172a;
  background: linear-gradient(180deg, #f0abfc 0%, #a855f7 100%);
  box-shadow: 0 6px 0 #6b21a8, 0 12px 40px rgba(168, 85, 247, 0.45);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.ui-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #6b21a8, 0 8px 24px rgba(168, 85, 247, 0.35);
}

.ui-btn.secondary {
  margin-top: 12px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

#shoot-zone {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38%;
  pointer-events: none;
  z-index: 8;
}

#game-root.is-playing #shoot-zone {
  pointer-events: auto;
}

.link-btn {
  margin-top: 18px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  pointer-events: auto;
}

.link-btn:hover {
  color: var(--text);
}

@media (min-width: 600px) {
  #shoot-zone {
    height: 32%;
  }
}
