:root {
  --pearl: #F6FFF8;
  --peach: #FFB86B;
  --sky: #7EDBFF;
  --emerald: #44E6A8;
  --magenta: #FF5FD7;
  --cyan: #B9F8FF;
  --lavender: #BBA7FF;
  --navy: #12315C;
  --ink: #07192E;
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "Libre Baskerville", Georgia, serif;
  --hud: "Nunito Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--pearl);
  background: var(--ink);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.sky-shell {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 184, 107, .48), transparent 22%),
    radial-gradient(circle at 75% 18%, rgba(185, 248, 255, .55), transparent 26%),
    linear-gradient(180deg, #7EDBFF 0%, #B9F8FF 34%, #12315C 82%, #07192E 100%);
}

.sky-shell::before {
  content: "";
  position: fixed;
  inset: 18px;
  z-index: 30;
  pointer-events: none;
  border: 1px solid rgba(246, 255, 248, .55);
  border-radius: 30px;
  box-shadow: inset 0 0 28px rgba(246,255,248,.52), 0 0 30px rgba(126,219,255,.34);
}

.aurora, .lens-flare, .bubble-field, .reef-base { pointer-events: none; }

.aurora {
  position: fixed;
  width: 58vw;
  height: 58vw;
  border-radius: 50%;
  filter: blur(34px);
  opacity: .48;
  z-index: 1;
  animation: drift 18s ease-in-out infinite alternate;
}

.aurora-a { left: -16vw; top: 5vh; background: radial-gradient(circle, #44E6A8, transparent 60%); }
.aurora-b { right: -18vw; top: 34vh; background: radial-gradient(circle, #FF5FD7, transparent 62%); animation-delay: -7s; }

.title-flare {
  position: fixed;
  top: 16vh;
  left: -28vw;
  width: 38vw;
  height: 13vh;
  z-index: 8;
  background: linear-gradient(100deg, transparent, rgba(255,184,107,.08), rgba(255,95,215,.78), rgba(246,255,248,.85), transparent);
  filter: blur(10px);
  transform: rotate(-14deg);
  animation: flareSweep 9s ease-in-out infinite;
}

.bubble-field span {
  position: fixed;
  z-index: 2;
  width: var(--size, 42px);
  height: var(--size, 42px);
  left: var(--x, 50%);
  bottom: -80px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #F6FFF8 0 8%, rgba(246,255,248,.2) 9% 18%, rgba(185,248,255,.35) 19% 100%);
  border: 1px solid rgba(246,255,248,.55);
  animation: bubbleRise var(--speed, 16s) linear infinite;
}
.bubble-field span:nth-child(1) { --x: 10%; --size: 26px; --speed: 13s; }
.bubble-field span:nth-child(2) { --x: 27%; --size: 58px; --speed: 19s; animation-delay: -6s; }
.bubble-field span:nth-child(3) { --x: 42%; --size: 36px; --speed: 15s; animation-delay: -10s; }
.bubble-field span:nth-child(4) { --x: 58%; --size: 68px; --speed: 22s; animation-delay: -3s; }
.bubble-field span:nth-child(5) { --x: 74%; --size: 30px; --speed: 14s; animation-delay: -8s; }
.bubble-field span:nth-child(6) { --x: 86%; --size: 50px; --speed: 18s; animation-delay: -12s; }
.bubble-field span:nth-child(7) { --x: 17%; --size: 76px; --speed: 24s; animation-delay: -15s; }
.bubble-field span:nth-child(8) { --x: 67%; --size: 24px; --speed: 12s; animation-delay: -4s; }

.top-visor, .quest-log, .minimap, .route-ribbon {
  position: fixed;
  z-index: 40;
  border: 1px solid rgba(246,255,248,.48);
  background: linear-gradient(135deg, rgba(246,255,248,.34), rgba(185,248,255,.16) 46%, rgba(18,49,92,.18));
  box-shadow: inset 0 1px 18px rgba(246,255,248,.28), 0 12px 30px rgba(7,25,46,.18);
  backdrop-filter: blur(14px);
}

.top-visor {
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1120px, calc(100vw - 62px));
  min-height: 58px;
  border-radius: 0 0 28px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  font-family: var(--hud);
  color: var(--navy);
  font-weight: 800;
}

.visor-gem { width: 32px; height: 32px; border-radius: 50%; background: radial-gradient(circle at 30% 20%, #F6FFF8, #44E6A8 42%, #7EDBFF 70%, #12315C); box-shadow: 0 0 18px #44E6A8; }
.visor-title { margin-right: auto; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.visor-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.visor-nav a { padding: 7px 12px; border-radius: 999px; background: rgba(246,255,248,.35); border: 1px solid rgba(255,255,255,.45); font-size: 12px; }

.quest-log {
  top: 108px;
  left: 18px;
  width: 218px;
  border-radius: 28px;
  padding: 20px 16px;
  color: var(--navy);
}
.rail-label, .minimap span, .ribbon-label, .eyebrow { font-family: var(--hud); text-transform: uppercase; letter-spacing: .14em; font-weight: 800; }
.rail-label { color: var(--ink); font-size: 12px; margin-bottom: 12px; }
.quest-log ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.quest-log li { display: grid; grid-template-columns: 34px 1fr; gap: 9px; align-items: center; padding: 9px; border-radius: 18px; opacity: .68; transition: .35s ease; }
.quest-log li.active { opacity: 1; background: rgba(246,255,248,.48); box-shadow: inset 0 0 14px rgba(126,219,255,.42), 0 0 18px rgba(68,230,168,.3); }
.quest-log b { font-family: var(--hud); color: var(--magenta); }
.quest-log span { font: 12px/1.35 var(--body); }
.inventory { margin-top: 17px; display: flex; flex-wrap: wrap; gap: 7px; }
.inventory span { font: 10px var(--hud); color: var(--navy); padding: 5px 8px; border-radius: 999px; background: rgba(255,184,107,.32); border: 1px solid rgba(246,255,248,.46); }

.minimap {
  right: 28px;
  top: 106px;
  width: 145px;
  height: 145px;
  border-radius: 50%;
  color: var(--navy);
}
.mini-ring { position: absolute; inset: 17px; border: 1px dashed rgba(18,49,92,.44); border-radius: 50%; animation: spin 24s linear infinite; }
.mini-ring::after { content: ""; position: absolute; inset: 28px; border: 1px solid rgba(68,230,168,.42); border-radius: 50%; }
.mini-route { position: absolute; left: 25px; right: 25px; top: 70px; height: 3px; background: linear-gradient(90deg, #44E6A8, #7EDBFF, #FF5FD7); border-radius: 999px; transform: rotate(-28deg); box-shadow: 0 0 12px #B9F8FF; }
.mini-dot { position: absolute; width: 15px; height: 15px; border-radius: 50%; background: #FF5FD7; left: 27px; top: 88px; box-shadow: 0 0 14px #FF5FD7, 0 0 22px #F6FFF8; transition: transform .45s ease; }
.minimap span { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); font-size: 9px; white-space: nowrap; }

.route-ribbon {
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(880px, calc(100vw - 62px));
  border-radius: 24px 24px 0 0;
  padding: 13px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  color: var(--navy);
}
.ribbon-track { height: 10px; border-radius: 999px; background: rgba(18,49,92,.22); overflow: hidden; box-shadow: inset 0 1px 4px rgba(7,25,46,.3); }
.ribbon-track span { display: block; width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #44E6A8, #7EDBFF, #FFB86B, #FF5FD7); box-shadow: 0 0 18px #B9F8FF; transition: width .4s ease; }
.ribbon-label { font-size: 11px; }

.quest-scenes { position: relative; z-index: 10; }
.scene {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 110px 260px 110px;
  overflow: hidden;
}

.floating-island, .scroll-plaque, .bridge-portal, .bubble-cluster, .settlement-shell, .final-map {
  position: relative;
  border: 1px solid rgba(246,255,248,.6);
  background:
    radial-gradient(circle at 18% 12%, rgba(246,255,248,.86), rgba(246,255,248,.24) 19%, transparent 20%),
    linear-gradient(145deg, rgba(246,255,248,.46), rgba(185,248,255,.24) 42%, rgba(126,219,255,.15));
  box-shadow: inset 0 1px 22px rgba(246,255,248,.45), 0 28px 70px rgba(7,25,46,.25), 0 0 36px rgba(126,219,255,.25);
  backdrop-filter: blur(16px);
}

.hero-island {
  width: min(760px, 78vw);
  min-height: 430px;
  border-radius: 46% 54% 48% 52% / 44% 42% 58% 56%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 58px 70px;
  animation: float 5.4s ease-in-out infinite;
}
.eyebrow { color: var(--navy); font-size: 12px; margin: 0 0 12px; }
h1, h2 { font-family: var(--display); color: var(--navy); margin: 0; line-height: .92; }
h1 { font-size: clamp(74px, 11vw, 160px); letter-spacing: .035em; text-shadow: 0 2px 0 rgba(246,255,248,.65); position: relative; }
h1 em { color: var(--ink); font-style: italic; }
.draw-underline { position: absolute; left: 58%; right: 2%; bottom: -18px; height: 18px; overflow: hidden; }
.draw-underline::after { content: ""; display: block; width: 100%; height: 100%; border-bottom: 5px solid #FF5FD7; border-radius: 50%; transform: translateX(-108%); animation: underlineDraw 2.2s ease forwards 1s; box-shadow: 0 8px 16px rgba(255,95,215,.45); }
.lore, .scroll-plaque p:not(.eyebrow), .final-plaque p:not(.eyebrow) { font: 16px/1.8 var(--body); color: var(--navy); max-width: 610px; }
.route-control { cursor: pointer; border: 1px solid rgba(246,255,248,.72); color: var(--navy); font: 800 13px var(--hud); text-transform: uppercase; letter-spacing: .16em; padding: 16px 25px; border-radius: 999px; background: linear-gradient(135deg, #F6FFF8, #FFB86B 45%, #FF5FD7); box-shadow: inset 0 1px 8px rgba(255,255,255,.7), 0 0 28px rgba(255,95,215,.45); transition: transform .25s ease, box-shadow .25s ease; }
.route-control:hover { transform: translateY(-3px) scale(1.03); box-shadow: inset 0 1px 8px rgba(255,255,255,.7), 0 0 42px rgba(255,95,215,.68); }

.chrome-ring { position: absolute; border: 9px solid rgba(246,255,248,.44); border-top-color: #B9F8FF; border-right-color: #44E6A8; border-radius: 50%; box-shadow: inset 0 0 18px rgba(18,49,92,.22), 0 0 20px rgba(185,248,255,.55); }
.ring-one { width: 150px; height: 150px; left: -35px; top: 50px; animation: spin 18s linear infinite; }
.ring-two { width: 94px; height: 94px; right: 55px; bottom: 36px; animation: spin 13s linear infinite reverse; }
.route-beam { position: absolute; height: 13px; width: 42vw; border-radius: 999px; background: linear-gradient(90deg, transparent, #44E6A8, #7EDBFF, transparent); filter: blur(.2px); box-shadow: 0 0 22px #B9F8FF; transform-origin: center; opacity: .72; }
.beam-a { right: 8vw; top: 57%; transform: rotate(-20deg); }
.beam-b { left: 20vw; bottom: 26%; transform: rotate(24deg); }
.paper-boat, .proof-orb { position: absolute; z-index: 12; display: grid; place-items: center; color: var(--navy); }
.paper-boat { right: 21vw; top: 36vh; width: 54px; height: 54px; background: linear-gradient(135deg, #F6FFF8, #B9F8FF); clip-path: polygon(50% 0, 100% 82%, 51% 64%, 0 82%); animation: float 4.3s ease-in-out infinite; }
.proof-orb { left: 25vw; bottom: 22vh; width: 86px; height: 86px; border-radius: 50%; font: 700 34px var(--display); background: radial-gradient(circle at 25% 20%, #F6FFF8, #BBA7FF 38%, #7EDBFF); border: 1px solid rgba(246,255,248,.8); box-shadow: 0 0 28px rgba(187,167,255,.65); animation: orbit 7s ease-in-out infinite; }

.scroll-plaque { width: min(520px, 78vw); border-radius: 34px; padding: 34px 40px; }
.scroll-plaque h2 { font-size: clamp(44px, 6vw, 82px); }
.left-plaque { justify-self: start; }
.right-plaque { justify-self: end; }
.key-phrase { position: relative; display: inline-block; }
.key-phrase::after { content: ""; position: absolute; left: 0; bottom: -8px; height: 5px; width: var(--draw, 0%); border-radius: 999px; background: linear-gradient(90deg, #FFB86B, #FF5FD7); box-shadow: 0 0 15px #FF5FD7; transition: width .9s ease; }
.scene.active .key-phrase::after { --draw: 100%; }

.bridge-portal { position: absolute; right: 18vw; width: 320px; height: 320px; border-radius: 50%; display: grid; place-items: center; animation: float 5s ease-in-out infinite; }
.portal-ring { position: absolute; inset: 28px; border: 18px solid rgba(246,255,248,.52); border-left-color: #FFB86B; border-bottom-color: #44E6A8; border-radius: 50%; animation: spin 16s linear infinite; }
.portal-water { width: 160px; height: 160px; border-radius: 45% 55% 48% 52%; background: radial-gradient(circle at 30% 25%, #F6FFF8, #B9F8FF 35%, #7EDBFF 70%); box-shadow: inset 0 -18px 30px rgba(18,49,92,.16), 0 0 28px #7EDBFF; }
.bridge-key { position: relative; z-index: 2; font-size: 58px; color: var(--navy); text-shadow: 0 0 12px #F6FFF8; }

.bubble-cluster { width: 390px; height: 390px; border-radius: 50%; display: grid; place-items: center; justify-self: start; animation: float 5.8s ease-in-out infinite; }
.bubble-cluster i { position: absolute; width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(circle at 28% 20%, #F6FFF8, rgba(185,248,255,.8), rgba(187,167,255,.45)); border: 1px solid rgba(246,255,248,.75); box-shadow: 0 0 22px rgba(185,248,255,.55); transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.bubble-cluster i:nth-child(1) { transform: translate(-104px, -55px); }
.bubble-cluster i:nth-child(2) { transform: translate(84px, -72px); }
.bubble-cluster i:nth-child(3) { transform: translate(-90px, 84px); }
.bubble-cluster i:nth-child(4) { transform: translate(96px, 74px); }
.bubble-cluster i:nth-child(5) { transform: translate(0, -126px); }
.bubble-cluster i:nth-child(6) { transform: translate(0, 120px); }
.scene.active .bubble-cluster i { transform: translate(0, 0) scale(.72); }
.bubble-cluster strong { position: relative; z-index: 2; width: 152px; height: 152px; border-radius: 50%; display: grid; place-items: center; text-align: center; padding: 20px; font: 800 16px var(--hud); text-transform: uppercase; letter-spacing: .12em; color: var(--navy); background: radial-gradient(circle at 30% 20%, #F6FFF8, #FFB86B 28%, #FF5FD7 84%); box-shadow: 0 0 36px rgba(255,95,215,.6); }
.floating-flag { position: absolute; right: 26vw; top: 24vh; padding: 16px 22px; border-radius: 20px 20px 20px 4px; background: linear-gradient(135deg, #F6FFF8, #44E6A8); color: var(--navy); font: 800 12px var(--hud); text-transform: uppercase; box-shadow: 0 0 24px rgba(68,230,168,.55); animation: float 4s ease-in-out infinite; }

.settlement-shell { position: absolute; right: 18vw; width: 330px; height: 250px; border-radius: 50% 50% 42% 42% / 70% 70% 30% 30%; display: grid; place-items: center; animation: shellDrop 6s ease-in-out infinite; }
.shell-ridges { position: absolute; inset: 22px; border-radius: inherit; background: repeating-radial-gradient(ellipse at 50% 100%, transparent 0 18px, rgba(18,49,92,.16) 19px 22px); }
.stamp { position: relative; z-index: 2; transform: rotate(-9deg); padding: 13px 28px; border: 4px double #FF5FD7; border-radius: 16px; color: var(--navy); font: 800 20px var(--hud); text-transform: uppercase; background: rgba(246,255,248,.5); box-shadow: 0 0 22px rgba(255,95,215,.5); }
.sunburst { position: absolute; right: 21vw; bottom: 30vh; width: 160px; height: 160px; background: conic-gradient(from 0deg, transparent, #FFB86B, transparent, #FF5FD7, transparent, #F6FFF8, transparent); border-radius: 50%; filter: blur(3px); opacity: .72; animation: spin 10s linear infinite; }

.final-map { width: min(900px, 78vw); height: 420px; border-radius: 48px; }
.route-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.route-svg path { fill: none; stroke: url(#routeGlow); stroke-width: 13; stroke-linecap: round; stroke-dasharray: 980; stroke-dashoffset: 980; filter: drop-shadow(0 0 12px #B9F8FF); transition: stroke-dashoffset 1.4s ease; }
.scene.active .route-svg path { stroke-dashoffset: 0; }
.map-node { position: absolute; display: grid; place-items: center; width: 116px; height: 80px; border-radius: 50%; background: radial-gradient(circle at 30% 20%, #F6FFF8, #B9F8FF 55%, #44E6A8); color: var(--navy); font: 800 13px var(--hud); text-transform: uppercase; box-shadow: 0 0 28px rgba(185,248,255,.8); animation: float 4.5s ease-in-out infinite; }
.n1 { left: 4%; top: 58%; }.n2 { left: 22%; top: 18%; animation-delay: -.5s; }.n3 { left: 45%; top: 48%; animation-delay: -1s; }.n4 { right: 22%; top: 18%; animation-delay: -1.5s; }.n5 { right: 5%; top: 54%; animation-delay: -2s; }
.final-plaque { position: absolute; bottom: 13vh; left: 50%; transform: translateX(-50%); width: min(720px, 72vw); text-align: center; }

.reef-base { position: fixed; left: 0; right: 0; bottom: 0; height: 28vh; z-index: 3; opacity: .92; background: linear-gradient(180deg, transparent, rgba(7,25,46,.34) 10%, #07192E 80%); }
.reef-grid { position: absolute; inset: 9vh 0 0; background-image: linear-gradient(rgba(126,219,255,.22) 1px, transparent 1px), linear-gradient(90deg, rgba(68,230,168,.18) 1px, transparent 1px); background-size: 54px 34px; transform: perspective(360px) rotateX(58deg) scale(1.25); transform-origin: bottom; }
.reef-glow { position: absolute; left: 10%; right: 10%; bottom: 4vh; height: 8vh; border-radius: 50%; background: radial-gradient(ellipse, rgba(68,230,168,.58), rgba(126,219,255,.16) 54%, transparent 72%); animation: reefPulse 4s ease-in-out infinite; }

@keyframes flareSweep { 0%, 28% { transform: translateX(0) rotate(-14deg); opacity: 0; } 42% { opacity: .9; } 72%, 100% { transform: translateX(150vw) rotate(-14deg); opacity: 0; } }
@keyframes underlineDraw { to { transform: translateX(0); } }
@keyframes drift { to { transform: translate(8vw, 4vh) scale(1.08); } }
@keyframes bubbleRise { to { transform: translateY(-118vh) translateX(45px); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
@keyframes orbit { 0%,100% { transform: translate(0,0); } 50% { transform: translate(30px,-24px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shellDrop { 0%,100% { transform: translateY(-12px); } 50% { transform: translateY(20px); } }
@keyframes reefPulse { 0%,100% { opacity: .42; transform: scaleX(.9); } 50% { opacity: .9; transform: scaleX(1.05); } }

@media (max-width: 900px) {
  .scene { padding: 120px 28px 130px; }
  .quest-log { display: none; }
  .minimap { width: 110px; height: 110px; right: 18px; top: 86px; }
  .visor-nav { display: none; }
  .hero-island { width: 92vw; padding: 45px 28px; }
  .bridge-portal, .settlement-shell { position: relative; right: auto; margin-top: 28px; transform: scale(.8); }
  .left-plaque, .right-plaque { justify-self: center; }
  .bubble-cluster { justify-self: center; transform: scale(.78); }
  .route-ribbon { grid-template-columns: 1fr; }
  .final-plaque { width: 88vw; }
}
