/* Werkraum · Grundgestaltung: Farben, Schrift, Knöpfe, Formulare, Dialoge, Meldungen, Einstiegsseiten */

:root {
  --hg: #f3f3f6;
  --flaeche: #ffffff;
  --flaeche-2: #f6f6f9;
  --flaeche-3: #ececf2;
  --rand: #e2e3ea;
  --rand-stark: #c9cbd6;
  --text: #1c1f2e;
  --text-2: #5d6276;
  --text-3: #8a8fa3;
  --akzent: #5b5bd6;
  --akzent-dunkel: #4646b8;
  --akzent-hell: #ecebff;
  --akzent-text: #ffffff;
  --gefahr: #d9363e;
  --ok: #2b9a4a;
  --warn: #e8890c;
  --ki: #8b5cf6;
  --schatten: 0 12px 40px rgba(20, 22, 40, .14), 0 2px 6px rgba(20, 22, 40, .06);
  --schatten-k: 0 2px 10px rgba(20, 22, 40, .08);
  --radius: 12px;
  --radius-k: 8px;
  --schrift: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --leinwand: #f7f7f3;
  --leinwand-punkt: #d6d7dd;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --hg: #14151c; --flaeche: #1d1f29; --flaeche-2: #23252f; --flaeche-3: #2b2e3a; --rand: #323544; --rand-stark: #464a5c;
    --text: #eceef5; --text-2: #a9aec2; --text-3: #7b8096; --akzent: #7c7cf0; --akzent-dunkel: #6a6ae6; --akzent-hell: #2c2c5a;
    --schatten: 0 12px 40px rgba(0, 0, 0, .5); --schatten-k: 0 2px 10px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --hg: #14151c; --flaeche: #1d1f29; --flaeche-2: #23252f; --flaeche-3: #2b2e3a; --rand: #323544; --rand-stark: #464a5c;
  --text: #eceef5; --text-2: #a9aec2; --text-3: #7b8096; --akzent: #7c7cf0; --akzent-dunkel: #6a6ae6; --akzent-hell: #2c2c5a;
  --schatten: 0 12px 40px rgba(0, 0, 0, .5); --schatten-k: 0 2px 10px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.45 var(--schrift); color: var(--text); background: var(--hg); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.8rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .7em; }
a { color: var(--akzent); }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.leise { color: var(--text-2); }
.klein { font-size: .85em; }
.sym { display: inline-flex; line-height: 0; }
.fehler { color: var(--gefahr); }
code { font-size: .9em; background: var(--flaeche-3); padding: .1em .3em; border-radius: 4px; }

/* Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 38px; padding: .45em .95em; border-radius: 10px; border: 1px solid var(--rand);
  background: var(--flaeche); color: var(--text); font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, transform .05s; white-space: nowrap;
}
.knopf:hover { background: var(--flaeche-2); border-color: var(--rand-stark); }
.knopf:active { transform: translateY(1px); }
.knopf:disabled { opacity: .5; cursor: default; }
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.knopf.haupt:hover { background: var(--akzent-dunkel); }
.knopf.gefahr { color: var(--gefahr); }
.knopf.gefahr:hover { background: color-mix(in srgb, var(--gefahr) 10%, var(--flaeche)); }
.knopf.an { background: var(--akzent-hell); border-color: var(--akzent); color: var(--akzent); }
.knopf.klein { min-height: 30px; padding: .25em .65em; font-size: .82rem; border-radius: 8px; }
.knopf.gross { min-height: 52px; padding: .6em 1.4em; font-size: 1.05rem; border-radius: 14px; }
.knopf.breit { width: 100%; }
.symbol-knopf { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; flex: none; }
.symbol-knopf:hover { background: var(--flaeche-3); color: var(--text); }
.symbol-knopf:disabled { opacity: .35; cursor: default; }
.symbol-knopf.an { background: var(--akzent-hell); color: var(--akzent); }
.symbol-knopf.aus { color: var(--gefahr); }
.symbol-knopf.gefahr { background: var(--gefahr); color: #fff; }
.knopf-reihe { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .6rem 0; }
.knopf-reihe.klein { gap: .35rem; margin: .4rem 0; }
.knopf-liste { display: flex; flex-direction: column; gap: .45rem; align-items: stretch; }
.knopf-liste .knopf { justify-content: flex-start; }
.zeile-zwischen { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

/* Formulare */
.formular { display: flex; flex-direction: column; gap: .8rem; }
.formular label, .formular .label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--text-2); }
.formular .zeile, .zeile { display: flex; gap: .7rem; flex-wrap: wrap; }
.formular .zeile > * { flex: 1 1 110px; }
.formular .zeile > .breit { flex: 3 1 200px; }
input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea, select {
  width: 100%; padding: .6em .75em; border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche); color: var(--text); font-weight: 400; font-size: 1rem;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--akzent); outline-offset: 0; border-color: var(--akzent); }
input[type=range] { width: 100%; accent-color: var(--akzent); }
.schalter { display: flex !important; flex-direction: row !important; align-items: center; gap: .6rem !important; cursor: pointer; font-weight: 500 !important; color: var(--text) !important; }
.schalter input { width: 20px; height: 20px; accent-color: var(--akzent); flex: none; }
.schalter span { display: flex; flex-direction: column; }
.schalter small { color: var(--text-2); font-weight: 400; }
.schalter.gross { padding: .55rem 0; border-bottom: 1px solid var(--rand); }
.suche { margin-bottom: .6rem; }

/* Dialoge */
.dialog-hinter { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 16, 28, .45); backdrop-filter: blur(3px); opacity: 0; transition: opacity .18s; }
.dialog-hinter.offen { opacity: 1; }
.dialog { width: min(520px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--flaeche); border-radius: 18px; box-shadow: var(--schatten); transform: translateY(10px) scale(.98); transition: transform .2s; }
.dialog-hinter.offen .dialog { transform: none; }
.dialog.breit { width: min(860px, 100%); }
.dialog-kopf { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 6px 22px; }
.dialog-kopf h2 { margin: 0; font-size: 1.15rem; }
.dialog-inhalt { padding: 6px 22px 16px; overflow: auto; }
.dialog-fuss { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; padding: 12px 22px 18px; border-top: 1px solid var(--rand); }
@media (max-width: 720px) {
  .dialog-hinter { align-items: flex-end; padding: 0; }
  .dialog, .dialog.breit { width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
}

/* Meldungen */
.meldungen { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(560px, calc(100% - 32px)); }
.meldung { pointer-events: auto; display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem; border-radius: 12px; background: #1d2030; color: #fff; box-shadow: var(--schatten); font-size: .92rem; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; max-width: 100%; }
.meldung.sichtbar { opacity: 1; transform: none; }
.meldung.fehler { background: var(--gefahr); }
.meldung .knopf { background: rgba(255, 255, 255, .15); border-color: transparent; color: #fff; }
p.meldung { background: color-mix(in srgb, var(--gefahr) 12%, var(--flaeche)); color: var(--gefahr); opacity: 1; transform: none; box-shadow: none; }
body.raum .meldungen { bottom: 90px; }

/* Einstiegsseiten */
body.einstieg { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--akzent) 18%, transparent), transparent), radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, #f08c00 14%, transparent), transparent), var(--hg); }
.karte { background: var(--flaeche); border-radius: 22px; box-shadow: var(--schatten); padding: 32px; width: min(980px, 100%); }
.karte.schmal { width: min(460px, 100%); }
.marke { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; margin-bottom: 1.2rem; letter-spacing: -.02em; }
.emoji-wahl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: .3rem; }
.emoji-wahl button { width: 42px; height: 42px; font-size: 1.35rem; border: 2px solid transparent; border-radius: 12px; background: var(--flaeche-2); cursor: pointer; }
.emoji-wahl button.an { border-color: var(--akzent); background: var(--akzent-hell); }
.beitritt h1 { font-size: 1.6rem; }

/* Startseite */
.start-held { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.start-held h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.03em; }
.start-held .unterzeile { font-size: 1.1rem; color: var(--text-2); }
.code-eingabe { display: flex; gap: .5rem; margin-top: 1rem; }
.code-eingabe input { font-size: 1.5rem !important; letter-spacing: .25em; text-transform: uppercase; text-align: center; font-weight: 800; }
.merkmale { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 28px; }
.merkmal { padding: 14px; border-radius: 14px; background: var(--flaeche-2); }
.merkmal strong { display: block; margin-bottom: .2rem; }
.merkmal span { color: var(--text-2); font-size: .88rem; }
.held-bild { aspect-ratio: 4/3; border-radius: 18px; background: var(--leinwand); background-image: radial-gradient(var(--leinwand-punkt) 1.2px, transparent 1.2px); background-size: 18px 18px; position: relative; overflow: hidden; border: 1px solid var(--rand); }
.held-bild .n { position: absolute; width: 22%; aspect-ratio: 1; border-radius: 3px; box-shadow: 0 4px 10px rgba(0,0,0,.1); font: 600 .7rem/1.2 var(--schrift); color: #1f2430; padding: 8px; display: flex; align-items: center; justify-content: center; text-align: center; animation: schweben 6s ease-in-out infinite; }
@keyframes schweben { 50% { transform: translateY(-6px) rotate(-1deg); } }
@media (max-width: 760px) { .start-held { grid-template-columns: 1fr; } .held-bild { display: none; } .karte { padding: 22px; } }

/* Übersicht (Moderation) */
body.uebersicht { background: var(--hg); }
.ue-kopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 14px 24px; background: var(--flaeche); border-bottom: 1px solid var(--rand); position: sticky; top: 0; z-index: 5; }
.ue-kopf .marke { margin: 0; }
.ue-haupt { max-width: 1180px; margin: 0 auto; padding: 24px 16px 60px; }
.ue-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.raum-karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: .5rem; transition: box-shadow .15s, transform .15s; }
.raum-karte:hover { box-shadow: var(--schatten-k); transform: translateY(-1px); }
.raum-karte h3 { margin: 0; font-size: 1.05rem; }
.raum-karte .meta { display: flex; gap: .6rem; flex-wrap: wrap; font-size: .82rem; color: var(--text-2); }
.raum-karte .code { font-weight: 800; letter-spacing: .12em; color: var(--akzent); }
.raum-karte.archiviert { opacity: .65; }
.raum-karte .online { color: var(--ok); font-weight: 700; }
.ablauf-wahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ablauf-option { text-align: left; border: 2px solid var(--rand); border-radius: 14px; padding: 12px; background: var(--flaeche); cursor: pointer; display: flex; flex-direction: column; gap: .25rem; }
.ablauf-option.an { border-color: var(--akzent); background: var(--akzent-hell); }
.ablauf-option small { color: var(--text-2); }
.ue-leiste { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.ue-leiste h1 { margin: 0 auto 0 0; font-size: 1.5rem; }
.leer-zustand { text-align: center; padding: 60px 20px; color: var(--text-2); }
.text-seite { max-width: 760px; margin: 0 auto; padding: 32px 16px 60px; }
.text-seite h1 { margin-top: .5rem; }
.text-seite h2 { margin-top: 1.6rem; }
