/* Pom Pom Roll — pastel candy UI */
:root {
  --pink: #ff7ab0;
  --pink2: #ffd1e8;
  --cream: #fff8f2;
  --ink: #4a2a45;
  --ink2: #7a5574;
  --mint: #7fe0c0;
  --sun: #ffd23f;
  --sky: #8fd3ff;
  --panel: rgba(255, 250, 253, 0.94);
  --shadow: 0 10px 30px rgba(120, 50, 100, 0.22);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #ffe9f4; color: var(--ink); font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }

.game-shell { position: fixed; inset: 0; display: flex; flex-direction: column; }
.game-bar {
  display: flex; align-items: center; gap: 8px; padding: 6px calc(12px + var(--safe-r)) 6px calc(12px + var(--safe-l));
  background: linear-gradient(90deg, #ffd1e8, #ffe9b8 55%, #c9f0ff); box-shadow: 0 2px 10px rgba(120, 50, 100, 0.15); z-index: 20; min-height: 44px;
}
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.6); }
.game-bar-title { flex: 1; text-align: center; font-weight: 700; font-size: 17px; letter-spacing: 0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.7); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.75); font-size: 15px; display: grid; place-items: center; }

.game-wrap { position: relative; flex: 1; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fx-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 6; }
.float-label {
  position: absolute; left: 0; top: 0; white-space: nowrap; font-weight: 700; font-size: 15px; color: #fff;
  padding: 3px 10px; border-radius: 999px; background: rgba(255, 122, 176, 0.92); box-shadow: 0 3px 10px rgba(120, 50, 100, 0.3);
}
.float-label.new { background: linear-gradient(90deg, #ffb703, #ff7ab0); font-size: 16px; }
.float-label.oops { background: rgba(110, 90, 200, 0.92); }
.float-label.shiny { background: linear-gradient(90deg, #ffd23f, #ffb703); color: #5a3a00; font-size: 17px; box-shadow: 0 0 18px rgba(255, 210, 63, 0.75); }
.countdown {
  position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%); font-size: 92px; font-weight: 700; color: #fff; opacity: 0;
  text-shadow: 0 6px 0 var(--pink), 0 0 30px rgba(255, 122, 176, 0.8); pointer-events: none;
}
.countdown.go { color: #fff36b; text-shadow: 0 6px 0 #ff9b3d, 0 0 34px rgba(255, 200, 60, 0.9); }
.countdown.show { animation: countIn 0.72s ease-out forwards; }
.countdown.go.show { animation-duration: 1s; }
@keyframes countIn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.9); } 22% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); } }
.speedlines {
  position: absolute; inset: -10%; pointer-events: none; opacity: 0;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.55) 0deg 1.2deg, transparent 1.2deg 9deg);
  -webkit-mask: radial-gradient(circle at 50% 55%, transparent 32%, #000 70%); mask: radial-gradient(circle at 50% 55%, transparent 32%, #000 70%);
}
.speedlines.go { animation: speedIn 0.6s ease-out; }
@keyframes speedIn { 0% { opacity: 0; transform: scale(1.15); } 20% { opacity: 0.9; } 100% { opacity: 0; transform: scale(1); } }
.float-label.hint { background: rgba(74, 42, 69, 0.82); font-size: 13px; font-weight: 600; }

/* ── HUD ─────────────────────────────────────────────── */
.hud { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.hud.hidden { display: none; }
.hud-top { position: absolute; top: 10px; left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.size-card { background: var(--panel); border-radius: 18px; padding: 8px 14px 9px; box-shadow: var(--shadow); min-width: 210px; max-width: 62vw; }
.size-row { display: flex; align-items: baseline; gap: 10px; }
.size-row b { font-size: 28px; line-height: 1; color: var(--pink); text-shadow: 0 2px 0 #fff; }
.size-row span { font-size: 12px; font-weight: 600; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.size-bar { position: relative; height: 12px; border-radius: 99px; background: #f3dbe8; margin: 8px 0 3px; }
.size-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px; background: linear-gradient(90deg, #ffb3d4, #ff7ab0 60%, #ffcf3d); transition: width 0.25s; }
.size-bar .mk { position: absolute; top: -15px; transform: translateX(-50%); font-style: normal; font-size: 11px; color: #d7b8c9; font-weight: 700; }
.size-bar .mk.end { left: auto !important; right: -4px; transform: none; }
.size-bar .mk.on { color: #ffb703; text-shadow: 0 0 6px #fff; }
.goal-row { font-size: 12px; color: var(--ink2); font-weight: 500; }
.hud-right { display: flex; gap: 8px; align-items: center; }
.timer { background: var(--panel); border-radius: 999px; padding: 6px 14px; font-size: 22px; font-weight: 700; box-shadow: var(--shadow); min-width: 78px; text-align: center; }
.timer.low { color: #fff; background: #ff5f7e; animation: throb 0.5s infinite alternate; }
.timer.zen { font-size: 16px; color: #3aa58a; }
@keyframes throb { to { transform: scale(1.08); } }
.hud-btn { pointer-events: auto; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--panel); box-shadow: var(--shadow); font-size: 16px; font-weight: 700; }

.banner {
  position: absolute; top: 24%; left: 50%; transform: translate(-50%, -10px) scale(0.85); opacity: 0; text-align: center;
  background: rgba(255, 255, 255, 0.92); border-radius: 22px; padding: 10px 22px; box-shadow: var(--shadow); max-width: 88vw;
}
.banner small { display: block; font-size: 13px; color: var(--ink2); font-weight: 600; }
.banner b { font-size: 22px; color: var(--ink); }
.banner.big b { font-size: 28px; color: var(--pink); }
.banner.show { animation: bannerIn 1.6s ease forwards; }
.banner.big.show { animation-duration: 2.2s; }
@keyframes bannerIn {
  0% { opacity: 0; transform: translate(-50%, -10px) scale(0.7); }
  12% { opacity: 1; transform: translate(-50%, 0) scale(1.06); }
  20% { transform: translate(-50%, 0) scale(1); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -12px) scale(0.96); }
}
.combo { position: absolute; top: 38%; left: 50%; transform: translateX(-50%); font-size: 30px; font-weight: 700; color: #fff; opacity: 0; text-shadow: 0 3px 0 var(--pink), 0 0 18px rgba(255, 122, 176, 0.7); white-space: nowrap; }
.combo.pop { animation: comboPop 1.1s ease forwards; }
@keyframes comboPop { 0% { opacity: 0; transform: translateX(-50%) scale(0.4) rotate(-6deg); } 18% { opacity: 1; transform: translateX(-50%) scale(1.15) rotate(3deg); } 30% { transform: translateX(-50%) scale(1) rotate(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-20px); } }
.hud-hint { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); max-width: 88vw; text-align: center; background: rgba(74, 42, 69, 0.78); color: #fff; padding: 8px 16px; border-radius: 16px; font-size: 14px; opacity: 0; transition: opacity 0.4s; }
.hud-hint.show { opacity: 1; }
.hud-bottom { position: absolute; left: calc(10px + var(--safe-l)); bottom: calc(10px + var(--safe-b)); right: calc(100px + var(--safe-r)); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.next-up { background: var(--panel); border-radius: 14px; padding: 6px 12px; font-size: 14px; box-shadow: var(--shadow); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-up span { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #fff; background: var(--pink); border-radius: 6px; padding: 1px 6px; margin-right: 6px; vertical-align: 2px; }
.next-up em { font-style: normal; color: var(--ink2); font-size: 12px; }
.ticker { display: flex; gap: 2px; font-size: 22px; min-height: 28px; }
.ticker span { animation: tickIn 0.35s ease; filter: drop-shadow(0 2px 2px rgba(120, 50, 100, 0.25)); }
.ticker span:nth-child(n+5) { opacity: 0.55; }
@keyframes tickIn { from { transform: scale(0.2) translateY(10px); } to { transform: none; } }
.dash-btn {
  pointer-events: auto; position: absolute; right: calc(16px + var(--safe-r)); bottom: calc(18px + var(--safe-b)); width: 76px; height: 76px;
  border-radius: 50%; border: 4px solid #fff; background: radial-gradient(circle at 35% 30%, #fff3a6, #ffcf3d 55%, #ff9b3d); box-shadow: var(--shadow); font-size: 30px; display: grid; place-items: center; touch-action: none;
}
.dash-btn i { position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(rgba(74, 42, 69, 0.45) calc(var(--cd, 0) * 360deg), transparent 0); pointer-events: none; }
.dash-btn span { position: relative; }
.stick { position: absolute; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); border: 3px solid rgba(255, 255, 255, 0.7); opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.stick.show { opacity: 1; }
.stick i { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #ffb3d4); box-shadow: 0 4px 10px rgba(120, 50, 100, 0.3); }

/* ── Screens ─────────────────────────────────────────── */
.screen { position: absolute; inset: 0; z-index: 12; display: none; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(ellipse at center, rgba(255, 233, 244, 0.25), rgba(255, 209, 232, 0.55)); overflow-y: auto; }
.screen.screen-active { display: flex; }
#screen-menu, #screen-results { background: linear-gradient(180deg, rgba(255, 233, 244, 0) 30%, rgba(255, 209, 232, 0.5)); }
.panel { background: var(--panel); border-radius: 28px; padding: 22px 22px 18px; box-shadow: var(--shadow); width: min(560px, 100%); text-align: center; margin: auto; border: 3px solid #fff; }
.panel-sm { width: min(380px, 100%); }
.readable { width: min(720px, 100%); text-align: left; max-height: calc(100% - 8px); overflow-y: auto; }
.readable h2, .readable .eyebrow { text-align: center; }
.eyebrow { font-size: 11px; letter-spacing: 2px; font-weight: 700; color: var(--pink); }
h1 { margin: 2px 0 6px; font-size: clamp(38px, 9vw, 58px); line-height: 1; color: var(--ink); letter-spacing: -1px; }
h1 span { color: var(--pink); }
h2 { margin: 4px 0 12px; font-size: 26px; }
h3 { margin: 14px 0 6px; font-size: 16px; color: var(--ink2); }
.subtitle { color: var(--ink2); font-size: 15px; line-height: 1.4; margin: 6px auto 12px; max-width: 460px; }
.muted { color: var(--ink2); font-size: 14px; text-align: center; }
.logo-pom { width: 76px; height: 76px; margin: 4px auto 2px; position: relative; animation: bob 2.4s ease-in-out infinite; }
.logo-pom i { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff 0 12%, #ffd1e8 13% 45%, #ff9ccd 75%); box-shadow: 0 8px 18px rgba(255, 122, 176, 0.45), inset -6px -8px 0 rgba(255, 122, 176, 0.35); animation: spin 6s linear infinite; }
.logo-pom::after { content: '🐰'; position: absolute; right: -26px; bottom: -4px; font-size: 32px; }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
.load-track { height: 12px; border-radius: 99px; background: #f3dbe8; overflow: hidden; margin: 10px 0 4px; }
.load-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb3d4, #ff7ab0); transition: width 0.2s; }
.stat-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 8px 0 14px; }
.stat-strip span { background: #fff; border-radius: 999px; padding: 4px 12px; font-size: 14px; box-shadow: 0 2px 8px rgba(120, 50, 100, 0.1); }
.menu-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.menu-actions.compact { display: flex; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.menu-actions button, .stage-card button {
  border: 0; border-radius: 16px; padding: 11px 16px; font-size: 16px; font-weight: 600; background: #fff; color: var(--ink);
  box-shadow: 0 3px 0 #f0cfe0, 0 6px 14px rgba(120, 50, 100, 0.12); transition: transform 0.12s;
}
.menu-actions button:hover, .stage-card button:hover { transform: translateY(-2px); }
.menu-actions button:active, .stage-card button:active { transform: translateY(2px); box-shadow: 0 1px 0 #f0cfe0; }
button.primary { background: linear-gradient(180deg, #ff9cc8, #ff6fa6) !important; color: #fff !important; box-shadow: 0 4px 0 #e0558c, 0 8px 18px rgba(255, 111, 166, 0.35) !important; }
button.big { grid-column: 1 / -1; font-size: 22px; padding: 14px; }
button.big small { display: block; font-size: 13px; font-weight: 500; opacity: 0.9; }

.stage-list { display: flex; flex-direction: column; gap: 10px; }
.stage-card { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 20px; padding: 12px; border: 3px solid color-mix(in srgb, var(--a) 40%, white); }
.stage-card.locked { opacity: 0.6; filter: grayscale(0.5); }
.sc-emoji { font-size: 38px; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: color-mix(in srgb, var(--a) 22%, white); flex: none; }
.sc-body { flex: 1; min-width: 0; }
.sc-body b { font-size: 17px; }
.sc-body p { margin: 2px 0 4px; font-size: 13px; color: var(--ink2); line-height: 1.3; }
.sc-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink2); }
.sc-meta .stars { color: #ffb703; letter-spacing: 1px; font-size: 14px; }
.sc-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.sc-actions button { padding: 8px 14px; font-size: 14px; }

.album-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-weight: 600; }
.album-track { flex: 1; height: 10px; background: #f3dbe8; border-radius: 99px; overflow: hidden; }
.album-track i { display: block; height: 100%; background: linear-gradient(90deg, #7fe0c0, #ffcf3d, #ff7ab0); }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.sticker { background: #fff; border-radius: 14px; padding: 8px 4px; text-align: center; box-shadow: 0 2px 6px rgba(120, 50, 100, 0.1); display: flex; flex-direction: column; gap: 2px; align-items: center; }
.sticker .se { font-size: 28px; line-height: 1.1; }
.sticker b { font-size: 12px; line-height: 1.1; }
.sticker em { font-style: normal; font-size: 11px; color: var(--ink2); }
.sticker.unknown { background: #f8eef4; }
.sticker.unknown .se { filter: grayscale(1); opacity: 0.4; }

.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.skin { border: 3px solid transparent; background: #fff; border-radius: 18px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 3px 8px rgba(120, 50, 100, 0.12); }
.skin i { width: 62px; height: 62px; border-radius: 50%; box-shadow: inset -6px -8px 0 rgba(0, 0, 0, 0.12), 0 4px 10px rgba(120, 50, 100, 0.2); }
.skin b { font-size: 14px; }
.skin em { font-style: normal; font-size: 12px; color: var(--ink2); }
.skin.on { border-color: var(--pink); }
.skin.locked { opacity: 0.55; cursor: default; }

.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.how-grid div { background: #fff; border-radius: 16px; padding: 10px 12px; }
.how-grid b { display: block; margin-bottom: 3px; }
.how-grid span { font-size: 14px; color: var(--ink2); line-height: 1.4; }
kbd { background: #f3dbe8; border-radius: 6px; padding: 0 5px; font-family: inherit; font-size: 12px; }

.over-panel { width: min(500px, 100%); }
.over-stars { font-size: 46px; letter-spacing: 6px; height: 54px; }
.over-stars .star { color: #ead7e2; display: inline-block; }
.over-stars .star.on { color: #ffb703; animation: starPop 0.5s ease backwards; text-shadow: 0 0 12px rgba(255, 183, 3, 0.6); }
@keyframes starPop { from { transform: scale(0) rotate(-90deg); } 70% { transform: scale(1.3); } }
.final-score { font-size: 46px; font-weight: 700; color: var(--pink); line-height: 1.1; }
.newbest-tag { display: inline-block; background: #ffcf3d; color: var(--ink); font-weight: 700; border-radius: 999px; padding: 2px 12px; font-size: 13px; margin: 4px 0; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.summary-grid div { background: #fff; border-radius: 14px; padding: 8px; }
.summary-grid span { display: block; font-size: 12px; color: var(--ink2); }
.summary-grid b { font-size: 20px; }
.summary-grid .unlock { grid-column: 1 / -1; background: linear-gradient(90deg, #fff3a6, #ffd1e8); font-size: 14px; }
.leaderboard-list { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.lb-row { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 12px; padding: 6px 12px; font-size: 14px; }
.lb-row.me { background: #fff3a6; }
.lb-row .rk { width: 22px; font-weight: 700; color: var(--pink); }
.lb-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nn-score-nudge { background: #fff; border-radius: 16px; padding: 10px; margin-top: 10px; }
.nn-score-nudge p { margin: 0 0 8px; }
.nn-nudge-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.nn-nudge-signup { background: var(--pink); color: #fff; text-decoration: none; border-radius: 12px; padding: 8px 14px; font-weight: 600; }
.nn-nudge-later { border: 0; background: #f3dbe8; border-radius: 12px; padding: 8px 14px; }

@media (max-width: 560px) {
  .countdown { font-size: 68px; top: 30%; }
  .size-card { min-width: 168px; padding: 6px 12px 7px; }
  .size-bar { margin-top: 14px; }
  .size-bar .mk { font-size: 9px; top: -13px; }
  .size-row b { font-size: 22px; }
  .size-row span { display: none; }
  .timer { font-size: 18px; min-width: 64px; padding: 5px 10px; }
  .banner b { font-size: 18px; }
  .banner.big b { font-size: 22px; }
  .combo { font-size: 24px; }
  .dash-btn { width: 66px; height: 66px; font-size: 26px; }
  .hud-bottom { right: calc(88px + var(--safe-r)); }
  .next-up { font-size: 12px; }
  .ticker { font-size: 18px; }
  .panel { padding: 18px 14px 14px; border-radius: 22px; }
  .menu-actions button { font-size: 15px; padding: 10px 8px; }
  .game-bar-title { font-size: 15px; }
  .player-pill { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* soft warm vignette: focuses the eye on the ball, gives the meadow a filmic glow */
.pp-vignette{position:absolute;inset:0;pointer-events:none;z-index:2;background:radial-gradient(ellipse at 50% 55%,rgba(255,240,230,0) 55%,rgba(255,170,200,.18) 82%,rgba(120,60,110,.32) 100%);mix-blend-mode:multiply}
