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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #fff;
  background: radial-gradient(circle at 50% -10%, #2b4a9c, #0d1430 70%);
}

#wrap {
  position: relative;
  width: min(900px, 100%);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: #79c7ff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  touch-action: none;
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: none;
}

.pill {
  padding: 6px 13px;
  font-size: 14px;
  border-radius: 999px;
  background: rgba(9, 16, 38, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

.pill b {
  color: #ffd93b;
  font-variant-numeric: tabular-nums;
}

.ico {
  margin-right: 2px;
}

/* ---------- Overlay ---------- */
#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: 18px;
  background: rgba(7, 11, 26, 0.74);
  backdrop-filter: blur(3px);
}

#overlay.hidden {
  display: none;
}

.panel {
  width: min(560px, 100%);
  padding: 26px 24px;
  text-align: center;
  border-radius: 20px;
  background: rgba(16, 24, 54, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.panel h1 {
  font-size: clamp(24px, 4.4vw, 36px);
  color: #ffd93b;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.45);
}

.sub {
  margin-top: 6px;
  font-size: 15px;
  color: #cfe0ff;
}

.rules {
  margin: 16px 0 18px;
  text-align: left;
  list-style: none;
  font-size: 14px;
  line-height: 1.5;
}

.rules li {
  margin-bottom: 8px;
}

.rules b {
  color: #ffe98a;
}

.dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: -1px;
}

.dot.orange {
  background: radial-gradient(circle at 32% 30%, #ffc46b, #ff5a1f);
}

.dot.pink {
  background: radial-gradient(circle at 32% 30%, #ff9ad5, #e33aa0);
}

.stats {
  margin-bottom: 14px;
  font-size: 16px;
  color: #9ff2a1;
}

.stats.hidden {
  display: none;
}

button {
  padding: 12px 34px;
  font-size: 19px;
  font-weight: 700;
  font-family: inherit;
  color: #1a2140;
  background: linear-gradient(180deg, #ffe066, #ffb824);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 5px 0 #c98a00, 0 10px 22px rgba(0, 0, 0, 0.4);
  transition: transform 0.08s, box-shadow 0.08s;
}

button:hover {
  transform: translateY(-2px);
}

button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #c98a00;
}

.hint {
  font-size: 13px;
  color: #8fa6d8;
}
