/* Astrellum Frontend -- Basisstile (Kapitel 11.2: mobil-first, ca. 360-430px
   Basisbreite). Farbpalette/Komponentenstile bewusst an
   planning/ui-stand-meilenstein-1-2-3-4.html angelehnt, damit das echte
   Frontend optisch am ursprünglichen Konzept-Mockup bleibt. */

:root {
  --bg: #0b0f1a;
  --panel: #131a2b;
  --panel-2: #182140;
  --border: #263252;
  --text: #e6ecff;
  --muted: #8a94b8;
  --accent: #5eb3ff;
  --good: #5ed6a0;
  --warn: #ffc75e;
  --danger: #ff6e6e;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  height: 100%;
  background: radial-gradient(ellipse at top, #141c30 0%, #05070c 70%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#app {
  height: 100%;
  /* Nutzerfeedback: "das Menue unten verschwindet wenn der Browser (Chrome
     Pixel) die Adresszeile einblendet" -- `100vh` bemisst sich am GROESSTEN
     moeglichen Viewport (Adressleiste eingeklappt); ist sie eingeblendet,
     ist der tatsaechlich sichtbare Bereich kleiner, wodurch dieser (und
     jeder darauf aufbauende `height:100vh`-Container, siehe `.app-shell`
     unten) ueber den unteren Bildschirmrand hinausragt und die Bottom-Nav
     mit aus dem sichtbaren Bereich schiebt. `100dvh` (dynamic viewport
     height) folgt der Adressleiste live -- Fallback auf `100vh` bleibt als
     vorherige Deklaration fuer Browser ohne `dvh`-Unterstuetzung stehen
     (die ignorieren die unbekannte Einheit und behalten die Zeile davor). */
  min-height: 100vh;
  min-height: 100dvh;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}
button:disabled { cursor: not-allowed; opacity: 0.55; }

.note { color: var(--muted); font-size: 0.82rem; line-height: 1.5; margin: 0 0 10px; }
.note.small { font-size: 0.7rem; }

/* --- Auth-Seite --- */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh; /* siehe Kommentar bei #app */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 60px;
  max-width: 420px;
  margin: 0 auto;
}
.auth-logo { font-size: 1.6rem; font-weight: 800; letter-spacing: 0.04em; margin-bottom: 4px; }
.auth-logo span { color: var(--accent); }
.auth-sub { font-size: 0.8rem; color: var(--muted); margin-bottom: 24px; text-align: center; }
.auth-tabs { display: flex; width: 100%; margin-bottom: 18px; background: var(--panel-2); border-radius: 10px; padding: 3px; }
.auth-tab { flex: 1; text-align: center; padding: 10px; font-size: 0.85rem; font-weight: 700; border-radius: 8px; color: var(--muted); background: none; border: none; }
.auth-tab.active { background: var(--accent); color: #061018; }
.auth-field { width: 100%; margin-bottom: 12px; }
.auth-field label { display: block; font-size: 0.72rem; color: var(--muted); margin-bottom: 4px; }
.auth-field input, .auth-field textarea {
  width: 100%; background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 0.9rem; padding: 12px 12px;
}
/* `<textarea>` bekommt ohne explizite Breite nur die Browser-Default-Breite
   (abhängig vom `cols`-Attribut, nicht von der Elternbreite) -- ohne diese
   Regel blieb das Nachrichten-Feld (messages-view.js) deutlich schmaler als
   alle anderen Formularfelder. `box-sizing: border-box` (siehe globale
   `*`-Regel) sorgt dafür, dass Padding/Border nicht zusätzlich über die
   100% hinausragen; `resize: vertical` verhindert nur, dass der Nutzer es
   breiter als das Formular ziehen kann. */
.auth-field textarea {
  resize: vertical;
  font-family: inherit;
}
.auth-checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: 0.76rem; color: var(--muted); margin-bottom: 10px; }
.auth-checkbox input { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; }
.auth-note { font-size: 0.68rem; color: var(--muted); margin-top: 16px; text-align: center; line-height: 1.6; }

/* --- Spieler-Namenssuche (spätere Überarbeitung "UX-Verbesserungen"),
   siehe components/player-search.js --- */
.player-search-field { position: relative; }
.player-search-results {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  margin-top: 4px; overflow: hidden;
}
.player-search-results:empty { display: none; }
.player-search-hit {
  display: block; width: 100%; text-align: left; padding: 10px 12px;
  background: none; border: none; color: var(--text); font-size: 0.85rem; border-bottom: 1px solid var(--border);
}
.player-search-hit:last-child { border-bottom: none; }
.player-search-hit:hover, .player-search-hit:focus { background: var(--panel-2); }
.player-search-empty { padding: 10px 12px; margin: 0; }

form { width: 100%; }

/* --- Buttons --- */
.btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--panel-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-block { width: 100%; margin-bottom: 10px; }
.btn-small { padding: 7px 12px; font-size: 0.76rem; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #061018; }
.btn-secondary { background: var(--panel-2); color: var(--text); }
.btn-danger { background: rgba(255,110,110,0.12); border-color: var(--danger); color: var(--danger); }

/* --- App-Shell (eingeloggter Bereich) --- */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* siehe Kommentar bei #app -- behebt die verschwindende Bottom-Nav */
}

.resource-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 14px 12px;
  background: linear-gradient(180deg, #10182c 0%, #0d1425 100%);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.resource-bar-empty { color: var(--muted); font-size: 0.8rem; text-align: center; }
.res-item { display: flex; align-items: center; gap: 5px; font-size: 0.74rem; color: var(--text); font-variant-numeric: tabular-nums; }
.res-item.metal svg { color: #9fb4d6; }
.res-item.crystal svg { color: #b98aff; }
.res-item.tritium svg { color: #5ed6a0; }
.res-item.energy svg { color: var(--warn); }
.res-item.energy.deficit { color: var(--danger); }
.res-item.energy.deficit svg { color: var(--danger); }

.screen {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 24px;
}

.bottom-nav {
  display: flex;
  flex-shrink: 0;
  background: #0d1425;
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 4px 8px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  min-height: 48px;
}
.nav-item:hover { text-decoration: none; }
.nav-item.active { color: var(--accent); }
.nav-item svg { color: inherit; }

/* Nutzerfeedback: "Bei Querformat oder Desktop Ansicht, soll anstelle des
   Menüpunkt 'Mehr' alle Menüpunkte angezeigt werden" -- Basiszustand
   (Hochformat-Handy, nach wie vor der Default): die bisher nur im
   "Mehr"-Hub versteckten Punkte bleiben ausgeblendet, der "Mehr"-Button
   bündelt sie wie gehabt. Das eigentliche Umschalten auf "alle Punkte
   direkt sichtbar" passiert in css/desktop.css (siehe dort) -- diese Datei
   ist laut Kapitel 11.1 explizit fuer sämtliche Breakpoint-/
   Desktop-Anpassungen vorgesehen, main.css bleibt rein mobil-first. Siehe
   components/bottom-nav.js für die (einzige) Quelle der Eintrags-Liste. */
.nav-item-extended { display: none; }

/* --- Karten / Listen --- */
.page-wrap { max-width: 480px; margin: 0 auto; padding: 20px 4px 40px; }
h1 { font-size: 1.2rem; margin: 4px 0 6px; }
.section-title { font-size: 1rem; margin: 4px 0 14px; }

.planet-hero { display: flex; flex-direction: column; align-items: center; margin-bottom: 14px; text-align: center; }
.planet-hero-canvas { border-radius: 50%; margin-bottom: 8px; box-shadow: 0 0 24px rgba(90, 140, 255, 0.25); }
.planet-icon { color: var(--accent); margin-bottom: 6px; }
.planet-name { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 6px; justify-content: center; }
.planet-coords { font-size: 0.74rem; color: var(--muted); }
/* Nutzerfeedback: Tritium-Temperaturbonus neben der Temperatur -- kälter
   ist gut (mehr Tritium, siehe Balancing.temperature_tritium_modifier). */
.planet-coords .temp-bonus-good { color: var(--good); }
.planet-coords .temp-bonus-bad { color: var(--danger); }
.icon-btn {
  background: none; border: none; padding: 2px; color: var(--muted); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; border-radius: 6px;
}
.icon-btn:hover { color: var(--accent); }
.planet-rename-form { display: flex; align-items: center; gap: 6px; width: 100%; max-width: 280px; }
.planet-rename-form input {
  flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 0.95rem; font-weight: 700; padding: 6px 8px;
}
.planet-rename-actions { display: flex; gap: 4px; }
.planet-rename-actions .btn-small { padding: 6px 10px; }

/* --- Planeten-Umschalter mit Miniatur-Vorschau (spätere Überarbeitung
   "UX-Verbesserungen"), siehe views/planet-view.js --- */
.planet-switcher { position: relative; width: 100%; margin-bottom: 14px; }
.planet-switcher-toggle {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 8px 10px;
}
.planet-switcher-chevron { margin-left: auto; color: var(--muted); }
.planet-switcher-thumb { flex-shrink: 0; width: 32px; height: 32px; display: block; }
.planet-switcher-thumb canvas { display: block; border-radius: 50%; }
.planet-switcher-option-info { display: flex; flex-direction: column; min-width: 0; }
.planet-switcher-option-info .name { font-size: 0.85rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planet-switcher-option-info .sub { font-size: 0.7rem; color: var(--muted); }
.planet-switcher-menu {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: 4px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  max-height: 300px; overflow-y: auto;
}
.planet-switcher-option {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  background: none; border: none; border-bottom: 1px solid var(--border); color: var(--text); padding: 8px 10px;
}
.planet-switcher-option:last-child { border-bottom: none; }
.planet-switcher-option:hover, .planet-switcher-option:focus { background: var(--panel-2); }
.planet-switcher-option.active { box-shadow: inset 2px 0 0 var(--accent); }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.card-title { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 10px; display: flex; justify-content: space-between; }

.build-progress { display: flex; align-items: center; gap: 12px; }
.build-progress svg { color: var(--accent); flex-shrink: 0; }
.build-progress .info { flex: 1; }
.build-progress .name { font-size: 0.86rem; font-weight: 600; }
.build-progress .timer { font-size: 0.78rem; color: var(--warn); font-variant-numeric: tabular-nums; }
.no-build { font-size: 0.8rem; color: var(--muted); text-align: center; padding: 4px 0; }

.storage-row { margin-bottom: 10px; }
.storage-row .label-row { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--muted); margin-bottom: 4px; }

/* Produktions-Karte (Planeten-Übersicht, siehe views/planet-view.js
   renderProductionCard) -- Nutzerfeedback: "keine Anzeige, wie viel
   produziert wird" / "was passiert bei -1 Energie". */
.production-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8rem; padding: 5px 0; gap: 10px;
}
.production-row + .production-row { border-top: 1px solid var(--border); }
.production-row svg { vertical-align: -3px; margin-right: 4px; color: var(--accent); }
.production-row .energy-deficit { color: var(--danger); font-weight: 600; }
.production-warning {
  margin: 8px 0 0; padding: 8px 10px; border-radius: 8px;
  background: rgba(255, 110, 110, 0.1); border: 1px solid var(--danger);
  color: var(--text); font-size: 0.72rem; line-height: 1.5;
}
/* Frühwarnung vor ankommenden Angriffsflotten (Planeten-Übersicht, siehe
   views/planet-view.js renderIncomingAttackBanner) -- Nutzerfeedback: "eine
   Info wenn man angegriffen wird und wann die feindliche Flotte eintrifft".
   Bewusst auffälliger als `.production-warning` (dickerer Rand, eigene
   Icon-Farbe), da hier sofortiges Handeln (Verteidigung ausbauen/Flotte in
   Sicherheit bringen) gefragt sein kann. */
.incoming-attack-banner {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid var(--danger); background: rgba(255, 110, 110, 0.12);
}
.incoming-attack-banner svg { color: var(--danger); flex-shrink: 0; }
.incoming-attack-banner .name { font-size: 0.86rem; font-weight: 700; color: var(--danger); }
.incoming-attack-banner .sub { font-size: 0.78rem; color: var(--text); margin-top: 2px; font-variant-numeric: tabular-nums; }
.incoming-attack-elsewhere { color: var(--danger); }

/* Nutzerfeedback: "es fehlt eine Benachrichtigung im Hauptbild über neue
   Nachrichten" -- klickbares Banner im Akzent-Ton (keine Bedrohung wie beim
   Angriffs-Banner oben, daher bewusst nicht rot). */
.unread-messages-banner {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  border: 2px solid var(--accent); background: rgba(94, 179, 255, 0.1);
}
.unread-messages-banner svg { color: var(--accent); flex-shrink: 0; }
.unread-messages-banner .name { font-size: 0.86rem; font-weight: 700; color: var(--accent); }
.unread-messages-banner .sub { font-size: 0.78rem; color: var(--text); margin-top: 2px; }

.storage-track { height: 7px; background: #1a2338; border-radius: 4px; overflow: hidden; }
.storage-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.storage-fill.metal { background: #9fb4d6; }
.storage-fill.crystal { background: #b98aff; }
.storage-fill.tritium { background: #5ed6a0; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s; }

.list-row {
  display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
}
.list-row.locked { opacity: 0.6; }
.list-row svg { color: var(--accent); flex-shrink: 0; }
.list-row .info { flex: 1; min-width: 0; }
.list-row .name { font-size: 0.86rem; font-weight: 600; }
.list-row .sub { font-size: 0.72rem; color: var(--muted); margin-top: 3px; }
.list-row .sub.effect { color: var(--good); }
/* Kosten-/Dauer-Zeile als umbrechende Reihe ganzer "12.345 Metall"-Einheiten
   statt eines einzelnen Fließtext-Satzes (Nutzerfeedback: auf schmalen
   Mobil-Breiten brach der Satz sonst faktisch nach jedem einzelnen Wort um,
   weil `white-space: normal` jedes Leerzeichen als moeglichen Umbruchpunkt
   behandelt). `.cost-chip` haelt jede Einheit (Zahl + Ressourcenname bzw.
   Zeit) mit `white-space: nowrap` zusammen -- bricht die Zeile doch um,
   dann immer zwischen ganzen Einheiten, nie mitten im Wort. */
.list-row .sub.cost-line { display: flex; flex-wrap: wrap; gap: 3px 10px; }
.cost-chip { white-space: nowrap; }
/* Aktuelle Produktions-/Energiebilanz je Gebäude (siehe
   views/buildings-view.js renderCurrentOutputLine) -- optisch von der
   Kosten-/Dauer-Zeile darunter abgesetzt (grün statt gedämpft), Energie-
   Verbrauch (negativ) sticht zusätzlich rot hervor. */
.list-row .sub.current-output { color: var(--good); }
.list-row .sub.current-output .cost-chip.energy-deficit { color: var(--danger); }
.level-badge { font-size: 0.66rem; color: var(--muted); font-weight: 500; margin-left: 4px; }
/* `flex-shrink: 0` allein reicht nicht: ohne eine harte Obergrenze durfte
   dieses Element so breit werden, wie sein Inhalt "am liebsten" wäre --
   und genau das sprengte bei Forschungen mit mehreren offenen
   Voraussetzungen (z. B. "Benötigt: Lasertechnik Stufe 10, Ionentechnik
   Stufe 5, Energietechnik Stufe X") die Zeile: `.info` (flex:1,
   min-width:0) wurde auf nahezu 0px zusammengequetscht, wodurch dort
   praktisch jedes einzelne Wort umbrach (Nutzerfeedback/Screenshot).
   `max-width` deckelt `.action` unabhängig von flex-shrink, damit `.info`
   immer einen nutzbaren Mindestanteil der Zeile behält. */
.list-row .action { flex-shrink: 0; max-width: 50%; text-align: right; }
.list-row .timer { font-size: 0.78rem; color: var(--warn); font-variant-numeric: tabular-nums; }
/* Abbrechen-Button unter dem Countdown (Nutzerfeedback: "es fehlt noch ein
   Abbruch-Button für Bau, Forschung und Schiffswerft") -- etwas Abstand zum
   Timer darüber, damit beides nicht zusammenklebt. */
.list-row .action .btn-cancel { margin-top: 6px; }
.req-missing {
  font-size: 0.68rem; color: var(--muted); display: flex; flex-wrap: wrap;
  align-items: flex-start; justify-content: flex-end; gap: 4px; text-align: left;
}
/* Nutzerfeedback: Zeilenumbruch statt Komma zwischen mehreren fehlenden
   Voraussetzungen ("Benötigt: X Stufe 10<br>Y Stufe 5..."). Der Text steckt
   bewusst in einem eigenen, NICHT-flex Kindelement -- <br> innerhalb eines
   flex-Containers selbst wird von Browsern nicht zuverlässig als Zeilenumbruch
   behandelt, in einem normalen Block/Inline-Element dagegen schon. */
.req-missing-text { display: block; }

/* --- Welt-Auswahl --- */
.world-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.world-card-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.92rem; }
.pill { background: var(--panel-2); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; font-size: 0.64rem; color: var(--muted); text-transform: uppercase; }
.world-card-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.72rem; color: var(--muted); margin-bottom: 8px; }
.world-runtime { display: flex; align-items: center; gap: 5px; font-size: 0.7rem; color: var(--warn); margin-bottom: 8px; }
.world-card-actions { display: flex; justify-content: flex-end; }

/* --- Rechtstexte --- */
.legal-page { padding-top: 30px; }
.back-link { display: inline-block; margin-bottom: 16px; font-size: 0.82rem; }
.legal-draft-badge {
  background: rgba(255, 199, 94, 0.12); border: 1px solid var(--warn); color: var(--warn);
  border-radius: 10px; padding: 10px 12px; font-size: 0.74rem; margin-bottom: 16px;
}
.legal-markdown h1 { font-size: 1.15rem; }
.legal-markdown h2 { font-size: 0.95rem; margin-top: 20px; color: var(--accent); }
.legal-markdown p, .legal-markdown li { font-size: 0.82rem; line-height: 1.6; color: var(--text); }
.legal-markdown blockquote {
  border-left: 3px solid var(--warn); margin: 0 0 14px; padding: 8px 12px; background: rgba(255,199,94,0.08);
  font-size: 0.78rem; color: var(--warn);
}
.legal-markdown ul { padding-left: 20px; }

/* --- Sub-Tabs (Ausbau/Flotte/Berichte, Frontend-Meilenstein F3-F5) --- */
.sub-tabs { display: flex; gap: 6px; margin-bottom: 14px; background: var(--panel-2); border-radius: 10px; padding: 3px; }
.sub-tab { flex: 1; text-align: center; padding: 8px 4px; font-size: 0.74rem; font-weight: 700; border-radius: 8px; color: var(--muted); background: none; border: none; }
.sub-tab.active { background: var(--accent); color: #061018; }

/* --- Werft / Flotte --- */
.qty-input { width: 56px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 6px; font-size: 0.78rem; text-align: center; margin-right: 6px; }
.unit-action { display: flex; align-items: center; gap: 4px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper-btn { width: 30px; height: 30px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font-size: 1rem; font-weight: 700; }
.stepper .qty-input { margin-right: 0; width: 46px; }

/* --- Wizard (Kapitel 11.3) --- */
.wizard-steps { display: flex; align-items: center; margin-bottom: 18px; }
.wizard-step { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.wizard-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); display: block; }
.wizard-step.active .wizard-dot { background: var(--accent); }
.wizard-step.done .wizard-dot { background: var(--good); }
.wizard-step-label { font-size: 0.58rem; color: var(--muted); text-align: center; }
.wizard-step.active .wizard-step-label { color: var(--accent); font-weight: 700; }
.wizard-connector { flex: 0.6; height: 1px; background: var(--border); margin-bottom: 16px; }
.wizard-body { min-height: 120px; margin-bottom: 16px; }
.wizard-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wizard-nav .btn { flex: 1; }

/* Nutzerfeedback: "Beim Flotte senden sollte eine Vorschau für den
   benötigten Treibstoff angezeigt werden, nicht erst nach dem senden." --
   siehe views/fleet-view.js::refreshFuelPreview. */
.fuel-preview-box { margin-top: 10px; padding: 10px 14px; }
.fuel-preview-box p { margin: 0; }
.fuel-preview-box p + p { margin-top: 4px; }
.fuel-preview-warning { color: var(--danger); font-weight: 700; }

.mission-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mission-choice {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 0.76rem; font-weight: 600;
}
.mission-choice.active { border-color: var(--accent); color: var(--accent); }
.mission-choice:disabled { opacity: 0.45; }

.target-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.target-fields .auth-field { min-width: 0; }
.target-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.target-chip { background: var(--panel-2); border: 1px solid var(--border); color: var(--accent); }

/* --- Galaxie --- */
.galaxy-form { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 14px; }
.galaxy-form .auth-field { flex: 1; margin-bottom: 0; }
.galaxy-form .btn { flex-shrink: 0; }
.note-inline { color: var(--muted); }

/* Sternkarte (Kapitel 5.9/11): ein Punkt pro tatsächlich existierendem
   Planeten auf dem system_grid_size x system_grid_size-Koordinatenraster
   (Standard 100x100) -- der ganz überwiegende Rest bleibt echter leerer
   Raum. Bewusst KEINE Spielernamen auf der Karte selbst; Details erscheinen
   erst im Panel unterhalb nach Antippen eines Punktes. Farbe = Temperatur
   (siehe components/planet-canvas.js tempPalette), Grau = unerforscht,
   Blau mit Ring = eigener Planet. */
.starmap-wrap {
  display: flex; justify-content: center; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; padding: 8px; margin-bottom: 10px;
}
.starmap-canvas { border-radius: 8px; max-width: 100%; touch-action: manipulation; cursor: pointer; }
.starmap-legend {
  display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.68rem; color: var(--muted);
  margin-bottom: 14px;
}
.starmap-legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.starmap-detail-card { display: flex; flex-direction: column; }
.starmap-mode-tabs { margin-bottom: 10px; }

/* Listen-Ansicht (Nachtrag): dieselben Planeten wie auf der Karte, aber als
   normal große, garantiert treffsichere Zeilen -- Fallback für kleine
   Bildschirme/ungenaue Tipp-Gesten, wo einzelne Punkte auf der Karte zu
   dicht beieinander liegen koennten. */
.starmap-list { max-height: 420px; overflow-y: auto; margin-bottom: 10px; }
.starmap-list-row {
  width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; color: inherit; font-family: inherit; margin-bottom: 6px;
}
.starmap-list-row.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.starmap-list-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

/* --- Ranglisten --- */
.type-select {
  width: 100%; background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 0.85rem; padding: 10px 12px; margin-bottom: 14px;
}

/* --- Allianz --- */
.alliance-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.alliance-actions .btn { width: auto; }

/* --- Nachrichten --- */
.message-row { cursor: pointer; }
.message-row.unread .name { font-weight: 800; }
.message-row .message-checkbox { flex-shrink: 0; width: 18px; height: 18px; accent-color: var(--accent); }
#message-detail:empty { display: none; }
/* Nutzerfeedback: "Es fehlt eine Möglichkeit auf Nachrichten zu antworten
   (Antworten button)" -- Antworten- und Löschen-Button nebeneinander statt
   volle Breite (wie schon bei .planet-rename-actions). */
.message-detail-actions { display: flex; gap: 8px; margin-top: 4px; }
.message-detail-actions .btn { width: auto; }
/* Sammel-Aktionsleiste (Nutzerfeedback: "es fehlt eine Möglichkeit mehrere
   Nachrichten gleichzeitig zu löschen oder als gelesen zu markieren"). */
.bulk-action-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; padding: 8px 12px; margin-bottom: 8px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 10px; font-size: 0.78rem;
}
.bulk-select-all { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.bulk-select-all input { accent-color: var(--accent); }
.bulk-action-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.bulk-action-buttons .btn { width: auto; }

/* --- Berichte --- */
.round-row { font-size: 0.74rem; color: var(--muted); line-height: 1.7; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }

/* --- Toast --- */
.toast {
  position: fixed; left: 50%; bottom: 76px; transform: translate(-50%, 20px);
  max-width: 90vw; background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 10px 16px; border-radius: 10px; font-size: 0.8rem; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; z-index: 100; text-align: center;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.toast-error { border-color: var(--danger); }
.toast.toast-success { border-color: var(--good); }

/* --- Konto: Spielername/E-Mail ändern (Nutzerfeedback: "Im Konto fehlt
   eine Möglichkeit seinen Spielernamen oder Email zu ändern") --
   `.planet-rename-form` (planet-view.js) ist für EIN Eingabefeld in einer
   Zeile ausgelegt; hier kommen zwei Felder (Wert + aktuelles Passwort)
   dazu, deshalb ein eigenes, gestapeltes Layout statt der Flex-Zeile. */
#username-form.planet-rename-form,
#email-form.planet-rename-form {
  flex-direction: column;
  align-items: stretch;
  max-width: none;
}
#username-form.planet-rename-form input,
#email-form.planet-rename-form input {
  font-weight: 400;
}

/* --- Wiki (Nutzerfeedback: "wir benötigen ein Wiki, dass alle Stats
   anzeigt ... so dass der Spieler sich ausrechnen kann was ihn die
   nächste Stufe an Energie kostet und Produktion bringt") --
   Annahmen-Leiste (Welt-Speed/Gebäudestufen/Techstufen) + je Karte ein
   Zielstufen-/Stückzahl-Eingabefeld, siehe views/wiki-view.js. */
.wiki-assumptions-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 6px;
}
.wiki-assumption {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 0.74rem; color: var(--muted);
}
.wiki-assumption input {
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); padding: 4px 6px; font-size: 0.85rem;
}
.wiki-level-label {
  display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--muted);
  margin-bottom: 6px;
}
.wiki-level-label input {
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); padding: 4px 6px; font-size: 0.9rem; font-weight: 700;
}
