/* K4 effects are decorative: no layout space, input interception or geometry changes. */
.k4-lock-note{padding:12px;color:#d8c6ab}
.k4-match-effects{position:absolute;inset:0;overflow:hidden;pointer-events:none!important;z-index:3;border-radius:inherit}
.k4-match-effects *,#k4Flames{pointer-events:none!important}
.k4-table-wave,.k4-phone-wave{position:absolute;width:35px;height:35px;border:3px double #d7a0ee;border-radius:50%;animation:k4-wave 1.5s ease-out forwards;transform:rotate(var(--wave-angle,0deg)) scale(.1)}
@keyframes k4-wave{to{transform:rotate(var(--wave-angle,0deg)) scale(6);opacity:0}}
.k4-rain{position:absolute;width:2px;height:28px;background:linear-gradient(transparent,#c7dcff);animation:k4-rain .7s linear infinite}
@keyframes k4-rain{0%{transform:translateY(-30px);opacity:0}35%{opacity:.8}85%{transform:translateY(70px) scaleY(.3);opacity:.6}100%{transform:translateY(75px) scaleX(7) scaleY(.1);opacity:0}}
#k4Flames{position:fixed;inset:0;z-index:90;opacity:0;transition:opacity .25s;overflow:hidden}
#k4Flames.surging{opacity:.65}
#k4Flames::before,#k4Flames::after{content:'';position:absolute;top:8%;bottom:8%;width:13%;background:radial-gradient(ellipse at left,#ffde73,rgba(255,90,0,.85) 38%,transparent 72%);filter:blur(8px);animation:k4-flame .55s alternate infinite}
#k4Flames::before{left:-3%}#k4Flames::after{right:-3%;transform:scaleX(-1);animation-delay:-.25s}
@keyframes k4-flame{to{width:19%;filter:blur(13px)}}
.generic-story-mode .scene-character.k4-hedgehog.scene-character-entering{scale:0}
.generic-story-mode .scene-character.k4-hedgehog{transition:scale 4.8s ease-out,opacity 1.2s}
.k4-parting{opacity:0!important;transition:opacity 2.5s}
.k4-vapour{position:absolute;left:68%;top:24%;width:7%;height:10%;border-radius:50%;filter:blur(12px);animation:k4-vapour 12s ease-out infinite;opacity:0;background:#e33cce}
.k4-vapour.cyan{background:#25d9ff;animation-delay:-6s}
@keyframes k4-vapour{15%{opacity:.35}55%{opacity:.32}to{translate:0 -100px;scale:2.5;opacity:0}}
.k4-phone-wave{animation-iteration-count:infinite;animation-duration:2s}
.table-mini-lucy{background:#302c2a;border-color:#33221c;box-shadow:inset 0 0 12px #f65b12}
.k4-reduced *{animation:none!important;opacity:.25}
@media(prefers-reduced-motion:reduce){.k4-character,.k4-vapour,.k4-phone-wave,.k4-rain,#k4Flames::before,#k4Flames::after{animation:none!important;transition:none!important}.k4-vapour,.k4-phone-wave,.k4-rain,#k4Flames{display:none!important}.k4-hedgehog.scene-character-entering{scale:1}}
.reduced-character-portrait-motion .k4-character,.reduced-character-portrait-motion .k4-vapour,.reduced-character-portrait-motion .k4-phone-wave{animation:none!important}

/* TMECI keeps the same text node and typewriter timing as other speakers. */
[data-speaker-colour='tmeci'] #blackballStoryText{color:#f2dfa5}
@supports ((background-clip:text) or (-webkit-background-clip:text)){
 [data-speaker-colour='tmeci'] #blackballStoryText{background:linear-gradient(90deg,#ffaaaa,#ffda95,#fff5a0,#a7efb1,#9edfff,#d3baff,#ffb4e4);background-clip:text;-webkit-background-clip:text;color:transparent;text-shadow:none}
}

.k4-phone-wave{margin-left:-17.5px;margin-top:-17.5px}
.k4-vapour{transform:translate(-50%,-50%)}

/* Keep the kitten at 40% of both original fit limits; enlarged TMECI fits the stage. */
.generic-story-mode img.k4-lucy{max-height:calc(var(--scene-fit-height,90%) * .4);object-fit:contain}
.generic-story-mode img.k4-tmeci{max-height:var(--scene-fit-height,90%);object-fit:contain}
