/* =========================================================
   Crew Alert – Website
   Hell: „Gerät“ (Gehäuse, Platten, eingelassene Bildschirme)
   Dunkel: Aegis (kühl, präzise, Rot nur für Knöpfe)
   Werte und Regeln siehe docs/DESIGN.md
   ========================================================= */

:root {
    /* Hell – „Gerät“ */
    --casing: #c9d1d6;
    --plate: #e4e9ec;
    --plate-edge: #ffffff;
    --plate-shadow: 0 1px 0 #00000022, 0 6px 14px -10px #1d232766;
    --ink: #1d2327;
    --mist: #5d6a72;
    --glass: #0f2a33;
    --glass-edge: #ffffff14;
    --readout: #bff3ff;
    --readlabel: #7fb3c2;
    --signal: #ff8a3d;
    --signal-hover: #ff9a57;
    --signal-ink: #1d1208;
    --nav-on: #1d2327;
    --highlight: #1d2327;   /* Hervorhebung und Fokus – nie die Signalfarbe */
    --nav-on-ink: #e4e9ec;
    --rule: #0000001a;
    --field: #f4f7f8;
    --field-line: #9aa7af;
    --disabled: #b6bfc5;
    --disabled-ink: #5d6a72;
    --ok: #1f8a4c;
    --busy: #a8690f;
    --bad: #c2412d;
    --rust: #d4572a;        /* Rostorange aus dem Logo – nur der Admin-Knopf des Streamers */
    --rust-hover: #e0683b;
    --chart: #d4572a;       /* Linien und Balken der Diagramme (Kontrast 3,3:1 auf --plate) */
    --r: 4px;

    --display: "Big Shoulders Text", "Bahnschrift", "Segoe UI", sans-serif;
    --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;

    color-scheme: light;
}

:root[data-theme="dark"] {
    /* Dunkel – Aegis */
    --casing: #1d242b;
    --plate: #262f38;
    --plate-edge: #ffffff0f;
    --plate-shadow: inset 0 0 0 1px #ffffff0f;
    --ink: #e3e8ec;
    --mist: #8796a3;
    --glass: #0d1216;
    --glass-edge: #ffffff12;
    --readout: #f2f5f7;
    --readlabel: #7d8e9b;
    --signal: #d23c32;
    --signal-hover: #e0483d;
    --signal-ink: #ffffff;
    --nav-on: #e3e8ec;
    --highlight: #e3e8ec;
    --nav-on-ink: #1d242b;
    --rule: #ffffff12;
    --field: #1a2128;
    --field-line: #3b4855;
    --disabled: #323d48;
    --disabled-ink: #8796a3;
    --ok: #4cc38a;
    --busy: #e0b341;
    --bad: #f0a33c;   /* Fehlschlag/gesperrt: orange-gelb, Rot gehört den Knöpfen */
    --chart: #e0683b;       /* Diagramme im Dunkelmodus (Kontrast 4:1 auf --plate) */
    --r: 2px;

    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
    min-height: 100vh;
    background: var(--casing);
    color: var(--ink);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.5;
}

a { color: inherit; text-decoration: underline; text-decoration-color: var(--mist); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--ink); }

h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.1; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px 48px; }

/* ---- Kopf ---- */

.head { padding: 24px 0 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.title { font-size: 38px; margin: 0; letter-spacing: 0.01em; }
.title a { text-decoration: none; display: block; line-height: 0; }
.title .logo { height: 46px; width: auto; }
.title .logo.on-dark, :root[data-theme="dark"] .title .logo.on-light { display: none; }
:root[data-theme="dark"] .title .logo.on-dark { display: block; }

/* Twitch-Knopf: Farbe von Twitch, nicht die Signalfarbe – er führt aus der Seite heraus */
.twitch {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: calc(var(--r) - 1px);
    background: #9146ff; color: #fff; font-weight: 600; font-size: 14px; text-decoration: none;
}
.twitch:hover { background: #a970ff; }
.twitch:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }

/* LIVE/OFFLINE: kleines eingelassenes Anzeigefeld wie die Bildschirme */
.live-badge {
    display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: calc(var(--r) - 1px);
    background: var(--glass); color: var(--readlabel); box-shadow: inset 0 0 0 1px var(--glass-edge), inset 0 3px 8px #00000066;
    font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: 0.06em;
}
.live-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.live-badge.is-live { color: #ff4d5e; }
.live-badge.is-live::before { opacity: 1; box-shadow: 0 0 8px currentColor; animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .live-badge.is-live::before { animation: none; } }
.subtitle { color: var(--mist); font-size: 15px; margin: 2px 0 0; }
.who { color: var(--mist); font-size: 15px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.who strong { color: var(--ink); font-weight: 600; }
.who-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }

/* Hell/Dunkel-Schalter: Kippschalter mit Sonne und Mond */
.theme-toggle {
    position: relative; display: inline-flex; align-items: center; justify-content: space-between;
    width: 64px; height: 30px; padding: 0 8px; border-radius: 15px; cursor: pointer;
    background: var(--glass); border: 0; box-shadow: inset 0 0 0 1px var(--glass-edge), inset 0 3px 8px #00000066;
    color: var(--readlabel); font-size: 14px;
}
.theme-toggle .knob {
    position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
    background: var(--plate); box-shadow: 0 1px 2px #00000066; transition: transform 0.2s ease;
}
:root[data-theme="dark"] .theme-toggle .knob { transform: translateX(34px); }
.theme-toggle:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }

nav.tabs {
    display: flex; flex-wrap: wrap; gap: 2px; width: max-content; max-width: 100%;
    margin-bottom: 20px; padding: 3px; background: var(--plate); border-radius: var(--r);
    box-shadow: var(--plate-shadow);
}
nav.tabs a { padding: 6px 13px; border-radius: calc(var(--r) - 1px); color: var(--mist); text-decoration: none; font-weight: 500; }
nav.tabs a:hover { color: var(--ink); }
nav.tabs a.active { background: var(--nav-on); color: var(--nav-on-ink); }
/* Captain etwas abgesetzt von den Spielreitern */
nav.tabs a.captain { margin-left: 14px; position: relative; }
nav.tabs a.captain::before { content: ""; position: absolute; left: -9px; top: 7px; bottom: 7px; width: 1px; background: var(--rule); }
/* Unterleiste des Captain-Bereichs: direkt unter der Hauptleiste, etwas kleiner */
nav.tabs:has(+ nav.tabs.sub) { margin-bottom: 6px; }
nav.tabs.sub { font-size: 14px; background: transparent; box-shadow: inset 0 0 0 1px var(--rule); }
nav.tabs.sub a { padding: 4px 11px; }

/* ---- Platten (Karten) ---- */

.card, .option, .slot, .podium-place, .module, .achievement {
    background: var(--plate); border-radius: var(--r);
    box-shadow: inset 0 1px 0 var(--plate-edge), var(--plate-shadow);
}
.card { position: relative; padding: 18px 20px; margin-bottom: 14px; }
.card h2 { font-size: 26px; margin: 0 0 6px; }
.card.plain { background: transparent; box-shadow: none; padding: 4px 0; }
.card.accent { box-shadow: inset 0 1px 0 var(--plate-edge), inset 3px 0 0 var(--highlight), var(--plate-shadow); }
.muted { color: var(--mist); }
.card p.report { white-space: pre-line; }   /* mehrzeilige Spielmeldungen: eine Zeile je Chatnachricht */
.card .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--ok); }

/* Aegis: obere rechte Ecke schräg abgeschnitten */
:root[data-theme="dark"] :is(.card:not(.plain), .option, .slot, .podium-place) {
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}

/* ---- Bildschirme: eingelassene Felder für wichtige Zahlen ---- */

.screen {
    margin-top: 12px; padding: 12px 14px; border-radius: calc(var(--r) - 1px);
    background: var(--glass); color: var(--readout);
    box-shadow: inset 0 0 0 1px var(--glass-edge), inset 0 10px 30px #00000066;
}
.screen.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 16px; }
.screen .k { font-size: 12px; color: var(--readlabel); }
.screen .v { font-family: var(--display); font-weight: 600; font-size: 26px; line-height: 1.1; color: var(--readout); overflow-wrap: anywhere; }
.screen .v .muted, .screen .v small { color: var(--readlabel); font-size: 0.7em; }
:root[data-theme="dark"] .screen { background-image: linear-gradient(#ffffff08 1px, transparent 1px); background-size: 100% 8px; }

/* ---- Status ---- */

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.status.green { color: var(--ok); }
.status.yellow { color: var(--busy); }
.status.red { color: var(--bad); }

.countdown { font-family: var(--display); font-weight: 600; font-size: 34px; letter-spacing: 0.02em; }
.screen .countdown { color: var(--readout); }

/* ---- Knöpfe: einzige Stelle mit der Signalfarbe (Test prüft das) ---- */

.btn { background: var(--signal); color: var(--signal-ink); }
.btn {
    display: inline-block; font-family: var(--body); font-size: 15px; font-weight: 600;
    padding: 9px 16px; border: 0; border-radius: calc(var(--r) - 1px);
    cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { background: var(--signal-hover); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--field-line); }
.btn.secondary:hover { background: var(--rule); }
.btn.rust { background: var(--rust); color: #fff; }
.btn.rust:hover, .btn.rust.active { background: var(--rust-hover); }
.btn:disabled, .btn.secondary:disabled { background: var(--disabled); color: var(--disabled-ink); box-shadow: none; cursor: not-allowed; }

form.inline { display: inline; }
.abort-form { margin-top: 12px; }

/* ---- Formularfelder ---- */

input[type=number], input[type=text], input[type=datetime-local], input[type=date], input[type=time], select {
    font-family: var(--body); font-size: 15px; padding: 8px 10px;
    background: var(--field); color: var(--ink); border: 1px solid var(--field-line); border-radius: calc(var(--r) - 1px);
}
input[type=number] { width: 160px; }
input:focus, select:focus { outline: 2px solid var(--highlight); outline-offset: 1px; }
.copy-field { width: 100%; font-size: 13px !important; }

/* Tag-Feld: Name tippen, Enter übernimmt ihn als Tag, × entfernt ihn */
.tag-field {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 5px 6px; margin-top: 8px;
    background: var(--field); border: 1px solid var(--field-line); border-radius: calc(var(--r) - 1px);
}
.tag-field:focus-within { outline: 2px solid var(--highlight); outline-offset: 1px; }
.tag-field form { display: contents; }
.tag-field input[type=text] { flex: 1; min-width: 160px; border: 0; background: transparent; padding: 4px 4px; }
.tag-field input[type=text]:focus { outline: none; }
.chip { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 600; padding: 2px 4px 2px 9px; border-radius: 3px; background: var(--rule); color: var(--ink); }
.chip button { border: 0; background: none; color: var(--mist); font-size: 17px; line-height: 1; padding: 0 4px; cursor: pointer; border-radius: 2px; }
.chip button:hover { color: var(--ink); background: var(--rule); }
.tag-field.locked { opacity: .75; }
.tag-field.locked .chip { padding-right: 9px; }
.form-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 8px; align-items: center; }
.form-grid input { width: 100%; }
.form-grid .colhead { color: var(--mist); font-size: 13px; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; margin-top: 8px; }
.check-list label { display: flex; gap: 8px; align-items: center; }
code { font-size: 0.92em; background: var(--rule); padding: 1px 5px; border-radius: 3px; }

/* ---- Meldungen ---- */

.flash {
    background: var(--plate); border-radius: var(--r); padding: 12px 16px; margin-bottom: 14px; white-space: pre-line;
    box-shadow: inset 4px 0 0 var(--busy), var(--plate-shadow);
}
.flash.ok { box-shadow: inset 4px 0 0 var(--ok), var(--plate-shadow); }

/* ---- Missionen: alle Kästen gleich hoch, Knopf immer unten ---- */

.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); grid-auto-rows: 1fr; gap: 14px; }
.option { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.option form { margin-top: auto; }
.option h3 { font-size: 22px; margin: 0 0 4px; }
.option .row { display: flex; justify-content: space-between; gap: 10px; color: var(--mist); font-size: 15px; padding: 3px 0; border-bottom: 1px dashed var(--rule); }
.option .row span:last-child { color: var(--ink); text-align: right; }
.option .btn { margin-top: 10px; }
.option.risk { box-shadow: inset 0 1px 0 var(--plate-edge), inset 0 -3px 0 var(--bad), var(--plate-shadow); }

/* ---- Tabellen ---- */

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { color: var(--mist); font-size: 13px; font-weight: 600; }
tr.current td { font-weight: 600; background: var(--rule); }
tr.done td { color: var(--mist); }
.table-scroll { overflow-x: auto; }

/* ---- Module, Komponenten ---- */

.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); grid-auto-rows: 1fr; gap: 8px; margin-top: 10px; }
.module { padding: 10px 12px; font-size: 15px; display: flex; flex-direction: column; background: var(--casing); box-shadow: inset 0 1px 3px #0000002a; }
.module .bottom { margin-top: auto; padding-top: 8px; }
.module.built { box-shadow: inset 0 0 0 2px var(--ok); }
.module .id { font-size: 13px; color: var(--mist); font-weight: 600; }

/* ---- Logbuch ---- */

.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 3px; background: var(--rule); color: var(--mist); text-decoration: none; }
a.tag:hover { color: var(--ink); }
td.good { color: var(--ok); }
td.bad { color: var(--bad); }
.logbook td { font-size: 15px; }

/* ---- Erfolge, Fortschritt ---- */

.achievements { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 10px; }
.achievement { padding: 10px 12px; background: var(--casing); box-shadow: inset 0 1px 3px #0000002a; color: var(--mist); }
.achievement.unlocked { background: var(--plate); color: var(--ink); box-shadow: inset 0 1px 0 var(--plate-edge), inset 3px 0 0 var(--ok), var(--plate-shadow); }
.achievement .name { font-family: var(--display); font-weight: 800; font-size: 19px; margin-bottom: 2px; }
.achievement .muted { font-size: 14px; }
.achievement .when { font-size: 12px; color: var(--mist); margin-top: 4px; }

.progress { height: 10px; margin-top: 8px; border-radius: 2px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-edge), inset 0 2px 4px #00000066; overflow: hidden; }
.progress > div { height: 100%; background: var(--readout); }
.progress.small { height: 6px; }
.goal-numbers { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.screen .progress { margin-top: 8px; box-shadow: inset 0 0 0 1px var(--glass-edge); background: #ffffff12; }
.ship-title { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.1; overflow-wrap: anywhere; }
.pilot-title { color: var(--mist); font-size: 14px; font-weight: 600; }

/* ---- Schiffsbilder ---- */

.shipimg {
    background: var(--glass); overflow: hidden; border-radius: calc(var(--r) - 1px);
    display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9;
    box-shadow: inset 0 0 0 1px var(--glass-edge);
}
.shipimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shipimg span { font-family: var(--display); font-weight: 600; color: var(--readlabel); font-size: 22px; }

.card.with-ship { display: flow-root; }
.shipimg.side { float: right; width: 240px; margin: 0 0 8px 18px; }

/* ---- Hangar: 4 Slots, gleich hoch, Knopf unten ---- */

.hangar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 14px; }
@media (max-width: 900px) { .hangar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .hangar { grid-template-columns: 1fr; } }
.slot { padding: 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.slot.active { box-shadow: inset 0 1px 0 var(--plate-edge), inset 0 3px 0 var(--highlight), var(--plate-shadow); }
.slot.locked { opacity: 0.8; }
.slot h3 { font-size: 21px; margin: 6px 0 0; overflow-wrap: anywhere; }
.slot-head { display: flex; justify-content: space-between; align-items: center; }
.slot .exp-line { display: flex; justify-content: space-between; gap: 8px; color: var(--mist); font-size: 15px; margin-top: 4px; }
.slot .exp-line span:last-child { color: var(--ink); text-align: right; }
.slot .screen { margin-top: 8px; padding: 8px 10px; }
.slot .due { color: var(--busy); font-size: 14px; margin: 6px 0 0; }
.slot .rename { display: flex; gap: 6px; margin-top: 8px; }
.slot .rename input { flex: 1; min-width: 0; font-size: 14px; padding: 6px 8px; }
.slot .rename .btn { padding: 6px 10px; }
.slot .bottom { margin-top: auto; padding-top: 10px; }

.due-banner { box-shadow: inset 0 1px 0 var(--plate-edge), inset 4px 0 0 var(--busy), var(--plate-shadow) !important; }

/* ---- Rangliste ---- */

.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; align-items: end; }
.podium-place { padding: 12px; text-align: center; }
.podium-place .rank { font-family: var(--display); font-weight: 800; font-size: 30px; margin-top: 8px; }
.podium-place .name { font-family: var(--display); font-weight: 600; font-size: 19px; overflow-wrap: anywhere; }
.podium-place.place-1 { order: 2; box-shadow: inset 0 1px 0 var(--plate-edge), inset 0 3px 0 var(--highlight), var(--plate-shadow); }
.podium-place.place-2 { order: 1; }
.podium-place.place-3 { order: 3; }

.foot {
    color: var(--mist); font-size: 13px; margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--rule);
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.foot a { color: var(--mist); }
.foot-main { display: flex; align-items: center; gap: 12px; }
.fan-note { font-size: 12px; opacity: 0.8; }
/* Fan-Abzeichen: Weiß verschmilzt mit dem Gehäuse (hell) bzw. wird invertiert (dunkel), gedämpft wie der übrige Fußtext */
.community-badge { flex: none; width: 96px; height: 96px; border-radius: 50%; mix-blend-mode: multiply; opacity: 0.55; }
:root[data-theme="dark"] .community-badge { filter: invert(1); mix-blend-mode: screen; }
address.imprint { font-style: normal; margin: 8px 0 12px; }

/* ---- Handy ---- */

@media (max-width: 600px) {
    .title { font-size: 30px; }
    .title .logo { height: 36px; }
    .shipimg.side { float: none; width: 100%; margin: 0 0 12px; }
    .podium { grid-template-columns: 1fr; }
    .podium-place { order: 0 !important; }
    .form-grid { grid-template-columns: 1fr 1fr !important; }
    .form-grid > * { min-width: 0; }
    /* Breite Tabellen scrollen in sich, die Seite bleibt fest */
    table { display: block; overflow-x: auto; }
    input[type=number] { width: 100%; max-width: 160px; }
    nav.tabs { width: 100%; }
}

/* ---- Kacheln (Admin-Bereich des Streamers): ganze Kachel ist der Link ---- */

.tiles { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.tile {
    display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px 18px 16px; box-sizing: border-box;
    background: var(--plate); border-radius: var(--r); box-shadow: inset 0 1px 0 var(--plate-edge), var(--plate-shadow);
    color: var(--ink); text-decoration: none; transition: transform .12s ease, box-shadow .12s ease;
}
.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: inset 0 1px 0 var(--plate-edge), inset 0 -3px 0 var(--rust), var(--plate-shadow); }
.tile:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }
.tile svg { width: 30px; height: 30px; fill: none; stroke: var(--rust); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 4px; }
.tile strong { font-family: var(--display); font-size: 24px; font-weight: 800; line-height: 1.1; }
.tile-text { color: var(--mist); font-size: 14px; flex: 1; }
.tile-meta { font-size: 13px; font-weight: 600; color: var(--mist); }
.tile-meta.good { color: var(--ok); }
.tile-badge { align-self: flex-start; font-size: 13px; font-weight: 700; color: #fff; background: var(--rust); padding: 3px 9px; border-radius: 999px; }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:hover { transform: none; } }
@media (max-width: 520px) {
    .tiles { gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tile { padding: 14px 12px 12px; }
    .tile strong { font-size: 19px; overflow-wrap: anywhere; hyphens: auto; }
    .tile-text { font-size: 13px; }
}

.today { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.today p { margin: 0; }
.today-label { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.today-what { font-size: 18px; }

/* ---- Wachstumskurve (Admin-Bereich): drei kleine Diagramme statt einer Grafik mit zwei Achsen ---- */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.growth-section { margin-bottom: 14px; }
.growth { display: grid; gap: 12px; align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.growth-panel { margin: 0; padding: 14px 16px 10px; }
.growth-head { display: flex; flex-direction: column; gap: 1px; }
.growth-label { font-size: 13px; color: var(--mist); text-transform: uppercase; letter-spacing: .06em; }
.growth-value { font-family: var(--display); font-size: 32px; font-weight: 800; line-height: 1.05; color: var(--ink); }
.growth-sub { font-size: 13px; color: var(--mist); }
.growth-chart { display: block; width: 100%; height: auto; margin-top: 8px; overflow: visible; }
.growth-line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.growth-bar { fill: var(--chart); }
.growth-dot { fill: var(--chart); stroke: var(--plate); stroke-width: 2; }
.growth-axis { stroke: var(--rule); stroke-width: 1; }
.growth-cross { stroke: var(--mist); stroke-width: 1; stroke-dasharray: 2 3; }
.growth-tick { font: 500 10px var(--body); fill: var(--mist); }
.growth-hit { fill: transparent; cursor: crosshair; }
.growth-panel { position: relative; }
/* Hinweis oben rechts in der Platte (darüber würde ihn die abgeschrägte Ecke im Dunkelmodus abschneiden) */
.growth-tip { position: absolute; top: 12px; right: 12px; max-width: calc(100% - 24px); background: var(--ink); color: var(--plate); font-size: 12px; font-weight: 600;
              padding: 4px 8px; border-radius: 4px; pointer-events: none; z-index: 2; }
.growth-table { margin-top: 8px; font-size: 14px; }
.growth-table summary { cursor: pointer; color: var(--mist); }

/* Missionslog: Zeitleiste der Browser-Mission unter dem Countdown und im Missionsbericht */
.mlog { margin-top: 16px; }
.mlog h3 { font-size: 20px; margin: 0 0 8px; }
.mlog ol { list-style: none; margin: 0; padding: 0; position: relative; }
.mlog ol::before { content: ""; position: absolute; left: 49px; top: 6px; bottom: 6px; width: 2px; background: var(--rule); }
.mlog li { display: grid; grid-template-columns: 42px 16px 1fr; gap: 0 10px; padding: 6px 0; align-items: start; }
.mlog .t { font-variant-numeric: tabular-nums; color: var(--mist); font-size: 14px; padding-top: 1px; }
.mlog .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; background: var(--plate); box-shadow: inset 0 0 0 2px var(--mist); position: relative; z-index: 1; }
.mlog li.good .dot { box-shadow: inset 0 0 0 2px var(--ok); background: var(--ok); }
.mlog li.bad .dot { box-shadow: inset 0 0 0 2px var(--bad); background: var(--bad); }
.mlog li.open .dot { box-shadow: inset 0 0 0 2px var(--busy); background: var(--busy); }
.mlog li.next .dot { background: transparent; }
.mlog .what { font-weight: 600; }
.mlog .more { color: var(--mist); font-size: 14px; }
.mlog .res { font-size: 14px; margin-top: 2px; }
.mlog .res.good { color: var(--ok); }
.mlog .res.bad { color: var(--bad); }
.mlog .sum { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--rule); display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--mist); }
.mlog .sum strong { color: var(--ink); }

/* Funkspruch-Balken oben auf jeder Seite (Browser-Mission); Rot nur auf den Knöpfen */
.radio-banner {
  margin-bottom: 14px; padding: 14px 18px; border-radius: var(--r);
  background: var(--glass); color: var(--readout);
  box-shadow: inset 0 0 0 1px var(--glass-edge), inset 4px 0 0 var(--busy), 0 6px 14px -10px #000;
}
.radio-banner .top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.radio-banner .label { font-size: 12px; color: var(--readlabel); letter-spacing: .02em; }
.radio-banner h3 { font-family: var(--display); font-weight: 800; font-size: 22px; margin: 2px 0 6px; color: var(--readout); }
.radio-banner p { margin: 0 0 10px; color: var(--readout); opacity: .9; }
.radio-banner .timer { font-family: var(--display); font-weight: 600; font-size: 22px; }
.radio-banner .choices { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-banner .btn.secondary { color: var(--readout); box-shadow: inset 0 0 0 1px var(--glass-edge); }
.radio-banner .hint { font-size: 12px; color: var(--readlabel); margin-top: 8px; }

/* Handel: Pilot, Betrag, Senden in einer Zeile (bricht schmal um) */
.send-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.send-form input[type=text] { flex: 1 1 180px; max-width: 280px; }

/* Notrufe auf der Station: je Notruf eine Zeile, Knopf rechts (bricht schmal um) */
.distress-list { display: grid; gap: 8px; }
.distress { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
            padding: 10px 12px; border-radius: var(--r); background: var(--plate); box-shadow: inset 4px 0 0 var(--bad); }

/* Rallye-Zeile im Cockpit */
.rally-line { margin: 0 0 14px; padding: 10px 14px; border-radius: var(--r); background: var(--plate); }

/* Piratenangriff: Alarm-Balken oben auf jeder Seite (wie der Funkspruch-Balken), Lebensleiste */
.pirate-banner {
  margin-bottom: 14px; padding: 14px 18px; border-radius: var(--r);
  background: var(--glass); color: var(--readout);
  box-shadow: inset 0 0 0 1px var(--glass-edge), inset 4px 0 0 var(--bad), 0 6px 14px -10px #000;
}
.pirate-banner .top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.pirate-banner .label { font-size: 12px; color: var(--readlabel); letter-spacing: .02em; }
.pirate-banner .timer { font-family: var(--display); font-weight: 600; font-size: 22px; }
.pirate-banner .actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.pirate-banner .hint { font-size: 12px; color: var(--readlabel); margin-top: 8px; }
.pirate-banner .hint a { color: var(--readout); }
.hp { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.hp-bar { flex: 1 1 200px; height: 10px; border-radius: 5px; background: var(--rule); overflow: hidden; }
.hp-bar > div { height: 100%; background: var(--bad); }
.hp-text { font-size: 14px; font-variant-numeric: tabular-nums; }

/* Großauftrag: drei Abschnitte nebeneinander (schmal untereinander), aktueller hervorgehoben */
.contract-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.contract-section { padding: 10px 12px; border-radius: var(--r); background: var(--plate); opacity: .7; }
.contract-section.current { opacity: 1; box-shadow: inset 4px 0 0 var(--busy); }
.contract-section.done { opacity: 1; }
.contract-section .what { margin-bottom: 6px; }
.small-bar { height: 8px; margin-bottom: 4px; }
.contract-section .hp-bar > div { background: var(--busy); }
.contract-section.done .hp-bar > div { background: var(--ok); }

/* Crew-Seite: Erholungs-Kacheln, Energie-/Proviantleiste */
.crew-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.crew-option { padding: 12px; border-radius: var(--r); background: var(--plate); display: flex; flex-direction: column; gap: 8px; }
.crew-option h3 { margin: 0; font-size: 18px; }
.crew-option form { margin-top: auto; }
.energy-bar > div { background: var(--ok); }

/* Wirtschaft: Zu- und Abflüsse nebeneinander (schmal untereinander) */
.economy-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.economy-columns h3 { margin: 0 0 6px; font-size: 18px; }

/* Analyse: Aktivitäts-Heatmap. Eine Farbe (Blau), hell → dunkel = wenig → viel; im Dunkelmodus umgekehrt,
   damit „wenig“ im Hintergrund verschwindet. 0 = leere Zelle in Linienfarbe. */
:root { --heat-1: #cde2fb; --heat-2: #9ec5f4; --heat-3: #6da7ec; --heat-4: #3987e5; --heat-5: #256abf; --heat-6: #184f95; }
:root[data-theme="dark"] { --heat-1: #104281; --heat-2: #1c5cab; --heat-3: #2a78d6; --heat-4: #5598e7; --heat-5: #86b6ef; --heat-6: #b7d3f6; }
.heatmaps { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.heatmap { margin: 0; }
.heatmap figcaption { margin-bottom: 6px; }
.heat-grid { display: grid; grid-template-columns: 24px repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; }
.heat-hour, .heat-day { font-size: 11px; color: var(--mist); font-variant-numeric: tabular-nums; }
.heat-hour { overflow: visible; white-space: nowrap; }   /* „12“ darf über die Spalte ragen, ohne sie breiter zu machen */
.heat-cell { display: block; aspect-ratio: 1; min-width: 0; border-radius: 2px; background: var(--rule); }
.heat-cell:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.heat-1 { background: var(--heat-1); } .heat-2 { background: var(--heat-2); } .heat-3 { background: var(--heat-3); }
.heat-4 { background: var(--heat-4); } .heat-5 { background: var(--heat-5); } .heat-6 { background: var(--heat-6); }
.heat-legend { display: flex; gap: 4px; align-items: center; margin: 10px 0; font-size: 12px; }
.heat-legend .heat-cell { width: 14px; min-width: 14px; }
.heat-tip { position: fixed; z-index: 20; pointer-events: none; padding: 4px 8px; border-radius: 4px;
            background: var(--ink); color: var(--plate); font-size: 12px; font-weight: 600; }

/* Einmalige Hinweise oben im Cockpit, wegdrückbar (gemerkt im Browser) */
.notice { position: relative; padding-right: 48px; }
.notice ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.notice-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 0; border-radius: 6px;
                background: transparent; color: var(--mist); font-size: 22px; line-height: 1; cursor: pointer; }
.notice-close:hover, .notice-close:focus-visible { color: var(--ink); background: var(--rule); }
