* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #3b2f5c;
  background: var(--theme-bg, linear-gradient(160deg, #ffe3f1, #dff1ff 55%, #e6ffe9));
  user-select: none;
  transition: background .4s, color .4s;
}
body.dark {
  background: linear-gradient(160deg, #14102b, #1c2540);
  color: #e8e2ff;
}

/* The whole screen is one big stage. Toys land anywhere on it. */
#stage { position: fixed; inset: 0; overflow: hidden; transition: rotate .8s; z-index: 1; }
#ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
#stage.flipped { rotate: 180deg; }
#stage.shake { animation: shake .35s; }
@keyframes shake {
  0%,100% { translate: 0 0; }
  20% { translate: -10px 0; }
  40% { translate: 10px 0; }
  60% { translate: -8px 0; }
  80% { translate: 8px 0; }
}
#flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 4; mix-blend-mode: screen; }

/* ---------- middle column ---------- */
.center {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: 470px; text-align: center; z-index: 10; padding-top: 8px;
}
h1 { margin: 0; font-size: 1.2rem; letter-spacing: .5px; }
.score { font-size: 2.6rem; font-weight: 800; line-height: 1.1; }
.sub { opacity: .7; font-size: .9rem; height: 1.2em; }

.bubble {
  width: 190px; height: 190px; margin-top: 8px;
  border: none; border-radius: 50%; cursor: pointer;
  background: var(--skin-bg, radial-gradient(circle at 32% 28%, #fff 0 8%, #ffd0ec 9% 30%, #ff8fcf 70%, #e660b4));
  box-shadow: var(--skin-sh, inset -12px -16px 30px rgba(180,0,120,.25), 0 14px 30px rgba(230,96,180,.4));
  transition: transform .08s;
}
.bubble:hover { transform: scale(1.04); }
.bubble:active, .bubble.squish { transform: scale(.88, .8); }
.hint { opacity: .7; margin: 10px 0 8px; font-size: .85rem; height: 1.2em; }

/* the rectangles you bought */
.owned {
  display: flex; flex-wrap: wrap; gap: 5px; align-content: flex-start; justify-content: center;
  height: 80px; overflow-y: auto; overflow-x: hidden; padding: 6px;
  background: rgba(255,255,255,.55); border-radius: 12px; border: 2px dashed rgba(124,92,255,.35);
}
body.dark .owned, body.dark-theme .owned { background: rgba(255,255,255,.07); }
.owned:empty::before { content: attr(data-empty); opacity: .5; font-size: .85rem; margin: auto; }
.owned-item {
  width: 42px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; cursor: pointer; box-shadow: 0 2px 0 rgba(0,0,0,.2); color: #fff;
}
.owned-item:hover { filter: brightness(1.15); }
.owned-item.new { animation: drop-in .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes drop-in { 0% { transform: translateY(-120px) rotate(200deg) scale(2); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ---------- shop ---------- */
.shop {
  position: absolute; right: 12px; top: 12px; width: 210px; z-index: 10;
  background: rgba(255,255,255,.75); border-radius: 16px; padding: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
}
body.dark .shop, body.dark-theme .shop { background: rgba(255,255,255,.1); }
.shop h2 { margin: 0 0 8px; font-size: 1.1rem; }
.buy {
  display: block; width: 100%; text-align: left; margin-bottom: 8px; padding: 9px 10px;
  border-radius: 12px; border: 2px solid #7c5cff; background: #f3efff; color: #3b2f5c; cursor: pointer;
}
.buy strong { display: block; font-size: .95rem; }
.buy span { display: block; font-size: .78rem; opacity: .75; margin: 1px 0 4px; }
.buy em { font-style: normal; font-weight: 700; font-size: .85rem; color: #7c5cff; }
.buy:hover:not(.cant) { background: #e6dfff; }
.buy.cant { opacity: .5; cursor: not-allowed; }
.small-btn {
  display: block; width: 100%; margin-top: 4px; padding: 6px; border-radius: 10px; cursor: pointer;
  border: 2px solid rgba(124,92,255,.4); background: transparent; color: inherit; font-size: .85rem;
}
.small-btn.faint { border: none; opacity: .5; text-decoration: underline; font-size: .75rem; }

/* ---------- toys (small, and scattered) ---------- */
.toy {
  position: absolute; z-index: 10; width: var(--w, 180px);
  background: rgba(255,255,255,.75); border-radius: 14px; padding: 8px; text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  transform: rotate(var(--rot, 0deg)) scale(var(--sc, 1));
  transition: left .7s cubic-bezier(.3, 1.3, .5, 1), top .7s cubic-bezier(.3, 1.3, .5, 1);
}
body.dark .toy, body.dark-theme .toy { background: rgba(255,255,255,.1); }
.toy.locked { display: none; }
.toy h2 { margin: 0 0 6px; font-size: .9rem; }
.toy.just-unlocked { animation: pop-in .7s; }
@keyframes pop-in { 0% { transform: scale(.2) rotate(180deg); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.small { font-size: .75rem; opacity: .65; margin: 6px 0 0; }

/* bubble wrap */
.wrap { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.wrap button {
  aspect-ratio: 1; border: none; border-radius: 50%; cursor: pointer; padding: 0;
  background: radial-gradient(circle at 32% 28%, #fff 0 10%, #d9f1ff 11% 40%, #8fd0ff 90%);
  box-shadow: inset -2px -3px 6px rgba(0,80,160,.25);
  transition: transform .08s;
}
.wrap button:hover { transform: scale(1.12); }
.wrap button.popped { background: #c9dcea; box-shadow: inset 2px 2px 4px rgba(0,0,0,.25); transform: scale(.7); cursor: default; }

/* spinner */
.spinner { position: relative; width: 100px; height: 100px; border: none; background: none; cursor: pointer; }
.spinner span {
  position: absolute; width: 42px; height: 42px; border-radius: 50%;
  background: #7c5cff; border: 5px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.3);
}
.spinner span:nth-child(1) { top: 0; left: 29px; background: #ff6b9a; }
.spinner span:nth-child(2) { bottom: 3px; left: 2px; background: #35c8a0; }
.spinner span:nth-child(3) { bottom: 3px; right: 2px; background: #ffb43a; }

/* troll button */
.troll {
  font-size: .95rem; font-weight: 700; padding: 10px 14px; border-radius: 10px;
  border: 3px dashed #d63b3b; background: #fff0f0; color: #d63b3b; cursor: pointer;
}
.troll:hover { background: #ffdede; }

/* light switch */
.switch {
  width: 52px; height: 86px; border: 4px solid #aaa; border-radius: 10px;
  background: #f4f4f4; cursor: pointer; position: relative; padding: 0;
}
.switch .knob {
  position: absolute; left: 7px; right: 7px; height: 32px; border-radius: 6px;
  background: #fff; border: 3px solid #999; top: 7px; transition: top .1s;
}
.switch.off .knob { top: 39px; background: #ddd; }

/* slime pit */
#slime { border-radius: 10px; background: #4ade80; cursor: grab; touch-action: none; display: block; margin: 0 auto; }
#slime:active { cursor: grabbing; }

/* xylophone */
.xylo { display: flex; justify-content: center; align-items: flex-start; gap: 4px; height: 100px; }
.xylo button {
  width: 28px; border: none; border-radius: 6px; cursor: pointer; color: #fff; font-weight: 700; font-size: .8rem;
  transition: transform .06s; box-shadow: 0 3px 0 rgba(0,0,0,.2); padding: 0;
}
.xylo button:active { transform: translateY(3px); box-shadow: none; }

/* runaway button */
.arena { position: relative; width: 210px; height: 90px; margin: 0 auto; background: rgba(124,92,255,.1); border-radius: 10px; }
.runner {
  position: absolute; left: 60px; top: 27px; width: 96px; white-space: nowrap; height: 36px; border-radius: 18px; border: none;
  background: linear-gradient(#5ee6a8, #1fb87a); color: #fff; font-weight: 800; cursor: pointer;
  box-shadow: 0 3px 0 #108a5a; transition: left .12s, top .12s;
}
.runner.tired { background: linear-gradient(#bbb, #888); box-shadow: 0 3px 0 #555; }

/* cannon */
.cannon {
  font-size: 1.1rem; font-weight: 800; padding: 12px 20px; border-radius: 12px; border: none;
  background: linear-gradient(#ffb43a, #ff7a3a); color: #fff; cursor: pointer; box-shadow: 0 4px 0 #c75a1e;
}
.cannon:active { transform: translateY(3px); box-shadow: none; }
.cannon:disabled { opacity: .5; cursor: wait; }

/* ---------- effects ---------- */
.particle { position: fixed; width: 10px; height: 10px; border-radius: 50%; pointer-events: none; z-index: 50; }
.float { position: fixed; pointer-events: none; font-weight: 800; font-size: 1.2rem; color: #e660b4; z-index: 60; text-shadow: 0 1px 0 #fff; white-space: nowrap; }
.drifter { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 5; }
.toast {
  position: fixed; top: 14px; left: 50%; transform: translate(-50%, -120px); z-index: 100;
  background: #7c5cff; color: #fff; padding: 10px 20px; border-radius: 30px; font-weight: 700;
  box-shadow: 0 6px 18px rgba(0,0,0,.25); transition: transform .35s; white-space: nowrap;
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- rage mode: the bubble grows and gets angrier ---------- */
.bubble { transform: scale(var(--s, 1)); transition: transform .08s; }
.bubble:hover { transform: scale(calc(var(--s, 1) * 1.04)); }
.bubble:active, .bubble.squish { transform: scale(calc(var(--s, 1) * .88), calc(var(--s, 1) * .8)); }
.bubble.rage-1 {
  background: radial-gradient(circle at 32% 28%, #fff 0 8%, #ffe3b8 9% 30%, #ffa040 70%, #e87a10);
  box-shadow: inset -12px -16px 30px rgba(150,70,0,.3), 0 14px 34px rgba(255,150,40,.6);
}
.bubble.rage-2 {
  background: radial-gradient(circle at 32% 28%, #fff 0 8%, #ffc4b8 9% 30%, #ff5a40 70%, #d62a10);
  box-shadow: inset -12px -16px 30px rgba(130,0,0,.35), 0 14px 40px rgba(255,60,40,.7);
}
.bubble.rage-3 {
  background: radial-gradient(circle at 32% 28%, #ffd0d0 0 8%, #ff6a6a 9% 30%, #d10f0f 70%, #6e0000);
  box-shadow: inset -12px -16px 30px rgba(60,0,0,.5), 0 0 60px rgba(255,0,0,.85);
  animation: rage-shake .12s infinite;
}
@keyframes rage-shake {
  0%, 100% { translate: 0 0; } 25% { translate: -4px 3px; } 50% { translate: 3px -4px; } 75% { translate: -3px -2px; }
}

/* ---------- sand pit ---------- */
#sand { width: 170px; height: 110px; border-radius: 10px; background: #2b2540; display: block; margin: 0 auto; cursor: crosshair; touch-action: none; image-rendering: pixelated; }

/* ---------- click-clack balls ---------- */
.cradle { position: relative; width: 170px; height: 104px; margin: 0 auto; cursor: pointer; }
.cradle::before { content: ''; position: absolute; left: 14px; right: 14px; top: 0; height: 8px; border-radius: 4px; background: #8a7f9e; }
.cradle .string { position: absolute; top: 6px; width: 2px; height: 80px; background: #9a90ad; transform-origin: 50% 0; }
.cradle .ball {
  position: absolute; top: 67px; left: -12px; width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0 8%, #e8e8f4 10%, #8f8fb0 80%);
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}

/* ---------- trophies ---------- */
.modal { position: fixed; inset: 0; background: rgba(20,10,40,.55); display: none; align-items: center; justify-content: center; z-index: 200; }
.modal.open { display: flex; }
.modal-card { background: #fff; color: #3b2f5c; border-radius: 18px; padding: 16px; width: min(600px, 92vw); max-height: 86vh; overflow: auto; }
.modal-card h2 { margin: 0 0 8px; }
.trophy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.trophy { border-radius: 12px; padding: 8px; text-align: center; background: #fff6d6; border: 2px solid #ffb43a; font-size: .8rem; }
.trophy .big { font-size: 1.7rem; }
.trophy strong { display: block; }
.trophy span { opacity: .75; }
.trophy.locked { opacity: .5; filter: grayscale(1); border-style: dashed; background: #f1f1f1; border-color: #aaa; display: block; }
.ach-toast {
  position: fixed; bottom: 16px; left: 50%; transform: translate(-50%, 140px); z-index: 150;
  background: #ffb43a; color: #4a2a00; padding: 10px 22px; border-radius: 30px; font-weight: 800;
  box-shadow: 0 6px 18px rgba(0,0,0,.3); transition: transform .35s; white-space: nowrap;
}
.ach-toast.show { transform: translate(-50%, 0); }

/* ---------- the shop, right under the bubble ---------- */
.shop-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.shop-row .buy { margin: 0; padding: 7px 8px; text-align: center; }
.shop-row .buy strong { font-size: .88rem; }
.shop-row .buy span { font-size: .7rem; margin: 1px 0 3px; }
.shop-row .buy em { font-size: .78rem; }

.tools { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 4px; margin-top: 8px; height: 72px; }
.tools .small-btn { display: inline-block; width: auto; margin: 0; padding: 5px 10px; }
.tools .star-btn { border-color: #ffb43a; background: #fff6d6; color: #5a3a00; }
.tools .star-btn.cant { opacity: .55; }
body.dark .tools .star-btn, body.dark-theme .tools .star-btn { background: rgba(255,180,58,.2); color: #ffe7b0; }
.small-btn.faint { text-decoration: underline; }

/* ---------- newton's cradle you can drag ---------- */
.cradle { cursor: grab; touch-action: none; }
.cradle:active { cursor: grabbing; }
.cradle .string, .cradle .ball { pointer-events: none; }

/* ---------- boss bubble ---------- */
.boss {
  position: absolute; z-index: 90; width: 170px; text-align: center;
  transition: left .5s cubic-bezier(.3, 1.4, .5, 1), top .5s cubic-bezier(.3, 1.4, .5, 1);
}
.hidden { display: none !important; }
.boss-label {
  display: inline-block; background: #d6336c; color: #fff; font-weight: 900; font-size: .8rem;
  padding: 1px 10px; border-radius: 10px; margin-bottom: 3px; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.boss .bar { height: 10px; border-radius: 5px; background: rgba(0,0,0,.3); overflow: hidden; margin: 3px 10px; }
.boss .bar i { display: block; height: 100%; width: 100%; transition: width .1s linear; }
.boss .hp i { background: #ff4d6d; }
.boss .time i { background: #ffd43b; }
.boss-body {
  width: 150px; height: 150px; border-radius: 50%; border: none; cursor: pointer; font-size: 4rem; padding: 0; margin-top: 4px;
  background: radial-gradient(circle at 32% 28%, #fff 0 6%, #b58cff 8% 25%, #5a2ea6 65%, #1d0b3d);
  box-shadow: inset -10px -14px 26px rgba(0,0,0,.45), 0 0 40px rgba(130, 60, 255, .85);
  animation: boss-wobble .45s infinite alternate;
}
.boss-body:active { scale: .9; }
@keyframes boss-wobble { from { rotate: -5deg; } to { rotate: 5deg; } }


/* ---------- bubble skins (each skin just sets two variables) ---------- */
.skin-orange { --skin-bg: radial-gradient(circle at 32% 28%, #fff 0 7%, #ffd89a 8% 28%, #ffa31a 68%, #e07800); --skin-sh: inset -12px -16px 30px rgba(150,70,0,.3), 0 14px 30px rgba(255,160,30,.45); }
.skin-ice { --skin-bg: radial-gradient(circle at 32% 28%, #fff 0 9%, #e6f9ff 10% 35%, #8fdcff 72%, #4aa8e0); --skin-sh: inset -12px -16px 30px rgba(0,90,160,.3), 0 14px 30px rgba(80,190,255,.5); }
.skin-pizza { --skin-bg:
    radial-gradient(circle at 30% 30%, #b3261e 0 8%, transparent 9%), radial-gradient(circle at 68% 36%, #b3261e 0 9%, transparent 10%),
    radial-gradient(circle at 44% 68%, #b3261e 0 8%, transparent 9%), radial-gradient(circle at 76% 72%, #b3261e 0 7%, transparent 8%),
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.7) 0 6%, transparent 14%),
    radial-gradient(circle, #ffd45e 0 78%, #d98c2b 81%);
  --skin-sh: inset -12px -16px 30px rgba(120,60,0,.3), 0 14px 30px rgba(230,160,40,.45); }
.skin-galaxy { --skin-bg:
    radial-gradient(circle at 25% 30%, #fff 0 1.5%, transparent 2.5%), radial-gradient(circle at 62% 20%, #fff 0 1.2%, transparent 2.2%),
    radial-gradient(circle at 76% 58%, #fff 0 1.5%, transparent 2.5%), radial-gradient(circle at 40% 72%, #ffe 0 1.2%, transparent 2.2%),
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.55) 0 5%, transparent 14%),
    radial-gradient(circle at 60% 60%, #ff4fb0 0, transparent 55%), radial-gradient(circle at 30% 30%, #7b4cff 0, transparent 60%), #140c34;
  --skin-sh: inset -12px -16px 30px rgba(0,0,40,.5), 0 0 40px rgba(140,90,255,.8); }
.skin-rainbow { --skin-bg: radial-gradient(circle at 32% 28%, rgba(255,255,255,.9) 0 6%, transparent 18%), conic-gradient(#ff6b6b, #ffd43b, #69db7c, #4dabf7, #b197fc, #ff6b6b);
  --skin-sh: inset -12px -16px 30px rgba(0,0,0,.2), 0 14px 30px rgba(120,120,255,.5); animation: rainbow-spin 4s linear infinite; }
@keyframes rainbow-spin { to { filter: hue-rotate(360deg); } }
.skin-gold { --skin-bg: radial-gradient(circle at 32% 28%, #fff9d6 0 8%, #ffe27a 9% 30%, #f2b01e 68%, #b87800); --skin-sh: inset -12px -16px 30px rgba(110,70,0,.4), 0 14px 34px rgba(255,200,40,.6); }
.skin-preview { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 4px;
  background: var(--skin-bg, radial-gradient(circle at 32% 28%, #fff 0 8%, #ffd0ec 9% 30%, #ff8fcf 70%, #e660b4)); box-shadow: var(--skin-sh, 0 4px 10px rgba(230,96,180,.4)); }
.trophy button { margin-top: 6px; padding: 4px 12px; border-radius: 10px; border: 2px solid #7c5cff; background: #f3efff; color: #3b2f5c; cursor: pointer; font-weight: 700; }
.trophy button:disabled { opacity: .5; cursor: default; }

/* ---------- troll stuff ---------- */
.fake { position: absolute; width: 100px; height: 100px; margin: 0; z-index: 30; }
.ad { position: absolute; z-index: 80; width: 230px; background: #fffbe6; border: 3px solid #ffb43a; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.3); overflow: hidden; }
.ad-bar { background: #ffb43a; color: #4a2a00; font-weight: 800; font-size: .75rem; padding: 4px 8px; height: 26px; text-align: left; }
.ad-bar button { position: absolute; right: 4px; top: 2px; width: 22px; height: 22px; border-radius: 50%; border: none; background: #d63b3b; color: #fff; font-weight: 900; cursor: pointer; line-height: 1; padding: 0; transition: left .12s, top .12s; z-index: 2; }
.ad-body { padding: 14px 10px 16px; font-weight: 700; text-align: center; color: #4a2a00; font-size: .95rem; }
.gift { font-size: 3rem; border: none; background: linear-gradient(#ffe066, #ffa94d); border-radius: 16px; padding: 8px 18px; cursor: pointer; box-shadow: 0 4px 0 #c97a1e; display: block; margin: 0 auto; line-height: 1.1; }
.gift small { display: block; font-size: .75rem; font-weight: 800; color: #7a2e00; }
.gift:active { transform: translateY(3px); box-shadow: none; }

/* ---------- 3D printer ---------- */
#printer { width: 280px; height: 210px; border-radius: 10px; display: block; margin: 0 auto; cursor: pointer; }

body.dark-theme { color: #e8e2ff; }

/* ---------- backgrounds ---------- */
.amb { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; }
.amb-bubble { border-radius: 50%; border: 2px solid rgba(255,255,255,.7); background: rgba(255,255,255,.22); }
.bg-preview { height: 44px; border-radius: 10px; margin-bottom: 4px; background: var(--bgp); border: 2px solid rgba(0,0,0,.15); }

/* ---------- golden bubble + bubble rain ---------- */
.golden { position: absolute; left: 0; top: 0; width: 76px; height: 76px; margin: 0; z-index: 70; border-radius: 50%; animation: gold-pulse .5s infinite alternate; }
@keyframes gold-pulse { from { box-shadow: 0 0 14px 2px rgba(255,210,60,.7); } to { box-shadow: 0 0 34px 10px rgba(255,230,120,.95); } }
.raindrop {
  position: absolute; left: 0; top: 0; width: 46px; height: 46px; border-radius: 50%; border: none; z-index: 60; cursor: pointer; padding: 0;
  background: radial-gradient(circle at 32% 28%, #fff 0 8%, #d9f1ff 9% 40%, #8fd0ff 90%); box-shadow: inset -3px -4px 8px rgba(0,80,160,.25);
}

/* ---------- more toys ---------- */
.cushion { font-size: 3rem; border: none; background: linear-gradient(#ff9ecb, #e75a9b); border-radius: 50% / 42%; padding: 8px 26px; cursor: pointer; box-shadow: 0 4px 0 #a82f66; transition: transform .1s; }
.cushion.squash { transform: scale(1.25, .6); }
.eightball { width: 88px; height: 88px; border-radius: 50%; border: none; cursor: pointer; font-size: 2.4rem; font-weight: 800; color: #fff;
  background: radial-gradient(circle at 32% 28%, #666, #111 45%, #000 75%); box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.eightball.shaking { animation: ball-shake .5s; }
@keyframes ball-shake { 0%,100% { translate: 0 0; } 20% { translate: -8px 4px; } 40% { translate: 8px -4px; } 60% { translate: -6px 2px; } 80% { translate: 6px -2px; } }

/* ---------- pet ---------- */
#pet { position: fixed; left: 0; top: 0; z-index: 45; width: 56px; height: 56px; cursor: pointer; will-change: transform; }
#pet.hidden { display: none; }
.pet-body { font-size: 44px; line-height: 56px; text-align: center; transform-origin: 50% 100%; filter: drop-shadow(0 4px 3px rgba(0,0,0,.25)); }
#pet.moving .pet-body { animation: pet-hop .32s infinite; }
@keyframes pet-hop { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
#pet.sleeping .pet-body { filter: grayscale(.5) drop-shadow(0 4px 3px rgba(0,0,0,.2)); }
.pet-zzz { display: none; position: absolute; right: -4px; top: -16px; font-size: 16px; animation: zzz 1.6s infinite; }
#pet.sleeping .pet-zzz { display: block; }
@keyframes zzz { 0% { translate: 0 0; opacity: 0; } 30% { opacity: 1; } 100% { translate: 8px -14px; opacity: 0; } }
.pet-say {
  position: absolute; bottom: 62px; left: 50%; transform: translateX(-50%); background: #fff; color: #3b2f5c; padding: 4px 10px;
  border-radius: 12px; font-size: .8rem; font-weight: 700; white-space: nowrap; box-shadow: 0 3px 8px rgba(0,0,0,.25);
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.pet-say.show { opacity: 1; }

/* ---------- podcast captions + notifications ---------- */
.caption {
  position: fixed; left: 50%; bottom: 14px; transform: translate(-50%, 300%); opacity: 0; z-index: 120; max-width: min(640px, 92vw);
  background: rgba(20, 14, 40, .86); color: #fff; padding: 9px 18px; border-radius: 14px; font-size: .95rem; line-height: 1.35;
  box-shadow: 0 6px 18px rgba(0,0,0,.35); transition: transform .3s; pointer-events: none; text-align: left;
}
.caption.show { transform: translate(-50%, 0); opacity: 1; }
.caption .onair { display: inline-block; background: #e03131; color: #fff; font-size: .65rem; font-weight: 900; padding: 1px 7px; border-radius: 8px; margin-right: 8px; animation: onair 1.2s infinite; }
@keyframes onair { 50% { opacity: .45; } }
.caption b { color: #ffd43b; }

.notifs { position: fixed; top: 12px; right: 12px; width: 280px; z-index: 110; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.notif {
  display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.96); color: #2b2540; border-radius: 14px; padding: 9px 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.3); cursor: pointer; pointer-events: auto; animation: notif-in .4s cubic-bezier(.3, 1.4, .5, 1); font-size: .85rem;
}
.notif.out { animation: notif-out .4s forwards; }
.notif .n-icon { font-size: 1.8rem; }
.notif small { display: block; opacity: .55; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; font-size: .65rem; }
@keyframes notif-in { from { transform: translateX(120%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes notif-out { to { transform: translateX(120%); opacity: 0; } }

.settings .small-btn { display: inline-block; width: auto; margin: 3px 4px 3px 0; padding: 6px 12px; }
.pet-emoji { font-size: 2rem; height: 44px; line-height: 44px; }

/* ---------- daily challenge ---------- */
.trophy.daily { background: #e6fff1; border-color: #2fbf71; margin-bottom: 10px; font-size: .9rem; padding: 10px; }
.trophy.daily .bar { height: 10px; background: #cfeedd; border-radius: 6px; overflow: hidden; margin: 6px 0 2px; }
.trophy.daily .bar i { display: block; height: 100%; background: #2fbf71; }

/* Pocket Arcade: the Back button, tucked in the bottom-right corner */
#arcadeLink {
  position: fixed;
  right: 10px;
  bottom: 10px;
  z-index: 300;
  padding: 8px 12px;
  background: #2b1d5c;
  border: 2px solid #ffd43b;
  border-radius: 8px;
  color: #ffffff;
  font: bold 14px Arial, sans-serif;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(0,0,0,.3);
}
#arcadeLink:hover { border-color: #ff8fcf; }
