/* Okeanos-Reisetool – Gestaltung */

:root {
  --meer-tief: #0a1419;
  --flaeche: #12232b;
  --flaeche-2: #182e38;
  --flaeche-3: #1f3a46;
  --linie: #2b4855;
  --text: #e8e2d2;
  --text-leise: #9db0b4;
  --messing: #d8aa4e;
  --messing-hell: #f0c66e;
  --tuerkis: #6ee0ea;
  --warnung: #f08a5d;
  --gut: #8fd18b;
  --radius: 8px;
  --schrift: "Segoe UI", system-ui, -apple-system, sans-serif;
  --schrift-titel: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--meer-tief);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 14px;
  line-height: 1.45;
}

button, input, select { font: inherit; color: inherit; }

[hidden] { display: none !important; }

/* ---------- Karte ---------- */

.karten-leinwand {
  display: block;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.karten-leinwand.zieht { cursor: grabbing !important; }

/* ---------- DM-Ansicht: Aufbau ---------- */

body.dm {
  display: flex;
  overflow: hidden;
}

.kartenbereich {
  position: relative;
  flex: 1;
  min-width: 0;
}

#karte {
  position: absolute;
  inset: 0;
}

.seitenleiste {
  width: 370px;
  flex: 0 0 370px;
  height: 100%;
  overflow-y: auto;
  background: var(--flaeche);
  border-left: 1px solid var(--linie);
  display: flex;
  flex-direction: column;
}
body.leiste-zu .seitenleiste { display: none; }

.kopf {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--linie);
  background: linear-gradient(180deg, #17303b 0%, var(--flaeche) 100%);
}
.kopf h1 {
  margin: 0;
  font-family: var(--schrift-titel);
  font-size: 26px;
  font-weight: normal;
  letter-spacing: 0.06em;
  color: var(--messing-hell);
}
.kopf .unterzeile {
  color: var(--text-leise);
  font-size: 13px;
}

.abschnitt {
  padding: 16px 20px;
  border-bottom: 1px solid var(--linie);
}
.abschnitt h2 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--messing);
}
.abschnitt h3 {
  margin: 14px 0 6px;
  font-size: 14px;
  font-weight: 600;
}
.abschnitt h3:first-of-type { margin-top: 0; }

.leise { color: var(--text-leise); font-size: 13px; }
.info { margin: 0 0 10px; }
.info strong { color: var(--text); font-weight: 600; }

.fuss {
  margin-top: auto;
  padding: 14px 20px;
  color: var(--text-leise);
  font-size: 12px;
}

/* ---------- Bedienelemente ---------- */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--flaeche-3);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.knopf:hover:not(:disabled) { background: #28495a; border-color: #3d6475; }
.knopf:disabled { opacity: 0.45; cursor: default; }
.knopf.haupt { background: #8a6a2a; border-color: var(--messing); color: #fff8e6; }
.knopf.haupt:hover:not(:disabled) { background: #a07b31; }
.knopf.klein { padding: 3px 9px; }
.knopf.breit { width: 100%; }

.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; }

.umschalter {
  display: flex;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
}
.umschalter button {
  flex: 1;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text-leise);
}
.umschalter button + button { border-left: 1px solid var(--linie); }
.umschalter button.aktiv { background: var(--flaeche-3); color: var(--text); box-shadow: inset 0 -2px 0 var(--messing); }

.haken {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 12px;
  cursor: pointer;
}
.haken input { width: 16px; height: 16px; accent-color: var(--messing); }

.kasten {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--flaeche-2);
}
.kasten.hervor { border-color: var(--tuerkis); }

.feld { display: block; margin-bottom: 10px; }
.feld > span { display: block; margin-bottom: 4px; font-size: 13px; color: var(--text-leise); }
.eingabe {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--linie);
  border-radius: 6px;
  background: var(--meer-tief);
}
.eingabe:focus { outline: 2px solid var(--messing); outline-offset: -1px; }

.wahl { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.wahl label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.wahl input { accent-color: var(--messing); }

.feinzeile {
  display: grid;
  grid-template-columns: 1fr auto 92px auto;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.feinzeile .eingabe { text-align: right; padding: 4px 6px; }

details.fein { margin-top: 12px; }
details.fein summary { cursor: pointer; color: var(--text-leise); }
details.fein[open] summary { margin-bottom: 10px; color: var(--text); }

.meldung { margin: 8px 0 0; font-size: 13px; }
.meldung.warnung { color: var(--warnung); }
.meldung.gut { color: var(--gut); }

/* ---------- Schwebende Elemente über der Karte ---------- */

.hinweis {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(640px, calc(100% - 140px));
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--tuerkis);
  border-radius: var(--radius);
  background: rgba(10, 20, 25, 0.94);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  z-index: 5;
}

.statusleiste {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(10, 20, 25, 0.85);
  color: var(--text-leise);
  font-size: 13px;
  pointer-events: none;
  z-index: 4;
}
.statusleiste b { color: var(--text); font-weight: 600; }

.zoomknoepfe {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 4;
}
.rundknopf {
  width: 38px;
  height: 38px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: rgba(18, 35, 43, 0.92);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.rundknopf:hover { background: var(--flaeche-3); }

.leistenknopf {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
}

.zoomanzeige {
  text-align: center;
  font-size: 11px;
  color: var(--text-leise);
  background: rgba(10, 20, 25, 0.85);
  border-radius: 6px;
  padding: 2px 0;
}

/* ---------- Werkzeugleiste, Uhr und Meldungen über der Karte ---------- */

.werkzeugleiste {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: calc(100% - 80px);
  z-index: 4;
}
.umschalter.klein { margin: 0; background: rgba(18, 35, 43, 0.92); }
.umschalter.klein button { padding: 5px 10px; font-size: 13px; }
.schalter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: rgba(18, 35, 43, 0.92);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.schalter input { accent-color: var(--messing); margin: 0; }

.uhrleiste {
  position: absolute;
  left: 12px;
  bottom: 50px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(10, 20, 25, 0.85);
  color: var(--messing-hell);
  font-family: var(--schrift-titel);
  font-size: 16px;
  pointer-events: none;
  z-index: 4;
}
.uhrleiste .laeuft { color: var(--gut); font-family: var(--schrift); font-size: 12px; }

.meldungen {
  position: absolute;
  top: 116px;
  right: 60px;
  width: min(340px, calc(100% - 80px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 6;
  pointer-events: none;
}
.meldungskarte {
  position: relative;
  padding: 10px 34px 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--linie);
  background: rgba(14, 28, 34, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  animation: einblenden 0.25s ease-out;
}
.meldungskarte.warnung { border-color: #e0a24a; background: rgba(48, 36, 14, 0.96); }
.meldungskarte.alarm { border-color: #ff6a50; background: rgba(70, 20, 14, 0.97); }
.meldung-zu {
  position: absolute;
  top: 6px;
  right: 6px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text-leise);
  font-size: 14px;
}
@keyframes einblenden { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Reiter in der Seitenleiste ---------- */

.reiter {
  display: flex;
  border-bottom: 1px solid var(--linie);
  background: var(--flaeche);
  position: sticky;
  top: 0;
  z-index: 2;
}
.reiter button {
  flex: 1;
  padding: 10px 4px;
  border: 0;
  background: transparent;
  color: var(--text-leise);
  cursor: pointer;
  font-size: 13px;
}
.reiter button.aktiv { color: var(--text); box-shadow: inset 0 -2px 0 var(--messing); }
.reiter button:hover { color: var(--text); }

/* ---------- Felder ---------- */

.feldzeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.feldzeile > span:first-child { color: var(--text-leise); font-size: 13px; }
.eingabe.zahl { width: 76px; text-align: right; }
.eingabe.schmal { width: auto; min-width: 140px; }
.eingabe.zeit { width: 110px; }
.zaehler { display: flex; align-items: center; gap: 4px; }
.zaehler .eingabe.zahl { width: 56px; text-align: center; }
.regler { width: 100%; accent-color: var(--messing); }
.einrueck { margin: -8px 0 10px 24px; }
.knopfreihe.rechts { justify-content: flex-end; margin-top: 14px; }
.knopf.gross { padding: 9px 18px; font-size: 15px; }
.knopf.gefahr { border-color: #8a3a2a; }
.knopf.gefahr:hover:not(:disabled) { background: #5a2218; }
.knopf.umschaltknopf.aktiv { background: #2b5466; border-color: var(--tuerkis); color: #fff; }
.abschnitt .knopfreihe + .knopfreihe, .abschnitt .knopf.breit + .leise { margin-top: 8px; }
.abschnitt > .knopf.breit { margin-bottom: 8px; }
.klein { font-size: 12px; }

.uhrgross {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-family: var(--schrift-titel);
  font-size: 21px;
  color: var(--messing-hell);
}
.abzeichen {
  padding: 2px 10px;
  border-radius: 999px;
  font-family: var(--schrift);
  font-size: 12px;
  border: 1px solid var(--linie);
}
.abzeichen.tag { color: #ffe08a; border-color: #7a6630; }
.abzeichen.nacht { color: #a9b8ff; border-color: #3d4a85; background: #141a38; }

.windkasten { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--linie); border-radius: var(--radius); background: var(--flaeche-2); }
.windkasten .feldzeile { margin-bottom: 4px; }
.windtitel { font-size: 13px; color: var(--text-leise); margin-bottom: 6px; }
.nichtumbrechen { white-space: nowrap; flex-shrink: 0; }
.windkasten p { margin: 4px 0 0; }
.alarm {
  margin: 8px 0 0;
  padding: 6px 10px;
  border-radius: 6px;
  background: #5a1d14;
  border: 1px solid #ff6a50;
  color: #ffd6cc;
  font-weight: 600;
}

.planzeile { line-height: 1.7; }
.planzeile b { color: var(--messing-hell); font-weight: 600; }
.warntext { color: var(--warnung); }
.tabellenrahmen { overflow-x: auto; }
.plantabelle { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.plantabelle th, .plantabelle td { padding: 4px 3px; border-bottom: 1px solid var(--linie); text-align: left; white-space: nowrap; }
.plantabelle th { color: var(--text-leise); font-weight: 600; }
.plantabelle .r { text-align: right; }
.plantabelle tr.rueck td { color: #ff9f86; }
.farbpunkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }

.ereignisliste { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; }
.ereignisliste li { padding: 4px 0; border-bottom: 1px dashed var(--linie); }
.ereignisliste li b { color: var(--text-leise); font-weight: 600; margin-right: 4px; }
.logbuch { max-height: 380px; overflow-y: auto; margin-bottom: 10px; }
.logbuch li.warnung { color: #f0c27a; }
.logbuch li.alarm { color: #ff9f86; }

.fahrtstatus { margin-top: 10px; }
.fahrtstatus .tempo { font-size: 22px; font-weight: 600; font-family: var(--schrift-titel); }
.fahrtstatus .tempo.gut { color: var(--gut); }
.fahrtstatus .tempo.schlecht { color: #ff8a6a; }
.fahrtstatus .tempo.neutral { color: var(--text); }
.gut { color: var(--gut); }

.zonenzeile {
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--flaeche-2);
}
.zonenzeile.aussen { border-style: dashed; }
.zonenkopf { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.zonenkopf .eingabe { flex: 1; min-width: 0; padding: 4px 6px; }
input[type="color"] { width: 30px; height: 28px; padding: 0; border: 1px solid var(--linie); border-radius: 6px; background: transparent; cursor: pointer; }
.zonenwerte { display: flex; gap: 8px; justify-content: space-between; }
.zonenwerte label { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-leise); }
.zonenwerte .eingabe.zahl { width: 58px; padding: 3px 5px; }

.bootkarte {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--flaeche-2);
}
.bootvorschau { flex: 0 0 72px; width: 72px; height: 72px; border-radius: 6px; background: #1d3a47; }
.bootfelder { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bootfelder .feldzeile { margin: 0; }
.bootfelder .knopfreihe { gap: 6px; }

/* ---------- Dialoge ---------- */

.dialog {
  width: min(440px, calc(100% - 32px));
  padding: 22px 24px;
  border: 1px solid var(--messing);
  border-radius: 12px;
  background: var(--flaeche);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.dialog::backdrop { background: rgba(3, 8, 12, 0.6); }
.dialog h2 { margin: 0 0 8px; font-family: var(--schrift-titel); font-weight: normal; color: var(--messing-hell); }

/* ---------- Spieleransicht: Uhr ---------- */

.spieleruhr {
  position: fixed;
  top: 14px;
  left: 14px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(216, 170, 78, 0.45);
  background: rgba(10, 20, 25, 0.82);
  color: var(--messing-hell);
  font-family: var(--schrift-titel);
  font-size: clamp(16px, 2.2vw, 26px);
  letter-spacing: 0.03em;
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}
.spieleruhr .symbol { margin-right: 6px; }

/* ---------- Spieleransicht: Wartehinweis ---------- */

.wartehinweis {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(10, 20, 25, 0.85);
  color: var(--text-leise);
  z-index: 4;
}

.zugang form {
  max-width: 340px;
  padding: 24px 28px;
  border: 1px solid var(--linie);
  border-radius: 12px;
  background: var(--flaeche);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.zugang h2 { margin: 0; color: var(--messing-hell); font-family: var(--schrift-titel); font-weight: normal; }
.zugang p { margin: 0; }

/* ---------- Fehlermeldung, wenn Karten fehlen ---------- */

.vollmeldung {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--meer-tief);
  z-index: 50;
}
.vollmeldung > div {
  max-width: 520px;
  padding: 24px 28px;
  border: 1px solid var(--warnung);
  border-radius: 12px;
  background: var(--flaeche);
}
.vollmeldung h2 { margin-top: 0; color: var(--warnung); font-family: var(--schrift-titel); font-weight: normal; }

/* ---------- Spieleransicht ---------- */

body.spieler { overflow: hidden; }
body.spieler #karte { position: fixed; inset: 0; }
body.spieler .vollbildknopf {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 4;
  transition: opacity 0.4s;
}
body.spieler.ruhig .vollbildknopf { opacity: 0; pointer-events: none; }
body.spieler.ruhig .karten-leinwand { cursor: none; }

/* ---------- Startseite ---------- */

body.start {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(110, 224, 234, 0.08), transparent 60%),
    var(--meer-tief);
}
.startkarte {
  width: min(560px, 100%);
  padding: 34px 36px 28px;
  border: 1px solid var(--linie);
  border-radius: 14px;
  background: var(--flaeche);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
}
.startkarte h1 {
  margin: 0;
  font-family: var(--schrift-titel);
  font-weight: normal;
  font-size: 40px;
  letter-spacing: 0.08em;
  color: var(--messing-hell);
}
.startkarte .unterzeile { margin: 4px 0 26px; color: var(--text-leise); }
.startwahl { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.startwahl a {
  display: block;
  padding: 18px 16px;
  border: 1px solid var(--linie);
  border-radius: 10px;
  background: var(--flaeche-2);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.12s, background 0.12s;
}
.startwahl a:hover { border-color: var(--messing); background: var(--flaeche-3); }
.startwahl strong { display: block; font-size: 17px; margin-bottom: 4px; color: var(--messing-hell); font-weight: 600; }
.startwahl span { color: var(--text-leise); font-size: 13px; }
.startkarte .fuss { margin-top: 22px; padding: 0; }
.anmeldung { text-align: left; max-width: 320px; margin: 0 auto; }
.anmeldung .eingabe { padding: 9px 10px; font-size: 15px; }
.anmeldung .knopf { margin-top: 6px; }

.nur-schmal { display: none; }

@media (max-width: 760px) {
  .seitenleiste { width: 100%; flex-basis: auto; position: absolute; inset: 0; z-index: 10; }
  .kopf { position: relative; }
  .nur-schmal { display: block; position: absolute; top: 14px; right: 14px; }
  .hinweis { left: 8px; right: 58px; top: 8px; transform: none; max-width: none; font-size: 13px; padding: 6px 8px 6px 10px; gap: 8px; }
  .startwahl { grid-template-columns: 1fr; }
}
