* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2a1650; font-family: "Trebuchet MS", system-ui, sans-serif; color: #3a2350; user-select: none; -webkit-user-select: none; touch-action: none; }
.hidden { display: none !important; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; background: radial-gradient(120% 80% at 50% 0%, #6d3fd1 0%, #3a1d7a 55%, #1d0f3d 100%); }
#hud { display: flex; align-items: center; justify-content: space-between; padding: max(8px, env(safe-area-inset-top)) 12px 6px; gap: 8px; }
.hud-mid { text-align: center; flex: 1; }
#level-title { font-size: 26px; font-weight: 900; color: #fff; text-shadow: 0 3px 0 #2b0f5c; }
.hud-row { display: flex; gap: 6px; justify-content: center; margin-top: 2px; flex-wrap: wrap; }
.pill { background: rgba(255,255,255,.92); border-radius: 999px; padding: 2px 10px; font-weight: 900; font-size: 15px; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
#push-pill { background: #ffe066; }
#push-pill.warn { background: #ff6b6b; color: #fff; animation: pulse .6s infinite alternate; }
@keyframes pulse { to { transform: scale(1.12); } }

#board { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
#cv { display: block; touch-action: none; border-radius: 18px; }

.round { width: 48px; height: 48px; border-radius: 50%; border: 4px solid #fff; background: #ff4fa3; color: #fff; font-size: 22px; font-weight: 900; box-shadow: 0 5px 0 rgba(0,0,0,.3); cursor: pointer; flex: none; }
.round.small { width: 42px; height: 42px; font-size: 20px; background: #fff; color: #6d3fd1; border-color: #e7dcff; }
.round:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.3); }

#boosters { display: flex; justify-content: center; gap: 12px; padding: 6px 12px max(10px, env(safe-area-inset-bottom)); }
.booster { position: relative; width: 92px; border: 4px solid #fff; border-radius: 18px; background: #f4edff; padding: 6px 4px 4px; display: flex; flex-direction: column; align-items: center; font-family: inherit; cursor: pointer; box-shadow: 0 5px 0 rgba(0,0,0,.3); }
.booster .ico { font-size: 28px; line-height: 1.1; }
.booster b { font-size: 13px; color: #6d3fd1; }
.booster i { position: absolute; top: -10px; right: -8px; background: #3ddc4a; color: #fff; font-style: normal; font-weight: 900; font-size: 13px; border: 3px solid #fff; border-radius: 999px; min-width: 26px; padding: 0 6px; }
.booster.on { background: #ffe066; transform: translateY(-6px); }
.booster:disabled { opacity: .45; }

#combo { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none; font-size: 44px; font-weight: 900; color: #fff; -webkit-text-stroke: 2px #6d3fd1; paint-order: stroke fill; text-shadow: 0 4px 0 #2b0f5c; animation: combo .9s ease-out forwards; white-space: nowrap; }
@keyframes combo { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; } 20% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -120%) scale(1); opacity: 0; } }

.overlay { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20,8,45,.6); }
.panel { width: min(440px, 100%); max-height: 100%; overflow: auto; background: #fbf7ff; border: 6px solid #fff; border-radius: 30px; padding: 20px; text-align: center; box-shadow: 0 10px 0 rgba(0,0,0,.25); animation: pop .3s cubic-bezier(.2,1.5,.5,1); }
.panel.wide { width: min(620px, 100%); }
@keyframes pop { from { transform: scale(.6); } }
.logo { display: flex; justify-content: center; gap: 4px; margin-bottom: 6px; }
.logo .b { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset -5px -6px 0 rgba(0,0,0,.18), inset 5px 5px 0 rgba(255,255,255,.35); }
.b.r { background: #ff3b3b; } .b.y { background: #ffd60a; } .b.g { background: #3ddc4a; } .b.u { background: #2f8bff; } .b.p { background: #c04dff; }
h1 { margin: 4px 0; color: #6d3fd1; font-size: 34px; }
h2 { margin: 0 0 8px; color: #6d3fd1; }
.sub { font-weight: 700; line-height: 1.35; }
.sub.small { font-size: 14px; opacity: .8; }
.big { display: block; width: 100%; margin: 10px 0; border: none; border-radius: 18px; padding: 14px; font: inherit; font-size: 20px; font-weight: 900; background: #ff4fa3; color: #fff; box-shadow: 0 5px 0 #b8246d; cursor: pointer; }
.big.alt { background: #8f6af0; box-shadow: 0 5px 0 #5a38b8; }
.big:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.3); }
.row { display: flex; gap: 8px; }
.row .big { font-size: 16px; padding: 12px 6px; }
.link { display: inline-block; margin-top: 6px; color: #6d3fd1; font-weight: 900; text-decoration: none; }
.stars { font-size: 46px; letter-spacing: 6px; margin: 4px 0; }
.stars .off { filter: grayscale(1); opacity: .3; }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 10px; font-weight: 900; }
#level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; margin-bottom: 6px; }
#level-grid button { border: none; border-radius: 14px; padding: 6px 0 4px; font: inherit; font-weight: 900; font-size: 18px; background: #8f6af0; color: #fff; box-shadow: 0 4px 0 #5a38b8; cursor: pointer; }
#level-grid button small { display: block; font-size: 10px; letter-spacing: 1px; min-height: 12px; }
#level-grid button.done { background: #3ddc4a; box-shadow: 0 4px 0 #1f8f2a; }
#level-grid button.cur { background: #ff4fa3; box-shadow: 0 4px 0 #b8246d; }
#level-grid button:disabled { background: #d9d0ee; box-shadow: 0 4px 0 #b9add6; color: #fff; cursor: default; }
