:root {
  --bg: #0e0e12; --flaeche: #181820; --flaeche2: #22222d; --linie: #2c2c3a;
  --text: #f3f3f7; --leise: #a0a0b4;
  --ich: #4cc9a7; --kanal: #ff5a4d; --akzent: var(--ich);
  --nav: 220px; --leiste: 96px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input { font: inherit; color: inherit; }
a { color: inherit; }

/* Anmeldeseite */
body.anmelden main { max-width: 26rem; margin: 18vh auto 0; padding: 0 1.5rem; text-align: center; }
body.anmelden h1 { font-size: 2.4rem; margin: 0 0 .5rem; }
.knopf { display: inline-block; background: var(--akzent); color: #06150f; font-weight: 700;
  border-radius: 2rem; padding: .6rem 1.4rem; text-decoration: none; }
.knopf.gross { padding: .9rem 2rem; font-size: 1.1rem; margin: 1rem 0; }
.klein { color: var(--leise); font-size: .85rem; }
.fehler { background: #3a1d1d; border: 1px solid #7a2e2e; border-radius: .6rem; padding: .7rem 1rem; }

/* Aufbau: links Navigation, mitte Liste, unten die Spielleiste */
#app { display: grid; height: 100%; grid-template-columns: var(--nav) 1fr;
  grid-template-rows: 1fr auto; grid-template-areas: "nav mitte" "leiste leiste"; }
#nav { grid-area: nav; padding: 1.2rem .8rem; border-right: 1px solid var(--linie); overflow: auto; }
#nav .marke { font-weight: 800; font-size: 1.3rem; padding: 0 .6rem 1rem; }
#nav button { display: flex; gap: .7rem; align-items: center; width: 100%; text-align: left;
  padding: .7rem .8rem; border-radius: .6rem; color: var(--leise); font-weight: 600; }
#nav button.an { background: var(--flaeche2); color: var(--text); }
#nav button:hover { color: var(--text); }
#nav .zahl { margin-left: auto; font-size: .8rem; color: var(--leise); }
#nav .ich { margin-top: 1.5rem; padding: .6rem .8rem; color: var(--leise); font-size: .85rem; }
#nav .ich button { display: inline; padding: 0; text-decoration: underline; width: auto; }
#mitte { grid-area: mitte; overflow-y: auto; min-width: 0; }
#kopf { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 1rem 1.2rem .6rem;
  display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; }
#kopf h2 { margin: 0; font-size: 1.5rem; flex: 1 1 100%; }
#kopf input[type=search], #kopf input[type=text] { flex: 1 1 14rem; background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: 2rem; padding: .6rem 1rem; min-width: 0; }
#kopf input:focus { outline: 2px solid var(--akzent); }
.stimmen { display: flex; gap: .4rem; flex-wrap: wrap; flex: 1 1 100%; }
.marke, .stimmen button { background: var(--flaeche2); border-radius: 1rem; padding: .15rem .7rem; font-size: .85rem; }
.stimmen button { color: var(--leise); }
.stimmen button.an { background: var(--text); color: var(--bg); }
.aktion { background: var(--flaeche2); border-radius: 2rem; padding: .5rem 1rem; font-weight: 600; }
.aktion.rot { background: var(--kanal); color: #fff; }
.aktion.gefahr { color: #ff8d85; }

/* Liste */
ul.lieder { list-style: none; margin: 0; padding: 0 .6rem 1rem; }
.zeile { display: grid; grid-template-columns: 3rem 1fr auto auto; gap: .8rem; align-items: center;
  padding: .5rem .6rem; border-radius: .7rem; cursor: pointer; min-height: 4rem; }
.zeile:hover { background: var(--flaeche); }
.zeile.laeuft { background: var(--flaeche2); }
.zeile.laeuft .titel { color: var(--akzent); }
.cover { width: 3rem; height: 3rem; border-radius: .5rem; display: grid; place-items: center;
  font-weight: 800; font-size: 1.2rem; color: rgba(255,255,255,.9); }
.text { min-width: 0; }
.titel { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .15rem; }
.chip { font-size: .72rem; border-radius: .8rem; padding: 0 .5rem; color: #fff; opacity: .9; }
.sub { color: var(--leise); font-size: .85rem; }
.dauer { color: var(--leise); font-variant-numeric: tabular-nums; font-size: .9rem; }
.knoepfe { display: flex; gap: .1rem; }
.knoepfe button { width: 2.6rem; height: 2.6rem; border-radius: 50%; font-size: 1.15rem; color: var(--leise); }
.knoepfe button:hover { background: var(--flaeche2); color: var(--text); }
.knoepfe button.stern.an { color: #ffcf4d; }
.leer { color: var(--leise); padding: 2rem 1.2rem; }
.karte { display: flex; align-items: center; gap: 1rem; padding: .8rem 1rem; margin: 0 .6rem .5rem;
  background: var(--flaeche); border-radius: .8rem; cursor: pointer; }
.karte .text { flex: 1; }

/* Spielleiste */
#leiste { grid-area: leiste; background: var(--flaeche); border-top: 3px solid var(--akzent);
  padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom)); display: grid; gap: .3rem 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; }
#leiste.kanal { --akzent: var(--kanal); background: #2a1514; }
#leiste .band { grid-column: 1 / -1; font-size: .8rem; font-weight: 700; letter-spacing: .04em;
  color: var(--akzent); display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
#leiste .band .leise { color: var(--leise); font-weight: 400; letter-spacing: 0; }
#leiste .stueck { display: flex; gap: .8rem; align-items: center; min-width: 0; }
#leiste .stueck .cover { flex: none; width: 3.4rem; height: 3.4rem; }
.mitte { display: grid; gap: .3rem; justify-items: center; }
.steuer { display: flex; gap: .6rem; align-items: center; }
.steuer button { width: 2.8rem; height: 2.8rem; border-radius: 50%; font-size: 1.2rem; }
.steuer button[disabled] { opacity: .25; cursor: default; }
.steuer .gross { background: var(--text); color: var(--bg); width: 3.2rem; height: 3.2rem; }
.zeitleiste { display: grid; grid-template-columns: 3rem 1fr 3rem; gap: .5rem; width: 100%; align-items: center;
  color: var(--leise); font-size: .8rem; font-variant-numeric: tabular-nums; }
.zeitleiste span:last-child { text-align: right; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--akzent) var(--p, 0%), var(--flaeche2) var(--p, 0%)); width: 100%; margin: 0; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--text); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--text); }
input[type=range][disabled]::-webkit-slider-thumb { visibility: hidden; }
input[type=range][disabled]::-moz-range-thumb { visibility: hidden; }
.rechts { display: flex; gap: .8rem; justify-content: flex-end; align-items: center; }
.rechts input[type=range] { width: 6rem; }
.umschalter { display: inline-flex; background: var(--flaeche2); border-radius: 2rem; padding: 3px; }
.umschalter button { padding: .35rem .8rem; border-radius: 2rem; font-weight: 700; font-size: .9rem; color: var(--leise); }
.umschalter button.an { background: var(--akzent); color: #06150f; }
#leiste.kanal .umschalter button.an { color: #fff; }

/* Blatt zum Hinzufuegen */
.hintergrund { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: grid; place-items: end center; }
.blatt { background: var(--flaeche); width: min(30rem, 100%); border-radius: 1rem 1rem 0 0; padding: 1rem 1.2rem calc(1rem + env(safe-area-inset-bottom));
  max-height: 80vh; overflow: auto; }
.blatt h3 { margin: 0 0 .6rem; }
.blatt label { display: flex; gap: .8rem; padding: .6rem 0; align-items: center; }
.blatt input[type=checkbox] { width: 1.3rem; height: 1.3rem; accent-color: var(--akzent); }
.blatt form { display: flex; gap: .5rem; margin-top: .8rem; }
.blatt form input { flex: 1; background: var(--flaeche2); border: 1px solid var(--linie); border-radius: 2rem; padding: .5rem 1rem; min-width: 0; }

#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--leiste) + 5.5rem); display: grid; justify-items: center; gap: .4rem; z-index: 30; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: .5rem 1rem; border-radius: 2rem; font-weight: 600; max-width: 90vw; }
.toast.rot { background: var(--kanal); color: #fff; }

/* Handy: Navigation wird eine Reihe ueber der Spielleiste, die Leiste schrumpft */
@media (max-width: 760px) {
  html, body { font-size: 16px; }
  #app { grid-template-columns: 1fr; grid-template-rows: 1fr auto auto; grid-template-areas: "mitte" "leiste" "nav"; }
  #nav { display: flex; border: 0; border-top: 1px solid var(--linie); padding: .2rem .3rem calc(.2rem + env(safe-area-inset-bottom)); overflow: visible; background: var(--bg); }
  #nav .marke, #nav .ich { display: none; }
  #nav button { flex-direction: column; gap: 0; justify-content: center; text-align: center; padding: .4rem .2rem; font-size: .72rem; }
  #nav button .symbol { font-size: 1.3rem; }
  #nav .zahl { display: none; }
  #leiste { grid-template-columns: 1fr; padding-bottom: .5rem; }
  #leiste .stueck { order: 1; }
  #leiste .mitte { order: 2; }
  #leiste .rechts { order: 0; justify-content: space-between; }
  #leiste .rechts input[type=range] { display: none; }
  .zeile { grid-template-columns: 3rem 1fr auto; }
  .zeile .dauer { display: none; }
  .knoepfe button { width: 2rem; height: 2.4rem; font-size: 1.05rem; }
  .zeile { gap: .5rem; }
  .zeile .titel { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .zeile .chips { display: none; }
  #leiste { gap: .2rem; }
  #leiste .stueck .chips, #leiste .band .leise:not(:first-of-type) { display: none; }
  #leiste .stueck .cover { width: 2.6rem; height: 2.6rem; }
  #leiste .steuer button { height: 2.4rem; }
  #toasts { bottom: 15rem; }
}

/* Blaupausen */
.einzug { padding: 0 1.2rem .6rem; margin: 0; }
.stand { font-size: .78rem; font-weight: 700; border-radius: 1rem; padding: .1rem .7rem; background: var(--flaeche2); white-space: nowrap; }
.stand-Eingereicht { background: #27408b; } .stand-Angenommen { background: #1d6b4f; }
.stand-Gebaut { background: #2f7d32; } .stand-Abgelehnt { background: #7a2e2e; }
form.editor { padding: 0 1.2rem 2rem; max-width: 44rem; }
.feld { display: grid; gap: .3rem; margin: 0 0 1rem; }
.feld > span { font-weight: 600; }
.feld input, .feld textarea, .admin input, .admin select { background: var(--flaeche); border: 1px solid var(--linie); border-radius: .6rem;
  padding: .6rem .8rem; width: 100%; font: inherit; color: inherit; }
.feld textarea { resize: vertical; }
.feld input:focus, .feld textarea:focus { outline: 2px solid var(--akzent); }
.feld [disabled] { opacity: .7; }
.hinweis { color: var(--leise); font-size: .85rem; }
.reihe { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1rem 0; }
fieldset.admin { border: 1px dashed var(--linie); border-radius: .8rem; display: grid; gap: .6rem; padding: .8rem; }
@media (max-width: 760px) { #nav button { font-size: .66rem; } }
