:root {
  --ink: #3d2a2e;
  --ink-soft: #7a6468;
  --ink-faint: #b8a8a6;
  --cream: #fff8ee;
  --line: #f0dcc4;
  --coral: #ff6b6b;
  --coral-deep: #e24f57;
  --grape: #8e6cf0;
  --mint: #5ed3bc;
  --sun: #ffc93c;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--cream); color: var(--ink); font-family: 'Nunito', system-ui, sans-serif; }
body { min-height: 100dvh; overflow-x: hidden; }
body::before, body::after { content: ''; position: fixed; border-radius: 50%; z-index: -1; }
body::before { width: 340px; height: 340px; background: #ffe4d2; top: -140px; left: -140px; }
body::after { width: 300px; height: 300px; background: #e9e2ff; bottom: -120px; right: -130px; }
.app { max-width: 460px; margin: 0 auto; padding: max(10px, env(safe-area-inset-top)) 16px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.top { width: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 900; font-size: 24px; color: var(--ink); text-decoration: none; letter-spacing: -0.5px; }
.pill { color: #fff; font-weight: 900; padding: 6px 14px; border-radius: 16px; border: 2.5px solid var(--ink); background: var(--coral); }
.best { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 3px 10px; text-align: center; min-width: 76px; }
.best span { display: block; font-size: 10px; letter-spacing: 1px; color: var(--ink-faint); font-weight: 900; }
.best b { font-size: 15px; }
.challenge { width: 100%; background: #fff3c4; border: 2px solid #f3d57a; border-radius: 16px; padding: 8px 12px; font-weight: 800; text-align: center; }
.app > .openInApp { display: block; width: 100%; min-height: 44px; padding: 10px 14px; border: 2px solid var(--ink); border-radius: 16px; background: var(--grape); color: #fff; text-align: center; font-weight: 900; text-decoration: none; }
.challenge .openInApp { display: inline-block; margin-top: 4px; font-size: 13px; color: #c2410c; text-decoration: underline; }
.scoreRow { width: 100%; display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.score { grid-column: 2; text-align: center; font-size: 46px; font-weight: 900; letter-spacing: -1px; transition: transform 0.12s; }
.score.pop { transform: scale(1.12); }
.next { grid-column: 3; text-align: center; }
.next span { font-size: 10px; letter-spacing: 1.5px; color: var(--ink-faint); font-weight: 900; }
.nextBubble { width: 52px; height: 52px; border-radius: 18px; border: 2.5px solid var(--line); margin: 2px auto 0; display: grid; place-items: center; overflow: visible; }
.nextBubble img { width: 50px; height: 50px; }
.stage { position: relative; width: 100%; user-select: none; touch-action: none; }
.claw { position: relative; height: calc(var(--cell) * 1.1); }
.claw img { position: absolute; bottom: 0; width: calc(var(--cell) * 1.08); height: calc(var(--cell) * 1.08); transition: left 0.14s cubic-bezier(.3,1.4,.5,1); animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.jar { position: relative; background: #fffbf5; border: 3px solid var(--line); border-radius: 32px; overflow: hidden; box-shadow: 0 6px 14px rgba(107,63,42,.14); height: calc(var(--cell) * 6 + var(--gap) * 5 + var(--pad) * 2 + 6px); }
.jar.danger { animation: danger 1s ease-in-out infinite; }
@keyframes danger { 50% { border-color: #f2545b; } }
.jar.shake { animation: shake 0.24s; }
@keyframes shake { 25% { transform: translateX(-7px); } 60% { transform: translateX(7px); } 85% { transform: translateX(-3px); } }
.lane { position: absolute; top: 0; bottom: 0; }
.tile { position: absolute; width: var(--cell); height: var(--cell); transition: transform 0.13s ease-in, opacity 0.13s; will-change: transform; }
.tile .edge, .tile .face { position: absolute; inset: 0; border-radius: calc(var(--cell) * 0.26); }
.tile .face { bottom: 5px; border: 2px solid rgba(255,255,255,.6); }
.tile img { position: absolute; left: 50%; top: 50%; width: calc(var(--cell) * 1.1); height: calc(var(--cell) * 1.1); transform: translate(-50%, -58%); pointer-events: none; }
.tile.pop img { animation: pop 0.32s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { 0% { transform: translate(-50%, -58%) scale(0.6); } 60% { transform: translate(-50%, -58%) scale(1.25); } 100% { transform: translate(-50%, -58%) scale(1); } }
.tile.land img { animation: land 0.26s ease-out; }
@keyframes land { 0% { transform: translate(-50%, -58%) scale(1.1, 0.8); } 100% { transform: translate(-50%, -58%) scale(1); } }
.tile.gone { opacity: 0; transform-origin: center; }
.guide { position: absolute; top: 0; width: 4px; background-image: linear-gradient(var(--dot) 50%, transparent 0); background-size: 4px 14px; transition: left 0.14s; }
.ghost { position: absolute; width: var(--cell); height: var(--cell); border: 2.5px dashed var(--dot); border-radius: calc(var(--cell) * 0.26); background: rgba(255,255,255,.4); display: grid; place-items: center; transition: left 0.14s, top 0.14s; }
.ghost img { width: 70%; opacity: .4; }
.float { position: absolute; font-weight: 900; font-size: 22px; pointer-events: none; text-shadow: 0 0 6px #fff; animation: rise 0.9s ease-out forwards; }
@keyframes rise { to { transform: translateY(-70px); opacity: 0; } }
.spark { position: absolute; width: 9px; height: 7px; border-radius: 3px; pointer-events: none; animation: spark 0.55s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) rotate(180deg) scale(.5); opacity: 0; } }
.banner { position: absolute; left: 50%; top: 34%; transform: translate(-50%, 0) rotate(-4deg); background: rgba(255,255,255,.94); border: 3px solid var(--ink); border-radius: 22px; padding: 10px 22px; font-size: 32px; font-weight: 900; animation: banner 0.9s ease-out forwards; pointer-events: none; }
@keyframes banner { 0% { transform: translate(-50%, 0) rotate(-4deg) scale(0); } 20% { transform: translate(-50%, 0) rotate(-4deg) scale(1.12); } 70% { transform: translate(-50%, 0) rotate(-4deg) scale(1); opacity: 1; } 100% { transform: translate(-50%, 0) rotate(-4deg) scale(1.2); opacity: 0; } }
.hint { position: absolute; left: 50%; top: 42%; transform: translateX(-50%); background: rgba(255,255,255,.92); border-radius: 14px; padding: 8px 14px; font-weight: 900; text-align: center; line-height: 1.35; pointer-events: none; transition: opacity .4s; white-space: nowrap; }
.hint.hide { opacity: 0; }
.goal { margin: 2px 0 0; font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.appCta { display: flex; align-items: center; gap: 10px; width: 100%; background: #fff; border: 2.5px solid var(--ink); border-radius: 22px; padding: 8px 14px; color: var(--ink); text-decoration: none; font-size: 13px; line-height: 1.3; box-shadow: 0 5px 0 #e8d7c2; }
.appCta img { width: 54px; height: 54px; }
.appCta b { font-size: 15px; }
.overlay { position: fixed; inset: 0; background: rgba(40,24,30,.66); display: grid; place-items: center; padding: 20px; z-index: 10; }
.card { width: min(380px, 100%); background: var(--cream); border: 3px solid var(--ink); border-radius: 32px; padding: 26px 18px 16px; text-align: center; position: relative; }
.ribbon { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); background: var(--coral); color: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 6px 16px; font-weight: 900; letter-spacing: 1px; white-space: nowrap; }
.overPal { width: 160px; height: 160px; }
.overName { font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); font-size: 13px; }
.overScore { font-size: 48px; font-weight: 900; letter-spacing: -1px; line-height: 1.1; }
.overLabel { font-size: 12px; font-weight: 800; color: var(--ink-soft); letter-spacing: 2px; text-transform: uppercase; }
.ladder { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; margin: 10px 0; }
.ladder img { width: 26px; height: 26px; border-radius: 50%; }
.ladder img.off { filter: brightness(0) opacity(.2); }
.overVs { font-weight: 900; margin: 4px 0 10px; }
.btn { display: block; width: 100%; border: 0; border-radius: 22px; padding: 14px; font: inherit; font-weight: 900; font-size: 18px; color: #fff; cursor: pointer; text-decoration: none; margin-top: 8px; }
.btn.coral { background: var(--coral); box-shadow: 0 5px 0 var(--coral-deep); }
.btn.grape { background: var(--grape); box-shadow: 0 5px 0 #6c4fc6; }
.btn.ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); box-shadow: 0 5px 0 var(--line); }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; width: auto; font-size: 16px; }
.toast { font-weight: 800; color: var(--ink-soft); font-size: 13px; }

.groupBox { margin: 8px 0 10px; padding: 10px 12px; border-radius: 16px; background: #fff; border: 2.5px solid var(--ink, #2B2027); text-align: left; font-size: 14px; }
.groupBox b { display: block; font-weight: 900; }
.groupList { margin: 6px 0 4px 20px; padding: 0; font-weight: 800; }
.groupList li { margin: 1px 0; }
.groupNote { margin: 4px 0 0; font-weight: 800; color: var(--ink-soft, #6B5A63); font-size: 13px; }
