:root {
  --grass: #79c26b;
  --ink: #23303f;
  --panel: rgba(255, 255, 255, 0.85);
  --accent: #ef4a4a;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--grass);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
  margin-right: 4px;
}

.levelNav { display: flex; align-items: center; gap: 2px; }

.pill {
  background: var(--panel);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}
.pill.subtle { font-weight: 600; color: #4b5a6b; }

.actions { margin-left: auto; display: flex; gap: 6px; }

button {
  font: inherit;
  color: inherit;
  border: 0;
  cursor: pointer;
}

.actions button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.14);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
}
.actions button svg { width: 20px; height: 20px; }
@media (max-width: 560px) {
  .brand { display: none; }
  #bar { gap: 6px; padding: 8px 10px; }
  .actions { gap: 5px; }
  .actions button { width: 36px; height: 36px; border-radius: 11px; }
}
@media (max-width: 460px) {
  #bumpLabel { display: none; }
}
.actions button:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.14); }
.actions button.off { opacity: 0.5; }

.ghost {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}
.ghost:disabled { opacity: 0.3; cursor: default; }

#stage {
  position: relative;
  flex: 1;
  min-height: 0;
}

canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  display: block;
}

.tip {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(35, 48, 63, 0.88);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  pointer-events: none;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(35, 48, 63, 0.35);
  z-index: 5;
  animation: fade 0.25s ease;
}
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }

.card {
  width: min(340px, calc(100% - 40px));
  padding: 26px 24px 20px;
  border-radius: 24px;
  background: #fff;
  text-align: center;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.12), 0 20px 40px rgba(0, 0, 0, 0.2);
  animation: pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes pop { from { transform: scale(0.7); } }

.card h2 { margin: 0 0 10px; font-size: 26px; }
.lede { margin: 8px 0 18px; color: #4b5a6b; }

.stars { font-size: 44px; letter-spacing: 6px; line-height: 1; }
.stars .on { color: #fbbf24; text-shadow: 0 3px 0 #d97706; }
.stars .off { color: #e2e8f0; }

.primary, .soft {
  display: block;
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 17px;
  margin-top: 10px;
}
.primary { background: var(--accent); color: #fff; box-shadow: 0 4px 0 #b91c1c; }
.soft { background: #eef2f6; box-shadow: 0 4px 0 #cbd5e1; }
.primary:active, .soft:active { transform: translateY(3px); box-shadow: none; }
