:root {
  --bg1: #ffe3f1; --bg2: #eadcff; --card: #ffffff; --card2: #fff5fb;
  --ink: #5b3566; --soft: #9a77a8; --accent: #ff5fa8; --accent-d: #d93d86; --accent2: #8a7fe0; --mint: #5fd0b0;
  --plank: #f4b3cf; --plank-d: #e48fb6; --line: #f3c6dc;
  --m-body: #ff9cc8; --m-line: #9a5a8f; --m-glass: rgba(255, 255, 255, .6); --m-trim: #ffd95c; --m-dark: #8a4a7f;
  --title: 'Chewy', 'Fredoka', cursive;
  --ui: 'Fredoka', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --tabbar: 70px;
}
body.dark {
  --bg1: #1d1427; --bg2: #33204a; --card: #2a2036; --card2: #241b30;
  --ink: #f3e9ff; --soft: #b9a6cc; --accent: #b07bff; --accent-d: #7f4fd6; --accent2: #ff5fa8;
  --plank: #4a3560; --plank-d: #2f2140; --line: #4a3560;
  --m-body: #3d2c4f; --m-line: #120c18; --m-glass: rgba(176, 123, 255, .18); --m-trim: #b07bff; --m-dark: #120c18;
  --title: 'Creepster', 'Chewy', cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg1); }
body {
  min-height: 100dvh; color: var(--ink); font-family: var(--ui); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background: linear-gradient(170deg, var(--bg1), var(--bg2)); background-attachment: fixed;
  transition: background .5s, color .5s;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
[hidden] { display: none !important; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--accent2); outline-offset: 3px; }

/* floating background: soft bubbles when pink, cobwebs and bats when dark */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg span { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .55); filter: blur(1px); animation: drift 14s ease-in-out infinite; }
.bg span:nth-child(1) { width: 90px; height: 90px; left: 6%; top: 18%; }
.bg span:nth-child(2) { width: 50px; height: 50px; left: 80%; top: 12%; animation-delay: -3s; background: rgba(255, 179, 209, .5); }
.bg span:nth-child(3) { width: 130px; height: 130px; left: 70%; top: 60%; animation-delay: -6s; background: rgba(215, 194, 255, .45); }
.bg span:nth-child(4) { width: 40px; height: 40px; left: 20%; top: 70%; animation-delay: -9s; }
.bg span:nth-child(5) { width: 70px; height: 70px; left: 45%; top: 40%; animation-delay: -2s; background: rgba(180, 239, 214, .4); }
.bg span:nth-child(6) { width: 24px; height: 24px; left: 90%; top: 85%; animation-delay: -5s; }
@keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(18px, -26px); } }
body.dark .bg span { background: none; filter: none; border-radius: 0; width: auto; height: auto; font-size: 22px; opacity: .55; animation: flap 7s ease-in-out infinite; }
body.dark .bg span::before { content: '🦇'; }
body.dark .bg span:nth-child(3)::before, body.dark .bg span:nth-child(6)::before { content: '✦'; color: #b07bff; }
@keyframes flap { 0%, 100% { transform: translate(0, 0) rotate(-8deg); } 50% { transform: translate(30px, -20px) rotate(8deg); } }
body.dark .bg::before, body.dark .bg::after {
  content: ''; position: absolute; width: 150px; height: 150px; opacity: .35;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23d9c6ff' stroke-width='1.2'%3E%3Cpath d='M0 0 L100 100 M0 0 L100 40 M0 0 L40 100 M0 0 L100 0 M0 0 L0 100'/%3E%3Cpath d='M20 0 Q14 14 0 20 M45 0 Q32 30 0 45 M72 0 Q50 50 0 72 M100 0 Q70 70 0 100'/%3E%3C/svg%3E") center / contain no-repeat;
}
body.dark .bg::before { left: 0; top: 0; }
body.dark .bg::after { right: 0; bottom: 60px; transform: rotate(180deg); }

/* ---------------- header ---------------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px; max-width: 900px; margin: 0 auto;
  background: linear-gradient(var(--bg1) 70%, transparent);
}
.logo { margin: 0; font-family: var(--title); font-weight: 400; font-size: 34px; letter-spacing: 1px; color: var(--accent); text-shadow: 2px 3px 0 #fff, 4px 5px 0 rgba(0, 0, 0, .08); line-height: 1; }
body.dark .logo { color: #c9a8ff; text-shadow: 0 0 14px rgba(176, 123, 255, .6), 2px 3px 0 #120c18; }
.top-right { display: flex; align-items: center; gap: 8px; }
.hearts { display: inline-flex; align-items: center; gap: 5px; background: var(--card); border-radius: 999px; padding: 6px 13px; font-weight: 700; font-size: 19px; box-shadow: 0 3px 0 var(--line); }
.hearts.bump { animation: bump .45s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { 40% { transform: scale(1.25); } }
.round { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--card); font-size: 20px; display: grid; place-items: center; box-shadow: 0 3px 0 var(--line); padding: 0; }
.round:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }

main { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 0 14px calc(var(--tabbar) + 110px + env(safe-area-inset-bottom)); }

/* ---------------- squishies everywhere ---------------- */
.sq { display: block; width: 100%; height: auto; overflow: visible; transform-origin: 50% 92%; }
.sq .f-squish, .sq .f-secret { display: none; }
.sq.pressed .f-norm, .sq.secret .f-norm { display: none; }
.sq.pressed .f-squish, .sq.secret .f-secret { display: inline; }
.sq.pressed .f-secret { display: none; }
.sq .twinkle path { animation: twinkle 1.6s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }

/* ---------------- shelf ---------------- */
.stage { display: grid; justify-items: center; padding-top: 4px; position: relative; }
.big { width: min(64vw, 300px); position: relative; z-index: 2; touch-action: none; cursor: pointer; animation: breathe 3.4s ease-in-out infinite; transform-origin: 50% 92%; }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.015, .985); } }
.shadow { width: min(44vw, 210px); height: 18px; margin-top: -16px; border-radius: 50%; background: rgba(91, 53, 102, .16); filter: blur(3px); }
body.dark .shadow { background: rgba(0, 0, 0, .45); }
.big-name { margin: 8px 0 0; font-family: var(--title); font-size: 30px; color: var(--accent-d); text-align: center; line-height: 1.05; }
body.dark .big-name { color: #d7c2ff; }
.hint { margin: 2px 0 14px; color: var(--soft); font-weight: 600; font-size: 14px; }
.shelf-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); row-gap: 14px;
  background: var(--card2); border-radius: 26px; padding: 14px 10px 6px; box-shadow: inset 0 0 0 3px var(--line);
}
.item { position: relative; border: 0; padding: 0 0 4px; background: none; display: grid; justify-items: center; align-content: end; gap: 0; touch-action: pan-y; }
.item .sq { width: 82px; margin-bottom: -3px; position: relative; z-index: 1; }
.item .plank { display: block; width: 100%; height: 12px; background: linear-gradient(var(--plank), var(--plank-d)); box-shadow: 0 4px 6px rgba(91, 53, 102, .12); }
.item small { margin-top: 6px; padding: 0 4px; font-weight: 600; font-size: 12px; color: var(--soft); text-align: center; line-height: 1.15; min-height: 2.3em; }
.item.on::before { content: '💖'; position: absolute; top: -6px; right: 10px; font-size: 16px; z-index: 2; }

/* ---------------- capsule machine ---------------- */
.machine-screen { display: grid; justify-items: center; gap: 12px; padding-top: 6px; }
.machine-wrap { width: min(76vw, 330px); }
.machine { width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 14px rgba(91, 53, 102, .2)); }
.m-label { font-family: 'Chewy', cursive; font-size: 17px; fill: #fff; letter-spacing: 1px; }
.machine .ball { transform-box: fill-box; transform-origin: center; animation: jiggle 3s ease-in-out infinite; }
.machine .crank { transform-box: view-box; transform-origin: 58px 196px; }
.machine.turning .crank { animation: crank 1.1s ease-in-out; }
.machine.turning .ball { animation: shake .14s linear infinite; }
@keyframes jiggle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes crank { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-3px, 2px) rotate(-8deg); } 75% { transform: translate(3px, -2px) rotate(8deg); } }
.small-note { margin: 0; text-align: center; color: var(--soft); font-weight: 600; font-size: 14px; max-width: 330px; }

.big-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--title); font-size: 28px; letter-spacing: .5px; color: #fff;
  background: linear-gradient(180deg, #ff7fbb, var(--accent-d)); border: 0; border-radius: 999px; padding: 12px 34px 14px;
  box-shadow: 0 6px 0 #a8286a, 0 10px 20px rgba(217, 61, 134, .3); transition: transform .1s, box-shadow .1s;
}
body.dark .big-btn { background: linear-gradient(180deg, #c9a0ff, var(--accent-d)); box-shadow: 0 6px 0 #4f2a9c, 0 0 24px rgba(176, 123, 255, .4); }
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #a8286a; }
.big-btn .cost { font-family: var(--ui); font-weight: 700; font-size: 18px; background: rgba(255, 255, 255, .25); border-radius: 999px; padding: 2px 10px; }
.big-btn.poor { filter: saturate(.4); opacity: .85; }
.big-btn.alt { background: linear-gradient(180deg, #8fe8cf, #3fb994); box-shadow: 0 6px 0 #26806a; }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* capsule opening */
.reveal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #fff6fb, #ffc2df 70%);
}
.reveal.r-sparkly { background: radial-gradient(circle at 50% 45%, #fbf6ff, #d7c2ff 70%); }
.reveal.r-spooky { background: radial-gradient(circle at 50% 45%, #4b2a6b, #1d1427 70%); color: #f3e9ff; }
.reveal.r-rare { background: radial-gradient(circle at 50% 45%, #fffbe6, #ffd95c 45%, #ff9cc8 80%); }
.rays { position: absolute; width: 180vmax; height: 180vmax; left: 50%; top: 45%; translate: -50% -50%; opacity: .35; background: repeating-conic-gradient(from 0deg, #fff 0 10deg, transparent 10deg 20deg); animation: spin 18s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.cap-btn { position: relative; z-index: 2; width: min(56vw, 230px); border: 0; padding: 0; background: none; }
.cap-btn svg { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .2)); }
.cap-btn.drop { animation: capdrop .9s cubic-bezier(.3, 1.4, .5, 1); }
.cap-btn.knock { animation: knock .35s ease-in-out; }
@keyframes capdrop { 0% { transform: translateY(70vh) scale(.4) rotate(-200deg); } 100% { transform: none; } }
@keyframes knock { 25% { transform: rotate(-12deg) scale(1.05); } 60% { transform: rotate(10deg); } }
.capsule .cap-crack { opacity: 0; transition: opacity .2s; }
.cap-btn.cracked .cap-crack { opacity: 1; }
.capsule .cap-top, .capsule .cap-bottom { transform-box: view-box; transform-origin: 50px 50px; transition: transform .45s cubic-bezier(.3, 1.2, .5, 1), opacity .45s; }
.cap-btn.open .cap-top { transform: translate(-40px, -120px) rotate(-60deg); opacity: 0; }
.cap-btn.open .cap-bottom { transform: translate(30px, 110px) rotate(40deg); opacity: 0; }
.cap-btn.open .cap-crack { opacity: 0; }
.capsule.gold .cap-top path:first-child { filter: drop-shadow(0 0 8px #fff3a8); }
.cap-hint { position: absolute; z-index: 2; bottom: 18%; margin: 0; font-family: var(--title); font-size: 30px; color: var(--accent-d); animation: bump 1s ease-in-out infinite; }
.reveal.r-spooky .cap-hint { color: #d7c2ff; }
.prize { position: relative; z-index: 2; display: grid; justify-items: center; gap: 6px; padding: 0 20px; text-align: center; animation: prizein .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes prizein { from { transform: scale(.2); opacity: 0; } }
.prize-sq { width: min(62vw, 270px); touch-action: none; }
.prize h2 { margin: 0; font-family: var(--title); font-weight: 400; font-size: 36px; color: var(--accent-d); line-height: 1.05; }
.reveal.r-spooky .prize h2 { font-family: 'Creepster', cursive; color: #d7c2ff; letter-spacing: 1px; }
.rarity { display: inline-block; font-weight: 700; font-size: 16px; padding: 4px 14px; border-radius: 999px; background: rgba(255, 255, 255, .8); color: #5b3566; }
.rarity.spooky { background: #241a2e; color: #d7c2ff; }
.rarity.rare { background: linear-gradient(90deg, #ffb3d1, #fff0a3, #b4efd6, #b5dcff, #d7c2ff); }
.badge { font-family: var(--title); font-size: 26px; padding: 4px 18px; border-radius: 12px; rotate: -5deg; background: var(--accent); color: #fff; box-shadow: 0 4px 0 #a8286a; }
.badge.dupe { background: #8a7fe0; box-shadow: 0 4px 0 #5a4fb0; font-size: 20px; }
.prize .big-btn { margin-top: 10px; }

/* ---------------- squish rush ---------------- */
.rush { position: relative; padding-top: 4px; }
.rush-top { display: flex; justify-content: space-between; font-size: 26px; font-weight: 700; padding: 0 6px 10px; }
.rush-top b { font-size: 30px; }
.holes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 460px; margin: 0 auto; }
.hole { position: relative; aspect-ratio: 1 / 1.05; overflow: hidden; border-radius: 30px 30px 40% 40%; background: radial-gradient(ellipse at 50% 100%, rgba(255, 255, 255, .9), rgba(255, 255, 255, .25) 70%); touch-action: none; cursor: pointer; }
body.dark .hole { background: radial-gradient(ellipse at 50% 100%, rgba(176, 123, 255, .35), rgba(176, 123, 255, .05) 70%); }
.hole .popper { position: absolute; left: 10%; right: 10%; bottom: 8%; transform: translateY(115%); transition: transform .2s cubic-bezier(.3, 1.5, .5, 1); }
.hole.up .popper { transform: translateY(0); }
.hole.hit .popper .sq { animation: whack .3s ease-out forwards; }
@keyframes whack { 0% { transform: scale(1); } 40% { transform: scale(1.35, .55); } 100% { transform: scale(1.2, .7); } }
.hole .cushion { position: absolute; left: -4%; right: -4%; bottom: -14%; height: 36%; border-radius: 50%; background: linear-gradient(#ffd0e6, #ffb3d1); box-shadow: inset 0 6px 0 rgba(255, 255, 255, .6); }
body.dark .hole .cushion { background: linear-gradient(#4a3560, #33204a); box-shadow: inset 0 6px 0 rgba(176, 123, 255, .3); }
.countdown { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-family: var(--title); font-size: 120px; color: var(--accent); text-shadow: 4px 6px 0 #fff; z-index: 5; pointer-events: none; }
.countdown.beat { animation: beat .7s ease-out; }
@keyframes beat { from { transform: scale(2); opacity: 0; } 30% { opacity: 1; } }
.panel {
  position: absolute; left: 50%; top: 52%; translate: -50% -50%; z-index: 6; width: min(92%, 420px);
  background: var(--card); border-radius: 28px; padding: 22px 20px 24px; text-align: center; box-shadow: 0 12px 0 var(--line), 0 20px 40px rgba(91, 53, 102, .2);
  animation: prizein .45s cubic-bezier(.3, 1.6, .5, 1);
}
.panel h2 { margin: 0 0 8px; font-family: var(--title); font-weight: 400; font-size: 40px; color: var(--accent-d); }
.panel p { margin: 6px 0; font-weight: 600; line-height: 1.4; }
.end-line { font-size: 22px; }
.end-line b { font-size: 30px; color: var(--accent-d); }
.best { color: var(--soft); }
.record { font-family: var(--title); font-size: 24px; color: #f0a500; animation: bump 1s ease-in-out infinite; }

/* ---------------- maker ---------------- */
.maker-top { display: grid; justify-items: center; gap: 8px; }
.maker-preview { width: min(48vw, 220px); touch-action: none; cursor: pointer; }
.name-row { display: flex; gap: 8px; align-items: center; }
.name-row input { width: min(60vw, 260px); font: inherit; font-weight: 700; font-size: 20px; text-align: center; color: var(--ink); background: var(--card); border: 3px solid var(--line); border-radius: 999px; padding: 8px 14px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 14px 2px 8px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 0; border-radius: 999px; padding: 9px 16px; font-weight: 700; font-size: 16px; background: var(--card); box-shadow: 0 3px 0 var(--line); }
.tabs button.on { background: var(--accent); color: #fff; box-shadow: 0 3px 0 var(--accent-d); }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; background: var(--card2); border-radius: 22px; padding: 10px; box-shadow: inset 0 0 0 3px var(--line); }
.opt { aspect-ratio: 1; border: 0; border-radius: 18px; background: var(--card); padding: 6px; display: grid; place-items: center; box-shadow: 0 3px 0 var(--line); }
.opt.on { box-shadow: 0 0 0 4px var(--accent), 0 3px 0 var(--line); }
.opt.swatch { background: var(--c); }
.opt.none { font-size: 28px; color: var(--soft); }
.maker-buttons { margin-top: 16px; }

/* ---------------- album ---------------- */
.album-head { display: grid; gap: 6px; justify-items: center; padding: 4px 0 6px; font-size: 22px; }
.bar { width: min(80vw, 360px); height: 16px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 3px var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, #ffb3d1, #d7c2ff, #b5dcff); border-radius: 999px; transition: width .6s; }
.album h3 { margin: 18px 4px 8px; font-family: var(--title); font-weight: 400; font-size: 26px; color: var(--accent-d); }
body.dark .album h3 { color: #d7c2ff; }
.album h3 small { font-family: var(--ui); font-size: 15px; color: var(--soft); font-weight: 700; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.card { border: 0; border-radius: 20px; background: var(--card); padding: 8px 6px 6px; display: grid; justify-items: center; box-shadow: 0 3px 0 var(--line); }
.card .sq { width: 72px; }
.card small { font-weight: 600; font-size: 11.5px; color: var(--soft); text-align: center; line-height: 1.15; margin-top: 2px; }
.card.missing .sq { filter: brightness(0) opacity(.16); }
body.dark .card.missing .sq { filter: brightness(0) invert(1) opacity(.12); }
.card.missing small { font-size: 18px; font-weight: 700; }

/* viewer */
.viewer { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: 20px; background: rgba(91, 53, 102, .45); backdrop-filter: blur(4px); }
body.dark .viewer { background: rgba(10, 6, 16, .65); }
.view-card { position: relative; width: min(100%, 380px); background: var(--card); border-radius: 30px; padding: 26px 20px 24px; display: grid; justify-items: center; gap: 8px; text-align: center; animation: prizein .45s cubic-bezier(.3, 1.6, .5, 1); }
.view-sq { width: min(60vw, 240px); touch-action: none; }
.view-card h2 { margin: 0; font-family: var(--title); font-weight: 400; font-size: 32px; color: var(--accent-d); }
.close { position: absolute; top: 12px; right: 12px; }

/* ---------------- tab bar ---------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--card); box-shadow: 0 -4px 0 var(--line), 0 -8px 24px rgba(91, 53, 102, .12);
  border-radius: 26px 26px 0 0;
}
.tabbar button { border: 0; background: none; display: grid; justify-items: center; gap: 1px; padding: 4px 0; font-weight: 700; font-size: 12.5px; color: var(--soft); border-radius: 18px; }
.tabbar button span { font-size: 27px; line-height: 1.1; transition: transform .2s; }
.tabbar button.on { color: var(--accent-d); background: var(--card2); }
body.dark .tabbar button.on { color: #d7c2ff; }
.tabbar button.on span { transform: translateY(-3px) scale(1.12); }
.tabbar button.nudge span { animation: nudge .6s ease-in-out 3; }
@keyframes nudge { 30% { transform: translateY(-8px) scale(1.3); } 60% { transform: translateY(0) scale(1); } }

/* ---------------- Mustikas and Kevin ---------------- */
.host { position: fixed; right: 8px; bottom: calc(var(--tabbar) + 6px + env(safe-area-inset-bottom)); z-index: 55; display: flex; align-items: flex-end; gap: 4px; pointer-events: none; }
.host-sq { pointer-events: auto; width: 82px; border: 0; padding: 0; background: none; animation: hostbob 3s ease-in-out infinite; }
.host.talk .host-sq { animation: hostbob .5s ease-in-out infinite; }
@keyframes hostbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.host-bubble {
  pointer-events: auto; max-width: min(64vw, 330px); background: #fff; color: #3b2a3f; border-radius: 20px 20px 4px 20px; padding: 10px 14px;
  font-weight: 600; font-size: 15.5px; line-height: 1.35; box-shadow: 0 4px 0 #e6d4f5, 0 8px 20px rgba(59, 42, 63, .15);
  opacity: 0; transform: translateY(8px) scale(.9); transform-origin: 100% 100%; transition: opacity .25s, transform .25s; margin-bottom: 26px;
}
.host-bubble.show { opacity: 1; transform: none; }
body.dark .host-bubble { background: #241a2e; color: #f3e9ff; box-shadow: 0 4px 0 #120c18, 0 0 20px rgba(176, 123, 255, .25); }
.kevin { position: fixed; top: 0; z-index: 40; width: 74px; transform: translateY(-110%); transition: transform 1.2s cubic-bezier(.3, 1.3, .5, 1); pointer-events: none; }
.kevin.down { transform: translateY(calc(26vh + env(safe-area-inset-top))); }
.kevin .thread { position: absolute; left: 50%; bottom: 88%; width: 2px; height: 60vh; background: rgba(120, 100, 140, .6); }
body.dark .kevin .thread { background: rgba(230, 220, 255, .6); }
.kevin .kv { pointer-events: auto; border: 0; padding: 0; background: none; width: 100%; animation: dangle 2.2s ease-in-out infinite; transform-origin: 50% -40px; }
.kevin.wave .kv { animation: wavey .25s ease-in-out 6; }
@keyframes dangle { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes wavey { 50% { transform: rotate(-16deg) scale(1.1); } }

/* ---------------- fx ---------------- */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.puff { position: absolute; translate: -50% -50%; animation: puff 1s cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes puff { 0% { transform: translate(0, 0) scale(.3); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 0; } }
.floater { position: absolute; translate: -50% -50%; font-weight: 700; font-size: 22px; color: var(--accent-d); text-shadow: 0 2px 0 #fff; animation: floatup 1.2s ease-out forwards; white-space: nowrap; }
.floater.big { font-size: 30px; color: #f0a500; }
.floater.plus { font-size: 24px; }
@keyframes floatup { to { transform: translateY(-60px); opacity: 0; } }

/* ---------------- bigger screens ---------------- */
@media (min-width: 700px) {
  .logo { font-size: 42px; }
  .shelf-list { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  .item .sq { width: 96px; }
  .tabbar { left: 50%; right: auto; width: min(640px, 100%); translate: -50% 0; }
  .host-sq { width: 100px; }
}
@media (prefers-reduced-motion: reduce) { .bg span, .rays, .big { animation: none !important; } }
