:root{
  --cake-w: 320px;
  --layer-h: 80px;
  --frost-h: 22px;

  /* mum–pasta ince ayarı */
  --candle-top: -50px;
  --wick-top:   -10px;

  /* sahneyi aşağı kaydırma */
  --scene-shift-y: 112px;
  --scene-shift-y-mobile: 108px;

  /* boşluklar */
  --controls-under-gap: 28px;   /* pasta tabanı ile wish1 arası temel boşluk */
  --wish-controls-gap: 24px;    /* wish1 ile buton arası sabit boşluk */
  --wish-dyn-gap: 0px;          /* JS ile eklenen DİNAMİK boşluk (satır uzarsa artar) */

  /* satır sınırı */
  --wish-line-clamp: 3;
}
@media (max-width:480px){
  :root{
    --cake-w: 280px; --layer-h: 72px; --frost-h: 20px;
    --candle-top: -58px;
    --wick-top:   -9px;
    --controls-under-gap: 24px;
    --wish-controls-gap: 20px;
    --wish-dyn-gap: 0px;
    --wish-line-clamp: 3;
  }
}

/* SADECE INDEX’TE kaydırmayı kapat */
html.no-scroll,
body.page-index{ height:100%; overflow:hidden; }

body{
  margin:0;
  background: radial-gradient(60% 60% at 50% 35%, #fff7fb 0, #ffe9f3 55%, #ffe1ee 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color:#222;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:12px; padding:12px;
}

/* DUMAN: daha altta kalsın */
#fx{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6; /* DUMAN: altta */
}

/* SAHNE: dumanın ÜSTÜNDE, yazılar burada */
.stage{
  position: relative;
  z-index: 10; /* sahne ve içindekiler dumanın üstünde */
  width: min(92vw, calc(var(--cake-w) + 180px));
  height: calc(100vh - 204px);
  display:flex; flex-direction:column; align-items:center; justify-content:flex-start;
  padding: 12px 12px 0;
  transform: translateY(var(--scene-shift-y));
}
@media (max-width:480px){
  .stage{
    height: calc(100vh - 208px);
    padding: 8px 8px 0;
    transform: translateY(var(--scene-shift-y-mobile));
  }
}

.cake-wrap{
  position:relative;
  width:var(--cake-w);
  height: calc(var(--layer-h)*2 + var(--frost-h) + 86px);
}

/* MUM */
.candle{
  position:absolute; left:50%; transform:translateX(-50%); top: var(--candle-top);
  width:20px; height:68px;
  background: repeating-linear-gradient(90deg,#ffe08a 0 6px,#ffd54f 6px 12px);
  border:1px solid rgba(0,0,0,.18); border-radius:6px; box-shadow:0 3px 6px rgba(0,0,0,.08);
}
.wick{ position:absolute; top: var(--wick-top); left:50%; transform:translateX(-50%); width:2px; height:12px; background:#333; border-radius:1px; }
.flame{
  position:absolute; top:-40px; left:50%; transform:translateX(-50%);
  width:22px; height:32px;
  background: radial-gradient(ellipse at 50% 60%, #ffd27d 0%, #ff9800 55%, rgba(255,152,0,0) 70%);
  border-radius:50% 50% 55% 55%/60% 60% 40% 40%;
  filter: drop-shadow(0 0 10px rgba(255,160,20,.65));
  animation:flicker .18s infinite alternate ease-in-out;
}
.flame.off{ display:none; }
@keyframes flicker{ from{ transform: translateX(calc(-50% - 1px)) scale(1);} to{ transform: translateX(calc(-50% + 1px)) scale(1.05);} }

/* PASTA */
.cake{
  position:relative; width:var(--cake-w);
  height: calc(var(--layer-h)*2 + var(--frost-h) + 40px);
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.12));
  z-index: 4; /* pasta < duman(6) < yazılar(>=12) */
}
.layer{
  position:absolute; left:50%; transform:translateX(-50%); width:var(--cake-w); height:var(--layer-h);
  background: linear-gradient(180deg,#ffd2df 0%, #ffb1c9 60%, #ff9ebb 100%);
  border-radius:14px; border:2px solid rgba(178,30,83,.25);
  box-shadow: inset 0 14px 24px rgba(255,126,163,.18), 0 2px 0 rgba(255,255,255,.7);
}
.layer::after{
  content:""; position:absolute; inset:0;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.18) 0 2px, rgba(255,255,255,0) 2px 6px);
  border-radius: inherit; pointer-events:none;
}
.layer.top{ top:0; }
.layer.bottom{ top: calc(var(--layer-h) + var(--frost-h) + 18px); }

.frost{
  position:absolute; left:50%; transform:translateX(-50%);
  top: calc(var(--layer-h) - 2px); width: calc(var(--cake-w) + 10px); height: var(--frost-h);
  background:
    radial-gradient(16px 12px at 12% 20%, #fff 98%, transparent 100%),
    radial-gradient(20px 14px at 28% 40%, #fff 98%, transparent 100%),
    radial-gradient(14px 12px at 46% 50%, #fff 98%, transparent 100%),
    radial-gradient(20px 14px at 63% 35%, #fff 98%, transparent 100%),
    radial-gradient(16px 12px at 79% 45%, #fff 98%, transparent 100%),
    radial-gradient(18px 14px at 92% 30%, #fff 98%, transparent 100%),
    linear-gradient(#fff,#ffe7ee);
  border-bottom-left-radius:12px; border-bottom-right-radius:12px;
  border:1px solid rgba(0,0,0,.08); border-top:none; box-shadow:0 3px 6px rgba(0,0,0,.06);
}
.frost.second{ top: calc(var(--layer-h) + var(--frost-h) + 16px + var(--layer-h) - 2px); }
.plate{
  position:absolute; left:50%; transform:translateX(-50%); bottom: 8px;
  width: calc(var(--cake-w) + 90px); height:22px; background:#e0e0e8;
  border-radius:999px; box-shadow: inset 0 2px 4px rgba(0,0,0,.12); border:1px solid rgba(0,0,0,.08);
}
.shadow{
  position:absolute; left:50%; transform:translateX(-50%); bottom: -8px;
  width: calc(var(--cake-w) + 130px); height:22px;
  background: radial-gradient(ellipse, rgba(0,0,0,.18), rgba(0,0,0,0) 70%);
  border-radius:50%; filter: blur(7px);
}

/* METİN STİLLERİ (yazılar dumanın üstünde olacak) */
.name-tag,
.wish2 .text,
.wish1 .text{
  font-weight:900; letter-spacing:.25px;
  text-shadow: 0 2px 6px rgba(0,0,0,.22), 0 1px 0 rgba(255,255,255,.8), 0 0 10px rgba(255,255,255,.35);
  background: linear-gradient(90deg,#1d1b3a,#3a1d4b,#8a2be2);
  -webkit-background-clip: text; background-clip:text; color: transparent;
}

/* İSİM ETİKETİ mutlak konumlu — JS ofsetleri uygular */
.name-tag{
  position:absolute;
  left:50%;
  top:-66px;                 /* baz nokta; JS üzerine ofset ekliyor */
  transform:translateX(-50%);
  font-size:17px;
  white-space:nowrap;
  z-index:16;                /* duman (6) ve pasta (4) üstünde */
}

/* Üst dilek (pop + parıltı efekti) */
.wish2{
  position:absolute; left:50%; transform:translateX(-50%); top: -170px;
  display:none; transform-origin: center;
  z-index: 30; /* en üstte */
  width: var(--cake-w);
  text-align: center;
}
.wish2.show{ display:block; }
.wish2.pop{
  z-index: 999;
  animation: wish2Pop .9s cubic-bezier(.2,.8,.2,1) both;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,.25));
}
@keyframes wish2Pop{
  0%   { transform: translate(-50%, -10px) scale(.85); opacity: 0; }
  40%  { transform: translate(-50%, 0)    scale(1.2);  opacity: 1; }
  70%  { transform: translate(-50%, -2px) scale(1.06); }
  100% { transform: translate(-50%, 0)    scale(1);   }
}
/* Parıltı + ışıma (kısa süre) */
.wish2.fx .text{
  background: linear-gradient(90deg,#ffffff,#fbd3ff,#a889ff,#ffffff);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip:text; color: transparent;
  animation: shine 1.8s linear 1, glow 1.4s ease-in-out 2;
  text-shadow:
    0 0 12px rgba(255,255,255,.55),
    0 0 22px rgba(168,137,255,.35),
    0 2px 6px rgba(0,0,0,.25);
}
@keyframes shine { from{ background-position: 200% 0; } to{ background-position: 0 0; } }
@keyframes glow  { 0%,100%{ filter: drop-shadow(0 0 0 rgba(255,255,255,0)); } 50%{ filter: drop-shadow(0 0 14px rgba(255,255,255,.55)); } }

/* 2. dilek metni: max satır + padding */
.wish2 .text{
  display: -webkit-box;
  -webkit-line-clamp: var(--wish-line-clamp);
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.2;
  padding: 6px 10px;
  max-width: calc(var(--cake-w) - 16px - 20px);
  margin: 0 auto;
  white-space: normal;
}

/* Alt dilek: dumanın üstünde */
.wish1{
  position:absolute; left:50%; transform:translateX(-50%);
  top: calc(var(--layer-h)*2 + var(--frost-h) + 22px);
  z-index: 20;  /* yazı > duman */
  width: var(--cake-w); text-align:center;
}
.wish1 .text{
  display: -webkit-box;
  -webkit-line-clamp: var(--wish-line-clamp);
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.2;
  padding: 6px 10px;
  max-width: calc(var(--cake-w) - 16px - 20px);
  margin: 0 auto;
  white-space: normal;
}

/* KONTROLLER — pasta alt-ortası (sabit + dinamik boşluk birlikte) */
.controls{
  width: var(--cake-w);
  display:flex; justify-content:center; align-items:center; gap:10px;
  margin-top: calc(var(--controls-under-gap) + var(--wish-controls-gap) + var(--wish-dyn-gap));
}
.controls-under-cake{ align-self:center; }

.btn{ padding:12px 16px; border-radius:16px; cursor:pointer; border:1px solid rgba(0,0,0,.12); background:#fff; }
.btn.mic{
  background: linear-gradient(90deg,#ff5d99,#ff7bb2);
  color:#fff; border-color:#ff5d99;
  display:flex; align-items:center; gap:10px; font-weight:700;
  box-shadow: 0 6px 20px rgba(255,93,153,.35);
}
.btn.mic .mic-icon{ font-size:20px; line-height:1; }
.btn.mic .mic-text{ white-space:nowrap; }

.pulse{ animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse{
  0%{ transform: scale(1); box-shadow: 0 6px 20px rgba(255,93,153,.35); }
  50%{ transform: scale(1.03); box-shadow: 0 10px 28px rgba(255,93,153,.45); }
  100%{ transform: scale(1); box-shadow: 0 6px 20px rgba(255,93,153,.35); }
}

/* Alt marka linki */
.brand{
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  z-index: 5; font-weight: 800; letter-spacing: .5px;
}
.brand a{
  text-decoration: none; color: #8a2be2;
  text-shadow: 0 1px 0 #fff, 0 0 10px rgba(138,43,226,.2);
}
.brand a:hover{ text-decoration: underline; }

/* Admin stilleri */
.admin-wrap{ width:min(1000px,92vw); margin:32px auto; }
h1,h2{ margin:8px 0 10px 0 }
.panel{ background:#fff; border:1px solid rgba(0,0,0,.08); border-radius:16px; padding:16px; box-shadow:0 8px 30px rgba(0,0,0,.06); width:100%; max-width:1000px; }
.grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.grid input, .grid select { padding:10px 12px; border-radius:12px; border:1px solid rgba(0,0,0,.12); }
.note{ background:#f1fff4; color:#245d2b; border:1px solid #b7e2be; padding:8px 12px; border-radius:12px; display:inline-block; margin:8px 0; }
.list .item{ margin-bottom:10px; }
.list summary{ list-style:none; cursor:pointer; display:flex; gap:8px; align-items:center; flex-wrap:wrap }
.list summary::-webkit-details-marker{ display:none; }
.copy{ width:280px; font-size:12px; padding:8px 10px; border-radius:8px; border:1px dashed rgba(0,0,0,.2); background:#fff; }
