/* Global: das hidden-Attribut muss jede display-Regel schlagen */
[hidden] { display: none !important; }

/* ============================================================
   Plattform-Grundlage – dunkles Theme
   Feste Bereiche: Top-Header (56px) + linke Navigation (230px)
   ============================================================ */

:root {
    /* Farben */
    --bg:         #0c0f18;   /* Seitenhintergrund */
    --bg-raised:  #131826;   /* Panels, Header, Sidebar */
    --bg-inset:   #0f1420;   /* Eingabefelder */
    --line:       #232c42;   /* Rahmen & Trenner */
    --accent:     #e8b45a;   /* Akzent (Bernstein) */
    --accent-dim: #9c7a3f;
    --text:       #d6dcee;
    --text-dim:   #7f89a8;
    --success:    #5abf7f;
    --error:      #d9645a;

    /* Maße */
    --topbar-h:  56px;
    --sidebar-w: 230px;

    /* Schrift */
    --font-ui:   system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

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

html { font-size: 16px; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    line-height: 1.55;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg-inset);
    border: 1px solid var(--line);
    padding: 1px 5px;
    border-radius: 3px;
}

/* ------------------------------------------------------------
   Fester Top-Header
   ------------------------------------------------------------ */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 18px;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--line);
    z-index: 100;
}

.brand {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text);
}
.brand:hover { text-decoration: none; color: var(--accent); }
/* Farbe von .brand-mark kommt aus der Status-Klasse (weiter unten). */

.topbar-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.topbar-username { color: var(--text-dim); }

.badge {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent-dim);
    padding: 2px 7px;
    border-radius: 3px;
}
.badge-link {
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.badge-link:hover {
    background: var(--accent);
    color: #1a1206;
}

/* Hamburger – nur mobil sichtbar */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 17px;
    width: 36px; height: 36px;
    border-radius: 4px;
    cursor: pointer;
}

/* ------------------------------------------------------------
   Feste linke Navigation
   ------------------------------------------------------------ */
.sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-raised);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    z-index: 90;
}

.sidenav { flex: 1; padding: 18px 0; overflow-y: auto; }

.sidenav-title {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 0 20px 10px;
}

.sidenav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text-dim);
    border-left: 2px solid transparent;
}
a.sidenav-item:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
}
.sidenav-item.is-active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: rgba(232, 180, 90, 0.06);
}
.sidenav-item.is-soon { cursor: default; opacity: 0.55; }

.soon-tag {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid var(--line);
    color: var(--text-dim);
    padding: 1px 6px;
    border-radius: 3px;
}

.sidebar-logout {
    padding: 14px 16px;
    border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------
   Inhaltsbereich
   ------------------------------------------------------------ */
.content {
    margin-top: var(--topbar-h);
    margin-left: var(--sidebar-w);
    padding: 28px 32px 60px;
    max-width: 1200px;
}

.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 22px; font-weight: 600; }
.page-sub { color: var(--text-dim); font-size: 14px; margin-top: 2px; }

/* Raster */
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* Panels */
.panel {
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 18px 20px;
}

.panel-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-dim);
    margin-bottom: 8px;
}

.panel-value { font-size: 26px; font-weight: 600; }
.panel-value-sm { font-size: 17px; }
.panel-foot { color: var(--text-dim); font-size: 12px; margin-top: 4px; }
.panel-text { color: var(--text-dim); font-size: 14px; }
.panel-soon { border-style: dashed; }

/* Daten-Tabelle (z.B. Profil) */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.data-table td:first-child { color: var(--text-dim); width: 45%; }
.data-table tr:last-child td { border-bottom: none; }

/* ------------------------------------------------------------
   Formulare
   ------------------------------------------------------------ */
.field { display: block; margin-bottom: 16px; }

.field-label {
    display: block;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 15px;
    padding: 10px 12px;
    transition: border-color 0.15s;
}
.field input:focus {
    outline: none;
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 3px rgba(232, 180, 90, 0.12);
}

/* Buttons */
.btn {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
    background: var(--accent);
    color: #17130a;
}
.btn-primary:hover { background: #f2c476; }

.btn-ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--text-dim);
}
.btn-ghost:hover { border-color: var(--accent-dim); color: var(--accent); }

.btn-block { display: block; width: 100%; }

/* ------------------------------------------------------------
   Flash-Meldungen
   ------------------------------------------------------------ */
.flash {
    border: 1px solid var(--line);
    border-left-width: 3px;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 14px;
    background: var(--bg-raised);
}
.flash-success { border-left-color: var(--success); }
.flash-error   { border-left-color: var(--error); }
.flash-info    { border-left-color: var(--accent); }

/* ------------------------------------------------------------
   Auth-Seiten (Login / Registrierung) – ohne Sidebar
   ------------------------------------------------------------ */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background:
        radial-gradient(ellipse 70% 50% at 50% -10%, rgba(232, 180, 90, 0.07), transparent),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 30px 28px;
}

.auth-brand {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
    text-align: center;
    margin-bottom: 6px;
}

.auth-title {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 22px;
}

.auth-switch {
    text-align: center;
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 18px;
}

/* ------------------------------------------------------------
   Responsiv: Sidebar wird mobil eingeklappt
   ------------------------------------------------------------ */
@media (max-width: 860px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }

    .nav-toggle { display: block; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }
    .sidebar.is-open { transform: translateX(0); }

    .content { margin-left: 0; padding: 20px 16px 60px; }
}

/* ------------------------------------------------------------
   Admin: Spielertabelle
   ------------------------------------------------------------ */
.table-scroll { overflow-x: auto; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    white-space: nowrap;
}
.admin-table th {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-dim);
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
}
.admin-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
}
.admin-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.cell-dim { color: var(--text-dim); }

/* Emailuser-Schalter */
.toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 12px 4px 4px;
    color: var(--text-dim);
    font-family: var(--font-ui);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.toggle:hover { border-color: var(--accent-dim); }
.toggle:disabled { opacity: 0.5; cursor: wait; }
.toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.toggle-knob {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: background 0.15s;
}
.toggle.is-on { border-color: var(--accent-dim); color: var(--accent); }
.toggle.is-on .toggle-knob { background: var(--accent); }

/* Admin: Link-Formular */
.link-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 14px;
    align-items: end;
}
.link-form .field { margin-bottom: 0; }
.link-form .btn { height: 42px; }

@media (max-width: 860px) {
    .link-form { grid-template-columns: 1fr; }
}


/* Auswahlfelder (gleiche Optik wie Eingabefelder) */
.field select {
    width: 100%;
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 15px;
    padding: 10px 12px;
    height: 42px;
    cursor: pointer;
}
.field select:focus {
    outline: none;
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 3px rgba(232, 180, 90, 0.12);
}

/* Markierung für externe Links in der Navigation */
.ext-mark {
    font-size: 11px;
    color: var(--text-dim);
    margin-left: 6px;
}

/* ------------------------------------------------------------
   Spiel: Rahmen, HUD, Overlays
   ------------------------------------------------------------ */
.game-shell {
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}
.game-shell:fullscreen { border-radius: 0; border: none; }
.game-shell:fullscreen .game-canvas { height: calc(100vh - 84px); }

.game-hud {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 8px 14px;
    background: var(--bg-inset);
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.hud-item { display: flex; align-items: center; gap: 8px; }
.hud-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-dim);
}
.hud-value { font-size: 14px; font-weight: 600; }
.hud-mono { font-family: var(--font-mono); font-weight: 400; color: var(--text-dim); }
.hud-spacer { flex: 1; }

.fuel-bar {
    width: 90px; height: 8px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
}
.fuel-fill {
    height: 100%;
    width: 100%;
    background: var(--accent);
    transition: width 0.3s;
}
.fuel-fill.is-low { background: var(--error); }

/* Schild-Balken: blau statt bernstein */
.shield-fill { background: #6f9fe0; }
.shield-fill.is-low { background: #d9645a; }

.hud-btn {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-dim);
    font-family: var(--font-ui);
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}
.hud-btn:hover { border-color: var(--accent-dim); color: var(--accent); }

.game-canvas {
    width: 100%;
    height: 620px;
    background: #0a0d1c;
}

.game-log {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    max-width: 80%;
    padding: 7px 16px;
    font-size: 13px;
    text-align: center;
    color: var(--text);
    background: rgba(10, 14, 24, 0.72);
    border: 1px solid rgba(140, 160, 200, 0.18);
    border-radius: 8px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transition: opacity 0.3s;
}
.game-log.is-flash {
    animation: logFlash 2.6s ease-out forwards;
}
@keyframes logFlash {
    0%   { opacity: 0; transform: translateX(-50%) translateY(-6px); color: var(--accent); border-color: rgba(232,180,90,0.5); }
    12%  { opacity: 1; transform: translateX(-50%) translateY(0); }
    80%  { opacity: 1; color: var(--text); }
    100% { opacity: 0; color: var(--text); transform: translateX(-50%) translateY(0); }
}

/* Sternenkarten-Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 15, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}
.overlay-inner {
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    max-width: 95vw;
}
.overlay-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.overlay-head strong {
    font-family: var(--font-mono);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 13px;
    color: var(--accent);
}
#map-canvas {
    display: block;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 4px;
    cursor: crosshair;
}
.overlay-foot { margin-top: 10px; font-size: 12px; color: var(--text-dim); }

@media (max-width: 860px) {
    .game-canvas { height: 460px; }
}

/* ------------------------------------------------------------
   Inventar
   ------------------------------------------------------------ */
.inv-layout {
    display: grid;
    grid-template-columns: 280px 1fr 260px;
    gap: 16px;
    align-items: start;
}

/* Werte-Balken */
.stat-row {
    display: grid;
    grid-template-columns: 1fr 70px 44px;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
}
.stat-name { color: var(--text-dim); }
.stat-track {
    height: 6px;
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
}
.stat-fill { height: 100%; background: var(--accent); }
.stat-num { text-align: right; font-family: var(--font-mono); font-size: 12px; }

/* Slot-Raster */
.slot-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
}
.slot-grid-module { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); }

.slot {
    aspect-ratio: 1;
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
}
.slot-module {
    border-style: dashed;
    background: rgba(232, 180, 90, 0.03);
}
.slot.is-target { border-color: var(--accent-dim); }
.slot.is-over {
    border-color: var(--accent);
    background: rgba(232, 180, 90, 0.12);
}

/* Gegenstände */
.item {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}
.item:hover { transform: translateY(-2px); border-color: var(--accent-dim); }
.item.is-dragging { opacity: 0.4; cursor: grabbing; }
.item.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(232, 180, 90, 0.2);
}
.item-icon { font-size: 24px; line-height: 1; }
.item-qty {
    position: absolute;
    right: 3px; bottom: 2px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    background: var(--bg);
    border-radius: 3px;
    padding: 0 3px;
}

/* Seltenheit */
.rarity-gewoehnlich .item-icon { color: #9fb0d0; }
.rarity-selten      { border-color: #3f6f9c; }
.rarity-selten      .item-icon { color: #6fa8e0; }
.rarity-episch      { border-color: #7a5a9a; }
.rarity-episch      .item-icon { color: #b08ad0; }

.inv-hint {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-dim);
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

/* Detailkarte */
.detail-empty { color: var(--text-dim); font-size: 13px; }
.detail-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.detail-icon {
    font-size: 30px;
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--accent);
}
.detail-name { font-size: 15px; font-weight: 600; }
.detail-type { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.detail-desc { font-size: 13px; color: var(--text-dim); margin-bottom: 12px; }
.detail-value {
    font-size: 12px; color: var(--text-dim);
    border-top: 1px solid var(--line);
    padding-top: 10px; margin-top: 10px;
}

.effect-list { list-style: none; margin: 0 0 8px; padding: 0; }
.effect-list li {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 4px 0;
    border-bottom: 1px solid var(--line);
}
.effect-list li span { color: var(--text-dim); }
.effect-list li strong { color: var(--success); font-family: var(--font-mono); }

/* ------------------------------------------------------------
   Forschung
   ------------------------------------------------------------ */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tab {
    padding: 9px 16px;
    font-size: 14px;
    color: var(--text-dim);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.tree-tier { margin-bottom: 22px; }
.tier-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-dim);
    margin-bottom: 10px;
}
.tier-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.res-card {
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
}
.res-card.is-done   { border-color: var(--success); }
.res-card.is-locked { opacity: 0.5; }
.res-card.is-open   { border-left: 3px solid var(--accent); }

.res-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.res-name { font-size: 14px; font-weight: 600; }
.res-tag {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid var(--line);
    color: var(--text-dim);
    padding: 1px 6px;
    border-radius: 3px;
}
.res-tag-done { border-color: var(--success); color: var(--success); }
.res-desc { font-size: 12px; color: var(--text-dim); margin: 6px 0 10px; }
.res-req { font-size: 11px; color: var(--error); margin-bottom: 8px; }
.res-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}
.res-cost { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
.res-btn { padding: 6px 12px; font-size: 12px; }

/* ------------------------------------------------------------
   Optionen
   ------------------------------------------------------------ */
.opt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.opt-label { font-size: 14px; }
.opt-hint { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.opt-select {
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 13px;
    padding: 7px 10px;
    cursor: pointer;
}

/* Schiebeschalter */
.switch { display: inline-flex; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-track {
    width: 42px; height: 22px;
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: 999px;
    display: flex;
    align-items: center;
    padding: 2px;
    transition: background 0.15s, border-color 0.15s;
}
.switch-knob {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: transform 0.15s, background 0.15s;
}
.switch input:checked + .switch-track { border-color: var(--accent-dim); background: rgba(232,180,90,0.15); }
.switch input:checked + .switch-track .switch-knob { transform: translateX(20px); background: var(--accent); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 1100px) {
    .inv-layout { grid-template-columns: 1fr; }
}

/* Kursanzeige im Spiel-HUD */
.hud-btn-tiny { padding: 2px 6px; font-size: 11px; line-height: 1; }

/* Sternenkarte: Kurszeile im Kopf */
.overlay-head-btns { display: flex; gap: 6px; }
.map-course {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    margin-left: auto;
    margin-right: 12px;
}
#map-canvas { cursor: pointer; }

/* ------------------------------------------------------------
   Admin: Spielerverwaltung
   ------------------------------------------------------------ */
.admin-table tr.is-frozen td { opacity: 0.55; }

.status-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid var(--line);
}
.status-active { color: var(--success); border-color: rgba(90, 191, 127, 0.4); }
.status-frozen { color: #6fa8e0; border-color: rgba(111, 168, 224, 0.4); }

.row-actions { display: flex; gap: 6px; }

.mini-btn {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-dim);
    font-family: var(--font-ui);
    font-size: 12px;
    padding: 4px 9px;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.mini-btn:hover:not(:disabled) { border-color: var(--accent-dim); color: var(--accent); }
.mini-btn:disabled { opacity: 0.5; cursor: wait; }
.mini-btn-danger:hover:not(:disabled) { border-color: var(--error); color: var(--error); }
.mini-btn-warn { border-color: #a5702a; color: #e0a050; }
.mini-btn-warn:hover:not(:disabled) { border-color: #e8b45a; color: #f0c574; background: rgba(232,180,90,0.08); }

/* ------------------------------------------------------------
   Admin: Dateiübersicht
   ------------------------------------------------------------ */
.scan-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.sum-chip {
    font-size: 12px;
    color: var(--text-dim);
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 12px;
}
.sum-chip strong { color: var(--text); font-weight: 600; }
.sum-chip-total { border-color: var(--accent-dim); }
.sum-chip-total strong { color: var(--accent); }

.file-table { font-size: 13px; }
.file-table td { padding: 6px 12px; }

.ext-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid var(--line);
    color: var(--text-dim);
}
.ext-php { color: #8ab4e8; border-color: rgba(138, 180, 232, 0.35); }
.ext-css { color: #b08ad0; border-color: rgba(176, 138, 208, 0.35); }

.size-track {
    width: 110px;
    height: 5px;
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
}
.size-fill { height: 100%; background: var(--accent-dim); }

/* ------------------------------------------------------------
   Planeten-Editor
   ------------------------------------------------------------ */
.editor-shell { display: flex; flex-direction: column; gap: 14px; }

.editor-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 14px 18px;
}
.tool-group { display: flex; flex-direction: column; gap: 8px; }
.tool-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-dim);
}
.tool-palette { display: flex; flex-wrap: wrap; gap: 6px; }

.pal-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-inset);
    border: 1px solid var(--line);
    color: var(--text-dim);
    font-family: var(--font-ui);
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}
.pal-item:hover { border-color: var(--accent-dim); color: var(--text); }
.pal-item.is-active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(232,180,90,0.08);
}
.pal-swatch {
    width: 16px; height: 16px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #0c0f18;
    border: 1px solid rgba(0,0,0,0.3);
}

.size-controls { display: flex; align-items: center; gap: 8px; }
.size-controls label { font-size: 12px; color: var(--text-dim); }
.size-controls input {
    width: 56px;
    background: var(--bg-inset);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 4px;
    padding: 5px 7px;
    font-family: var(--font-mono);
}
.editor-actions { display: flex; gap: 8px; align-items: center; }

.editor-canvas-wrap {
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
    overflow: auto;
}
#editor {
    display: block;
    max-width: 100%;
    background: #0c0f18;
    border-radius: 4px;
    cursor: crosshair;
    image-rendering: pixelated;
}
.editor-status {
    font-size: 12px;
    color: var(--text-dim);
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 8px 12px;
}

/* ============================================================
   Header: Nachrichten-Icons & Systemmeldungen
   ============================================================ */
.topbar-icons { display: flex; gap: 4px; margin-right: 6px; }
.tb-icon {
    position: relative;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text-dim);
    cursor: pointer;
    text-decoration: none;
}
.tb-icon:hover { border-color: var(--accent-dim); color: var(--accent); }
.tb-glyph { font-size: 15px; }
.tb-count {
    position: absolute; top: -6px; right: -6px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    background: var(--error);
    color: #fff;
    font-size: 10px;
    font-family: var(--font-mono);
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
}
.tb-dot {
    position: absolute; top: -3px; right: -3px;
    width: 9px; height: 9px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg-raised);
}

/* Systemmeldungs-Dropdown */
.notice-dropdown {
    position: fixed;
    top: var(--topbar-h);
    right: 12px;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 200;
    overflow: hidden;
}
.notice-dropdown-head {
    font-family: var(--font-mono);
    font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
    color: var(--text-dim);
    padding: 12px 16px 8px;
}
.notice-dropdown-body { max-height: 60vh; overflow-y: auto; }
.nd-empty { padding: 16px; font-size: 13px; color: var(--text-dim); }
.nd-item {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 11px 14px;
    border-top: 1px solid var(--line);
    border-left: 3px solid var(--accent-dim);
    font-size: 13px;
}
.nd-item.level-info    { border-left-color: var(--accent); }
.nd-item.level-success { border-left-color: var(--success); }
.nd-item.level-warning { border-left-color: var(--error); }
.nd-body { flex: 1; }
.nd-dismiss {
    background: none; border: none; color: var(--text-dim);
    cursor: pointer; font-size: 13px; padding: 0 2px;
}
.nd-dismiss:hover { color: var(--accent); }

/* Laufband für frische Meldungen */
.notice-ticker {
    position: fixed;
    top: var(--topbar-h);
    left: var(--sidebar-w);
    right: 0;
    z-index: 80;
    padding: 8px 20px;
    font-size: 13px;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    animation: tickerIn 0.3s ease;
}
.notice-ticker.level-success { border-left-color: var(--success); }
.notice-ticker.level-warning { border-left-color: var(--error); }
@keyframes tickerIn { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (max-width: 860px) { .notice-ticker { left: 0; } }

/* Statusfarben für die Admin-Notice-Tabelle */
.status-tag.level-info    { color: var(--accent); border-color: var(--accent-dim); }
.status-tag.level-success { color: var(--success); border-color: rgba(90,191,127,0.4); }
.status-tag.level-warning { color: var(--error); border-color: rgba(217,100,90,0.4); }

.notice-form {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 10px;
    align-items: center;
}
.notice-form input[type=text], .notice-form select {
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 14px;
    padding: 9px 11px;
}
@media (max-width: 860px) { .notice-form { grid-template-columns: 1fr; } }

/* ============================================================
   Nachrichten-Seite
   ============================================================ */
.msg-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    height: calc(100vh - var(--topbar-h) - 130px);
    min-height: 480px;
}

.msg-sidebar {
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.msg-tabs { display: flex; border-bottom: 1px solid var(--line); }
.msg-tab {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-dim);
    font-family: var(--font-ui);
    font-size: 14px;
    padding: 12px;
    cursor: pointer;
}
.msg-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 16px; height: 16px;
    background: var(--error); color: #fff;
    font-size: 10px; border-radius: 999px; margin-left: 4px;
}
.msg-panel { flex: 1; overflow-y: auto; }
.msg-empty { padding: 18px; font-size: 13px; color: var(--text-dim); text-align: center; }

/* Gesprächsliste */
.conv-item {
    width: 100%;
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: transparent; border: none;
    border-bottom: 1px solid var(--line);
    cursor: pointer; text-align: left;
}
.conv-item:hover { background: rgba(255,255,255,0.03); }
.conv-item.has-unread { background: rgba(232,180,90,0.05); }
.conv-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--text-dim); flex-shrink: 0;
}
.conv-dot.is-online { background: var(--success); }
.conv-main { flex: 1; min-width: 0; }
.conv-name { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); }
.conv-badge {
    background: var(--error); color: #fff;
    font-size: 10px; padding: 0 5px; border-radius: 999px;
}
.conv-preview {
    display: block; font-size: 12px; color: var(--text-dim);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-time { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }

/* Freundesverwaltung */
.friend-search { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.friend-search input {
    width: 100%;
    background: var(--bg-inset); border: 1px solid var(--line);
    border-radius: 4px; color: var(--text);
    font-family: var(--font-ui); font-size: 14px; padding: 8px 11px;
}
.search-results:not(:empty) { margin-top: 8px; }
.friend-section { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.friend-section-title {
    font-family: var(--font-mono); font-size: 10px;
    letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--accent-dim); margin-bottom: 8px;
}
.friend-row {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 0; font-size: 13px;
}
.friend-name { flex: 1; }
.friend-state { font-size: 11px; color: var(--text-dim); }
.friend-acts { display: flex; gap: 5px; }

/* Chatfenster */
.msg-chat {
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 6px;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.chat-empty {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: var(--text-dim); gap: 10px;
}
.chat-empty-icon { font-size: 40px; opacity: 0.4; }
.chat-active { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.chat-partner { font-size: 15px; font-weight: 600; }
.chat-status { font-size: 12px; color: var(--text-dim); }
.chat-status.is-online { color: var(--success); }
.chat-delete { margin-left: auto; }

.chat-messages {
    flex: 1; overflow-y: auto;
    padding: 16px; display: flex; flex-direction: column; gap: 8px;
}
.bubble {
    max-width: 72%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}
.bubble-body { display: block; }
.bubble-time { display: block; font-size: 10px; color: var(--text-dim); margin-top: 3px; text-align: right; }
.from-me {
    align-self: flex-end;
    background: rgba(232,180,90,0.14);
    border: 1px solid var(--accent-dim);
    border-bottom-right-radius: 3px;
}
.from-them {
    align-self: flex-start;
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-bottom-left-radius: 3px;
}

.chat-input {
    display: flex; gap: 8px; align-items: flex-end;
    padding: 12px 14px; border-top: 1px solid var(--line);
}
.chat-input textarea {
    flex: 1; resize: none;
    background: var(--bg-inset); border: 1px solid var(--line);
    border-radius: 6px; color: var(--text);
    font-family: var(--font-ui); font-size: 14px;
    padding: 9px 12px; max-height: 120px; line-height: 1.4;
}
.chat-input textarea:focus { outline: none; border-color: var(--accent-dim); }

@media (max-width: 860px) {
    .msg-layout { grid-template-columns: 1fr; height: auto; }
    .msg-sidebar { height: 340px; }
    .msg-chat { height: 460px; }
}

/* ============================================================
   Fahndungsstatus: leuchtende Raute im Header
   ============================================================ */
.brand-mark {
    display: inline-block;
    font-size: 1.35em;
    line-height: 1;
    transform-origin: center;
    transition: color 0.4s, text-shadow 0.4s;
}
/* Sauber = grün, sanft pulsierend und leicht atmend */
.brand-mark.status-sauber {
    color: #5abf7f;
    text-shadow: 0 0 10px rgba(90, 191, 127, 0.85);
    animation: markBreathe 2.8s ease-in-out infinite;
}
/* Vorbestraft = gelb/bernstein, deutlicher pulsierend */
.brand-mark.status-vorbestraft {
    color: #e8c14a;
    text-shadow: 0 0 12px rgba(232, 193, 74, 0.9);
    animation: markBreathe 2.0s ease-in-out infinite;
}
/* Gesucht = rot, kräftig und schnell pulsierend */
.brand-mark.status-gesucht {
    color: #e5533f;
    text-shadow: 0 0 14px rgba(229, 83, 63, 0.95);
    animation: markAlarm 1.1s ease-in-out infinite;
}
/* Grün/Gelb: sanftes „Atmen" mit leichter Größenänderung */
@keyframes markBreathe {
    0%, 100% { opacity: 1;    transform: scale(1); }
    50%      { opacity: 0.75; transform: scale(1.18); }
}
/* Rot: kräftiger Alarm-Puls */
@keyframes markAlarm {
    0%, 100% { opacity: 1;   transform: scale(1.12); text-shadow: 0 0 16px rgba(229, 83, 63, 1); }
    50%      { opacity: 0.5; transform: scale(1);    text-shadow: 0 0 5px rgba(229, 83, 63, 0.5); }
}

/* Admin: Fahndungs-Dropdown farblich passend */
.wanted-select {
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: 4px;
    font-family: var(--font-ui);
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
}
.wanted-select.wanted-sauber      { color: var(--success); border-color: rgba(90,191,127,0.4); }
.wanted-select.wanted-vorbestraft { color: #e8c14a;        border-color: rgba(232,193,74,0.4); }
.wanted-select.wanted-gesucht     { color: #e5533f;        border-color: rgba(229,83,63,0.5); }

/* ============================================================
   Handelspanel (Weltraumspiel)
   ============================================================ */
.trade-overlay {
    position: fixed; inset: 0;
    background: rgba(6, 8, 14, 0.82);
    display: none; align-items: center; justify-content: center;
    z-index: 300;
}
.trade-window {
    width: 85vw;
    max-width: 1500px;
    max-height: 88vh;
    background: #0f1422;
    border: 1px solid #232c42;
    border-radius: 10px;
    display: flex; flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.trade-head {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid #232c42;
    font-family: monospace; font-size: 16px; color: #e8b45a;
}
.trade-meta { margin-left: auto; font-size: 13px; color: #9fb0c8; }
.trade-close {
    background: none; border: none; color: #7f89a8;
    font-size: 18px; cursor: pointer; padding: 0 4px;
}
.trade-close:hover { color: #e8b45a; }

.trade-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0; overflow: hidden; }
.trade-col { padding: 12px 16px; overflow-y: auto; overflow-x: hidden; max-height: 66vh; min-width: 0; }
.trade-col:first-child { border-right: 1px solid #232c42; }
.trade-col-title {
    font-family: monospace; font-size: 10px; letter-spacing: 2px;
    text-transform: uppercase; color: #6f7ba0; margin-bottom: 10px;
}
.trade-row {
    padding: 10px 10px;
    border-bottom: 1px solid #1a2133;
    font-size: 13px; color: #d6dcee;
}
.trade-row.is-illegal { background: rgba(217, 100, 90, 0.07); }
.trade-name { font-weight: 600; color: #e6ecf7; }
.trade-sub { display: block; font-size: 11px; color: #7f89a8; font-weight: 400; margin-top: 2px; }
.illegal-tag {
    font-size: 10px; color: #e5533f;
    border: 1px solid rgba(229,83,63,0.4); border-radius: 3px;
    padding: 0 4px; margin-left: 4px;
}
.trade-price { color: #e8b45a; font-family: monospace; text-align: right; white-space: nowrap; }
.trade-act { display: flex; align-items: center; gap: 6px; }
.trade-qty {
    width: 56px; background: #0c0f18; border: 1px solid #232c42;
    color: #d6dcee; border-radius: 4px; padding: 5px 6px;
    font-family: monospace; font-size: 12px;
}
.trade-btn {
    background: #1a2133; border: 1px solid #2f3a52;
    color: #d6dcee; border-radius: 4px; padding: 5px 10px;
    font-size: 12px; cursor: pointer;
}
.trade-btn.buy:hover  { border-color: #5abf7f; color: #5abf7f; }
.trade-btn.sell:hover { border-color: #e8b45a; color: #e8b45a; }
.trade-empty, .trade-loading { padding: 16px 4px; font-size: 13px; color: #7f89a8; }

@media (max-width: 680px) {
    .trade-cols { grid-template-columns: 1fr; }
    .trade-col:first-child { border-right: none; border-bottom: 1px solid #232c42; }
    .trade-col { max-height: 40vh; }
}

/* ============================================================
   Weltraum-Landingpage (Gäste)
   ============================================================ */
.space-landing {
    margin: 0;
    min-height: 100vh;
    background: #05070f;
    overflow: hidden;
    position: relative;
    font-family: var(--font-ui);
    color: var(--text);
}
#starfield {
    position: fixed; inset: 0;
    width: 100%; height: 100%;
    display: block;
    z-index: 0;
}
.landing-nebula {
    position: fixed; inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 50% at 25% 30%, rgba(80, 112, 156, 0.18), transparent 70%),
        radial-gradient(ellipse 50% 40% at 78% 68%, rgba(176, 138, 208, 0.14), transparent 70%),
        radial-gradient(ellipse 40% 30% at 60% 20%, rgba(232, 180, 90, 0.06), transparent 70%);
}
.landing-brand {
    position: fixed; top: 22px; left: 26px;
    z-index: 3;
    font-family: var(--font-mono);
    font-size: 17px; letter-spacing: 3px; text-transform: uppercase;
    color: var(--text);
}
.landing-brand .brand-mark { color: var(--success); text-shadow: 0 0 8px rgba(90,191,127,0.7); }

.landing-hero {
    position: relative; z-index: 3;
    min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    padding: 20px;
}
.landing-title {
    font-size: clamp(2.6rem, 8vw, 5.5rem);
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0;
    color: #f0f4fc;
    text-shadow: 0 0 30px rgba(138, 180, 232, 0.5), 0 0 60px rgba(80, 112, 156, 0.3);
}
.landing-tagline {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    color: #9fb0c8;
    margin: 14px 0 40px;
    letter-spacing: 0.5px;
}
.landing-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.landing-btn {
    background: rgba(19, 24, 38, 0.6);
    border: 1px solid rgba(140, 160, 200, 0.3);
    color: #d6dcee;
    font-family: var(--font-ui);
    font-size: 15px;
    padding: 12px 30px;
    border-radius: 999px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: all 0.25s;
}
.landing-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 20px rgba(232, 180, 90, 0.25);
}
.landing-btn.primary {
    background: rgba(232, 180, 90, 0.14);
    border-color: var(--accent);
    color: var(--accent);
}
.landing-btn.primary:hover { background: rgba(232, 180, 90, 0.22); }

.landing-hint {
    position: fixed; bottom: 26px; left: 0; right: 0;
    z-index: 3;
    text-align: center;
    font-size: 12px;
    color: rgba(159, 176, 200, 0.5);
    letter-spacing: 0.5px;
}

/* Auth-Overlays (Login/Register/Passwort) */
.auth-overlay {
    position: fixed; inset: 0;
    z-index: 20;
    background: rgba(5, 7, 15, 0.75);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
/* Wichtig: hidden-Attribut muss display:flex schlagen, sonst bleiben
   alle Fenster gleichzeitig sichtbar und lassen sich nicht schließen. */
.auth-overlay[hidden] { display: none !important; }
.auth-modal {
    position: relative;
    width: min(400px, 94vw);
    background: rgba(15, 20, 34, 0.96);
    border: 1px solid #232c42;
    border-radius: 12px;
    padding: 32px 28px 26px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.auth-modal-close {
    position: absolute; top: 14px; right: 16px;
    background: none; border: none;
    color: #7f89a8; font-size: 18px; cursor: pointer;
}
.auth-modal-close:hover { color: var(--accent); }
.auth-modal .auth-brand {
    font-family: var(--font-mono);
    font-size: 13px; letter-spacing: 2px; text-transform: uppercase;
    color: #9fb0c8; margin-bottom: 6px;
}
.auth-modal .auth-title { font-size: 20px; margin: 0 0 18px; color: #f0f4fc; }
.auth-note { font-size: 13px; color: #9fb0c8; margin: 0 0 14px; line-height: 1.5; }

@media (max-width: 480px) {
    .landing-brand { font-size: 14px; top: 16px; left: 16px; }
}

/* ============================================================
   MOD-Datei-Upload (Optionen)
   ============================================================ */
.mod-upload-zone {
    border: 2px dashed #2f3a52;
    border-radius: 10px;
    padding: 28px;
    text-align: center;
    color: #9fb0c8;
    background: var(--bg-inset);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.mod-upload-zone:hover, .mod-upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(232, 180, 90, 0.05);
}
.mod-upload-zone .mod-icon { font-size: 30px; opacity: 0.5; display: block; margin-bottom: 8px; }
.mod-file-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}
.mod-file-name { flex: 1; }
.mod-file-meta { color: #7f89a8; font-size: 11px; }

/* Händler-Typ-Auswahl im Editor */
.mini-select {
    background: var(--bg-inset);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 4px;
    font-family: var(--font-ui);
    font-size: 12px;
    padding: 5px 8px;
    margin-left: 4px;
}

/* ============================================================
   Admin-Sternenkarte
   ============================================================ */
.starmap-toolbar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    margin-bottom: 12px;
}
.starmap-radio {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text); cursor: pointer;
}
.starmap-sel {
    font-family: monospace; font-size: 12px; color: #9fb0c8;
    padding: 4px 10px; background: var(--bg-inset);
    border: 1px solid var(--line); border-radius: 4px;
    margin-left: auto;
}
.starmap-canvas {
    width: 100%;
    height: auto;
    aspect-ratio: 900 / 520;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #05070f;
    cursor: crosshair;
    display: block;
}
.starmap-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #7f89a8;
    font-family: monospace;
}

/* ============================================================
   Dashboard – Level-Fortschritt
   ============================================================ */
.level-panel {
    background: linear-gradient(135deg, #131826 0%, #0f1420 100%);
    border: 1px solid #232c42;
}
.level-header {
    display: flex;
    align-items: center;
    gap: 22px;
}

/* Runde Stufen-Plakette */
.level-badge {
    flex-shrink: 0;
    width: 92px; height: 92px;
    border-radius: 50%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: radial-gradient(circle at 35% 30%, #f0c874, #e8b45a 55%, #b0812f 100%);
    box-shadow: 0 0 24px rgba(232, 180, 90, 0.35),
                inset 0 2px 6px rgba(255, 255, 255, 0.35),
                inset 0 -3px 8px rgba(0, 0, 0, 0.3);
    color: #2a1f08;
}
.level-badge-label {
    font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
    opacity: 0.75; font-weight: 600;
}
.level-badge-num {
    font-size: 38px; font-weight: 700; line-height: 1;
    font-family: var(--font-mono, monospace);
}

.level-info { flex: 1; min-width: 0; }
.level-info-top {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 8px;
}
.level-title { font-size: 17px; font-weight: 600; color: #f0f4fc; }
.level-next { font-size: 12px; color: #7f89a8; }

/* Der eigentliche Balken */
.level-bar {
    position: relative;
    height: 26px;
    background: #0a0e18;
    border: 1px solid #232c42;
    border-radius: 999px;
    overflow: hidden;
}
.level-bar-fill {
    position: relative;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #b0812f 0%, #e8b45a 55%, #f7d894 100%);
    box-shadow: 0 0 12px rgba(232, 180, 90, 0.5);
    transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    min-width: 2px;
}
.level-bar-text {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-family: var(--font-mono, monospace);
    color: #f0f4fc;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.5px;
}
.level-info-bottom {
    display: flex; justify-content: space-between;
    margin-top: 8px;
    font-size: 12px; color: #7f89a8;
}

/* Kennzahlen-Reihe unter dem Balken */
.level-stats {
    display: flex;
    gap: 16px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #1a2133;
}
.level-stat {
    flex: 1;
    display: flex; flex-direction: column; align-items: center;
    text-align: center;
}
.level-stat-num {
    font-size: 22px; font-weight: 700;
    font-family: var(--font-mono, monospace);
    color: #e8b45a;
}
.level-stat-label {
    font-size: 11px; color: #7f89a8;
    text-transform: uppercase; letter-spacing: 1px;
    margin-top: 4px;
}

@media (max-width: 560px) {
    .level-header { flex-direction: column; text-align: center; }
    .level-info-top, .level-info-bottom { flex-direction: column; gap: 2px; align-items: center; }
    .level-stats { flex-wrap: wrap; }
}

/* ============================================================
   Schiffsseite – Werte & Balken (überarbeitet)
   ============================================================ */
.ship-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 6px;
}
.ship-stat-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}
.ship-stat-name {
    font-size: 13px;
    color: #b8c2d8;
}
.ship-stat-val {
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-mono, monospace);
    color: #f0f4fc;
}
.ship-bar {
    height: 8px;
    background: #0a0e18;
    border: 1px solid #1e2740;
    border-radius: 999px;
    overflow: hidden;
}
.ship-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #b0812f 0%, #e8b45a 100%);
    box-shadow: 0 0 8px rgba(232, 180, 90, 0.4);
    transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.ship-bar-xp {
    background: linear-gradient(90deg, #4f8fce 0%, #7fc4ff 100%);
    box-shadow: 0 0 8px rgba(127, 196, 255, 0.4);
}

/* Pilot-Block */
.ship-pilot {
    display: flex;
    flex-direction: column;
    gap: 11px;
    margin-top: 6px;
}
.ship-pilot-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    color: #8593ab;
}
.ship-pilot-row strong {
    color: #e6ecf7;
    font-weight: 600;
    font-family: var(--font-mono, monospace);
}
.ship-pilot-xp {
    padding: 4px 0;
    border-top: 1px solid #1a2133;
    border-bottom: 1px solid #1a2133;
}
.ship-credits {
    color: #e8b45a !important;
}

/* ============================================================
   Werft (Modul-Shop) im Spiel
   ============================================================ */
.shop-body {
    padding: 14px 16px;
    overflow-y: auto;
    max-height: 66vh;
}
.shop-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid #232c42;
    border-radius: 8px;
    background: #0f1422;
    margin-bottom: 10px;
}
.shop-item.is-owned { opacity: 0.6; }
.shop-icon {
    flex-shrink: 0;
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    background: radial-gradient(circle at 40% 35%, #2a3550, #131826);
    border: 1px solid #2f3a52;
    border-radius: 8px;
    color: #ffcf6a;
}
.shop-info { flex: 1; min-width: 0; }
.shop-name {
    font-size: 15px; font-weight: 600; color: #f0f4fc;
    display: flex; align-items: baseline; gap: 8px;
}
.shop-lvl {
    font-size: 10px; color: #7f89a8;
    border: 1px solid #2f3a52; border-radius: 3px;
    padding: 1px 5px; font-weight: 400;
}
.shop-desc { font-size: 12px; color: #9fb0c8; margin-top: 4px; line-height: 1.4; }
.shop-buy { flex-shrink: 0; text-align: right; }
.shop-price {
    font-size: 14px; font-family: monospace; color: #e8b45a;
    margin-bottom: 6px; font-weight: 600;
}
.shop-owned-tag {
    font-size: 11px; color: #5abf7f;
    border: 1px solid rgba(90,191,127,0.4); border-radius: 4px;
    padding: 4px 10px; display: inline-block;
}
.shop-empty { padding: 24px 8px; font-size: 13px; color: #7f89a8; text-align: center; line-height: 1.5; }

/* ============================================================
   Dashboard – Status-Box (leuchtende Schrift)
   ============================================================ */
.status-value {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 4px 0 2px;
}
.status-glow-sauber {
    color: #5abf7f;
    text-shadow: 0 0 14px rgba(90, 191, 127, 0.7);
    animation: statusBreathe 2.8s ease-in-out infinite;
}
.status-glow-vorbestraft {
    color: #e8c14a;
    text-shadow: 0 0 16px rgba(232, 193, 74, 0.8);
    animation: statusBreathe 2.0s ease-in-out infinite;
}
.status-glow-gesucht {
    color: #e5533f;
    text-shadow: 0 0 18px rgba(229, 83, 63, 0.9);
    animation: statusAlarm 1.1s ease-in-out infinite;
}
@keyframes statusBreathe {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.7; }
}
@keyframes statusAlarm {
    0%, 100% { opacity: 1;   text-shadow: 0 0 20px rgba(229, 83, 63, 1); }
    50%      { opacity: 0.6; text-shadow: 0 0 8px rgba(229, 83, 63, 0.5); }
}

/* ============================================================
   Dashboard – Rangliste
   ============================================================ */
.score-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
}
.score-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 4px;
    border-bottom: 1px solid #1a2133;
}
.score-row:last-child { border-bottom: none; }
.score-rank {
    flex-shrink: 0;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    font-family: var(--font-mono, monospace);
    background: #1a2133; color: #8593ab;
    border-radius: 50%;
}
.score-row.is-first .score-rank {
    background: radial-gradient(circle at 40% 35%, #f0c874, #e8b45a 60%, #b0812f);
    color: #2a1f08;
    box-shadow: 0 0 10px rgba(232, 180, 90, 0.5);
}
.score-name { flex: 1; font-size: 14px; color: #e6ecf7; }
.score-row.is-first .score-name { color: #f0f4fc; font-weight: 600; }
.score-points {
    font-family: var(--font-mono, monospace);
    font-size: 14px; font-weight: 600;
    color: #e8b45a;
}

/* ============================================================
   Admin – Statistik-Kacheln
   ============================================================ */
.admin-stats {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.admin-stat {
    flex: 1;
    min-width: 130px;
    background: linear-gradient(135deg, #131826, #0f1420);
    border: 1px solid #232c42;
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-stat-num {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    color: #e8b45a;
}
.admin-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7f89a8;
}

/* Steuerungshinweis unter der Weltraum-Map */
.game-controls-hint {
    margin: 10px 2px 0;
    font-size: 12px;
    color: #6f7ba0;
    text-align: center;
}
.game-controls-hint strong {
    color: #9fb0c8;
    font-weight: 600;
}

/* Zoom-Buttons der Sternenkarte – auf Touch gut treffbar */
.map-zoom-btn {
    min-width: 38px;
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
    padding: 4px 10px;
    touch-action: manipulation;   /* kein Doppeltipp-Zoom auf Touch */
    user-select: none;
}

/* ============================================================
   Admin – Menü, Kacheln, Unterseiten
   ============================================================ */
.admin-menu {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    border-bottom: 1px solid #232c42;
    padding-bottom: 0;
}
.admin-menu-item {
    padding: 9px 16px;
    font-size: 14px;
    color: #8593ab;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.admin-menu-item:hover { color: #d6dcee; }
.admin-menu-item.is-active {
    color: #e8b45a;
    border-bottom-color: #e8b45a;
}

.admin-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.admin-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    background: linear-gradient(135deg, #131826, #0f1420);
    border: 1px solid #232c42;
    border-radius: 10px;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s;
}
.admin-tile:hover { border-color: #e8b45a; transform: translateY(-2px); }
.admin-tile-title { font-size: 16px; font-weight: 600; color: #f0f4fc; }
.admin-tile-desc { font-size: 12px; color: #7f89a8; line-height: 1.4; }

/* Einstellungen-Formular */
.settings-form { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.settings-field { display: flex; flex-direction: column; gap: 5px; }
.settings-field > span { font-size: 13px; color: #b8c2d8; }
.settings-field input[type="text"],
.settings-field input[type="number"],
.settings-field textarea {
    background: #0a0e18; border: 1px solid #232c42; border-radius: 6px;
    padding: 8px 10px; color: #e6ecf7; font-family: inherit;
}
.settings-field small { font-size: 11px; color: #6f7ba0; }
.settings-checkbox { flex-direction: row; align-items: center; gap: 8px; }
.settings-checkbox span { font-size: 14px; color: #e6ecf7; }

/* Schiffs-Katalog */
.ship-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.ship-card {
    display: flex; flex-direction: column;
    background: #0f1422; border: 1px solid #232c42; border-radius: 10px;
    overflow: hidden;
}
.ship-card-preview {
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 50% 40%, #1a2740, #0a0e18);
    padding: 16px; border-bottom: 1px solid #232c42;
}
.ship-card-body { padding: 12px 14px; flex: 1; }
.ship-card-name { font-size: 15px; font-weight: 600; color: #f0f4fc; display: flex; align-items: center; gap: 8px; }
.ship-card-stats { font-size: 11px; color: #8593ab; margin-top: 6px; line-height: 1.5; }
.ship-card-price { font-size: 13px; color: #e8b45a; font-family: monospace; margin-top: 8px; }
.ship-card-actions { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid #1a2133; }

.ship-form-title { font-size: 15px; color: #e6ecf7; margin: 8px 0 12px; }
.ship-form-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px; margin-bottom: 12px;
}
.ship-form label, .place-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #8593ab; }
.ship-form input, .ship-form textarea,
.place-form input, .place-form select, .place-form textarea {
    background: #0a0e18; border: 1px solid #232c42; border-radius: 6px;
    padding: 7px 9px; color: #e6ecf7; font-family: inherit;
}
.ship-form-full { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 12px; color: #8593ab; }
.ship-form-buttons { display: flex; gap: 10px; }
.ship-select { background: #0a0e18; border: 1px solid #232c42; border-radius: 5px; color: #d6dcee; padding: 4px 6px; font-size: 12px; }

/* Ort bearbeiten */
.place-edit-grid { display: grid; grid-template-columns: 220px 1fr; gap: 18px; }
.place-list { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; }
.place-list-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 12px; background: #0f1422; border: 1px solid #232c42;
    border-radius: 6px; cursor: pointer; text-align: left;
}
.place-list-item:hover { border-color: #50709c; }
.place-list-item.is-active { border-color: #e8b45a; background: #1a1e2c; }
.place-list-name { font-size: 13px; color: #e6ecf7; }
.place-list-type { font-size: 10px; color: #7f89a8; text-transform: uppercase; }
.place-form { display: flex; flex-direction: column; gap: 12px; }
.place-form-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

@media (max-width: 640px) {
    .place-edit-grid { grid-template-columns: 1fr; }
    .place-form-row { grid-template-columns: repeat(2, 1fr); }
}

/* Positionsanzeige unten links im Spielbildschirm */
.game-canvas { position: relative; }
.game-pos-overlay {
    position: absolute;
    left: 10px;
    bottom: 8px;
    z-index: 5;
    font-family: monospace;
    font-size: 11px;
    color: #e8b45a;
    opacity: 0.75;
    pointer-events: none;
    text-shadow: 0 0 4px rgba(0,0,0,0.8);
    letter-spacing: 0.5px;
}

/* Dashboard – Statistik-Liste */
.stat-list { list-style: none; margin: 6px 0 0; padding: 0; }
.stat-list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 4px; border-bottom: 1px solid #1a2133; font-size: 14px;
}
.stat-list li:last-child { border-bottom: none; }
.stat-list li span { color: #b8c2d8; }
.stat-list li strong { color: #e8b45a; font-family: monospace; }
.stat-list li.stat-sub { padding: 4px 4px 4px 14px; font-size: 12px; }
.stat-list li.stat-sub span { color: #7f89a8; }
.stat-list li.stat-sub strong { color: #9fb0c8; }

/* ============================================================
   Handels-Panel: moderne Zeilen mit Mengen-Stepper
   ============================================================ */
.trade-row {
    padding: 10px 12px;
    border: 1px solid #232c42;
    border-radius: 8px;
    background: #0f1422;
    margin-bottom: 8px;
}
.trade-row.is-illegal { border-color: rgba(217,100,90,0.4); }
.trade-row-top {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 8px; gap: 10px;
}
.trade-name { font-size: 14px; color: #e6ecf7; font-weight: 600; }
.trade-sub { font-size: 11px; color: #7f89a8; font-weight: 400; display: block; margin-top: 2px; }
.trade-price { font-family: monospace; font-size: 13px; color: #e8b45a; white-space: nowrap; }

/* Preis-Indikator */
.price-cheap { color: #5abf7f; font-size: 11px; margin-left: 4px; }
.price-dear  { color: #e5533f; font-size: 11px; margin-left: 4px; }
.price-fair  { color: #7f89a8; font-size: 11px; margin-left: 4px; }

/* Mengen-Stepper */
.trade-row-bot {
    display: flex; justify-content: space-between; align-items: center;
    gap: 8px; flex-wrap: wrap;
}
.qty-stepper {
    display: inline-flex; align-items: center;
    border: 1px solid #2f3a52; border-radius: 7px; overflow: hidden;
    background: #0a0e18;
}
.qty-btn {
    width: 28px; height: 30px; border: none; background: #1a2133;
    color: #e6ecf7; font-size: 16px; font-weight: 700; cursor: pointer;
    touch-action: manipulation; user-select: none; padding: 0;
}
.qty-btn:hover { background: #263048; }
.qty-btn:active { background: #e8b45a; color: #1a1206; }
.qty-input {
    width: 42px; height: 30px; border: none; background: transparent;
    color: #f0f4fc; text-align: center; font-family: monospace; font-size: 14px;
    border-left: 1px solid #2f3a52; border-right: 1px solid #2f3a52;
    padding: 0;
}
.qty-max {
    height: 30px; padding: 0 8px; border: none; background: #1a2133;
    color: #8593ab; font-size: 10px; cursor: pointer; border-left: 1px solid #2f3a52;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.qty-max:hover { color: #e8b45a; }
.trade-btn {
    touch-action: manipulation; white-space: nowrap;
    padding: 7px 14px; font-size: 13px;
}
.trade-btn:disabled { opacity: 0.4; cursor: not-allowed; }

@media (max-width: 520px) {
    .trade-row-bot { flex-direction: column; align-items: stretch; }
    .qty-stepper { justify-content: center; }
}

/* Lebensanzeige im HUD – übersichtlicher */
#hud-lives { display: inline-flex; align-items: center; gap: 6px; }
.lives-hearts { color: #e5533f; letter-spacing: 1px; }
.lives-empty { color: #4a5468; letter-spacing: 1px; }
.lives-count { font-family: monospace; font-size: 12px; color: #9fb0c8; }
.lives-deaths {
    font-family: monospace; font-size: 11px; color: #b0857f;
    border-left: 1px solid #2a3346; padding-left: 6px; margin-left: 2px;
}

/* ============================================================
   Marktnet – Preisübersicht auf der Schiffseite
   ============================================================ */
.marketnet-wrap { overflow-x: auto; border: 1px solid #232c42; border-radius: 8px; }
.marketnet {
    width: 100%; border-collapse: collapse; font-size: 12px;
    font-family: monospace; white-space: nowrap;
}
.marketnet th, .marketnet td {
    padding: 7px 10px; text-align: right; border-bottom: 1px solid #1a2133;
}
.marketnet thead th {
    position: sticky; top: 0; background: #131826; color: #8593ab;
    font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
}
.marketnet .mn-planet { text-align: left; color: #e6ecf7; font-family: var(--font-ui); font-weight: 600; }
.marketnet tbody tr:hover { background: rgba(138,180,232,0.05); }
.marketnet td { color: #b8c2d8; }
.marketnet .mn-cheap { color: #5abf7f; font-weight: 700; }
.marketnet .mn-dear  { color: #e5533f; font-weight: 700; }
.marketnet .mn-na { color: #4a5468; }
/* Inline-Legende oben */
.mn-cheap { color: #5abf7f; }
.mn-dear  { color: #e5533f; }

/* ============================================================
   Landing – zusätzliche Eyecatcher (Sonne, Planet, Grid, Effekte)
   ============================================================ */

/* Ferne Sonne oben rechts, mit weichem Glow & langsamem Atmen */
.landing-sun-wrap {
    position: fixed; z-index: 1; pointer-events: none;
    top: 12%; right: 14%; will-change: transform;
}
.landing-sun {
    width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle at 50% 50%,
        #fff3d0 0%, #ffe08a 22%, #ffcf6a 38%,
        rgba(240,160,60,0.5) 55%, rgba(240,160,60,0) 75%);
    filter: blur(2px);
    animation: sun-breath 7s ease-in-out infinite;
}
@keyframes sun-breath {
    0%, 100% { transform: scale(1); opacity: 0.92; }
    50%      { transform: scale(1.06); opacity: 1; }
}

/* Kleiner Planet unten links, der ganz langsam schwebt */
.landing-planet-wrap {
    position: fixed; z-index: 1; pointer-events: none;
    bottom: 10%; left: 8%; will-change: transform;
}
.landing-planet {
    position: relative;
    width: 120px; height: 120px; border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, #4f9f6a, #2f6f5a 55%, #1e4544 100%);
    box-shadow: inset -18px -12px 40px rgba(0,0,0,0.55),
                0 0 40px rgba(80,160,120,0.25);
    animation: planet-float 12s ease-in-out infinite;
}
@keyframes planet-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-18px); }
}

/* Dezentes Perspektiv-Gitter am unteren Rand (Sci-Fi-Boden) */
.landing-grid {
    position: fixed; z-index: 1; pointer-events: none;
    left: 0; right: 0; bottom: 0; height: 34vh;
    background-image:
        linear-gradient(rgba(138,180,232,0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(138,180,232,0.12) 1px, transparent 1px);
    background-size: 46px 46px;
    transform: perspective(340px) rotateX(62deg);
    transform-origin: bottom center;
    mask-image: linear-gradient(to top, rgba(0,0,0,0.7), transparent 85%);
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.7), transparent 85%);
    animation: grid-flow 6s linear infinite;
}
@keyframes grid-flow {
    from { background-position: 0 0, 0 0; }
    to   { background-position: 0 46px, 0 0; }
}

/* Titel bekommt ein sanft pulsierendes Leuchten (zusammen mit dem Einblenden) */
@keyframes title-glow {
    0%, 100% { text-shadow: 0 0 30px rgba(138,180,232,0.5), 0 0 60px rgba(80,112,156,0.3); }
    50%      { text-shadow: 0 0 42px rgba(138,180,232,0.75), 0 0 90px rgba(120,150,220,0.45); }
}

/* Buttons: sanfter Dauer-Puls beim Primär-Button, damit das Auge hingeht */
.space-landing .landing-btn.primary {
    animation: btn-pulse 2.8s ease-in-out infinite;
}
@keyframes btn-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(232,180,90,0); }
    50%      { box-shadow: 0 0 26px rgba(232,180,90,0.35); }
}

/* Tagline sanft einblenden beim Laden */
.space-landing .landing-title { opacity: 0; animation: title-glow 4s ease-in-out infinite, fade-up 1s ease-out 0.1s forwards; }
.space-landing .landing-tagline { opacity: 0; animation: fade-up 1s ease-out 0.4s forwards; }
.space-landing .landing-actions { opacity: 0; animation: fade-up 1s ease-out 0.7s forwards; }
@keyframes fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Auf kleinen Screens Sonne/Planet kleiner, damit nichts überladen wirkt */
@media (max-width: 640px) {
    .landing-sun-wrap { top: 8%; right: 8%; }
    .landing-sun { width: 130px; height: 130px; }
    .landing-planet { width: 80px; height: 80px; }
    .landing-grid { height: 26vh; }
}

/* ============================================================
   Landing – zweite Effekt-Welle (Mond, Partikel, Schiff, Scan)
   ============================================================ */

/* Parallax-Elemente brauchen will-change für flüssige Bewegung */
.landing-sun-wrap, .landing-planet-wrap, .landing-nebula { will-change: transform; }

/* Mond, der um den Planeten kreist */
.landing-moon {
    position: absolute; top: 50%; left: 50%;
    width: 16px; height: 16px; margin: -8px; border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #dfe6ef, #8b97a8 60%, #5a6472);
    box-shadow: 0 0 10px rgba(200,215,235,0.5);
    transform-origin: 8px 8px;
    animation: moon-orbit 9s linear infinite;
}
@keyframes moon-orbit {
    from { transform: rotate(0deg) translateX(96px) rotate(0deg); }
    to   { transform: rotate(360deg) translateX(96px) rotate(-360deg); }
}

/* Aufsteigender Sternenstaub */
.landing-particles {
    position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden;
}
.landing-particles .dust {
    position: absolute; border-radius: 50%;
    background: radial-gradient(circle, #ffe6bf, rgba(255,230,191,0));
    animation-name: dust-rise; animation-timing-function: linear;
    animation-iteration-count: infinite;
}
@keyframes dust-rise {
    0%   { transform: translateY(0) translateX(0); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-108vh) translateX(30px); opacity: 0; }
}

/* Fernes Raumschiff, das durchs Bild zieht */
.fly-ship {
    position: fixed; z-index: 2; pointer-events: none;
    width: 10px; height: 3px; border-radius: 2px;
    background: #cdd6e8;
    box-shadow: 0 0 8px 1px rgba(188,212,242,0.9);
    animation: ship-cross 7s linear forwards;
}
/* Schweif standardmäßig LINKS (Schiff fliegt nach rechts) */
.fly-ship::after {
    content: ''; position: absolute; top: 50%;
    width: 70px; height: 1px; transform: translateY(-50%);
    right: 100%;
    background: linear-gradient(to left, rgba(188,212,242,0.8), transparent);
}
/* Fliegt das Schiff nach LINKS, kommt der Schweif nach RECHTS */
.fly-ship.rev::after {
    right: auto; left: 100%;
    background: linear-gradient(to right, rgba(188,212,242,0.8), transparent);
}
@keyframes ship-cross {
    from { transform: translateX(0); }
    to   { transform: translateX(calc(var(--dir) * (100vw + 160px))); }
}

/* Titel-Scan: kurze Leucht-Linie fährt beim Laden einmal durch.
   Standardmäßig unsichtbar (opacity 0), damit KEIN grauer Kasten bleibt. */
.space-landing .landing-title { position: relative; }
.space-landing .landing-title::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(100deg, transparent 40%, rgba(188,212,242,0.5) 50%, transparent 60%);
    background-size: 300% 100%;
    background-position: -150% 0;
    opacity: 0;
    animation: title-scan 1.8s ease-out 0.4s 1;
    pointer-events: none; mix-blend-mode: screen;
}
@keyframes title-scan {
    0%   { background-position: -150% 0; opacity: 0; }
    15%  { opacity: 1; }
    85%  { opacity: 1; }
    100% { background-position: 250% 0; opacity: 0; }
}

/* ============================================================
   Handelswaren an Bord – Übersicht auf der Schiffseite
   ============================================================ */
.cargo-goods-wrap { overflow-x: auto; border: 1px solid #232c42; border-radius: 8px; }
.cargo-goods {
    width: 100%; border-collapse: collapse; font-size: 13px;
    font-family: var(--font-mono, monospace);
}
.cargo-goods th, .cargo-goods td {
    padding: 8px 12px; text-align: right; border-bottom: 1px solid #1a2133;
    white-space: nowrap;
}
.cargo-goods thead th {
    background: #131826; color: #8593ab;
    font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
}
.cargo-goods .cg-name { text-align: left; color: #e6ecf7; font-family: var(--font-ui); font-weight: 600; }
.cargo-goods tbody tr:hover { background: rgba(138,180,232,0.05); }
.cargo-goods td { color: #c2ccde; }
.cargo-goods .cg-dim { color: #7f89a8; }
.cargo-goods .cg-good { color: #5abf7f; font-weight: 700; }
.cargo-goods .cg-bad  { color: #e5533f; font-weight: 700; }
.cargo-goods .cg-illegal { color: #e0a050; margin-left: 4px; }
.cargo-goods tfoot td {
    border-top: 2px solid #2a3346; border-bottom: none;
    color: #e6ecf7; padding-top: 10px;
}
/* Legenden-Farben im Fließtext */
.cg-good { color: #5abf7f; }
.cg-bad  { color: #e5533f; }

/* Feste Schiffs-Kennwerte (ohne Balken) unter den Balken-Werten */
.ship-fixed {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #1a2133;
}

/* ============================================================
   Bullauge (Raumstations-Fenster) auf dem Dashboard
   ============================================================ */
.porthole-panel { display: flex; flex-direction: column; }
.porthole {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 220px;
    margin: 6px auto 0;
    border-radius: 50%;
}
/* Metallrahmen außen */
.porthole::before {
    content: '';
    position: absolute; inset: -6px;
    border-radius: 50%;
    background: conic-gradient(from 45deg,
        #3a4460, #6b7794, #2e3648, #5a6580, #3a4460, #7a86a4, #2e3648, #3a4460);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5), inset 0 0 12px rgba(0,0,0,0.4);
}
/* Glaskuppel mit Weltraum-Blick */
.porthole-glass {
    position: absolute; inset: 8px;
    border-radius: 50%;
    overflow: hidden;
    background: radial-gradient(circle at 50% 40%, #1a2740, #0a0f1c 80%);
    box-shadow: inset 0 0 30px rgba(0,0,0,0.8);
}
/* innerer Rand (Dichtung) */
.porthole-rim {
    position: absolute; inset: 4px;
    border-radius: 50%;
    border: 3px solid #10151f;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.9);
    pointer-events: none;
}
/* Sternenfeld (zwei Ebenen per Radialpunkten, driftet langsam) */
.ph-stars, .ph-nebula, .ph-planet, .ph-ship, .ph-shine {
    position: absolute; inset: 0; border-radius: 50%;
}
.ph-stars {
    background-image:
        radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent),
        radial-gradient(1px 1px at 60% 70%, #cdd6e8, transparent),
        radial-gradient(1.5px 1.5px at 80% 20%, #ffe6bf, transparent),
        radial-gradient(1px 1px at 40% 80%, #fff, transparent),
        radial-gradient(1px 1px at 75% 55%, #aebbe8, transparent),
        radial-gradient(1.5px 1.5px at 30% 60%, #fff, transparent),
        radial-gradient(1px 1px at 90% 85%, #cdd6e8, transparent),
        radial-gradient(1px 1px at 15% 90%, #ffe6bf, transparent);
    animation: ph-drift 26s linear infinite;
}
@keyframes ph-drift {
    from { transform: translateX(0); }
    to   { transform: translateX(-18px); }
}
/* farbiger Nebelschimmer, atmet */
.ph-nebula {
    background: radial-gradient(circle at 65% 35%, rgba(90,120,200,0.28), transparent 55%),
                radial-gradient(circle at 30% 70%, rgba(120,80,160,0.22), transparent 55%);
    animation: ph-breath 9s ease-in-out infinite;
}
@keyframes ph-breath {
    0%, 100% { opacity: 0.7; }
    50%      { opacity: 1; }
}
/* Planet zieht ganz langsam durchs Bild */
.ph-planet {
    background: radial-gradient(circle at 38% 34%, #4f9f6a, #2f6f5a 55%, #163a38 100%);
    width: 46px; height: 46px; inset: auto;
    top: 30%; left: -60px;
    box-shadow: inset -8px -6px 16px rgba(0,0,0,0.6), 0 0 18px rgba(80,160,120,0.25);
    animation: ph-planet-cross 40s linear infinite;
}
@keyframes ph-planet-cross {
    0%   { transform: translateX(0); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateX(320px); opacity: 0; }
}
/* kleines Schiff, das gelegentlich vorbeihuscht */
.ph-ship {
    width: 6px; height: 2px; border-radius: 1px;
    background: #cdd6e8; box-shadow: 0 0 6px 1px rgba(188,212,242,0.9);
    inset: auto; top: 62%; left: -20px;
    animation: ph-ship-cross 40s linear infinite;
    animation-delay: 8s;
}
.ph-ship::after {
    content: ''; position: absolute; top: 50%; right: 100%;
    width: 34px; height: 1px; transform: translateY(-50%);
    background: linear-gradient(to left, rgba(188,212,242,0.7), transparent);
}
@keyframes ph-ship-cross {
    0%   { transform: translateX(0); opacity: 0; }
    5%   { opacity: 1; }
    45%  { opacity: 1; }
    55%  { opacity: 0; }
    100% { transform: translateX(260px); opacity: 0; }
}
/* Glas-Reflexion oben links */
.ph-shine {
    background: linear-gradient(135deg, rgba(255,255,255,0.16), transparent 42%);
    pointer-events: none;
}
/* Nieten am Rahmen */
.porthole-bolt {
    position: absolute; width: 8px; height: 8px; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #9aa6c0, #3a4460 70%, #202838);
    box-shadow: 0 1px 2px rgba(0,0,0,0.6);
    z-index: 2;
}
.porthole-bolt.b1 { top: 4%;  left: 50%; transform: translateX(-50%); }
.porthole-bolt.b2 { bottom: 4%; left: 50%; transform: translateX(-50%); }
.porthole-bolt.b3 { left: 4%;  top: 50%; transform: translateY(-50%); }
.porthole-bolt.b4 { right: 4%; top: 50%; transform: translateY(-50%); }
