#result-dialog{max-width:1000px!important;width:min(1000px,calc(100vw - 24px))!important;background:radial-gradient(ellipse at 50% 10%,#fff3c8,#fdf8f3 48%,#eae1f5)!important}
.ceremony{position:relative;isolation:isolate;overflow:hidden;padding:8px 0 0;container-type:inline-size}
/* Every actor shares one world projection, including host and caregiver. */
.ceremony-floor{--world-unit:min(1.8px,.28cqw);position:relative;display:grid;grid-template-columns:1.1fr 3.3fr 1.1fr;align-items:end;padding:0 4px 12px;background:radial-gradient(ellipse at 50% 96%,#b7a3ca55,transparent 60%)}
.ceremony .podium-grid{gap:6px;margin:0;align-items:end;position:relative;z-index:2;grid-column:2;grid-row:1;min-width:0}
.ceremony .podium-place{gap:0;min-width:0}
.ceremony-character-space{height:calc(110 * var(--world-unit));width:100%;position:relative;display:flex;align-items:end;justify-content:center}
.ceremony-actor{width:calc(var(--pose-width) * var(--world-unit));height:calc(var(--pose-height) * var(--world-unit));flex:none;max-width:none;filter:drop-shadow(0 3px 2px #57376718)}
.ceremony-actor svg{width:100%;height:100%;display:block;overflow:hidden}
.ceremony-stand{width:100%;min-height:58px;border-radius:10px 10px 3px 3px;background:linear-gradient(110deg,#fff7,var(--medal));border-bottom:5px solid #54397430;box-shadow:0 7px 12px #5737671c;padding:6px 2px}
.ceremony .place-1 .ceremony-stand{min-height:96px}.ceremony .place-2 .ceremony-stand{min-height:76px}
.ceremony .podium-number{height:auto!important;min-height:0!important;background:none;border:0;margin:0;padding:0;box-shadow:none;font-size:29px;line-height:1}
.ceremony .podium-place h3{font-size:clamp(11px,2.8vw,19px);line-height:1.1;margin:4px 0!important;overflow-wrap:anywhere}
.ceremony .podium-identity{display:inline-block;margin-top:5px;font-size:9px;padding:3px 8px}
.ceremony-host,.ceremony-mother{position:relative;display:flex;align-items:end;justify-content:center;z-index:3;min-width:0}
.ceremony-host{grid-column:3;grid-row:1}.ceremony-mother{grid-column:1;grid-row:1}
.ceremony-cup{position:absolute;bottom:108px;left:calc(50% + 20px);width:32px;height:32px;z-index:4;opacity:0;transition:opacity .15s,transform .65s;transform:translate(100px,35px);background:url('celebration/props.webp') left center / 200% 100% no-repeat}
.ceremony-cup>svg,.ceremony-drinks>svg{display:none}
.ceremony[data-phase="cheer"] .ceremony-cup,.ceremony[data-phase="kiss"] .ceremony-cup,.ceremony[data-phase="rest"] .ceremony-cup{opacity:1;transform:none}
.ceremony-drinks{display:flex;justify-content:center;align-items:center;gap:8px;color:#755a7c;font-size:11px}
.ceremony-drinks:before{content:'';display:block;width:48px;height:48px;background:url('celebration/props.webp') right center / 200% 100% no-repeat}
.ceremony-quote{font-size:clamp(14px,3.5vw,20px);line-height:1.35;color:#4d2b6b;font-weight:700;margin:10px auto!important;max-width:650px;min-height:2.7em;padding:0 8px}
.ceremony-confetti{position:absolute;inset:0;pointer-events:none;z-index:5;overflow:hidden}.ceremony-confetti i{position:absolute;left:var(--x);top:-16px;width:7px;height:12px;border-radius:2px;animation:kd-confetti 3.7s var(--delay) ease-out both;transform:rotate(var(--turn))}
@keyframes kd-confetti{0%{top:-16px;opacity:0;transform:rotate(0)}12%{opacity:1}90%{opacity:.9}100%{top:95%;opacity:0;transform:rotate(var(--turn)) translateX(16px)}}
.ceremony[data-calm="true"] .ceremony-confetti i{animation:none;top:12%;transform:rotate(var(--turn));opacity:.45}.ceremony[data-calm="true"] .ceremony-confetti i:nth-child(2n){top:85%}
.ceremony-kiss{position:absolute;left:12%;bottom:calc(65 * var(--world-unit));width:24px;height:24px;opacity:0;z-index:6;pointer-events:none}.ceremony-kiss svg{width:100%;height:100%}
.ceremony[data-phase="kiss"] .ceremony-kiss{animation:kd-kiss 1.7s ease-out forwards}
@keyframes kd-kiss{15%{opacity:1}80%{opacity:1}100%{opacity:0;transform:translate(100px,-50px) scale(.5)}}
.ceremony[data-calm="true"] .ceremony-cup{transition:none}
@media(max-width:600px){.ceremony .podium-grid{gap:3px}.ceremony .podium-number{font-size:24px}.ceremony .podium-place h3{font-size:11px}.ceremony .podium-identity{font-size:8px;padding:3px}.ceremony-cup{width:24px;height:24px;bottom:106px;left:calc(50% + 5px)}.ceremony-drinks{font-size:10px}}
@media(max-height:540px) and (min-width:600px){#result-dialog[open]{grid-template-columns:1.6fr 1fr}#result-dialog #podium-stage{grid-row:4 / 9}.ceremony .place-1 .ceremony-stand{min-height:66px}.ceremony .place-2 .ceremony-stand{min-height:54px}.ceremony .ceremony-stand{min-height:44px}.ceremony .podium-number{font-size:21px!important}.ceremony .podium-place h3{font-size:11px!important}.ceremony .podium-identity{font-size:7px;padding:2px 5px}.ceremony-cup{bottom:76px;width:22px;height:22px}.ceremony-drinks{display:none}.ceremony-quote{font-size:13px;margin:5px 0!important}}
@media(prefers-reduced-motion:reduce){.ceremony *{animation:none!important;transition:none!important}}
.ceremony[aria-busy="true"] .ceremony-confetti i{animation-play-state:paused}
.ceremony[data-paused="true"] *{animation-play-state:paused!important}
.ceremony-asset-notice{font-size:14px;line-height:1.4;margin:8px auto;max-width:42em}
.ceremony-controls{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:10px auto;max-width:520px}
.ceremony-controls button{width:auto;flex:1 1 180px;min-height:44px;margin:0!important;border-radius:16px;background:#e9ddf4;color:#4d2b6b;border:1px solid #bda7d1;padding:10px 16px;font-size:13px;font-weight:700;line-height:1.25;font-family:inherit;cursor:pointer}
.ceremony-controls button:hover{background:#decaee}.ceremony-controls button:focus-visible{outline:3px solid #643b88;outline-offset:3px}.ceremony-controls button[hidden]{display:none!important}
/* Short screens keep the ceremony and the next action beside each other. */
@media(max-height:540px) and (min-width:600px){
 #result-dialog[open]{grid-template-columns:minmax(0,1.6fr) minmax(210px,1fr);row-gap:3px;align-items:center}
 #result-dialog[open] #result-title{grid-row:1;font-size:24px;margin:0}
 #result-dialog[open] #result-text{grid-row:2}
 #result-dialog[open] #podium-stage{grid-row:3 / 8;align-self:start}
 #result-dialog[open] .result-stats{grid-row:3}
 #result-dialog[open] #next{grid-row:4}
 #result-dialog[open] #retry{grid-row:5}
 #result-dialog[open] #result-menu{grid-row:6}
 #result-dialog[open] #result-friend{grid-column:2;grid-row:7;font-size:11px}
 #result-dialog .ceremony-floor{--world-unit:min(.78px,.24cqw);padding-bottom:8px}
 #result-dialog .ceremony-character-space{height:calc(105 * var(--world-unit))}
 #result-dialog .place-1 .ceremony-stand{min-height:60px}
 #result-dialog .place-2 .ceremony-stand{min-height:50px}
 #result-dialog .ceremony-quote{font-size:12px;line-height:1.25;min-height:0;margin:4px 0!important}
 #result-dialog .ceremony .podium-own{padding:4px;margin:4px 0;font-size:11px}
 #result-dialog .ceremony-controls{margin:4px auto;gap:4px}
 #result-dialog .ceremony-controls button{font-size:11px;flex-basis:130px;padding:6px;min-height:44px}
 #result-dialog .ceremony-cup{bottom:68px;width:20px;height:20px}
}
/* The player's badge must not make third place taller than first place. */
.ceremony .ceremony-stand{box-sizing:border-box;height:94px;min-height:0!important}
.ceremony .place-2 .ceremony-stand{height:114px}
.ceremony .place-1 .ceremony-stand{height:134px}
@media(max-width:600px){.ceremony .ceremony-stand{height:76px}.ceremony .place-2 .ceremony-stand{height:94px}.ceremony .place-1 .ceremony-stand{height:112px}.ceremony-cup{bottom:122px}}
@media(max-height:540px) and (min-width:600px){
 .ceremony .ceremony-stand{height:62px;padding:4px 2px}.ceremony .place-2 .ceremony-stand{height:78px}.ceremony .place-1 .ceremony-stand{height:94px}
 #result-dialog .ceremony .podium-place h3{margin:2px 0!important}.ceremony .podium-identity{margin-top:0;padding:1px 3px}
 #result-dialog .ceremony-cup{bottom:102px}
}
@media(min-height:541px) and (min-width:601px){.ceremony-cup{bottom:145px}}
.ceremony-floor.has-ceremony-world{display:block;padding:0 0 6px}
.ceremony-world{position:relative;width:100%;aspect-ratio:600 / 220;isolation:isolate}
.ceremony-scenery{position:absolute;inset:0;z-index:0}
.ceremony-scenery svg{width:100%;height:100%;display:block}
.ceremony-world .ceremony-world-actor{position:absolute;max-width:none;filter:none}
.ceremony-world-actor svg{overflow:visible}
.ceremony-world-helmet,.ceremony-world-cup{position:absolute;pointer-events:none}
.ceremony-world-helmet svg,.ceremony-world-cup svg{display:block;width:100%;height:100%;overflow:hidden}
.ceremony-world-cup{z-index:3}
.ceremony-affection{position:absolute;z-index:4;pointer-events:none;opacity:0}
.ceremony-affection svg{display:block;width:100%;height:100%;overflow:visible}
.ceremony .ceremony-world-labels{display:grid;grid-template-columns:1fr 1fr 1fr;gap:4px;list-style:none;padding:0 9%;margin:0;min-height:38px}
.ceremony-world-labels .podium-place{display:flex;flex-direction:column;align-items:center;justify-content:start;box-shadow:none;background:none;border:0;padding:0;min-width:0}
.ceremony-world-labels .place-2{grid-column:1;grid-row:1}.ceremony-world-labels .place-1{grid-column:2;grid-row:1}.ceremony-world-labels .place-3{grid-column:3;grid-row:1}
.ceremony-world-labels .podium-place h3{font-size:clamp(11px,2cqw,16px)!important;margin:0!important}
.ceremony-world-labels .podium-identity{margin-top:2px}
.ceremony .has-ceremony-world .ceremony-kiss{left:7.2%;bottom:40%;width:18px;height:18px}

/* Confetti follows the welcome/award sequence; pause still wins. */
.ceremony[data-phase="welcome"] .ceremony-confetti i{animation-play-state:paused}

/* Laid-down helmets belong behind the walking racers, never over faces. */
.ceremony-world-helmet{z-index:1}
.ceremony-world .ceremony-world-actor{z-index:2}
