body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Segoe UI', sans-serif;
    color: #eee;
    overflow: hidden;
    background: #05080a;
}


.map-viewport {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1b2735 0%, #05070a 70%);
    overflow: hidden;
    cursor: grab;
}

/* Die Sonne (Mittelpunkt) */
.sun {
    position: absolute;
    width: 30px;
    height: 30px;
    background: #ffcc00;
    border-radius: 50%;
    box-shadow: 0 0 50px #ff6600, 0 0 20px #ffffff;
    z-index: 10;
}

/* Gemeinsame Styles für Planeten/Stationen */
.map-object {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20;
}

.map-object:hover {
    scale: 1.5;
}

/* Stationen sind kleine Punkte */
.map-object.station .dot {
    width: 6px;
    height: 6px;
    background-color: #00f2ff;
    /* Blau/Cyan */
}

.map-object.planet .dot {
    width: 12px;
    height: 12px;
    background-color: #1c9906;
    box-shadow: 0 0 15px #fcf4e3;
}

/* Punkt-Optik */
.dot {
    width: 12px;
    height: 12px;
    background: #5dade2;
    border-radius: 50%;
    border: 2px solid #fff;
}

.label {
    position: absolute;
    top: 0;
    left: 0;

    color: #00f2ff;
    text-shadow: 0 0 5px #00f2ff;

    font-family: 'Orbitron', sans-serif;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 242, 255, 0.5);
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}

.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
    /* Klicks gehen durch den Ring durch */
}

/* In den <style> Bereich kopieren */
.map-viewport::before {
    content: "";
    position: absolute;
    width: 200%;
    height: 200%;
    background-image:
        radial-gradient(1px 1px at 20px 30px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 40px 70px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 50px 160px, #ddd, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 80px 120px, #fff, rgba(0, 0, 0, 0));
    background-repeat: repeat;
    background-size: 200px 200px;
    opacity: 0.3;

}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    /* Muss höher sein als die Labels */
    background: rgba(10, 15, 25, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 242, 255, 0.2);
}

#container-3d {
    position: relative;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;

    padding: 10px 0;
}

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

.nav-container-systems {
    position: absolute;
    top: 80px;
    /* Unter der Haupt-Navi */
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 100;
}

.nav-button {
    background: rgba(0, 40, 60, 0.6);
    border: 1px solid #00f2ff;
    color: #00f2ff;
    padding: 10px 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border-radius: 2px;
    box-shadow: 0 0 5px rgba(0, 242, 255, 0.2);
}

.nav-button:hover {
    background: rgba(0, 242, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.6);
    text-shadow: 0 0 8px #00f2ff;
    transform: translateY(-2px);
}

.nav-button:active {
    transform: translateY(0);
    background: rgba(0, 242, 255, 0.4);
}

.nav-logo-h1 {
    color: #00f2ff;
    font-weight: bold;
    letter-spacing: 2px;
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
}

.referral-box {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
}

.referral-img {
    height: 20px;
    filter: drop-shadow(0 0 5px #00f2ff);
}

.referral-text-link {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s;
}

.referral-text-link:hover {
    color: #fff;
}

.nav-links {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    align-items: center;
}

.nav-links a {
    color: #eee;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.3s;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover {
    color: #00f2ff;
}

.nav-links a.active {
    color: #00f2ff;
    border-bottom: 2px solid #00f2ff;
}

.nav-external {
    color: #ffaa00 !important;
    /* Goldene Farbe für Mining */
}

canvas {
    display: block;
    /* Verhindert kleine Abstände am Rand */
}

/* Das Suchfenster links */
#search-container {
    position: absolute;
    top: 80px;
    left: 20px;
    width: 450px;
    background: rgba(0, 20, 30, 0.85);
    border: 1px solid rgba(0, 242, 255, 0.4);
    border-radius: 8px;
    padding: 15px;
    z-index: 100;
    color: white;
    backdrop-filter: blur(5px);
}

#search-container h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #00f2ff;
    font-family: 'Orbitron', sans-serif;
}

#search-input {
    width: 100%;
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00f2ff;
    color: white;
    border-radius: 4px;
    box-sizing: border-box;
}

#search-input:focus {
    outline: none;
    box-shadow: 0 0 5px #00f2ff;
}

.search-hint {
    font-size: 10px;
    color: #888;
    margin-top: 5px;
}

#search-results {
    background: rgba(0, 30, 50, 0.9);
    border: 1px solid rgba(0, 242, 255, 0.3);
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    /* Standardmäßig aus */
}

.search-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #fff;
    border-bottom: 1px solid rgba(0, 242, 255, 0.1);
    transition: background 0.2s;
}

.search-item:hover {
    background: rgba(0, 242, 255, 0.2);
    color: #00f2ff;
}

/* Scrollbar Styling für den Sci-Fi Look */
#search-results::-webkit-scrollbar {
    width: 5px;
}

#search-results::-webkit-scrollbar-thumb {
    background: #00f2ff;
}

#info-features {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 242, 255, 0.05);
    border-radius: 4px;
}

#info-features img {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 0 5px #00f2ff);
    border: 1px solid rgba(0, 242, 255, 0.2);
    padding: 5px;
    border-radius: 4px;
    background: rgba(0, 242, 255, 0.05);
}

.trade-section h4 {
    color: #00f2ff;
    margin-bottom: 5px;
    font-size: 12px;
    text-transform: uppercase;
}

.trade-section li {
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.trade-nav-button {
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid #00f2ff;
    color: #00f2ff;
    padding: 8px 15px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    transition: all 0.3s;
    flex: 1;
}

.trade-nav-button:hover {
    background: rgba(0, 242, 255, 0.3);
    box-shadow: 0 0 10px #00f2ff;
}

.trade-nav-button.active {
    background: #00f2ff;
    color: #000;
}


.trade-highlight-label {
    position: absolute;
    z-index: 9999;
    /* Zwingt das Label ganz nach vorne */
    margin: 0;
    background: rgba(5, 15, 25, 0.9);
    border: 1px solid #00f2ff;
    padding: 8px;
    margin-left: 80px;
    /* Transform komplett entfernen! */
    pointer-events: auto;
    user-select: none;
}

/* Der Trick: Beim Drüberfahren springt es nach ganz vorne */
.trade-highlight-label:hover {
    z-index: 1000000 !important;
    background: rgba(0, 40, 80, 1);
    border-color: #fff;
}

@keyframes pulse-border {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.route-stop-label {
    background: rgba(0, 20, 30, 0.85);
    border: 1px solid #00f2ff;
    border-radius: 4px;
    padding: 4px 8px;
    color: white;
    font-size: 11px;
    pointer-events: none;
    /* Klicks gehen durch auf die Station */
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}

.route-stop-label b {
    color: #00f2ff;
    display: block;
    margin-bottom: 2px;
}

.trade-buy {
    color: #3aff03;
}

/* Grün für Kauf */
.trade-sell {
    color: #ffa500;
}

.active-commodity {
    background: rgba(0, 242, 255, 0.2) !important;
    border-left: 3px solid #00f2ff;
}

.trade-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Orange für Verkauf */
.route-controls {
    position: absolute;
    bottom: 20px;
    /* Abstand von unten */
    right: 40px;
    /* Abstand von rechts */
    background: rgba(5, 15, 25, 0.85);
    border: 1px solid #00f2ff;
    padding: 15px;
    color: white;
    z-index: 50;
    border-radius: 4px;
    /* Optional: leicht abgerundete Ecken für den Look */
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.2);
    /* Ein dezentes Leuchten */
}

#route-info-panel {
    z-index: 8999 !important;
    pointer-events: auto !important;
}

.route-line-label {
    color: #ff0000;
    font-family: monospace;
    font-size: 12px;
    text-shadow: 1px 1px 2px black;
}

/* Ersetze deinen alten .commodity-item.active-commodity Block hiermit: */
.trade-item.active-commodity {
    background: rgba(0, 242, 255, 0.3) !important;
    /* Leuchtendes Blau */
    border-left: 4px solid #00f2ff !important;
    color: #fff !important;
    box-shadow: inset 5px 0 10px rgba(0, 242, 255, 0.2);
}

.status-icons-container {
    display: flex;
    /* Ordnet Icons nebeneinander an */
    flex-wrap: wrap;
    /* Erlaubt Umbruch bei Platzmangel */
    gap: 8px;
    /* Abstand zwischen den Icons */
    margin-bottom: 10px;
    /* Abstand zum Titel */
    min-height: 24px;
    /* Verhindert Springen des Layouts */
}

.status-icons-container img {
    width: 24px;
    /* Einheitliche Größe */
    height: 24px;
    object-fit: contain;
}

.trade-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #0a0f19;
    color: #00b7ff;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    border-bottom: 2px solid #00b7ff;
    /* Padding EXAKT wie bei .trade-item */
    padding: 12px 15px;
    min-height: unset;
}

.unit {
    color: #aaa;
    font-size: 0.7rem;
    margin-left: 2px;
}


/* Die Tabellenzeile (Header und Daten) */
.trade-item {
    display: grid;
    /* Festes Verhältnis: Ware(3), Lager(1.5), Preis(2), SCU(2) */
    grid-template-columns: 3fr 1.5fr 2fr 2fr;
    column-gap: 65px;
    align-items: right;
    /* WICHTIG: Padding muss bei .trade-item UND .trade-header identisch sein */
    padding: 12px 15px;
    background: rgba(2, 69, 252, 0.05);
    font-size: 0.9rem;
    color: #eee;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 40px;
    box-sizing: content-box;
    /* Sorgt dafür, dass Padding die Breite nicht verändert */
}

/* SCU Styling für zwei Zeilen */
.col-scu {
    line-height: 1.4;
    /* Mehr Abstand zwischen den zwei Zahlenreihen */
    font-family: 'monospace';
    /* Zahlen untereinander wirken sauberer */
    font-size: 0.8rem;
    color: #00f2ff;
}


/* Suche diesen Block und ändere die Farbe: */
.trade-item:not(.trade-header):hover {
    background: rgba(1, 183, 255, 0.2);
    cursor: pointer;
}

/* Einheiten (aUEC, SCU) kleiner darstellen */
.unit {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-left: 3px;
}

.trade-item span {
    text-align: left;
}

.trade-item span:nth-child(1) {
    text-align: left;
    font-weight: bold;
}

/* Ware */
.trade-item span:nth-child(2) {
    text-align: left;
}

/* Lager */
.trade-item span:nth-child(3) {
    text-align: right;
    color: #fff;
}

/* Preis */
.trade-item span:nth-child(4) {
    text-align: right;
}

/* SCU */

/* Container für die Listen - hier begrenzen wir die Höhe */
#trade-buy-list,
#trade-sell-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;

    /* Höhe begrenzen und Scrollen erlauben */
    max-height: 450px;
    overflow-y: auto;
    overflow-x: hidden;

    /* Padding rechts, damit die Scrollbar nicht auf dem Text klebt */
    padding-right: 5px;
}

/* Styling der Scrollbar für Chrome/Edge/Safari (Webkit) */
#trade-buy-list::-webkit-scrollbar,
#trade-sell-list::-webkit-scrollbar {
    width: 6px;
}

#trade-buy-list::-webkit-scrollbar-track,
#trade-sell-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

#trade-buy-list::-webkit-scrollbar-thumb,
#trade-sell-list::-webkit-scrollbar-thumb {
    background: #00b7ff;
    border-radius: 10px;
}