:root {
  --bg: #17122a;
  --panel: #241c40;
  --ink: #f4efff;
  --muted: #b3a8d6;
  --gold: #ffd166;
  --accent: #8be9c4;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Fredoka, system-ui, sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
canvas#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 6, 24, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  overflow-y: auto;
  touch-action: pan-y;
  z-index: 5;
}
.overlay.hidden, .hidden { display: none !important; }
.panel {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border-radius: 22px;
  padding: 24px 20px 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  margin: auto;
}
.logo { font-size: 56px; line-height: 1; }
h1 { margin: 8px 0 2px; font-size: 32px; }
h2 { margin: 6px 0; font-size: 26px; }
h3 { margin: 18px 0 8px; font-size: 18px; color: var(--muted); font-weight: 600; }
.sub { margin: 0 0 16px; color: var(--muted); }
.kicker { margin: 0; color: var(--accent); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; }
.how { text-align: left; padding-left: 22px; margin: 0 0 20px; line-height: 1.45; color: #ddd5f5; }
.how li { margin-bottom: 6px; }
#introText { color: #ddd5f5; line-height: 1.45; margin: 4px 0 18px; }
button {
  font-family: inherit;
  border: 0;
  cursor: pointer;
  color: var(--ink);
}
button.big {
  width: 100%;
  padding: 14px;
  font-size: 20px;
  font-weight: 700;
  border-radius: 14px;
  background: #7c5cff;
  box-shadow: 0 4px 0 #4b33b8;
}
button.big:active { transform: translateY(2px); box-shadow: 0 2px 0 #4b33b8; }
button.link { background: none; color: var(--muted); margin-top: 12px; font-size: 14px; text-decoration: underline; }
.stars { font-size: 40px; letter-spacing: 6px; margin: 6px 0 10px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { background: rgba(255, 255, 255, 0.06); border-radius: 12px; padding: 10px 4px; }
.stats span { display: block; font-size: 24px; font-weight: 700; }
.stats small { color: var(--muted); font-size: 12px; }
.bonus { color: var(--gold); margin: 10px 0 0; min-height: 1em; }
.shop { display: grid; gap: 8px; margin-bottom: 16px; }
.up {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 10px 12px;
}
.up .ico { font-size: 26px; width: 32px; text-align: center; }
.up .txt { flex: 1; min-width: 0; }
.up .txt b { display: block; font-size: 16px; }
.up .txt small { color: var(--muted); font-size: 12px; }
.up .pips { color: var(--accent); font-size: 11px; letter-spacing: 2px; }
.up button {
  background: var(--gold);
  color: #3a2a00;
  font-weight: 700;
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 72px;
  font-size: 15px;
}
.up button:disabled { background: #4a4166; color: #9a90bb; cursor: default; }
#debug {
  position: fixed;
  left: 8px;
  bottom: 8px;
  font: 12px ui-monospace, monospace;
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 8px;
  border-radius: 6px;
  z-index: 10;
  pointer-events: none;
  white-space: pre;
}
