/* ---------- Feed: scoop the right portion, then watch the token crunch through it ---------- */
#feed { position: fixed; inset: 0; z-index: 50; background: rgba(20, 30, 50, .72); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 12px; }
#feed[hidden] { display: none; }
body.feed-open { overflow: hidden; }
.feed-stage { position: relative; width: min(440px, 100%); background: linear-gradient(180deg, #fff4e6 0%, #ffe9d2 100%); border-radius: 22px; padding: 14px 14px 18px; box-shadow: 0 24px 60px rgba(0,0,0,.35); color: #3a2a1f; }
.feed-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0,0,0,.08); font-size: 16px; cursor: pointer; color: inherit; z-index: 3; }
.feed-title { margin: 4px 36px 6px 4px; font-size: 18px; }
.feed-scene { position: relative; height: 340px; border-radius: 16px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  background: linear-gradient(180deg, #f7e7d3 0%, #f1dcc2 52%, #d9b48c 52.5%, #cfa57c 100%); }
.feed-scene::after { content: ""; position: absolute; left: 0; right: 0; top: 52.5%; bottom: 0; background: repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 1px, transparent 1px 40px), repeating-linear-gradient(0deg, rgba(0,0,0,.05) 0 1px, transparent 1px 40px); pointer-events: none; }
.feed-mat { position: absolute; left: 50%; bottom: 18px; width: 220px; height: 70px; margin-left: -110px; border-radius: 12px; background: #e4572e; opacity: .85; box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.feed-mat::after { content: "🐾"; position: absolute; right: 10px; bottom: 6px; font-size: 16px; opacity: .6; }
.feed-dog { position: absolute; left: 50%; top: 28px; width: 150px; height: 150px; margin-left: -75px; border-radius: 50%; z-index: 2; pointer-events: none; transition: top .9s cubic-bezier(.3,1.3,.5,1), transform .3s;
  background: radial-gradient(circle at 35% 30%, #fff1c2 0%, #f3c64f 45%, #c99324 100%); box-shadow: inset 0 0 0 6px #d9a93a, inset 0 0 0 8px #fff0b5, 0 10px 18px rgba(0,0,0,.25); }
.feed-dog img { width: 100%; height: 100%; object-fit: contain; padding: 10px; display: block; border-radius: 50%; }
.feed-dog.waiting { animation: drool 1.6s ease-in-out infinite; }
@keyframes drool { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
.feed-dog.eating { top: 120px; animation: chomp .36s ease-in-out infinite; pointer-events: auto; cursor: pointer; }
@keyframes chomp { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(10px) rotate(3deg); } }
.feed-dog.full { animation: happy-wag .6s ease-in-out infinite; }
@keyframes happy-wag { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.feed-dog .bubble { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -4px); white-space: nowrap; font: 600 11px/1 system-ui, sans-serif; background: #fff; color: #333; padding: 4px 8px; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.2); opacity: 0; transition: opacity .2s; }
.feed-dog .bubble.show { opacity: 1; }
.bowl { position: absolute; left: 50%; bottom: 34px; width: 150px; height: 64px; margin-left: -75px; z-index: 3; }
.bowl-back { position: absolute; left: 0; right: 0; top: 0; height: 30px; border-radius: 50%; background: #9bb7d4; }
.bowl-fill { position: absolute; left: 14px; right: 14px; top: 8px; height: 14px; border-radius: 50%; overflow: hidden; background: #6f8fb0; }
.bowl-fill i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: radial-gradient(circle at 20% 30%, #a0693a 2px, transparent 3px) 0 0/8px 8px, radial-gradient(circle at 70% 70%, #8f5a2d 2px, transparent 3px) 3px 3px/8px 8px, #b57b47; transition: height .15s; }
.bowl-heap { position: absolute; left: 50%; top: 12px; width: 100px; height: 26px; margin-left: -50px; border-radius: 50% 50% 40% 40%; background: radial-gradient(circle at 20% 30%, #a0693a 2px, transparent 3px) 0 0/8px 8px, radial-gradient(circle at 70% 70%, #8f5a2d 2px, transparent 3px) 3px 3px/8px 8px, #b57b47; transform: scaleY(0); transform-origin: 50% 100%; transition: transform .2s; }
.bowl-front { position: absolute; left: 0; right: 0; top: 16px; bottom: 0; border-radius: 0 0 70px 70px / 0 0 40px 40px; background: linear-gradient(180deg, #7aa0c8, #5f86b0 60%, #4a6d94); box-shadow: 0 8px 12px rgba(0,0,0,.2), inset 0 6px 8px rgba(255,255,255,.35); }
.bowl-front::after { content: ""; position: absolute; left: 50%; bottom: 10px; width: 50px; height: 14px; margin-left: -25px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); }
.bowl-name { position: absolute; left: 50%; top: 32px; transform: translateX(-50%); font: 800 11px/1 system-ui, sans-serif; color: #fff; letter-spacing: .5px; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.bag { position: absolute; left: 14px; bottom: 30px; width: 86px; height: 120px; border-radius: 10px 10px 6px 6px; z-index: 4; cursor: grab; touch-action: none;
  background: linear-gradient(180deg, #f2b84b, #e49c2a); box-shadow: 0 8px 14px rgba(0,0,0,.2), inset 0 -8px 0 rgba(0,0,0,.08); }
.bag::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 18px; border-radius: 8px 8px 0 0; background: #d98d1f; }
.bag::after { content: "🐶 KIBBLE"; position: absolute; left: 6px; right: 6px; top: 36px; padding: 8px 0; border-radius: 8px; background: #fff; color: #b85c1a; font: 800 10px/1.2 system-ui, sans-serif; text-align: center; }
.bag.cat::after { content: "🐱 KIBBLE"; }
.bag.active { cursor: grabbing; }
.scoop { position: absolute; width: 56px; height: 40px; margin: -20px 0 0 -28px; z-index: 6; pointer-events: none; opacity: 0; transition: opacity .15s; }
.feed-scene.scooping .scoop { opacity: 1; }
.scoop .cup { position: absolute; left: 0; bottom: 0; width: 36px; height: 26px; border-radius: 4px 4px 14px 14px; background: linear-gradient(180deg, #e6eef7, #b9c7d9); box-shadow: inset 0 -4px 0 rgba(0,0,0,.1); }
.scoop .cup::after { content: ""; position: absolute; left: 3px; right: 3px; top: 3px; height: 10px; border-radius: 4px; background: radial-gradient(circle at 20% 30%, #a0693a 2px, transparent 3px) 0 0/8px 8px, #b57b47; transition: opacity .2s; }
.scoop.empty .cup::after { opacity: 0; }
.scoop .handle { position: absolute; left: 32px; top: 6px; width: 26px; height: 10px; border-radius: 6px; background: #2a9d8f; transform: rotate(-20deg); transform-origin: 0 50%; }
.scoop.pouring { transform: rotate(-35deg); }
.kib { position: absolute; width: 7px; height: 7px; margin: -3px 0 0 -3px; border-radius: 40%; background: #a0693a; z-index: 5; animation: kib-fall .5s ease-in forwards; pointer-events: none; }
@keyframes kib-fall { to { transform: translate(var(--dx, 0), var(--dy, 80px)) rotate(120deg); opacity: .9; } }
.gauge { position: absolute; right: 14px; top: 28px; width: 22px; height: 200px; border-radius: 11px; background: rgba(255,255,255,.75); box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); z-index: 4; }
.gauge .zone { position: absolute; left: 3px; right: 3px; border-radius: 6px; background: rgba(42,157,143,.35); border: 2px dashed #2a9d8f; }
.gauge .level { position: absolute; left: 5px; right: 5px; bottom: 5px; height: 0; border-radius: 6px; background: linear-gradient(180deg, #d9a05c, #b57b47); transition: height .15s; }
.gauge.over .level { background: linear-gradient(180deg, #ff8a65, #e4572e); }
.gauge .tag { position: absolute; right: 28px; white-space: nowrap; font: 700 10px/1 system-ui, sans-serif; color: #2a9d8f; background: rgba(255,255,255,.9); padding: 3px 6px; border-radius: 999px; transform: translateY(-50%); }
.serve { position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%); padding: 9px 18px; border: 0; border-radius: 999px; background: #2a9d8f; color: #fff; font: inherit; font-weight: 700; cursor: pointer; z-index: 7; display: none; box-shadow: 0 6px 14px rgba(0,0,0,.2); animation: serve-pop .4s cubic-bezier(.2,1.4,.4,1); }
.feed-scene.ready .serve { display: block; }
@keyframes serve-pop { from { transform: translateX(-50%) scale(.6); } }
.crumb { position: absolute; font: 800 13px/1 system-ui, sans-serif; color: #7a4a1e; animation: crumb 1s ease-out forwards; pointer-events: none; z-index: 8; }
@keyframes crumb { 0% { transform: translateY(0) scale(.8); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(var(--dx, 0), -60px) scale(1.2); opacity: 0; } }
.heart { position: absolute; font-size: 18px; animation: heart 1.1s ease-out forwards; pointer-events: none; z-index: 9; }
@keyframes heart { 0% { transform: scale(.4); opacity: 0; } 25% { opacity: 1; } 100% { transform: translate(var(--dx, 0), -70px) scale(1.2); opacity: 0; } }
.feed-hud { display: flex; justify-content: space-between; gap: 8px; margin: 10px 4px 0; font-size: 14px; }
.feed-hud strong { color: #2a9d8f; }
.feed-meter { height: 12px; margin: 8px 4px 6px; background: rgba(0,0,0,.08); border-radius: 6px; overflow: hidden; }
.feed-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f2b84b, #2a9d8f); transition: width .2s; }
.feed-msg { margin: 0 4px; font-size: 14px; min-height: 1.4em; }
.feed-done { display: none; margin: 10px auto 0; padding: 9px 18px; border: 0; border-radius: 999px; background: #e4572e; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.feed-stage.finished .feed-done { display: block; }
.feed-sparkle { position: absolute; z-index: 8; font-size: 22px; animation: feed-sparkle 1.4s ease-out forwards; pointer-events: none; }
@keyframes feed-sparkle { 0% { transform: scale(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1.4) translateY(-30px); opacity: 0; } }
.feed-btn { margin-top: 8px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line, #d9d4ca); background: var(--card, #fff); color: var(--ink, #1f1d1a); font: inherit; cursor: pointer; }
.feed-btn:hover { border-color: #f2b84b; }
.pill.fed { background: #fff0cf; color: #8a5a12; }
.pill.fed[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .feed-dog.waiting, .feed-dog.eating, .feed-dog.full { animation: none; } }
