/* islanoctis.com/map (portal/map_api.py, portal/map.html): the header and the box the live map sits in.
   Every rule starts with .mp (the page), #nx-map (the map's box) or html.nx-map-, so nothing else on the site
   changes. The map's own styles are /assets/map-app.css, loaded only inside the map's shadow root. */

/* ------------------------------------------------------------------ the header: night sky and a compass */
.mp-hero { --c-cyan: var(--glow, #3fe3f2); --c-amber: var(--ember, #e8953c); --c-green: #6cc644; --t: var(--c-cyan);
  position: relative; overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--vine, #16303b);
  background: radial-gradient(ellipse 55% 130% at 8% 0%, rgba(63, 227, 242, .17), transparent 65%),
              radial-gradient(ellipse 50% 110% at 92% 10%, rgba(232, 149, 60, .13), transparent 70%),
              linear-gradient(180deg, #0b1620 0%, #08141b 60%, var(--night, #050d12) 100%); }
.mp-sky { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.mp-star { fill: #eaf6ff; animation: mp-twinkle 4.5s ease-in-out infinite alternate; }
@keyframes mp-twinkle { 0% { fill-opacity: .95; } 100% { fill-opacity: .2; } }
.mp-hero-in { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: clamp(1rem, 3vw, 2.25rem); align-items: center;
  padding-block: clamp(.7rem, 1.4vw, 1rem); }

.mp-compass { position: relative; width: clamp(3.9rem, 5.6vw, 4.8rem); aspect-ratio: 1; border-radius: 50%; color: var(--c-cyan);
  background: radial-gradient(circle, rgba(63, 227, 242, .14), rgba(5, 13, 18, .88) 70%); border: 1px solid rgba(63, 227, 242, .5);
  box-shadow: 0 0 0 4px rgba(5, 13, 18, .8), 0 0 38px rgba(63, 227, 242, .28); }
.mp-ring { position: absolute; inset: 0; margin: auto; border-radius: 50%; border: 1px dashed rgba(63, 227, 242, .3); }
.mp-ring.r1 { width: 62%; height: 62%; } .mp-ring.r2 { width: 84%; height: 84%; border-style: solid; border-color: rgba(63, 227, 242, .16); }
.mp-tick { position: absolute; font: 600 .56rem/1 var(--font-body, sans-serif); font-style: normal; letter-spacing: .04em; color: #bfe9ef; }
.mp-tick.n { top: 5%; left: 50%; transform: translateX(-50%); color: var(--c-amber); } .mp-tick.s { bottom: 5%; left: 50%; transform: translateX(-50%); }
.mp-tick.e { right: 6%; top: 50%; transform: translateY(-50%); } .mp-tick.w { left: 6%; top: 50%; transform: translateY(-50%); }
.mp-needle { position: absolute; inset: 0; margin: auto; width: 58%; height: 58%; animation: mp-needle 7s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(63, 227, 242, .7)); }
.mp-needle .north { fill: var(--c-amber); } .mp-needle .south { fill: #cdeff4; } .mp-needle circle { fill: #06171b; stroke: #cdeff4; stroke-width: 1; }
@keyframes mp-needle { 0% { transform: rotate(-14deg); } 30% { transform: rotate(22deg); } 55% { transform: rotate(4deg); } 80% { transform: rotate(31deg); } 100% { transform: rotate(-14deg); } }

.mp-hello { min-width: 0; text-shadow: 0 2px 12px rgba(0, 0, 0, .7); }
.mp-hello .eyebrow { margin: 0 0 .3rem; }
/* the title with its two lines of text beside it, so the header stays short and the map starts high */
.mp-title { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem 1rem; margin: 0 0 .55rem; }
.mp-hello h1 { flex: none; margin: 0; font: italic 800 clamp(1.8rem, 3.4vw, 2.6rem)/.95 var(--font-display, sans-serif); text-transform: uppercase; letter-spacing: .01em; }
.mp-hello h1 span { color: var(--c-cyan); text-shadow: 0 0 28px rgba(63, 227, 242, .55); }
.mp-hello .mp-sub { flex: 1 1 17rem; margin: 0; max-width: 46ch; color: #cfe3e8; font-size: .9rem; line-height: 1.35; }
.mp-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.mp-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .32rem .75rem; border-radius: 999px; font: 600 .74rem/1.2 var(--font-body, sans-serif);
  letter-spacing: .05em; text-transform: uppercase; color: #d7eef1; background: rgba(5, 13, 18, .62); border: 1px solid rgba(140, 220, 230, .3);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.mp-ic { width: 1rem; height: 1rem; flex: none; color: var(--c-cyan); }
.mp-chip.live { border-color: rgba(108, 198, 68, .55); color: #c6f1b1; }
.mp-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #5c7a84; flex: none; }
.mp-dot.on { background: var(--c-green); box-shadow: 0 0 0 0 rgba(108, 198, 68, .7); animation: mp-pulse 1.8s ease-out infinite; }
@keyframes mp-pulse { 0% { box-shadow: 0 0 0 0 rgba(108, 198, 68, .7); } 100% { box-shadow: 0 0 0 .55rem rgba(108, 198, 68, 0); } }

.mp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.mp-stats > div { display: grid; gap: .3rem; min-width: 7.4rem; max-width: 12rem; padding: .7rem .9rem; border-radius: 12px; text-align: center;
  background: rgba(5, 13, 18, .66); border: 1px solid rgba(140, 220, 230, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 -2px 0 var(--t);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.mp-stats .t-cyan { --t: var(--c-cyan); } .mp-stats .t-amber { --t: var(--c-amber); } .mp-stats .t-green { --t: var(--c-green); }
.mp-stats b { font: italic 800 1.35rem/1 var(--font-display, sans-serif); letter-spacing: .02em; text-transform: uppercase; color: var(--t);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-stats span { font: 600 .68rem/1.2 var(--font-body, sans-serif); letter-spacing: .07em; text-transform: uppercase; color: #9fbcc5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-signin { display: flex; align-items: center; gap: .9rem; max-width: 30rem; padding: .7rem .9rem; border-radius: 12px;
  background: rgba(5, 13, 18, .66); border: 1px solid rgba(140, 220, 230, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 -2px 0 var(--c-amber);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.mp-signin p { flex: 1 1 auto; margin: 0; font-size: .88rem; line-height: 1.35; color: #cfe3e8; }
.mp-signin b { color: #fff; }
.mp-btn { flex: none; display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1.1rem; border-radius: 8px; font: 600 .82rem/1 var(--font-body, sans-serif);
  letter-spacing: .07em; text-transform: uppercase; text-decoration: none; color: #06171b; background: var(--c-cyan); box-shadow: 0 0 18px rgba(63, 227, 242, .35); }
.mp-btn .mp-ic { color: inherit; }
.mp-btn:hover { background: #8ff0f8; color: #06171b; }

/* ------------------------------------------------------------------ the map's box */
section.mp { padding-block: clamp(.6rem, 1.2vw, 1rem) clamp(1.5rem, 3vw, 2.5rem); }   /* section.: the site gives every section a tall gap */
/* The map is as tall as the window under the site's bar (and the tabs above the map), never tiny. */
#nx-map { display: block; --nxm-h: max(26rem, calc(100vh - var(--nb-h, 0rem) - 8.5rem)); min-height: calc(var(--nxm-h) + 5rem); scroll-margin-top: calc(var(--nb-h, 0rem) + .5rem); }
@supports (height: 100svh) { #nx-map { --nxm-h: max(26rem, calc(100svh - var(--nb-h, 0rem) - 8.5rem)); } }
.mp-loading { margin: 0; padding: 3rem 1rem; text-align: center; color: var(--fern, #8fb0ba); }

/* the map over the whole window (its own button; Esc leaves) */
html.nx-map-full { overflow: hidden; }
#nx-map.full { position: fixed; inset: 0; z-index: 2147483000; overflow: auto; min-height: 0; background: var(--night, #050d12); --nxm-h: calc(100vh - 5.6rem); }
@supports (height: 100dvh) { #nx-map.full { --nxm-h: calc(100dvh - 5.6rem); } }

@media (max-width: 1100px) {
  .mp-hero-in { grid-template-columns: auto minmax(0, 1fr); }
  .mp-stats, .mp-signin { grid-column: 1 / -1; max-width: none; }
  .mp-stats > div { max-width: none; min-width: 0; }
}
@media (max-width: 960px) {
  /* the side panel sits under the map: leave room to scroll past the map with a thumb */
  #nx-map { --nxm-h: clamp(18rem, min(68vh, 96vw), 36rem); }   /* no taller than it is wide: the whole island fills it */
  @supports (height: 100svh) { #nx-map { --nxm-h: clamp(18rem, min(68svh, 96vw), 36rem); } }
  #nx-map.full { --nxm-h: calc(100vh - 5.2rem); }
  @supports (height: 100dvh) { #nx-map.full { --nxm-h: calc(100dvh - 5.2rem); } }
}
@media (max-width: 560px) {
  .mp-compass { display: none; }
  .mp-hero-in { grid-template-columns: minmax(0, 1fr); }
  .mp-hello .mp-sub { display: none; }   /* the three chips say it; the map starts higher */
  .mp-title { margin-bottom: .45rem; }
  .mp-chips { gap: .35rem; }
  .mp-chip { padding: .28rem .6rem; font-size: .68rem; }
  .mp-stats { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, .85fr); gap: .4rem; }
  .mp-stats > div { padding: .5rem .45rem; }
  .mp-stats b { font-size: 1.02rem; }
  .mp-stats span { font-size: .62rem; letter-spacing: .05em; white-space: normal; }
  .mp-signin { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .mp-star, .mp-needle, .mp-dot.on { animation: none; } }
