/* MASTERCLASS-PASS: Observatorium-Einstieg, Launch und Navigationsrahmen. */
/* Rein progressive UI: Die 3D-Szene, WebXR und alle Lernmodi bleiben frei */
/* von Abhaengigkeiten zu diesen Dekorationen.                              */
/* ====================================================================== */

#title {
  align-items: stretch;
  justify-content: flex-start;
  padding: clamp(22px, 4vh, 48px) clamp(20px, 4vw, 64px) 22px;
  background:
    radial-gradient(circle at 73% 45%, rgba(35, 112, 142, 0.18), transparent 27%),
    radial-gradient(ellipse 62% 70% at 76% 54%, rgba(31, 42, 95, 0.22), transparent 62%),
    linear-gradient(115deg, rgba(3, 7, 17, 0.985) 0%, rgba(5, 10, 23, 0.96) 48%, rgba(3, 6, 16, 0.985) 100%);
}
#title::before {
  display: block;
  opacity: 0.36;
  animation: observatoryDrift 120s linear infinite;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,.25) 45%, #000 100%);
  mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,.25) 45%, #000 100%);
}
#title::after {
  display: block;
  inset: 0;
  opacity: 1;
  background:
    linear-gradient(90deg, rgba(124,240,255,.055) 1px, transparent 1px),
    linear-gradient(rgba(124,240,255,.045) 1px, transparent 1px);
  background-size: 96px 96px;
  -webkit-mask-image: radial-gradient(circle at 74% 48%, #000, transparent 45%);
  mask-image: radial-gradient(circle at 74% 48%, #000, transparent 45%);
  animation: none;
}
@keyframes observatoryDrift { to { background-position: -280px 280px; } }
#title > :first-child { margin-top: auto; }
#title > :last-child { margin-bottom: auto; }

.titleeyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 22px;
  color: #7da5c7;
  font-size: 10px;
  letter-spacing: .2em;
}
.titleeyebrow i,
.hudbrand i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7cffb2;
  box-shadow: 0 0 11px rgba(124,255,178,.9);
  animation: navPulse 2s ease-in-out infinite;
}
@keyframes navPulse { 50% { opacity: .45; box-shadow: 0 0 4px rgba(124,255,178,.45); } }
@keyframes scopeSpin { to { transform: rotate(360deg); } }
/* Unterer Produktbereich bleibt erreichbar, aber nimmt dem Hero nicht die Buehne. */
#title > .titlefoot { max-width: 760px; margin: 4px auto 0; font-size: 9.5px; }
#title > .titleteacher { margin: 7px auto 0; }
#title > .titlelegal { margin: 7px auto 0; font-size: 9.5px; }
#title > .titlecredit { margin: 6px auto 0; font-size: 9px; }
#title > #producttools { margin-left: auto; margin-right: auto; }

/* Filmischer, aber kurzer Wechsel vom Observatorium in die echte Szene. */
#launchSequence {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  background: radial-gradient(circle, rgba(14,45,66,.48), rgba(2,5,13,.97) 66%);
}
#launchSequence::before,
#launchSequence::after { content: ""; position: absolute; left: 50%; top: 50%; background: linear-gradient(90deg, transparent, rgba(180,238,255,.5), transparent); transform: translate(-50%,-50%); }
#launchSequence::before { width: 140vw; height: 1px; }
#launchSequence::after { width: 1px; height: 140vh; background: linear-gradient(transparent, rgba(180,238,255,.35), transparent); }
.launch-ring { position: relative; width: 170px; height: 170px; border: 1px solid rgba(124,240,255,.32); border-radius: 50%; }
.launch-ring::before, .launch-ring::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(124,240,255,.14); }
.launch-ring::before { inset: 18px; }
.launch-ring::after { inset: -25px; border-style: dashed; }
.launch-ring i { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%,-50%); background: #e9fdff; box-shadow: 0 0 20px #7cf0ff, 0 0 70px #7cf0ff; }
.launch-copy { position: absolute; left: 50%; top: calc(50% + 128px); transform: translateX(-50%); width: min(440px, 88vw); text-align: center; }
.launch-copy span { display: block; color: #7cffb2; font-size: 9px; letter-spacing: .23em; }
.launch-copy b { display: block; margin-top: 8px; color: #dff8ff; font-size: 12px; font-weight: 400; letter-spacing: .19em; }
body.launching #launchSequence { visibility: visible; animation: launchCurtain 1.15s cubic-bezier(.22,.75,.2,1) both; }
body.launching .launch-ring { animation: launchRing .9s cubic-bezier(.2,.7,.2,1) both; }
body.launching .launch-ring::after { animation: scopeSpin 3s linear infinite; }
body.launching #title { animation: titleDepart .7s cubic-bezier(.4,0,.6,1) both; }
@keyframes launchCurtain { 0% { opacity: 0; } 18%, 68% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@keyframes launchRing { 0% { transform: scale(.35); opacity: 0; } 55% { transform: scale(1); opacity: 1; } 100% { transform: scale(5.4); opacity: 0; } }
@keyframes titleDepart { to { opacity: 0; transform: scale(1.035); filter: blur(4px); } }

/* Navigationsrahmen: lesbar, duenn und weit genug vom Reticle entfernt. */
#flightframe { --thrust: 0; position: fixed; inset: 0; z-index: 2; display: none; pointer-events: none; color: #83bad4; }
body.playing #flightframe { display: block; animation: flightFrameIn .8s .45s both; }
@keyframes flightFrameIn { from { opacity: 0; } to { opacity: 1; } }
.ff-corner { position: absolute; width: 58px; height: 58px; opacity: .43; }
.ff-tl { left: 9px; top: 9px; border-left: 1px solid #7cf0ff; border-top: 1px solid #7cf0ff; }
.ff-tr { right: 9px; top: 9px; border-right: 1px solid #7cf0ff; border-top: 1px solid #7cf0ff; }
.ff-bl { left: 9px; bottom: 9px; border-left: 1px solid #7cf0ff; border-bottom: 1px solid #7cf0ff; }
.ff-br { right: 9px; bottom: 9px; border-right: 1px solid #7cf0ff; border-bottom: 1px solid #7cf0ff; }
.ff-top { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; color: rgba(170,215,236,.62); font-size: 8px; letter-spacing: .22em; white-space: nowrap; }
.ff-top i { width: 46px; height: 1px; background: linear-gradient(90deg, transparent, rgba(124,240,255,.38)); }
.ff-top i:last-child { transform: scaleX(-1); }
.ff-telemetry { position: absolute; right: 16px; bottom: 15px; width: 205px; padding: 8px 10px; border-right: 1px solid rgba(124,240,255,.28); text-align: right; }
.ff-label { display: block; color: rgba(108,151,176,.7); font-size: 7px; letter-spacing: .2em; }
.ff-telemetry b { display: block; margin: 3px 0 6px; color: rgba(199,232,247,.76); font-size: 9px; font-weight: 400; letter-spacing: .06em; }
.ff-thrust { display: block; height: 2px; background: rgba(124,240,255,.1); }
.ff-thrust i { display: block; width: calc(var(--thrust) * 100%); height: 100%; background: linear-gradient(90deg, #7cf0ff, #7cffb2); box-shadow: 0 0 8px rgba(124,240,255,.7); transition: width .18s linear; }

#hud { z-index: 4; width: min(510px, calc(100vw - 32px)); padding: 0; overflow: hidden; border-radius: 8px; }
#hud .hudbrand { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid rgba(124,240,255,.1); color: #87aac4; }
#hud .hudbrand b { flex: 1; font-size: 9px; letter-spacing: .16em; }
#hud .hudbrand span { color: #66839b; font-size: 7px; letter-spacing: .16em; }
#hud #target { padding: 8px 10px 2px; color: #bed3e4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hud #speed { padding: 0 10px 8px; color: #708ba3; font-size: 9px; }
body.cardopen #flightframe,
body.navmenuopen #flightframe { opacity: .25; }
body.vrready #flightframe,
body.kiosk #flightframe { display: none !important; }

@media (max-width: 980px) {
  #title { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 760px), (pointer: coarse) {
  #title {
    display: block;
    padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
    overflow-y: auto;
  }
  #title::after { opacity: .4; }
  #title > .titlefoot { display: none; }
  #title > .titleteacher { margin-top: 10px; }
  #title > .titlelegal { margin-top: 9px; }
  .ff-top, .ff-telemetry, .ff-corner { display: none; }
  #hud { width: min(58vw, 270px); }
  #hud .hudbrand span { display: none; }
}

@media (max-height: 720px) and (min-width: 761px) {
  #title { padding-top: 18px; padding-bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  #title::before, .titleeyebrow i, .hudbrand i { animation: none !important; }
  body.launching #launchSequence { display: none; }
  body.launching #title { animation: none; }
}

/* ====================================================================== */
/* UNIVERSAL COMMAND VIEW                                                  */
/* Die echte WebGL-Szene bleibt die Bildquelle. Dieses UI rahmt sie nur.   */
/* ====================================================================== */

.cosmosatlas {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: none;
  overflow: hidden;
  color: #dceaf4;
  background: rgba(1, 5, 12, 0.42);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  pointer-events: none;
}
.cosmosatlas.on { display: block; animation: caReveal .42s ease both; }
@keyframes caReveal { from { opacity: 0; } to { opacity: 1; } }

body.atlasopen #hud,
body.atlasopen #help,
body.atlasopen #search,
body.atlasopen #info,
body.atlasopen #reticle,
body.atlasopen #navbtns,
body.atlasopen #rankhud,
body.atlasopen #baseHud,
body.atlasopen #flightframe,
body.atlasopen #aliensignal { display: none !important; }
body.atlasopen #vignette { opacity: .38; }

.ca-top {
  position: absolute;
  top: 20px;
  left: 92px;
  right: 28px;
  min-height: 62px;
  border-bottom: 1px solid rgba(129, 194, 221, .14);
  text-align: center;
  pointer-events: auto;
}
.ca-top-title {
  color: #8ad8f4;
  font-size: 16px;
  line-height: 1;
  letter-spacing: .18em;
}
.ca-breadcrumb {
  margin-top: 12px;
  color: #8da3b8;
  font-size: 10px;
  letter-spacing: .045em;
}
.ca-close {
  position: absolute;
  right: 0;
  top: -4px;
  min-height: 34px;
  border: 1px solid rgba(133, 194, 216, .30);
  border-radius: 4px;
  padding: 0 13px;
  background: rgba(4, 11, 22, .74);
  color: #a9c2d3;
  font: inherit;
  font-size: 9px;
  letter-spacing: .13em;
  cursor: pointer;
}
.ca-close:hover,
.ca-close:focus-visible { color: #effbff; border-color: #7cf0ff; outline: none; }

.ca-rail {
  position: absolute;
  inset: 0 auto 0 0;
  width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  border-right: 1px solid rgba(129, 194, 221, .15);
  background: rgba(1, 5, 12, .72);
  pointer-events: auto;
}
.ca-rail button {
  width: 34px;
  height: 34px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #658197;
  font: 10px/1 ui-monospace, monospace;
  letter-spacing: .08em;
  cursor: pointer;
}
.ca-rail button:hover { color: #c8e6f2; }
.ca-rail button.on {
  border-left-color: #f0ad32;
  background: rgba(240, 173, 50, .07);
  color: #ffc24b;
}
.ca-rail button:focus-visible { outline: 1px solid #7cf0ff; outline-offset: 2px; }

.ca-context {
  position: absolute;
  left: 96px;
  top: 142px;
  width: min(280px, 25vw);
  padding: 20px 20px 18px;
  border-left: 1px solid rgba(124, 240, 255, .24);
  background: rgba(2, 8, 18, .68);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 22px 54px rgba(0, 0, 0, .24);
  pointer-events: auto;
}
.ca-kicker,
.ca-target-label,
.ca-metric span,
.ca-selected span {
  color: #68bcd8;
  font-size: 8px;
  line-height: 1.3;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.ca-context h2 {
  margin: 10px 0 5px;
  color: #f0f7fb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(24px, 2.5vw, 38px);
  line-height: 1.06;
  font-weight: 350;
  letter-spacing: -.03em;
}
.ca-description {
  margin: 0;
  color: #a6b8c7;
  font: 12px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.ca-selected {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(129, 194, 221, .13);
}
.ca-selected b {
  color: #d7eaf3;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}
.ca-route {
  width: 100%;
  min-height: 43px;
  margin-top: 12px;
  border: 1px solid rgba(240, 173, 50, .72);
  border-radius: 4px;
  background: rgba(240, 173, 50, .055);
  color: #ffc24b;
  font: 600 10px/1 ui-monospace, monospace;
  letter-spacing: .15em;
  cursor: pointer;
}
.ca-route:hover,
.ca-route:focus-visible { background: rgba(240, 173, 50, .14); border-color: #ffc24b; outline: none; }
.ca-target-label { margin-top: 20px; }
.ca-targets { display: flex; flex-direction: column; gap: 1px; margin-top: 7px; }
.ca-targets button {
  width: 100%;
  min-height: 31px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid rgba(129, 194, 221, .09);
  background: transparent;
  color: #849caf;
  font: 9px/1.25 ui-monospace, monospace;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.ca-targets button:hover { color: #dff7ff; }
.ca-targets button.on { color: #7cf0ff; }
.ca-targets button:focus-visible { outline: 1px solid #7cf0ff; outline-offset: -2px; }

.ca-metrics {
  position: absolute;
  right: 30px;
  top: 50%;
  width: min(230px, 21vw);
  transform: translateY(-45%);
  padding-left: 20px;
  border-left: 1px solid rgba(124, 240, 255, .25);
  background: rgba(2, 8, 18, .54);
  pointer-events: none;
}
.ca-metric { padding: 14px 0 17px; border-bottom: 1px solid rgba(129, 194, 221, .14); }
.ca-metric:last-child { border-bottom: 0; }
.ca-metric b {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: #eef7fa;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(15px, 1.35vw, 20px);
  line-height: 1.25;
  font-weight: 350;
}

.ca-scales {
  position: absolute;
  left: 50%;
  bottom: 24px;
  display: flex;
  align-items: stretch;
  transform: translateX(-50%);
  border-top: 1px solid rgba(129, 194, 221, .13);
  background: rgba(2, 8, 18, .70);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}
.ca-scales button {
  position: relative;
  min-width: 92px;
  min-height: 58px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #71899b;
  font: inherit;
  cursor: pointer;
}
.ca-scales span { display: block; font-size: 7px; letter-spacing: .18em; opacity: .7; }
.ca-scales b { display: block; margin-top: 5px; font-size: 10px; font-weight: 500; }
.ca-scales button:hover { color: #d7eaf3; }
.ca-scales button.on { border-bottom-color: #f0ad32; color: #ffc24b; }
.ca-scales button:focus-visible { outline: 1px solid #7cf0ff; outline-offset: -3px; }
.ca-status {
  position: absolute;
  right: 30px;
  bottom: 22px;
  color: #7cffb2;
  font-size: 8px;
  letter-spacing: .08em;
}

body.hicontrast .cosmosatlas { background: rgba(0, 0, 0, .45); }
body.hicontrast .ca-context,
body.hicontrast .ca-scales,
body.hicontrast .ca-metrics,
body.hicontrast .ca-rail { background: #02050a; }

@media (max-width: 980px) {
  .ca-context { left: 82px; width: 250px; }
  .ca-metrics { width: 190px; }
  .ca-scales button { min-width: 78px; }
  .ca-status { display: none; }
}

@media (max-width: 760px), (pointer: coarse) {
  .cosmosatlas { background: rgba(1, 5, 12, .16); }
  .ca-top { top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px; min-height: 42px; }
  .ca-top-title { font-size: 12px; }
  .ca-breadcrumb { display: none; }
  .ca-close { right: 0; top: -6px; min-height: 36px; padding: 0 10px; font-size: 8px; }
  .ca-rail, .ca-metrics, .ca-status { display: none; }
  .ca-scales {
    top: 66px;
    bottom: auto;
    width: calc(100vw - 24px);
    justify-content: stretch;
  }
  .ca-scales button { flex: 1 1 0; min-width: 0; min-height: 49px; }
  .ca-scales b { font-size: 8px; }
  .ca-context {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
    max-height: 39vh;
    overflow-y: auto;
    padding: 13px 14px 12px;
    border: 1px solid rgba(124, 240, 255, .18);
    border-radius: 8px;
    background: rgba(2, 8, 18, .88);
  }
  .ca-context h2 { margin-top: 6px; font-size: 23px; }
  .ca-description { font-size: 11px; }
  .ca-selected { margin-top: 9px; padding-top: 8px; }
  .ca-route { min-height: 40px; margin-top: 8px; }
  .ca-target-label { margin-top: 11px; }
  .ca-targets { flex-direction: row; overflow-x: auto; gap: 6px; }
  .ca-targets button {
    flex: 0 0 auto;
    width: auto;
    max-width: 200px;
    min-height: 34px;
    padding: 0 9px;
    border: 1px solid rgba(129, 194, 221, .15);
    border-radius: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cosmosatlas.on { animation: none; }
}
