/* Four accessible routes, with hand-stepped openings in the cave wall. */
.portal-route{position:absolute;inset:0;pointer-events:none;z-index:1;outline-offset:-4px!important}
.portal-link{
 --portal:#c1aaf4;--rgb:157,123,204;
 --rock-edge:polygon(0 88%,5% 88%,5% 62%,10% 62%,10% 34%,17% 34%,17% 19%,28% 19%,28% 8%,42% 8%,42% 2%,61% 2%,61% 10%,75% 10%,75% 21%,86% 21%,86% 36%,93% 36%,93% 55%,98% 55%,98% 83%,100% 83%,100% 97%,87% 97%,87% 100%,11% 100%,11% 96%,0 96%);
 --mouth:polygon(15% 93%,15% 75%,20% 75%,20% 46%,25% 46%,25% 30%,36% 30%,36% 19%,48% 19%,48% 14%,64% 14%,64% 23%,75% 23%,75% 35%,81% 35%,81% 53%,88% 53%,88% 83%,92% 83%,92% 95%,65% 95%,65% 97%,30% 97%,30% 94%);
 position:absolute;left:var(--portal-x);top:15%;transform:translateX(-50%);width:20%;
 display:flex;flex-direction:column;align-items:center;text-align:center;text-decoration:none;pointer-events:auto;color:#f3e8ce;gap:5px
}
.portal-link:nth-child(2){--portal:#a8dacf;--rgb:101,155,138}
.portal-link:nth-child(3){--portal:#ecc488;--rgb:174,122,67}
.portal-link[data-portal="4"]{--portal:#b6c3ec;--rgb:111,132,197}
.portal-link.death-portal{--portal:#ff9e79;--rgb:195,76,48}
.portal-link:nth-child(even){
 --rock-edge:polygon(0 80%,4% 80%,4% 56%,9% 56%,9% 35%,16% 35%,16% 23%,26% 23%,26% 12%,41% 12%,41% 3%,57% 3%,57% 8%,68% 8%,68% 15%,81% 15%,81% 25%,87% 25%,87% 43%,94% 43%,94% 70%,98% 70%,98% 86%,100% 86%,100% 97%,87% 97%,87% 100%,12% 100%,12% 96%,0 96%);
 --mouth:polygon(12% 94%,12% 79%,17% 79%,17% 58%,22% 58%,22% 44%,27% 44%,27% 34%,38% 34%,38% 27%,45% 27%,45% 17%,61% 17%,61% 22%,72% 22%,72% 31%,78% 31%,78% 53%,84% 53%,84% 70%,89% 70%,89% 89%,93% 89%,93% 95%,64% 95%,64% 98%,29% 98%,29% 95%);
}
.portal-arch{
 isolation:isolate;aspect-ratio:.91;width:84%;display:block;position:relative;
 clip-path:var(--rock-edge);background:
  linear-gradient(90deg,#a966474f 70%,transparent 70%) 17% 23%/27% 11% no-repeat,
  linear-gradient(90deg,#170f17 68%,transparent 68%) 84% 35%/25% 11% no-repeat,
  linear-gradient(90deg,#a7604266 72%,transparent 72%) 89% 68%/19% 10% no-repeat,
  linear-gradient(90deg,#1a1015 65%,transparent 65%) 10% 65%/17% 13% no-repeat,
  linear-gradient(90deg,#b5724c47 60%,transparent 60%) 7% 79%/24% 9% no-repeat,
  linear-gradient(90deg,#100b10 75%,transparent 75%) 98% 89%/20% 8% no-repeat,
  linear-gradient(90deg,#b6754c33 75%,transparent 75%) 49% 8%/31% 11% no-repeat,
  linear-gradient(145deg,#895035 0%,#5c3329 26%,#47262a 49%,#301c21 71%,#5d382c 95%);
 transition:filter .18s ease
}
.portal-arch::before,.portal-arch::after{content:"";position:absolute;inset:0;clip-path:var(--mouth)}
.portal-arch::before{background:#27191d;transform:scale(1.11,1.07);transform-origin:50% 96%}
.portal-arch::after{background:radial-gradient(ellipse at 51% 104%,rgba(var(--rgb),.30),rgba(var(--rgb),.1) 32%,transparent 63%),linear-gradient(#09070a,#030305 45%,#08080b)}
.portal-link.death-portal .portal-arch::after{background:radial-gradient(ellipse at 58% 106%,#99502d67,#501d2444 35%,transparent 63%),linear-gradient(#0b0708,#030305 45%,#0c0708)}
.portal-sigil{display:none}
.portal-label{display:block;max-width:100%;font:700 clamp(11px,1.7cqw,15px)/1.2 var(--mono);text-shadow:1px 2px #000}
.portal-link:hover .portal-arch,.portal-link:focus-visible .portal-arch{filter:brightness(1.32)}
.portal-link:hover .portal-label,.portal-link:focus-visible .portal-label{color:var(--portal)}
.portal-link:focus-visible{outline:2px solid var(--portal);outline-offset:3px}
.portal-hint{position:absolute;top:91%;left:20%;right:20%;text-align:center;font:clamp(10px,1.35cqw,13px)/1.25 var(--mono);color:#eedcba;text-shadow:1px 1px #07050b}
.portal-route:not([hidden]) .portal-link{animation:portal-reveal .42s cubic-bezier(.25,.65,.35,1) backwards}
.portal-route .portal-link:nth-child(2){animation-delay:.08s}.portal-route .portal-link:nth-child(3){animation-delay:.16s}
.portal-route[data-portal-count="5"] .portal-link{width:18%}
@keyframes portal-reveal{from{opacity:0;translate:0 8px}to{opacity:1;translate:0 0}}
@media(max-width:700px){.portal-route{inset:0 0 auto;aspect-ratio:4/3}.portal-link{width:21%;gap:3px}.portal-arch{width:78%}.portal-label{font-size:clamp(9px,2.15vw,12px)}.portal-hint{top:auto;bottom:3%;left:8%;right:8%;font-size:10px}}
@media(prefers-reduced-motion:reduce){.portal-route .portal-link,.portal-link .portal-arch{animation:none!important;transition:none!important}}
.motion-paused .portal-route .portal-link,.motion-paused .portal-link .portal-arch{animation:none!important;transition:none!important}
/* The chapter-flight canvas uses the same full-screen treatment as the 4499 reference. */
.portal-warp{position:fixed;z-index:1000;inset:0;isolation:isolate;overflow:hidden;display:grid;place-items:center;background:#080807;color:#f1ece2;opacity:var(--warp-cover,0);pointer-events:auto}
.portal-warp[hidden]{display:none!important}
.portal-warp canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.portal-warp-type{position:relative;max-width:min(88vw,36rem);text-align:center;opacity:var(--warp-title,0);text-shadow:0 2px 20px #080807}
.portal-warp-type p{margin:0 0 .7rem;color:#e9cb9a;font:650 .875rem/1.3 var(--mono);letter-spacing:.22em;text-transform:uppercase}
.portal-warp-title{display:block;font:650 clamp(2.1rem,7vw,5.3rem)/.99 var(--serif);letter-spacing:-.035em;text-wrap:balance}
.portal-warp[data-phase="reveal"]{animation:portal-warp-reveal 240ms ease-out both}
@keyframes portal-warp-reveal{from{opacity:1}to{opacity:0}}
@media(prefers-reduced-motion:reduce){.portal-warp{display:none!important}}
