:root {
  color-scheme: dark;
  --ink: #f7f3ff;
  --muted: rgba(239, 232, 255, .72);
  --panel: rgba(12, 7, 26, .58);
  --line: rgba(255, 255, 255, .14);
  --violet: #9f7aea;
  --cyan: #58e6d9;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  overflow-x: hidden;
  background: #070513;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, a { font: inherit; }

.globe-page {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 36%, rgba(84, 43, 151, .26), transparent 34rem),
    linear-gradient(180deg, #070513 0%, #090718 58%, #05040c 100%);
}
.sky { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.nebula { position: absolute; width: 55vw; height: 55vw; border-radius: 50%; filter: blur(70px); opacity: .24; transition: background .5s ease; }
.nebula-one { left: -20vw; top: -15vw; background: #51349b; }
.nebula-two { right: -18vw; bottom: -24vw; background: #087e88; }
.stars { position: absolute; inset: 0; background-repeat: repeat; opacity: .48; }
.stars-small { background-image: radial-gradient(circle, rgba(255,255,255,.72) 0 1px, transparent 1.5px); background-size: 67px 67px; }
.stars-large { background-image: radial-gradient(circle, rgba(165,215,255,.8) 0 1px, transparent 2px); background-size: 157px 139px; transform: translate(21px, 37px); }

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.brand img { filter: drop-shadow(0 0 18px rgba(159,122,234,.45)); }
.notes-link, .reset, .autospin, .large-mode, .world-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: rgba(255,255,255,.82);
  background: rgba(10, 7, 22, .6);
  backdrop-filter: blur(14px);
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}
.notes-link { padding: .62rem .9rem; font-size: .74rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.notes-link:hover, .reset:hover, .autospin:hover, .large-mode:hover, .world-button:hover { color: #fff; border-color: rgba(159,122,234,.72); background: rgba(91,59,154,.25); transform: translateY(-1px); }
.notes-link:focus-visible, .reset:focus-visible, .autospin:focus-visible, .large-mode:focus-visible, .world-button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.autospin.is-active, .large-mode.is-active { color: #fff; border-color: rgba(88,230,217,.62); background: rgba(17,117,112,.28); box-shadow: 0 0 20px rgba(88,230,217,.12); }

.globe-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px) 0 36px;
  display: grid;
  grid-template-columns: minmax(250px, .7fr) minmax(480px, 1.4fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
}
.intro { position: relative; z-index: 3; }
.eyebrow { margin: 0 0 .7rem; color: var(--cyan); font-size: .76rem; font-weight: 750; letter-spacing: .18em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(3.1rem, 8vw, 7rem); line-height: .86; letter-spacing: -.065em; text-wrap: balance; }
.intro > p:not(.eyebrow):not(.active-world-line) { max-width: 36rem; margin: 1.35rem 0 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.2rem); line-height: 1.65; }
.active-world-line { margin: 1.25rem 0 0; color: rgba(255,255,255,.58); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.active-world-line strong { color: #fff; }

.viewer-column {
  min-width: 0;
  width: 100%;
  display: grid;
  gap: 14px;
}

.world-switch {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 22px;
  background: rgba(6,4,15,.68);
  box-shadow: 0 16px 45px rgba(0,0,0,.2);
  backdrop-filter: blur(14px);
}
.world-switch-label {
  padding-inline: 4px;
  color: rgba(255,255,255,.54);
  font-size: .66rem;
  font-weight: 760;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.world-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 9px;
}
.world-button {
  min-width: 0;
  min-height: 38px;
  padding: .52rem .76rem;
  cursor: pointer;
  font-size: .69rem;
  font-weight: 760;
  letter-spacing: .035em;
  white-space: nowrap;
}
.world-button.is-active { color: #fff; border-color: rgba(88,230,217,.72); background: rgba(17,117,112,.34); box-shadow: 0 0 18px rgba(88,230,217,.14); }

.viewer-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 420px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: clamp(24px, 4vw, 44px);
  background: radial-gradient(circle at 50% 46%, rgba(72, 50, 132, .22), rgba(4, 4, 12, .2) 64%, rgba(4,4,12,.58));
  box-shadow: inset 0 0 70px rgba(106, 73, 182, .08), 0 35px 100px rgba(0,0,0,.38);
  overflow: hidden;
  touch-action: none;
}
.viewer-wrap:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: radial-gradient(circle at 50% 46%, rgba(72, 50, 132, .3), #05040d 72%);
}
#globe { width: 100%; height: 100%; display: block; cursor: grab; image-rendering: auto; }
#globe:active { cursor: grabbing; }

.loading {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; justify-items: center;
  color: rgba(255,255,255,.76); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(5,4,13,.42); transition: opacity .35s ease, visibility .35s ease;
}
.loading.is-hidden { opacity: 0; visibility: hidden; }
.loading.has-error { padding: 24px; text-align: center; color: #ffd6e7; }
.loading-orbit { width: 44px; height: 44px; border: 2px solid rgba(255,255,255,.14); border-top-color: var(--cyan); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hint { position: absolute; left: 18px; bottom: 18px; width: max-content; max-width: calc(100% - 410px); padding: .56rem .85rem; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; color: rgba(255,255,255,.66); background: rgba(6,4,15,.6); backdrop-filter: blur(12px); font-size: .72rem; transition: opacity .3s ease; }
.hint.is-hidden { opacity: 0; pointer-events: none; }
.viewer-controls { position: absolute; right: 18px; bottom: 18px; z-index: 3; display: flex; gap: 8px; align-items: center; }
.reset, .autospin, .large-mode { padding: .58rem .78rem; font-size: .72rem; cursor: pointer; }
.fallback { padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }

.viewer-wrap:fullscreen .viewer-controls { right: 24px; bottom: 24px; }
.viewer-wrap:fullscreen .hint { left: 24px; bottom: 24px; }

body[data-world="lava"] .nebula-one { background: #9b2e08; }
body[data-world="lava"] .nebula-two { background: #dc5a00; }
body[data-world="candy"] .nebula-one { background: #c84cb2; }
body[data-world="candy"] .nebula-two { background: #6c7cf5; }
body[data-world="frozen"] .nebula-one { background: #2368be; }
body[data-world="frozen"] .nebula-two { background: #34d5e8; }
body[data-world="toxic"] .nebula-one { background: #6f2a91; }
body[data-world="toxic"] .nebula-two { background: #72d700; }
body[data-world="jungle"] .nebula-one { background: #126f3b; }
body[data-world="jungle"] .nebula-two { background: #00a2a5; }
body[data-world="desert"] .nebula-one { background: #9b5a18; }
body[data-world="desert"] .nebula-two { background: #d8982b; }
body[data-world="neon"] .nebula-one { background: #c025d5; }
body[data-world="neon"] .nebula-two { background: #00bfe8; }
body[data-world="haunted"] .nebula-one { background: #37306d; }
body[data-world="haunted"] .nebula-two { background: #166c68; }
body[data-world="crystal"] .nebula-one { background: #8d54d9; }
body[data-world="crystal"] .nebula-two { background: #21a6c8; }
body[data-world="ocean"] .nebula-one { background: #0b4d94; }
body[data-world="ocean"] .nebula-two { background: #008f9a; }

@media (max-width: 860px) {
  .globe-shell { grid-template-columns: 1fr; padding-top: 12px; text-align: center; }
  .intro > p:not(.eyebrow) { margin-inline: auto; }
  .viewer-column { width: min(100%, 720px); margin-inline: auto; }
  .viewer-wrap { min-height: 0; }
  .world-switch-label { text-align: left; }
}
@media (max-width: 620px) {
  .topbar { width: min(100% - 24px, 1180px); padding-top: 14px; }
  .brand span { font-size: .82rem; }
  .globe-shell { width: min(100% - 20px, 1180px); padding-bottom: 16px; }
  .world-switch { padding: 10px; border-radius: 18px; }
  .world-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .world-button { font-size: .66rem; padding: .48rem .58rem; }
  .viewer-wrap { border-radius: 24px; }
  .hint { display: none; }
  .viewer-controls { right: 12px; bottom: 12px; left: 12px; justify-content: flex-end; flex-wrap: wrap; }
  .reset, .autospin, .large-mode { font-size: .66rem; padding: .52rem .64rem; }
}
@media (prefers-reduced-motion: reduce) {
  .loading-orbit { animation-duration: 2.4s; }
  .notes-link, .reset, .autospin, .large-mode, .world-button, .nebula { transition: none; }
}
