:root { --ink: #2b1b4a; --pink: #ff4d9a; --yellow: #ffd84d; --sky: #8fd8ff; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--sky); color: var(--ink);
  font: 600 16px/1.4 ui-rounded, "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; overscroll-behavior: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }

#hud { position: fixed; inset: 0; pointer-events: none; padding: max(12px, env(safe-area-inset-top)) 14px 0; }
.pill { position: absolute; top: max(44px, calc(env(safe-area-inset-top) + 40px)); left: 14px; background: #fff; border: 3px solid var(--ink);
  border-radius: 16px; padding: 4px 12px 5px; box-shadow: 0 4px 0 var(--ink); display: flex; flex-direction: column; min-width: 92px; }
.pill.right { left: auto; right: 14px; text-align: right; }
.pill b { font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pill span { font-size: 12px; opacity: .75; }
#track { position: absolute; left: 50%; top: max(52px, calc(env(safe-area-inset-top) + 48px)); width: min(34vw, 300px); height: 14px; transform: translateX(-50%);
  background: #fff; border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; }
#bar { display: block; height: 100%; width: 0; background: var(--pink); }

#count { position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-size: min(38vw, 220px); font-weight: 900; color: #fff; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 0 8px 0 var(--ink); }
#count.pop { animation: pop .5s ease-out; }
@keyframes pop { from { transform: scale(1.6); opacity: .2; } to { transform: scale(1); opacity: 1; } }

#menu { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(43, 27, 74, .28); }
.card { width: min(100%, 380px); background: #fff; border: 4px solid var(--ink); border-radius: 26px; box-shadow: 0 8px 0 var(--ink); padding: 20px 22px 18px; text-align: center; }
h1 { margin: 0 0 4px; font-size: 46px; line-height: 1; color: var(--pink); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; letter-spacing: .5px; }
.card p { margin: 10px 0; }
.keys, .best { font-size: 14px; font-weight: 500; opacity: .85; }
.best:empty { display: none; }
button { font: inherit; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
#play { width: 100%; font-size: 24px; font-weight: 800; padding: 12px; background: var(--yellow); border: 4px solid var(--ink); border-radius: 18px; box-shadow: 0 5px 0 var(--ink); }
#play:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
#play:disabled { background: #e6e3ee; cursor: progress; }

#back, #mute { position: fixed; top: max(8px, env(safe-area-inset-top)); font-size: 13px; padding: 4px 10px; background: rgba(255, 255, 255, .85); border: 2px solid var(--ink); border-radius: 12px; color: var(--ink); text-decoration: none; }
#back { left: 14px; } #mute { right: 14px; }

#pad { position: fixed; left: 0; bottom: 0; width: 60%; height: 62%; touch-action: none; }
#knob { position: absolute; left: 70px; bottom: calc(70px + env(safe-area-inset-bottom)); width: 64px; height: 64px; margin: -32px; border-radius: 50%; background: rgba(255, 255, 255, .55); border: 3px solid var(--ink); pointer-events: none; }
#pad::before { content: ""; position: absolute; left: var(--ox, 70px); top: var(--oy, auto); bottom: var(--ob, calc(70px + env(safe-area-inset-bottom))); width: 120px; height: 120px; margin: -60px; border-radius: 50%; border: 3px dashed rgba(43, 27, 74, .45); background: rgba(255, 255, 255, .18); pointer-events: none; }
#jump { position: fixed; right: 22px; bottom: calc(34px + env(safe-area-inset-bottom)); width: 104px; height: 104px; border-radius: 50%; font-size: 20px; font-weight: 800;
  background: var(--yellow); border: 4px solid var(--ink); box-shadow: 0 5px 0 var(--ink); touch-action: none; opacity: .92; }
#jump.down { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
