.fantasy { --ink-forest:#2d2343; background:#211832; }
.fantasy .full-world {background:#19142b;}
.fantasy .world-image {object-position:center center;}
.fantasy .scene-shade {background:linear-gradient(180deg,#17102bd9, #20153a3a 26%, transparent 54%, #160e2eb0 100%);}
.fantasy .sunbeams {display:none;}
.fantasy .rolling-mist {background:radial-gradient(ellipse at 66% 64%,#c8a3ff38,transparent 62%);}
.fantasy .world-light {background:radial-gradient(ellipse at 77% 47%,#ffe0a877,transparent 38%);}
.fantasy .portal-halo {position:absolute;inset:0;background:radial-gradient(ellipse at 78% 41%,#ffca6a32,transparent 25%);mix-blend-mode:screen;animation:arch-breath 4s ease-in-out infinite alternate;}
.fantasy [data-locks="2"] .portal-halo {opacity:1; background:radial-gradient(ellipse at 78% 41%,#ffe0a377,transparent 30%);animation:none;}
@keyframes arch-breath {from{opacity:.28}to{opacity:.9}}
.fantasy :is(.stage-brand,.stage-progress,.stage-bar .tools,.stage-location) {background:#241a39ef;border-color:#c2a9e887;}
.fantasy .stage-heading {text-shadow:0 2px 19px #160e2a;}
.fantasy .stage-heading .eyebrow,.fantasy .counter {color:#ffdb96;}
.fantasy .stage-location span {color:#eee1ff;}
.fantasy .stage-progress .counter {background:#46355e;}
.fantasy .stage-progress {width:min(100%,690px);}
.fantasy .stage-progress .tracks {grid-template-columns:repeat(22,minmax(0,1fr));}
.fantasy .stage-progress .tracks li {background:#312346;border-color:#a68ac7;color:#f6efff;}
.fantasy .stage-progress .tracks .is-lit {background:#ffd477;color:#322036;border-color:#ffedb8;}
.fantasy .stage-progress .tracks .current {background:#fff0b8;color:#3d2858;}
.fantasy .stage-progress .tracks li:nth-child(n+21) {border-radius:5px;}
.fantasy .stage-task {background:#faf7fffa;border-color:#dbcef3;}
.fantasy .stage-task .eyebrow,.fantasy .stage-task .bracelet {color:#58446e;}
.fantasy .stage-task :is(.choice,.forms div) {background:#fff;border-color:#c2b1d8;color:#322640;}
.fantasy .stage-task .choice {box-shadow:0 3px 0 #ddd3ea;}
.fantasy .stage-task .choice:hover:not(:disabled) {background:#f2ebfd;border-color:#84659f;}
.fantasy .stage-task .choice.correct,.fantasy .stage-task .forms .resolved {background:#dcf5e2;border-color:#55966e;color:#1b5537;}
.fantasy .stage-task .choice.wrong {background:#ffe8e9;border-color:#ba718a;color:#872f4a;}
.fantasy .stage-task .forms .gap {background:#fff2d5;border-color:#caa365;color:#68441f;}
.fantasy .stage-task .button {background:#eabe6c;color:#36253b;}
.fantasy .stage-task .button:hover {background:#ffe0a3;}
.fantasy .stage-task .button:disabled {background:#e6e0ed;color:#60576b;}
.fantasy .fantasy-stage {position:relative;display:flex;justify-content:flex-end;align-items:flex-end;width:min(100%,1250px);margin:auto;padding:0 3% 4px 0;}
.rune-panel {position:relative;width:min(100%,260px);padding:10px 13px;border:1px solid #e9c5858f;border-radius:15px;background:#1c1638db;box-shadow:0 8px 30px #110c29a8;color:#ffebc4;}
.rune-title {display:flex;justify-content:space-between;gap:8px;font-size:12px;}
.runes {list-style:none;display:grid;grid-template-columns:repeat(10,1fr);gap:4px;margin:7px 0;}
.runes li {display:grid;place-items:center;aspect-ratio:1;border:1px solid #aa91ca65;border-radius:5px;font-size:15px;color:#a894b8;background:#372b4e;}
.runes .is-lit {background:#785027;border-color:#ffcf76;color:#fff4bd;text-shadow:0 0 7px #ffe6a0;box-shadow:0 0 7px #ffd77b6e;}
.runes .new-light {animation:rune-ignite .52s ease-out both;}
@keyframes rune-ignite {0%{transform:scale(1.3);background:#fff1b4;box-shadow:0 0 24px #ffde8f;color:#533512}100%{transform:scale(1)}}
.rune-panel .quiet {min-height:29px;padding:3px 9px;font-size:11px;background:#38294d;border-color:#bfa0e77a;}
.rune-panel.reaction {animation:rune-respond .52s ease-out;}
@keyframes rune-respond {50%{box-shadow:0 0 30px #ffe4a477;}}
.lock-panel {display:flex;gap:6px;justify-content:space-between;flex-wrap:wrap;font-size:11px;margin:7px 0;}
.lock-panel span {padding:3px 5px;border:1px solid #ab92cb75;border-radius:5px;color:#dac7f2;}
.lock-panel .open-lock {color:#b0ffd1;border-color:#68c799;background:#23473a;}
#key-awakening {font-size:12px;font-weight:700;color:#ffe6ad;margin:6px 0;}
#key-awakening i {display:inline-block;width:11px;height:11px;border-radius:3px;background:#78e2a6;border:1px solid #d4ffe5;box-shadow:0 0 11px #56d98d;transform:rotate(45deg);margin:0 6px 0 2px;}
#key-awakening.key-new {animation:key-awaken 1.5s ease-out both;}
@keyframes key-awaken {0%{opacity:.15;transform:scale(.85)}40%{opacity:1;transform:scale(1.08)}100%{transform:none}}
/* Distinct collected colours in the finale: amber, cyan, lavender, emerald. */
.fantasy-finale {background:#19122c;overflow:auto;}
.fantasy-finale[open] {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(9px,2vh,20px);padding:clamp(12px,3vw,30px);}
.home-backdrop {position:absolute;inset:0;z-index:-2;background:linear-gradient(0deg,#171126e8,transparent 85%),url('../images/home-portal.webp') center/cover no-repeat;}
.portal-flash {position:absolute;inset:0;z-index:-1;pointer-events:none;background:radial-gradient(ellipse at 76% 42%,#fff3c4,#ffdb8a66 22%,transparent 58%);opacity:0;}
.fantasy-finale[open] .portal-flash {animation:home-open 15s ease-in-out both;}
@keyframes home-open {0%,18%{opacity:0}31%{opacity:.85}42%{opacity:.13}60%,100%{opacity:0}}
.fantasy-finale[open] .home-backdrop {animation:home-backdrop 15s ease-out both;}
@keyframes home-backdrop {0%,15%{filter:none;transform:scale(1)}40%,100%{filter:blur(6px) brightness(.46);transform:scale(1.07)}}
.home-award {width:min(84vw,900px,110vh);padding:7px;background:#f9eddb;border-radius:12px;border:1px solid #ffe4b5;box-shadow:0 12px 48px #0e091dbb;}
.home-award img {display:block;width:100%;height:auto;max-height:49vh;object-fit:contain;background:#23172b;border-radius:6px;}
.fantasy-finale[open] .home-award {animation:award-reveal 15s cubic-bezier(.18,.75,.25,1) both;}
@keyframes award-reveal {0%,29%{opacity:0;transform:scale(.7) translateY(30px)}43%,100%{opacity:1;transform:none}}
.final-home-copy {text-align:center;position:relative;max-width:95vw;}
.final-home-copy h2 {font:800 clamp(32px,6vw,75px)/1.03 Georgia,serif;color:#ffebc4;margin:5px 0;text-shadow:0 3px 20px #1e122f;}
.final-home-copy p:not(.eyebrow) {color:#f5eafa;font-size:clamp(12px,1.6vw,17px);}
.final-home-copy .eyebrow {color:#ffdc95;margin-top:8px;}
.home-bracelet {display:inline-flex;align-items:center;gap:12px;padding:10px 17px;border:1px solid #ddd1ff;border-radius:30px;background:#25213bea;box-shadow:0 0 12px #d4baff76;}
.home-bracelet i {width:19px;height:19px;rotate:45deg;border-radius:5px;border:1px solid #ffedcc;box-shadow:0 0 11px currentColor;}
.home-bracelet i:nth-child(1) {background:#ffce82;color:#ffbd58;}
.home-bracelet i:nth-child(2) {background:#50e1f5;color:#39dbf4;border-color:#b7faff;}
.home-bracelet i:nth-child(3) {background:#bb9bfa;color:#ad80f4;border-color:#e7d9ff;}
.home-bracelet i:nth-child(4) {background:#63dd97;color:#47d98b;border-color:#d5ffe2;}
.fantasy-finale[open] .home-bracelet i {animation:gem-pulse 1.2s ease-in-out 3 alternate;}
.fantasy-finale[open] .home-bracelet i:nth-child(2){animation-delay:.25s}.fantasy-finale[open] .home-bracelet i:nth-child(3){animation-delay:.5s}.fantasy-finale[open] .home-bracelet i:nth-child(4){animation-delay:.75s}
@keyframes gem-pulse {50%{scale:1.15;filter:brightness(1.4);}}
.home-actions {display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:10px;}
.home-actions .quiet {background:#322641;border-color:#bca2df;color:#fff;}
.home-actions .button {background:#ffd58d;color:#2f2336;}
@media(max-width:640px){.fantasy .stage-progress{grid-template-columns:1fr;}.fantasy .stage-progress .counter{justify-self:start;}.fantasy .fantasy-stage{flex-basis:135px;padding:0;}.rune-panel{width:min(245px,85vw);}.home-award{width:94vw;}.home-actions .button,.home-actions .quiet{font-size:12px;min-height:36px;}}
@media(max-height:540px) and (orientation:landscape){.fantasy-finale[open]{flex-direction:row;}.home-award{width:49vw;}.final-home-copy{width:45vw;}.home-award img{max-height:82vh;}.fantasy .fantasy-stage{flex-basis:110px;}.rune-panel{padding:5px 8px;}}
@media(prefers-reduced-motion:reduce){.fantasy .portal-halo,.runes .new-light,.rune-panel.reaction,#key-awakening.key-new,.fantasy-finale[open] :is(.portal-flash,.home-backdrop,.home-award,.home-bracelet i){animation:none;}.home-backdrop{filter:blur(4px) brightness(.5);}}
/* Prevent intrinsic rune glyph widths expanding the grid on narrow windows. */
.runes {grid-template-columns:repeat(10,minmax(0,1fr));}
.runes li {min-width:0;min-height:0;font-size:clamp(10px,1.2vw,14px);line-height:1;}
.fantasy .stage-task .forms .gap.resolved {background:#dcf5e2;border-color:#55966e;color:#1b5537;}
.home-award {width:min(84vw,900px,87vh);}
@media(max-width:640px){.home-award{width:min(94vw,87vh);}.rune-panel .actor-note{max-width:100%;white-space:normal;text-align:center;}.fantasy .stage-task{min-width:0;}.fantasy .stage-task .task-actions{flex-wrap:wrap;}}
@media(max-height:540px) and (orientation:landscape){.home-award{width:min(49vw,145vh);}}
