/* ================= Koalamochi styles ================= */
:root {
  --pink: #ff8fb1;
  --pink-d: #e8557a;
  --pink-l: #ffe3ec;
  --mint: #7fdcc0;
  --lav: #b9a3ff;
  --yellow: #ffd96a;
  --sky: #8fd3ff;
  --ink: #4a3b4f;
  --ink-soft: #8a7a8f;
  --line: #ffd0de;
  --font: 'Fredoka', 'Baloo 2', 'Nunito', 'Segoe UI', 'Comic Sans MS', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #ffd6e3;
  background-image: radial-gradient(#fff 3px, transparent 3.5px), radial-gradient(#fff 3px, transparent 3.5px);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; user-select: none; -webkit-user-select: none;
}
button { font-family: inherit; color: inherit; cursor: pointer; border: none; background: none; padding: 0; }
input { font-family: inherit; }
.hidden { display: none !important; }

#device {
  position: relative;
  width: min(460px, 100vw);
  height: min(880px, 100vh);
  height: min(880px, 100dvh);
  background: #fff7fa;
  border-radius: 36px;
  box-shadow: 0 0 0 8px #fff, 0 0 0 14px #ffb3cb, 0 20px 50px rgba(200, 60, 110, .35);
  display: flex; flex-direction: column; overflow: hidden;
}
@media (max-width: 500px), (max-height: 700px) {
  #device { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; box-shadow: none; }
}

/* ---------- top bar ---------- */
#topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 8px; gap: 10px; }
#pet-name { font-size: 22px; font-weight: 700; color: var(--pink-d); line-height: 1.05; }
.lvl-row { display: flex; gap: 6px; align-items: center; margin: 4px 0; }
#lvl-badge { background: var(--pink); color: #fff; font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 99px; }
#stage { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.xpbar { position: relative; width: 150px; height: 14px; background: var(--pink-l); border-radius: 99px; overflow: hidden; border: 2px solid #ffc2d4; }
#xp-fill { height: 100%; width: 0; background: linear-gradient(90deg, #ffd96a, #ffb347); border-radius: 99px; transition: width .4s; }
#xp-text { position: absolute; inset: 0; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; color: #a0566e; }
.top-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.coin-pill { background: #fff3c4; border: 3px solid var(--yellow); border-radius: 99px; padding: 3px 12px; font-weight: 700; font-size: 16px; }
.coin-pill.bump { animation: bump .35s; }
.icon-btns { display: flex; gap: 6px; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 2px solid #ffc2d4; font-size: 16px; display: grid; place-items: center; }
.icon-btn.off { opacity: .4; }
.top-right { position: relative; }
#vol-pop {
  position: absolute; top: 100%; right: 0; margin-top: 8px; z-index: 35;
  background: #fff; border: 3px solid var(--line); border-radius: 18px; padding: 10px 14px;
  box-shadow: 0 8px 20px rgba(232, 85, 122, .2); animation: up .2s ease-out; width: 220px;
}
.vol-box { display: flex; flex-direction: column; gap: 4px; }
.vol-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.vol-row span { font-size: 18px; }
.vol-row b { width: 28px; text-align: right; font-size: 13px; color: var(--ink-soft); }
.vol-row input[type=range] { flex: 1; min-width: 110px; accent-color: var(--pink); cursor: pointer; }

/* ---------- stats ---------- */
#stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 4px 14px 10px; }
.stat { display: flex; align-items: center; gap: 4px; background: #fff; border-radius: 14px; padding: 5px 7px; border: 2px solid #ffe0ea; }
.stat-ico { font-size: 15px; }
.meter { flex: 1; height: 10px; background: #f3e8ec; border-radius: 99px; overflow: hidden; }
.meter .fill { height: 100%; width: 50%; border-radius: 99px; transition: width .5s, background-color .5s; }
.stat.low { animation: pulse 1s infinite; }

/* ---------- room ---------- */
#room { position: relative; flex: 1; min-height: 0; margin: 0 12px; border-radius: 26px; overflow: hidden; border: 4px solid #fff; box-shadow: 0 0 0 2px var(--line); }
#room-bg { position: absolute; inset: 0; background-size: cover; background-position: center bottom; }
#room-bg .wall { position: absolute; left: 0; right: 0; top: 0; height: 64%; background-color: var(--wall); background-image: var(--wall-pat); background-size: var(--wall-size, 28px 28px); }
#room-bg .floor { position: absolute; left: 0; right: 0; bottom: 0; height: 36%; background: var(--floor); border-top: 7px solid var(--trim); }
#room-bg.has-img .wall, #room-bg.has-img .floor { display: none; }
#room.has-img .window-deco, #room.has-img .rug { display: none; }

.wp-strawberry { --wall: #ffe6ee; --wall-pat: radial-gradient(#ffc3d5 3px, transparent 3.5px); --floor: repeating-linear-gradient(90deg, #f6cfae 0 46px, #efc29d 46px 50px); --trim: #ffb3c9; }
.wp-mint { --wall: #e2f8ef; --wall-pat: repeating-linear-gradient(90deg, transparent 0 18px, #c9f0e1 18px 30px); --wall-size: auto; --floor: repeating-linear-gradient(90deg, #e9d6b9 0 46px, #dcc6a5 46px 50px); --trim: #9fe3cb; }
.wp-lavender { --wall: #efe7ff; --wall-pat: radial-gradient(#d9c9ff 4px, transparent 4.5px); --wall-size: 34px 34px; --floor: repeating-linear-gradient(45deg, #e3d7f7 0 20px, #d6c7f2 20px 40px); --trim: #c3b0ff; }
.wp-cloud { --wall: #d8efff; --wall-pat: radial-gradient(ellipse 30px 13px at 50% 50%, #fff 96%, transparent 100%); --wall-size: 90px 60px; --floor: repeating-linear-gradient(90deg, #cfe4f7 0 46px, #bed8f0 46px 50px); --trim: #a9d6ff; }
.wp-starry { --wall: #2f2c66; --wall-pat: radial-gradient(#fff6b0 1.6px, transparent 2px); --wall-size: 36px 36px; --floor: repeating-linear-gradient(90deg, #4a437f 0 46px, #403973 46px 50px); --trim: #7a6fd1; }

.window-deco {
  position: absolute; left: 7%; top: 8%; width: 28%; aspect-ratio: 1 / 1.1;
  background: linear-gradient(#bfe6ff, #eaf8ff); border: 7px solid #fff; border-radius: 40px 40px 8px 8px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .06);
}
.window-deco::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 6px; margin-left: -3px; background: #fff; }
.window-deco::after { content: '☁️'; position: absolute; left: 10%; top: 25%; font-size: 22px; animation: drift 9s ease-in-out infinite alternate; }

#shelf {
  position: absolute; right: 6%; top: 7%; width: 44%;
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 46px;
  background: repeating-linear-gradient(to bottom, transparent 0 38px, #d79b6e 38px 46px);
  min-height: 46px; z-index: 2;
}
#shelf:empty { display: none; }
/* over a picture background: a floating white shelf instead of the wooden plank */
#room.has-img #shelf {
  background: repeating-linear-gradient(to bottom, transparent 0 38px, rgba(255, 255, 255, .92) 38px 46px);
  filter: drop-shadow(0 3px 2px rgba(120, 60, 90, .25));
}
#shelf button { font-size: 26px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 7px; transition: transform .15s; }
#shelf button:hover { transform: scale(1.15) rotate(-5deg); }
#shelf button img { width: 34px; height: 34px; object-fit: contain; }

.rug { position: absolute; left: 50%; bottom: 3%; width: 72%; height: 14%; transform: translateX(-50%); border-radius: 50%; background: #ffc8d8; box-shadow: inset 0 0 0 6px #ffb0c7, inset 0 0 0 10px #ffd9e5; }
.wp-mint .rug { background: #c4f0e0; box-shadow: inset 0 0 0 6px #a5e6cf, inset 0 0 0 10px #d6f7eb; }
.wp-lavender .rug { background: #ddd0ff; box-shadow: inset 0 0 0 6px #cbb8ff, inset 0 0 0 10px #e9e1ff; }
.wp-cloud .rug { background: #fff; box-shadow: inset 0 0 0 6px #d4ecff, inset 0 0 0 10px #fff; }
.wp-starry .rug { background: #ffe58a; box-shadow: inset 0 0 0 6px #ffd24d, inset 0 0 0 10px #fff0b8; }

#pet-wrap {
  position: absolute; left: 50%; bottom: 5%;
  width: calc(min(56%, 250px) * var(--scale, 1));
  aspect-ratio: 200 / 220;
  transform: translateX(-50%); z-index: 3; transition: width .6s;
}
#pet { position: relative; width: 100%; height: 100%; animation: bob 2.6s ease-in-out infinite; transform-origin: 50% 100%; cursor: pointer; }
#room.sleeping #pet { animation: breathe 4s ease-in-out infinite; }
#pet.squish { animation: squish .45s ease-out; }
#pet .pet-base { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.acc { position: absolute; pointer-events: none; }
.acc svg, .acc img { width: 100%; height: auto; display: block; }
.star-glow { position: absolute; inset: -6%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 233, 140, .55), transparent 65%); animation: glow 2.5s ease-in-out infinite; pointer-events: none; }

#speech {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px;
  background: #fff; border: 3px solid var(--line); border-radius: 18px; padding: 6px 12px;
  font-weight: 600; font-size: 14px; width: max-content; max-width: 220px; text-align: center; z-index: 6;
  box-shadow: 0 4px 0 rgba(232, 85, 122, .15); animation: popIn .25s ease-out;
}
#speech::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -8px; border: 8px solid transparent; border-top-color: #fff; }

.zzz { position: absolute; right: 2%; top: 0; font-weight: 700; color: #b8c6ff; font-size: 24px; }
.zzz span { display: inline-block; opacity: 0; animation: zz 2.4s infinite; }
.zzz span:nth-child(2) { animation-delay: .5s; font-size: 28px; }
.zzz span:nth-child(3) { animation-delay: 1s; font-size: 34px; }
.stink { position: absolute; left: 0; right: 0; top: -4%; text-align: center; color: #93c060; font-size: 26px; font-weight: 700; letter-spacing: 14px; animation: stink 1.8s ease-in-out infinite; pointer-events: none; }

#messes { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.mess { position: absolute; pointer-events: auto; font-size: 30px; transform: translate(-50%, -50%); animation: wiggle 2.2s ease-in-out infinite; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .12)); }

#night { position: absolute; inset: 0; background: linear-gradient(rgba(27, 24, 70, .78), rgba(43, 36, 102, .55)); opacity: 0; transition: opacity 1s; pointer-events: none; z-index: 5; }
#night::after { content: '🌙'; position: absolute; top: 7%; left: 9%; font-size: 34px; }
#room.sleeping #night { opacity: 1; }

/* ---------- action bar ---------- */
#actions { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 10px 12px 14px; }
#actions button {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: #fff; border: 3px solid var(--c, #ffd0de); border-radius: 18px; padding: 7px 0 6px;
  font-weight: 600; font-size: 12px; box-shadow: 0 4px 0 var(--c, #ffd0de); transition: transform .1s, box-shadow .1s;
}
#actions button span { font-size: 22px; line-height: 1.1; }
#actions button em { font-style: normal; }
#actions button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--c, #ffd0de); }
#actions button:disabled { opacity: .4; cursor: not-allowed; }
#actions button:nth-child(1) { --c: #ffc9a8; }
#actions button:nth-child(2) { --c: #b9e7ff; }
#actions button:nth-child(3) { --c: #b5ecd9; }
#actions button:nth-child(4) { --c: #d4c6ff; }
#actions button:nth-child(5) { --c: #ffd0de; }
#actions button:nth-child(6) { --c: #ffe08a; }

/* ---------- modal sheet ---------- */
#modal { position: absolute; inset: 0; background: rgba(80, 30, 60, .28); z-index: 30; display: flex; align-items: flex-end; }
.sheet { width: 100%; max-height: 84%; background: #fff; border-radius: 28px 28px 0 0; display: flex; flex-direction: column; animation: up .25s ease-out; box-shadow: 0 -6px 24px rgba(0, 0, 0, .12); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 6px; }
.sheet-head h2 { margin: 0; font-size: 20px; color: var(--pink-d); }
.close-btn { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--pink-l); color: var(--pink-d); font-weight: 700; font-size: 16px; }
#modal-tabs { display: flex; gap: 6px; padding: 4px 14px 8px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 6px 12px; border-radius: 99px; background: #fff0f5; font-weight: 600; font-size: 13px; white-space: nowrap; border: 2px solid var(--line); }
.tab.on { background: var(--pink); color: #fff; border-color: var(--pink); }
#modal-body { overflow-y: auto; padding: 6px 14px 22px; }
.shop-coins { text-align: right; font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); gap: 10px; }
.card { background: #fff7fa; border: 2px solid #ffe0ea; border-radius: 18px; padding: 10px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.card-ico { font-size: 34px; height: 50px; display: grid; place-items: center; }
.card-ico svg, .card-ico img { width: 52px; height: 52px; object-fit: contain; }
.card-name { font-weight: 700; font-size: 13px; }
.card-desc { font-size: 11px; color: var(--ink-soft); min-height: 28px; }
.card.locked { opacity: .55; }
.card.equipped { border-color: var(--pink); background: #ffe9f1; }
button.card { cursor: pointer; }
.lock, .owned-tag { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.owned-tag { color: #2fae86; }
.have { position: absolute; top: 6px; right: 8px; background: var(--yellow); border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.buy, .btn { background: var(--pink); color: #fff; font-weight: 700; border-radius: 99px; padding: 7px 16px; box-shadow: 0 3px 0 var(--pink-d); font-size: 14px; }
.btn.soft { background: var(--pink-l); color: var(--pink-d); box-shadow: 0 3px 0 var(--line); }
.buy:disabled, .btn:disabled { background: #d9c9cf; box-shadow: 0 3px 0 #bba9b0; cursor: not-allowed; }
.buy:active, .btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--pink-d); }

.list { display: flex; flex-direction: column; gap: 10px; }
.row-card { display: flex; align-items: center; gap: 12px; background: #fff7fa; border: 2px solid #ffe0ea; border-radius: 18px; padding: 12px; text-align: left; width: 100%; }
.row-card:hover:not(:disabled) { border-color: var(--pink); }
.row-card .ri { font-size: 34px; }
.row-card b { display: block; font-size: 15px; }
.row-card small { color: var(--ink-soft); }
.row-card .rr { margin-left: auto; font-size: 12px; font-weight: 700; text-align: right; white-space: nowrap; }
.row-card:disabled { opacity: .5; cursor: not-allowed; }
h4.sec { margin: 14px 2px 8px; color: var(--pink-d); }
.empty { text-align: center; color: var(--ink-soft); padding: 18px 0; }
.center-box { text-align: center; padding: 6px 0 4px; }
.big-emo { font-size: 64px; }
.reward { font-size: 22px; font-weight: 700; }
.name-koala { width: 130px; margin: 0 auto; }
.name-form input, .set-row input { font-size: 18px; padding: 8px 14px; border-radius: 99px; border: 3px solid var(--line); text-align: center; outline: none; width: 200px; margin: 6px 0 12px; color: var(--ink); }
.name-form input:focus, .set-row input:focus { border-color: var(--pink); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 4px; border-bottom: 2px dashed #ffe0ea; flex-wrap: wrap; }
.set-row input { margin: 0; width: 160px; font-size: 15px; }
.tip { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }

/* ---------- game screen ---------- */
#game { position: absolute; inset: 0; z-index: 40; background: #fff7fa; display: flex; flex-direction: column; }
.game-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; }
#game-title { font-weight: 700; font-size: 18px; color: var(--pink-d); }
#game-hud { margin-left: auto; font-weight: 700; background: #fff; border-radius: 99px; padding: 4px 12px; border: 2px solid var(--line); font-size: 14px; }
#game-hud:empty { display: none; }
#game-area { position: relative; flex: 1; margin: 0 12px 12px; border-radius: 24px; overflow: hidden; touch-action: none; border: 4px solid #fff; box-shadow: 0 0 0 2px var(--line); }
.bg-garden { background: linear-gradient(#bfe9ff 0 55%, #b7eb9f 55% 100%); }
.bg-play { background-color: #fff0f6; background-image: radial-gradient(#ffd3e2 4px, transparent 4.5px); background-size: 30px 30px; }
.bg-sky { background: linear-gradient(#a9dcff, #e6f6ff 60%, #ffe6f0); }
.bg-bath { background-color: #e6f7ff; background-image: linear-gradient(#cdeeff 2px, transparent 2px), linear-gradient(90deg, #cdeeff 2px, transparent 2px); background-size: 40px 40px; }
.bg-kitchen { background-color: #fff6d6; background-image: conic-gradient(#ffe9a8 25%, transparent 0 50%, #ffe9a8 0 75%, transparent 0); background-size: 48px 48px; }
.bg-window { background-color: #ffe6ee; background-image: radial-gradient(#ffc3d5 3px, transparent 3.5px); background-size: 28px 28px; }
#game-area canvas.full { position: absolute; inset: 0; }

/* memory */
.mem-grid { position: absolute; inset: 0; margin: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 16px; max-width: 400px; max-height: 470px; align-content: center; }
.mem-card { aspect-ratio: 3 / 4; border-radius: 14px; background: linear-gradient(135deg, #ff9cc0, #ffc2d6); border: 3px solid #fff; font-size: 30px; box-shadow: 0 4px 0 rgba(232, 85, 122, .4); display: grid; place-items: center; }
.mem-card .front { display: none; }
.mem-card.flipped { background: #fff; animation: flip .25s; }
.mem-card.flipped .front { display: block; }
.mem-card.flipped .back { display: none; }
.mem-card.matched { background: #e3fff4; border-color: var(--mint); animation: bump .4s; }

/* bubbles */
.bubble-field { position: absolute; inset: 0; }
.bubble { position: absolute; bottom: -100px; animation: rise var(--dur) linear forwards; }
.bubble .b {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; font-size: 22px;
  background: radial-gradient(circle at 30% 28%, #fff 0 10%, rgba(255, 255, 255, .35) 12%, rgba(190, 228, 255, .35) 60%, rgba(255, 182, 213, .55) 100%);
  border: 2px solid rgba(255, 255, 255, .9); cursor: pointer;
}
.bubble.popped .b { animation: popb .25s forwards; }

/* scrub */
.scrub-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; }
.scrub-tip { background: rgba(255, 255, 255, .85); border-radius: 99px; padding: 4px 14px; font-weight: 700; }
.scrub-target { position: relative; width: min(74%, 320px); }
.scrub-target > svg, .scrub-target > .bath-wrap { position: absolute; inset: 0; width: 100%; height: 100%; }
.scrub-target canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: none; touch-action: none; z-index: 3; }
.scrub-target.clean-flash { animation: bump .5s; }
.scrub-progress { width: 70%; height: 16px; background: rgba(255, 255, 255, .85); border-radius: 99px; overflow: hidden; border: 2px solid #fff; }
.scrub-progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--sky), var(--mint)); transition: width .2s; }
.sponge { position: absolute; left: -100px; top: -100px; font-size: 44px; pointer-events: none; transform: translate(-50%, -50%); z-index: 6; }
.soap { position: absolute; border-radius: 50%; border: 2px solid #fff; background: rgba(255, 255, 255, .5); pointer-events: none; animation: soap .9s forwards; z-index: 5; }
.bath-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tub { position: absolute; left: -10%; right: -10%; bottom: -4%; height: 34%; background: #fff; border: 5px solid #9ed8ff; border-radius: 12px 12px 70px 70px; z-index: 2; }
.tub::before { content: ''; position: absolute; left: -2%; right: -2%; top: -26px; height: 40px;
  background: radial-gradient(circle at 8% 60%, #fff 17px, transparent 18px), radial-gradient(circle at 26% 45%, #fff 22px, transparent 23px), radial-gradient(circle at 46% 60%, #fff 19px, transparent 20px), radial-gradient(circle at 66% 42%, #fff 23px, transparent 24px), radial-gradient(circle at 86% 58%, #fff 18px, transparent 19px); }
.tub::after { content: '🦆'; position: absolute; right: 10%; top: -30px; font-size: 26px; }

/* results */
.results { position: absolute; inset: 0; background: rgba(255, 240, 246, .85); display: grid; place-items: center; z-index: 10; animation: fade .3s; }
.res-card { background: #fff; border-radius: 26px; padding: 18px 22px; text-align: center; width: min(86%, 320px); box-shadow: 0 10px 30px rgba(232, 85, 122, .25); border: 3px solid var(--line); animation: popIn .35s ease-out; }
.res-card h3 { margin: 6px 0; color: var(--pink-d); font-size: 22px; }
.res-card p { margin: 4px 0; }
.res-koala { width: 110px; margin: 0 auto; }
.res-rewards { display: flex; gap: 10px; justify-content: center; font-weight: 700; font-size: 18px; margin: 12px 0; }
.res-rewards span { background: #fff3c4; border-radius: 99px; padding: 4px 12px; }
.res-btns { display: flex; gap: 8px; justify-content: center; }

/* toasts + floating fx */
#toasts { position: absolute; top: 76px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 60; pointer-events: none; }
.toast { background: #fff; border: 3px solid var(--pink); border-radius: 99px; padding: 6px 16px; font-weight: 700; font-size: 14px; box-shadow: 0 6px 16px rgba(232, 85, 122, .25); animation: toast 3.4s forwards; max-width: 90%; text-align: center; }
.float { position: absolute; font-weight: 700; color: #e09a00; pointer-events: none; z-index: 70; animation: floatUp 1.1s ease-out forwards; transform: translate(-50%, -50%); font-size: 18px; text-shadow: 0 2px 0 #fff, 0 -1px 0 #fff; white-space: nowrap; }
.confetti { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 3px; z-index: 65; pointer-events: none; animation: fall var(--d) linear forwards; }

/* ---------- keyframes ---------- */
@keyframes bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-5px) scale(1.01, .99); } }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.025, .975); } }
@keyframes squish { 30% { transform: scale(1.1, .88); } 60% { transform: scale(.94, 1.07); } 100% { transform: scale(1, 1); } }
@keyframes glow { 50% { opacity: .5; transform: scale(1.05); } }
@keyframes pulse { 50% { border-color: #ff6b8b; transform: scale(1.04); } }
@keyframes bump { 50% { transform: scale(1.15); } }
@keyframes wiggle { 0%, 100% { transform: translate(-50%, -50%) rotate(-8deg); } 50% { transform: translate(-50%, -50%) rotate(8deg); } }
@keyframes zz { 0% { opacity: 0; transform: translate(0, 10px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(14px, -26px); } }
@keyframes stink { 0%, 100% { transform: translateY(0); opacity: .9; } 50% { transform: translateY(-8px); opacity: .5; } }
@keyframes drift { to { transform: translateX(30px); } }
@keyframes popIn { from { transform: translateX(-50%) scale(.6); opacity: 0; } }
.res-card { animation-name: popInC; }
@keyframes popInC { from { transform: scale(.7); opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes flip { from { transform: rotateY(90deg); } }
@keyframes rise { to { transform: translateY(calc(var(--h) * -1 - 140px)); } }
@keyframes popb { to { transform: scale(1.7); opacity: 0; } }
@keyframes soap { to { transform: translateY(-40px) scale(1.4); opacity: 0; } }
@keyframes toast { 0% { transform: translateY(-14px); opacity: 0; } 8%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes floatUp { from { opacity: 1; } to { opacity: 0; transform: translate(-50%, -160%); } }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }
