/* Isolated Chapter 18 scene; no shared Chapter 17 selectors. */
[data-cake="pending"] .chapter-heading,[data-cake="pending"] .reading-room,[data-cake="pending"] .colophon { visibility:hidden; }
[data-cake="active"] > .chapter-heading,[data-cake="active"] > .reading-room,[data-cake="active"] > .colophon { display:none; }
.birthday-cake { position:relative; width:min(860px,100%); display:flex; flex-direction:column; align-items:center; padding:8px 20px 0; isolation:isolate; }
.cake-heading { text-align:center; position:relative; z-index:2; pointer-events:none; }
.cake-heading .eyebrow { color:#c4a577; font-size:9px; margin:0 0 12px; letter-spacing:.29em; }
.cake-heading h1 { font-size:clamp(35px,4.8vw,59px); line-height:1.2; font-weight:400; letter-spacing:-.035em; color:#fff0da; margin:0; text-shadow:0 2px 34px #c9938e20; }
.cake-heading h1 em { color:#e3bdc1; font-weight:400; }
.cake-heading > p:last-child { color:#b9a2a8; font:italic 13px/1.6 Keepsake,Georgia,serif; margin:13px 0 0; }
.cake-display { position:relative; width:min(100%,660px); height:clamp(290px,48dvh,460px); margin-top:0; }
.cake-halo { position:absolute; inset:0 -15%; background:radial-gradient(ellipse at 50% 55%,#e8a3931e,transparent 55%); pointer-events:none; z-index:-1; transition:opacity 1.5s; }
.cake-display::before,.cake-display::after { content:''; position:absolute; z-index:1; pointer-events:none; left:50%; bottom:4%; width:43%; height:14%; border:1px solid #e5c18c; border-radius:50%; opacity:0; transform:translateX(-50%) scale(.7); }
[data-cake="active"] .cake-heading .eyebrow { animation:cake-copy-in .8s cubic-bezier(.2,.7,.2,1) .12s backwards; }
[data-cake="active"] .cake-heading h1 { animation:cake-copy-in 1s cubic-bezier(.2,.7,.2,1) .28s backwards; }
[data-cake="active"] .cake-heading > p:last-child { animation:cake-copy-in .9s ease-out .55s backwards; }
[data-cake="active"] .cake-turn-hint { animation:cake-copy-in .8s ease-out 1.6s backwards; }
[data-cake="active"] .cake-controls { animation:cake-controls-in .8s ease-out 1.8s backwards; }
[data-cake="active"] .cake-headphones { animation:cake-copy-in .9s ease-out 2s backwards; }
[data-phase="wishing"] .cake-halo { animation:cake-light-breathe 6s ease-in-out infinite; }
[data-phase="blowing"] .cake-halo { animation:cake-wish-glow 2.5s ease-out both; }
[data-phase="blowing"] .cake-display::before { animation:cake-wish-ripple 2.3s cubic-bezier(.2,.6,.2,1) .12s backwards; }
[data-phase="blowing"] .cake-display::after { animation:cake-wish-ripple 2.3s cubic-bezier(.2,.6,.2,1) .38s backwards; }
[data-phase="blowing"] .cake-status { animation:cake-copy-in .45s ease-out backwards; }
[data-phase="wished"] .cake-status { animation:cake-wish-copy .7s ease-out backwards; }
[data-phase="wished"] #cake-continue { animation:cake-wish-copy .7s ease-out backwards; }
[data-motion-paused="true"],[data-motion-paused="true"] *,[data-motion-paused="true"] *::before,[data-motion-paused="true"] *::after { animation-play-state:paused !important; }
#birthday-cake-canvas { display:block; width:100%; height:100%; touch-action:pan-y; cursor:grab; -webkit-tap-highlight-color:transparent; }
#birthday-cake-canvas:active { cursor:grabbing; }
.cake-fallback { position:absolute; inset:0; margin:auto; width:100%; height:100%; pointer-events:none; }
[data-webgl="ready"] .cake-fallback { display:none; }
[data-webgl="unavailable"] #birthday-cake-canvas { visibility:hidden; }
[data-webgl="unavailable"] .cake-turn-hint { visibility:hidden; }
.cake-turn-hint { color:#9b818e; font:10px/1.4 Georgia,serif; letter-spacing:.07em; text-align:center; margin:-10px 0 0; min-height:14px; opacity:.8; transition:opacity .5s; }
[data-phase="blowing"] .cake-turn-hint,[data-phase="wished"] .cake-turn-hint { opacity:0; }
.birthday-cake[data-phase="blowing"] .cake-turn-hint,.birthday-cake[data-phase="wished"] .cake-turn-hint { animation:none; }
.cake-controls { min-height:92px; width:100%; display:flex; flex-direction:column; align-items:center; text-align:center; position:relative; z-index:3; }
.cake-status { font:italic 14px/1.6 Keepsake,Georgia,serif; color:#d7b9b7; margin:15px 0 16px; min-height:23px; }
.cake-button { color:#f3dfc0; border:1px solid #bd9f6d82; border-radius:30px; background:linear-gradient(120deg,#e5b78a10,#bf879316); box-shadow:inset 0 1px 0 #fff1db0c,0 6px 28px #00000018; font:10px/1.4 Georgia,serif; letter-spacing:.14em; text-transform:uppercase; padding:15px 25px; min-height:46px; transition:background .25s,border-color .25s,transform .25s,box-shadow .25s; }
.cake-button span { display:inline-block; margin-left:15px; font-size:14px; line-height:1; }
.cake-button:not(:disabled):hover { border-color:#e6c493; background:#e0b99b14; transform:translateY(-2px); box-shadow:0 7px 28px #c58a8e10; }
.cake-button:disabled { opacity:.45; }
.cake-headphones { font:9px/1.4 Georgia,serif; color:#9d828e; letter-spacing:.06em; margin:22px 0 0; }
.fallback-flames { transform-origin:center; animation:cake-fallback-flicker 1.5s ease-in-out infinite alternate; }
[data-phase="blowing"] .fallback-flames,[data-phase="wished"] .fallback-flames { opacity:0; transition:opacity .4s; }
[data-phase="wished"] .cake-halo { opacity:.45; }
@keyframes cake-fallback-flicker { from { opacity:.8; transform:scaleY(.95); } to { opacity:1; transform:scaleY(1.04); } }
@keyframes cake-copy-in { from { opacity:0; transform:translateY(9px); } to { opacity:1; transform:none; } }
@keyframes cake-controls-in { from { opacity:0; transform:translateY(7px); visibility:hidden; } to { opacity:1; transform:none; visibility:visible; } }
@keyframes cake-wish-copy { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:none; } }
@keyframes cake-light-breathe { 0%,100% { opacity:.64; transform:scale(.94); } 50% { opacity:1; transform:scale(1.07); } }
@keyframes cake-wish-glow { 0% { opacity:.8; transform:scale(1); } 30% { opacity:1; transform:scale(1.25); } 100% { opacity:.45; transform:scale(1.1); } }
@keyframes cake-wish-ripple { 0% { opacity:0; transform:translateX(-50%) scale(.7); } 16% { opacity:.34; } 100% { opacity:0; transform:translateX(-50%) scale(2.25); } }
@media (max-width:700px) {
 [data-cake="active"]#keepsake { justify-content:center; padding:55px 0 28px; }
 .birthday-cake { padding:0 12px; }
 .cake-heading h1 { font-size:clamp(33px,8.6vw,49px); }
 .cake-heading .eyebrow { font-size:8px; margin-bottom:12px; }
 .cake-display { width:100%; height:min(44dvh,380px); min-height:260px; }
 .cake-status { font-size:13px; margin-top:16px; }
 .cake-headphones { margin-top:22px; }
}
@media (max-height:650px) {
 [data-cake="active"]#keepsake { justify-content:flex-start; padding-top:36px; }
 .cake-heading .eyebrow { margin-bottom:6px; font-size:8px; }
 .cake-heading h1 { font-size:32px; }
 .cake-heading > p:last-child { margin-top:7px; font-size:11px; }
 .cake-display { height:260px; min-height:220px; }
 .cake-status { margin:8px 0 11px; font-size:12px; }
 .cake-headphones { margin-top:15px; }
 .cake-button { padding:12px 21px; min-height:42px; }
}
@media (prefers-reduced-motion:reduce) {
 .birthday-cake,.birthday-cake *,.birthday-cake *::before,.birthday-cake *::after { animation:none !important; transition:none !important; }
 .cake-button:not(:disabled):hover { transform:none; }
}
