/* Jelly Bounce */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2a1f4a; color: #3a2140; font-family: Fredoka, "Segoe UI", system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
body { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
#app { position: fixed; inset: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }
kbd { display: inline-block; min-width: 1.9em; padding: .12em .45em; margin: 0 .12em; border-radius: .4em; background: #fff; color: #3a2140; border: 2px solid #d9c6de; border-bottom-width: 4px; font: 600 .95em/1.3 Fredoka, system-ui, sans-serif; text-align: center; }
kbd.wide { min-width: 4.6em; }

/* heads-up display */
.hud { position: absolute; top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; z-index: 5; }
.hud > div { display: flex; gap: 8px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 14px; border-radius: 999px; background: rgba(32, 18, 56, .72); color: #fff; font: 600 19px/1 Fredoka, system-ui, sans-serif; box-shadow: 0 3px 10px rgba(0, 0, 0, .25); }
.pill .gem { width: 17px; height: 21px; background: linear-gradient(160deg, #9be9ff 0 42%, #19b6e8 42% 100%); clip-path: polygon(50% 0, 100% 42%, 50% 100%, 0 42%); }
.pill .coin { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b8 0 18%, #ffd34d 19% 62%, #e0a21c 63%); }
.pill.lives { gap: 4px; padding: 0 12px 0 8px; }
.pill.lives img { width: 30px; height: auto; }
@media (max-width: 430px) { .hud > div { gap: 5px; } .pill { height: 38px; padding: 0 9px; font-size: 16px; gap: 5px; } .pill.lives { padding: 0 9px 0 6px; } .pill.lives img { width: 25px; } button.pill { width: 40px; } }
button.pill { pointer-events: auto; border: 0; cursor: pointer; width: 46px; justify-content: center; padding: 0; font-size: 22px; }
button.pill:hover { background: rgba(60, 36, 100, .9); }

.toast { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 56px); left: 50%; transform: translateX(-50%); max-width: min(92vw, 560px); padding: 10px 18px; border-radius: 16px; background: rgba(255, 255, 255, .94); color: #3a2140; font: 600 18px/1.25 Fredoka, system-ui, sans-serif; text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); z-index: 6; pointer-events: none; }
.toast.show { animation: pop .25s ease-out; }
@keyframes pop { from { transform: translateX(-50%) scale(.8); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }

.keys { position: absolute; bottom: max(10px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: rgba(32, 18, 56, .55); color: #fff; font: 500 15px/1.5 Fredoka, system-ui, sans-serif; white-space: nowrap; z-index: 5; pointer-events: none; }
.keys kbd { font-size: .85em; margin: 0 .2em 0 .7em; border-color: #b9a6c9; }
.keys kbd:first-child { margin-left: 0; }

/* touch pad */
.pad { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); display: flex; justify-content: space-between; align-items: flex-end; pointer-events: none; z-index: 5; }
.pad .move { pointer-events: auto; display: flex; gap: 12px; padding: 14px 6px 6px; touch-action: none; }
.pad .pb, .pad .jump { display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; background: rgba(32, 18, 56, .5); border: 3px solid rgba(255, 255, 255, .75); font: 700 30px/1 Fredoka, system-ui, sans-serif; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.pad .pb { width: 78px; height: 78px; }
.pad .move[data-on="l"] .pb.l, .pad .move[data-on="r"] .pb.r { background: rgba(255, 79, 139, .9); transform: scale(.94); }
.pad .jump { pointer-events: auto; width: 104px; height: 104px; font-size: 21px; letter-spacing: .04em; background: rgba(255, 79, 139, .72); touch-action: none; cursor: pointer; }
.pad .jump.on { background: rgba(255, 79, 139, 1); transform: scale(.94); }
@media (max-height: 440px) { .pad .pb { width: 66px; height: 66px; } .pad .jump { width: 88px; height: 88px; font-size: 18px; } }

/* menus */
.ui { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(34, 18, 60, .46); overflow-y: auto; touch-action: pan-y; }
.panel { width: min(100%, 460px); max-height: 100%; overflow-y: auto; padding: 22px 22px 20px; border-radius: 26px; background: #fff8fb; box-shadow: 0 16px 50px rgba(20, 5, 40, .45), inset 0 0 0 4px #ffd3e3; text-align: center; }
.panel.wide { width: min(100%, 640px); }
h1 { margin: 0; white-space: nowrap; font: 700 clamp(34px, 10vw, 54px)/1 Fredoka, system-ui, sans-serif; color: #e8336d; letter-spacing: .01em; text-shadow: 0 3px 0 #ffd3e3; }
h2 { margin: 0 0 10px; font: 700 28px/1.1 Fredoka, system-ui, sans-serif; color: #e8336d; }
.tag { margin: 6px 0 16px; font-size: 18px; font-weight: 500; }
.note { margin: 8px 0; font-size: 15.5px; line-height: 1.4; color: #6b4d72; font-weight: 500; }
.hero { width: 150px; height: auto; margin: -6px auto 2px; display: block; animation: bob 1.1s ease-in-out infinite alternate; }
.hero.small { width: 104px; }
@keyframes bob { from { transform: translateY(0) scale(1.04, .96); } to { transform: translateY(-12px) scale(.97, 1.03); } }
button, a.btn { font: 600 17px/1.1 Fredoka, system-ui, sans-serif; color: #b3245a; background: #fff; border: 2.5px solid #ffb3cd; border-radius: 16px; padding: 11px 16px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; }
button:hover, a.btn:hover { background: #ffeef4; }
button:focus-visible, a.btn:focus-visible { outline: 3px solid #6c4bd8; outline-offset: 2px; }
button.primary { color: #fff; background: #ff4f8b; border-color: #e8336d; box-shadow: 0 4px 0 #c92560; }
button.primary:hover { background: #ff6699; }
button.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #c92560; }
button.big { width: 100%; font-size: 23px; padding: 15px; margin: 6px 0 12px; border-radius: 20px; }
button.linkish { border: 0; background: none; padding: 2px 4px; min-height: 0; color: #c92560; text-decoration: underline; font-size: inherit; display: inline; }
.row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.row.small button { font-size: 15px; padding: 8px 12px; min-height: 40px; }
.row > button { flex: 1 1 auto; }
.col { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.col > :first-child { grid-column: 1 / -1; }
.tick { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 15.5px; font-weight: 500; color: #6b4d72; cursor: pointer; }
.tick input { width: 20px; height: 20px; accent-color: #ff4f8b; }

.steps { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 10px; text-align: left; counter-reset: s; }
.steps kbd { font-size: .85em; min-width: 1.7em; margin: 0 .06em; }
.steps kbd.wide { min-width: 3.9em; }
.steps li { display: grid; grid-template-columns: 30px 150px 1fr; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 16px; background: #ffeef4; font-size: 16.5px; line-height: 1.3; font-weight: 500; counter-increment: s; }
.steps li::before { content: counter(s); width: 30px; height: 30px; border-radius: 50%; background: #ff4f8b; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.steps .pic { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; font-size: 15px; }
.steps .pic em { font-style: normal; font-size: 13px; color: #8a6c90; margin: 0 2px; }
.steps .tb { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; background: #5b3a86; color: #fff; font-weight: 700; font-size: 20px; border: 3px solid #cdb7ea; }
.steps .tb.wide { width: 62px; height: 62px; background: #ff4f8b; border-color: #ffc3d8; font-size: 14px; }
.steps canvas.ico { width: 44px; height: 44px; }
@media (max-width: 420px) { .steps li { grid-template-columns: 26px 104px 1fr; font-size: 15px; padding: 9px; } .steps li::before { width: 26px; height: 26px; } .steps .tb { width: 40px; height: 40px; } .steps .tb.wide { width: 54px; height: 54px; font-size: 12px; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.lv { flex-direction: column; gap: 3px; padding: 10px 6px; min-height: 104px; }
.lv b { font-size: 26px; color: #e8336d; line-height: 1; }
.lv span { font-size: 14.5px; }
.lv small { font-size: 13px; color: #8a6c90; font-weight: 500; }
.lv.locked { opacity: .55; cursor: default; background: #f3e9ef; }
.stars { color: #ffb81f; font-size: 17px; letter-spacing: 1px; }
.stars i { font-style: normal; color: #e3d3dc; }
.bigstars { font-size: 46px; line-height: 1; letter-spacing: 6px; margin: 2px 0; }
.bigstars span { color: #e3d3dc; display: inline-block; }
.bigstars span.on { color: #ffb81f; animation: starpop .45s cubic-bezier(.2, 1.6, .4, 1) both; text-shadow: 0 3px 0 #e59200; }
@keyframes starpop { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1) rotate(0); } }
table { border-collapse: collapse; width: 100%; }
.sum { margin: 8px auto; max-width: 300px; font-size: 16.5px; font-weight: 500; }
.sum td { padding: 3px 4px; text-align: left; } .sum td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.sum .tot td { border-top: 2px solid #ffd3e3; font-weight: 700; color: #e8336d; font-size: 19px; padding-top: 6px; }
.tabs { display: flex; gap: 6px; justify-content: center; margin-bottom: 8px; }
.tabs button { min-height: 38px; padding: 7px 16px; border-radius: 999px; }
.tabs button.on { background: #ff4f8b; color: #fff; border-color: #e8336d; }
.board { font-size: 15.5px; font-weight: 500; }
.board th { font-size: 13px; color: #8a6c90; text-align: left; padding: 3px 6px; }
.board td { padding: 5px 6px; text-align: left; border-top: 1px solid #ffe1eb; font-variant-numeric: tabular-nums; }
.board td:last-child, .board th:last-child { text-align: right; }
.board tr.me td { background: #fff0c9; font-weight: 700; }
.namebox { margin-top: 12px; padding: 10px 12px; border-radius: 16px; background: #ffeef4; }
.namebox input { flex: 2 1 160px; min-width: 0; font: 500 17px Fredoka, system-ui, sans-serif; padding: 10px 12px; border-radius: 14px; border: 2.5px solid #ffb3cd; color: #3a2140; user-select: text; -webkit-user-select: text; }
.namebox .row > button { flex: 0 0 auto; }
.namebox details { margin-top: 6px; font-size: 15px; font-weight: 500; color: #6b4d72; }
.namebox summary { cursor: pointer; }
.code { letter-spacing: .12em; user-select: all; -webkit-user-select: all; }

@media (max-height: 520px) {
  .panel { padding: 14px 18px; }
  .panel.title { display: grid; grid-template-columns: auto 1fr; column-gap: 18px; align-items: center; width: min(100%, 640px); text-align: left; }
  .panel.title .hero { grid-row: 1 / span 6; width: 130px; margin: 0; }
  .panel.title .row { justify-content: flex-start; }
  .hero.small { width: 64px; } .bigstars { font-size: 34px; } h2 { font-size: 23px; margin-bottom: 4px; }
  button.big { padding: 10px; font-size: 20px; margin: 4px 0 8px; }
  .steps { gap: 6px; } .steps li { padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) { .hero, .bigstars span.on, .toast.show { animation: none; } }
