/* MatrixWerk 1v0 – created by AnnoBoy 2015–2026 */
@font-face { font-family:"Montserrat"; font-weight:400; font-display:swap; src:url(schriften/montserrat-latin-400-normal.woff) format("woff"); }
@font-face { font-family:"Montserrat"; font-weight:700; font-display:swap; src:url(schriften/montserrat-latin-700-normal.woff) format("woff"); }
@font-face { font-family:"Anton"; font-display:swap; src:url(schriften/anton-latin-400-normal.woff) format("woff"); }
@font-face { font-family:"Bebas Neue"; font-display:swap; src:url(schriften/bebas-neue-latin-400-normal.woff) format("woff"); }
@font-face { font-family:"Orbitron"; font-weight:700; font-display:swap; src:url(schriften/orbitron-latin-700-normal.woff) format("woff"); }
@font-face { font-family:"Oswald"; font-weight:500; font-display:swap; src:url(schriften/oswald-latin-500-normal.woff) format("woff"); }
@font-face { font-family:"Roboto Slab"; font-weight:600; font-display:swap; src:url(schriften/roboto-slab-latin-600-normal.woff) format("woff"); }
@font-face { font-family:"Comfortaa"; font-weight:700; font-display:swap; src:url(schriften/comfortaa-latin-700-normal.woff) format("woff"); }
@font-face { font-family:"Permanent Marker"; font-display:swap; src:url(schriften/permanent-marker-latin-400-normal.woff) format("woff"); }
@font-face { font-family:"Pacifico"; font-display:swap; src:url(schriften/pacifico-latin-400-normal.woff) format("woff"); }
@font-face { font-family:"Lobster"; font-display:swap; src:url(schriften/lobster-latin-400-normal.woff) format("woff"); }

body.dunkel { --bg:#0b0a1a; --panel:#15132b; --panel2:#1f1c3d; --rand:#35305e; --text:#f1efff; --leise:#a9a3d6; --knopf:#26224a; --knopfh:#332d62;
  --akz1:#00d2ff; --akz2:#ff2fb3; --akz3:#ffd23f; --gruen:#22c55e; --schatten:rgba(0,0,0,.55); --platine:#0a2416; --platine2:#0f3320; --ledaus:rgba(255,255,255,.07); }
body.hell   { --bg:#f6f4ff; --panel:#ffffff; --panel2:#f0edff; --rand:#ddd6fb; --text:#1d1838; --leise:#6c6596; --knopf:#efebff; --knopfh:#e2dcff;
  --akz1:#0891b2; --akz2:#db2777; --akz3:#b45309; --gruen:#16a34a; --schatten:rgba(70,40,160,.14); --platine:#123a26; --platine2:#185034; --ledaus:rgba(255,255,255,.1); }
* { box-sizing:border-box; }
html, body { margin:0; height:100%; }
body { background:var(--bg); color:var(--text); font:14px/1.4 "Segoe UI", Montserrat, system-ui, sans-serif; -webkit-tap-highlight-color:transparent; overflow:hidden; }
#app { display:flex; flex-direction:column; gap:8px; padding:10px 12px 6px; height:100vh; height:100dvh; }
h1, h2, h3 { margin:0; }
h2 { font-size:17px; display:flex; align-items:center; gap:8px; margin-bottom:10px; }
h3 { font-size:13px; margin:14px 0 6px; text-transform:uppercase; letter-spacing:.06em; color:var(--leise); display:flex; align-items:center; gap:8px; }
.leise { color:var(--leise); }
.klein { font-size:12px; margin:4px 0; }
.luecke { flex:1; }
[hidden] { display:none !important; }

/* Kopf */
.kopf { display:flex; align-items:center; gap:10px; min-height:60px; border-radius:16px; padding:6px 14px; flex-wrap:wrap; flex:none;
  background:linear-gradient(100deg,#2b0f6b 0%,#5b21b6 30%,#0e7490 66%,#db2777 100%); color:#fff; box-shadow:0 8px 24px var(--schatten); }
.kopf h1 { font-size:23px; letter-spacing:.3px; font-family:Montserrat, "Segoe UI", sans-serif; }
.kopf p { margin:0; font-size:12px; opacity:.9; }
.logo { width:44px; height:44px; flex:none; filter:drop-shadow(0 0 8px rgba(0,210,255,.6)); }
.logo svg { width:100%; height:100%; }
.knopfgruppe { display:flex; gap:6px; flex-wrap:wrap; }
.kopfknopf { color:#fff !important; background:rgba(255,255,255,.14) !important; border:1px solid rgba(255,255,255,.3) !important; }
.kopfknopf:hover { background:rgba(255,255,255,.28) !important; }

/* Knöpfe & Felder */
button, .knopf { font:inherit; font-weight:600; color:var(--text); background:var(--knopf); border:1px solid var(--rand); border-radius:10px;
  padding:6px 11px; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:6px; justify-content:center; min-height:32px;
  touch-action:manipulation; user-select:none; -webkit-user-select:none; transition:background .15s, transform .1s; }
button:hover, .knopf:hover { background:var(--knopfh); }
button:active { transform:scale(.97); }
button:disabled { opacity:.38; cursor:default; transform:none; }
button.haupt { background:linear-gradient(135deg,var(--akz1),var(--akz2)); color:#fff; border:none; }
button.haupt:hover { filter:brightness(1.08); }
button.grosser { padding:6px 16px; font-size:15px; }
button.laeuft { background:linear-gradient(135deg,#ef4444,#f97316); }
.klein-knopf { padding:4px 9px; min-height:28px; font-size:13px; }
.rotknopf-klein:hover { background:#ef4444; color:#fff; }
.breit-knopf { width:100%; margin:4px 0; min-height:40px; }
input, select, textarea { font:inherit; color:var(--text); background:var(--panel2); border:1px solid var(--rand); border-radius:8px; padding:5px 7px; min-height:30px; }
input[type=range] { padding:0; accent-color:var(--akz1); background:none; border:none; width:100%; }
input[type=checkbox] { accent-color:var(--akz1); width:16px; height:16px; min-height:0; }
input[type=color] { padding:0; width:48px; height:34px; }
textarea { width:100%; resize:vertical; }
input:focus, select:focus, textarea:focus { outline:2px solid var(--akz1); outline-offset:0; }
.feld { display:flex; flex-direction:column; gap:3px; font-size:12px; color:var(--leise); margin:6px 0; flex:1; }
.feld > select, .feld > input:not([type=range]) { color:var(--text); font-size:14px; }
.schalter { display:flex; align-items:center; gap:7px; margin:6px 0; cursor:pointer; }
.zeile2 { display:flex; gap:8px; align-items:flex-end; }
.knopf-zeile { display:flex; gap:6px; flex-wrap:wrap; margin:6px 0; }
.knopf-zeile.rechts { justify-content:flex-end; }
.mini { display:inline-flex; align-items:center; gap:5px; font-size:12px; color:var(--leise); }
.mini input[type=number] { width:78px; min-height:26px; padding:2px 6px; }
.klein-wahl { font-size:12px; min-height:24px; padding:1px 4px; text-transform:none; letter-spacing:0; }

/* Aufbau */
.mitte { flex:1; min-height:0; display:grid; grid-template-columns:76px 1fr 370px; gap:8px; }
.werkzeuge { display:flex; flex-direction:column; gap:5px; background:var(--panel); border:1px solid var(--rand); border-radius:14px; padding:6px; overflow:auto; }
.wz { width:62px; min-height:48px; padding:2px; font-size:19px; border-radius:10px; flex:none; flex-direction:column; gap:0; }
.wz small { font-size:10px; font-weight:600; color:var(--leise); }
.wz.an { background:linear-gradient(135deg,var(--akz1),var(--akz2)); color:#fff; border:none; }
.wz.an small { color:#fff; }
.wz.rot:hover { background:#ef4444; color:#fff; }
.wz-trenn { height:1px; background:var(--rand); margin:3px 2px; flex:none; }
.buehne-panel { display:flex; flex-direction:column; min-width:0; min-height:0; background:var(--panel); border:1px solid var(--rand); border-radius:14px; overflow:hidden; }
.objektleiste { display:flex; align-items:center; gap:8px; padding:6px 10px; border-bottom:1px solid var(--rand); flex-wrap:wrap; background:var(--panel2); }
.buehne { flex:1; min-height:0; overflow:auto; position:relative; display:grid; place-items:center;
  background:radial-gradient(circle at 50% 40%, var(--panel2), var(--bg)); touch-action:none; }
#leinwand { display:block; margin:18px; border-radius:10px; box-shadow:0 10px 40px rgba(0,0,0,.5), 0 0 0 6px var(--platine2); cursor:crosshair; }
.leer-hinweis { position:absolute; inset:auto 0 18px 0; text-align:center; color:var(--leise); pointer-events:none; font-size:13px; }

/* Bilderleiste */
.bilderleiste { border-top:1px solid var(--rand); background:var(--panel2); padding:6px 8px; flex:none; }
.bl-knoepfe { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.bl-streifen { display:flex; gap:6px; overflow-x:auto; padding:6px 2px 2px; scroll-behavior:smooth; }
.bl-bild { flex:none; position:relative; border:2px solid transparent; border-radius:8px; padding:2px; background:var(--panel); cursor:pointer; }
.bl-bild.an { border-color:var(--akz1); box-shadow:0 0 0 2px rgba(0,210,255,.25); }
.bl-bild canvas { display:block; border-radius:5px; image-rendering:pixelated; }
.bl-bild span { position:absolute; left:4px; top:2px; font-size:10px; font-weight:700; color:#fff; text-shadow:0 0 3px #000; }
.bl-bild em { position:absolute; right:4px; bottom:2px; font-size:9px; font-style:normal; color:#fff; text-shadow:0 0 3px #000; }

/* Seite */
.seite { display:flex; flex-direction:column; background:var(--panel); border:1px solid var(--rand); border-radius:14px; min-height:0; overflow:hidden; }
.reiter { display:flex; flex-wrap:wrap; gap:4px; padding:6px; border-bottom:1px solid var(--rand); background:var(--panel2); }
.reiter button { flex:1 1 30%; font-size:12px; padding:5px 4px; min-height:30px; }
.reiter button.an { background:linear-gradient(135deg,var(--akz1),var(--akz2)); color:#fff; border:none; }
.tafel { padding:8px 12px 14px; overflow:auto; flex:1; }
.tafel > h3:first-child { margin-top:4px; }
.blatt-kopf { display:flex; align-items:center; padding:8px 12px; border-bottom:1px solid var(--rand); background:var(--panel2); }
.blatt-kopf b { flex:1; }

/* Farben */
.palette { display:grid; grid-template-columns:repeat(8, 1fr); gap:5px; }
.palette button { padding:0; min-height:0; aspect-ratio:1; border-radius:8px; border:2px solid rgba(255,255,255,.15); }
.palette button.an { border-color:var(--text); box-shadow:0 0 0 2px var(--akz1); }
.farbe-jetzt { display:flex; align-items:center; gap:10px; margin:6px 0 10px; }
.farbe-jetzt span { width:44px; height:44px; border-radius:50%; box-shadow:0 0 18px currentColor; border:2px solid rgba(255,255,255,.4); }

/* Text & Symbole */
#tEingabe { width:100%; font-size:16px; }
.vorschau { display:block; width:100%; height:70px; background:#06120c; border-radius:8px; margin:6px 0; image-rendering:pixelated; }
.symbolgitter { display:grid; grid-template-columns:repeat(7, 1fr); gap:5px; }
.symbolgitter button { padding:3px; min-height:0; aspect-ratio:1; }
.symbolgitter canvas { width:100%; height:100%; image-rendering:pixelated; }
.emojigitter { display:grid; grid-template-columns:repeat(8, 1fr); gap:4px; }
.emojigitter button { padding:0; min-height:36px; font-size:20px; font-family:"Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",sans-serif; }
.ablage { border:2px dashed var(--rand); border-radius:12px; padding:14px; text-align:center; color:var(--leise); }
.ablage.drueber { border-color:var(--akz1); background:rgba(0,210,255,.08); }

/* Kästen */
.warnkasten { background:rgba(239,68,68,.12); border:1px solid rgba(239,68,68,.55); border-radius:10px; padding:9px 11px; margin:10px 0; font-size:13px; }
.hinweiskasten { background:rgba(255,210,63,.12); border:1px solid rgba(255,210,63,.55); border-radius:10px; padding:8px 11px; margin:8px 0; font-size:13px; }
.fehlerkasten { background:rgba(239,68,68,.18); border:1px solid #ef4444; border-radius:10px; padding:8px 11px; margin:8px 0; font-size:13px; font-weight:600; }
.okkasten { background:rgba(34,197,94,.12); border:1px solid rgba(34,197,94,.55); border-radius:10px; padding:8px 11px; margin:8px 0; font-size:13px; }
.infozeile { background:var(--panel2); border-radius:10px; padding:8px 10px; font-size:13px; }
.speicher { display:flex; align-items:center; gap:8px; margin:8px 0; }
.speicher-balken { flex:1; height:12px; background:var(--panel2); border-radius:6px; overflow:hidden; border:1px solid var(--rand); }
.speicher-balken i { display:block; height:100%; width:0; background:linear-gradient(90deg,#22c55e,#eab308,#ef4444); background-size:300% 100%; transition:width .3s; }

/* Fuß */
.fuss { display:flex; align-items:center; gap:10px; font-size:12px; flex:none; flex-wrap:wrap; padding:0 4px; }
.werbung { color:var(--text); text-decoration:none; background:linear-gradient(90deg,rgba(124,58,237,.25),rgba(219,39,119,.25)); padding:4px 10px; border-radius:999px; border:1px solid var(--rand); }
.werbung:hover { filter:brightness(1.2); }
.signatur { color:var(--leise); white-space:nowrap; }

/* Dialoge */
.dialog { position:fixed; inset:0; background:rgba(5,3,20,.6); display:grid; place-items:center; z-index:50; padding:12px; backdrop-filter:blur(3px); }
.dialog-box { background:var(--panel); border:1px solid var(--rand); border-radius:16px; padding:16px; width:min(440px, 100%); max-height:92vh; overflow:auto; box-shadow:0 20px 60px rgba(0,0,0,.5); }
.dialog-box.sehr-breit { width:min(1000px, 100%); }
.dialog-box input[type=email], .dialog-box input[type=text] { width:100%; margin:6px 0; }
#codeText { height:60vh; font:12px/1.35 Consolas, "Courier New", monospace; white-space:pre; }
.fehler { color:#ef4444; font-weight:600; }
.meldung { position:fixed; left:50%; top:84px; transform:translateX(-50%); background:var(--panel); color:var(--text); border:1px solid var(--akz1); border-radius:12px; padding:10px 16px; z-index:90; box-shadow:0 10px 30px var(--schatten); font-weight:600; max-width:90vw; text-align:center; }
.arbeit { position:fixed; inset:0; background:rgba(5,3,20,.55); display:grid; place-items:center; z-index:80; }
.arbeit-box { background:var(--panel); border:1px solid var(--rand); border-radius:16px; padding:18px 20px; width:min(460px, 92vw); text-align:center; }
.dreher { width:38px; height:38px; margin:0 auto 8px; border-radius:50%; border:4px solid var(--rand); border-top-color:var(--akz1); animation:dreh 1s linear infinite; }
@keyframes dreh { to { transform:rotate(360deg); } }
.fortschritt { height:10px; background:var(--panel2); border-radius:6px; overflow:hidden; margin:8px 0 12px; }
.fortschritt i { display:block; height:100%; width:0; background:linear-gradient(90deg,var(--akz1),var(--akz2)); transition:width .25s; }
.arbeit-log { text-align:left; max-height:180px; overflow:auto; background:var(--panel2); border-radius:8px; padding:6px 8px; font:11px/1.3 Consolas, monospace; white-space:pre-wrap; }
.ablegen { position:fixed; inset:0; z-index:95; background:rgba(0,210,255,.18); border:4px dashed var(--akz1); display:grid; place-items:center; font-size:26px; font-weight:700; pointer-events:none; }
.verlauf-liste { display:flex; flex-direction:column; gap:6px; }
.verlauf-liste button { justify-content:flex-start; text-align:left; gap:10px; }
.verlauf-liste canvas { width:64px; height:32px; image-rendering:pixelated; border-radius:4px; background:#06120c; flex:none; }

/* Bauplan */
.bauplan-inhalt { color:#1d1838; background:#fff; border-radius:10px; padding:14px; }
.bauplan-inhalt h2 { color:#1d1838; }
.bauplan-inhalt h3 { color:#4c1d95; font-size:15px; text-transform:none; letter-spacing:0; margin-top:18px; }
.bp-kopf { font-size:15px; }
.bp-tab { border-collapse:collapse; width:100%; font-size:13px; }
.bp-tab th, .bp-tab td { border:1px solid #ddd6fb; padding:4px 7px; text-align:left; vertical-align:top; }
.bp-tab th { background:#f0edff; }
.bp-tab .bp-zw td { background:#f0edff; font-weight:700; }
.bp-tab .hk { width:22px; text-align:center; }
.bp-bilder { display:flex; flex-wrap:wrap; gap:14px; }
.bp-bilder svg, .bp-schalt svg { max-width:100%; height:auto; border:1px solid #e5e7eb; border-radius:8px; }
.bp-schalt { overflow:auto; }
.bauplan-inhalt .warnkasten { color:#7f1d1d; background:#fef2f2; }
.bauplan-inhalt .hinweiskasten { color:#713f12; background:#fefce8; }
.bauplan-inhalt .fehlerkasten { color:#7f1d1d; }
.bauplan-inhalt .leise { color:#6c6596; }
.druck-bereich { display:none; }

/* Handy */
.unten, .nur-handy { display:none; }
@media (max-width: 900px) {
  #app { padding:6px 6px 0; gap:6px; }
  .kopf { min-height:48px; padding:4px 8px; border-radius:12px; }
  .kopf h1 { font-size:18px; } .kopf p { display:none; }
  .logo { width:34px; height:34px; }
  .kt, .nur-breit { display:none; }
  .kopfknopf { padding:4px 8px; min-height:30px; }
  .mitte { grid-template-columns:1fr; grid-template-rows:auto 1fr; }
  .werkzeuge { flex-direction:row; order:2; padding:4px; border-radius:12px; overflow-x:auto; }
  .wz { width:52px; min-height:44px; font-size:17px; }
  .wz-trenn { width:1px; height:auto; margin:2px 3px; }
  .buehne-panel { order:1; }
  .mitte { grid-template-rows:1fr auto; }
  .objektleiste { padding:4px 6px; gap:5px; }
  .seite { position:fixed; left:0; right:0; bottom:var(--unten, 110px); max-height:55vh; z-index:40; border-radius:18px 18px 0 0; transform:translateY(110%); transition:transform .25s; box-shadow:0 -10px 40px rgba(0,0,0,.45); }
  .seite.offen { transform:none; }
  .nur-handy { display:flex; }
  .nicht-handy { display:none !important; }
  .unten { display:flex; flex:none; gap:2px; background:var(--panel); border-top:1px solid var(--rand); margin:0 -6px; padding:4px 4px calc(4px + env(safe-area-inset-bottom)); z-index:45; }
  .unten button { flex:1; flex-direction:column; gap:0; border:none; background:none; min-height:48px; font-size:20px; padding:2px; }
  .unten button small { font-size:10px; color:var(--leise); }
  .unten button.an { background:var(--panel2); }
  .unten button.an small { color:var(--akz1); }
  .fuss { font-size:10px; gap:6px; padding:2px; }
  .fuss .werbung { padding:2px 8px; }
  .bl-knoepfe .mini#bInfo { display:none; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .kopf { display:none; }
  .fuss { display:none; }
}

/* Druck: nur der Bauplan */
@media print {
  body { overflow:visible; background:#fff; }
  #app, .dialog, .meldung, .arbeit { display:none !important; }
  .druck-bereich { display:block; color:#000; }
  .druck-bereich .bauplan-inhalt { padding:0; }
  .bp-schalt svg { max-width:100%; }
  tr, svg { page-break-inside:avoid; }
}
