:root {
  --dark: #03080A;
  --yellow: #FFD93D;
  --orange: #FF6B2B;
  --red: #FF4444;
  --green: #2A7A45;
  --greenLight: #AAFF60;
  --white: #F0FFF4;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--dark); font-family: 'Nunito', sans-serif; cursor: none; }

/* ── CURSOR ── */
#cur {
  width: 26px; height: 26px; border-radius: 50%;
  background: #E8F5A0;
  position: fixed; pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
  transition: transform .08s, background .15s;
}
#cur.click { transform: translate(-50%, -50%) scale(2); background: var(--orange); }

/* ── CANVAS ── */
#bgCanvas { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; }

/* ── SCENE ── */
#scene {
  position: fixed; inset: 0; z-index: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  pointer-events: none;
}
#ground {
  width: 100%; height: 22%;
  background: linear-gradient(180deg, #071A0A 0%, #040E06 100%);
  flex-shrink: 0;
}
#bushes-area {
  width: 100%; height: 78%;
  position: relative;
  display: flex; align-items: flex-end; justify-content: center;
}

/* ── BUSH ── */
.bush {
  position: absolute; bottom: 0;
  pointer-events: none;
  transform-origin: bottom center;
}
.bush svg { display: block; }

/* ── WOLF WRAP ── */
#wolf-wrap {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: auto;
  transition: bottom .3s cubic-bezier(.34, 1.4, .64, 1);
}
#wolf-wrap img {
  width: 180px; height: auto;
  display: block;
  filter: drop-shadow(0 0 24px rgba(200, 240, 100, .35));
  transition: opacity .2s;
}
#wolf-wrap.hidden { bottom: -300px !important; }

/* click ring around wolf */
#wolf-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 3px solid rgba(255, 220, 50, .7);
  animation: ringPulse 1s ease-in-out infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}
#wolf-ring.show { opacity: 1; }

@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: .6; }
  50%       { transform: scale(1.14); opacity: 1; }
}

/* ── UI LAYER ── */
#ui {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  align-items: center;
  pointer-events: none;
}

/* top global bar */
#topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px 0; width: 100%;
}
#global-wrap {
  flex: 1;
  background: rgba(0,0,0,.5);
  border-radius: 20px; height: 9px;
  overflow: hidden;
  border: 1px solid rgba(200,240,100,.15);
}
#global-bar {
  height: 100%; border-radius: 20px;
  background: linear-gradient(90deg, #2A7A34, #AAFF60);
  transition: width .1s linear, background .5s;
}
#timer-txt {
  font-family: 'Fredoka One', cursive;
  font-size: 22px; color: #AAFF60;
  min-width: 32px; text-align: right;
}
#timer-txt.urgent { color: var(--red); animation: urgentPulse .45s ease-in-out infinite; }
@keyframes urgentPulse { 0%,100%{transform:scale(1);}50%{transform:scale(1.2);} }

/* score pill */
#score-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.6);
  border: 1px solid rgba(200,240,100,.2);
  border-radius: 50px; padding: 6px 18px;
  backdrop-filter: blur(8px);
  margin-top: 8px;
}
#score-icon { width: 28px; height: 28px; object-fit: contain; }
#score-val {
  font-family: 'Fredoka One', cursive;
  font-size: 28px; color: var(--white);
  min-width: 40px; text-align: center;
}
#score-val.bump { animation: sBump .28s ease; }
@keyframes sBump { 0%{transform:scale(1);}45%{transform:scale(1.6);color:#AAFF60;}100%{transform:scale(1);} }
#score-val.neg  { animation: sNeg .28s ease; }
@keyframes sNeg  { 0%{transform:scale(1);}45%{transform:scale(1.4);color:var(--red);}100%{transform:scale(1);} }

#streak-badge {
  background: var(--orange); color: #1A0500;
  font-family: 'Fredoka One', cursive; font-size: 12px;
  padding: 2px 10px; border-radius: 20px; display: none;
}
#streak-badge.show { display: flex; align-items: center; gap: 4px; animation: popIn .3s cubic-bezier(.34,1.56,.64,1); }
#streak-badge img { width: 16px; height: 16px; object-fit: contain; }
@keyframes popIn { from{transform:scale(0);}to{transform:scale(1);} }

/* heading */
#heading {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(22px, 6vw, 44px);
  color: var(--white);
  text-shadow: 0 0 20px rgba(200,240,100,.4), 2px 2px 0 rgba(0,0,0,.8);
  text-align: center; margin-top: 10px;
  min-height: 52px; letter-spacing: 1px;
}
#heading span { color: #AAFF60; }

/* round timer bar (bottom) */
#rbar-wrap {
  position: fixed; bottom: 0; left: 0;
  width: 100%; height: 5px; z-index: 60;
  background: rgba(0,0,0,.4);
}
#rbar {
  height: 100%; border-radius: 0;
  background: #AAFF60;
  transition: width .07s linear, background .4s;
}

/* hint */
#hint {
  font-family: 'Fredoka One', cursive;
  font-size: 13px; color: rgba(200,240,150,.45);
  text-align: center;
  position: fixed; bottom: 76px; left: 0; right: 0;
  z-index: 60; pointer-events: none;
}

/* main button */
#click-btn {
  position: fixed; bottom: 22px; left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  font-family: 'Fredoka One', cursive;
  font-size: clamp(17px, 4.5vw, 24px);
  border: none; border-radius: 60px;
  padding: 12px 40px;
  cursor: pointer; pointer-events: auto;
  transition: transform .1s, box-shadow .1s, opacity .3s;
  display: flex; align-items: center; gap: 10px;
}
#click-btn img { width: 28px; height: 28px; object-fit: contain; }
#click-btn.cheftou {
  background: linear-gradient(135deg, #2D7A45, #4CAF7D);
  color: var(--white);
  box-shadow: 0 7px 0 #1A4A2A, 0 10px 28px rgba(76,175,100,.4);
}
#click-btn.cheftha {
  background: linear-gradient(135deg, #7B4500, #D4870A);
  color: #FFF8F0;
  box-shadow: 0 7px 0 #4A2400, 0 10px 28px rgba(200,130,10,.4);
}
#click-btn:hover  { transform: translateX(-50%) translateY(-4px); }
#click-btn:active { transform: translateX(-50%) translateY(3px); }
#click-btn:disabled { opacity: .3; pointer-events: none; }

/* ── FEEDBACK TEXT ── */
.fb-txt {
  position: fixed;
  font-family: 'Fredoka One', cursive;
  font-size: 38px; pointer-events: none; z-index: 200;
  animation: fbAnim .85s ease-out forwards;
  text-shadow: 2px 2px 0 rgba(0,0,0,.5);
  display: flex; align-items: center; gap: 8px;
  left: 50vw; top: 42vh;
}
.fb-txt img { width: 40px; height: 40px; object-fit: contain; }
@keyframes fbAnim {
  0%   { opacity: 1; transform: translate(-50%,-50%) scale(.4); }
  40%  { opacity: 1; transform: translate(-50%,-75%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%,-160%) scale(.9); }
}

/* ── PARTICLES ── */
.pt {
  position: fixed; pointer-events: none;
  z-index: 300; animation: ptFly 1s ease-out forwards;
}
.pt img { width: 28px; height: 28px; object-fit: contain; }
@keyframes ptFly {
  0%   { opacity: 1; transform: translate(0,0) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx),var(--dy)) scale(.3) rotate(var(--dr)); }
}

/* ── START SCREEN ── */
#start-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  transition: opacity .5s, transform .5s;
}
#start-screen.hidden { opacity: 0; pointer-events: none; transform: scale(.92); }

.logo-wrap { animation: bounce 2.5s ease-in-out infinite; }
@keyframes bounce { 0%,100%{transform:translateY(0) rotate(-2deg);}50%{transform:translateY(-14px) rotate(2deg);} }

.logo-img {
  width: 130px; height: 130px; object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(200,240,100,.5));
}
.logo-fallback {
  width: 130px; height: 130px;
  background: linear-gradient(135deg, #0D2818, #1A5C30);
  border: 2px solid rgba(170,255,80,.2);
  border-radius: 28px;
  display: none; align-items: center; justify-content: center;
}
.logo-fallback img { width: 80px; height: 80px; object-fit: contain; }

.start-title {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(46px, 11vw, 80px);
  color: var(--yellow);
  text-shadow: 3px 3px 0 #6B4A00, 6px 6px 0 rgba(0,0,0,.5);
  animation: wiggle 3s ease-in-out infinite; line-height: 1;
}
@keyframes wiggle { 0%,100%{transform:rotate(-1.5deg);}50%{transform:rotate(1.5deg);} }

.start-sub {
  font-size: 16px; color: rgba(200,240,150,.65);
  margin: 4px 0 24px; font-weight: 700; letter-spacing: 1px;
}

.btn-start {
  font-family: 'Fredoka One', cursive;
  font-size: 26px;
  background: linear-gradient(135deg, #2D7A45, #4CAF7D);
  color: var(--white); border: none;
  padding: 15px 48px; border-radius: 60px; cursor: pointer;
  box-shadow: 0 8px 0 #1A4A2A, 0 12px 28px rgba(76,175,100,.5);
  transition: transform .1s;
  animation: pBtn 2s ease-in-out infinite;
}
@keyframes pBtn { 0%,100%{transform:scale(1);}50%{transform:scale(1.04);} }
.btn-start:hover  { transform: translateY(-4px); }
.btn-start:active { transform: translateY(4px); }

.howl-text {
  position: absolute;
  font-family: 'Fredoka One', cursive;
  font-size: 16px; color: rgba(200,240,150,.12);
  letter-spacing: 4px;
  animation: hFloat 7s ease-in-out infinite; pointer-events: none;
}
@keyframes hFloat { 0%,100%{opacity:.12;transform:translateY(0);}50%{opacity:.25;transform:translateY(-10px);} }

/* ── END SCREEN ── */
#end-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s, transform .5s;
}
#end-screen.hidden { opacity: 0; pointer-events: none; transform: scale(.9); }

.end-card {
  background: rgba(3,10,4,.93);
  border: 1px solid rgba(170,255,80,.2);
  border-radius: 32px;
  padding: 28px 24px;
  width: min(370px, 93vw);
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 70px rgba(0,0,0,.8), 0 0 60px rgba(80,180,60,.05);
  animation: cardIn .65s cubic-bezier(.34,1.2,.64,1);
}
@keyframes cardIn { from{transform:scale(.65) translateY(50px);opacity:0;}to{transform:scale(1);opacity:1;} }

.end-wolf-img {
  width: 90px; height: 90px; object-fit: contain;
  animation: wolfBob 2.2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(200,240,100,.3));
}
@keyframes wolfBob { 0%,100%{transform:translateY(0);}45%{transform:translateY(-10px) rotate(4deg);}75%{transform:translateY(-5px) rotate(-2deg);} }

.end-title {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(26px, 7vw, 38px);
  color: #AAFF60;
  text-shadow: 0 0 24px rgba(170,255,96,.4);
  text-align: center;
}
.end-score {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(56px, 15vw, 82px);
  color: var(--yellow);
  text-shadow: 3px 3px 0 #7B5000;
  line-height: 1;
}
.end-pts {
  font-family: 'Fredoka One', cursive;
  font-size: 16px; color: rgba(200,240,150,.5);
}

.stats-row { display: flex; gap: 10px; width: 100%; justify-content: center; }
.sbox {
  background: rgba(170,255,80,.05);
  border: 1px solid rgba(170,255,80,.12);
  border-radius: 14px; padding: 8px 12px;
  text-align: center; flex: 1;
}
.sval { font-family: 'Fredoka One', cursive; font-size: 22px; color: var(--white); }
.slbl { font-size: 11px; color: rgba(170,255,80,.45); font-weight: 700; letter-spacing: .4px; margin-top: 2px; }

.rank-badge {
  background: linear-gradient(135deg, rgba(170,255,80,.1), rgba(76,175,100,.07));
  border: 1px solid rgba(170,255,80,.25);
  border-radius: 18px; padding: 8px 20px;
  font-family: 'Fredoka One', cursive;
  font-size: 17px; color: #AAFF60; text-align: center;
}

.end-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%; }

.btn-replay {
  font-family: 'Fredoka One', cursive; font-size: 19px;
  background: linear-gradient(135deg, #2D7A45, #4CAF7D);
  color: var(--white); border: none;
  padding: 12px 28px; border-radius: 50px; cursor: pointer;
  box-shadow: 0 6px 0 #1A4A2A;
  transition: transform .1s;
}
.btn-replay:hover { transform: translateY(-3px); }

.btn-wa {
  font-family: 'Fredoka One', cursive; font-size: 19px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff; border: none;
  padding: 12px 28px; border-radius: 50px; cursor: pointer;
  box-shadow: 0 6px 0 #0A5A3A;
  transition: transform .1s;
}
.btn-wa:hover { transform: translateY(-3px); }

.btn-copy {
  font-family: 'Fredoka One', cursive; font-size: 19px;
  background: linear-gradient(135deg, #1DA1F2, #0D8BD9);
  color: #fff; border: none;
  padding: 12px 28px; border-radius: 50px; cursor: pointer;
  box-shadow: 0 6px 0 #0A5A8A;
  transition: transform .1s;
}
.btn-copy:hover { transform: translateY(-3px); }

.toast {
  font-size: 13px; color: #AAFF60;
  opacity: 0; transition: opacity .3s;
  font-weight: 700; height: 16px;
}
.toast.show { opacity: 1; }
