/* Shared look for every game */
:root {
  --bg: #faf5ff; --ink: #2e1065; --muted: #6b5b8a; --card: #fff; --line: #e9d5ff;
  --accent: #7c3aed; --pink: #f472b6; --ok: #16a34a; --bad: #ef4444; --radius: 18px;
  font-family: "Trebuchet MS", "Segoe UI Rounded", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; }
button { font: inherit; cursor: pointer; border: 0; color: inherit; }
.hidden { display: none !important; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: #fff; box-shadow: 0 2px 10px #7c3aed1a; }
.topbar h1 { flex: 1; margin: 0; font-size: 22px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round { width: 50px; height: 50px; border-radius: 50%; background: #ede9fe; color: var(--accent); font-size: 24px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; flex: none; text-decoration: none; }
.stars { font-weight: 800; font-size: 20px; min-width: 70px; text-align: right; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 16px; }
.center { text-align: center; }

/* Buttons */
.btn { display: inline-block; padding: 14px 22px; border-radius: 16px; background: var(--accent); color: #fff; font-weight: 800; font-size: 20px;
  box-shadow: 0 4px 0 #5b21b6; text-decoration: none; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #5b21b6; }
.btn.ghost { background: #ede9fe; color: var(--accent); box-shadow: 0 4px 0 #ddd6fe; }
.btn.pink { background: var(--pink); box-shadow: 0 4px 0 #db2777; }
.btn.green { background: #22c55e; box-shadow: 0 4px 0 #15803d; }

/* Level picker shown before a game starts */
.picker { display: grid; gap: 14px; max-width: 520px; margin: 24px auto; }
.picker .opt { background: #fff; border-radius: 22px; padding: 18px 20px; text-align: left; box-shadow: 0 4px 0 var(--line), 0 6px 18px #7c3aed14;
  display: flex; align-items: center; gap: 16px; font-size: 22px; font-weight: 800; }
.picker .opt .em { font-size: 40px; }
.picker .opt small { display: block; font-size: 15px; font-weight: 600; color: var(--muted); }
.picker h2 { text-align: center; margin: 6px 0; font-size: 26px; }

/* Celebration */
.celebrate { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: #2e106544; padding: 16px; }
.celebrate .msg { background: #fff; padding: 22px 26px; border-radius: 26px; text-align: center; box-shadow: 0 10px 40px #2e106544;
  animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); max-width: 420px; }
.celebrate .big { font-size: 60px; }
.celebrate h2 { margin: 4px 0 16px; font-size: 30px; }
.celebrate .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.confetti { position: fixed; top: -20px; width: 12px; height: 18px; border-radius: 3px; animation: fall linear forwards; z-index: 49; pointer-events: none; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
.wiggle { animation: wiggle .35s; }
@keyframes wiggle { 20% { transform: translateX(-6px); } 60% { transform: translateX(6px); } }
.bounce { animation: bounce .4s; }
@keyframes bounce { 50% { transform: scale(1.15); } }
.pixel { image-rendering: pixelated; }
