/* Chapter 6: her birthday table */
.chapter-cake { gap: clamp(10px, 2.2dvh, 22px); }

.cake-wish {
  margin: 0;
  max-width: 24ch;
  min-height: 2.5em;
  display: grid;
  align-items: end;
  font: italic 500 clamp(24px, 4.2vw, 34px)/1.25 var(--font-serif);
  color: var(--cocoa);
  text-align: center;
  text-wrap: balance;
}

/* the table, and everything on it */
.feast {
  position: relative;
  flex: none;
  width: min(900px, 94vw, calc((100dvh - 230px) * 2.25));
  aspect-ratio: 9 / 4;
}
.feast-table {
  position: absolute;
  left: -4%; right: -4%;
  top: 64%; bottom: -5%;
  background: #FFD6E0;
  border: 5px solid var(--cocoa);
  border-radius: 28px 28px 18px 18px;
  box-shadow: inset 0 -14px 0 #FFC2D1, inset 0 5px 0 #FFFCFD;
}
.feast-item { position: absolute; }
.feast-item svg { display: block; width: 100%; height: auto; overflow: visible; }
.feast-cake {
  left: 30%; width: 40%; bottom: 6%;
  padding: 0; border: 0; background: none;
  cursor: pointer;
  transform-origin: 50% 95%;
}
.feast-cake:disabled { cursor: default; }
.feast-cake:not(:disabled):hover svg { transform: translateY(-3px); }
.feast-cake svg { transition: transform .35s var(--ease-bounce); }
.feast-cake:focus-visible { outline: 3px solid var(--candy); outline-offset: 6px; border-radius: 24px; }
.feast-shadow {
  position: absolute;
  left: 30%; width: 40%;
  bottom: 3%; height: 10%;
  background: var(--ground-shadow);
}
.feast-sushi { left: 2%; width: 27%; bottom: 14%; }
.feast-fries { left: 72%; width: 13%; bottom: 10%; }
.feast-laban { left: 86.5%; width: 10%; bottom: 12%; }

/* candles: a gentle flicker while lit; they lean when she blows into the microphone */
.feast-cake svg { --lean: 0; }
.candle .lean, .candle .flame, .candle .flicker { transform-box: fill-box; transform-origin: 50% 100%; }
.candle .lean { transform: skewX(calc(var(--lean) * -28deg)) scaleY(calc(1 - var(--lean) * .3)); transition: transform .12s linear; }
.candle.lit .flicker { animation: flicker 1.1s ease-in-out infinite; }
.candle.lit .glow { animation: glow 2s ease-in-out infinite; }
@keyframes flicker {
  0%, 100% { transform: scale(1, 1) skewX(0deg); }
  25% { transform: scale(.94, 1.06) skewX(2deg); }
  50% { transform: scale(1.03, .95) skewX(-2deg); }
  75% { transform: scale(.97, 1.04) skewX(1deg); }
}
@keyframes glow { 0%, 100% { opacity: .3; } 50% { opacity: .5; } }
.smoke-curl { fill: none; stroke: #BFAFAF; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 60; transform-box: fill-box; }

/* under the table */
.cake-prompt { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 64px; }
.cake-mic {
  min-height: 32px;
  padding: 4px 10px;
  border: 0;
  background: none;
  font: 600 13px/1.3 var(--font-sans);
  color: var(--cocoa-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.cake-mic:disabled { text-decoration: none; cursor: default; }
.cake-mic:focus-visible { outline: 3px solid var(--candy); outline-offset: 2px; border-radius: 8px; }

/* the celebration */
.confetti { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.confetti-bit { position: absolute; top: 0; left: 0; width: 9px; height: 14px; border-radius: 2px; }
.confetti-bit.round { width: 10px; height: 10px; border-radius: 50%; }
.confetti-heart { position: absolute; top: 0; left: 0; width: 18px; }
.confetti-heart svg { display: block; width: 100%; height: auto; }

/* phones: the cake in front and centre, the little feast in front of it */
@media (max-width: 600px) {
  .feast { width: min(94vw, calc((100dvh - 230px) * 4 / 3)); aspect-ratio: 4 / 3; }
  .feast-table { top: 58%; }
  .feast-cake { left: 18%; width: 64%; bottom: 14%; }
  .feast-shadow { left: 20%; width: 60%; bottom: 11%; }
  .feast-sushi { left: -2%; width: 46%; bottom: 0; }
  .feast-fries { left: 64%; width: 20%; bottom: 2%; }
  .feast-laban { left: 84%; width: 15%; bottom: 6%; }
}

@media (prefers-reduced-motion: reduce) {
  .candle.lit .flicker, .candle.lit .glow { animation: none; }
  .candle .lean, .feast-cake svg { transition: none; }
}
