/* ════════════════════════════════════════════════════════
   IkeStar — style.css
   
   SECTION MAP  (search by the comment to jump)
     :root             — CSS custom properties & color palette
     Fonts             — Orbitron + Libre Baskerville
     Base / Reset      — html, body, canvas
     Topbar            — #topbar, mode pills, culture switcher
     Info Panel        — #info-panel (star/planet click panel)
     Story Panel       — #story-panel (Moʻolelo mode)
     Learn Panel       — #learn-panel + lesson cards
     Formation Focus   — #formation-panel + canvas
     Compass Overlay   — #compass-overlay + Hawaiian sky map
     Controls bar      — #controls, toolbar buttons
     Loader            — #loader, splash animation
     Welcome overlay   — #welcome-overlay
     Whats Up Tonight  — #whatsup-card
     Tour card         — #tour-card
     Time panel        — #time-panel
     How-To modal      — #howto-modal
     Search overlay    — #search-overlay
     Photo mode        — body.photo-mode
     Auth modal        — #auth-overlay
     Toast / Joystick  — #sky-joystick, toast notifications
     Badge modal       — #badge-modal
     Responsive        — @media breakpoints
════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

/* ── Fonts ── */
  

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --gold:    #e8c96a;
    --gold2:   #ffd700;
    --cyan:    #00f7ff;
    --violet:  #7c3aed;
    --indigo:  #312e81;
    --sky:     #030a1a;
    --panel:   rgba(3,6,20,.97);
    --border:  rgba(0,247,255,.15);
    --text:    rgba(220,235,255,.85);
    --orb:     'Orbitron', monospace;
    --serif:   'Libre Baskerville', serif;
  }

  html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    background: #000;
    font-family: var(--serif);
    color: var(--text);
    cursor: none;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    height: 100dvh; /* Dynamic viewport for mobile */
    min-height: -webkit-fill-available;
  }

  canvas { display: block; position: fixed; inset: 0; z-index: 0; }

  /* Force cursor:none everywhere so the ʻIwa div is always the only cursor */
  *, *::before, *::after,
  button, a, input, select, textarea, label,
  [role="button"], [tabindex], [draggable] {
    cursor: none !important;
  }

  /* ── Custom cursor ── */
  #cursor {
    position: fixed; pointer-events: none; z-index: 2147483647;
    transform: translate(-50%,-55%);
    transition: opacity .15s; will-change: transform;
  }
  #cursor img {
    width: 56px; height: auto; display: block;
    filter: drop-shadow(0 0 8px rgba(0,247,255,.7))
            drop-shadow(0 0 20px rgba(0,247,255,.35));
    transform: rotate(-38deg); /* beak points toward upper-right / direction of travel */
    transition: filter .15s, transform .12s;
  }
  #cursor.hover img {
    filter: drop-shadow(0 0 12px rgba(0,247,255,1))
            drop-shadow(0 0 32px rgba(0,247,255,.65));
    transform: rotate(-38deg) scale(1.18);
  }
  #cursor.drag img {
    opacity: .55; transform: rotate(-38deg) scale(.92);
  }
  #cursor.loading img { opacity: .3; animation: iwa-spin 1.2s linear infinite; }
  @keyframes iwa-spin { to { transform: rotate(360deg); } }

  /* ── Top header ── */
  /* ══════════════════════════════════════════════════════
     UNIFIED NAV BAR — single dark strip, two rows
     Row 1: logo | title | clock
     Row 2: mode pills | divider | culture tabs  (one scroll zone)
  ══════════════════════════════════════════════════════ */
  #topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    display: flex; flex-direction: column;
    background: rgba(4,6,20,.96);
    border-bottom: 1px solid rgba(0,247,255,.10);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    pointer-events: none;
  }

  /* Single combined topbar row: logo · modes · culture · clock · profile */
  #topbar-row1 {
    display: flex; align-items: stretch; gap: 0;
    padding: 0 10px 0;
    pointer-events: all;
    min-height: 46px;
  }
  #top-time {
    flex-shrink: 0; text-align: right; pointer-events: none;
    font-family: var(--orb); font-size: .52rem; letter-spacing: .07em;
    color: rgba(232,201,106,.48); line-height: 1.3;
    display: flex; flex-direction: column; justify-content: center;
    padding: 0 8px;
  }
  #topbar-profile-btn {
    flex-shrink: 0;
    width: 38px; height: 38px; border-radius: 50%;
    border: 1.5px solid rgba(0,247,255,.3);
    touch-action: manipulation;
    overflow: hidden; text-decoration: none;
    pointer-events: all;
    display: flex; align-items: center; justify-content: center;
    align-self: center;
    background: rgba(0,247,255,.06);
    transition: border-color .15s, box-shadow .15s, background .15s;
  }
  #topbar-profile-btn:hover {
    border-color: rgba(0,247,255,.75);
    box-shadow: 0 0 12px rgba(0,247,255,.4);
    background: rgba(0,247,255,.12);
  }
  #topbar-profile-img {
    width: 90%; height: 90%;
    object-fit: contain; display: block;
  }
  #culture-switcher {
    display: flex; align-items: stretch; flex-shrink: 0;
    border-left: 1px solid rgba(255,255,255,.07);
    margin-left: 4px;
  }

  /* Culture tab buttons */
  .cult-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 10px; white-space: nowrap; flex-shrink: 0;
    background: transparent; border: none; border-bottom: 2px solid transparent;
    font-family: var(--orb); font-size: .5rem; letter-spacing: .07em;
    cursor: pointer; touch-action: manipulation;
    transition: color .16s, border-color .16s, background .16s;
    color: rgba(255,255,255,.35); min-height: 36px;
    position: relative;
  }
  .cult-btn:hover:not(.active) {
    color: rgba(255,255,255,.65); background: rgba(255,255,255,.04);
  }
  .cult-btn.active {
    color: rgba(0,247,255,.9); border-bottom-color: rgba(0,247,255,.7);
    background: rgba(0,247,255,.07);
  }
  .cult-btn[data-culture]:not([data-culture="hawaiian"]):not(.cult-dropdown-item) {
    color: rgba(170,190,205,.28);
    border-bottom-color: rgba(232,201,106,.22);
  }
  .cult-btn[data-culture]:not([data-culture="hawaiian"]):not(.cult-dropdown-item)::after {
    content: "BUILDING";
    position: absolute;
    top: 2px;
    right: 3px;
    padding: 1px 4px;
    border-radius: 4px;
    border: 1px solid rgba(232,201,106,.28);
    background: rgba(3,6,20,.86);
    color: rgba(232,201,106,.78);
    font-size: .36rem;
    letter-spacing: .08em;
    line-height: 1.2;
    pointer-events: none;
  }
  .fct-btn.is-building {
    position: relative;
    opacity: .48;
    border-color: rgba(232,201,106,.18);
    color: rgba(210,220,230,.36);
  }
  .fct-btn.is-building::after {
    content: "BUILDING";
    margin-left: 4px;
    color: rgba(232,201,106,.72);
    font-size: .42rem;
  }
  .mode-icon, .cult-icon { font-size: .82rem; line-height: 1; }

  /* Vertical divider between modes and cultures */
  #nav-divider {
    width: 1px; align-self: stretch; flex-shrink: 0;
    background: rgba(255,255,255,.08); margin: 6px 2px;
  }

  /* Mobile: icon-only mode pills below 560px */
  @media (max-width: 560px) {
    .mode-pill span:not(.mode-icon) { display: none; }
    .mode-pill { padding: 6px 4px; font-size: .46rem; }
    #top-time { display: none; }
  }
  @media (max-width: 360px) {
    .mode-pill { padding: 3px 2px; }
    #logo-text { display: none; }
  }
  .cult-btn:hover { color: rgba(255,255,255,.75); }
  .cult-icon { font-size: .85rem; line-height: 1; }

  /* ── Bottom controls ── */
  #controls {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px max(18px,env(safe-area-inset-bottom,18px));
    background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 100%);
    pointer-events: none;
  }
  #ctrl-left { display: flex; gap: 6px; align-items: center; pointer-events: all; }
  .ctrl-btn {
    width: 42px; height: 42px; border-radius: 12px;
    border: 1px solid rgba(0,247,255,.2); background: rgba(3,6,20,.82);
    color: rgba(0,247,255,.7); font-size: .82rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(16px); transition: all .15s;
    touch-action: manipulation;
  }
  .ctrl-btn:hover { background: rgba(0,247,255,.1); border-color: rgba(0,247,255,.4); }
  .ctrl-btn:active { transform: scale(.88); }
  .ctrl-btn.active { background: rgba(0,247,255,.15); border-color: rgba(0,247,255,.5); color: var(--cyan); }
  #ctrl-divider { width: 1px; height: 22px; background: rgba(0,247,255,.1); flex-shrink: 0; }
  #ctrl-hint {
    flex: 1; text-align: center;
    font-family: var(--orb); font-size: .52rem; letter-spacing: .1em;
    color: rgba(0,247,255,.22); pointer-events: none;
  }
  #ctrl-right { display: flex; gap: 6px; align-items: center; pointer-events: all; }

  /* ── Compass rose (fixed, corner) ── */
  #compass-widget {
    position: fixed;
    bottom: max(76px,calc(env(safe-area-inset-bottom,0px)+76px));
    right: 12px; z-index: 100;
    width: 158px; height: 158px;
    pointer-events: all; cursor: pointer;
    /* 3D perspective tilt — looks like a compass lying at an angle */
    perspective: 400px;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,.6));
    transition: filter .2s;
  }
  #compass-widget:hover {
    filter: drop-shadow(0 6px 24px rgba(0,247,255,.35)) drop-shadow(0 0 8px rgba(0,247,255,.15));
  }
  #compass-inner {
    width: 158px; height: 158px;
    transform: rotateX(28deg) rotateZ(-4deg);
    transform-origin: center bottom;
    transition: transform .3s cubic-bezier(.25,.46,.45,.94);
    position: relative;
  }
  #compass-widget:hover #compass-inner {
    transform: rotateX(18deg) rotateZ(-2deg) scale(1.04);
  }
  #compass-canvas {
    width: 158px; height: 158px; border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0,247,255,.2), inset 0 0 0 1px rgba(0,247,255,.08);
  }
  #compass-label {
    position: absolute; bottom: -22px; left: 0; right: 0;
    text-align: center; font-family: var(--orb);
    font-size: .46rem; letter-spacing: .14em;
    color: rgba(0,247,255,.32); text-transform: uppercase;
    pointer-events: none; transition: color .2s;
  }
  #compass-widget:hover #compass-label { color: rgba(0,247,255,.6); }
  #compass-look-dir {
    position: absolute; top: 50%; left: 50%;
    font-family: var(--orb); font-size: .52rem; letter-spacing: .1em;
    color: rgba(0,247,255,.55); transform: translate(-50%,220%);
    pointer-events: none; white-space: nowrap;
  }

  /* ── Info panel ── */
  #info-panel {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    background: var(--panel); border-top: 1px solid var(--border);
    border-radius: 24px 24px 0 0;
    max-height: 86vh; overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateY(102%);
    transition: transform .36s cubic-bezier(.25,.46,.45,.94);
    scrollbar-width: thin; scrollbar-color: rgba(0,247,255,.2) transparent;
    backdrop-filter: blur(28px);
    box-shadow: 0 -12px 60px rgba(0,0,0,.9);
    padding-bottom: max(24px,env(safe-area-inset-bottom,24px));
  }
  #info-panel.open { transform: translateY(0); }
  #info-panel::-webkit-scrollbar { width: 4px; }
  #info-panel::-webkit-scrollbar-thumb { background: rgba(0,247,255,.2); border-radius: 2px; }

  .panel-handle {
    width: 42px; height: 4px; background: rgba(0,247,255,.2);
    border-radius: 2px; margin: 14px auto 0;
  }
  .panel-inner { padding: 12px 22px 16px; }
  .panel-close {
    position: absolute; top: 12px; right: 16px; width: 36px; height: 36px;
    border-radius: 10px; border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.04); color: rgba(255,255,255,.6);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: .88rem; touch-action: manipulation;
  }
  .panel-close:hover { background: rgba(255,60,60,.12); color: #fff; }

  /* Panel sections */
  .panel-star-head {
    display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
  }
  .panel-star-glow {
    width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle, rgba(0,247,255,.18) 0%, transparent 70%);
  }
  .panel-star-dot {
    width: 14px; height: 14px; border-radius: 50%;
    background: #a0c8ff;
    box-shadow: 0 0 14px 5px rgba(0,200,255,.5);
  }
  .panel-names { flex: 1; min-width: 0; }
  .panel-haw {
    font-family: var(--orb); font-size: 1rem; font-weight: 700;
    letter-spacing: .05em; color: var(--gold);
    text-shadow: 0 0 18px rgba(232,201,106,.5); margin-bottom: 3px;
  }
  .panel-west {
    font-size: .88rem; color: rgba(255,255,255,.82);
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  }
  .panel-con {
    font-family: var(--orb); font-size: .62rem; letter-spacing: .07em;
    background: rgba(0,247,255,.08); border: 1px solid rgba(0,247,255,.15);
    border-radius: 4px; padding: 1px 7px; color: rgba(0,247,255,.55);
  }
  .panel-meaning {
    font-size: .74rem; color: rgba(232,201,106,.55); font-style: italic;
    margin-bottom: 10px;
  }
  .panel-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
  .panel-pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-family: var(--orb); font-size: .64rem; letter-spacing: .05em;
    color: rgba(0,247,255,.6); background: rgba(0,247,255,.07);
    border: 1px solid rgba(0,247,255,.12); border-radius: 6px; padding: 3px 9px;
  }
  .knowledge-status-row {
    display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 12px;
  }
  .knowledge-status {
    display:inline-flex;align-items:center;gap:5px;min-height:22px;padding:3px 8px;border-radius:999px;
    font-family:var(--orb);font-size:.48rem;font-weight:800;letter-spacing:.07em;text-transform:uppercase;
    border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.035);color:rgba(210,225,240,.68);
  }
  .knowledge-status.verified{border-color:rgba(60,179,113,.28);background:rgba(60,179,113,.08);color:rgba(95,220,145,.86);}
  .knowledge-status.encoded{border-color:rgba(0,247,255,.24);background:rgba(0,247,255,.07);color:rgba(0,247,255,.84);}
  .knowledge-status.review{border-color:rgba(232,201,106,.28);background:rgba(232,201,106,.075);color:rgba(232,201,106,.88);}
  .knowledge-status.draft{border-color:rgba(180,130,255,.24);background:rgba(180,130,255,.07);color:rgba(205,175,255,.8);}
  .panel-compass-row {
    display: flex; align-items: center; gap: 10px;
    padding: 12px; border-radius: 12px;
    background: rgba(0,247,255,.04); border: 1px solid rgba(0,247,255,.1);
    margin-bottom: 12px;
  }
  .panel-cdir { flex: 1; text-align: center; }
  .panel-clab { font-family: var(--orb); font-size: .5rem; letter-spacing: .1em; color: rgba(255,255,255,.3); margin-bottom: 2px; }
  .panel-chouse { font-family: var(--orb); font-size: .82rem; font-weight: 700; margin-bottom: 2px; }
  .panel-cdeg { font-size: .62rem; color: rgba(255,255,255,.3); }
  .panel-carr { font-size: .9rem; color: rgba(0,247,255,.22); }
  .panel-nav {
    display: flex; gap: 10px; padding: 10px 13px; border-radius: 10px;
    background: rgba(232,201,106,.05); border: 1px solid rgba(232,201,106,.14);
    font-size: .8rem; color: rgba(232,201,106,.82); line-height: 1.58;
    margin-bottom: 12px;
  }
  .panel-nav i { color: rgba(232,201,106,.45); flex-shrink: 0; margin-top: 2px; }
  .panel-sect { margin-bottom: 14px; }
  .panel-sect-lbl {
    font-family: var(--orb); font-size: .58rem; font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase; color: rgba(0,247,255,.4);
    border-bottom: 1px solid rgba(0,247,255,.08); padding-bottom: 5px;
    margin-bottom: 9px; display: flex; align-items: center; gap: 7px;
  }
  .panel-moolelo {
    font-size: .82rem; line-height: 1.76; color: rgba(210,230,248,.8);
    border-left: 2px solid rgba(0,247,255,.2); padding-left: 13px;
    font-style: italic;
  }
  .panel-trad {
    padding: 10px 12px; border-radius: 10px; margin-bottom: 6px;
    background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.06);
  }
  .panel-trad-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
  .panel-trad-icon { font-size: .95rem; }
  .panel-trad-name { font-family: var(--orb); font-size: .68rem; font-weight: 700; color: rgba(0,247,255,.88); }
  .panel-trad-cult { font-size: .58rem; color: rgba(255,255,255,.28); font-family: var(--orb); margin-left: auto; }
  .panel-trad-text { font-size: .77rem; line-height: 1.62; color: rgba(190,215,235,.72); }

  /* ── Moon panel extras ── */
  .panel-moon-disc { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
  #moon-canvas-panel { border-radius: 50%; box-shadow: 0 0 20px rgba(255,248,200,.3); }

  /* ── Loading ── */
  #loader {
    position: fixed; inset: 0; z-index: 9999;
    background: #000509; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 20px;
    transition: opacity .6s; font-family: var(--orb);
  }
  #loader.fade { opacity: 0; pointer-events: none; }
  #loader-title { font-size: 1.1rem; font-weight: 700; letter-spacing: .2em; color: var(--gold); }
  #loader-sub { font-size: .6rem; letter-spacing: .18em; color: rgba(0,247,255,.4); }
  #loader-bar { width: 180px; height: 2px; background: rgba(0,247,255,.1); border-radius: 1px; overflow: hidden; }
  #loader-fill { width: 0%; height: 100%; background: var(--cyan); border-radius: 1px; transition: width .4s; }
  #loader-star {
    font-size: 2.5rem; animation: spin 8s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ── Look Here button (formation panel) ── */
  .look-here-btn {
    display: inline-flex; align-items: center; gap: 5px;
    font-family: var(--orb); font-size: .60rem; letter-spacing: .06em;
    color: rgba(0,247,255,.92); background: rgba(0,247,255,.10);
    border: 1px solid rgba(0,247,255,.30); border-radius: 6px;
    padding: 4px 12px; cursor: pointer; transition: background .15s, border-color .15s;
    margin-top: 2px;
  }
  .look-here-btn:hover { background: rgba(0,247,255,.20); border-color: rgba(0,247,255,.55); }

  /* ── Horizon visibility badges ── */
  .horizon-up {
    color: rgba(80,220,110,.80) !important; background: rgba(80,220,110,.08) !important;
    border-color: rgba(80,220,110,.22) !important;
  }
  .horizon-down {
    color: rgba(255,160,70,.65) !important; background: rgba(255,160,70,.06) !important;
    border-color: rgba(255,160,70,.18) !important;
  }

  /* ── Culture formation-count badge ── */
  .cult-btn { position: relative; }
  .cult-count {
    position: absolute; top: 3px; right: 3px;
    min-width: 14px; height: 14px; line-height: 14px; text-align: center;
    font-family: var(--orb); font-size: .42rem; font-weight: 700; letter-spacing: 0;
    background: rgba(0,247,255,.14); border: 1px solid rgba(0,247,255,.22);
    border-radius: 3px; color: rgba(0,247,255,.60);
    pointer-events: none; padding: 0 2px;
  }

  /* ── Tooltip ── */
  #tooltip {
    position: fixed; z-index: 150; pointer-events: none;
    background: rgba(3,6,20,.92); border: 1px solid rgba(0,247,255,.2);
    border-radius: 10px; padding: 7px 12px;
    font-family: var(--orb); font-size: .64rem; letter-spacing: .06em;
    color: rgba(0,247,255,.9); white-space: nowrap;
    backdrop-filter: blur(16px);
    opacity: 0; transition: opacity .15s;
    transform: translate(-50%,-130%);
  }
  #tooltip.show { opacity: 1; }

  /* ── Moon glow overlay ── */
  #moon-glow {
    position: fixed; z-index: 5; pointer-events: none;
    border-radius: 50%; filter: blur(40px);
    background: radial-gradient(circle, rgba(255,248,200,.15) 0%, transparent 70%);
    display: none;
  }

  /* ── Mobile ── */
  @media (max-width:480px) {
    .cult-label { display: none; }
    #top-title { display: none; }
    .panel-inner { padding: 10px 14px 14px; }
    #formation-info-bar { max-height: 55%; }
    #compass-widget { width: 120px; height: 120px; right: 8px; }
    #compass-inner { width: 120px; height: 120px; }
    #compass-canvas { width: 120px; height: 120px; }
    /* Collapsed compass: small 52px circle, double-tap to toggle */
    #compass-widget.collapsed { width: 52px !important; height: 52px !important; border-radius: 50%; background: rgba(3,6,20,.88); border: 1.5px solid rgba(0,247,255,.35); overflow: hidden; }
    #compass-widget.collapsed > * { visibility: hidden; }
    #compass-widget.collapsed::after { content: 'N'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-family: var(--orb); font-size: .82rem; font-weight: 700; color: rgba(0,247,255,.85); letter-spacing: .1em; pointer-events: none; }
    #ctrl-hint { display: none; }
    .panel-facts-grid { grid-template-columns: repeat(2,1fr); }
  }
  @media (max-width:380px) {
    #ctrl-left .ctrl-btn:nth-child(n+4) { display: none; }
    #ctrl-divider { display: none; }
  }
  @media (hover:none) {
    /* Touch devices: larger targets */
    #info-panel { touch-action: pan-y; }
    .howto-step-kbd { min-width: 36px; min-height: 28px; display:inline-flex;align-items:center;justify-content:center; }
  }
  @supports (padding: max(0px)) {
    #controls { padding-bottom: max(18px, env(safe-area-inset-bottom, 18px)); }
    #topbar    { padding-top:    max(10px, env(safe-area-inset-top, 10px)); }
    #compass-widget { bottom: max(76px, calc(env(safe-area-inset-bottom,0px) + 76px)); }
  }

  /* Font Awesome */
  .fas { font-family: 'Font Awesome 6 Free'; font-weight: 900; }

  /* ── How To Use modal ── */
  #howto-modal {
    position:fixed;inset:0;z-index:10000;
    background:rgba(0,0,0,.85);backdrop-filter:blur(20px);
    display:flex;align-items:center;justify-content:center;
    opacity:0;pointer-events:none;transition:opacity .3s;
  }
  #howto-modal.show{opacity:1;pointer-events:all;}
  #howto-card {
    width:min(540px,94vw);max-height:88vh;overflow-y:auto;
    background:rgba(3,6,20,.98);border:1px solid rgba(0,247,255,.2);
    border-radius:20px;padding:0;
    box-shadow:0 28px 80px rgba(0,0,0,.9),0 0 60px rgba(0,247,255,.06);
    scrollbar-width:thin;scrollbar-color:rgba(0,247,255,.2) transparent;
  }
  #howto-card::-webkit-scrollbar{width:4px;}
  #howto-card::-webkit-scrollbar-thumb{background:rgba(0,247,255,.2);border-radius:2px;}
  #howto-head {
    padding:26px 28px 18px;border-bottom:1px solid rgba(0,247,255,.1);
    background:linear-gradient(180deg,rgba(0,247,255,.05),transparent);
    position:relative;
  }
  #howto-title{font-family:var(--orb);font-size:1rem;font-weight:700;letter-spacing:.12em;color:var(--gold);margin-bottom:4px;text-shadow:0 0 18px rgba(232,201,106,.5);}
  #howto-sub{font-size:.72rem;color:rgba(0,247,255,.4);font-family:var(--orb);letter-spacing:.08em;}
  #howto-close{position:absolute;top:14px;right:14px;width:34px;height:34px;border-radius:9px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.05);color:rgba(255,255,255,.6);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:.85rem;}
  #howto-close:hover{background:rgba(255,60,60,.12);}
  .howto-steps{padding:20px 28px 24px;display:flex;flex-direction:column;gap:12px;}
  .howto-step{display:flex;gap:14px;padding:12px 14px;border-radius:12px;background:rgba(255,255,255,.02);border:1px solid rgba(255,255,255,.06);}
  .howto-step-icon{font-size:1.4rem;flex-shrink:0;width:36px;text-align:center;padding-top:2px;}
  .howto-step-body{}
  .howto-step-title{font-family:var(--orb);font-size:.68rem;font-weight:700;color:rgba(0,247,255,.88);letter-spacing:.06em;margin-bottom:4px;}
  .howto-step-desc{font-size:.78rem;line-height:1.62;color:rgba(190,215,235,.75);}
  .howto-step-kbd{display:inline-block;background:rgba(0,247,255,.08);border:1px solid rgba(0,247,255,.2);border-radius:4px;padding:1px 7px;font-family:var(--orb);font-size:.6rem;color:rgba(0,247,255,.7);margin:0 2px;}
  #howto-footer{padding:14px 28px 20px;border-top:1px solid rgba(255,255,255,.06);display:flex;justify-content:space-between;align-items:center;}
  #howto-start{padding:10px 24px;border-radius:20px;border:1px solid rgba(0,247,255,.35);background:rgba(0,247,255,.1);color:rgba(0,247,255,.9);font-family:var(--orb);font-size:.72rem;letter-spacing:.08em;cursor:pointer;transition:background .15s;}
  #howto-start:hover{background:rgba(0,247,255,.2);}
  #howto-skip{font-size:.65rem;color:rgba(255,255,255,.35);cursor:pointer;font-family:var(--orb);letter-spacing:.06em;}
  #howto-skip:hover{color:rgba(255,255,255,.6);}

  /* ── Formation Focus Mode ── */
  #formation-panel {
    position:fixed;inset:0;z-index:9500;
    background:rgba(2,4,16,.95);backdrop-filter:blur(12px);
    display:flex;flex-direction:column;
    opacity:0;pointer-events:none;transition:opacity .38s;
  }
  #formation-panel.show{opacity:1;pointer-events:all;}
  #formation-topbar{
    display:flex;align-items:center;gap:12px;
    padding:max(12px,env(safe-area-inset-top,12px)) 18px 12px;
    background:linear-gradient(to bottom,rgba(0,0,0,.7),transparent);
    flex-shrink:0;position:relative;z-index:4;
  }
  #formation-back { min-height: 44px; }
  #formation-back{display:flex;align-items:center;gap:7px;padding:9px 15px;border-radius:20px;border:1px solid rgba(232,201,106,.5);background:linear-gradient(180deg,rgba(38,27,7,.95),rgba(8,10,18,.95));color:rgba(255,226,120,.96);font-family:var(--orb);font-size:.72rem;font-weight:700;letter-spacing:.06em;cursor:pointer;touch-action:manipulation;transition:background .14s,transform .14s,box-shadow .14s;box-shadow:0 0 18px rgba(232,201,106,.16);}
  #formation-back:hover{background:linear-gradient(180deg,rgba(56,39,9,.98),rgba(10,13,22,.98));box-shadow:0 0 22px rgba(232,201,106,.24);}
  #formation-back:active{transform:translateY(1px);background:rgba(232,201,106,.14);}
  #formation-title-wrap{flex:1;text-align:center;}
  #formation-title-main{font-family:var(--orb);font-size:.8rem;font-weight:700;letter-spacing:.1em;color:var(--gold);}
  #formation-title-sub{font-size:.58rem;color:rgba(0,247,255,.4);font-family:var(--orb);letter-spacing:.07em;}
  #formation-content{flex:1;display:flex;flex-direction:column;overflow:hidden;}
  #formation-canvas-wrap{flex:1;position:relative;min-height:0;}
  #formation-canvas{width:100%;height:100%;display:block;}
  #formation-info-bar{
    flex-shrink:0;
    background:linear-gradient(to top,rgba(2,4,16,.98),rgba(2,4,16,.88),transparent);
    padding:12px 18px max(18px,env(safe-area-inset-bottom,18px));
    max-height:48%;overflow-y:auto;
  }
  #formation-focus-meta{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:10px;}
  #formation-focus-meta span{
    display:inline-flex;align-items:center;gap:6px;min-height:28px;
    padding:0 10px;border-radius:999px;border:1px solid rgba(0,247,255,.16);
    background:rgba(0,247,255,.045);color:rgba(190,230,240,.78);
    font-family:var(--orb);font-size:.54rem;letter-spacing:.06em;
  }
  #formation-focus-meta i{color:rgba(232,201,106,.82);}
  #formation-focus-actions{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin-bottom:10px;}
  .ff-action{
    display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:32px;
    padding:0 12px;border-radius:8px;border:1px solid rgba(0,247,255,.16);
    background:rgba(0,247,255,.045);color:rgba(190,230,240,.78);
    font-family:var(--orb);font-size:.55rem;font-weight:700;letter-spacing:.07em;
    text-transform:uppercase;cursor:pointer;touch-action:manipulation;
  }
  .ff-action.primary{border-color:rgba(232,201,106,.42);background:rgba(232,201,106,.10);color:rgba(232,201,106,.94);}
  .ff-action:hover:not(:disabled){background:rgba(0,247,255,.10);border-color:rgba(0,247,255,.32);}
  .ff-action.primary:hover:not(:disabled){background:rgba(232,201,106,.16);border-color:rgba(232,201,106,.58);}
  .ff-action:disabled{opacity:.38;cursor:not-allowed;}
  .ff-label-mode{
    display:inline-flex;align-items:center;gap:2px;min-height:32px;padding:2px;
    border-radius:8px;border:1px solid rgba(0,247,255,.13);background:rgba(0,247,255,.035);
  }
  .ff-label-mode button{
    min-height:26px;padding:0 9px;border:0;border-radius:6px;background:transparent;
    color:rgba(180,205,220,.55);font-family:var(--orb);font-size:.48rem;font-weight:700;
    letter-spacing:.07em;text-transform:uppercase;cursor:pointer;touch-action:manipulation;
  }
  .ff-label-mode button.active{background:rgba(0,247,255,.12);color:rgba(0,247,255,.9);}
  .ff-count{font-family:var(--orb);font-size:.5rem;letter-spacing:.08em;color:rgba(180,205,220,.45);margin-left:auto;}
  #formation-cult-tabs{display:flex;gap:5px;margin-bottom:12px;overflow-x:auto;scrollbar-width:none;padding:1px;}
  #formation-cult-tabs::-webkit-scrollbar{display:none;}
  .fct-btn{display:inline-flex;align-items:center;gap:4px;padding:5px 11px;border-radius:16px;border:1px solid rgba(255,255,255,.1);background:transparent;color:rgba(255,255,255,.45);font-family:var(--orb);font-size:.58rem;cursor:pointer;white-space:nowrap;flex-shrink:0;transition:all .18s;}
  .fct-btn.active{background:rgba(0,247,255,.1);border-color:rgba(0,247,255,.38);color:rgba(0,247,255,.9);}
  #formation-star-list{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;margin-bottom:10px;padding:1px 1px 3px;}
  #formation-star-list::-webkit-scrollbar{display:none;}
  .ff-star{
    flex:0 0 auto;display:flex;flex-direction:column;gap:2px;max-width:160px;
    padding:7px 10px;border-radius:8px;border:1px solid rgba(255,255,255,.08);
    background:rgba(255,255,255,.025);color:rgba(220,236,248,.78);
    font-family:var(--orb);text-align:left;cursor:pointer;touch-action:manipulation;
  }
  .ff-star span{font-size:.58rem;letter-spacing:.06em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .ff-star small{font-size:.45rem;letter-spacing:.06em;color:rgba(180,205,220,.45);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .ff-star.active{border-color:rgba(232,201,106,.45);background:rgba(232,201,106,.09);color:rgba(255,226,120,.94);}
  #formation-moolelo-wrap{
    font-size:.82rem;line-height:1.72;color:rgba(210,232,248,.86);
    border-left:2px solid rgba(0,247,255,.24);padding:10px 12px;
    background:rgba(0,247,255,.035);border-radius:0 8px 8px 0;
    font-style:italic;margin-bottom:10px;
  }
  #formation-nav-wrap{display:flex;gap:8px;padding:9px 12px;border-radius:10px;background:rgba(232,201,106,.05);border:1px solid rgba(232,201,106,.12);font-size:.78rem;color:rgba(232,201,106,.82);line-height:1.55;}

  /* ── Compass sky overlay ── */
  #compass-overlay {
    position:fixed;inset:0;z-index:160;
    display:flex;align-items:center;justify-content:center;
    background:rgba(0,0,0,.38);
    opacity:0;visibility:hidden;
    pointer-events:none;
    transition:opacity .35s, visibility 0s .35s;
  }
  #compass-overlay.show {
    opacity:1;visibility:visible;pointer-events:all;
    touch-action:none; /* none lets JS handle all gestures including pinch */
    transition:opacity .35s, visibility 0s;
  }
  /* Close button — sits below topbar (topbar = safe-area + 46px min-height) */
  #compass-overlay-close {
    position:absolute;
    top: max(64px, calc(env(safe-area-inset-top, 0px) + 54px));
    right:14px;
    z-index:10;
    width:44px;height:44px;border-radius:50%;
    border:1px solid rgba(0,247,255,.35);
    background:rgba(3,6,20,.92);color:rgba(0,247,255,.9);
    font-size:1.15rem;line-height:1;cursor:pointer;
    display:flex;align-items:center;justify-content:center;
    backdrop-filter:blur(14px);
    box-shadow:0 2px 16px rgba(0,0,0,.5);
    transition:background .15s,border-color .15s;
    touch-action:manipulation;
  }
  #compass-overlay-close:hover,#compass-overlay-close:active{
    background:rgba(0,247,255,.18);border-color:rgba(0,247,255,.8);
  }
  #compass-overlay-toolbar {
    position:absolute;top:112px;left:50%;transform:translateX(-50%);
    z-index:2;display:flex;align-items:center;gap:14px;justify-content:space-between;
    width:min(680px,calc(100vw - 28px));
    padding:10px 12px;border-radius:8px;
    background:rgba(3,6,20,.84);border:1px solid rgba(0,247,255,.18);
    backdrop-filter:blur(18px);box-shadow:0 12px 36px rgba(0,0,0,.35);
    pointer-events:all;
  }
  #compass-overlay-title {
    font-family:var(--orb);font-size:.66rem;letter-spacing:.1em;
    color:rgba(0,247,255,.86);text-transform:uppercase;white-space:nowrap;
  }
  #compass-overlay-sub {
    margin-top:3px;font-family:var(--orb);font-size:.48rem;letter-spacing:.08em;
    color:rgba(190,215,235,.45);white-space:nowrap;
  }
  #skymap-controls{display:none;align-items:center;gap:8px;}
  #compass-overlay.skymap-mode #skymap-controls{display:flex;}
  /* In skymap mode keep toolbar visible so the month nav controls inside it are reachable;
     only hide the title/subtitle wrapper */
  #compass-overlay.skymap-mode #compass-overlay-toolbar > div:first-child{display:none;}
  #skymap-select {
    min-height:30px;padding:0 8px;border-radius:6px;
    border:1px solid rgba(0,247,255,.24);
    background:rgba(3,6,20,.92);color:rgba(0,247,255,.8);
    font-family:var(--orb);font-size:.56rem;letter-spacing:.06em;
  }
  #compass-overlay canvas{
    position:absolute;
    left:50%;top:55%;transform:translate(-50%,-50%);
    max-width:min(82vw,calc(100vh - 235px));max-height:min(82vw,calc(100vh - 235px));
    width:min(82vw,calc(100vh - 235px));height:min(82vw,calc(100vh - 235px));
    touch-action:none; /* allow JS pinch handler to receive all touch events */
    border-radius:50%;
    filter:drop-shadow(0 24px 54px rgba(0,0,0,.58));
    cursor:pointer;touch-action:manipulation;
  }
  #compass-overlay.skymap-mode canvas {
    background:radial-gradient(circle, rgba(3,14,26,.82), rgba(0,4,10,.42));
    border:1px solid rgba(0,247,255,.22);
    box-shadow:0 0 0 1px rgba(0,247,255,.12), inset 0 0 0 1px rgba(255,255,255,.05), 0 0 38px rgba(0,247,255,.12);
  }
  #hawaiian-map-tools{
    position:fixed;right:18px;top:148px;z-index:175;width:min(330px,calc(100vw - 36px));
    max-height:calc(100vh - 265px);overflow:hidden;display:none;pointer-events:all;
    padding:12px;border-radius:8px;border:1px solid rgba(0,247,255,.18);
    background:linear-gradient(180deg,rgba(3,8,22,.9),rgba(2,5,14,.76));
    backdrop-filter:blur(18px);box-shadow:0 18px 46px rgba(0,0,0,.46);
    color:rgba(220,236,248,.86);box-sizing:border-box;
  }
  #hawaiian-map-tools *,
  #hawaiian-map-tools *::before,
  #hawaiian-map-tools *::after{box-sizing:border-box;}
  #hawaiian-map-tools button,
  #hawaiian-map-tools select{appearance:none;-webkit-appearance:none;}
  #hawaiian-map-tools.show{display:block;}
  #compass-overlay:not(.show) #hawaiian-map-tools{display:none;}
  .hmt-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:9px;}
  .hmt-title{font-family:var(--orb);font-size:.68rem;font-weight:700;letter-spacing:.08em;color:rgba(232,201,106,.94);text-transform:uppercase;}
  .hmt-sub{margin-top:3px;font-family:var(--orb);font-size:.5rem;letter-spacing:.08em;color:rgba(0,247,255,.48);}
  #hawaiian-map-select{
    min-height:30px;min-width:92px;border-radius:6px;border:1px solid rgba(0,247,255,.25);
    padding:0 26px 0 9px;
    background:
      linear-gradient(45deg,transparent 50%,rgba(0,247,255,.78) 50%) calc(100% - 13px) 12px/5px 5px no-repeat,
      linear-gradient(135deg,rgba(0,247,255,.78) 50%,transparent 50%) calc(100% - 8px) 12px/5px 5px no-repeat,
      rgba(2,8,18,.92);
    color:rgba(0,247,255,.86);font-family:var(--orb);font-size:.56rem;
  }
  .hmt-toggle{
    display:flex;align-items:center;gap:8px;margin:0 0 9px;padding:8px 9px;border-radius:7px;
    border:1px solid rgba(232,201,106,.16);background:rgba(232,201,106,.055);
    font-family:var(--orb);font-size:.55rem;letter-spacing:.06em;color:rgba(232,201,106,.82);
  }
  .hmt-toggle input{accent-color:#e8c96a;}
  #hawaiian-map-filters{display:flex;gap:6px;margin:0 0 8px;}
  .hmt-filter{
    flex:1;min-height:36px;border-radius:6px;border:1px solid rgba(0,247,255,.14);
    background:rgba(0,247,255,.035);color:rgba(180,220,235,.64);
    font-family:var(--orb);font-size:.48rem;letter-spacing:.08em;text-transform:uppercase;
    cursor:pointer;touch-action:manipulation;
  }
  .hmt-filter.active{border-color:rgba(232,201,106,.42);background:rgba(232,201,106,.10);color:rgba(232,201,106,.92);}
  #hawaiian-map-checklist{max-height:calc(100vh - 405px);overflow:auto;padding-right:2px;scrollbar-width:thin;}
  .hmt-summary{font-family:var(--orb);font-size:.52rem;letter-spacing:.06em;color:rgba(190,220,235,.55);padding:2px 0 8px;}
  .hmt-row{width:100%;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;padding:6px 2px;border:0;border-top:1px solid rgba(255,255,255,.055);background:transparent;text-align:left;cursor:pointer;touch-action:manipulation;}
  .hmt-row:hover,.hmt-row.active{background:rgba(232,201,106,.075);}
  .hmt-row.active{box-shadow:inset 2px 0 0 rgba(232,201,106,.82);}
  .hmt-dot{width:7px;height:7px;border-radius:50%;box-shadow:0 0 9px currentColor;background:currentColor;color:rgba(0,247,255,.85);}
  .hmt-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.68rem;color:rgba(220,236,248,.86);}
  .hmt-status{font-family:var(--orb);font-size:.46rem;letter-spacing:.06em;text-transform:uppercase;color:rgba(180,205,220,.46);}
  .hmt-empty{padding:10px 2px;font-size:.66rem;color:rgba(190,215,230,.52);}
  .hmt-visible .hmt-dot{color:rgba(0,247,255,.9);}
  .hmt-visible .hmt-status{color:rgba(0,247,255,.62);}
  .hmt-low .hmt-dot{color:rgba(232,201,106,.95);}
  .hmt-low .hmt-status{color:rgba(232,201,106,.76);}
  .hmt-below .hmt-dot{color:rgba(130,180,205,.58);}
  .hmt-below .hmt-name{color:rgba(190,215,230,.64);}

  /* ── Planet info extras ── */
  .planet-sphere-preview{
    width:80px;height:80px;border-radius:50%;flex-shrink:0;
    display:flex;align-items:center;justify-content:center;
    position:relative;overflow:hidden;
  }
  .planet-sphere-preview::after{
    content:'';position:absolute;inset:0;border-radius:50%;
    background:radial-gradient(circle at 35% 35%,rgba(255,255,255,.18),transparent 65%);
  }
  .planet-glow-ring{
    position:absolute;inset:-8px;border-radius:50%;
    border:1px solid currentColor;opacity:.2;
  }
  .planet-names-grid{display:flex;flex-direction:column;gap:5px;margin-bottom:10px;}
  .planet-name-row{display:flex;align-items:center;gap:8px;padding:5px 10px;border-radius:8px;background:rgba(255,255,255,.02);border:1px solid rgba(255,255,255,.05);}
  .planet-name-cult{font-family:var(--orb);font-size:.6rem;color:rgba(255,255,255,.35);width:72px;flex-shrink:0;}
  .planet-name-val{font-family:var(--orb);font-size:.72rem;color:rgba(0,247,255,.88);}
  .planet-name-meaning{font-size:.65rem;color:rgba(255,215,0,.45);font-style:italic;margin-left:auto;}

  /* ── Confidence badge ── */
  .conf-badge{
    display:inline-flex;align-items:center;gap:4px;
    font-family:var(--orb);font-size:.54rem;letter-spacing:.08em;
    padding:2px 7px;border-radius:4px;
  }
  .conf-verified{background:rgba(60,179,113,.1);color:rgba(60,179,113,.8);border:1px solid rgba(60,179,113,.2);}
  .conf-probable{background:rgba(255,215,0,.08);color:rgba(255,215,0,.65);border:1px solid rgba(255,215,0,.18);}
  .conf-placeholder{background:rgba(157,0,255,.08);color:rgba(157,0,255,.65);border:1px solid rgba(157,0,255,.18);}

  /* ── Help button ── */
  #btn-help{border-color:rgba(232,201,106,.25);color:rgba(232,201,106,.65);}
  #btn-compass-overlay{border-color:rgba(232,201,106,.25);}
  #btn-compass-overlay.active{background:rgba(232,201,106,.12);border-color:rgba(232,201,106,.5);color:rgba(232,201,106,.9);}


  .panel-facts-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:0 0 12px;}
  .panel-fact{background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.07);border-radius:10px;padding:9px 10px;}
  .panel-fact-lbl{font-family:var(--orb);font-size:.52rem;letter-spacing:.1em;color:rgba(0,247,255,.42);text-transform:uppercase;margin-bottom:4px;}
  .panel-fact-val{font-size:.78rem;line-height:1.45;color:rgba(220,235,248,.88);}
  .panel-formation-note{font-size:.7rem;color:rgba(255,215,0,.52);font-style:italic;margin-top:6px;}


  /* ── Experience Mode bar ── */
  #mode-bar {
    flex: 1 1 0%;
    display: flex;
    align-items: stretch;
    gap: 3px;
    padding: 4px 4px 0;
    min-width: 0;
    background: transparent;
    border: none;
  }

  /* Single definitive rule — no other .mode-pill rules exist */
  .mode-pill {
    flex: 1 1 0%;
    min-width: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 6px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255,255,255,.42);
    font-family: var(--orb);
    font-size: .5rem;
    letter-spacing: .06em;
    cursor: pointer;
    white-space: nowrap;
    transition: all .22s;
    touch-action: manipulation;
  }
  .mode-pill.active {
    background: rgba(232,201,106,.14);
    border-color: rgba(232,201,106,.5);
    color: var(--gold);
    box-shadow: 0 0 10px rgba(232,201,106,.18);
  }
  .mode-pill:hover:not(.active) {
    color: rgba(255,255,255,.7);
    background: rgba(255,255,255,.05);
  }
  .mode-icon { font-size: .78rem; flex-shrink: 0; }

  /* ── Story/Moʻolelo panel — full-screen immersive ── */
  #story-panel {
    position:fixed; inset:0; z-index:8000;
    display:flex; flex-direction:column;
    background:linear-gradient(160deg,rgba(2,4,20,.97) 0%,rgba(8,2,28,.97) 100%);
    opacity:0; pointer-events:none;
    transition:opacity .5s cubic-bezier(.4,0,.2,1);
  }
  #story-panel.show { opacity:1; pointer-events:all; }
  #story-topbar {
    display:flex; align-items:center; gap:10px;
    padding:max(14px,env(safe-area-inset-top,14px)) 18px 12px;
    flex-shrink:0;
  }
  #story-back {
    display:flex; align-items:center; gap:6px;
    padding:8px 14px; border-radius:20px;
    border:1px solid rgba(232,201,106,.3); background:rgba(0,0,0,.4);
    color:rgba(232,201,106,.85); font-family:var(--orb); font-size:.68rem;
    cursor:pointer; touch-action:manipulation;
  }
  #story-culture-badge {
    font-family:var(--orb); font-size:.52rem; letter-spacing:.12em;
    color:rgba(0,247,255,.5); text-transform:uppercase;
  }
  #story-progress {
    position:absolute; bottom:0; left:0; height:2px;
    background:rgba(232,201,106,.6); transition:width .4s;
    pointer-events:none;
  }
  #story-content {
    flex:1; overflow-y:auto; padding:0 24px 32px;
    scrollbar-width:thin; scrollbar-color:rgba(232,201,106,.2) transparent;
    overscroll-behavior:contain;
    display:flex; flex-direction:column; gap:20px;
  }
  #story-content::-webkit-scrollbar { width:3px; }
  #story-star-visual {
    display:flex; justify-content:center; align-items:center;
    padding:28px 0 12px; flex-shrink:0;
  }
  .story-star-glow-ring {
    width:90px; height:90px; border-radius:50%; position:relative;
    display:flex; align-items:center; justify-content:center;
    animation:story-pulse 3s ease-in-out infinite;
  }
  @keyframes story-pulse {
    0%,100% { box-shadow:0 0 20px 6px var(--sg,rgba(0,247,255,.2)); }
    50%      { box-shadow:0 0 40px 14px var(--sg,rgba(0,247,255,.35)); }
  }
  .story-star-core {
    width:22px; height:22px; border-radius:50%;
    box-shadow:0 0 20px 8px currentColor;
  }
  #story-haw-name {
    font-family:var(--orb); font-size:1.6rem; font-weight:900;
    letter-spacing:.06em; color:var(--gold);
    text-shadow:0 0 28px rgba(232,201,106,.55);
    text-align:center; line-height:1.2;
  }
  #story-meaning {
    font-family:var(--serif); font-size:.92rem; font-style:italic;
    color:rgba(232,201,106,.6); text-align:center; margin-top:-8px;
  }
  #story-moolelo-text {
    font-family:var(--serif); font-size:.96rem; line-height:1.88;
    color:rgba(215,232,252,.88);
    border-left:3px solid rgba(232,201,106,.35); padding-left:16px;
  }
  .story-fact-row {
    display:flex; gap:10px; flex-wrap:wrap;
  }
  .story-fact {
    flex:1; min-width:130px;
    background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.07);
    border-radius:12px; padding:12px;
  }
  .story-fact-lbl {
    font-family:var(--orb); font-size:.5rem; letter-spacing:.12em;
    color:rgba(0,247,255,.4); text-transform:uppercase; margin-bottom:5px;
  }
  .story-fact-val { font-size:.84rem; color:rgba(220,235,250,.88); line-height:1.4; }
  .story-trad-block {
    background:rgba(255,255,255,.025); border:1px solid rgba(255,255,255,.06);
    border-radius:12px; padding:14px 16px;
  }
  .story-trad-title {
    font-family:var(--orb); font-size:.6rem; letter-spacing:.1em;
    color:rgba(0,247,255,.55); text-transform:uppercase; margin-bottom:8px;
    display:flex; align-items:center; gap:7px;
  }
  .story-trad-item {
    display:flex; gap:8px; padding:7px 0;
    border-bottom:1px solid rgba(255,255,255,.04); font-size:.8rem;
    line-height:1.55; color:rgba(195,218,240,.75);
  }
  .story-trad-item:last-child { border-bottom:none; }
  .story-trad-name {
    font-family:var(--orb); font-size:.62rem; font-weight:700;
    color:rgba(0,247,255,.75); min-width:72px; flex-shrink:0;
  }
  .story-nav-box {
    background:rgba(232,201,106,.05); border:1px solid rgba(232,201,106,.15);
    border-radius:12px; padding:14px 16px;
    display:flex; gap:10px; align-items:flex-start;
  }
  .story-nav-icon { font-size:1.1rem; flex-shrink:0; margin-top:1px; }
  .story-nav-text { font-size:.82rem; line-height:1.65; color:rgba(232,201,106,.85); }
  .story-conf-badge {
    display:inline-flex; align-items:center; gap:5px;
    font-family:var(--orb); font-size:.5rem; letter-spacing:.08em;
    padding:3px 9px; border-radius:4px; align-self:flex-start;
  }
  .conf-verified { background:rgba(60,179,113,.1);color:rgba(60,179,113,.8);border:1px solid rgba(60,179,113,.2); }
  .conf-probable { background:rgba(255,215,0,.08);color:rgba(255,215,0,.65);border:1px solid rgba(255,215,0,.18); }
  .conf-placeholder { background:rgba(157,0,255,.08);color:rgba(157,0,255,.65);border:1px solid rgba(157,0,255,.18); }

  /* ── Navigation Mode HUD ── */
  #learn-panel{
    position:fixed;inset:0;z-index:7900;display:flex;flex-direction:column;
    background:linear-gradient(160deg,rgba(2,5,18,.97),rgba(3,10,24,.96));
    opacity:0;pointer-events:none;transition:opacity .32s cubic-bezier(.4,0,.2,1);
  }
  #learn-panel.show{opacity:1;pointer-events:all;}
  #learn-topbar{
    display:flex;align-items:center;gap:12px;flex-shrink:0;
    padding:max(14px,env(safe-area-inset-top,14px)) 18px 12px;
    border-bottom:1px solid rgba(0,247,255,.08);
    background:linear-gradient(180deg,rgba(0,247,255,.045),transparent);
  }
  #learn-back{
    display:flex;align-items:center;gap:7px;padding:8px 14px;border-radius:20px;
    border:1px solid rgba(232,201,106,.36);background:rgba(0,0,0,.28);
    color:rgba(232,201,106,.88);font-family:var(--orb);font-size:.66rem;
    cursor:pointer;touch-action:manipulation;
  }
  #learn-title{font-family:var(--orb);font-size:.86rem;font-weight:800;letter-spacing:.09em;color:var(--gold);}
  #learn-subtitle{margin-top:3px;font-family:var(--orb);font-size:.52rem;letter-spacing:.07em;color:rgba(0,247,255,.45);}
  #learn-content{
    flex:1;min-height:0;overflow:auto;padding:18px;
    display:grid;grid-template-columns:minmax(260px,360px) minmax(0,1fr);gap:16px;
    scrollbar-width:thin;scrollbar-color:rgba(0,247,255,.18) transparent;
  }
  #learn-modules{display:flex;flex-direction:column;gap:10px;}
  .learn-card{
    border:1px solid rgba(0,247,255,.12);border-radius:8px;background:rgba(255,255,255,.025);
    padding:12px;cursor:pointer;touch-action:manipulation;transition:border-color .15s,background .15s;
  }
  .learn-card:hover,.learn-card.active{border-color:rgba(232,201,106,.4);background:rgba(232,201,106,.055);}
  .learn-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:8px;}
  .learn-card-side{display:flex;flex-direction:column;align-items:flex-end;gap:5px;flex-shrink:0;}
  .learn-card-side .knowledge-status{font-size:.38rem;min-height:18px;padding:2px 6px;}
  .learn-card-title{font-family:var(--orb);font-size:.72rem;font-weight:800;letter-spacing:.06em;color:rgba(232,201,106,.95);}
  .learn-card-meta{font-family:var(--orb);font-size:.48rem;letter-spacing:.08em;color:rgba(0,247,255,.5);text-transform:uppercase;}
  .learn-card-desc{font-size:.76rem;line-height:1.55;color:rgba(205,225,242,.72);margin-bottom:10px;}
  .learn-progress{height:4px;border-radius:999px;background:rgba(255,255,255,.08);overflow:hidden;}
  .learn-progress span{display:block;height:100%;background:linear-gradient(90deg,rgba(0,247,255,.8),rgba(232,201,106,.9));}
  #lesson-view{
    min-height:420px;border:1px solid rgba(0,247,255,.12);border-radius:8px;
    background:rgba(0,0,0,.18);padding:18px;
  }
  .lesson-kicker{font-family:var(--orb);font-size:.52rem;letter-spacing:.1em;color:rgba(0,247,255,.55);text-transform:uppercase;margin-bottom:8px;}
  .lesson-title{font-family:var(--orb);font-size:1.1rem;font-weight:900;letter-spacing:.07em;color:var(--gold);margin-bottom:10px;}
  .lesson-body{font-size:.92rem;line-height:1.78;color:rgba(220,236,248,.86);max-width:820px;}
  .lesson-callout{margin:14px 0;padding:12px 14px;border-left:2px solid rgba(232,201,106,.45);background:rgba(232,201,106,.055);color:rgba(232,201,106,.9);line-height:1.65;}
  .lesson-task{
    display:flex;gap:10px;align-items:flex-start;margin:12px 0 4px;padding:12px 14px;border-radius:8px;
    border:1px solid rgba(0,247,255,.14);background:rgba(0,247,255,.045);
    color:rgba(210,235,248,.82);line-height:1.58;
  }
  .lesson-task i{margin-top:3px;color:rgba(0,247,255,.68);flex-shrink:0;}
  .lesson-task strong{
    display:block;font-family:var(--orb);font-size:.52rem;letter-spacing:.1em;text-transform:uppercase;
    color:rgba(0,247,255,.78);margin-bottom:3px;
  }
  .lesson-task span{display:block;font-size:.82rem;}
  .lesson-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px;}
  .lesson-action{
    display:inline-flex;align-items:center;gap:7px;min-height:34px;padding:0 12px;border-radius:8px;
    border:1px solid rgba(0,247,255,.18);background:rgba(0,247,255,.055);
    color:rgba(0,247,255,.86);font-family:var(--orb);font-size:.56rem;font-weight:800;
    letter-spacing:.07em;text-transform:uppercase;cursor:pointer;touch-action:manipulation;
  }
  .lesson-action.primary{border-color:rgba(232,201,106,.42);background:rgba(232,201,106,.11);color:rgba(232,201,106,.95);}
  .lesson-step-dot{
    width:8px;height:8px;border-radius:50%;border:none;padding:0;
    background:rgba(255,255,255,.16);cursor:pointer;touch-action:manipulation;
    flex-shrink:0;transition:background .2s, width .2s;
  }
  .lesson-step-dot.active{width:22px;border-radius:999px;background:rgba(232,201,106,.88);}
  .lesson-step-dot.done{background:rgba(0,247,255,.72);}
  .lesson-steps{display:flex;gap:6px;flex-wrap:wrap;margin:18px 0 0;}

  /* ── Lesson enrichment components ── */
  .lesson-objectives{
    display:flex;flex-wrap:wrap;gap:7px;margin:10px 0 14px;
  }
  .lesson-objectives span{
    display:inline-flex;align-items:center;gap:6px;
    padding:5px 10px;border-radius:20px;
    border:1px solid rgba(0,247,255,.18);background:rgba(0,247,255,.055);
    font-size:.74rem;color:rgba(180,225,245,.82);line-height:1.4;
  }
  .lesson-objectives span i{color:rgba(0,247,255,.6);font-size:.72rem;flex-shrink:0;}

  .lesson-note{
    display:flex;flex-direction:column;gap:6px;
    margin:14px 0;padding:13px 15px;border-radius:8px;
    border-left:3px solid rgba(0,247,255,.35);
    background:rgba(0,247,255,.04);
  }
  .lesson-note > div{
    display:flex;align-items:center;gap:7px;
    font-family:var(--orb);font-size:.5rem;letter-spacing:.1em;text-transform:uppercase;
    color:rgba(0,247,255,.65);
  }
  .lesson-note > div i{font-size:.78rem;}
  .lesson-note p{font-size:.83rem;line-height:1.72;color:rgba(210,230,248,.78);}
  .lesson-note.cultural{
    border-left-color:rgba(232,201,106,.45);background:rgba(232,201,106,.04);
  }
  .lesson-note.cultural > div{color:rgba(232,201,106,.72);}
  .lesson-note.modern{
    border-left-color:rgba(120,180,255,.4);background:rgba(120,180,255,.04);
  }
  .lesson-note.modern > div{color:rgba(140,195,255,.65);}

  .lesson-check{
    margin:16px 0 4px;padding:14px 16px;border-radius:10px;
    border:1px solid rgba(255,215,0,.16);background:rgba(255,215,0,.04);
  }
  .lesson-check-title{
    display:flex;align-items:flex-start;gap:9px;
    font-size:.88rem;font-weight:700;color:rgba(232,201,106,.92);
    margin-bottom:12px;line-height:1.5;
  }
  .lesson-check-title i{flex-shrink:0;margin-top:2px;color:rgba(232,201,106,.7);}
  .lesson-check-options{display:flex;flex-direction:column;gap:7px;}
  .lesson-choice{
    display:block;width:100%;text-align:left;
    padding:9px 13px;border-radius:7px;
    border:1px solid rgba(0,247,255,.14);background:rgba(0,247,255,.04);
    color:rgba(210,232,248,.82);font-size:.82rem;line-height:1.5;
    cursor:pointer;touch-action:manipulation;transition:border-color .15s,background .15s;
  }
  .lesson-choice:hover{border-color:rgba(0,247,255,.34);background:rgba(0,247,255,.09);}
  .lesson-choice.selected{border-color:rgba(232,201,106,.38);background:rgba(232,201,106,.08);color:rgba(232,201,106,.95);}
  .lesson-choice.correct{border-color:rgba(60,200,120,.5);background:rgba(60,200,120,.1);color:rgba(120,230,160,.95);}
  .lesson-choice.incorrect{border-color:rgba(220,80,80,.4);background:rgba(220,80,80,.07);color:rgba(240,140,130,.88);}
  .lesson-feedback{
    margin-top:11px;padding:10px 13px;border-radius:7px;
    font-size:.82rem;line-height:1.62;
  }
  .lesson-feedback.correct{border:1px solid rgba(60,200,120,.3);background:rgba(60,200,120,.08);color:rgba(120,230,160,.92);}
  .lesson-feedback.incorrect{border:1px solid rgba(220,80,80,.28);background:rgba(220,80,80,.07);color:rgba(240,150,140,.88);}

  .lesson-reflect{
    display:flex;gap:10px;align-items:flex-start;
    margin:14px 0 4px;padding:12px 14px;border-radius:8px;
    border:1px solid rgba(157,80,255,.22);background:rgba(157,80,255,.055);
    color:rgba(215,195,248,.82);line-height:1.62;
  }
  .lesson-reflect i{margin-top:3px;color:rgba(180,130,255,.7);flex-shrink:0;}
  .lesson-reflect strong{
    display:block;font-family:var(--orb);font-size:.5rem;letter-spacing:.1em;text-transform:uppercase;
    color:rgba(180,130,255,.75);margin-bottom:3px;
  }
  .lesson-reflect span{display:block;font-size:.82rem;}

  /* ── Collapsible note toggle ── */
  .lesson-note-toggle{
    display:flex;align-items:center;gap:7px;width:100%;
    background:none;border:none;cursor:pointer;touch-action:manipulation;
    font-family:var(--orb);font-size:.5rem;letter-spacing:.1em;text-transform:uppercase;
    color:inherit;padding:0;text-align:left;
  }
  .lesson-note.cultural .lesson-note-toggle{color:rgba(232,201,106,.72);}
  .lesson-note.modern .lesson-note-toggle{color:rgba(140,195,255,.65);}
  .lesson-note-chevron{margin-left:auto;transition:transform .2s;}
  .lesson-note[data-collapsed="false"] .lesson-note-chevron{transform:rotate(180deg);}
  .lesson-note-body{margin-top:9px;font-size:.83rem;line-height:1.72;color:rgba(210,230,248,.78);}
  .lesson-note[data-collapsed="true"] .lesson-note-body{display:none;}

  /* ── Completion requirements ── */
  .lesson-requirements{
    margin:14px 0 4px;padding:12px 14px;border-radius:8px;
    border:1px solid rgba(220,160,0,.2);background:rgba(220,160,0,.05);
  }
  .lesson-req-label{
    display:flex;align-items:center;gap:7px;
    font-family:var(--orb);font-size:.48rem;letter-spacing:.1em;text-transform:uppercase;
    color:rgba(220,180,60,.7);margin-bottom:8px;
  }
  .lesson-req-item{
    display:flex;align-items:flex-start;gap:8px;
    font-size:.8rem;color:rgba(220,200,140,.72);line-height:1.5;margin-bottom:5px;
  }
  .lesson-req-item i{margin-top:2px;font-size:.7rem;color:rgba(220,160,0,.5);flex-shrink:0;}

  /* ── Mark Complete locked/done states ── */
  .lesson-action.primary.locked,
  .lesson-action.primary[disabled]{
    opacity:.38;cursor:not-allowed;pointer-events:none;
  }
  .lesson-action.primary.done-state{
    border-color:rgba(0,247,255,.42);background:rgba(0,247,255,.11);color:rgba(0,247,255,.92);
  }
  /* Sky action gets its own prominent row */
  .lesson-sky-row{margin:14px 0 8px;}
  .lesson-action.sky-action{
    width:100%;justify-content:center;min-height:44px;
    font-size:.62rem;letter-spacing:.12em;
    border-color:rgba(0,247,255,.35);background:rgba(0,247,255,.08);color:rgba(0,247,255,.92);
  }
  .lesson-action.sky-action.triggered{
    border-color:rgba(60,200,120,.4);background:rgba(60,200,120,.09);color:rgba(120,230,160,.9);
  }

  /* Completion flash */
  @keyframes lesson-flash{
    0%  {box-shadow:0 0 0 0 rgba(0,247,255,.55);}
    60% {box-shadow:0 0 0 18px rgba(0,247,255,.0);}
    100%{box-shadow:0 0 0 0 rgba(0,247,255,.0);}
  }
  .lesson-complete-flash{animation:lesson-flash .75s ease-out;}

  /* ── Overall progress chip ── */
  #learn-overall-progress{
    display:flex;flex-direction:column;align-items:center;flex-shrink:0;
    padding:6px 12px;border-radius:8px;
    border:1px solid rgba(0,247,255,.15);background:rgba(0,247,255,.04);
    min-width:52px;
  }
  .learn-overall-count{
    font-family:var(--orb);font-size:1rem;font-weight:900;color:var(--gold);line-height:1;
  }
  .learn-overall-count span{font-size:.62rem;color:rgba(0,247,255,.5);}
  .learn-overall-label{font-family:var(--orb);font-size:.42rem;letter-spacing:.1em;text-transform:uppercase;color:rgba(0,247,255,.4);margin-top:2px;}

  /* ── Month scrubber buttons ── */
  #skymap-controls{display:flex;align-items:center;gap:4px;}
  #skymap-prev,#skymap-next{
    display:inline-flex;align-items:center;justify-content:center;
    width:28px;height:28px;border-radius:6px;flex-shrink:0;
    border:1px solid rgba(0,247,255,.18);background:rgba(0,247,255,.055);
    color:rgba(0,247,255,.8);font-size:.7rem;cursor:pointer;touch-action:manipulation;
    transition:opacity .15s,background .15s;
  }
  #skymap-prev:hover,#skymap-next:hover{background:rgba(0,247,255,.12);}
  #skymap-prev:disabled,#skymap-next:disabled{opacity:.25;cursor:not-allowed;}

  /* ══════════════════════════════════════════════════════
     COSMIC + HAWAIIAN/POLYNESIAN DESIGN — Learn Panel
  ══════════════════════════════════════════════════════ */

  /* ── Starfield canvas sits behind all learn content ── */
  #learn-bg-stars{
    position:absolute;inset:0;width:100%;height:100%;
    pointer-events:none;z-index:0;
    animation:learn-star-pulse 6s ease-in-out infinite alternate;
  }
  @keyframes learn-star-pulse{
    from{opacity:.75;}
    to{opacity:1;}
  }
  #learn-topbar,#learn-content{position:relative;z-index:1;}

  /* ── Celestial bar canvases (moon phases + formation dots) ── */
  #topbar-celestial-bar-top{
    position:absolute;top:0;left:0;width:100%;height:14px;
    pointer-events:none;display:block;z-index:1;opacity:.55;
  }
  #topbar-celestial-bar{
    position:absolute;bottom:0;left:0;width:100%;height:14px;
    pointer-events:none;display:block;z-index:1;
  }
  #learn-celestial-bar{
    position:absolute;bottom:0;left:0;width:100%;height:20px;
    pointer-events:none;display:block;z-index:3;
  }
  #learn-topbar{border-bottom:none;}

  /* ── Lesson view: Polynesian wave/zigzag top stripe ── */
  #lesson-view{overflow:hidden;}
  #lesson-view::before{
    content:'';
    display:block;
    height:8px;
    margin:-18px -18px 18px;
    /* Nalu (wave) chevron — classic Polynesian kapa motif */
    background:
      linear-gradient(135deg,rgba(232,201,106,.42) 25%,transparent 25%) -8px 0/16px 8px,
      linear-gradient(225deg,rgba(232,201,106,.42) 25%,transparent 25%) -8px 0/16px 8px,
      linear-gradient(315deg,rgba(232,201,106,.42) 25%,transparent 25%) 0 0/16px 8px,
      linear-gradient(45deg, rgba(232,201,106,.42) 25%,transparent 25%) 0 0/16px 8px;
    background-color:rgba(232,201,106,.06);
  }

  /* ── Lesson title: star glyph + cosmic glow ── */
  .lesson-title{
    text-shadow:0 0 22px rgba(232,201,106,.28),0 0 50px rgba(232,201,106,.10);
    padding-bottom:6px;
    border-bottom:1px solid rgba(232,201,106,.12);
    margin-bottom:14px;
  }
  .lesson-title::before{
    content:'✦';
    display:inline-block;
    margin-right:9px;
    font-size:.55em;
    vertical-align:middle;
    color:rgba(232,201,106,.7);
    text-shadow:0 0 8px rgba(232,201,106,.9),0 0 18px rgba(232,201,106,.5);
    animation:star-flicker 3.5s ease-in-out infinite alternate;
  }
  @keyframes star-flicker{
    0%{opacity:.7;}50%{opacity:1;}100%{opacity:.82;}
  }

  /* ── Module cards: shimmer top rail on hover/active ── */
  .learn-card{overflow:hidden;position:relative;}
  .learn-card::after{
    content:'';
    position:absolute;top:0;left:-100%;right:0;height:2px;
    background:linear-gradient(90deg,transparent,rgba(232,201,106,.6),rgba(0,247,255,.5),transparent);
    transition:left .35s ease;
  }
  .learn-card:hover::after,.learn-card.active::after{left:0;}

  /* ── Lesson section label decorations ── */
  .lesson-note{position:relative;}

  .lesson-note.cultural{
    border-left-color:rgba(232,201,106,.55);
    background:linear-gradient(135deg,rgba(232,201,106,.055),rgba(232,201,106,.018));
  }
  .lesson-note.cultural .lesson-note-toggle{
    color:rgba(232,201,106,.78);
  }

  .lesson-note.modern{
    border-left-color:rgba(100,190,255,.45);
    background:linear-gradient(135deg,rgba(80,160,255,.05),rgba(80,160,255,.015));
  }
  .lesson-note.modern .lesson-note-toggle{
    color:rgba(140,200,255,.72);
  }

  /* ── Lesson callout: Polynesian diamond marker ── */
  .lesson-callout{
    position:relative;
    padding-left:22px;
    border-left:none;
    border-left:2px solid rgba(232,201,106,.45);
  }
  .lesson-callout::before{
    content:'◆';
    position:absolute;
    left:-8px;top:50%;transform:translateY(-50%);
    font-size:.5rem;line-height:1;
    color:rgba(232,201,106,.75);
    text-shadow:0 0 6px rgba(232,201,106,.8);
    background:var(--sky);
    padding:2px 0;
  }

  /* ── Reflect prompt: coral/sunset warm accent ── */
  .lesson-reflect{
    border-color:rgba(220,100,50,.28);
    background:rgba(200,75,30,.055);
  }
  .lesson-reflect i{color:rgba(255,145,80,.82);flex-shrink:0;}
  .lesson-reflect strong{
    display:block;font-family:var(--orb);font-size:.5rem;letter-spacing:.1em;text-transform:uppercase;
    color:rgba(255,165,90,.8);margin-bottom:3px;
  }
  .lesson-reflect span{display:block;font-size:.82rem;color:rgba(240,210,190,.82);}

  /* ── Check block: warm golden cosmic tone ── */
  .lesson-check{
    background:linear-gradient(135deg,rgba(232,201,106,.05),rgba(232,201,106,.02));
  }

  /* ── Step progress: active glow, done = star shape ── */
  .lesson-step-dot.active{
    box-shadow:0 0 8px rgba(232,201,106,.65),0 0 16px rgba(232,201,106,.25);
  }
  .lesson-step-dot.done{
    /* 5-point star via clip-path */
    clip-path:polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
    width:11px;height:11px;border-radius:0;
    background:rgba(0,247,255,.88);
    box-shadow:0 0 6px rgba(0,247,255,.5);
  }

  /* ── Objectives: constellation gradient pills ── */
  .lesson-objectives span{
    background:linear-gradient(135deg,rgba(0,247,255,.07),rgba(0,247,255,.03));
    border-color:rgba(0,247,255,.22);
    transition:border-color .2s,background .2s;
  }
  .lesson-objectives span:hover{
    border-color:rgba(0,247,255,.4);
    background:rgba(0,247,255,.1);
  }

  /* ── Sky action button: glow when triggered ── */
  .lesson-action.sky-action.triggered{
    box-shadow:0 0 12px rgba(60,200,120,.35);
  }

  /* ── Lesson kicker: subtle star-trail underline ── */
  .lesson-kicker{
    position:relative;
    padding-bottom:4px;
  }
  .lesson-kicker::after{
    content:'';
    position:absolute;bottom:0;left:0;
    width:40px;height:1px;
    background:linear-gradient(90deg,rgba(0,247,255,.5),transparent);
  }

  /* ── Overall progress chip: glow ── */
  #learn-overall-progress{
    box-shadow:0 0 12px rgba(0,247,255,.08);
  }
  .learn-overall-count{
    text-shadow:0 0 10px rgba(232,201,106,.4);
  }

  @media (max-width: 760px){
    #learn-content{grid-template-columns:1fr;padding:12px;gap:12px;}
    #learn-modules{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(230px,78vw);overflow-x:auto;padding-bottom:4px;scroll-snap-type:x proximity;}
    .learn-card{scroll-snap-align:start;}
    #lesson-view{min-height:0;padding:14px;}
    #lesson-view::before{margin:-14px -14px 14px;}
    #learn-title{font-size:.74rem;}
    #learn-subtitle{display:none;}
    #seasonal-banner{
      top:max(112px,calc(env(safe-area-inset-top,0px)+112px));
      width:calc(100vw - 24px);
      max-width:none;
      padding:12px 36px 12px 16px;
    }
  }

  #nav-hud {
    position:fixed; inset:0; z-index:200; pointer-events:none;
    display:none;
  }
  #nav-hud.active { display:block; }
  #nav-bearing-display {
    position:absolute; bottom:max(84px,calc(env(safe-area-inset-bottom,0px)+84px));
    left:50%; transform:translateX(-50%);
    font-family:var(--orb); font-size:.65rem; letter-spacing:.12em;
    color:rgba(0,247,255,.8); background:rgba(2,5,18,.88);
    border:1px solid rgba(0,247,255,.2); border-radius:16px;
    padding:8px 18px; backdrop-filter:blur(16px); white-space:nowrap;
    pointer-events:none;
  }
  #nav-stars-list {
    position:absolute; top:50%; right:16px; transform:translateY(-50%);
    display:flex; flex-direction:column; gap:6px;
    pointer-events:all;
  }
  .nav-star-card {
    background:rgba(2,5,18,.88); border:1px solid rgba(0,247,255,.2);
    border-radius:10px; padding:8px 12px; cursor:pointer;
    touch-action:manipulation; transition:border-color .15s;
    backdrop-filter:blur(16px); max-width:160px;
  }
  .nav-star-card:hover { border-color:rgba(0,247,255,.55); }
  .nav-star-card.active { border-color:rgba(255,215,0,.6); background:rgba(232,201,106,.08); }
  .nsc-name { font-family:var(--orb); font-size:.65rem; color:var(--gold); margin-bottom:2px; }
  .nsc-bearing { font-size:.62rem; color:rgba(0,247,255,.7); }
  .nsc-use { font-size:.58rem; color:rgba(255,255,255,.4); line-height:1.4; margin-top:2px; }
  #nav-crosshair {
    position:absolute; top:50%; left:50%;
    transform:translate(-50%,-50%);
    width:48px; height:48px; pointer-events:none;
  }
  #nav-crosshair::before, #nav-crosshair::after {
    content:''; position:absolute; background:rgba(0,247,255,.4);
  }
  #nav-crosshair::before { left:50%;top:0;width:1px;height:100%;transform:translateX(-50%); }
  #nav-crosshair::after { top:50%;left:0;height:1px;width:100%;transform:translateY(-50%); }

  /* ── Seasonal banner ── */
  #seasonal-banner {
    position:fixed; top:max(118px,calc(env(safe-area-inset-top,0px)+118px));
    left:50%; transform:translateX(-50%);
    z-index:360; opacity:0; pointer-events:none;
    transition:opacity .5s; text-align:center;
    background:rgba(2,5,18,.92); border:1px solid rgba(232,201,106,.3);
    border-radius:16px; padding:12px 22px; backdrop-filter:blur(20px);
    max-width:min(380px,90vw);
  }
  #seasonal-banner.show { opacity:1; pointer-events:all; }
  #seasonal-banner-title {
    font-family:var(--orb); font-size:.72rem; font-weight:700;
    letter-spacing:.1em; color:var(--gold); margin-bottom:4px;
  }
  #seasonal-banner-text {
    font-size:.76rem; color:rgba(200,225,248,.78); line-height:1.55;
  }
  #seasonal-banner-close {
    position:absolute; top:8px; right:10px; width:24px; height:24px;
    border:none; background:none; color:rgba(255,255,255,.4);
    cursor:pointer; font-size:.85rem; display:flex;
    align-items:center; justify-content:center;
  }

  /* ── Star importance glow rings (injected onto canvas) ── */
  .star-tier-1 { filter:drop-shadow(0 0 12px rgba(255,215,0,.8)) drop-shadow(0 0 28px rgba(255,215,0,.4)); }
  .star-tier-2 { filter:drop-shadow(0 0 8px rgba(0,247,255,.6)) drop-shadow(0 0 18px rgba(0,247,255,.3)); }

  /* ── Guided tour step card ── */
  #tour-card {
    position:fixed; bottom:max(84px,calc(env(safe-area-inset-bottom,0px)+84px));
    left:50%; transform:translateX(-50%);
    z-index:300; width:min(380px,calc(100vw - 24px));
    background:rgba(2,5,18,.96); border:1px solid rgba(232,201,106,.25);
    border-radius:20px; padding:18px 20px 16px;
    backdrop-filter:blur(28px); box-shadow:0 8px 40px rgba(0,0,0,.7);
    display:none;
  }
  #tour-card.show { display:block; animation:slideup .3s ease; }
  @keyframes slideup { from { opacity:0; transform:translateX(-50%) translateY(24px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }
  #tour-step-num { font-family:var(--orb); font-size:.5rem; letter-spacing:.15em; color:rgba(0,247,255,.45); margin-bottom:5px; }
  #tour-step-title { font-family:var(--orb); font-size:.82rem; font-weight:700; color:var(--gold); margin-bottom:8px; }
  #tour-step-text { font-size:.8rem; line-height:1.65; color:rgba(200,225,248,.82); margin-bottom:14px; }
  #tour-controls { display:flex; gap:8px; align-items:center; }
  .tour-btn {
    padding:8px 18px; border-radius:16px; border:1px solid rgba(0,247,255,.3);
    background:rgba(0,247,255,.08); color:rgba(0,247,255,.88);
    font-family:var(--orb); font-size:.62rem; cursor:pointer;
    touch-action:manipulation; transition:background .15s;
  }
  .tour-btn:hover { background:rgba(0,247,255,.18); }
  .tour-btn.primary {
    background:rgba(232,201,106,.12); border-color:rgba(232,201,106,.4);
    color:var(--gold); margin-left:auto;
  }
  #tour-progress-dots { display:flex; gap:5px; align-items:center; }
  .tour-dot { width:6px; height:6px; border-radius:50%; background:rgba(255,255,255,.2); transition:background .2s; }
  .tour-dot.active { background:var(--gold); width:16px; border-radius:3px; }

  /* ── Cosmic Weave transition overlay ── */
  #weave-overlay {
    position:fixed; inset:0; z-index:50; pointer-events:none;
    opacity:0; transition:opacity .3s;
    background:radial-gradient(ellipse at center,
      rgba(124,58,237,.08) 0%,rgba(0,247,255,.04) 40%,transparent 70%);
  }
  #weave-overlay.pulse { opacity:1; }

  /* ── Seasonal mode badge ── */
  #seasonal-badge {
    position:fixed; top:max(52px,calc(env(safe-area-inset-top,0px)+52px));
    right:14px; z-index:106; display:none;
    background:rgba(2,5,18,.88); border:1px solid rgba(232,201,106,.3);
    border-radius:20px; padding:6px 12px;
    font-family:var(--orb); font-size:.54rem; letter-spacing:.1em;
    color:rgba(232,201,106,.8); backdrop-filter:blur(16px);
  }
  #seasonal-badge.show { display:flex; align-items:center; gap:6px; }


  /* ── Editorial star panel ── */
  .ep-header {
    display:flex; gap:14px; align-items:flex-start; margin-bottom:14px;
  }
  .ep-star-orb {
    flex-shrink:0; width:58px; height:58px; border-radius:50%;
    display:flex; align-items:center; justify-content:center; position:relative;
  }
  .ep-star-core {
    width:16px; height:16px; border-radius:50%;
  }
  .ep-names-block { flex:1; min-width:0; }
  .ep-primary { font-family:var(--orb); font-size:1.05rem; font-weight:800; letter-spacing:.04em; line-height:1.1; margin-bottom:3px; }
  .ep-secondary { font-size:.72rem; color:rgba(255,255,255,.5); font-family:var(--orb); letter-spacing:.06em; }
  .ep-meaning-line { font-size:.76rem; font-style:italic; margin-top:2px; }
  .ep-pills { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:11px; }
  .ep-pill {
    display:inline-flex; align-items:center; gap:4px;
    font-family:var(--orb); font-size:.58rem; letter-spacing:.06em;
    background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.08);
    border-radius:6px; padding:3px 9px; color:rgba(180,210,240,.75);
  }
  .ep-pill.tier1 { border-color:rgba(255,215,0,.35); color:rgba(255,215,0,.85); background:rgba(255,215,0,.06); }
  .ep-pill.tier2 { border-color:rgba(0,247,255,.25); color:rgba(0,247,255,.75); }
  .ep-compass-row {
    display:flex; align-items:center; gap:8px;
    padding:11px 13px; border-radius:12px;
    background:rgba(0,247,255,.03); border:1px solid rgba(0,247,255,.1);
    margin-bottom:11px;
  }
  .ep-dir { flex:1; text-align:center; }
  .ep-dir-lbl { font-family:var(--orb); font-size:.46rem; letter-spacing:.1em; color:rgba(255,255,255,.3); margin-bottom:2px; text-transform:uppercase; }
  .ep-dir-house { font-family:var(--orb); font-size:.82rem; font-weight:700; margin-bottom:1px; }
  .ep-dir-deg { font-size:.58rem; color:rgba(255,255,255,.3); }
  .ep-arr { color:rgba(0,247,255,.2); font-size:.9rem; }
  .ep-nav-box {
    display:flex; gap:9px; padding:10px 13px; border-radius:10px;
    background:rgba(232,201,106,.04); border:1px solid rgba(232,201,106,.12);
    font-size:.79rem; color:rgba(232,201,106,.82); line-height:1.6; margin-bottom:11px;
  }
  .ep-section { margin-bottom:13px; }
  .ep-section-head {
    font-family:var(--orb); font-size:.54rem; font-weight:700;
    letter-spacing:.13em; text-transform:uppercase; color:rgba(0,247,255,.38);
    border-bottom:1px solid rgba(0,247,255,.07); padding-bottom:5px; margin-bottom:8px;
    display:flex; align-items:center; gap:7px;
  }
  .ep-moolelo {
    font-family:var(--serif); font-size:.83rem; line-height:1.78;
    color:rgba(210,230,250,.83); border-left:2px solid rgba(232,201,106,.3);
    padding-left:13px; font-style:italic;
  }
  .ep-trad-grid { display:flex; flex-direction:column; gap:5px; }
  .ep-trad-row {
    display:flex; gap:8px; padding:7px 10px; border-radius:8px;
    background:rgba(255,255,255,.02); border:1px solid rgba(255,255,255,.05);
    font-size:.76rem; color:rgba(185,212,235,.72); line-height:1.55;
  }
  .ep-trad-key {
    font-family:var(--orb); font-size:.59rem; font-weight:700;
    color:rgba(0,247,255,.7); min-width:68px; flex-shrink:0; padding-top:1px;
  }
  .ep-science-grid {
    display:grid; grid-template-columns:repeat(2,1fr); gap:7px;
  }
  .ep-sci-cell {
    background:rgba(255,255,255,.025); border:1px solid rgba(255,255,255,.06);
    border-radius:9px; padding:9px 10px;
  }
  .ep-sci-lbl { font-family:var(--orb); font-size:.48rem; letter-spacing:.1em; color:rgba(0,247,255,.38); text-transform:uppercase; margin-bottom:4px; }
  .ep-sci-val { font-size:.78rem; color:rgba(218,232,248,.88); line-height:1.4; }
  .ep-action-row { display:flex; gap:7px; padding:3px 0 4px; }
  .ep-action-btn {
    flex:1; padding:11px; border-radius:12px;
    border:1px solid rgba(0,247,255,.28); background:rgba(0,247,255,.06);
    color:rgba(0,247,255,.88); font-family:var(--orb); font-size:.65rem;
    letter-spacing:.07em; cursor:pointer; touch-action:manipulation;
    transition:background .14s; display:flex; align-items:center; justify-content:center; gap:7px;
  }
  .ep-action-btn:hover { background:rgba(0,247,255,.14); }
  .ep-action-btn.gold { border-color:rgba(232,201,106,.35); background:rgba(232,201,106,.06); color:rgba(232,201,106,.9); }
  .ep-note { font-size:.7rem; color:rgba(255,255,255,.35); font-style:italic; padding:7px 11px; border-radius:8px; background:rgba(255,255,255,.02); border:1px solid rgba(255,255,255,.05); line-height:1.6; }
  .ep-circum { padding:9px 12px; border-radius:9px; background:rgba(157,0,255,.05); border:1px solid rgba(157,0,255,.12); font-size:.74rem; color:rgba(200,175,255,.65); }

  /* Real photo from Wikipedia */
  .ep-photo-box { margin:0 0 13px; border-radius:10px; overflow:hidden; background:rgba(0,0,0,.22); border:1px solid rgba(255,255,255,.07); }
  .ep-photo-loading { display:flex; align-items:center; justify-content:center; min-height:120px; color:rgba(0,247,255,.4); font-size:1.4rem; }
  .ep-photo-link { display:block; line-height:0; }
  .ep-photo-img { width:100%; height:auto; max-height:280px; object-fit:cover; display:block; }
  .ep-photo-credit { font-size:.62rem; color:rgba(255,255,255,.32); text-align:center; padding:5px 10px; background:rgba(0,0,0,.3); line-height:1.4; }
  .ep-photo-credit a { color:rgba(0,247,255,.55); text-decoration:none; }

  /* Responsive tweaks */
  @media (max-width:480px) {
    #story-haw-name { font-size:1.2rem; }
    #story-content { padding:0 16px 24px; }
    #nav-stars-list { right:8px; }
    .nav-star-card { max-width:130px; }
  }

/* ── Three.js canvas: subtle bloom glow ── */
canvas {
  filter: brightness(1.04) saturate(1.12);
}
/* Gyro hint animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0);    }
}

/* ══════════════════════════════════════════════════
   IKEVERSE ICON SYSTEM
══════════════════════════════════════════════════ */

/* ── Loader icon ── */
#loader-star {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
#loader-star-img {
  width: 96px; height: 96px;
  border-radius: 50%;
  padding: 4px;
  background: radial-gradient(circle at 38% 32%,
    rgba(0,247,255,.18) 0%,
    rgba(0,247,255,.04) 55%,
    transparent 100%);
  box-shadow:
    0 0 0 1px rgba(0,247,255,.18),
    0 0 24px  8px rgba(0,247,255,.22),
    0 0 56px 16px rgba(0,247,255,.10),
    0 0 80px 28px rgba(0,247,255,.05);
  animation: ike-pulse 2.2s cubic-bezier(.4,0,.2,1) infinite;
}

@keyframes ike-pulse {
  0%   { transform: scale(1.00);
         box-shadow: 0 0 0 1px rgba(0,247,255,.18),
                     0 0 24px  8px rgba(0,247,255,.22),
                     0 0 56px 16px rgba(0,247,255,.10),
                     0 0 80px 28px rgba(0,247,255,.05); }
  35%  { transform: scale(1.16);
         box-shadow: 0 0 0 2px rgba(0,247,255,.30),
                     0 0 36px 14px rgba(0,247,255,.38),
                     0 0 72px 28px rgba(0,247,255,.18),
                     0 0 110px 44px rgba(0,247,255,.08); }
  65%  { transform: scale(0.94);
         box-shadow: 0 0 0 1px rgba(0,247,255,.12),
                     0 0 14px  4px rgba(0,247,255,.14),
                     0 0 32px 10px rgba(0,247,255,.06); }
  100% { transform: scale(1.00);
         box-shadow: 0 0 0 1px rgba(0,247,255,.18),
                     0 0 24px  8px rgba(0,247,255,.22),
                     0 0 56px 16px rgba(0,247,255,.10),
                     0 0 80px 28px rgba(0,247,255,.05); }
}

/* ── Nav bar logo icon ── */
#logo {
  display: flex; align-items: center; gap: 7px;
  text-decoration: none; pointer-events: all; cursor: pointer;
  flex-shrink: 0; align-self: center; padding-right: 6px;
  border-right: 1px solid rgba(255,255,255,.07);
}

#logo-icon-wrap {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: box-shadow .28s;
  position: relative;
}
#logo:hover #logo-icon-wrap {
  box-shadow:
    0 0 0 1px rgba(0,247,255,.45),
    0 0 16px 5px rgba(0,247,255,.32),
    0 0 36px 12px rgba(0,247,255,.14);
}

#logo-star-img {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: block; position: relative; z-index: 1;
  object-fit: cover;
  padding: 2px;
  background: radial-gradient(circle at 38% 32%,
    rgba(0,247,255,.22) 0%,
    rgba(0,247,255,.06) 55%,
    transparent 100%);
  box-shadow:
    0 0 0 1px rgba(0,247,255,.22),
    0 0 10px 3px rgba(0,247,255,.20),
    0 0 22px 7px rgba(0,247,255,.09);
  transition: transform .28s, box-shadow .28s;
}
#logo:hover #logo-star-img {
  transform: scale(1.10) rotate(12deg);
  box-shadow:
    0 0 0 1px rgba(0,247,255,.45),
    0 0 16px 5px rgba(0,247,255,.35),
    0 0 36px 12px rgba(0,247,255,.16);
}

#logo-text {
  font-family: var(--orb); font-size: .7rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); text-shadow: 0 0 12px rgba(232,201,106,.38);
  transition: text-shadow .28s;
}
#logo:hover #logo-text {
  text-shadow: 0 0 20px rgba(232,201,106,.7);
}

/* ── Cardinal / celestial navigation buttons ── */
#btn-north, #btn-east, #btn-south, #btn-west {
  font-family: var(--orb); font-size: .62rem; font-weight: 700;
  letter-spacing: .05em; color: rgba(0,247,255,.65);
  min-width: 28px;
}
#btn-north:hover, #btn-east:hover, #btn-south:hover, #btn-west:hover {
  color: rgba(0,247,255,1); background: rgba(0,247,255,.1);
}
#btn-goto-moon {
  font-size: 1rem; color: rgba(255,248,200,.7); min-width: 28px;
}
#btn-goto-sun {
  font-size: .95rem; color: rgba(255,220,100,.7); min-width: 28px;
}
#btn-goto-moon:hover { color: rgba(255,248,200,1); background: rgba(255,248,200,.08); }
#btn-goto-sun:hover  { color: rgba(255,220,100,1); background: rgba(255,220,100,.08); }
.ctrl-divider-v {
  width: 1px; height: 18px; background: rgba(255,255,255,.1);
  align-self: center; flex-shrink: 0; margin: 0 2px;
}

/* Responsive control polish */
#ctrl-left,
#ctrl-right {
  max-width: min(48vw, 720px);
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
}
#ctrl-left::-webkit-scrollbar,
#ctrl-right::-webkit-scrollbar { display: none; }
.ctrl-btn {
  flex: 0 0 42px;
  border-radius: 10px;
  scroll-snap-align: center;
}
@media (min-width: 900px) {
  #controls {
    align-items: flex-end;
  }
  #ctrl-left,
  #ctrl-right {
    padding: 4px;
    border-radius: 14px;
    background: rgba(3,6,20,.28);
    border: 1px solid rgba(0,247,255,.06);
  }
}
/* ══════════════════════════════════════════════════════════
   UX FEATURES: toolbar labels, culture dropdown, welcome,
   always-on nav labels, what's-up card
══════════════════════════════════════════════════════════ */

/* 1 ── Bottom toolbar icon labels */
#ctrl-left .ctrl-btn {
  flex-direction: column; gap: 2px;
  height: 50px; width: 46px; font-size: .78rem;
}
.ctrl-label {
  font-family: var(--orb); font-size: .32rem; letter-spacing: .04em;
  color: rgba(0,247,255,.5); line-height: 1; display: block;
}
.ctrl-btn.active .ctrl-label { color: rgba(0,247,255,.9); }
#btn-whatsup { font-size: 1.1rem; }

/* 2 ── Culture dropdown */
#cult-more-wrap { position: relative; }
#cult-more-dropdown {
  display: none; flex-direction: column; gap: 3px;
  position: absolute; top: calc(100% + 6px); right: 0;
  background: rgba(3,6,20,.97); border: 1px solid rgba(0,247,255,.18);
  border-radius: 12px; padding: 8px;
  min-width: 240px; z-index: 350;
  backdrop-filter: blur(24px);
  box-shadow: 0 8px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(0,247,255,.06);
}
#cult-more-dropdown.open { display: flex; }
.cult-dropdown-heading {
  font-family: var(--orb); font-size: .38rem; letter-spacing: .1em;
  color: rgba(0,247,255,.35); text-transform: uppercase;
  padding: 4px 8px 6px; border-bottom: 1px solid rgba(0,247,255,.08); margin-bottom: 4px;
}
.cult-dropdown-item {
  justify-content: flex-start; gap: 8px;
  padding: 7px 10px; border-radius: 8px; width: 100%;
  opacity: .65;
}
.cult-dropdown-item:hover { opacity: .9; }
.cult-dropdown-item.cult-live {
  opacity: .92;
  border: 1px solid rgba(232,201,106,.3);
  background: rgba(232,201,106,.05);
}
.cult-dropdown-item.cult-live:hover { opacity: 1; background: rgba(232,201,106,.1); }
.cult-dropdown-item.cult-live.active {
  color: rgba(0,247,255,.95);
  border-color: rgba(0,247,255,.45);
  background: rgba(0,247,255,.08);
}
.cult-dropdown-item[disabled] {
  opacity: .28;
  cursor: not-allowed;
}
.cult-dropdown-item[disabled]:hover { opacity: .28; }
.cult-building-tag {
  margin-left: auto; font-family: var(--orb); font-size: .32rem; letter-spacing: .08em;
  color: rgba(180,180,180,.4); border: 1px solid rgba(180,180,180,.15);
  border-radius: 4px; padding: 2px 5px;
}
.cult-live-tag {
  margin-left: auto; font-family: var(--orb); font-size: .32rem; letter-spacing: .1em;
  color: rgba(0,247,255,.95); border: 1px solid rgba(0,247,255,.5);
  border-radius: 4px; padding: 2px 6px;
  box-shadow: 0 0 8px rgba(0,247,255,.2);
}

/* 3 ── Welcome overlay */
#welcome-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,12,.85); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .5s ease;
}
#welcome-overlay.show { opacity: 1; pointer-events: all; }
#welcome-card {
  background: rgba(3,8,28,.96); border: 1px solid rgba(0,247,255,.2);
  border-radius: 20px; padding: 36px 40px; max-width: 440px; width: 92%;
  text-align: center;
  box-shadow: 0 0 80px rgba(0,247,255,.12), 0 0 0 1px rgba(232,201,106,.08);
}
#welcome-star-glyph {
  font-size: 2.4rem; color: var(--gold); margin-bottom: 12px;
  animation: star-flicker 3s ease-in-out infinite alternate;
}
#welcome-title {
  font-family: var(--orb); font-size: 1.1rem; font-weight: 800;
  color: var(--gold); letter-spacing: .12em; margin-bottom: 6px;
}
#welcome-sub {
  font-family: var(--orb); font-size: .52rem; letter-spacing: .1em;
  color: rgba(0,247,255,.55); margin-bottom: 24px;
}
#welcome-tips {
  text-align: left; margin-bottom: 28px; display: flex; flex-direction: column; gap: 10px;
}
.welcome-tip {
  font-family: var(--orb); font-size: .54rem; letter-spacing: .05em;
  color: rgba(220,235,255,.75); display: flex; align-items: flex-start; gap: 10px;
}
.wtip-dot { color: var(--cyan); flex-shrink: 0; }
.welcome-tip strong { color: var(--gold); }
#welcome-start {
  background: linear-gradient(135deg, rgba(232,201,106,.22), rgba(0,247,255,.12));
  border: 1px solid rgba(232,201,106,.45); border-radius: 24px;
  color: var(--gold); font-family: var(--orb); font-size: .62rem; letter-spacing: .1em;
  padding: 12px 32px; cursor: pointer; width: 100%; margin-bottom: 12px;
  transition: background .2s, box-shadow .2s;
}
#welcome-start:hover { box-shadow: 0 0 20px rgba(232,201,106,.3); }
#welcome-dismiss {
  font-family: var(--orb); font-size: .38rem; letter-spacing: .06em;
  color: rgba(0,247,255,.22);
}

/* 4 ── What's Up Tonight card */
#whatsup-card {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px);
  width: min(420px, 94vw); z-index: 400;
  background: rgba(3,8,28,.97); border: 1px solid rgba(0,247,255,.18);
  border-radius: 16px; padding: 0;
  box-shadow: 0 -4px 40px rgba(0,0,0,.6), 0 0 0 1px rgba(232,201,106,.06);
  backdrop-filter: blur(24px);
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
#whatsup-card.show { opacity: 1; pointer-events: all; transform: translateX(-50%) translateY(0); }
#whatsup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(0,247,255,.1);
}
#whatsup-title {
  font-family: var(--orb); font-size: .62rem; font-weight: 700;
  letter-spacing: .1em; color: var(--gold);
}
#whatsup-close {
  background: transparent; border: none; color: rgba(0,247,255,.5);
  font-size: .9rem; cursor: pointer; padding: 2px 6px;
}
#whatsup-body { padding: 12px 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.wu-item {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(0,247,255,.04); border: 1px solid rgba(0,247,255,.08);
}
.wu-icon { font-size: 1.4rem; flex-shrink: 0; width: 32px; text-align: center; }
.wu-info { flex: 1; min-width: 0; }
.wu-name { font-family: var(--orb); font-size: .56rem; font-weight: 700; color: rgba(220,235,255,.9); }
.wu-detail { font-family: var(--orb); font-size: .44rem; color: rgba(0,247,255,.5); margin-top: 2px; }
.wu-go {
  flex-shrink: 0; background: rgba(0,247,255,.1); border: 1px solid rgba(0,247,255,.25);
  border-radius: 8px; color: var(--cyan); font-family: var(--orb); font-size: .48rem;
  padding: 6px 12px; cursor: pointer; transition: background .15s;
}
.wu-go:hover { background: rgba(0,247,255,.2); }

@media (max-width: 760px) {
  #controls {
    gap: 8px;
    padding: 8px 8px max(14px,env(safe-area-inset-bottom,14px));
    background:linear-gradient(to top,rgba(0,0,0,.9),rgba(0,0,0,.48) 72%,transparent);
  }
  #ctrl-left,
  #ctrl-right {
    max-width: calc(50vw - 8px);
    gap: 5px;
    padding:4px;
    border-radius:13px;
    background:rgba(3,6,20,.64);
    border:1px solid rgba(0,247,255,.08);
    backdrop-filter:blur(14px);
  }
  .ctrl-btn {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    border-radius: 9px;
  }
  .ctrl-label { display: none; }
  .ctrl-divider-v { display: none; }
  #compass-overlay-toolbar {
    top: 100px;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  #compass-overlay-close {
    top: max(58px, calc(env(safe-area-inset-top, 0px) + 50px));
    right: 10px;
    width: 40px; height: 40px;
    font-size: 1rem;
  }
  #compass-overlay canvas {
    max-width:min(92vw,calc(100vh - 235px));
    max-height:min(92vw,calc(100vh - 235px));
    width:min(92vw,calc(100vh - 235px));
    height:min(92vw,calc(100vh - 235px));
  }
  #hawaiian-map-tools{
    top:auto;right:10px;left:10px;
    bottom: max(86px, calc(env(safe-area-inset-bottom, 0px) + 78px));
    width:auto;max-height:32vh;padding:10px;
    overscroll-behavior:contain;
  }
  #hawaiian-map-checklist{max-height:calc(32vh - 96px);overscroll-behavior:contain;}

  /* Time panel — override inline bottom so it clears the controls bar on home-indicator devices */
  #time-panel {
    bottom: max(74px, calc(env(safe-area-inset-bottom, 0px) + 70px)) !important;
    min-width: min(280px, 90vw) !important;
    max-width: 92vw !important;
  }
  #tp-play, #tp-reset {
    touch-action: manipulation;
  }
}
@media (max-width: 460px) {
  /* Single horizontally-scrollable row — all buttons reachable, no grid clipping */
  #controls {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 8px;
    padding: 8px 10px max(16px, env(safe-area-inset-bottom, 16px));
    align-items: center;
  }
  #controls::-webkit-scrollbar { display: none; }

  #ctrl-left,
  #ctrl-right {
    flex-shrink: 0;
    max-width: none;
    flex-wrap: nowrap;
    overflow: visible;
    gap: 5px;
  }

  /* Re-show any buttons hidden by the ≤380px rule — all reachable by scrolling */
  #ctrl-left .ctrl-btn { display: flex; }
  #ctrl-divider { display: block; }

  /* 44 px targets — Apple/Google minimum recommendation */
  .ctrl-btn {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }

  /* Compass overlay month nav */
  #skymap-controls { width: 100%; }
  #skymap-select { flex: 1; min-width: 0; }

  /* Hawaiian sky map tools */
  .hmt-head { align-items: flex-start; flex-direction: column; gap: 7px; }
  #hawaiian-map-select { width: 100%; }
  .hmt-status { display: none; }
}

/* ── Landscape phone — shrink overlay panels so the sky stays visible ── */
@media (max-height: 500px) and (max-width: 900px) {
  #hawaiian-map-tools { max-height: 50vh; }
  #hawaiian-map-checklist { max-height: calc(50vh - 96px); }
  #compass-overlay canvas {
    max-width: min(56vw, calc(100vh - 140px));
    max-height: min(56vw, calc(100vh - 140px));
    width: min(56vw, calc(100vh - 140px));
    height: min(56vw, calc(100vh - 140px));
  }
}

/* ══════════════════════════════════════════════════════════
   NEW FEATURES — Search · Photo Mode · Auth · Topbar Search
══════════════════════════════════════════════════════════ */

/* ── Topbar search button ── */
#topbar-search-btn {
  flex-shrink: 0; align-self: center;
  background: transparent; border: 1px solid rgba(0,247,255,.18);
  border-radius: 8px; color: rgba(0,247,255,.6);
  padding: 7px 10px; font-size: .82rem;
  cursor: pointer; margin-right: 4px;
  touch-action: manipulation;
  transition: color .15s, border-color .15s, background .15s;
}
#topbar-search-btn:hover {
  color: rgba(0,247,255,.95); border-color: rgba(0,247,255,.5);
  background: rgba(0,247,255,.07);
}

/* ── Search overlay ── */
#search-overlay {
  position: fixed; inset: 0; z-index: 8500;
  background: rgba(0,0,12,.75); backdrop-filter: blur(16px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: max(80px, calc(env(safe-area-inset-top, 0px) + 72px));
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
#search-overlay.open { opacity: 1; pointer-events: all; }
#search-card {
  width: min(560px, 94vw);
  background: rgba(3,8,28,.98); border: 1px solid rgba(0,247,255,.22);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.8), 0 0 0 1px rgba(0,247,255,.06);
}
#search-input-wrap {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid rgba(0,247,255,.08);
}
#search-icon { color: rgba(0,247,255,.45); font-size: .9rem; flex-shrink: 0; }
#search-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-family: var(--orb); font-size: .72rem; letter-spacing: .06em;
  color: rgba(220,235,255,.9); caret-color: var(--cyan);
}
#search-input::placeholder { color: rgba(255,255,255,.22); }
#search-close-btn {
  background: transparent; border: none; color: rgba(255,255,255,.3);
  font-size: .9rem; cursor: pointer; padding: 4px;
  transition: color .15s;
}
#search-close-btn:hover { color: rgba(255,255,255,.7); }
#search-results {
  max-height: 360px; overflow-y: auto; padding: 8px;
  overscroll-behavior: contain;
}
.search-result {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  transition: background .15s;
}
.search-result:hover { background: rgba(0,247,255,.07); }
.search-result-icon {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.search-result-icon.star-icon { background: rgba(232,201,106,.1); }
.search-result-icon.form-icon { background: rgba(0,247,255,.1); }
.search-result-name {
  font-family: var(--orb); font-size: .6rem; letter-spacing: .06em;
  color: rgba(220,235,255,.88); margin-bottom: 2px;
}
.search-result-sub {
  font-size: .56rem; color: rgba(0,247,255,.5); font-family: var(--orb);
  letter-spacing: .04em;
}
.search-result-badge {
  margin-left: auto; font-family: var(--orb); font-size: .38rem;
  letter-spacing: .08em; color: rgba(255,255,255,.3);
  background: rgba(255,255,255,.06); border-radius: 6px; padding: 2px 7px;
  flex-shrink: 0;
}
#search-empty {
  text-align: center; padding: 28px;
  font-family: var(--orb); font-size: .55rem; letter-spacing: .08em;
  color: rgba(255,255,255,.22);
}
.search-result-icon.galaxy-icon { background: rgba(160,100,255,.12); }

/* ── Galaxy browser button ── */
#topbar-galaxy-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1.05rem; padding: 4px 6px; border-radius: 8px;
  opacity: .75; transition: opacity .2s, background .2s;
  color: inherit; line-height: 1;
}
#topbar-galaxy-btn:hover { opacity: 1; background: rgba(255,255,255,.08); }

/* ── Galaxy browser overlay ── */
#galaxy-overlay {
  position: fixed; inset: 0; z-index: 8400;
  background: rgba(0,0,12,.78); backdrop-filter: blur(16px);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 60px;
}
#galaxy-overlay.open { opacity: 1; pointer-events: all; }
#galaxy-card {
  width: min(580px, 96vw); max-height: 82vh;
  background: rgba(3,6,24,.98); border: 1px solid rgba(140,80,255,.28);
  border-radius: 18px; overflow: hidden; display: flex; flex-direction: column;
}
#galaxy-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(140,80,255,.14);
  font-family: var(--orb); font-size: .65rem; letter-spacing: .1em;
  color: rgba(200,170,255,.88);
}
#galaxy-close-btn {
  background: none; border: none; cursor: pointer; color: rgba(255,255,255,.4);
  font-size: .9rem; padding: 2px 6px; border-radius: 6px; transition: color .15s;
}
#galaxy-close-btn:hover { color: rgba(255,255,255,.85); }
#galaxy-list {
  overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 10px 16px;
}
.gb-group-label {
  font-family: var(--orb); font-size: .48rem; letter-spacing: .14em;
  color: rgba(140,80,255,.55); text-transform: uppercase;
  padding: 14px 8px 6px; margin-top: 4px;
}
.gb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px; border-radius: 12px; cursor: pointer;
  transition: background .15s; margin-bottom: 2px;
}
.gb-row:hover { background: rgba(140,80,255,.10); }
.gb-thumb {
  border-radius: 50%; flex-shrink: 0; background: #000;
}
.gb-info { flex: 1; min-width: 0; }
.gb-name {
  font-family: var(--orb); font-size: .6rem; letter-spacing: .06em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px;
}
.gb-meta {
  font-size: .52rem; color: rgba(180,160,220,.5); font-family: var(--orb);
  letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gb-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.gb-dist {
  font-family: var(--orb); font-size: .48rem; letter-spacing: .06em;
  color: rgba(200,190,220,.45);
}
.gb-look {
  background: rgba(140,80,255,.18); border: 1px solid rgba(140,80,255,.30);
  border-radius: 8px; color: rgba(200,170,255,.85); cursor: pointer;
  font-family: var(--orb); font-size: .50rem; letter-spacing: .06em;
  padding: 4px 11px; transition: background .15s;
}
.gb-look:hover { background: rgba(140,80,255,.36); }

/* ── Galaxy info panel elements ── */
.pill-dim { opacity: .45; }
.horizon-toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 9000;
  background: rgba(3,6,20,.92); border: 1px solid rgba(255,160,70,.25); border-radius: 12px;
  padding: 9px 18px; font-family: var(--orb); font-size: .62rem; letter-spacing: .06em;
  color: rgba(255,160,70,.8); pointer-events: none; backdrop-filter: blur(16px);
  white-space: nowrap; animation: toastIn .25s ease;
}
@keyframes toastIn { from { opacity:0; transform:translateX(-50%) translateY(8px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }

/* ── Photo mode ── */
#photo-restore-btn,
#photo-save-btn {
  display: none;
  position: fixed; z-index: 9000;
  background: rgba(3,6,20,.88); border: 1px solid rgba(255,255,255,.18);
  border-radius: 24px; color: rgba(255,255,255,.75);
  font-family: var(--orb); font-size: .55rem; letter-spacing: .08em;
  padding: 8px 18px; cursor: pointer; backdrop-filter: blur(16px);
  transition: all .15s;
}
#photo-restore-btn { bottom: 24px; left: 50%; transform: translateX(-50%); }
#photo-save-btn    { bottom: 24px; right: 24px; }
#photo-restore-btn:hover, #photo-save-btn:hover {
  background: rgba(3,6,20,.96); color: rgba(255,255,255,.95);
}
body.photo-mode #photo-restore-btn,
body.photo-mode #photo-save-btn { display: block; }
body.photo-mode #topbar,
body.photo-mode #controls,
body.photo-mode #nav-hud,
body.photo-mode #seasonal-badge,
body.photo-mode #whatsup-card,
body.photo-mode #tooltip,
body.photo-mode #cursor { display: none !important; }

/* ── Auth overlay ── */
#auth-overlay {
  position: fixed; inset: 0; z-index: 8600;
  background: rgba(0,0,12,.82); backdrop-filter: blur(18px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
#auth-overlay.open { opacity: 1; pointer-events: all; }
#auth-card {
  position: relative; width: min(400px, 94vw);
  background: rgba(3,8,28,.98); border: 1px solid rgba(0,247,255,.18);
  border-radius: 20px; padding: 36px 30px 28px; text-align: center;
  box-shadow: 0 0 80px rgba(0,247,255,.08), 0 24px 60px rgba(0,0,0,.7);
}
#auth-close-btn {
  position: absolute; top: 14px; right: 16px;
  background: transparent; border: none; color: rgba(255,255,255,.3);
  font-size: 1rem; cursor: pointer; transition: color .15s;
}
#auth-close-btn:hover { color: rgba(255,255,255,.7); }
#auth-icon { font-size: 2.2rem; margin-bottom: 10px; }
#auth-title {
  font-family: var(--orb); font-size: .88rem; font-weight: 700;
  letter-spacing: .14em; color: var(--gold); margin-bottom: 8px;
}
.auth-sub-text {
  font-family: var(--orb); font-size: .52rem; letter-spacing: .06em;
  color: rgba(0,247,255,.55); margin-bottom: 16px; line-height: 1.7;
}
.auth-features-list {
  list-style: none; padding: 0; margin: 0 0 20px;
  background: rgba(0,247,255,.04); border: 1px solid rgba(0,247,255,.1);
  border-radius: 12px; padding: 12px 14px; text-align: left;
}
.auth-features-list li {
  font-family: var(--orb); font-size: .5rem; letter-spacing: .07em;
  color: rgba(200,230,255,.65); line-height: 1.9;
}
.auth-features-active li { color: rgba(0,247,255,.75); }
.auth-feat-dot { color: var(--gold); margin-right: 6px; }
.auth-lkp-note {
  font-family: var(--orb); font-size: .46rem; letter-spacing: .05em;
  color: rgba(255,255,255,.22); margin-top: 14px; margin-bottom: 0; line-height: 1.6;
}
#auth-email-input {
  width: 100%; padding: 11px 14px; margin-bottom: 12px;
  background: rgba(0,247,255,.05); border: 1px solid rgba(0,247,255,.2);
  border-radius: 10px; outline: none; color: rgba(220,235,255,.9);
  font-family: var(--orb); font-size: .6rem; letter-spacing: .05em;
  transition: border-color .15s; box-sizing: border-box;
}
#auth-email-input:focus { border-color: rgba(0,247,255,.5); }
/* Password field */
.auth-password-wrap { position: relative; margin-bottom: 12px; }
#auth-password-input {
  width: 100%; padding: 11px 42px 11px 14px; box-sizing: border-box;
  background: rgba(0,247,255,.05); border: 1px solid rgba(0,247,255,.2);
  border-radius: 10px; outline: none; color: rgba(220,235,255,.9);
  font-family: var(--orb); font-size: .6rem; letter-spacing: .05em;
  transition: border-color .15s;
}
#auth-password-input:focus { border-color: rgba(0,247,255,.5); }
.auth-pw-eye {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; color: rgba(0,247,255,.35);
  cursor: pointer; padding: 0; display: flex; align-items: center;
  transition: color .15s;
}
.auth-pw-eye:hover { color: rgba(0,247,255,.8); }
/* Google button */
#auth-google-btn {
  width: 100%; padding: 11px 14px; border-radius: 12px; margin-bottom: 0;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.18);
  color: rgba(220,235,255,.85); font-family: var(--orb); font-size: .58rem;
  letter-spacing: .07em; cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-sizing: border-box;
}
#auth-google-btn:hover { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.3); }
/* Or divider */
.auth-divider {
  display: flex; align-items: center; gap: 10px; margin: 14px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(0,247,255,.12);
}
.auth-divider span {
  font-family: var(--orb); font-size: .46rem; letter-spacing: .08em;
  color: rgba(255,255,255,.2);
}
/* Submit button */
#auth-submit-btn {
  width: 100%; padding: 12px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(0,247,255,.18), rgba(0,247,255,.08));
  border: 1px solid rgba(0,247,255,.35); color: rgba(0,247,255,.9);
  font-family: var(--orb); font-size: .58rem; letter-spacing: .1em;
  cursor: pointer; transition: all .2s;
}
#auth-submit-btn:hover { background: rgba(0,247,255,.18); box-shadow: 0 0 16px rgba(0,247,255,.2); }
#auth-submit-btn:disabled { opacity: .45; cursor: default; }
/* Sign-up / sign-in mode toggle */
.auth-mode-toggle {
  margin: 12px 0 0; font-family: var(--orb); font-size: .48rem;
  letter-spacing: .05em; color: rgba(255,255,255,.28); line-height: 1.6;
}
.auth-mode-toggle button {
  background: none; border: none; color: rgba(0,247,255,.6);
  font-family: var(--orb); font-size: .48rem; letter-spacing: .05em;
  cursor: pointer; padding: 0; transition: color .15s;
  text-decoration: underline; text-decoration-color: rgba(0,247,255,.2);
}
.auth-mode-toggle button:hover { color: rgba(0,247,255,.9); }
#auth-msg.error { color: rgba(255,110,110,.85); }
#auth-msg.success { color: rgba(0,247,255,.8); }

/* Signed-in panel */
#auth-avatar-circle {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 12px;
  background: radial-gradient(circle at 38% 32%, rgba(0,247,255,.24) 0%, rgba(0,247,255,.07) 60%, transparent 100%);
  border: 1.5px solid rgba(0,247,255,.4);
  box-shadow: 0 0 18px rgba(0,247,255,.22);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--orb); font-size: .88rem; font-weight: 700;
  letter-spacing: .04em; color: rgba(0,247,255,.9);
}
.auth-display-name {
  font-family: var(--orb); font-size: .78rem; font-weight: 700;
  letter-spacing: .1em; color: var(--gold); margin-bottom: 4px;
}
.auth-user-email {
  font-family: var(--orb); font-size: .48rem; letter-spacing: .06em;
  color: rgba(255,255,255,.3); margin-bottom: 18px;
}
.auth-profile-link-btn {
  display: block; width: 100%; padding: 11px; margin-bottom: 10px;
  border-radius: 12px; border: 1px solid rgba(232,201,106,.35);
  background: linear-gradient(135deg, rgba(232,201,106,.1), rgba(232,201,106,.04));
  color: var(--gold); font-family: var(--orb); font-size: .56rem;
  letter-spacing: .1em; text-decoration: none; transition: all .2s;
  box-sizing: border-box;
}
.auth-profile-link-btn:hover { border-color: rgba(232,201,106,.65); box-shadow: 0 0 14px rgba(232,201,106,.18); }
#auth-signout-btn {
  display: block; width: 100%; padding: 10px;
  border-radius: 10px; border: 1px solid rgba(255,100,100,.22);
  background: transparent; color: rgba(255,150,150,.65);
  font-family: var(--orb); font-size: .52rem; letter-spacing: .08em;
  cursor: pointer; transition: all .15s; box-sizing: border-box;
}
#auth-signout-btn:hover { border-color: rgba(255,100,100,.5); color: rgba(255,150,150,1); }
#auth-msg {
  margin-top: 14px; font-family: var(--orb); font-size: .52rem;
  letter-spacing: .06em; min-height: 18px; line-height: 1.6;
  color: rgba(0,247,255,.7);
}
/* Show/hide auth panels based on signed-in state */
#auth-overlay .auth-state-signed-in { display: none; }
#auth-overlay.signed-in .auth-state-signed-in { display: block; }
#auth-overlay.signed-in .auth-state-signed-out { display: none; }

/* Profile button — signed-in initials state */
#topbar-profile-btn.signed-in {
  border-color: rgba(0,247,255,.65);
  box-shadow: 0 0 10px rgba(0,247,255,.3), 0 0 0 2px rgba(0,247,255,.1);
  background: radial-gradient(circle at 38% 32%, rgba(0,247,255,.2) 0%, rgba(0,247,255,.06) 70%, transparent 100%);
}
.profile-initials {
  font-family: var(--orb); font-size: .56rem; font-weight: 700;
  letter-spacing: .04em; color: rgba(0,247,255,.95); pointer-events: none;
  line-height: 1;
}

/* ── Toast notifications ── */
#ike-toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(8px);
  z-index: 9500; background: rgba(3,6,20,.93); border: 1px solid rgba(0,247,255,.2);
  border-radius: 20px; padding: 9px 20px;
  font-family: var(--orb); font-size: .58rem; letter-spacing: .08em;
  color: rgba(0,247,255,.9); pointer-events: none; white-space: nowrap;
  backdrop-filter: blur(18px);
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
}
#ike-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }


/* ── Virtual joystick (touch devices only) ── */
#sky-joystick {
  display: none; /* shown via @media below */
  position: fixed;
  bottom: max(90px, calc(env(safe-area-inset-bottom, 0px) + 84px));
  left: 16px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(3,6,20,.55);
  border: 1.5px solid rgba(0,247,255,.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  touch-action: none;
  user-select: none;
  z-index: 200;
  transition: opacity .25s, border-color .2s;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
}
#sky-joystick.hidden { opacity: 0; pointer-events: none; }
#sky-joystick.active { border-color: rgba(0,247,255,.55); }

#sky-joystick-nub {
  position: absolute;
  top: 50%; left: 50%;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(0,247,255,.28);
  border: 1.5px solid rgba(0,247,255,.6);
  transform: translate(-50%, -50%);
  transition: transform .1s ease, background .15s;
  pointer-events: none;
}
#sky-joystick.active #sky-joystick-nub {
  transition: background .15s;
  background: rgba(0,247,255,.5);
}
#sky-joystick-nub i {
  font-size: .65rem;
  color: rgba(0,247,255,.7);
  pointer-events: none;
}

/* Direction arrows inside the ring */
#sky-joystick::before,
#sky-joystick::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

@media (pointer: coarse) {
  #sky-joystick { display: block; }
}

/* Gyro active: subtle body indicator */
body.gyro-on #btn-gyro {
  color: rgba(0,247,255,1);
  background: rgba(0,247,255,.18);
  box-shadow: 0 0 12px rgba(0,247,255,.3);
}
body.gyro-on #ctrl-hint { display: none; }

/* ── Inline task action button (inside Practice section) ── */
.lesson-task-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px;
  padding: 7px 14px;
  border: 1px solid rgba(0,247,255,.32);
  border-radius: 8px;
  background: rgba(0,247,255,.07);
  color: rgba(0,247,255,.88);
  font-family: var(--orb); font-size: .58rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; touch-action: manipulation;
  transition: background .15s, border-color .15s;
}
.lesson-task-btn.triggered {
  border-color: rgba(60,200,120,.45);
  background: rgba(60,200,120,.1);
  color: rgba(120,230,160,.9);
}
.lesson-task-btn:hover { background: rgba(0,247,255,.14); }

/* ── Module card complete state ── */
.learn-card.complete .learn-progress span {
  background: linear-gradient(90deg, rgba(60,200,120,.8), rgba(0,247,255,.9));
}
.learn-card-badge { display: flex; align-items: center; justify-content: center; }
.learn-card-badge img { width: 36px; height: 36px; border-radius: 50%; }

/* ── Badge modal ── */
@keyframes badge-in {
  0%   { opacity: 0; transform: scale(.7); }
  70%  { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes badge-ring-spin {
  to { transform: rotate(360deg); }
}
#badge-modal {
  position: fixed; inset: 0; z-index: 9000;
  display: none; align-items: center; justify-content: center;
  background: rgba(3,6,20,.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
#badge-modal.show { display: flex; }
#badge-modal-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  padding: 36px 32px 28px;
  background: rgba(3,6,20,.96);
  border: 1px solid rgba(0,247,255,.22);
  border-radius: 20px;
  box-shadow: 0 0 60px rgba(0,247,255,.12), 0 20px 60px rgba(0,0,0,.6);
  animation: badge-in .5s cubic-bezier(.34,1.56,.64,1) both;
  max-width: 320px; width: 88vw;
}
#badge-modal-ring {
  position: absolute; inset: -3px; border-radius: 22px;
  background: conic-gradient(rgba(0,247,255,.6), rgba(232,201,106,.6), rgba(0,247,255,.6));
  animation: badge-ring-spin 3s linear infinite;
  z-index: -1; border-radius: 23px;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #fff calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #fff calc(100% - 3px));
}
#badge-modal-img {
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(0,247,255,.25);
}
#badge-modal-label {
  font-family: var(--orb); font-size: .58rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
  color: rgba(0,247,255,.7);
}
#badge-modal-name {
  font-family: var(--orb); font-size: 1.05rem; font-weight: 800;
  color: rgba(232,201,106,.95); text-align: center;
  line-height: 1.3;
}
#badge-modal-close {
  margin-top: 6px;
  padding: 10px 32px;
  border: 1px solid rgba(0,247,255,.35);
  border-radius: 10px;
  background: rgba(0,247,255,.09);
  color: rgba(0,247,255,.9);
  font-family: var(--orb); font-size: .62rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer; touch-action: manipulation;
  transition: background .15s;
}
#badge-modal-close:hover { background: rgba(0,247,255,.18); }

/* ════════════════════════════════════════════════════════
   NEW FEATURES — Moon Panel, Mobile Nav, Season, Find in Sky
════════════════════════════════════════════════════════ */

/* ── Ka Mahina Moon Panel ── */
#moon-panel {
  position: fixed; inset: 0; z-index: 1800;
  background: rgba(2,4,18,.97); overflow-y: auto;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.22,.68,0,1.2);
  scrollbar-width: thin; scrollbar-color: rgba(255,215,0,.14) transparent;
}
#moon-panel.show { transform: translateY(0); }

#moon-panel-topbar {
  position: sticky; top: 0; z-index: 1;
  background: rgba(2,4,18,.98);
  border-bottom: 1px solid rgba(255,215,0,.1);
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px 12px;
}
#moon-panel-back {
  background: none; border: none; color: rgba(0,247,255,.65);
  font-family: var(--orb); font-size: .6rem; letter-spacing: .07em;
  cursor: pointer; padding: 6px 10px; border-radius: 8px;
  transition: color .15s; flex-shrink: 0;
}
#moon-panel-back:hover { color: rgba(0,247,255,.95); }
#moon-panel-title {
  font-family: var(--orb); font-size: .82rem; font-weight: 800;
  color: var(--gold); letter-spacing: .09em;
}
#moon-panel-sub {
  font-family: var(--orb); font-size: .5rem;
  color: rgba(0,247,255,.38); letter-spacing: .07em; margin-top: 2px;
}
#moon-panel-body { padding: 16px 18px 100px; }

.mp-tonight {
  display: flex; gap: 16px; align-items: flex-start;
  background: rgba(255,215,0,.05);
  border: 1px solid rgba(255,215,0,.18);
  border-radius: 16px; padding: 16px; margin-bottom: 10px;
}
.mp-tonight-glyph { font-size: 2.8rem; flex-shrink: 0; line-height: 1; }
.mp-tonight-label {
  font-family: var(--orb); font-size: .44rem; letter-spacing: .14em;
  color: rgba(255,215,0,.55); margin-bottom: 4px;
}
.mp-tonight-name {
  font-family: var(--orb); font-size: 1.25rem; font-weight: 800;
  color: var(--gold); letter-spacing: .06em; line-height: 1.15;
}
.mp-tonight-char {
  font-family: var(--orb); font-size: .52rem; color: rgba(0,247,255,.5);
  margin-top: 4px; letter-spacing: .06em;
}
.mp-tonight-meaning {
  font-size: .72rem; color: rgba(255,255,255,.65); margin-top: 6px; line-height: 1.5;
}
.mp-best-for {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,200,100,.06); border: 1px solid rgba(0,200,100,.18);
  border-radius: 10px; padding: 9px 14px; margin-bottom: 8px;
  font-family: var(--orb); font-size: .58rem; color: rgba(0,230,120,.75);
  letter-spacing: .05em;
}
.mp-taboo {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,60,60,.04); border: 1px solid rgba(255,60,60,.15);
  border-radius: 10px; padding: 9px 14px; margin-bottom: 8px;
  font-family: var(--orb); font-size: .58rem; color: rgba(255,90,90,.65);
  letter-spacing: .05em;
}
.mp-notes {
  font-size: .68rem; color: rgba(255,255,255,.38); line-height: 1.6;
  margin-bottom: 12px; padding: 0 4px;
}
.mp-look-btn {
  width: 100%; padding: 13px; border-radius: 14px;
  background: rgba(255,215,0,.08); border: 1px solid rgba(255,215,0,.28);
  color: var(--gold); font-family: var(--orb); font-size: .65rem;
  letter-spacing: .1em; cursor: pointer; touch-action: manipulation;
  transition: background .15s; margin-bottom: 20px;
}
.mp-look-btn:hover { background: rgba(255,215,0,.15); }
.mp-grid-label {
  font-family: var(--orb); font-size: .44rem; letter-spacing: .14em;
  color: rgba(0,247,255,.35); margin-bottom: 10px;
}
.mp-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 7px;
}
.mp-night {
  text-align: left; padding: 10px 12px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
  color: inherit; font: inherit; cursor: pointer;
  touch-action: manipulation; transition: background .15s; width: 100%;
}
.mp-night:hover { background: rgba(255,255,255,.06); }
.mp-today {
  border-color: rgba(255,215,0,.5) !important;
  background: rgba(255,215,0,.09) !important;
}
.mp-full { background: rgba(255,248,200,.03); }
.mp-night-phase { font-size: 1.1rem; margin-bottom: 4px; }
.mp-night-name {
  font-family: var(--orb); font-size: .62rem; font-weight: 700;
  color: rgba(255,255,255,.8); margin-bottom: 2px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.mp-today .mp-night-name { color: var(--gold); }
.mp-night-num { font-family: var(--orb); font-size: .48rem; color: rgba(0,247,255,.35); }

/* ── Tonight's Sky enhancements ── */
.wu-section-label {
  font-family: var(--orb); font-size: .44rem; letter-spacing: .14em;
  color: rgba(0,247,255,.35); margin: 12px 0 6px; padding: 0 2px;
}
.wu-sub { font-size: .58rem; color: rgba(0,200,100,.65); margin-top: 3px; font-family: var(--orb); }

/* ── Find in Sky button ── */
.ep-find-sky-btn {
  width: 100%; padding: 12px; border-radius: 14px; margin-top: 10px;
  background: rgba(0,247,255,.07); border: 1px solid rgba(0,247,255,.25);
  color: rgba(0,247,255,.8); font-family: var(--orb); font-size: .6rem;
  letter-spacing: .09em; cursor: pointer; touch-action: manipulation;
  transition: all .15s; display: flex; align-items: center;
  justify-content: center; gap: 8px;
}
.ep-find-sky-btn:hover { background: rgba(0,247,255,.15); color: rgba(0,247,255,.95); }

/* ── Lesson Return Pill ── */
#lesson-return-pill {
  position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%);
  z-index: 8000; background: rgba(3,6,20,.92);
  border: 1px solid rgba(0,247,255,.3); border-radius: 24px;
  color: rgba(0,247,255,.8); font-family: var(--orb); font-size: .58rem;
  letter-spacing: .08em; padding: 10px 22px; cursor: pointer;
  backdrop-filter: blur(16px); display: flex; align-items: center; gap: 8px;
  animation: toastIn .25s ease; white-space: nowrap;
  box-shadow: 0 4px 24px rgba(0,247,255,.12);
}
#lesson-return-pill:hover { background: rgba(0,247,255,.15); color: rgba(0,247,255,.98); }

/* ── Mobile Bottom Navigation ── */
#mobile-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 2000;
  background: rgba(2,4,18,.96); backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0,247,255,.1);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@media (max-width: 760px) {
  #mobile-bottom-nav { display: flex; }
}
.mbn-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; padding: 10px 4px 8px;
  background: none; border: none; color: rgba(255,255,255,.35);
  font-family: var(--orb); font-size: .42rem; letter-spacing: .07em;
  cursor: pointer; touch-action: manipulation; transition: color .15s;
  text-decoration: none; min-height: 54px;
}
.mbn-btn i { font-size: .88rem; }
.mbn-btn.active { color: rgba(0,247,255,.92); }
.mbn-btn:hover { color: rgba(0,247,255,.7); }

/* On mobile, pad controls + panels above bottom nav */
@media (max-width: 760px) {
  #controls { bottom: 62px; }
  #info-panel { padding-bottom: 62px; }
  #moon-panel-body { padding-bottom: 80px; }
  #lesson-return-pill { bottom: 72px; }
  body.photo-mode #mobile-bottom-nav { display: none; }
}

/* ── Season Indicator ── */
#season-indicator {
  flex-shrink: 0; align-items: center;
  opacity: .7;
}
