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

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1b2a4a;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 16, 32, 0.45);
  backdrop-filter: blur(2px);
  transition: opacity 0.25s ease;
}
.overlay.hidden { opacity: 0; pointer-events: none; }

.panel {
  width: min(420px, 100%);
  padding: 28px 24px 20px;
  text-align: center;
  background: rgba(16, 24, 44, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.panel h1 {
  margin: 0 0 8px;
  font-size: clamp(40px, 12vw, 64px);
  letter-spacing: 0.12em;
  color: #ffcf4a;
  text-shadow: 0 4px 0 #c0392b;
  white-space: nowrap;
}
.panel h1.long { font-size: clamp(30px, 9vw, 44px); letter-spacing: 0.06em; }

.panel p { margin: 8px 0; line-height: 1.45; color: #dfe6f3; }
.panel .stats { font-size: 18px; font-weight: 600; color: #fff; }
.panel .stats:empty { display: none; }
.panel .hint { margin-top: 16px; font-size: 13px; color: #8d9ab3; }

.panel button {
  margin-top: 12px;
  padding: 12px 36px;
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  color: #1b2a4a;
  background: #ffcf4a;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 4px 0 #c99a1c;
  cursor: pointer;
}
.panel button:active { transform: translateY(2px); box-shadow: 0 2px 0 #c99a1c; }
.panel button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.icon-btn {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  width: 40px;
  height: 40px;
  font-size: 20px;
  color: #fff;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
}
.icon-btn.off { opacity: 0.45; text-decoration: line-through; }
