/* v4 treats: sniff trail, hidden treats, group howl, visitor badge. transform/opacity only for motion. */
.treat-trail { position: fixed; z-index: 40; pointer-events: none; top: 0; right: 0; bottom: 0; width: 28px; overflow: hidden; transition: opacity .4s ease; }
.treat-trail.is-hidden { opacity: 0; }
.treat-paw { position: absolute; left: 0; top: 0; width: 14px; height: 14px; opacity: 0; transition: opacity 1.1s ease; filter: drop-shadow(0 0 4px currentColor); }
.treat-paw.is-on { opacity: .5; transition-duration: .25s; }
@media (max-width: 700px), (pointer: coarse) {
  .treat-trail { top: auto; left: 0; right: 0; width: auto; height: 28px; bottom: env(safe-area-inset-bottom, 0px); }
}
html.fx-off .treat-trail { display: none; }

.has-treat { position: relative; }
.treat-wrap { position: absolute; right: 6px; bottom: 4px; width: 44px; height: 44px; z-index: 2; }
.treat { position: relative; width: 44px; height: 44px; padding: 13px; border: 0; border-radius: 50%; background: transparent; color: rgba(255, 241, 223, .42); cursor: pointer; display: grid; place-items: center; transition: color .2s ease, transform .2s ease; }
.treat svg { display: block; width: 18px; height: 18px; }
.treat:hover, .treat:focus-visible { color: var(--orange, #ff9a4d); transform: rotate(-12deg) scale(1.1); }
.treat:focus-visible { outline: 2px solid var(--cyan, #3ee6e0); outline-offset: 2px; }
.treat.is-found { color: rgba(90, 240, 160, .8); cursor: default; transform: none; }
.treat-spark { position: absolute; inset: 0; pointer-events: none; }
.treat-spark i { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--orange, #ff9a4d); animation: treat-spark .7s ease-out forwards; }
@keyframes treat-spark { from { transform: rotate(var(--a)) translateY(0); opacity: 1; } to { transform: rotate(var(--a)) translateY(-26px); opacity: 0; } }

.treats-slot { margin: 12px 0 0; font-size: .85rem; color: var(--text-dim, rgba(255, 241, 223, .74)); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.treats-count { font-weight: 600; letter-spacing: .02em; }
.treats-status:empty { display: none; }

.coco-badge { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 6px 14px 6px 6px; border-radius: 999px; background: rgba(255, 154, 77, .14); border: 1px solid rgba(255, 154, 77, .4); color: var(--cream, #fff1df); font-size: .9rem; opacity: 0; transform: translateY(6px); transition: opacity .8s ease, transform .8s ease; }
.coco-badge.is-in { opacity: 1; transform: none; }
.coco-frame { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(255, 154, 77, .8); flex: none; display: block; }
.coco-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
html.fx-off .coco-badge { transition: none; }

.visitor-badge { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 5px 14px; border-radius: 999px; background: rgba(240, 200, 100, .16); border: 1px solid rgba(240, 200, 100, .55); color: #f6d98a; font-size: .85rem; font-weight: 600; }
.vb-paw { width: 14px; height: 14px; display: inline-block; }

.treat-howl { position: fixed; left: 0; right: 0; bottom: 0; height: 220px; z-index: 9100; pointer-events: none; overflow: hidden; }
.th-cast { position: absolute; left: 0; right: 0; bottom: env(safe-area-inset-bottom, 0px); display: flex; justify-content: center; gap: 12px; padding: 0 12px; }
.th-pup { display: block; animation: th-pop .6s cubic-bezier(.2, 1.4, .4, 1) both, th-bounce .7s ease-in-out .7s 3; animation-delay: calc(var(--i) * .12s), calc(.7s + var(--i) * .12s); }
.th-frame { display: block; width: 72px; height: 72px; border-radius: 50%; overflow: hidden; border: 3px solid var(--orange, #ff9a4d); box-shadow: 0 6px 20px rgba(0, 0, 0, .4); background: #0c2124; }
.th-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes th-pop { from { transform: translateY(130px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes th-bounce { 50% { transform: translateY(-14px); } }
.th-rings { position: absolute; left: 50%; bottom: 40px; width: 0; height: 0; }
.th-ring { position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%; border: 2px solid rgba(62, 230, 224, .6); opacity: 0; animation: th-ring 1.8s ease-out infinite; animation-delay: calc(.5s + var(--r) * .5s); }
@keyframes th-ring { from { transform: scale(.4); opacity: .8; } to { transform: scale(3.6); opacity: 0; } }
.th-conf { position: absolute; left: 50%; bottom: 80px; width: 0; height: 0; }
.th-paw { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; color: var(--orange, #ff9a4d); opacity: 0; animation: th-conf 1.6s ease-out forwards; animation-delay: calc(.4s + var(--d)); }
.th-paw:nth-child(even) { color: var(--cyan, #3ee6e0); }
@keyframes th-conf { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }
html.fx-off .treat-howl { display: none; }

html.theme-day .treat { color: rgba(60, 40, 20, .5); }
html.theme-day .treat:hover, html.theme-day .treat:focus-visible { color: #c2540a; }
html.theme-day .treat.is-found { color: #1d8a54; }
html.theme-day .treat-paw { filter: none; }
html.theme-day .coco-badge { background: rgba(255, 154, 77, .22); border-color: rgba(194, 84, 10, .5); color: #3a2410; }
html.theme-day .visitor-badge { background: rgba(190, 140, 20, .16); border-color: rgba(150, 105, 10, .6); color: #6b4a00; }
html.theme-day .th-frame { background: #fff7ea; }
html.theme-day .th-ring { border-color: rgba(20, 150, 145, .7); }
html.theme-day .treats-slot { color: #5a4630; }
