/*
  StarshipOS — Spielstatus-Panel (linker Rand)

  Fixierter, ein-/ausklappbarer Streifen. Gleiche Bauweise wie das OTS-Task-Strip
  auf der rechten Seite: aussen ein schmaler Reiter, per versteckter Checkbox
  klappt das Panel auf. Kein Layout-Reflow, weil position: fixed.
*/

.gsp {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    /* Breite waechst mit dem Inhalt: zugeklappt ist nur der Reiter da (34px),
       aufgeklappt kommt das Panel daneben. Kein :has() noetig. */
    width: auto;
    z-index: 901; /* ueber dem Stations-Blocker, damit die Gruende lesbar bleiben */
    background: var(--panel-bg, rgba(0, 10, 20, 0.96));
    border-right: 1px solid rgba(0, 229, 255, 0.3);
    display: flex;
    flex-direction: row;
    align-items: stretch;
    font-family: var(--font-mono, monospace);
}

/* Panel abgeschaltet: nichts anzeigen, aber das Polling-Element bleibt leer bestehen. */
.gsp--off {
    display: none;
}

.gsp-checkbox {
    display: none;
}

/* ── Reiter (immer sichtbar) ─────────────────────────────────────────── */

.gsp-tab {
    width: 34px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.65);
    user-select: none;
}

.gsp-tab:hover {
    color: #fff;
    background: rgba(0, 229, 255, 0.08);
}

.gsp-tab-text {
    writing-mode: vertical-rl;
    letter-spacing: 0.22em;
    font-size: 0.62rem;
    text-transform: uppercase;
}

.gsp-tab-arrow {
    font-size: 0.7rem;
}

.gsp-tab-badge,
.gsp-badge {
    display: inline-block;
    min-width: 1.15rem;
    padding: 1px 5px;
    border-radius: 3px;
    text-align: center;
    font-size: 0.62rem;
    line-height: 1.5;
    border: 1px solid transparent;
}

.gsp-badge--ok {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.55);
    color: #6ee7b7;
}

.gsp-badge--warn {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.55);
    color: #fcd34d;
}

.gsp-badge--off {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.45);
    color: #cbd5e1;
}

/* Blockierte Station: Reiter faellt auf. */
.gsp--blocked {
    border-right-color: rgba(245, 158, 11, 0.6);
}

/* ── Aufgeklapptes Panel ─────────────────────────────────────────────── */

.gsp-checkbox:checked ~ .gsp-panel {
    display: flex;
}

.gsp-panel {
    display: none;
    flex-direction: column;
    width: 296px;
    border-left: 1px solid rgba(0, 229, 255, 0.18);
}

.gsp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
    background: rgba(0, 229, 255, 0.06);
}

.gsp-title {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #e2e8f0;
}

.gsp-close {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    padding: 0 0.25rem;
}

.gsp-close:hover {
    color: #fff;
}

.gsp-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.7rem 1.5rem;
    font-size: 0.68rem;
    color: #cbd5e1;
}

/* ── Abschnitte ──────────────────────────────────────────────────────── */

.gsp-section {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.gsp-section:last-of-type {
    border-bottom: none;
}

.gsp-section-title {
    margin: 0 0 0.35rem;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7dd3fc;
}

.gsp-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1px 0;
}

.gsp-key {
    color: #94a3b8;
}

.gsp-key--sub {
    padding-left: 0.6rem;
    font-size: 0.62rem;
}

.gsp-val {
    color: #e2e8f0;
    text-align: right;
}

.gsp-mono {
    font-size: 0.64rem;
    word-break: break-all;
}

.gsp-muted {
    color: #7a8a99;
    font-size: 0.62rem;
    margin: 0.3rem 0 0;
    line-height: 1.4;
}

.gsp-text-ok { color: #6ee7b7; }
.gsp-text-warn { color: #fcd34d; }

/* ── Navigation ──────────────────────────────────────────────────────── */

.gsp-nav-portal {
    display: block;
    margin-bottom: 0.5rem;
    padding: 5px 8px;
    border: 1px solid rgba(0, 229, 255, 0.45);
    border-radius: 3px;
    background: rgba(0, 229, 255, 0.1);
    color: #e2e8f0;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
}

.gsp-nav-portal:hover {
    background: rgba(0, 229, 255, 0.2);
    color: #fff;
}

.gsp-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
}

.gsp-nav-link {
    display: block;
    padding: 4px 6px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 3px;
    color: #cbd5e1;
    font-size: 0.64rem;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gsp-nav-link:hover {
    border-color: rgba(0, 229, 255, 0.5);
    background: rgba(0, 229, 255, 0.08);
    color: #fff;
}

/* ── Blockaden ───────────────────────────────────────────────────────── */

.gsp-section--blockers {
    background: rgba(245, 158, 11, 0.06);
    border-radius: 4px;
    padding: 0.5rem;
    margin-top: 0.3rem;
}

.gsp--clear .gsp-section--blockers {
    background: rgba(16, 185, 129, 0.06);
}

.gsp-ok {
    margin: 0;
    color: #6ee7b7;
    line-height: 1.4;
}

.gsp-blocker-list {
    margin: 0;
    padding-left: 1rem;
    color: #fcd34d;
    line-height: 1.45;
}

.gsp-blocker-list li + li {
    margin-top: 0.3rem;
}

/* ── Postenliste ─────────────────────────────────────────────────────── */

.gsp-slot-list {
    list-style: none;
    margin: 0.4rem 0 0;
    padding: 0;
}

.gsp-slot {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 2px 4px;
    border-left: 2px solid transparent;
}

.gsp-slot--taken {
    border-left-color: rgba(16, 185, 129, 0.6);
}

.gsp-slot--free {
    border-left-color: rgba(148, 163, 184, 0.35);
    color: #7a8a99;
}

.gsp-slot-label {
    color: #94a3b8;
}

.gsp-slot--taken .gsp-slot-person {
    color: #e2e8f0;
}

/* ── Stationstabelle ─────────────────────────────────────────────────── */

.gsp-station-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.4rem;
}

.gsp-station-table td {
    padding: 2px 3px;
    font-size: 0.64rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.gsp-st-name { color: #cbd5e1; }
.gsp-st-ratio { text-align: right; width: 3rem; }
.gsp-st-min { text-align: right; width: 3.5rem; color: #7a8a99; }

.gsp-st--ok .gsp-st-ratio { color: #6ee7b7; }
.gsp-st--warn .gsp-st-ratio { color: #fcd34d; }

.gsp-st-essential {
    color: #7dd3fc;
    margin-left: 2px;
}

/* ── Schnellschalter ─────────────────────────────────────────────────── */

.gsp-actions {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.gsp-btn {
    flex: 1;
    padding: 4px 6px;
    font-family: inherit;
    font-size: 0.64rem;
    color: #e2e8f0;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.35);
    border-radius: 3px;
    cursor: pointer;
}

.gsp-btn:hover:not(:disabled) {
    background: rgba(0, 229, 255, 0.18);
}

.gsp-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.gsp-footnote {
    margin: 0.8rem 0 0;
    color: #64748b;
    font-size: 0.6rem;
    line-height: 1.4;
}

/* Auf schmalen Bildschirmen das Panel ueber die volle Breite legen. */
@media (max-width: 640px) {
    .gsp-panel { width: calc(100vw - 34px); }
}
