* {
  box-sizing: border-box;
}
html,body {
  height: 100%;
}
body {
  margin: 0;
  font-family: "Playpen Sans Arabic", cursive;
  font-optical-sizing: auto;
  font-weight: 300;
  font-style: normal;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.62), transparent 26%),
    radial-gradient(circle at 85% 8%, rgba(255,255,255,.42), transparent 30%),
    radial-gradient(circle at 76% 78%, rgba(255,255,255,.34), transparent 26%),
    linear-gradient(135deg, #05e910 0%, #ad6d39 30%, #dff7ff 65%, #4474a1 100%);
  color: #3a2a2f;
}
.wrap {
  height: 100vh;
  display: block;
}
.scene {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3.2vw, 36px);
  transition: opacity .6s ease, transform .6s ease;
}
.hidden {
  display: none; 
  opacity: 0;
  transform: translateY(10px);
}
.card {
  width: min(940px, 94vw);
  background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.9));
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 8px 30px rgba(18,12,22,0.12);
  text-align: center;
}
.intro {
    padding: 60px 28px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 50vh;
}
#bcake-0 {
    position: absolute;
    bottom: 0;
    right: 0;
}
.title-main {
    font-size: clamp(28px,6vw,48px);
    font-family: "Lucida Handwriting", "Apple Chancery", "ITC Zapf Chancery", cursive;
    color: #333;
    margin: 0 0 18px;
}
.title-sub {
    font-size: clamp(22px,4vw,40px);
    /*font-family: 'Sacramento', sans-serif;*/
    font-family: "Playpen Sans Arabic", cursive;
    font-optical-sizing: auto;
    font-style: normal;
    font-weight: 300;
    margin: 0 0 18px;
}
.btn {
    margin-top: 28px;
    appearance: none;
    border: 0;
    padding: 12px 20px;
    font-size: 18px;
    border-radius: 12px;
    background: linear-gradient(90deg,#5affce,#030438);
    color: #fff;
    font-family: "Playpen Sans Arabic", cursive;
    font-optical-sizing: auto;
    font-style: normal;
    font-weight: 300;
    cursor: pointer;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(74, 227, 238, 0.18);
    transition: transform .24s ease, box-shadow .24s ease, filter .24s ease;
}
.btn::before,
.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}
.btn::before {
    inset: -2px;
    border: 2px solid rgba(255,255,255,.62);
    opacity: 0;
    transform: scale(.96);
    transition: opacity .24s ease, transform .24s ease;
}
.btn::after{
    inset: -40% auto -40% -140%;
    width: 45%;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.15) 40%, rgba(255,255,255,.82) 50%, rgba(255,255,255,.15) 60%, transparent 100%);
    transform: skewX(-20deg);
    opacity: 0;
}
.btn:hover {
    transform: scale(1.1);
    filter: saturate(1.12);
    box-shadow: 0 10px 24px rgba(74, 227, 238, 0.28), 0 0 22px rgba(90, 255, 206, 0.22);
}
.btn:hover::before {
    opacity: 1;
    transform: scale(1);
}
.btn:hover::after {
    opacity: .95;
    animation: btnShine .85s ease forwards;
}
@keyframes btnShine {
    from{left:-140%}
    to{left:170%}
}
.btn:active {
  transform: translateY(2px);
}
.msg {
  font-size: 1.05rem;
  line-height: 1.5;
  margin:16px 0 22px; 
  text-align: justify;
}
.wishes h2, 
.cake-scene h2, 
.final h2 {
  margin: 0 0 12px;
}
.final {
  padding: 20px;
}
.final-layout {
  width: 100%;
}
.final-graphic {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  min-height: 540px;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(80, 28, 46, 0.16);
}
.final-graphic img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  object-position: left;
}
.final-content {
  position: relative;
  z-index: 1;
  margin-left: auto;
  width: min(440px, 46%);
  padding: 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.84), rgba(255,255,255,.74));
  backdrop-filter: blur(2px);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: visible;
}
.final-content h2 {
  text-align: center;
}
/* Cake */
.cake-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.nb-container {
  position: relative;
  width: min(350px, 84vw);
  height: min(350px, 84vw);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  margin: 8px auto;
}
.cake {
  position: absolute;
  width: 250px;
  height: 200px;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-35%);
}
.cake > * {
  position:absolute;
}
.plate{
  width: 270px;
  height: 110px;
  bottom: -10px;
  left: -10px;
  background: #d5d5d5;
  border-radius: 50%;
  box-shadow: 0 2px 0 #bcbcbc, 0 4px 0 #b2b2b2, 0 8px 30px rgba(0,0,0,.28);
}
.layer {
  display: block;
  width: 250px;
  height: 100px;
  border-radius: 50%;
  background: #553c13;
  box-shadow:
    0 2px 0 #64491a,
    0 4px 0 #4f3711,
    0 6px 0 #4d360f,
    0 8px 0 #4b340f,
    0 10px 0 #49330e,
    0 12px 0 #47310e,
    0 14px 0 #452f0d,
    0 16px 0 #432e0d,
    0 18px 0 #412c0c,
    0 20px 0 #3f2b0c,
    0 22px 0 #3d290b,
    0 24px 0 #3b280b,
    0 26px 0 #39260a,
    0 28px 0 #372509,
    0 30px 0 #352309;
}
.layer-top {
  top: 0;
}
.layer-middle {
  top: 33px;
}
.layer-bottom {
  top: 66px;
}
.icing {
  position: absolute;
  top: 2px;
  left: 5px;
  width: 240px;
  height: 90px;
  border-radius: 50%;
  background: #fffdd0;
  overflow: hidden;
}
.icing::before {
  content: "";
  position: absolute;
  top: 4px;
  right: 5px;
  bottom: 6px;
  left: 5px;
  border-radius: 50%;
  background: #ffffdb;
  box-shadow: 0 0 4px #ffffe6, 0 0 4px #ffffe6, 0 0 4px #ffffe6;
  z-index: 1;
}
.icing-caption {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}
.icing-caption .icing-name-text {
  fill: #bb1451;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  paint-order: stroke fill;
  stroke: rgba(255,255,255,.6);
  stroke-width: 0.9px;
}
.icing-caption textPath {
  dominant-baseline: middle;
}
.cake .candle {
  position: absolute;
  width: 16px;
  height: 50px;
  border-radius: 8px / 4px;
  top: -20px;
  left: 50%;
  margin-left: -8px;
  background: #7B020B;
  z-index: 10;
}
.cake .candle::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 8px;
  border-radius: 50%;
  background: #ad2630;
}
.cake .flame {
  position: absolute;
  width: 15px;
  height: 35px;
  top: -34px;
  left: 50%;
  margin-left: -7.5px;
  z-index: 11;
  border-radius: 10px 10px 10px 10px / 25px 25px 10px 10px;
  background: #ffe24a;
  transform-origin: 40% 80%;
  box-shadow: 0px 0px 20px rgba(0, 0, 0, .9);
}
.flame.lit {
  animation: flicker 1s ease-in-out alternate infinite;
}
@keyframes flicker {
  0%{transform:skewX(2deg)}
  25%{transform:skewX(-2deg)}
  50%{transform:skewX(2deg) scale(1.02,.96)}
  75%{transform:skewX(-2deg)}
  100%{transform:skewX(2deg)}
}
.cake-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.flame.puff {
  animation: blow .8s forwards;
}
@keyframes blow {
  0%{opacity:1;transform:scale(1)}
  100%{opacity:0;transform:translateY(-24px) scale(1.6)}
}
.hidden-by-js {
  display: none;
}
.box {
  background-color: #f6eee3;
  padding: 16px;
  border-radius: 10px;
  margin: 10px 0;
  clip-path: polygon(
    0% 5%, 12% 0%, 30% 7%, 50% 2%, 75% 8%, 95% 3%, 100% 20%, 
    94% 45%, 100% 20%, 96% 95%, 80% 100%, 50% 97%, 25% 100%, 
    2% 94%, 0% 70%, 2% 45%, 2% 20%
  );
  background-image: 
    linear-gradient(135deg, rgba(0,0,0,0.02) 25%, transparent 25%),
    linear-gradient(225deg, rgba(0,0,0,0.02) 25%, transparent 25%),
    linear-gradient(45deg, rgba(0,0,0,0.02) 25%, transparent 25%),
    linear-gradient(315deg, rgba(0,0,0,0.02) 25%, transparent 25%);
}
#the-world-is-better-place-because-of-you {
    margin-top: 45px;
}
.footer {
  text-align: center;
  margin-top: 45px;
  color: #8a6b73;
}
#poem {
    margin-block-start: 0;
    margin-block-end: 0;
    margin-inline-start: 0;
    margin-inline-end: 0;
    font-style: italic;
}
#you {
  font-weight: 600;
  color:#dd0655;
}
.fade-in {
  animation: fadeIn .6s ease both;
}
@keyframes fadeIn {
  from{opacity:0;transform:translateY(6px)}
  to{opacity:1;transform:none}
}

@media (max-width:520px) {
  .nb-container {
    width: min(320px, 88vw);
    height: min(320px, 88vw);
  }
  #poem {
    text-align: justify;
  }
  .cake {
    transform: translate(-50%,-35%) scale(.82);
  }
  .intro {
    height: 60vh;
  }
  .btn {
    width: 100%;
  }
  .final-graphic {
    min-height: 560px;
  }
  .final-content {
    width: 100%;
    margin-left: 0;
    max-width: none;
    text-align: center
  }
  .card {
    padding: 18px;
  }
  .title-main {
    font-size: 38px;
  }
  .title-sub {
    font-size: 29px;
  }
}