:root {
  --sky-top: #5fa9dc;
  --sky-bottom: #cfe9f4;
  --ink: #f3ecd8;
  --muted: #b9b39f;
  --slate: #1d2226;
  --slate-2: #262c31;
  --slate-edge: #3a4248;
  --cyan: #4fe3ff;
  --orange: #ff9a3c;
  --gold: #e8c35a;
  --box: rgba(14, 16, 18, .82);
  --title: "Marcellus SC", Georgia, serif;
  --body: "Nunito Sans", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #0d1012;
  color: var(--ink);
  font-family: var(--body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
body.slate-open { overflow-y: auto; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* ================= Loading screen =================
   Laid out after the game's loading screen: a white band wipes in across the
   top with stats and icons, tips sit below on black, and a logo block in the
   corner fills as loading progresses. */
.loader {
  position: fixed; inset: 0; z-index: 30;
  background: #000; color: #fff;
  font-family: var(--body);
  transition: opacity .7s ease;
}
.loader.done { opacity: 0; pointer-events: none; }
.ld-top { position: relative; height: 38%; overflow: hidden; }
.ld-band {
  position: absolute; top: 0; right: 0; height: 100%; width: 0;
  background: #fff; color: #141414;
  animation: band-in .95s cubic-bezier(.55, .05, .3, 1) .25s forwards;
}
.ld-edge {
  position: absolute; top: 0; right: 0; height: 100%; width: 170px; margin-right: -30px;
  background: linear-gradient(to right, #000, #fff);
  transform: skewX(7deg);
  animation: edge-in .95s cubic-bezier(.55, .05, .3, 1) .25s forwards;
}
.ld-band > * { opacity: 0; animation: fade-in .5s ease 1.25s forwards; }

.ld-title {
  position: absolute; left: 40px; bottom: 0; margin: 0; padding: 4px 6px 10px 0;
  font-weight: 800; font-size: clamp(16px, 2vw, 20px); letter-spacing: .02em;
}
.ld-stats {
  position: absolute; top: clamp(16px, 4.5vh, 34px); right: 45px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  font-size: 15px; font-weight: 600;
}
.ld-hearts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; width: 230px; margin-bottom: 2px; }
.ld-hearts svg { width: 15px; height: 14px; fill: #e5353b; stroke: #141414; stroke-width: 1.5; }
.ld-stamina { display: flex; gap: 3px; margin-bottom: 4px; }
.ld-stamina svg { width: 20px; height: 20px; fill: none; stroke: #3fb043; stroke-width: 4; }
.ld-stat { display: flex; align-items: center; justify-content: flex-end; gap: 0; height: 28px; font-variant-numeric: tabular-nums; }
.ld-stat .ic { width: 22px; height: 22px; margin-left: 10px; fill: #141414; stroke: #141414; }
.ld-stat .ic.gem { fill: #3fb043; stroke: none; }
.ld-icons { position: absolute; right: 45px; bottom: 0; display: flex; align-items: flex-end; gap: 22px; }
.ld-icons svg { width: 50px; height: 50px; fill: #141414; stroke: #141414; stroke-width: 2.5; stroke-linecap: round; }
.ld-icons .b1 { animation: bob-a 4.8s ease-in-out infinite; }
.ld-icons .b2 { animation: bob-b 1.6s ease-in-out infinite; }
.ld-icons .b3 { animation: bob-a 5.5s ease-in-out infinite reverse; }
.ld-icons .b4 { animation: bob-b 3.3s ease-in-out infinite; }

.ld-bottom { position: relative; height: 62%; }
.ld-bottom > * { opacity: 0; animation: fade-in .5s ease 1.35s forwards; }
.ld-tip {
  position: absolute; top: 14px; left: 40px; max-width: 50%; margin: 0;
  font-weight: 700; font-size: clamp(14px, 1.6vw, 17px); line-height: 1.5;
  transition: opacity .3s;
}
.ld-tip.swap { opacity: 0 !important; }
.ld-next {
  position: absolute; top: 12px; right: 50px;
  display: flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 0; cursor: pointer;
  font-weight: 700; font-size: 15px; color: #fff;
}
.btn-a {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; color: #000; font-size: 12px; font-weight: 800;
}
.ld-logo {
  position: absolute; right: 48px; bottom: 34px; width: 221px; height: 173px;
  background: #20221c; overflow: hidden;
  display: grid; place-items: center; text-align: center;
}
.ld-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: #fff; transition: width .4s ease; }
.ld-logo p {
  position: relative; margin: 0; padding: 0 14px;
  font-family: var(--title); font-size: 26px; line-height: 1.05; color: #fff;
  mix-blend-mode: difference;
}
.ld-logo small { display: block; font-size: 11px; letter-spacing: .25em; margin-bottom: 6px; }
.ld-tri { position: absolute; right: 290px; bottom: 40px; width: 40px; height: 36px; }
.ld-tri i {
  position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #fff;
  animation: tri 1.2s ease-in-out infinite;
}
.ld-tri i:nth-child(1) { left: 16px; top: 0; }
.ld-tri i:nth-child(2) { left: 24px; top: 14px; animation-delay: .2s; }
.ld-tri i:nth-child(3) { left: 32px; top: 28px; animation-delay: .4s; }
.ld-tri i:nth-child(4) { left: 16px; top: 28px; animation-delay: .6s; }
.ld-tri i:nth-child(5) { left: 0; top: 28px; animation-delay: .8s; }
.ld-tri i:nth-child(6) { left: 8px; top: 14px; animation-delay: 1s; }

@keyframes band-in { to { width: 100%; } }
@keyframes edge-in { 0% { right: 0; opacity: 1; } 90% { opacity: 1; } 100% { right: 100%; opacity: 0; } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes bob-a { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes bob-b { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-4deg); } }
@keyframes tri { 0%, 100% { opacity: .2; transform: scale(.8); } 30% { opacity: 1; transform: scale(1); } }

@media (max-width: 700px) {
  .ld-top { height: 34%; }
  .ld-title { left: 16px; }
  .ld-stats { right: 16px; top: 14px; font-size: 13px; }
  .ld-hearts { width: 150px; }
  .ld-hearts svg { width: 12px; height: 11px; }
  .ld-stat { height: 22px; }
  .ld-stat:nth-of-type(n+3) { display: none; }
  .ld-icons { right: 16px; gap: 10px; }
  .ld-icons svg { width: 30px; height: 30px; }
  .ld-tip { left: 16px; max-width: calc(100% - 32px); top: 16px; }
  .ld-next { top: auto; bottom: 16px; left: 16px; right: auto; }
  .ld-logo { right: 16px; bottom: 16px; width: 150px; height: 118px; }
  .ld-logo p { font-size: 18px; }
  .ld-logo small { font-size: 9px; letter-spacing: .12em; }
  .ld-tri { right: 184px; bottom: 20px; }
}

/* ================= Overworld ================= */
#world {
  position: fixed;
  inset: 0;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}
.sky { position: absolute; inset: 0; background: linear-gradient(var(--sky-top), var(--sky-bottom) 75%); }
.sun {
  position: absolute; width: 140px; height: 140px; right: 12%; top: 10%;
  border-radius: 50%;
  background: radial-gradient(#fffbe6 30%, rgba(255, 244, 200, .5) 55%, transparent 72%);
}

.clouds { position: absolute; inset: 0; pointer-events: none; }
.cloud {
  position: absolute; display: block;
  width: 220px; height: 60px;
  background: #fff; border-radius: 60px; opacity: .92;
  filter: blur(1px);
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: #fff; border-radius: 50%;
}
.cloud::before { width: 100px; height: 90px; left: 30px; top: -45px; }
.cloud::after { width: 80px; height: 70px; right: 30px; top: -30px; }
.c1 { left: 5%; top: 60%; transform: scale(.7); }
.c2 { left: 55%; top: 75%; transform: scale(.9); }
.c3 { left: 30%; top: 95%; transform: scale(.6); }
.c4 { left: 78%; top: 110%; transform: scale(.8); }
.c5 { left: -4%; top: 120%; transform: scale(1.6); }
.c6 { left: 60%; top: 150%; transform: scale(1.4); }
.c7 { left: 25%; top: 190%; transform: scale(1.8); }

.mountains {
  position: absolute; left: 0; right: 0; bottom: 18%;
  width: 100%; height: 40%;
}
.tower { position: absolute; left: 72%; bottom: 30%; height: 22%; }
.tower-glow { animation: pulse 2.2s ease-in-out infinite; }

.ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 36%;
}
.ground svg { width: 100%; height: 100%; display: block; }
.grass-tufts {
  position: absolute; left: 0; right: 0; bottom: 0; height: 60%;
  background:
    radial-gradient(4px 14px at 10% 40%, #8cc455 50%, transparent 52%),
    radial-gradient(4px 14px at 30% 70%, #8cc455 50%, transparent 52%),
    radial-gradient(4px 14px at 55% 50%, #8cc455 50%, transparent 52%),
    radial-gradient(4px 14px at 80% 65%, #8cc455 50%, transparent 52%);
  background-size: 160px 80px;
  opacity: .7;
}

.wind { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.wind i {
  position: absolute; height: 2px; width: 120px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9), transparent);
}
.wind i:nth-child(1) { top: 20%; left: 10%; }
.wind i:nth-child(2) { top: 35%; left: 60%; width: 180px; }
.wind i:nth-child(3) { top: 55%; left: 30%; }
.wind i:nth-child(4) { top: 70%; left: 75%; width: 90px; }
.wind i:nth-child(5) { top: 45%; left: 5%; width: 150px; }

/* The camera "descends": far layers drift up slowly, near clouds rush past,
   the ground rises into view. Everything starts parked in the sky. */
#world .mountains, #world .tower { transform: translateY(60%); }
#world .ground { transform: translateY(100%); }
#world.descending .clouds-far { animation: rise-far 7s ease-out forwards; }
#world.descending .clouds-near { animation: rise-near 7s ease-in-out forwards; }
#world.descending .mountains,
#world.descending .tower { animation: settle 7s ease-out forwards; }
#world.descending .ground { animation: ground-up 7s cubic-bezier(.3, .1, .3, 1) forwards; }
#world.descending .wind { animation: wind 7s linear forwards; }
#world.descending .wind i { animation: whoosh .9s linear infinite; }
#world.descending .wind i:nth-child(2n) { animation-delay: .3s; }
#world.descending .wind i:nth-child(3n) { animation-delay: .55s; }
#world.landed .clouds-far { transform: translateY(-55%); }
#world.landed .clouds-near { transform: translateY(-210%); }
#world.landed .mountains, #world.landed .tower { transform: none; }
#world.landed .ground { transform: none; }

#hero {
  position: absolute;
  width: min(220px, 42vw);
  aspect-ratio: 200 / 240;
  left: 50%;
  bottom: 14%;
  transform: translate(-50%, -140vh);
  opacity: 0;
}
#hero svg { width: 100%; height: 100%; overflow: visible; }
#hero .glider { transform-origin: 100px 110px; transition: transform .35s ease-in, opacity .35s; }
#hero .arm-down { opacity: 0; }
#hero .mini-slate { opacity: 0; transition: opacity .3s; }
#world.descending #hero { opacity: 1; animation: glide 7s cubic-bezier(.35, .05, .35, 1) forwards; }
#world.descending #hero svg { animation: sway 1.6s ease-in-out infinite; }
#world.landed #hero { opacity: 1; transform: translate(-50%, 0); }
#world.landed #hero .glider { transform: scale(.05, .05) translateY(600px); opacity: 0; }
#world.landed #hero .arm-up { opacity: 0; }
#world.landed #hero .arm-down { opacity: 1; }
#world.landed #hero .body { animation: hop .45s ease-out; transform-origin: 100px 210px; }
#world.checking #hero .mini-slate { opacity: 1; animation: pulse 1s ease-in-out infinite; }

/* 3D mode: Cesium fills the world and the 2D scenery steps aside. The globe
   stays laid out underneath from the start so Cesium can size itself. */
#globe { position: absolute; inset: 0; }
#globe .cesium-viewer, #globe .cesium-widget { width: 100%; height: 100%; }
#globe .cesium-widget canvas { display: block; }
#globe .cesium-viewer-bottom { opacity: .75; transform: scale(.85); transform-origin: left bottom; }
#world.is-3d .sky, #world.is-3d .sun, #world.is-3d .clouds, #world.is-3d .mountains,
#world.is-3d .tower, #world.is-3d .ground, #world.is-3d #hero { display: none; }
#world.flying .wind { opacity: .8; }
#world.flying .wind i { animation: whoosh .9s linear infinite; }
#world.flying .wind i:nth-child(2n) { animation-delay: .3s; }
#world.flying .wind i:nth-child(3n) { animation-delay: .55s; }
#world.is-3d .title-card { justify-content: flex-start; padding-top: max(56px, 9vh); background: linear-gradient(rgba(10, 20, 30, .55), transparent 45%, transparent 75%, rgba(10, 20, 30, .45)); }
#world.is-3d .title-card .press { position: absolute; left: 0; right: 0; bottom: max(28px, 7vh); }

/* In-flight HUD */
.hud { display: none; position: absolute; inset: 0; pointer-events: none; z-index: 3; }
#world.flying .hud, #world.descending .hud, #world.landed .hud { display: block; }
.hud-hearts {
  position: absolute; top: max(18px, env(safe-area-inset-top)); left: 22px;
  display: flex; flex-wrap: wrap; gap: 3px; width: 220px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6));
}
.hud-hearts svg { width: 19px; height: 17px; fill: #e5353b; stroke: #fff; stroke-width: 1.4; }
.hud-stamina { position: absolute; left: 60%; top: 42%; width: 52px; height: 52px; transform: rotate(-90deg); filter: drop-shadow(0 0 3px rgba(0, 0, 0, .5)); transition: opacity .6s; }
.hud-stamina circle { fill: none; stroke-width: 7; }
.hud-stamina .track { stroke: rgba(20, 30, 20, .55); }
.hud-stamina .bar { stroke: #3fd14a; stroke-dasharray: 119.4; stroke-dashoffset: 0; transition: stroke-dashoffset 1s ease; }
#world.flying .hud-stamina .bar { animation: drain 26s linear forwards; }
#world.landed .hud-stamina { opacity: 0; }
.hud-minimap {
  position: absolute; right: 22px; bottom: 22px; width: 150px; height: 150px;
  border-radius: 50%; overflow: hidden;
  border: 3px solid rgba(255, 255, 255, .85);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .35), 0 4px 18px rgba(0, 0, 0, .45);
}
.hud-map { position: absolute; inset: -40%; animation: minimap 26s linear infinite; }
.hud-map img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.hud-arrow {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -60%);
  border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 18px solid var(--gold);
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, .8));
}
.hud-n {
  position: absolute; left: 50%; top: 6px; transform: translateX(-50%);
  font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000;
}
.hud-place {
  position: absolute; right: 22px; bottom: 182px; margin: 0;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; color: #fff; text-shadow: 0 1px 3px #000;
}
#world.landed .hud-place, #world.landed .hud-minimap { opacity: .9; }
@keyframes drain { to { stroke-dashoffset: 95; stroke: #e8c43a; } }
@keyframes minimap { to { transform: rotate(-40deg) scale(1.15); } }
@media (max-width: 600px) {
  .hud-hearts { width: 150px; left: 14px; }
  .hud-hearts svg { width: 13px; height: 12px; }
  .hud-minimap { width: 96px; height: 96px; right: 14px; bottom: 14px; }
  .hud-place { right: 14px; bottom: 118px; font-size: 11px; }
  .hud-stamina { width: 40px; height: 40px; }
}
@media (max-width: 600px) { #world.landed .hud-minimap, #world.landed .hud-place { display: none; } }

/* Title card */
.title-card {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(10, 30, 50, .25), rgba(10, 20, 30, .55));
  transition: opacity .8s;
}
.title-card.gone { opacity: 0; pointer-events: none; }
.eyebrow {
  margin: 0; font-family: var(--title); letter-spacing: .3em; font-size: clamp(12px, 2vw, 16px);
  color: #fff7dc; text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.title-card h1 {
  margin: 8px 0 28px;
  font-family: var(--title); font-weight: 400;
  font-size: clamp(36px, 8vw, 92px); line-height: 1;
  color: #fff; text-shadow: 0 3px 0 #6b4a22, 0 8px 30px rgba(0, 0, 0, .45);
}
.title-card h1 span { color: var(--gold); display: inline-block; }
.press {
  margin: 0; font-weight: 600; letter-spacing: .08em; color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .6);
  animation: blink 1.6s ease-in-out infinite;
}

/* Dialog box */
.textbox {
  position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(720px, calc(100% - 32px));
  min-height: 112px;
  padding: 18px 24px 22px;
  background: var(--box);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
  backdrop-filter: blur(4px);
}
.textbox[hidden] { display: none; }
.speaker {
  position: absolute; top: -14px; left: 22px; margin: 0;
  padding: 2px 14px; border-radius: 999px;
  background: var(--gold); color: #2a1e08;
  font-family: var(--title); font-size: 15px;
}
.textbox .line { margin: 6px 0 0; font-size: clamp(16px, 2.4vw, 20px); line-height: 1.45; min-height: 2.9em; }
.textbox .line em { color: var(--orange); font-style: normal; font-weight: 800; }
.next {
  position: absolute; right: 22px; bottom: 10px; font-size: 12px; color: var(--gold);
  opacity: 0; animation: bob 1s ease-in-out infinite;
}
.textbox.ready .next { opacity: 1; }

.skip {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: 16px;
  background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer;
}
.skip:hover { background: rgba(0, 0, 0, .55); }

/* ================= Sheikah Slate ================= */
.slate {
  position: relative; z-index: 5;
  min-height: 100%;
  padding: max(16px, env(safe-area-inset-top)) 16px 16px;
  background:
    radial-gradient(ellipse at top, rgba(79, 227, 255, .08), transparent 60%),
    #0d1012;
  transform-origin: 50% 70%;
}
.slate[hidden] { display: none; }
.slate { perspective: 1600px; perspective-origin: 50% 30%; }
.slate.over-3d {
  position: fixed; inset: 0; overflow-y: auto;
  background: radial-gradient(ellipse at top, rgba(79, 227, 255, .08), transparent 60%), rgba(6, 10, 12, .5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.slate.over-3d .fine { color: #b7bcc0; }
.slate.opening .slate-frame { animation: slate-rise 1.15s cubic-bezier(.2, .85, .25, 1) backwards; }
.slate.opening .slate-boot { animation: boot 1.9s ease-out forwards; }

.slate-frame {
  position: relative;
  max-width: 1180px; margin: 0 auto;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform .25s ease-out;
  background: linear-gradient(var(--slate-2), var(--slate));
  border: 2px solid var(--slate-edge);
  border-radius: 28px;
  /* Layered edges give the device some thickness. */
  box-shadow: 0 0 0 6px #14181b, 0 2px 0 7px #2b3238, 0 10px 0 7px #0b0d0f, 0 30px 60px rgba(0, 0, 0, .55), 0 0 40px rgba(79, 227, 255, .12), inset 0 0 30px rgba(0, 0, 0, .5);
  overflow: hidden;
}
.slate-boot {
  position: absolute; inset: 0; z-index: 10;
  display: grid; place-items: center;
  background: radial-gradient(circle, #1e262b, #0f1315);
  color: var(--orange);
  opacity: 0; pointer-events: none;
}
.slate-boot svg { width: min(220px, 40%); filter: drop-shadow(0 0 18px rgba(255, 154, 60, .8)); }

.slate-top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--slate-edge);
  background: linear-gradient(rgba(79, 227, 255, .06), transparent);
}
.slate-eye { color: var(--orange); width: 44px; filter: drop-shadow(0 0 6px rgba(255, 154, 60, .6)); }
.slate-eye svg { display: block; width: 100%; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  background: none; border: 0; cursor: pointer;
  padding: 8px 14px; border-radius: 999px;
  font-family: var(--title); font-size: 15px; color: var(--muted);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: #10161a; background: var(--cyan); box-shadow: 0 0 14px rgba(79, 227, 255, .5); }
.region { margin: 0 0 0 auto; font-size: 13px; color: var(--muted); }
.region strong { color: var(--gold); }

.panel { padding: 20px; }
.panel[hidden] { display: none; }

/* Map */
.panel-map { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.map-wrap { position: relative; }
.map {
  position: relative; aspect-ratio: 1; width: 100%;
  border-radius: 14px; overflow: hidden;
  border: 1px solid #4b5a52;
  background: #2c3a33;
  touch-action: manipulation;
}
.map img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.regions span {
  position: absolute; transform: translate(-50%, -50%);
  font-family: var(--title); font-size: clamp(10px, 1.5vw, 15px); letter-spacing: .14em;
  color: rgba(255, 252, 240, .9); white-space: nowrap; pointer-events: none;
  text-shadow: 0 0 4px rgba(20, 28, 24, .9), 0 1px 2px rgba(20, 28, 24, .9);
}
.coords {
  position: absolute; right: 14px; bottom: 12px; margin: 0; z-index: 2; pointer-events: none;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(10, 14, 16, .6); border: 1px solid rgba(255, 255, 255, .12);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.map-contours { position: absolute; inset: 0; width: 100%; height: 100%; }
.fog {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 52% 45%, transparent 55%, rgba(10, 14, 16, .65) 100%);
}

.pin {
  position: absolute; transform: translate(-50%, -50%);
  width: 34px; height: 34px; padding: 0; border: 0; background: none; cursor: pointer;
  z-index: 2;
}
.pin .icon {
  display: grid; place-items: center;
  width: 100%; height: 100%; border-radius: 50%;
  background: rgba(16, 22, 26, .78);
  border: 2px solid var(--cyan);
  color: var(--cyan);
  font-size: 15px; line-height: 1;
  box-shadow: 0 0 10px rgba(79, 227, 255, .55);
  transition: transform .15s, background .15s;
}
.pin.kind-tower .icon { border-color: var(--orange); color: var(--orange); box-shadow: 0 0 10px rgba(255, 154, 60, .55); border-radius: 6px; transform: rotate(45deg); }
.pin.kind-tower .icon > span { transform: rotate(-45deg); }
.pin.kind-village .icon { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 10px rgba(232, 195, 90, .5); }
.pin:hover .icon, .pin:focus-visible .icon, .pin.active .icon { background: var(--cyan); color: #10161a; transform: scale(1.18); }
.pin.kind-tower:hover .icon, .pin.kind-tower.active .icon { background: var(--orange); transform: rotate(45deg) scale(1.18); }
.pin.kind-village:hover .icon, .pin.kind-village.active .icon { background: var(--gold); }
.pin.visited .icon::after {
  content: ""; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--gold);
}
.pin .name {
  position: absolute; left: 50%; top: 100%; margin-top: 4px; transform: translateX(-50%);
  white-space: nowrap; font-size: 11px; font-weight: 800; letter-spacing: .02em;
  color: #fff; text-shadow: 0 1px 3px #000, 0 0 6px #000;
  pointer-events: none;
  opacity: 0; transition: opacity .15s;
}
.pin:hover .name, .pin:focus-visible .name, .pin.active .name { opacity: 1; }
.pin:hover, .pin:focus-visible, .pin.active { z-index: 4; }
.pin.talking { z-index: 6; }
.bubble {
  position: absolute; left: 50%; bottom: calc(100% + 10px);
  transform: translateX(-50%) scale(.6); transform-origin: 50% 100%;
  width: max-content; max-width: 210px;
  padding: 8px 12px; border-radius: 12px;
  background: #fff8e4; color: #2a1e08;
  font-size: 12.5px; font-weight: 600; line-height: 1.35; text-align: left;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 3;
}
.bubble::after {
  content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: #fff8e4;
}
.bubble.show { opacity: 1; transform: translateX(-50%) scale(1); }
.pin.edge-left .bubble { left: 0; transform: scale(.6); transform-origin: 10% 100%; }
.pin.edge-left .bubble.show { transform: scale(1); }
.pin.edge-left .bubble::after { left: 16px; }
.pin.edge-right .bubble { left: auto; right: 0; transform: scale(.6); transform-origin: 90% 100%; }
.pin.edge-right .bubble.show { transform: scale(1); }
.pin.edge-right .bubble::after { left: auto; right: 10px; transform: none; }
.pin.edge-top .bubble { bottom: auto; top: calc(100% + 22px); transform-origin: 50% 0; }
.pin.edge-top .bubble::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #fff8e4; }

.you-are-here { position: absolute; transform: translate(-50%, -50%); z-index: 2; pointer-events: none; }
.you-are-here .arrow {
  display: block; width: 0; height: 0; margin: 0 auto;
  border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 22px solid var(--gold);
  filter: drop-shadow(0 0 6px rgba(232, 195, 90, .8));
  animation: look 3s ease-in-out infinite;
  transform-origin: 50% 70%;
}
.you-are-here .label {
  display: block; margin-top: 4px; font-size: 11px; font-weight: 800; white-space: nowrap;
  color: var(--gold); text-shadow: 0 1px 3px #000;
}

.map-name {
  position: absolute; left: 16px; top: 14px; margin: 0; pointer-events: none; z-index: 2;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .8);
}
.map-name span { display: block; font-family: var(--title); font-size: clamp(20px, 3vw, 30px); color: #fff; }
.map-name em { font-size: 12px; color: var(--muted); }

.info {
  position: sticky; top: 16px;
  background: rgba(10, 14, 16, .6);
  border: 1px solid var(--slate-edge);
  border-radius: 14px;
  padding: 18px 18px 20px;
  min-height: 260px;
}
.info-kicker { margin: 0; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); }
.info h2 { margin: 6px 0 2px; font-family: var(--title); font-weight: 400; font-size: 26px; color: #fff; }
.info-loc { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.info p { line-height: 1.55; }
.info.flash { animation: flash .4s ease-out; }
.info-stat:empty { display: none; }
.info-stat {
  margin-top: 14px; padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 154, 60, .1); border: 1px solid rgba(255, 154, 60, .35);
  color: #ffd0a1; font-size: 14px; font-weight: 600;
}

/* Compendium */
.entry {
  display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px;
  padding: 20px; border-radius: 14px;
  background: rgba(10, 14, 16, .55); border: 1px solid var(--slate-edge);
}
.entry + .entry { margin-top: 16px; }
.entry-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 2px solid var(--gold); }
.entry-photo-empty {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px;
  border: 2px dashed var(--slate-edge); color: var(--slate-edge);
  font-family: var(--title); font-size: 72px;
}
.entry-small { grid-template-columns: 120px minmax(0, 1fr); }
.entry-no { margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.entry h2 { margin: 4px 0 10px; font-family: var(--title); font-weight: 400; font-size: 32px; color: #fff; }
.entry p { line-height: 1.6; margin: 0 0 12px; }
.entry-meta { margin: 0; display: grid; gap: 10px; }
.entry-meta dt { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.entry-meta dd { margin: 2px 0 0; }

/* Adventure log */
.log-head { margin: 4px 0 12px; font-family: var(--title); font-weight: 400; font-size: 22px; color: var(--gold); }
.quests { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; }
.quest {
  position: relative; padding: 14px 16px 14px 46px; border-radius: 12px;
  background: rgba(10, 14, 16, .55); border: 1px solid var(--slate-edge);
}
.quest::before {
  content: ""; position: absolute; left: 16px; top: 18px; width: 14px; height: 14px;
  border-radius: 50%; border: 2px solid var(--muted);
}
.quest.active { border-color: var(--cyan); box-shadow: 0 0 14px rgba(79, 227, 255, .15); }
.quest.active::before { border-color: var(--cyan); background: var(--cyan); animation: pulse 1.6s infinite; }
.quest.done { opacity: .75; }
.quest.done::before { border-color: var(--gold); background: var(--gold); }
.quest strong { display: block; color: #fff; margin-bottom: 4px; }
.quest span { color: var(--muted); line-height: 1.5; }

/* Album */
.panel-album { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.snap {
  margin: 0; padding: 10px 10px 14px; border-radius: 12px;
  background: #f3ecd8; color: #2a1e08;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .4);
}
.snap:nth-child(odd) { transform: rotate(-1.2deg); }
.snap:nth-child(even) { transform: rotate(1deg); }
.snap img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.snap figcaption { padding: 10px 4px 0; font-size: 14px; line-height: 1.45; }
.snap figcaption strong { display: block; font-family: var(--title); font-weight: 400; font-size: 18px; }

.slate-bottom {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 20px; border-top: 1px solid var(--slate-edge);
  font-size: 13px; color: var(--muted);
}
kbd {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 4px;
  border-radius: 50%; background: var(--slate-edge); color: #fff;
  font-family: var(--body); font-size: 11px; font-weight: 800;
}
.linkish { background: none; border: 0; padding: 0; cursor: pointer; color: var(--cyan); font-weight: 700; }
.linkish:hover { text-decoration: underline; }
.glaze-count { color: var(--gold); font-weight: 700; }
.replay { margin-left: auto; }

.fine { max-width: 1180px; margin: 14px auto 4px; text-align: center; font-size: 12px; color: #6f7377; line-height: 1.5; }
.fine a { color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 20;
  transform: translate(-50%, 30px); opacity: 0;
  padding: 10px 18px; border-radius: 999px;
  background: var(--box); border: 1px solid var(--gold); color: var(--gold);
  font-weight: 700; font-size: 14px; text-align: center;
  max-width: calc(100% - 32px);
  transition: opacity .25s, transform .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ================= Keyframes ================= */
@keyframes glide {
  0%   { transform: translate(-190%, -110vh) rotate(-6deg); }
  35%  { transform: translate(-20%, -62vh) rotate(4deg); }
  65%  { transform: translate(-80%, -26vh) rotate(-3deg); }
  100% { transform: translate(-50%, 0) rotate(0); }
}
@keyframes sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes rise-far { to { transform: translateY(-55%); } }
@keyframes rise-near { to { transform: translateY(-210%); } }
@keyframes settle { to { transform: none; } }
@keyframes ground-up { 0% { transform: translateY(100%); } 55% { transform: translateY(55%); } 100% { transform: none; } }
@keyframes wind { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes whoosh { from { transform: translateY(120px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(-160px); opacity: 0; } }
@keyframes hop { 0% { transform: translateY(0) scaleY(1); } 30% { transform: translateY(4px) scaleY(.92); } 60% { transform: translateY(-10px); } 100% { transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@keyframes look { 0%, 100% { transform: rotate(30deg); } 50% { transform: rotate(50deg); } }
@keyframes flash { from { box-shadow: 0 0 0 2px var(--cyan), 0 0 24px rgba(79, 227, 255, .5); } to { box-shadow: none; } }
@keyframes slate-rise {
  0% { transform: translateY(75vh) rotateX(68deg) scale(.5); opacity: 0; filter: brightness(.4); }
  45% { opacity: 1; }
  75% { transform: translateY(-8px) rotateX(-3deg) scale(1.01); filter: brightness(1); }
  100% { transform: none; }
}
@keyframes boot {
  0% { opacity: 1; color: #6a4a2a; }
  35% { opacity: 1; color: var(--orange); }
  55% { opacity: 1; color: var(--cyan); }
  100% { opacity: 0; color: var(--cyan); }
}

/* ================= Small screens ================= */
@media (max-width: 860px) {
  .panel-map { grid-template-columns: 1fr; }
  .info { position: static; min-height: 0; }
  .region { margin-left: 0; width: 100%; }
  .entry, .entry-small { grid-template-columns: 1fr; }
  .entry-photo { max-width: 240px; }
  .entry-small .entry-photo { max-width: 120px; }
  .replay { margin-left: 0; }
}
@media (max-width: 520px) {
  .slate { padding-left: 8px; padding-right: 8px; }
  .slate-frame { border-radius: 20px; }
  .panel { padding: 12px; }
  .slate-top { padding: 12px; gap: 10px; }
  .tab { padding: 6px 10px; font-size: 13px; }
  .pin { width: 22px; height: 22px; }
  .pin .icon { font-size: 10px; border-width: 1.5px; }
  .pin .name { display: none; }
  .map-name em { display: none; }
  .regions span:nth-child(n+3) { display: none; }
  .coords { display: none; }
  .bubble { max-width: 160px; font-size: 11.5px; }
  .slate-bottom { gap: 12px; padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
