/* General */
html, body { touch-action: none; overscroll-behavior: none; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #000; overflow: hidden; font-family: Arial, sans-serif; }
canvas { display: block; cursor: pointer; }

/* 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); 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; 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; user-select:none; min-width:22px; display:flex; align-items:center; justify-content:center; }

/* 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; 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: 10;
    width: max-content; max-width: calc(100vw - 32px);
}

/* Title */
#viewtitle { display:flex;align-items:center;justify-content:center;gap:8px; }
.showpanelbutton { display:none;background:rgba(255,200,50,0.18);border:1px solid rgba(255,200,50,0.4);border-radius:8px;padding:0;width:16px;height:16px;cursor:pointer;flex-shrink:0;touch-action:manipulation;pointer-events:auto;position:relative;top:-1px; }
.languagebutton { background:rgba(255,255,255,0.1);border:1px solid rgba(255,255,255,0.2);border-radius:6px;padding:0;width:26px;height:16px;font-size:9px;font-weight:600;letter-spacing:0.06em;color:rgba(255,255,255,0.55);cursor:pointer;flex-shrink:0;touch-action:manipulation;pointer-events:auto;display:flex;align-items:center;justify-content:center;font-family:Arial,sans-serif; }

/* Labels */
#focusLabel { color:rgba(255,220,100,0.95); font-size:14px; font-weight:bold; opacity:0; transition:opacity 0.4s; }
#systemLabel { color:rgba(255,255,255,0.75); font-size:18px; font-weight:300; letter-spacing:0.12em; text-transform:uppercase; white-space:nowrap; }
#tooltip { color:rgba(255,255,255,0.45); font-size:12px; }
#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; }
#versionhistorylink { color:rgba(255,255,255,0.25);text-decoration:none;pointer-events:auto; }

/* 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;
    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; }
#astro-info.dragging { cursor: grabbing; 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;
    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; }
#astro-info2.dragging { cursor: grabbing; 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-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-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; }

/* ── 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); 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); 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;
}
#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;
}

@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;
      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-info2 {
      background: rgba(12, 45, 22, 0.55);
      border-width: 1.5px;
      border-radius: 10px;
      backdrop-filter: blur(8px);
      transform: scale(0.75);
      transform-origin: top left;
    }
}