:root{--bg:#f3f5f8;--ink:#0f172a;--mut:#64748b;--line:#dbe1e8;--acc:#2563eb;--accbg:#e8f0fe}
*{box-sizing:border-box}
body{font:15px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;margin:0;background:var(--bg);color:var(--ink)}
main{max-width:1000px;margin:0 auto;padding:12px}main.schmal{max-width:440px}
h1{font-size:1.5rem;margin:.6em 0}
a{color:var(--acc);text-decoration:none;font-weight:600}
input:not([type=checkbox]){height:44px;width:100%;padding:0 12px;font:inherit;border:1px solid var(--line);border-radius:6px;background:#fff;color:inherit}
input:focus{outline:2px solid var(--acc);outline-offset:-1px}
button{height:44px;min-width:44px;padding:0 14px;font:inherit;font-weight:600;border:1px solid var(--line);border-radius:6px;background:#fff;color:var(--ink);cursor:pointer}
button:hover{background:#f1f5f9}button:active{background:#e2e8f0}
button.primary{background:var(--acc);border-color:var(--acc);color:#fff}button.primary:hover{background:#1d4ed8}
button.an{background:var(--accbg);border-color:var(--acc);color:var(--acc)}
.karte,.knopf{display:block;padding:14px;margin:8px 0;background:#fff;border:1px solid var(--line);border-radius:8px;color:var(--ink);font-weight:600}
.knopf{background:var(--acc);border-color:var(--acc);color:#fff;text-align:center}
form button{width:100%;margin-top:8px}
.fehler{color:#dc2626;font-weight:600}
.bar{display:flex;gap:8px;align-items:center;margin-bottom:10px}.bar a{white-space:nowrap}.bar input{flex:1;min-width:0;font-weight:600}
canvas{width:100%;display:block;background:#0e2a40;border-radius:10px;touch-action:none}
.panel{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:10px;padding:10px;background:#fff;border:1px solid var(--line);border-radius:8px}
.seg{display:inline-flex}.seg>*{border-radius:0;margin-left:-1px}.seg>:first-child{border-radius:6px 0 0 6px;margin-left:0}.seg>:last-child{border-radius:0 6px 6px 0}.seg>:only-child{border-radius:6px}
.seg>span{display:flex;align-items:center;justify-content:center;min-width:72px;padding:0 8px;border:1px solid var(--line);background:#fff;font-weight:600;font-variant-numeric:tabular-nums}
.seg button.an{position:relative}
.sp{margin-left:auto}
.lbl{color:var(--mut);font-size:.85rem;font-weight:600}
.chk{display:flex;align-items:center;gap:6px;font-weight:600}
#tres{font-weight:600;min-height:2.6em;margin:8px 0 0}
[hidden]{display:none!important}
.boardgrid{display:grid;gap:12px;grid-template-columns:minmax(0,1fr)}
.mitte{order:-1;min-width:0}
.team{background:#fff;border:1px solid var(--line);border-radius:8px;padding:10px;align-self:start}
.team h3{display:flex;justify-content:space-between;align-items:center;margin:0 0 8px;font-size:.8rem;text-transform:uppercase;letter-spacing:.05em;color:var(--mut)}
.zeile{display:flex;gap:6px;align-items:center;padding:4px;margin-bottom:4px;border:1px solid transparent;border-radius:6px}
.zeile.sel{border-color:var(--acc);background:var(--accbg)}
.dot{width:30px;height:30px;min-width:30px;padding:0;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px var(--line)}
.dot.eigen{background:#ef4444}.dot.gegn{background:#f5b800}
.zeile input{width:3.6em;height:34px;padding:0;text-align:center;font-weight:700}
.zeile .seg{margin-left:auto}.zeile .seg button{height:34px;min-width:34px;padding:0 8px}
.testen .team{display:none}
@media(min-width:1100px){main.app{max-width:1500px}.boardgrid{grid-template-columns:240px minmax(0,1fr) 240px}.mitte{order:0}.team{position:sticky;top:12px}}
textarea{width:100%;padding:10px 12px;font:inherit;border:1px solid var(--line);border-radius:6px;background:#fff;color:inherit;resize:vertical}
textarea:focus{outline:2px solid var(--acc);outline-offset:-1px}
.testen .boardgrid{display:block}
.farben{display:flex;gap:6px}
.sw{width:30px;height:30px;min-width:30px;padding:0;border-radius:6px;border:2px solid #fff;box-shadow:0 0 0 1px var(--line)}
.sw.an{box-shadow:0 0 0 3px var(--acc)}
button:disabled{opacity:.35;cursor:default}
#dialog,#vdialog{position:fixed;inset:0;z-index:20;background:#0f172acc;display:flex;align-items:center;justify-content:center;padding:12px}
.dlg{background:#fff;border-radius:10px;width:100%;max-width:1150px;max-height:100%;display:flex;flex-direction:column}
.dlghead,.dlgfoot{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;gap:8px}
.dlghead{border-bottom:1px solid var(--line)}.dlgfoot{border-top:1px solid var(--line);justify-content:flex-end}
.dlgbody{display:grid;grid-template-columns:230px minmax(0,1fr);gap:14px;padding:12px;overflow:auto}
.opt{margin-bottom:12px}.opt .lbl{display:block;margin-bottom:4px}
.dprev{display:flex;flex-direction:column;gap:8px;align-items:center}
#vorschau{height:auto;touch-action:auto;background:#fff;border:1px solid var(--line)}
@media(max-width:700px){.dlgbody{grid-template-columns:1fr}}
#tdialog{position:fixed;inset:0;z-index:30;background:#0f172acc;display:flex;align-items:center;justify-content:center;padding:12px}
.dlg.klein{max-width:420px}
.dlgbody1{padding:12px;display:flex;flex-direction:column;gap:10px}.dlgbody1 p{margin:0}
.karte{display:flex;align-items:center;justify-content:space-between;gap:8px}.karte a{flex:1;color:inherit}
.karte small{display:block;color:var(--mut);font-weight:500}.karte button{height:36px}
.chips{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}.chips button{height:34px;padding:0 10px;font-size:.85rem}
.datei{color:var(--acc);font-weight:600;cursor:pointer}
input[type=search]{margin-bottom:4px}
select{height:44px;padding:0 10px;font:inherit;border:1px solid var(--line);border-radius:6px;background:#fff;color:inherit}
.zeile{flex-wrap:wrap}.zeile .nm{flex:1 1 100%;height:30px;width:auto;padding:0 8px;font-size:.85rem;font-weight:500;text-align:left}
.zeile .ein{height:34px;min-width:34px;padding:0}.zeile.aus{opacity:.5}.zeile.aus .ein{background:#fee2e2}
.ansicht .nur-edit,.ansicht .team{display:none!important}.ansicht .boardgrid{display:block}
.ansicht #name{border:0;background:transparent;font-size:1.25rem;padding:0}
#msg{color:var(--mut);font-weight:600}
@media(max-width:700px){
  .bar{flex-wrap:wrap}.bar input{order:5;flex-basis:100%}
  .panel{padding:8px;gap:6px}.seg.sp{margin-left:0}
  button,select,input:not([type=checkbox]){height:46px}
  .zeile input,.zeile button,.zeile .seg button{height:36px}.zeile .nm{height:32px}.dot{height:30px}
  .team{padding:8px}
}
#vvorschau{width:auto;max-width:100%;max-height:62vh;height:auto;touch-action:auto;background:#000;border-radius:6px}
.dlgfoot #vstatus{margin-right:auto;color:var(--mut);font-weight:600}
.dprev .klein{max-width:620px;margin:0;color:var(--mut)}
body.uebung .nur-taktik{display:none!important}
body:not(.uebung) .nur-uebung{display:none!important}
.uzeile{flex:1 1 100%;display:flex;flex-direction:column;gap:4px}
#matlist{font-weight:600}

/* ===== Erscheinungsbild 2: Navy, Senfgelb und Rot ===== */
:root{--bg:#edf0f4;--ink:#0f1f2e;--mut:#5a6b7b;--line:#dde3ea;--acc:#17415f;--accbg:#fff3c4;--rot:#ef4444;--senf:#f5b800;--sh:0 1px 2px #0f1f2e14,0 8px 22px #0f1f2e0f}
body{background:var(--bg);color:var(--ink);-webkit-font-smoothing:antialiased}
a{color:var(--acc)}
button{display:inline-flex;align-items:center;justify-content:center;gap:6px;border-radius:9px;transition:background .12s,border-color .12s}
button:hover{background:#f4f6f9}
button.primary{background:var(--acc);border-color:var(--acc);color:#fff}button.primary:hover{background:#0f2d44}
button.an,.seg button.an{background:#fff3c4;border-color:var(--senf);color:#3a2d00}
input:focus,textarea:focus,select:focus{outline:2px solid var(--senf);outline-offset:-1px}
.ic{width:1.2em;height:1.2em;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
button.ik{padding:0 12px}#play{min-width:60px}#play .ic{width:1.45em;height:1.45em}
.bar{background:linear-gradient(135deg,#17415f,#0e2b42);border-radius:16px;padding:10px 12px;box-shadow:var(--sh);margin-bottom:12px;color:#fff}
.bar .logo{display:flex}.bar .logo img{border-radius:9px;display:block}
.bar input{background:#ffffff1c;border:1px solid #ffffff33;color:#fff;font-weight:700;font-size:1.05rem}
.bar input::placeholder{color:#ffffffa6}
.bar button{background:#ffffff1c;border-color:#ffffff33;color:#fff}.bar button:hover{background:#ffffff30}
.bar button.primary{background:var(--senf);border-color:var(--senf);color:#2a2000}
.bar button:disabled{opacity:.35}
.panel{border:0;border-radius:14px;box-shadow:var(--sh);padding:12px}
.lbl{text-transform:uppercase;letter-spacing:.06em;font-size:.72rem}
canvas{border-radius:16px;box-shadow:0 10px 28px #0f1f2e40}
#vorschau,#vvorschau{box-shadow:none}
.team{border:0;border-radius:14px;box-shadow:var(--sh)}
.tabs{display:flex;gap:2px;margin-top:14px;border-bottom:2px solid var(--line);overflow-x:auto}
.tabs button{background:none;border:0;border-radius:0;height:46px;padding:0 16px;color:var(--mut);border-bottom:3px solid transparent;margin-bottom:-2px;white-space:nowrap;font-weight:700}
.tabs button:hover{background:none;color:var(--ink)}
.tabs button.an{background:none;color:var(--acc);border-bottom-color:var(--senf)}
.ansicht .tabs{display:none}
.klein{font-size:.85rem;color:var(--mut)}
.dlg{border-radius:16px;box-shadow:0 20px 60px #0f1f2e66}
/* Startseite und Anmeldung */
.start .kopf,.kopf{display:flex;align-items:center;gap:14px;margin:4px 0 18px}
.kopf img{border-radius:13px;box-shadow:var(--sh)}.kopf h1{margin:0;color:var(--acc);font-size:1.7rem}.kopf p{margin:2px 0 0;color:var(--mut)}
.neu{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:16px}
.knopf{display:flex;align-items:center;justify-content:center;gap:8px;height:52px;margin:0;border-radius:13px;border:0;box-shadow:var(--sh);background:var(--acc);color:#fff;font-weight:700}
.knopf.gelb{background:var(--senf);color:#2a2000}
#typfilter{width:100%}#typfilter button{flex:1}
.suche{display:flex;align-items:center;gap:8px;background:#fff;border-radius:12px;box-shadow:var(--sh);padding:0 12px;margin:10px 0;color:var(--mut)}
.suche input{border:0;background:none;height:46px;padding:0;outline:0!important}
.abschnitt{display:flex;align-items:center;gap:8px;font-size:1.05rem;margin:22px 0 6px;color:var(--ink)}
.mut{color:var(--mut);margin:0 0 8px}.leer{color:var(--mut)}
.karte{position:relative;border:0;border-radius:14px;box-shadow:var(--sh);padding:12px 12px 12px 22px;margin:8px 0;color:var(--ink)}
.karte::before{content:'';position:absolute;left:0;top:10px;bottom:10px;width:6px;border-radius:0 5px 5px 0;background:var(--rot)}
.karte[data-typ=uebung]::before{background:var(--senf)}
.kt{flex:1;color:inherit;display:block}.kn{display:block;font-weight:700}.karte small{display:block;color:var(--mut);font-weight:500}
.fuss{margin-top:22px;color:var(--mut)}
main.schmal form{background:#fff;padding:16px;border-radius:14px;box-shadow:var(--sh)}
.umbruch{display:none}
@media(max-width:700px){
  .bar button span{display:none}
  .bar .logo{order:1}.bar input{order:2;flex:1 1 0;min-width:0}.bar #save{order:3}
  .umbruch{display:block;flex:0 0 100%;height:0;order:4}
  .bar #undo,.bar #redo,.bar #link,.bar #reload{order:5}
  .bar #link{margin-left:auto}
}
