/* =====================================================================
   cake.css  —  Cake cutting page: gate + animated cake + knife cut
   ===================================================================== */

/* page thoda scroll ho sake (mobile) */
body { overflow-y: auto; }
.screen { position: static; min-height: 100dvh; }

/* =====================================================================
   OPENING GATE  —  tap for cake (Happy Birthday song isi par shuru)
   ===================================================================== */
.ck-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  min-height: 100dvh;
  justify-content: center;
  cursor: pointer;
  animation: fadeUp 0.9s both;
}
.ck-gate.fade-out { animation: gateOut 0.5s ease forwards; }
@keyframes gateOut { to { opacity: 0; transform: scale(0.9); visibility: hidden; } }

.ck-gate-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  animation: ckPulse 1.7s ease-in-out infinite;
}
.ck-gate-cake {
  font-size: 5rem;
  filter: drop-shadow(0 10px 24px rgba(255, 92, 138, 0.5));
  display: inline-block;
}
@keyframes ckPulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.08) rotate(-2deg); }
}
.ck-gate-label {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: 0.3px;
  cursor: pointer;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* =====================================================================
   CONTENT
   ===================================================================== */
.cake-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 30px 16px 40px;
  gap: 6px;
}

/* =====================================================================
   CAKE STAGE
   ===================================================================== */
.cake-stage {
  position: relative;
  width: 300px;
  max-width: 88vw;
  height: 320px;
  margin: 18px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

/* cake = tiers stack (bottom widest) */
.cake {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: cakeIn 0.7s both;
}
@keyframes cakeIn {
  from { opacity: 0; transform: translateY(24px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.cake.shake { animation: cakeShake 0.5s ease; }
@keyframes cakeShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px) rotate(-1deg); }
  40% { transform: translateX(6px) rotate(1deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ---- Tiers ---- */
.tier {
  position: relative;
  background: linear-gradient(180deg, #ffe3ef 0 22%, #ff9bbd 22% 100%);
  border-radius: 10px 10px 6px 6px;
  box-shadow: inset 0 -8px 14px rgba(195, 55, 155, 0.35),
              0 8px 18px rgba(0, 0, 0, 0.35);
}
.tier-top { width: 150px; height: 58px; z-index: 3; }
.tier-mid { width: 205px; height: 62px; margin-top: -4px; z-index: 2; }
.tier-bot { width: 260px; height: 70px; margin-top: -4px; z-index: 1; }

/* icing drips (frosting ki boondein) */
.drip {
  position: absolute;
  top: 16px;
  left: 0;
  width: 100%;
  height: 22px;
  background: #fff3f8;
  border-radius: 0 0 10px 10px;
  box-shadow: inset 0 -4px 8px rgba(255, 155, 189, 0.4);
}
.drip::before, .drip::after {
  content: "";
  position: absolute;
  top: 100%;
  width: 26px;
  height: 20px;
  background: #fff3f8;
  border-radius: 0 0 50% 50%;
}
.drip::before { left: 18%; }
.drip::after  { right: 18%; width: 34px; height: 26px; }

/* ---- Plate ---- */
.plate {
  width: 290px;
  max-width: 92vw;
  height: 16px;
  margin-top: -2px;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background: linear-gradient(180deg, #e9d8ff, #b79be0);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.4);
}

/* =====================================================================
   NUMBER CANDLES  (uski age — "28")
   ===================================================================== */
.candles {
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
  z-index: 4;
}
.candle {
  position: relative;
  width: 30px;
  height: 52px;
  border-radius: 8px;
  background: repeating-linear-gradient(
    -45deg, #fff 0 7px, #ff5c8a 7px 14px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  color: #c3379b;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}
/* wick + flame */
.flame {
  position: absolute;
  top: -20px;
  left: 50%;
  width: 14px;
  height: 20px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 70%, #fff 0%, #ffd36e 35%, #ff8a1e 70%, #ff5c2e 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow: 0 0 16px 6px rgba(255, 180, 70, 0.75);
  transform-origin: center bottom;
  animation: flameFlicker 0.28s ease-in-out infinite alternate;
}
.flame::after {   /* wick */
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 2px;
  height: 6px;
  transform: translateX(-50%);
  background: #4a2c1a;
}
@keyframes flameFlicker {
  0%   { transform: translateX(-50%) scale(1) rotate(-3deg); opacity: 0.92; }
  100% { transform: translateX(-50%) scale(1.14, 1.2) rotate(3deg); opacity: 1; }
}

/* flame bujhna (cut/blow par) */
.candle.out .flame {
  animation: none;
  transform: translateX(-50%) scale(0.2);
  opacity: 0;
  box-shadow: none;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
/* dhuan (smoke puff) */
.smoke {
  position: absolute;
  top: -22px;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(220, 220, 220, 0.5);
  opacity: 0;
  pointer-events: none;
}
.candle.out .smoke { animation: smokeRise 1.1s ease-out forwards; }
@keyframes smokeRise {
  0%   { opacity: 0.6; transform: translate(-50%, 0) scale(0.6); }
  100% { opacity: 0;   transform: translate(-50%, -34px) scale(1.8); }
}

/* =====================================================================
   KNIFE  +  CUT LINE
   ===================================================================== */
.knife {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%) rotate(28deg);
  font-size: 3.1rem;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.4s ease;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
  pointer-events: none;
}
.knife.show { opacity: 1; }
.knife.chop { animation: knifeChop 0.75s cubic-bezier(0.5, 0, 0.3, 1); }
@keyframes knifeChop {
  0%   { top: 2px;  transform: translateX(-50%) rotate(28deg); }
  45%  { top: 2px;  transform: translateX(-50%) rotate(10deg); }
  70%  { top: 72px; transform: translateX(-50%) rotate(4deg); }   /* chop in */
  100% { top: 2px;  transform: translateX(-50%) rotate(28deg); }
}

/* cut line (cake ke beech katne ka nishaan) */
.cut-gap {
  position: absolute;
  top: 82px;
  left: 50%;
  width: 5px;
  height: 150px;
  transform: translateX(-50%) scaleY(0);
  transform-origin: top center;
  background: linear-gradient(180deg, rgba(120, 20, 70, 0.0), rgba(120, 20, 70, 0.55));
  border-radius: 3px;
  z-index: 5;
}
.cut-gap.show { animation: cutGrow 0.4s ease forwards 0.35s; }
@keyframes cutGrow { to { transform: translateX(-50%) scaleY(1); } }

.slice { display: none; }   /* (future use) */

/* =====================================================================
   CUT BUTTON + DONE MESSAGE
   ===================================================================== */
.ck-cut-btn { margin-top: 14px; }
.ck-cut-btn.gone { display: none; }

.ck-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeUp 0.8s both;
}
.ck-done-msg {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: clamp(1.4rem, 6vw, 2rem);
  line-height: 1.35;
  color: #fff;
  text-shadow: 0 2px 18px rgba(255, 92, 138, 0.5);
  margin-top: 8px;
}
.ck-name { font-family: "Pacifico", cursive; color: var(--pink-soft); }
.ck-sub {
  display: inline-block;
  margin-top: 8px;
  font-family: "Poppins", sans-serif;
  font-weight: 300;
  font-size: 1rem;
  opacity: 0.9;
}
