/* General */
html, body { touch-action: none; overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #000; overflow: hidden; font-family: Arial, sans-serif; }
canvas { display: block; cursor: pointer; }
input, textarea, [contenteditable] { user-select: text; -webkit-user-select: text; }
.is-hidden { display: none !important; }

/* Overview */
#ov-lines { position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:8;display:none; }
#ov-labels { position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:9;display:none; }

/* UI */
#ui {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 0; z-index: 20;
    background: rgba(0,0,0,0.35); padding: 10px 0; border-radius: 32px;
    border: 1px solid rgba(255,255,255,0.1); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(8px);
    max-width: calc(100vw - 24px);
    overflow: hidden;
	touch-action: manipulation;
}
/* Carousel arrow buttons */
.ui-arrow {
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    width: 28px; height: 36px; cursor: pointer; -webkit-user-select: none; user-select: none;
    color: rgba(255,255,255,0.5); font-size: 18px;
    transition: color 0.15s;
    padding: 0 2px;
    touch-action: manipulation;
    -webkit-user-select: none;
}
.ui-arrow:hover { color: rgba(255,255,255,0.9); }
.ui-arrow.hidden { opacity: 0; pointer-events: none; }
/* Viewport that clips sections */
#ui-viewport {
    flex: 1; overflow: hidden; min-width: 0;
    display: flex; align-items: center;
}
/* Sliding track of sections */
#ui-track {
    display: flex; align-items: center; gap: 0;
    width: 100%;
    justify-content: center;
}
/* Each section */
.ui-section {
    display: flex; flex-direction: column; gap: 6px;
    flex-shrink: 0; padding: 0 12px;
}
.ui-section-sep {
    width: 1px; height: 44px; background: rgba(255,255,255,0.2);
    flex-shrink: 0; align-self: center;
}
.group { display:flex; align-items:center; gap:8px; }
.group-label { color:rgba(255,255,255,0.45); font-size:11px; -webkit-user-select:none; user-select:none; min-width:22px; display:flex; align-items:center; justify-content:center; }
.group-label svg {
  width: 20px;
  height: 20px;
  opacity: 0.5;
}
.panel-button { padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;pointer-events:auto;cursor:pointer; }

/* Buttons and HUD */
button {
    background: rgba(255,255,255,0.12); color: #fff;
    border: 1px solid rgba(255,255,255,0.25); padding: 0;
    width: 32px; height: 32px; text-align: center;
    display: flex; align-items: center; justify-content: center;
    border-radius: 20px; cursor: pointer; font-size: 15px;
    transition: background 0.15s; white-space: nowrap; line-height:1;
    touch-action: manipulation; flex-shrink: 0;
}
button:hover:not(:disabled) { background: rgba(255,255,255,0.24); }
button:disabled { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.1); color: rgba(255,255,255,0.2); cursor: default; }
.val { color:#fff; font-size:11px; font-family:Arial,sans-serif; min-width:32px; text-align:center; margin-left:-2px; -webkit-user-select:none; user-select:none; }
#hud {
    position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    pointer-events: none; z-index: 20;
    width: max-content; max-width: calc(100vw - 32px);
}

/* Title */
#viewtitle { display:flex;flex-direction:column;align-items:center;justify-content:center;user-select:none;-webkit-user-select:none;gap:1px; }
#hud-buttons { display:flex;align-items:center;justify-content:center;gap:8px;pointer-events:none; }
.showpanelbutton { display:none;background:rgba(255,200,50,0.18);border:1px solid rgba(255,200,50,0.4);border-radius:50%;padding:0;width:32px;height:32px;cursor:pointer;flex-shrink:0;touch-action:manipulation;pointer-events:auto; }
.topbarbutton { background:rgba(255,255,255,0.12);border:1px solid rgba(255,255,255,0.25);border-radius:50%;padding:0;width:32px;height:32px;font-size:9px;font-weight:600;letter-spacing:0.04em;color:rgba(255,255,255,0.75);cursor:pointer;flex-shrink:0;touch-action:manipulation;pointer-events:auto;display:flex;align-items:center;justify-content:center;font-family:Arial,sans-serif; }

/* Audio-Prompt-Button (Autoplay-Block-Hinweis, in #hud außerhalb #ui) */
@keyframes av-audio-pulse { 0%,49.9% { opacity:1; } 50%,100% { opacity:0.15; } }
#audio-prompt-btn { pointer-events:auto; touch-action:manipulation; }
#audio-prompt-btn.pulsing { animation: av-audio-pulse 2s step-start infinite; }

/* Labels */
#systemLabel { color:rgba(255,255,255,0.75); font-size:18px; font-weight:300; letter-spacing:0.12em; text-transform:uppercase; white-space:nowrap; }
#aliasLabel { display:none; color:rgba(255,255,255,0.42); font-size:10px; font-weight:400; letter-spacing:0.08em; white-space:nowrap; font-family:Arial,sans-serif; }
/* Wenn Alias-Namen vorhanden: play/track-indicator etwas tiefer setzen (≈ Höhe der Alias-Zeile) */
body.has-alias #play-indicator  { top: 26px; }
body.has-alias #track-indicator { top: 26px; }
#labels { position:fixed; top:0; left:0; pointer-events:none; width:100%; height:100%; overflow:hidden; }
#labels canvas, #labels span.nb-clickable { pointer-events:auto; }
#version { position:fixed;bottom:8px;right:12px;font-size:10px;font-family:Arial,sans-serif;z-index:10;display:none; }
#version { text-align:center; }
#version-icon-link { display:block; width:16px; height:16px; margin:0 auto 2px; pointer-events:auto; }
#version-icon { display:block; width:16px; height:16px; opacity:0.70;
  transition: opacity 0.2s ease, filter 0.2s ease; }
#version-icon-link:hover #version-icon {
  opacity: 1;
  filter: brightness(1.25) drop-shadow(0 0 4px rgba(255,200,0,0.65)) drop-shadow(0 0 9px rgba(255,140,0,0.35));
}
#versionhistorylink {
  color: rgba(255,220,100,0.70); text-decoration:none; pointer-events:auto;
  font-weight: bold; letter-spacing: 0.06em;
  text-shadow: 0 0 6px rgba(255,180,0,0.35);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
#versionhistorylink:hover {
  color: rgba(255,240,160,1.0);
  text-shadow: 0 0 10px rgba(255,200,0,0.6), 0 0 22px rgba(255,140,0,0.3);
}

/* Infopanels */
#astro-info {
    position: fixed; left: 0; top: 0;   /* positioned by JS */
    width: 260px; padding: 14px 16px;
    background: rgba(17, 60, 30, 0.78);
    border: 2px solid rgba(34, 221, 102, 0.55);
    border-radius: 14px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #d4ffe4; font-family: Arial, sans-serif; font-size: 13px;
    box-shadow: 0 0 18px rgba(34,221,102,0.18), inset 0 0 24px rgba(34,221,102,0.06);
    z-index: 20;
    opacity: 0; pointer-events: none;
    transition: opacity 0.35s ease;
    will-change: left, top;
}
#astro-info.visible { opacity: 1; pointer-events: auto; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
#astro-info.dragging { cursor: grabbing; -webkit-user-select: none; user-select: none; }
#astro-info2 {
    position: fixed; left: 0; top: 0;
    width: 320px; padding: 12px 10px 14px;
    background: rgba(17, 60, 30, 0.78);
    border: 2px solid rgba(34, 221, 102, 0.55);
    border-radius: 14px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #d4ffe4; font-family: Arial, sans-serif; font-size: 13px;
    box-shadow: 0 0 18px rgba(34,221,102,0.18), inset 0 0 24px rgba(34,221,102,0.06);
    z-index: 20;
    opacity: 0; pointer-events: none;
    transition: opacity 0.35s ease;
    will-change: left, top;
  }
#astro-info2.visible { opacity: 1; pointer-events: auto; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
#astro-info2.dragging { cursor: grabbing; -webkit-user-select: none; user-select: none; }
#astro-info3 {
    position: fixed; left: 0; top: 0;
    width: 320px; padding: 12px 10px 14px;
    background: rgba(17, 60, 30, 0.78);
    border: 2px solid rgba(34, 221, 102, 0.55);
    border-radius: 14px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #d4ffe4; font-family: Arial, sans-serif; font-size: 13px;
    box-shadow: 0 0 18px rgba(34,221,102,0.18), inset 0 0 24px rgba(34,221,102,0.06);
    z-index: 20;
    opacity: 0; pointer-events: none;
    transition: opacity 0.35s ease;
    will-change: left, top;
}
#astro-info3.visible { opacity: 1; pointer-events: auto; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
#astro-info3.dragging { cursor: grabbing; -webkit-user-select: none; user-select: none; }
#astro-info2 .atmo-svg { display: block; margin: 0 auto; overflow: visible; }
#astro-info2 .temp-display {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; margin-top: 6px;
}
#astro-info2 .temp-label { color: rgba(180,255,210,0.6); font-size: 11px; letter-spacing:0.05em; }
#astro-info2 .temp-range {
    color: #e8fff2; font-size: 15px; font-weight: 600; letter-spacing: 0.03em; white-space: nowrap;
}
#astro-info2 .temp-eq-row {
    display: flex; align-items: center; gap: 10px; white-space: nowrap;
}
#astro-info2 .temp-eq-side {
    color: rgba(180,255,210,0.55); font-size: 11px; font-weight: 400;
}
#astro-info2 .temp-eq-val {
    color: #e8fff2; font-size: 18px; font-weight: 700; letter-spacing: 0.02em;
}
#astro-info2 .var-bar-block {
    display: flex; flex-direction: column; gap: 8px; margin: 2px 0 8px;
}
#astro-info2 .var-bar-row {
    display: flex; align-items: center; gap: 7px;
}
#astro-info2 .var-bar-name {
    width: 60px; flex-shrink: 0; color: #e8fff2; font-size: 11px; font-weight: 600;
}
#astro-info2 .var-bar-end {
    color: rgba(180,255,210,0.55); font-size: 10px; white-space: nowrap;
    flex-shrink: 0; width: 52px; overflow: hidden; text-overflow: ellipsis;
}
#astro-info2 .var-bar-end-l { text-align: right; }
#astro-info2 .var-bar-end-r { text-align: left; }
#astro-info2 .var-bar-track {
    position: relative; flex: 1; height: 4px; border-radius: 2px;
    background: rgba(34,221,102,0.18);
}
#astro-info2 .var-bar-marker {
    position: absolute; top: 50%; width: 3px; height: 12px; border-radius: 2px;
    background: #7fdfff; box-shadow: 0 0 6px rgba(127,223,255,0.85);
    transform: translate(-50%,-50%);
}
#astro-leader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 19;
    opacity: 0; transition: opacity 0.35s ease;
}
#astro-leader.visible { opacity: 1; }
#astro-leader2 {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 19;
    opacity: 0; transition: opacity 0.35s ease;
}
#astro-leader3 {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 19;
    opacity: 0; transition: opacity 0.35s ease;
}
#astro-info h3 {
    margin: 0 0 10px 0; font-size: 15px; font-weight: bold;
    color: #88ffbb; letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(34,221,102,0.3);
    padding-bottom: 7px;
}
#astro-info .info-row {
    display: flex; justify-content: space-between;
    margin: 5px 0; gap: 8px;
}
#astro-info .info-label { color: rgba(180,255,210,0.6); flex-shrink: 0; }
#astro-info .info-val   { color: #e8fff2; text-align: right; font-weight: 500; }

/* Zonen-Infopanel (Asteroidengürtel, HZ, Trümmerscheiben etc.) */
#astro-zoneinfo {
    position: fixed; left: 0; top: 0;
    width: 260px; padding: 14px 16px;
    background: rgba(17, 60, 30, 0.78);
    border: 2px solid rgba(34, 221, 102, 0.55);
    border-radius: 14px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #d4ffe4; font-family: Arial, sans-serif; font-size: 13px;
    box-shadow: 0 0 18px rgba(34,221,102,0.18), inset 0 0 24px rgba(34,221,102,0.06);
    z-index: 20;
    opacity: 0; pointer-events: none;
    transition: opacity 0.35s ease;
    will-change: left, top;
}
#astro-zoneinfo.visible { opacity: 1; pointer-events: auto; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
#astro-zoneinfo.dragging { cursor: grabbing; -webkit-user-select: none; user-select: none; }
#astro-zoneinfo h3 {
    margin: 0 0 10px 0; font-size: 15px; font-weight: bold;
    color: #88ffbb; letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(34,221,102,0.3);
    padding-bottom: 7px;
}
#astro-zoneinfo .info-row {
    display: flex; justify-content: space-between;
    margin: 5px 0; gap: 8px;
}
#astro-zoneinfo .info-label { color: rgba(180,255,210,0.6); flex-shrink: 0; }
#astro-zoneinfo .info-val   { color: #e8fff2; text-align: right; font-weight: 500; }
#astro-leader-zoneinfo {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 19;
    opacity: 0; transition: opacity 0.35s ease;
}
#astro-leader-zoneinfo.visible { opacity: 1; display: block; }

/* ── Galaxy Info-Panel ── */
#astro-galaxyinfo {
    position: fixed; left: -9999px; top: -9999px;
    width: 260px; padding: 14px 16px;
    background: rgba(17, 60, 30, 0.78);
    border: 2px solid rgba(34, 221, 102, 0.55);
    border-radius: 14px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #d4ffe4; font-family: Arial, sans-serif; font-size: 13px;
    box-shadow: 0 0 18px rgba(34,221,102,0.18), inset 0 0 24px rgba(34,221,102,0.06);
    z-index: 20;
    opacity: 0; pointer-events: none;
    transition: opacity 0.35s ease;
    will-change: left, top;
}
#astro-galaxyinfo.visible { opacity: 1; pointer-events: auto; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
#astro-galaxyinfo.dragging { cursor: grabbing; -webkit-user-select: none; user-select: none; }
#astro-galaxyinfo h3 {
    margin: 0 0 10px 0; font-size: 15px; font-weight: bold;
    color: #b8ffd6; letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(34,221,102,0.3);
    padding-bottom: 7px;
}
#astro-galaxyinfo .info-row {
    display: flex; justify-content: space-between;
    margin: 5px 0; gap: 8px;
}
#astro-galaxyinfo .info-label { color: rgba(180,255,210,0.6); flex-shrink: 0; }
#astro-galaxyinfo .info-val   { color: #e8fff2; text-align: right; font-weight: 500; }
#astro-galaxyinfo .info-comment {
    margin-top: 9px; padding-top: 7px;
    border-top: 1px solid rgba(34,221,102,0.2);
    font-size: 11px; color: rgba(180,255,210,0.55);
    line-height: 1.45;
}
#astro-galaxyinfo .help-panel-close {
    color: rgba(180,255,210,0.6);
}
#astro-galaxyinfo .help-panel-close:hover {
    color: rgba(180,255,210,1.0);
}
#astro-leader-galaxyinfo {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 19;
    opacity: 0; transition: opacity 0.35s ease;
}
#astro-leader-galaxyinfo.visible { opacity: 1; display: block; }

/* ── Constellation Sub-Panel ── */
#astro-constellation {
    position: fixed; left: 0; top: 0;
    width: 300px; padding: 14px 16px;
    background: rgba(17, 60, 30, 0.78);
    border: 2px solid rgba(34, 221, 102, 0.55);
    border-radius: 14px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #d4ffe4; font-family: Arial, sans-serif; font-size: 13px;
    box-shadow: 0 0 18px rgba(34,221,102,0.18), inset 0 0 24px rgba(34,221,102,0.06);
    z-index: 20;
    opacity: 0; pointer-events: none;
    transition: opacity 0.35s ease;
    will-change: left, top;
}
#astro-constellation.visible { opacity: 1; pointer-events: auto; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
#astro-constellation.dragging { cursor: grabbing; -webkit-user-select: none; user-select: none; }
#astro-constellation h3 {
    margin: 0 0 4px 0; font-size: 15px; font-weight: bold;
    color: #88ffbb; letter-spacing: 0.04em; text-align: center;
}
#astro-constellation .cst-abbr {
    text-align: center; font-size: 11px; letter-spacing: 0.12em;
    color: rgba(180,255,210,0.55); margin-bottom: 8px;
    border-bottom: 1px solid rgba(34,221,102,0.3); padding-bottom: 7px;
}
#astro-constellation .cst-map {
    width: 100%; margin-top: 4px;
    background: rgba(0,0,0,0.30);
    border-radius: 8px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
#astro-constellation .cst-map svg { display: block; width: 100%; height: auto; }
#astro-leader-constellation {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 19;
    opacity: 0; transition: opacity 0.35s ease;
}
#astro-leader-constellation.visible { opacity: 1; display: block; }

/* Badge inside info-row that opens the constellation panel */
.cst-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 1px 6px 1px 5px;
    background: rgba(34,221,102,0.12);
    border: 1px solid rgba(34,221,102,0.45);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
    vertical-align: middle;
    line-height: 1;
}
.cst-badge:hover, .cst-badge.active {
    background: rgba(34,221,102,0.28);
    border-color: rgba(34,221,102,0.75);
}
.cst-badge svg { display: block; }

/* ── Loading screen ── */
#loading-screen {
    position: fixed; inset: 0; background: #000;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 100; transition: opacity 0.6s ease;
    gap: 0;
}
#loading-screen.fade-out { opacity: 0; pointer-events: none; }
.loading-noselect * {
	user-select: none;
	-webkit-user-select: none; /* Safari */
	-moz-user-select: none;    /* Firefox */
	-ms-user-select: none;     /* Legacy IE/Edge */	  
	cursor: default;           /* present text-cursor */
}
#loading-header {
	width: 550px; 
    display: flex; align-items: center; gap: 0; 
    background: rgba(0,0,0,0.35); padding: 10px 0; border-radius: 32px;
    border: 1px solid rgba(255,255,255,0.1); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(8px);
    overflow: hidden;
}  
#loading-info {
	width: 550px; 
    display: flex; align-items: center; gap: 0; 
    background: rgba(0,0,0,0.35); padding: 10px 0; border-radius: 32px;
    border: 1px solid rgba(255,255,255,0.1); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(8px);
    overflow: hidden;
}
#loading-logo {
    margin-left: 28px;
    font-size: 38px; font-weight: 100; letter-spacing: 0.55em;
    text-transform: uppercase; 
	background: linear-gradient(135deg, #fff 0%, #ffcc80 45%, #ff9800 70%, #fff 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 18px rgba(100,180,255,0.45));
    margin-right: -0.55em; /* compensate letter-spacing on last char */
}
#loading-logo span {
    font-size: 13px; font-weight: 300; letter-spacing: 0.22em;
    display: block; text-align: center;
    -webkit-text-fill-color: rgba(150,200,255,0.55);
    filter: none; margin-top: 2px; padding-right: 0.22em;
}
#loading-logo-img {
    margin: 10px 0 10px;
    max-width: 500px; max-height: 250px;
    opacity: 0.88;
    display: none; /* shown by JS only if image loads */
}
#loading-version {
    margin: 10px 15px; font-size: 10px; color: rgba(255,255,255,0.22); letter-spacing: 0.12em;
    text-transform: uppercase; transition: color 0.4s ease, text-shadow 0.4s ease, font-weight 0.1s;
}
#loading-version.loaded {
    color: rgba(255,220,100,0.95); font-weight: bold;
    text-shadow: 0 0 8px rgba(255,180,0,0.5), 0 0 20px rgba(255,140,0,0.25);
}
#loading-bar-wrap {
    margin-top: 2px; flex-grow:1; height: 6px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden;
}
#loading-bar {
    height: 100%; width: 0%;
	background: linear-gradient(90deg, rgba(255, 140, 0, 0.7), rgba(255, 200, 120, 0.9));
    border-radius: 2px; transition: width 0.18s ease;
}
#loading-label {
    margin: 10px 15px; font-size: 11px; color: rgba(255,255,255,0.28);
    letter-spacing: 0.06em;
}

/* ── Slider Panel ────────────────────────────────────────────── */
#slider-panel {	
  position: fixed;
  bottom: calc(24px + 90px + 10px); /* above #ui: ui bottom + ui height + gap */
  left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0;
  background: rgba(0,0,0,0.35); padding: 10px 0; border-radius: 32px;
  border: 1px solid rgba(255,255,255,0.1); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(8px);
  max-width: calc(100vw - 24px);
  overflow: hidden;
  z-index: 21;
  touch-action: manipulation;
  transition: opacity 0.18s ease, transform 0.18s ease;
  opacity: 0; pointer-events: none;
}
#slider-panel.visible {
  opacity: 1; pointer-events: auto;
}
#slider-panel-inner {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; flex: 1;
}
.slider-panel-icon {
  display: flex; align-items: center; justify-content: center;
  min-width: 22px; color: rgba(255,255,255,0.5);
  flex-shrink: 0;
}
.slider-track-wrap {
  flex: 1; display: flex; align-items: center;
  min-width: 80px;
}
/* Style the range input to look like the UI */
#sliderInput {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 32px; background: transparent; cursor: pointer;
  outline: none;
}
#sliderInput::-webkit-slider-container { background: transparent; }
#sliderInput::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.18);
}
#sliderInput::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  margin-top: -14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='12' viewBox='0 0 18 12'%3E%3Cpath d='M1 6h16M1 6l3-3M1 6l3 3M17 6l-3-3M17 6l-3 3' stroke='white' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 12px;
  transition: background-color 0.15s;
}
/* ::-webkit-slider-thumb:hover is invalid CSS (pseudo-element + pseudo-class). Use parent hover instead. */
#sliderInput:hover::-webkit-slider-thumb {
  background-color: rgba(255,255,255,0.24);
}
#sliderInput::-moz-range-track {
  height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.18);
}
#sliderInput::-moz-range-thumb {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='12' viewBox='0 0 18 12'%3E%3Cpath d='M1 6h16M1 6l3-3M1 6l3 3M17 6l-3-3M17 6l-3 3' stroke='white' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 12px;
}
.slider-panel-val {
  color: #fff; font-size: 11px; font-family: Arial, sans-serif;
  min-width: 32px; text-align: center; -webkit-user-select: none; user-select: none;
  flex-shrink: 0;
}
.toggle-button-on,
.slider-toggle-btn.active {
  background: rgba(255,200,50,0.18) !important;
  border-color: rgba(255,200,50,0.4) !important;
}
.slider-button {
  flex-shrink:0;
}
.btn--label { font-size:10px; font-weight:bold; letter-spacing:0.3px; color:#fff; }

/* ── Play Indicator ────────────────────────────────────────────── */
#play-indicator {
  display: none;
  position: fixed; top: 10px; left: 12px; z-index: 15;
  pointer-events: none;
  align-items: center; gap: 6px;
  padding: 4px 8px 4px 4px; border-radius: 12px;
  transition: background 0.15s;
  user-select: none; -webkit-user-select: none;
}
.play-indicator-label {
  font-family: Arial, sans-serif; font-size: 10px; font-weight: bold;
  letter-spacing: 0.08em; color: rgba(34,221,102,0.75); text-transform: uppercase;
}
#script-timer-display {
  display: none;
  font-family: Arial, sans-serif; font-size: 10px; font-weight: bold;
  letter-spacing: 0.06em; color: rgba(34,221,102,0.9); margin-left: 2px;
}
.play-indicator-pause-icon {
  margin-left: 3px; flex-shrink: 0;
}

/* ── Track Indicator ────────────────────────────────────────────── */
#track-indicator {
  display: none;
  position: fixed; top: 10px; right: 12px; z-index: 15;
  pointer-events: none;
  align-items: center; gap: 5px;
  padding: 3px 8px 3px 6px; border-radius: 10px;
  background: rgba(0,0,0,0.42);
  user-select: none; -webkit-user-select: none;
  max-width: calc(100vw - 80px);
}
.track-indicator-icon {
  flex-shrink: 0;
}
#track-text {
  display: flex; flex-direction: column; gap: 1px;
  flex: 1; min-width: 0;
}
#track-title-display {
  font-family: Arial, sans-serif; font-size: 10px; font-weight: bold;
  letter-spacing: 0.06em; color: rgba(34,221,102,0.9);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
#track-type-display {
  display: none;
  font-family: Arial, sans-serif; font-size: 8px; font-weight: bold;
  letter-spacing: 0.06em; color: rgba(20,150,70,0.9);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
#track-timer-display {
  font-family: Arial, sans-serif; font-size: 10px; font-weight: bold;
  letter-spacing: 0.06em; color: rgba(34,221,102,0.6);
  flex-shrink: 0;
}

/* ── Help Panels ────────────────────────────────────────────── */
#help-panel,
#help-panel2 {
  position: fixed; left: 0; top: 0;
  width: 280px; padding: 14px 16px 16px;
  background: rgba(17,60,30,0.88);
  border: 2px solid rgba(34,221,102,0.55);
  border-radius: 14px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #d4ffe4; font-family: Arial, sans-serif; font-size: 13px;
  box-shadow: 0 0 18px rgba(34,221,102,0.18), inset 0 0 24px rgba(34,221,102,0.06);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
  cursor: grab;
  will-change: left, top;
}
.help-panel-close {
  position: absolute; top: 8px; right: 10px;
  cursor: pointer; font-size: 13px;
  color: rgba(180,255,210,0.6);
  line-height: 1; padding: 2px 4px; border-radius: 4px;
  transition: color 0.15s; z-index: 1;
}

/* ── List-Panel (Objektliste) ──────────────────────────────────────────── */
#list-panel {
  position: fixed; left: 0; top: 0;
  width: 280px; padding: 14px 16px 16px;
  background: rgba(17,60,30,0.88);
  border: 2px solid rgba(34,221,102,0.55);
  border-radius: 14px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #d4ffe4; font-family: Arial, sans-serif; font-size: 13px;
  box-shadow: 0 0 18px rgba(34,221,102,0.18), inset 0 0 24px rgba(34,221,102,0.06);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
  cursor: grab;
  will-change: left, top;
  max-height: 70vh;
  display: flex; flex-direction: column;
}
#list-panel-content { overflow-y: auto; overflow-x: hidden; flex: 1 1 auto; min-height: 0; }
#list-panel-content::-webkit-scrollbar { width: 6px; }
#list-panel-content::-webkit-scrollbar-thumb { background: rgba(34,221,102,0.35); border-radius: 3px; }
#list-panel-header {
  padding-right: 18px;
  margin-bottom: 6px;
  cursor: grab;
  flex-shrink: 0;
}
#list-panel-header:active { cursor: grabbing; }
.lp-title {
  display: block;
  font-weight: 700; letter-spacing: 0.08em; color: rgba(180,255,210,0.7);
  text-transform: uppercase;
}
.lp-group-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: rgba(150,255,190,0.55); margin: 10px 0 4px; text-transform: uppercase;
}
.lp-group-title:first-of-type { margin-top: 0; }
.lp-row {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 6px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.lp-row:hover { background: rgba(34,221,102,0.14); }
.lp-row--sel { background: rgba(34,221,102,0.28); color: #fff; font-weight: 600; }
.lp-row--dim { opacity: 0.38; }
.lp-icon { flex-shrink: 0; font-size: 10px; opacity: 0.75; width: 12px; text-align: center; }
.lp-label { overflow: hidden; text-overflow: ellipsis; }
.lp-empty { padding: 4px 10px; color: rgba(180,255,210,0.45); font-style: italic; font-size: 12px; }

/* ── FilterPanel (Systemfilter) ───────────────────────────────────────── */
#filter-panel {
  position: fixed; left: 0; top: 0;
  width: 300px; padding: 14px 16px 12px;
  background: rgba(17,60,30,0.88);
  border: 2px solid rgba(34,221,102,0.55);
  border-radius: 14px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #d4ffe4; font-family: Arial, sans-serif; font-size: 13px;
  box-shadow: 0 0 18px rgba(34,221,102,0.18), inset 0 0 24px rgba(34,221,102,0.06);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
  cursor: grab;
  will-change: left, top;
  max-width: calc(100vw - 16px);
}
.fp-title {
  font-weight: 700; letter-spacing: 0.08em; color: rgba(180,255,210,0.7);
  text-transform: uppercase; margin: 0 18px 8px 0;
}
.fp-row {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 5px 4px; border-radius: 6px; cursor: pointer;
  line-height: 1.35; touch-action: manipulation;
}
.fp-row:hover { background: rgba(34,221,102,0.14); }
.fp-row input[type=checkbox] {
  flex-shrink: 0; width: 16px; height: 16px; margin: 1px 0 0;
  accent-color: #22dd66; cursor: pointer;
}
.fp-subtitle {
  margin: 8px 0 3px; font-size: 11px; letter-spacing: 0.04em;
  color: rgba(180,255,210,0.6);
}
.fp-classes { display: flex; flex-wrap: wrap; gap: 2px 4px; }
.fp-cls {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 6px; border-radius: 6px; cursor: pointer;
  font-weight: 700; line-height: 1.2; touch-action: manipulation;
}
.fp-cls:hover { background: rgba(34,221,102,0.14); }
.fp-cls input[type=checkbox] {
  flex-shrink: 0; width: 15px; height: 15px; margin: 0;
  accent-color: #22dd66; cursor: pointer;
}
.fp-count {
  margin-top: 8px; padding-top: 7px;
  border-top: 1px solid rgba(34,221,102,0.25);
  font-size: 11px; color: rgba(180,255,210,0.55);
}

/* ── Utility ────────────────────────────────────────────── */
.icon-flipped { transform: scaleX(-1); }


@media (max-width: 600px) {
    #loading-header {
      width: calc(100vw - 32px);
      max-width: 100%;
    }  
    #loading-info {
      width: calc(100vw - 32px);
      max-width: 100%;
    }
    #loading-logo {
      font-size: 24px;
      margin-left: 16px;
    }
    #loading-logo span {
      font-size: 10px;
    }
    #loading-logo-img {
      max-width: min(80vw, 300px);
      max-height: 120px;
    }
    #loading-version {
      font-size: 9px;
      margin: 6px 10px;
    }
    #loading-label {
      font-size: 10px;
      margin: 6px 10px;
    }
}

@media (max-width: 500px), (pointer: coarse) {
    #astro-info {
      width: 195px; padding: 9px 11px;
      font-size: 11px;
      background: rgba(12, 45, 22, 0.55);
      border-width: 1.5px;
      border-radius: 10px;
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
    }
    #astro-info h3 {
      font-size: 12px;
      margin-bottom: 7px;
      padding-bottom: 5px;
    }
    #astro-info .info-row { margin: 3px 0; gap: 5px; }
    #astro-galaxyinfo {
      width: 195px; padding: 9px 11px;
      font-size: 11px;
      background: rgba(12, 45, 22, 0.55);
      border-width: 1.5px;
      border-radius: 10px;
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
    }
    #astro-galaxyinfo h3 {
      font-size: 12px;
      margin-bottom: 7px;
      padding-bottom: 5px;
    }
    #astro-galaxyinfo .info-row { margin: 3px 0; gap: 5px; }
        #astro-zoneinfo {
      width: 195px; padding: 9px 11px;
      font-size: 11px;
      background: rgba(12, 45, 22, 0.55);
      border-width: 1.5px;
      border-radius: 10px;
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
    }
    #astro-zoneinfo h3 {
      font-size: 12px;
      margin-bottom: 7px;
      padding-bottom: 5px;
    }
    #astro-zoneinfo .info-row { margin: 3px 0; gap: 5px; }
    #astro-constellation {
      width: 210px; padding: 9px 11px;
      font-size: 11px;
      background: rgba(12, 45, 22, 0.55);
      border-width: 1.5px;
      border-radius: 10px;
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
    }
    #astro-constellation h3 { font-size: 12px; margin-bottom: 3px; }
    #astro-constellation .cst-abbr { font-size: 10px; margin-bottom: 5px; padding-bottom: 5px; }
    #astro-constellation .cst-map { border-radius: 6px; }
    #astro-info2 {
      background: rgba(12, 45, 22, 0.55);
      border-width: 1.5px;
      border-radius: 10px;
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
      transform: scale(0.75);
      transform-origin: top left;
    }
    #astro-info3 {
      background: rgba(12, 45, 22, 0.55);
      border-width: 1.5px;
      border-radius: 10px;
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
      transform: scale(0.75);
      transform-origin: top left;
    }
}
/* ── HUD-Indikatoren auf Mobile: links/rechts neben den Top-Buttons ─────────
   Auf Touch-Geräten (pointer:coarse) werden play-indicator und track-indicator
   auf die Höhe der #hud-buttons-Zeile gesetzt und links bzw. rechts am
   Screenrand positioniert – gilt für Portrait UND Landscape.
   Die bisherige Portrait-Sonderregel entfällt damit.
────────────────────────────────────────────────────────────────────────────── */
@media (pointer: coarse) {
  #play-indicator {
    top: 50px !important;
    left: 8px !important;
    transform: none;
    background: transparent;
    border-radius: 10px;
    max-width: calc(50vw - 16px);
  }
  #track-indicator {
    top: 50px !important;
    left: auto !important;
    right: 8px !important;
    transform: none;
    max-width: calc(40vw - 16px);
  }
  /* Timer auf Mobile ausblenden – Songtitel bekommt mehr Platz */
  #track-timer-display {
    display: none !important;
  }
}

/* ── CatalogPriorityPanel ─────────────────────────────────────────────── */
#catalog-priority-panel {
  position: fixed; left: 0; top: 0;
  width: 300px;
  background: rgba(17,60,30,0.92);
  border: 2px solid rgba(34,221,102,0.55);
  border-radius: 14px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #d4ffe4; font-family: Arial, sans-serif; font-size: 13px;
  box-shadow: 0 0 20px rgba(34,221,102,0.20), inset 0 0 28px rgba(34,221,102,0.07);
  z-index: 201;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
  will-change: left, top;
  display: flex; flex-direction: column;
  max-height: 80vh;
  cursor: default;
  user-select: none; -webkit-user-select: none;
}
#catalog-priority-panel.cp-visible { opacity: 1; pointer-events: auto; }
#catalog-priority-panel.dragging   { cursor: grabbing; }

.cp-header {
  padding: 12px 36px 10px 16px;
  cursor: grab;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(34,221,102,0.22);
}
.cp-header:active { cursor: grabbing; }

.cp-panel-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.10em;
  color: rgba(180,255,210,0.55); text-transform: uppercase;
  margin-bottom: 2px;
}
.cp-title {
  font-size: 14px; font-weight: 700; letter-spacing: 0.04em;
  color: #88ffbb;
}
.cp-close {
  position: absolute; top: 9px; right: 11px;
  cursor: pointer; font-size: 13px;
  color: rgba(180,255,210,0.55); line-height: 1;
  padding: 3px 5px; border-radius: 4px;
  transition: color 0.15s;
}
.cp-close:hover { color: #fff; }

.cp-hint {
  padding: 8px 14px 6px;
  font-size: 11px; color: rgba(180,255,210,0.50);
  line-height: 1.45;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(34,221,102,0.12);
}

#cp-list {
  overflow-y: auto; overflow-x: hidden;
  flex: 1 1 auto; min-height: 0;
  padding: 6px 0 8px;
}
#cp-list::-webkit-scrollbar { width: 5px; }
#cp-list::-webkit-scrollbar-thumb { background: rgba(34,221,102,0.30); border-radius: 3px; }

/* ── Catalog-List-Item ─────────────────────────────────────────────────── */
.cp-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 8px;
  border-radius: 8px; margin: 2px 6px;
  cursor: grab;
  transition: background 0.12s;
  touch-action: none;  /* wichtig: verhindert Scroll-Konflikt auf Touch */
}
.cp-item:hover         { background: rgba(34,221,102,0.12); }
.cp-item--dragging     { opacity: 0.30; cursor: grabbing; }
.cp-item:active        { cursor: grabbing; }
/* System-Kontext: Kataloge mit Alias im aktuellen System heller, ohne Alias dunkler */
.cp-item--active   .cp-name { color: #d4ffe4; }
.cp-item--active   .cp-key  { color: rgba(180,255,210,0.65); }
.cp-item--inactive .cp-name { color: rgba(180,255,210,0.32); }
.cp-item--inactive .cp-key  { color: rgba(180,255,210,0.18); }
.cp-item--inactive .cp-handle { color: rgba(180,255,210,0.18); }

.cp-handle {
  font-size: 16px; color: rgba(180,255,210,0.40);
  flex-shrink: 0; width: 18px; text-align: center;
  line-height: 1; letter-spacing: -1px;
  cursor: grab; pointer-events: none;
}

.cp-name {
  flex: 1 1 auto; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  color: #d4ffe4; font-size: 12px;
}

.cp-key {
  flex-shrink: 0; font-size: 10px;
  color: rgba(180,255,210,0.38);
  font-family: 'Courier New', monospace;
  letter-spacing: 0.02em;
}

/* Ghost-Element beim Ziehen */
.cp-ghost {
  background: rgba(17,60,30,0.95);
  border: 1.5px solid rgba(34,221,102,0.70);
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.55);
  padding: 7px 12px 7px 8px;
  display: flex; align-items: center; gap: 8px;
  font-family: Arial, sans-serif; font-size: 12px;
  color: #d4ffe4;
  pointer-events: none;
}

/* Footer mit Reset-Button */
.cp-footer {
  flex-shrink: 0; padding: 8px 14px 10px;
  border-top: 1px solid rgba(34,221,102,0.22);
  display: flex; justify-content: flex-end;
}
.cp-reset {
  background: rgba(34,221,102,0.12); color: #d4ffe4;
  border: 1px solid rgba(34,221,102,0.45); border-radius: 8px;
  width: auto; height: auto; min-width: 0; max-width: 100%;
  padding: 6px 16px; font-size: 12px; font-family: Arial, sans-serif;
  white-space: nowrap; line-height: 1.2;
  cursor: pointer; transition: background 0.15s, opacity 0.15s;
}
.cp-reset:hover:not(:disabled) { background: rgba(34,221,102,0.25); }
.cp-reset:disabled { opacity: 0.35; cursor: default; }

/* Drop-Indikator-Linie */
.cp-drop-indicator {
  height: 2px;
  background: rgba(34,221,102,0.80);
  border-radius: 2px;
  margin: 1px 10px;
  box-shadow: 0 0 6px rgba(34,221,102,0.60);
  pointer-events: none;
}

@media (max-width: 500px), (pointer: coarse) {
  #catalog-priority-panel {
    width: calc(100vw - 20px);
    max-width: 340px;
    font-size: 12px;
  }
  .cp-item { padding: 9px 12px 9px 8px; }
}

/* Mobile: Versionlabel + AppIcon etwas weiter nach rechts unten (Überlappung mit ControlPanel vermeiden) */
@media (max-width: 500px), (pointer: coarse) {
  #version { right: 4px; bottom: 2px; }
}
