/* Cake Party: laid out like Get Dressed (it uses that game's .dr- styles for the scene, cards and typing
   line); these are its own touches. The photos on the results card and in the album use the same
   drawings, so the room's styles aren't tied to the game screen. */
.game.cake { background: #fff0f7; }
.game.cake .dr-scene { background: #efe7ff; }
.game.cake .ck-me { transform-box: fill-box; transform-origin: 50% 100%; }
.game.cake .hud .btn.ghost { background: #fff; }

/* something new at the party */
.ck-pop { transform-box: fill-box; transform-origin: 50% 100%; animation: dr-pop .6s cubic-bezier(.2, 1.7, .4, 1) backwards; }
.ck-drop { animation: ck-drop .5s cubic-bezier(.45, 0, .7, 1); }
@keyframes ck-drop { 0% { transform: translateY(-520px); } 62% { transform: translateY(0); } 78% { transform: translateY(-20px); } 100% { transform: none; } }
.ck-rain { animation: ck-rain .42s ease-in backwards; }
@keyframes ck-rain { from { transform: translateY(-120px); opacity: 0; } 30% { opacity: 1; } to { transform: none; } }

/* the room, gently moving */
.ck-twinkle { transform-box: fill-box; transform-origin: 50% 50%; animation: ck-twinkle 1.5s ease-in-out infinite alternate; }
@keyframes ck-twinkle { from { transform: scale(.35); opacity: .35; } to { transform: scale(1.1); opacity: 1; } }
.ck-bob { animation: ck-bob 3.2s ease-in-out infinite alternate; }
@keyframes ck-bob { from { transform: translateY(-7px) rotate(-1deg); } to { transform: translateY(7px) rotate(1deg); } }
.ck-swing { animation: ck-swing 3s ease-in-out infinite alternate; }
@keyframes ck-swing { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
.ck-jiggle { transform-box: fill-box; transform-origin: 50% 100%; animation: ck-jiggle 3.6s ease-in-out infinite; }
@keyframes ck-jiggle { 0%, 80%, 100% { transform: none; } 84% { transform: rotate(-3deg) scale(1.02, .98); } 88% { transform: rotate(3deg) scale(.98, 1.02); } 92% { transform: rotate(-2deg); } 96% { transform: rotate(1deg); } }
.ck-bub { transform-box: fill-box; transform-origin: 50% 50%; animation: ck-bub 4.8s linear infinite backwards; }
@keyframes ck-bub { 0% { transform: translate(0, 0) scale(.3); opacity: 0; } 10% { opacity: 1; } 85% { opacity: .9; } 100% { transform: translate(var(--dx, 20px), -480px) scale(1.15); opacity: 0; } }
.ck-boom { transform-box: fill-box; transform-origin: 50% 50%; animation: ck-boom 2.2s ease-out infinite backwards; }
@keyframes ck-boom { 0% { transform: scale(.1); opacity: 0; } 18% { opacity: 1; } 60% { transform: scale(1); opacity: 1; } 85%, 100% { transform: scale(1.1); opacity: 0; } }

/* the door opens for a guest */
.ck-door { transform-box: fill-box; transform-origin: 0 50%; transition: transform .35s ease-out; }
.ck-door.open { transform: scaleX(.14); }
.ck-walk { transform-box: fill-box; transform-origin: 50% 100%; }

/* the lights go down */
.ck-dark { opacity: 0; pointer-events: none; transition: opacity 1s ease-in; }
.ck-night { opacity: 0; transition: opacity 1s ease-in; }
.ck-scene.dark .ck-dark { opacity: .66; }
.ck-scene.dark .ck-night { opacity: 1; }
.ck-scene:not(.dark) .ck-dark { transition-duration: .35s; }
.ck-scene:not(.dark) .ck-night { transition-duration: .35s; }
.ck-dots { transform-box: fill-box; transform-origin: 50% 50%; animation: ck-spin 16s linear infinite; }
@keyframes ck-spin { to { transform: rotate(360deg); } }

/* candles */
.ck-cakeglow { opacity: .6; animation: ck-glowin .9s ease-out; transition: opacity .4s; }
.ck-cakeglow.out { opacity: 0; }
@keyframes ck-glowin { from { opacity: 0; } }
.ck-flick { transform-box: fill-box; transform-origin: 50% 100%; animation: ck-flick .34s ease-in-out infinite alternate; }
@keyframes ck-flick { from { transform: scale(.94, 1.06) rotate(-3deg); } to { transform: scale(1.05, .95) rotate(3deg); } }
.ck-flame { animation: ck-lit .3s cubic-bezier(.2, 1.7, .4, 1); }
@keyframes ck-lit { from { opacity: 0; } }
.ck-lean { transform-box: fill-box; transform-origin: 50% 100%; transform: skewX(var(--lean, 0deg)); transition: transform .18s ease-out; }
.ck-fizz { transform-box: fill-box; transform-origin: 50% 50%; animation: ck-fizz .22s linear infinite alternate; }
@keyframes ck-fizz { from { transform: scale(.82) rotate(0); } to { transform: scale(1.12) rotate(18deg); } }
.ck-flame.out { opacity: 0; transition: opacity .12s; }

/* everyone sings, then cheers */
.ck-scene.sing .ck-walk { animation: ck-sway 1s ease-in-out infinite alternate; }
.ck-scene.sing .ck-seat:nth-child(even) .ck-walk { animation-direction: alternate-reverse; }
@keyframes ck-sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
.ck-scene.cheer .ck-walk { animation: ck-hooray .46s ease-out 5 alternate; }
.ck-scene.cheer .ck-seat:nth-child(even) .ck-walk { animation-delay: .12s; }
@keyframes ck-hooray { from { transform: none; } to { transform: translateY(-34px) scale(1.03, .98); } }

.game.cake .ck-lyric {
  position: absolute; z-index: 5; top: 12px; left: 50%; transform: translateX(-50%) translateY(-12px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  width: max-content; max-width: 94%; padding: 6px 18px; text-align: center; background: #fffdf4; border: 4px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow);
  font-size: clamp(20px, 2.7vw, 38px); font-weight: 800; line-height: 1.15; color: #b6a8c6;
}
.game.cake .ck-lyric.show { opacity: 1; transform: translateX(-50%); }
.game.cake .ck-lyric span { display: inline-block; margin: 0 .1em; transition: color .1s, transform .1s; }
.game.cake .ck-lyric .sung { color: var(--ink); }
.game.cake .ck-lyric .on { color: #e8359b; transform: scale(1.06) translateY(-2px); }

.game.cake .ck-wish {
  position: absolute; z-index: 5; bottom: 12px; left: 50%; transform: translateX(-50%) scale(.5); opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s cubic-bezier(.2, 1.6, .4, 1);
  width: max-content; max-width: 94%; padding: 6px 20px; text-align: center; background: #fff7cc; border: 4px solid var(--ink); border-radius: 18px; box-shadow: 0 0 0 5px #ffd23f, var(--shadow);
}
.game.cake .ck-wish.show { opacity: 1; transform: translateX(-50%); animation: ck-wishpulse 1.4s ease-in-out infinite alternate; }
@keyframes ck-wishpulse { from { box-shadow: 0 0 0 4px #ffd23f, var(--shadow); } to { box-shadow: 0 0 0 10px #ffd23f, var(--shadow); } }
.game.cake .ck-wish small { font-size: clamp(14px, 1.5vw, 20px); font-weight: 700; color: var(--ink-soft); }
.game.cake .ck-wish b { font-size: clamp(24px, 3vw, 42px); font-weight: 800; color: #c4359a; letter-spacing: 1px; white-space: pre; }
.game.cake .ck-wish b i { font-style: normal; color: var(--ink); background: #ffe27a; border-radius: 6px; }

/* the camera flash */
.game.cake .ck-flash { position: absolute; inset: 0; z-index: 6; background: #fff; opacity: 0; pointer-events: none; }
.game.cake .ck-flash.go { animation: sc-flash .5s ease-out; }
@keyframes sc-flash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }

/* the photo on the results card, and the album */
.ck-photo svg { width: 248px; height: 155px; background: none; }
.ck-album-modal .ck-album { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; max-height: 62vh; overflow: auto; padding: 10px; }
.ck-album .ck-photo { padding-bottom: 8px; }
.ck-album .ck-photo:nth-child(2n) { transform: rotate(2deg); }

@media (prefers-reduced-motion: reduce) {
  .ck-bob, .ck-swing, .ck-jiggle, .ck-dots, .ck-bub { animation: none; }
}
