.solar-finale{--sf-peach:#ffb481;--sf-lilac:#c5b8ff;position:relative;padding:24px 28px 22px;overflow:hidden;border:1.5px solid #485476;border-radius:23px;background:#101a32;color:#fff9ed;isolation:isolate}
.sf-modes{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin:18px auto 0;padding:0;border:0}.sf-modes legend{width:100%;margin:0 0 8px;text-align:center;color:#ddd5e9;font-size:11px;font-weight:700}.sf-modes label{display:flex;align-items:center;gap:7px;min-height:44px;padding:9px 12px;box-sizing:border-box;border:1px solid #b9afca66;border-radius:12px;background:#ffffff07;color:#ece6f7;font-size:12px;line-height:1.5;cursor:pointer}.sf-modes label:has(input:checked){border-color:#efd899;background:#d9ba8b22}.sf-modes input{width:16px;height:16px;margin:0;accent-color:#e6d49a}.sf-mode-note{min-height:2.8em;max-width:560px;margin:10px auto 0;text-align:center;color:#c8bedb;font-size:11px;line-height:1.6}
.solar-finale[hidden]{display:none!important}.solar-finale::before{content:"";position:absolute;inset:0;z-index:-1;background:radial-gradient(ellipse at 10% 0%,#54365966,transparent 55%),radial-gradient(ellipse at 100% 60%,#1f69984d,transparent 60%);pointer-events:none}
.sf-heading{text-align:center;max-width:650px;margin:auto}.sf-secret{display:inline-block;padding:6px 11px;background:#e1eea2;color:#172b43;border-radius:7px;font-size:10px;font-weight:800;letter-spacing:.08em;transform:rotate(-2deg)}.sg-dialog .sf-heading h2{margin:15px 0 9px;color:#fff9ed;font-size:clamp(25px,5vw,39px);line-height:1.3;letter-spacing:-.04em}.sf-boundary{max-width:560px;margin:0 auto;color:#ddd6e7;font-size:13px;line-height:1.8}
.sf-progress{display:flex;gap:8px;justify-content:center;list-style:none;margin:20px auto 4px;padding:0}.sf-progress li{display:flex;align-items:center;gap:8px;color:#b9b3ce}.sf-progress li+li::before{content:"";height:1px;width:28px;background:#6a6481}.sf-progress span{display:grid;place-items:center;width:28px;height:28px;border:1px solid #9991ae;border-radius:50%;font:800 11px/1 system-ui,sans-serif}.sf-progress [aria-current=step] span{background:var(--sf-peach);border-color:var(--sf-peach);color:#172b43;box-shadow:0 0 0 5px #ffb48118}.sf-progress .sf-complete span{background:#c6b8ed;color:#172b43;border-color:#c6b8ed}
/* Stars remain stellar-sized after the hypothetical merger; this is not a white-dwarf sequence. */
.sf-scene{position:relative;width:min(100%,560px);height:245px;margin:0 auto;overflow:hidden;border-radius:50%;contain:paint;isolation:isolate}
.sf-core,.sf-companion,.sf-halo,.sf-shell{position:absolute;top:50%;border-radius:50%;pointer-events:none}
.sf-core,.sf-companion{left:31%;width:94px;height:94px;transform:translate(-50%,-50%);background:radial-gradient(circle at 35% 28%,#fff1af 0%,#ffd473 40%,#ee9453 75%,#d56c42 100%);box-shadow:0 0 22px #ffba6677,inset -7px -10px 15px #b65b3566;z-index:3;transition:left 1.1s ease,top 1.1s ease,width 1.1s ease,height 1.1s ease,opacity 1s,transform 1.1s ease,box-shadow 1s}
.sf-companion{left:69%;background:radial-gradient(circle at 35% 28%,#fff0ba,#ffb87b 43%,#e7845b 77%,#bd594e);box-shadow:0 0 22px #e99e8d66,inset -7px -10px 15px #98444d55}
.sf-core::after,.sf-companion::after{content:"";position:absolute;inset:14%;border:1px solid #fff1d138;border-radius:46% 54% 43% 57%;transform:rotate(-24deg)}
.sf-halo{left:50%;width:230px;height:220px;transform:translate(-50%,-50%);background:radial-gradient(ellipse,#ffe2a000 25%,#ffc28a33 46%,#ffcc7d17 57%,transparent 72%);opacity:.2;transition:opacity 1s,transform 1.2s}
/* Center each ring before rotating and expanding it. */
.sf-shell{--sf-shell-angle:0deg;left:50%;width:180px;height:130px;border:10px solid #ffc28b66;opacity:0;transform:translate(-50%,-50%) rotate(var(--sf-shell-angle)) scale(.45);filter:blur(5px);transition:transform 1.4s ease,opacity 1s;transform-origin:center;z-index:2}.sf-shell-b{width:220px;height:160px;border-color:#d6b6ff4d}.sf-shell-c{width:250px;height:185px;border-color:#efb58e44}
.solar-finale[data-mode=angled][data-stage="0"] .sf-core{top:35%}.solar-finale[data-mode=angled][data-stage="0"] .sf-companion{top:65%}
.solar-finale[data-stage="1"] .sf-core{left:43%;width:112px;height:104px}.solar-finale[data-stage="1"] .sf-companion{left:57%;width:112px;height:104px}.solar-finale[data-stage="1"] .sf-shell{opacity:.8;transform:translate(-50%,-50%) rotate(var(--sf-shell-angle)) scale(1.3)}.solar-finale[data-stage="1"] .sf-halo{opacity:.85;transform:translate(-50%,-50%) scale(1.25)}
.solar-finale[data-mode=angled][data-stage="1"] .sf-core{top:43%;transform:translate(-50%,-50%) rotate(28deg)}.solar-finale[data-mode=angled][data-stage="1"] .sf-companion{top:57%;transform:translate(-50%,-50%) rotate(28deg)}.solar-finale[data-mode=angled] .sf-shell{--sf-shell-angle:28deg}.solar-finale[data-mode=angled] .sf-shell-b{--sf-shell-angle:-20deg}
.solar-finale[data-stage="2"] .sf-core{left:50%;top:50%;width:145px;height:145px;box-shadow:0 0 26px #ffdc95a8,0 0 60px #f2b57938;transform:translate(-50%,-50%)}.solar-finale[data-stage="2"] .sf-companion{left:50%;top:50%;opacity:0;width:145px;height:145px}.solar-finale[data-stage="2"] .sf-shell{opacity:.25;transform:translate(-50%,-50%) rotate(var(--sf-shell-angle)) scale(1.6)}.solar-finale[data-stage="2"] .sf-halo{opacity:.6;transform:translate(-50%,-50%) scale(1.4)}
.sf-scene-label{position:absolute;bottom:8px;left:50%;transform:translateX(-50%);font:800 11px/1 system-ui,sans-serif;letter-spacing:.22em;color:#ddd7ec}.sf-stars i{position:absolute;width:3px;height:3px;background:#d6d5ed;border-radius:50%;opacity:.7}.sf-stars i:nth-child(1){left:14%;top:22%}.sf-stars i:nth-child(2){left:26%;top:62%;width:2px;height:2px}.sf-stars i:nth-child(3){left:76%;top:22%;width:4px;height:4px}.sf-stars i:nth-child(4){left:85%;top:66%}.sf-stars i:nth-child(5){left:40%;top:9%;width:2px;height:2px}.sf-stars i:nth-child(6){left:68%;top:84%;width:2px;height:2px}.sf-stars i:nth-child(7){left:10%;top:48%;width:2px;height:2px}.sf-stars i:nth-child(8){left:91%;top:36%;width:2px;height:2px}
.sf-copy{max-width:570px;margin:0 auto;text-align:center}.sf-era{margin:4px 0 9px;color:#d9c99f;font-size:10px;font-weight:800;letter-spacing:.07em}.sg-dialog .sf-copy h3{margin:0 0 12px;color:#fff9ed;font-size:clamp(20px,4vw,28px);line-height:1.5}.sf-story{margin:0;color:#e5e3ed;font-size:14px;line-height:1.9}.sf-fact{display:inline-block;margin:16px 0 0;padding:8px 12px;border:1px solid #b7a6d94a;border-radius:9px;background:#b6a4ed16;color:#eee5ff;font-size:12px;line-height:1.7}.sf-model{margin:15px 0 18px;text-align:center;font-size:10px;color:#b8b8cc;line-height:1.6}
.sf-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;max-width:570px;margin:auto}.sg-dialog .sf-next,.sg-dialog .sf-replay,.sg-dialog .sf-exit{min-height:48px;border-radius:999px;font-size:13px;font-weight:800;padding:12px 22px;line-height:1.5;cursor:pointer;touch-action:manipulation}.sg-dialog .sf-next{flex:1 1 230px;border:1px solid #ead99c;background:#e3eea8;color:#172b43;box-shadow:0 4px 0 #526342}.sg-dialog .sf-replay,.sg-dialog .sf-exit{border:1px solid #aaa4c05c;background:#ffffff09;color:#e5ddef}.sg-dialog .sf-guide{display:block;width:fit-content;max-width:100%;min-height:44px;margin:14px auto 0;padding:11px 4px;box-sizing:border-box;color:#d7c4ff;font-size:12px;font-weight:700;line-height:1.7;text-align:center;text-decoration:underline;text-underline-offset:4px}.sf-return-note{margin:3px auto 0;max-width:560px;text-align:center;color:#afbbcd;font-size:10px;line-height:1.8}.solar-finale :focus-visible{outline:3px solid #dfc9ff!important;outline-offset:4px}.sf-heading h2:focus{outline:none}
html[data-motion=on] .solar-finale[data-stage="0"] .sf-core,html[data-motion=on] .solar-finale[data-stage="0"] .sf-companion{animation:sf-arrive .7s ease-out both}@keyframes sf-arrive{from{opacity:.2}to{opacity:1}}
@media(hover:hover) and (pointer:fine){.sg-dialog .sf-next:hover{background:#eef7c5}.sg-dialog .sf-replay:hover,.sg-dialog .sf-exit:hover{background:#ffffff15}}.sg-dialog .sf-next:active{transform:translateY(2px);box-shadow:0 2px 0 #526342}
html[data-motion=off] .solar-finale *,html[data-page-hidden=true] .solar-finale *,.solar-finale.sf-asleep *{animation:none!important;transition:none!important}
@media(max-width:600px){.solar-finale{padding:22px 15px 18px;border-radius:18px}.sf-scene{height:212px}.sf-boundary{font-size:12px}.sf-story{font-size:14px}.sf-actions{gap:8px}.sg-dialog .sf-next{flex-basis:100%}.sg-dialog .sf-exit,.sg-dialog .sf-replay{padding:10px 16px}.sf-shell{max-width:70%}.sf-return-note{font-size:10px}}
@media(prefers-reduced-motion:reduce){.solar-finale *{animation:none!important;transition:none!important}}
/* Keep the original positions, stage timing, and fallback lighting under the Blender texture. */
.sf-core::after,.sf-companion::after{inset:-4%;border:0;border-radius:0;transform:none;background:url("/assets/game-3d/sun.webp") center/100% 100% no-repeat;pointer-events:none}
.sf-companion::after{filter:hue-rotate(-13deg) saturate(1.12)}
/* Rendered gas spreads behind the stars, following the selected encounter angle. */
.sf-scene::before{
  content:"";position:absolute;z-index:2;left:50%;top:50%;width:94%;max-width:450px;aspect-ratio:720/440;
  background:url("/assets/game-3d/sun-outflow.webp") center/contain no-repeat;opacity:0;pointer-events:none;
  transform:translate(-50%,-50%) rotate(var(--sf-wake-angle,0deg)) scale(.46);
  transition:opacity .7s ease-out,transform 1.35s cubic-bezier(.16,1,.3,1)
}
.solar-finale[data-mode=angled]{--sf-wake-angle:28deg}
.solar-finale[data-stage="1"] .sf-scene::before{opacity:.94;transform:translate(-50%,-50%) rotate(var(--sf-wake-angle,0deg)) scale(1)}
.solar-finale[data-stage="2"] .sf-scene::before{opacity:.48;transform:translate(-50%,-50%) rotate(var(--sf-wake-angle,0deg)) scale(1.18)}
.sf-scene-label{z-index:4}
html[data-motion=off] .solar-finale .sf-scene::before,
html[data-page-hidden=true] .solar-finale .sf-scene::before,
.solar-finale.sf-asleep .sf-scene::before,
.sg-dialog[data-reduced=true] .solar-finale .sf-scene::before{transition:none}
@media(prefers-reduced-motion:reduce){.solar-finale .sf-scene::before{transition:none}}
