/* =============================================
   FEED THE FROG — style.css (v2)
   ============================================= */

*, *::before, *::after {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
img { pointer-events: none; }

:root {
  --green:       #2e7d32;
  --green-mid:   #43a047;
  --green-light: #66bb6a;
  --green-pale:  #c8e6c9;
  --gold:        #ffd54f;
  --gold-dark:   #f9a825;
  --white:       #ffffff;
  --bg:          #e8f5e9;
  --font-d:      'Fredoka One', cursive;
  --font-b:      'Nunito', sans-serif;

  --pond-day:    radial-gradient(ellipse, #4fc3f7, #0277bd);
  --pond-night:  radial-gradient(ellipse, #1a237e, #0d0d2b);
  --ground-day:  linear-gradient(180deg, #66bb6a 0%, #388e3c 100%);
  --ground-night:linear-gradient(180deg, #2e5436 0%, #1b3a20 100%);
}

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--font-b);
  background: var(--bg);
}

/* ===== NIGHT MODE ===== */
body.night #pond     { background: var(--pond-night); }
body.night #ground   { background: var(--ground-night); }
body.night #lily-pad { background: radial-gradient(ellipse at 50% 40%, #2e5436, #1b3a20); }
body.night .cloud    { opacity: 0.15; }
body.night #stars-wrap .star { opacity: 1; }
body.night #sun-moon { background: radial-gradient(circle, #e8eaf6 60%, transparent); box-shadow: 0 0 30px #9fa8da, 0 0 60px #3949ab44; width: 44px; height: 44px; top: 6%; left: 72%; }
body.night #hud .hud-pill { background: rgba(20,30,20,0.7); border-color: rgba(100,180,100,0.3); }
body.night .hud-val { color: #a5d6a7; }
body.night .hud-label { color: #66bb6a99; }
body.night #shop-toggle-btn { background: linear-gradient(135deg, #1b5e20, #0a3d0a); }
body.night #daynight-btn { background: rgba(255,213,79,0.2); color: #ffd54f; }

/* ===== SCENE ===== */
#scene {
  width: 100vw; height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

/* ===== BG CANVAS ===== */
#bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

/* ===== STARS ===== */
#stars-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0;
  animation: twinkle var(--dur, 3s) ease-in-out infinite var(--delay, 0s);
}
body.night .star { opacity: 1; }
@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.4); }
}

/* ===== SUN / MOON ===== */
#sun-moon {
  position: absolute;
  width: 52px; height: 52px;
  border-radius: 50%;
  top: 5%; left: 68%;
  background: radial-gradient(circle, #fff176 50%, #ffd54f 80%, transparent);
  box-shadow: 0 0 30px #ffd54f99, 0 0 60px #ffd54f44;
  z-index: 2;
  animation: sunPulse 4s ease-in-out infinite;
  transition: all 0.8s ease;
}
@keyframes sunPulse {
  0%, 100% { box-shadow: 0 0 30px #ffd54f99, 0 0 60px #ffd54f44; }
  50%       { box-shadow: 0 0 40px #ffd54fcc, 0 0 80px #ffd54f66; }
}

/* ===== CLOUDS ===== */
.cloud {
  position: absolute;
  background: rgba(255,255,255,0.85);
  border-radius: 50px;
  z-index: 3;
  transition: opacity 0.8s;
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
}

.cloud-1 { width: 80px;  height: 28px; top: 8%;  left: -100px; animation: cloudDrift 28s linear infinite; }
.cloud-1::before { width: 45px; height: 45px; top: -22px; left: 12px; }
.cloud-1::after  { width: 30px; height: 30px; top: -14px; left: 40px; }

.cloud-2 { width: 110px; height: 34px; top: 15%; left: -150px; animation: cloudDrift 38s linear infinite 12s; }
.cloud-2::before { width: 60px; height: 60px; top: -28px; left: 16px; }
.cloud-2::after  { width: 40px; height: 40px; top: -18px; left: 60px; }

.cloud-3 { width: 65px;  height: 22px; top: 5%;  left: -90px;  animation: cloudDrift 22s linear infinite 5s; opacity: 0.7; }
.cloud-3::before { width: 36px; height: 36px; top: -18px; left: 10px; }
.cloud-3::after  { width: 24px; height: 24px; top: -12px; left: 34px; }

.cloud-4 { width: 90px;  height: 30px; top: 20%; left: -130px; animation: cloudDrift 44s linear infinite 20s; opacity: 0.5; }
.cloud-4::before { width: 50px; height: 50px; top: -24px; left: 18px; }
.cloud-4::after  { width: 32px; height: 32px; top: -15px; left: 52px; }

@keyframes cloudDrift {
  from { left: -160px; }
  to   { left: 110vw; }
}

/* ===== GROUND ===== */
#ground {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 38%;
  background: var(--ground-day);
  z-index: 4;
  border-radius: 60% 60% 0 0 / 20% 20% 0 0;
  transition: background 0.8s;
  overflow: hidden;
}

/* Grass blades */
.grass-blade {
  position: absolute;
  bottom: 100%;
  left: var(--x);
  width: 6px;
  height: var(--h);
  background: linear-gradient(180deg, #81c784, #388e3c);
  border-radius: 3px 3px 0 0;
  transform-origin: bottom center;
  animation: grassSway 2s ease-in-out infinite var(--d);
}
@keyframes grassSway {
  0%, 100% { transform: rotate(-4deg); }
  50%       { transform: rotate(4deg);  }
}

/* ===== POND ===== */
#pond {
  position: absolute;
  bottom: 24%;
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, 80vw);
  height: min(90px, 20vw);
  background: var(--pond-day);
  border-radius: 50%;
  z-index: 5;
  overflow: hidden;
  transition: background 0.8s;
  box-shadow: 0 4px 20px rgba(2,119,189,0.4);
}
#pond-shine {
  position: absolute;
  top: 15%; left: 20%;
  width: 30%; height: 20%;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  filter: blur(4px);
  transform: rotate(-20deg);
}
.pond-ripple {
  position: absolute;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  width: 30px; height: 14px;
  top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  animation: ripple 2.5s ease-out infinite;
}
.pond-ripple:nth-child(2) { animation-delay: 0.9s; }
.pond-ripple:nth-child(3) { animation-delay: 1.8s; }
@keyframes ripple {
  0%   { width: 20px;  height: 10px; opacity: 0.7; }
  100% { width: 180px; height: 70px; opacity: 0; }
}

/* ===== LILY PAD ===== */
#lily-pad {
  position: absolute;
  bottom: 33%;
  left: 50%;
  transform: translateX(-50%);
  width: min(180px, 42vw);
  height: min(80px, 18vw);
  background: radial-gradient(ellipse at 50% 40%, #81c784, #2e7d32);
  border-radius: 50%;
  z-index: 6;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  animation: lilyBob 4s ease-in-out infinite;
  transition: background 0.8s;
}
@keyframes lilyBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(-3px); }
}
#lily-pad::after {
  content: '';
  position: absolute;
  width: 55%; height: 55%;
  border: 3px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  top: 12%; left: 22%;
}
.lily-flower {
  position: absolute;
  top: -10px; right: 20px;
  font-size: 18px;
  animation: flowerSway 3s ease-in-out infinite;
}
.lily-flower::before { content: '🌸'; }
@keyframes flowerSway {
  0%, 100% { transform: rotate(-5deg); }
  50%       { transform: rotate(5deg);  }
}

/* ===== FROG ===== */
#frog-wrap {
  position: absolute;
  bottom: calc(33% + min(60px, 13vw));
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  animation: frogIdle 3s ease-in-out infinite;
}
@keyframes frogIdle {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(-6px); }
}

#frog-aura {
  position: absolute;
  width: 140px; height: 70px;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -40%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s, background 0.8s;
  animation: auraPulse 2s ease-in-out infinite;
}
@keyframes auraPulse {
  0%, 100% { transform: translate(-50%, -40%) scale(1); }
  50%       { transform: translate(-50%, -40%) scale(1.12); }
}

#frog-body {
  font-size: clamp(52px, 13vw, 88px);
  line-height: 1;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.3));
  transition: transform 0.15s;
  position: relative;
  z-index: 1;
}
#frog-shadow {
  width: 60px; height: 12px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.2) 0%, transparent 70%);
  border-radius: 50%;
  margin-top: -4px;
}

#frog-body.eating {
  animation: eatAnim 0.5s ease-in-out;
}
@keyframes eatAnim {
  0%   { transform: scale(1)    rotate(0deg); }
  25%  { transform: scale(1.3)  rotate(-10deg); }
  60%  { transform: scale(0.88) rotate(5deg);  }
  100% { transform: scale(1)    rotate(0deg);   }
}
#frog-body.pooping {
  animation: poopAnim 0.6s ease-in-out;
}
@keyframes poopAnim {
  0%   { transform: scale(1)   translateY(0);  }
  30%  { transform: scale(1.1) translateY(-8px); }
  60%  { transform: scale(0.88) translateY(4px); }
  100% { transform: scale(1)   translateY(0);  }
}
#frog-body.tap-bounce {
  animation: tapBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes tapBounce {
  0%   { transform: scale(1);   }
  40%  { transform: scale(0.82) rotate(-5deg); }
  70%  { transform: scale(1.18) rotate(3deg);  }
  100% { transform: scale(1);   }
}

/* Tap hint ring */
#frog-wrap::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2.5px dashed rgba(102,187,106,0.4);
  animation: tapHint 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes tapHint {
  0%, 100% { opacity: 0.3; transform: scale(0.95); }
  50%       { opacity: 0.7; transform: scale(1.05); }
}

/* ===== BARS ===== */
#hunger-wrap {
  position: absolute;
  bottom: calc(33% + min(180px, 34vw));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
#xp-wrap {
  position: absolute;
  bottom: calc(33% + min(215px, 39vw));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
#hunger-label, #xp-label {
  font-family: var(--font-d);
  font-size: clamp(10px, 2.2vw, 13px);
  color: var(--green);
  text-shadow: 0 1px 2px rgba(255,255,255,0.7);
}
#hunger-bar-bg, #xp-bar-bg {
  width: min(120px, 28vw);
  height: 10px;
  background: rgba(0,0,0,0.12);
  border-radius: 20px;
  overflow: hidden;
  border: 1.5px solid rgba(255,255,255,0.5);
  position: relative;
}
#hunger-bar-shine {
  position: absolute;
  top: 0; left: 0;
  height: 40%;
  width: 100%;
  background: rgba(255,255,255,0.25);
  border-radius: 20px;
  pointer-events: none;
}
#hunger-bar, #xp-bar {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, #66bb6a, #00e676);
  transition: width 0.5s ease, background 0.5s;
}
#xp-bar {
  background: linear-gradient(90deg, #ffd54f, #ff8f00) !important;
}

/* ===== SPEECH BUBBLE ===== */
#speech {
  position: absolute;
  bottom: calc(33% + min(108px, 24vw));
  left: calc(50% + min(40px, 8vw));
  z-index: 10;
  background: white;
  border: 2.5px solid var(--green);
  border-radius: 16px;
  padding: 6px 12px;
  font-family: var(--font-b);
  font-size: clamp(11px, 2.5vw, 14px);
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
#speech::before {
  content: '';
  position: absolute;
  bottom: 6px; left: -12px;
  border: 6px solid transparent;
  border-right-color: var(--green);
}
#speech::after {
  content: '';
  position: absolute;
  bottom: 8px; left: -8px;
  border: 5px solid transparent;
  border-right-color: white;
}
#speech.visible { opacity: 1; transform: scale(1); }

/* ===== FLOAT TEXT VFX ===== */
.float-text {
  position: fixed;
  font-family: var(--font-d);
  font-size: clamp(14px, 3.5vw, 18px);
  color: #ffd54f;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
  z-index: 50;
  pointer-events: none;
  animation: floatUp 0.9s ease-out forwards;
  transform: translateX(-50%);
}
@keyframes floatUp {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0)    scale(1.2); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-60px) scale(0.8); }
}

/* ===== POOP COIN VFX ===== */
.poop-coin {
  position: fixed;
  font-size: clamp(18px, 5vw, 28px);
  z-index: 11;
  animation: coinDrop 1.1s cubic-bezier(0.22,1,0.36,1) forwards;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}
@keyframes coinDrop {
  0%   { opacity: 0; transform: translateY(-30px) scale(0.5) rotate(-20deg); }
  25%  { opacity: 1; transform: translateY(0px)   scale(1.2) rotate(10deg);  }
  60%  {             transform: translateY(18px)  scale(1)   rotate(-5deg);  }
  80%  {             transform: translateY(10px)  scale(1.05); }
  100% { opacity: 0; transform: translateY(24px)  scale(0.7); }
}

/* ===== FOOD FLY VFX ===== */
.food-fly {
  position: fixed;
  font-size: clamp(18px, 5vw, 26px);
  z-index: 12;
  pointer-events: none;
  animation: foodFly 0.7s cubic-bezier(0.22,1,0.36,1) forwards;
}
@keyframes foodFly {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--fx), var(--fy)) scale(0.3); }
}

/* ===== HUD ===== */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: clamp(8px, 2vw, 16px) clamp(10px, 3vw, 20px);
  pointer-events: none;
}
.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}
.hud-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,0.7);
  border-radius: 30px;
  padding: 6px 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  transition: background 0.3s, border-color 0.3s, transform 0.15s;
}
.hud-pill.pill-pop {
  animation: pillPop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes pillPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.hud-icon  { font-size: clamp(14px, 3.5vw, 18px); }
.hud-val   { font-family: var(--font-d); font-size: clamp(14px, 3.5vw, 18px); color: var(--green); transition: color 0.3s; }
.hud-label { font-size: clamp(9px, 2vw, 11px); font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }

#mood-display {
  font-size: clamp(22px, 5vw, 28px);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
  animation: moodBounce 2s ease-in-out infinite;
}
@keyframes moodBounce {
  0%, 100% { transform: scale(1);   }
  50%       { transform: scale(1.1); }
}

#streak-badge {
  background: linear-gradient(135deg, #ff6f00, #ff8f00);
  color: white;
  font-family: var(--font-d);
  font-size: clamp(10px, 2.5vw, 13px);
  padding: 2px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(255,111,0,0.5);
}
#streak-badge.hidden { display: none; }

/* ===== DAY/NIGHT BUTTON ===== */
#daynight-btn {
  position: absolute;
  top: clamp(8px, 2vw, 14px);
  right: clamp(10px, 3vw, 20px);
  margin-top: 46px;
  z-index: 21;
  background: rgba(255,255,255,0.25);
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
  backdrop-filter: blur(6px);
}
#daynight-btn:active { transform: scale(0.88); }

/* ===== HOME BUTTON ===== */
#home-btn {
  position: absolute;
  top: clamp(8px, 2vw, 14px);
  right: clamp(10px, 3vw, 20px);
  margin-top: 90px;
  z-index: 21;
  background: rgba(255,255,255,0.25);
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
  backdrop-filter: blur(6px);
}
#home-btn:active { transform: scale(0.88); }
body.night #home-btn { background: rgba(255,213,79,0.2); color: #ffd54f; }

/* ===== SHOP BUTTON ===== */
#shop-toggle-btn {
  position: absolute;
  bottom: clamp(60px, 10vw, 80px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  background: linear-gradient(135deg, #43a047, #2e7d32);
  color: white;
  border: none;
  border-radius: 50px;
  padding: clamp(10px, 2.5vw, 14px) clamp(20px, 5vw, 32px);
  font-family: var(--font-d);
  font-size: clamp(14px, 3.5vw, 18px);
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(46,125,50,0.45), 0 2px 0 #1b5e20;
  transition: transform 0.2s, box-shadow 0.2s;
}
#shop-toggle-btn:active { transform: translateX(-50%) scale(0.94); }

/* ===== SHOP OVERLAY ===== */
#shop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#shop-overlay.open { opacity: 1; pointer-events: auto; }

/* ===== SHOP PANEL ===== */
#shop-panel {
  position: fixed;
  bottom: -100%;
  left: 0; right: 0;
  z-index: 31;
  background: linear-gradient(180deg, #1a4a1e 0%, #2e7d32 50%, #1b5e20 100%);
  border-radius: 28px 28px 0 0;
  padding: 0 0 32px;
  transition: bottom 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.4);
}
#shop-panel.open { bottom: 0; }

#shop-handle {
  width: 44px; height: 5px;
  background: rgba(255,255,255,0.3);
  border-radius: 10px;
  margin: 14px auto 12px;
  flex-shrink: 0;
}
#shop-header { flex-shrink: 0; }
#shop-title {
  font-family: var(--font-d);
  font-size: clamp(20px, 5vw, 26px);
  color: white;
  text-align: center;
  margin: 0 0 2px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
#shop-subtitle {
  font-size: clamp(11px, 2.5vw, 13px);
  color: rgba(255,255,255,0.55);
  text-align: center;
  margin: 0 0 10px;
}

/* ===== SHOP TABS ===== */
#shop-tabs {
  display: flex;
  gap: 6px;
  padding: 0 16px 10px;
  flex-shrink: 0;
}
.shop-tab {
  flex: 1;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  color: rgba(255,255,255,0.65);
  font-family: var(--font-d);
  font-size: clamp(12px, 3vw, 14px);
  padding: 7px 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.shop-tab.active {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.4);
  color: white;
}

/* ===== TAB PANELS ===== */
.tab-panel { display: none; overflow-y: auto; flex: 1; }
.tab-panel.active { display: block; }

/* ===== FOOD GRID ===== */
#food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(120px, 36vw), 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.food-card {
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 16px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.2s, transform 0.18s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}
.food-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: rgba(255,255,255,0.06);
  border-radius: 16px 16px 0 0;
  pointer-events: none;
}

.food-card:active { transform: scale(0.9); }
.food-card.cant-afford { opacity: 0.45; cursor: not-allowed; }
.food-card.cant-afford:active { transform: none; }
.food-card.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  60%       { transform: translateX(6px); }
}

.rarity-badge {
  position: absolute;
  top: 6px; right: 6px;
  font-size: 10px;
  line-height: 1;
}
.food-emoji { font-size: clamp(26px, 7vw, 34px); line-height: 1; }
.food-name  { font-family: var(--font-d); font-size: clamp(12px, 3vw, 14px); color: white; text-align: center; }
.food-stats { display: flex; gap: 8px; align-items: center; }
.food-cost  { font-size: clamp(10px, 2.5vw, 12px); font-weight: 700; color: var(--gold); }
.food-xp    { font-size: clamp(9px, 2vw, 11px); color: rgba(255,255,255,0.55); }
.food-hunger{ font-size: clamp(9px, 2vw, 11px); color: rgba(255,255,255,0.5); text-align: center; }

/* ===== STATS PANEL ===== */
#stats-panel { padding: 12px 16px 24px; }

.stat-card {
  background: rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.15);
}
.stat-frog  { font-size: 40px; margin-bottom: 6px; }
.stat-name  { font-family: var(--font-d); font-size: 18px; color: white; }
.stat-level { font-size: 13px; color: var(--gold); font-weight: 700; margin-top: 2px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.stat-item {
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.1);
}
.stat-icon { font-size: 18px; display: block; margin-bottom: 4px; }
.stat-val  { font-family: var(--font-d); font-size: 16px; color: white; }
.stat-lbl  { font-size: 9px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.5px; }

.stat-fav {
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.stat-fav-label { font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-fav-val   { font-family: var(--font-d); font-size: 13px; color: white; }

.stat-next {
  text-align: center;
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
  padding: 6px 0 10px;
}

.stat-reset-btn {
  width: 100%;
  background: rgba(239,83,80,0.2);
  border: 1.5px solid rgba(239,83,80,0.4);
  border-radius: 12px;
  color: #ef9a9a;
  font-family: var(--font-d);
  font-size: 14px;
  padding: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.stat-reset-btn:active { background: rgba(239,83,80,0.35); }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0,0,0,0.78);
  color: white;
  font-family: var(--font-d);
  font-size: clamp(14px, 3.5vw, 18px);
  padding: 10px 24px;
  border-radius: 30px;
  z-index: 99;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== MILESTONE BANNER ===== */
#milestone {
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: linear-gradient(135deg, #ffd54f, #f9a825);
  color: #3e2723;
  font-family: var(--font-d);
  font-size: clamp(14px, 4vw, 20px);
  padding: 12px 28px;
  border-radius: 30px;
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(249,168,37,0.5);
  transition: opacity 0.35s, transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  text-align: center;
  white-space: nowrap;
}
#milestone.show { opacity: 1; transform: translateX(-50%) scale(1); }

/* ===== LEVEL-UP OVERLAY ===== */
#levelup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
#levelup-overlay.show { opacity: 1; pointer-events: auto; }

#levelup-card {
  background: linear-gradient(135deg, #1b5e20, #2e7d32);
  border: 2px solid rgba(255,213,79,0.6);
  border-radius: 28px;
  padding: 36px 40px;
  text-align: center;
  box-shadow: 0 0 60px rgba(255,213,79,0.3), 0 20px 60px rgba(0,0,0,0.5);
  animation: cardBounceIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
  max-width: min(340px, 90vw);
}
@keyframes cardBounceIn {
  from { transform: scale(0.6) rotate(-5deg); }
  to   { transform: scale(1)   rotate(0deg);  }
}
#levelup-frog  { font-size: 64px; margin-bottom: 12px; animation: levelFrogSpin 0.6s ease-out; }
@keyframes levelFrogSpin {
  from { transform: scale(0) rotate(-180deg); }
  to   { transform: scale(1) rotate(0deg);   }
}
#levelup-title {
  font-family: var(--font-d);
  font-size: 32px;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255,213,79,0.7);
  margin-bottom: 8px;
  letter-spacing: 2px;
}
#levelup-sub {
  color: rgba(255,255,255,0.8);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 24px;
}
#levelup-ok {
  background: linear-gradient(135deg, #ffd54f, #f9a825);
  color: #3e2723;
  border: none;
  border-radius: 50px;
  padding: 12px 32px;
  font-family: var(--font-d);
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(249,168,37,0.5);
  transition: transform 0.2s;
}
#levelup-ok:active { transform: scale(0.94); }