@font-face { font-family: "Orbitron"; src: url("fonts/orbitron.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "ShareTechMono"; src: url("fonts/sharetechmono.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #000;
  --g: #00ff66;
  --g2: #00c853;
  --dim: #0b5d2e;
  --faint: #06301a;
  --warn: #ff3b5c;
  --glow: 0 0 6px rgba(0,255,102,.55), 0 0 18px rgba(0,255,102,.18);
  --mono: "ShareTechMono", ui-monospace, "SF Mono", Menlo, monospace;
  --head: "Orbitron", "ShareTechMono", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--g); font-family: var(--mono); min-height: 100%; }
body {
  font-size: 16px; letter-spacing: .02em;
  background:
    linear-gradient(rgba(0,255,102,.035) 1px, transparent 1px) 0 0 / 100% 3px,
    radial-gradient(ellipse at 50% 0%, #021a0c 0%, #000 60%);
  background-attachment: fixed;
}
body::after { /* Scanlines + Vignette */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.25) 0 1px, transparent 1px 3px);
  box-shadow: inset 0 0 140px rgba(0,0,0,.9);
}
::selection { background: var(--g); color: #000; }
a { color: var(--g); }
button, input { font: inherit; color: inherit; }

.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 22px; border-bottom: 1px solid var(--dim); font-size: 12px; color: var(--g2);
  text-transform: uppercase; letter-spacing: .18em;
}
.topbar .sys::before { content: "■ "; color: var(--g); animation: blink 1.2s steps(1) infinite; }
.topbar .right { display: flex; gap: 14px; align-items: center; }
.topbar button { background: none; border: 1px solid var(--dim); padding: 4px 10px; cursor: pointer; letter-spacing: .14em; text-transform: uppercase; font-size: 11px; }
.topbar button:hover { border-color: var(--g); box-shadow: var(--glow); }

main.grid {
  display: grid; gap: 22px; padding: 22px;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1fr) minmax(320px, 1.4fr);
  align-items: start;
}
@media (max-width: 1100px) { main.grid { grid-template-columns: 1fr 1fr; } .ident { grid-column: 1 / -1; } }
@media (max-width: 720px)  { main.grid { grid-template-columns: 1fr; padding: 14px; gap: 14px; } }

.panel {
  position: relative; border: 1px solid var(--dim); padding: 22px 20px 20px; background: rgba(0,20,8,.35);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}
.panel::before { /* Eck-Markierung */
  content: ""; position: absolute; top: 0; left: 0; width: 42px; height: 2px; background: var(--g); box-shadow: var(--glow);
}
.panel .tag {
  position: absolute; top: 6px; right: 26px; font-size: 10px; color: var(--dim); letter-spacing: .2em;
}
.panel h2 {
  margin: 0 0 16px; font-family: var(--head); font-weight: 700; font-size: 14px; letter-spacing: .26em;
  text-transform: uppercase; text-shadow: var(--glow);
}

/* Identität */
.ident .kicker { font-size: 12px; letter-spacing: .4em; text-transform: uppercase; color: var(--g2); }
.ident h1 {
  margin: 6px 0 14px; font-family: var(--head); font-weight: 900; font-size: clamp(34px, 4.4vw, 64px);
  letter-spacing: .06em; line-height: 1; text-transform: uppercase; text-shadow: var(--glow);
  position: relative;
}
.ident h1.glitch::before, .ident h1.glitch::after {
  content: attr(data-text); position: absolute; inset: 0; opacity: .6;
}
.ident h1.glitch::before { color: #00ffd5; transform: translate(2px, 0); clip-path: inset(0 0 60% 0); animation: gl 3.4s infinite steps(1); }
.ident h1.glitch::after  { color: #66ff00; transform: translate(-2px, 0); clip-path: inset(55% 0 0 0); animation: gl 2.7s infinite steps(1) reverse; }
.ident dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 18px 0 0; font-size: 13px; }
.ident dt { color: var(--dim); text-transform: uppercase; letter-spacing: .14em; }
.ident dd { margin: 0; }
.bar { height: 6px; border: 1px solid var(--dim); margin-top: 18px; position: relative; overflow: hidden; }
.bar i { position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--g), transparent); animation: sweep 3s linear infinite; }

/* Tasks */
.tasks ul { list-style: none; margin: 0; padding: 0; }
.tasks li {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start;
  padding: 9px 0; border-bottom: 1px dashed var(--faint);
}
.tasks li .idx { color: var(--dim); font-size: 12px; padding-top: 2px; }
.tasks li .txt { word-break: break-word; line-height: 1.35; }
.tasks li.done .txt { color: var(--dim); text-decoration: line-through; }
.tasks li .box { cursor: default; color: var(--g); }
.tasks li .tools { display: flex; gap: 4px; opacity: .55; }
.tasks li:hover .tools { opacity: 1; }
.tasks .empty { color: var(--dim); padding: 10px 0; }
.ibtn { background: none; border: 1px solid transparent; padding: 0 5px; cursor: pointer; line-height: 1.4; }
.ibtn:hover { border-color: var(--g); box-shadow: var(--glow); }
.ibtn.del:hover { border-color: var(--warn); color: var(--warn); box-shadow: none; }
.tasks .chk { width: 22px; height: 22px; border: 1px solid var(--g2); background: none; cursor: pointer; padding: 0; font-size: 14px; line-height: 20px; }
.tasks .chk:disabled { cursor: default; }
.tasks form { display: flex; gap: 8px; margin-top: 14px; }
.tasks .txt input { width: 100%; }

input[type=text], input[type=password], input[type=number] {
  background: #000; border: 1px solid var(--dim); padding: 9px 10px; outline: none; color: var(--g); min-width: 0;
}
input:focus { border-color: var(--g); box-shadow: var(--glow); }
input[type=number] { -moz-appearance: textfield; }
.btn {
  background: transparent; border: 1px solid var(--g); color: var(--g); padding: 9px 16px; cursor: pointer;
  text-transform: uppercase; letter-spacing: .2em; font-size: 12px; white-space: nowrap;
}
.btn:hover { background: var(--g); color: #000; box-shadow: var(--glow); }
.btn:disabled { opacity: .4; cursor: default; }

/* Kreis */
.diam { text-align: center; }
.diam .label { font-family: var(--head); font-size: 13px; letter-spacing: .26em; text-transform: uppercase; text-shadow: var(--glow); }
.diam .value { font-size: 30px; font-family: var(--head); font-weight: 700; margin: 4px 0 12px; text-shadow: var(--glow); }
.diam .value small { font-size: 14px; color: var(--g2); margin-left: 4px; }
.diam .value.closed { margin: 12px 0 4px; }
.stage { display: flex; align-items: center; justify-content: center; width: 100%; overflow: hidden; }
.stage svg { display: block; overflow: visible; }
.diam .scale { font-size: 11px; letter-spacing: .14em; color: var(--g2); min-height: 16px; margin-top: 8px; text-transform: uppercase; }
.diam .scale.warn { color: #ffd000; }
.diam .edit { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.diam .edit label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--g2); display: flex; align-items: center; gap: 6px; }
.diam .edit input { width: 90px; text-align: right; }
.linkbtn { background: none; border: none; color: var(--g2); text-decoration: underline; cursor: pointer; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; padding: 0; }
.linkbtn:hover { color: var(--g); }

/* Dialog */
dialog { background: #000; color: var(--g); border: 1px solid var(--g); box-shadow: var(--glow); padding: 22px; max-width: min(92vw, 640px); }
dialog::backdrop { background: rgba(0,0,0,.8); }
dialog h3 { font-family: var(--head); letter-spacing: .2em; text-transform: uppercase; margin: 0 0 12px; font-size: 15px; }
dialog p { color: var(--g2); font-size: 14px; line-height: 1.45; }
.card { border: 2px solid var(--g); border-radius: 3.18mm; margin: 18px auto; box-shadow: var(--glow); display: flex; align-items: center; justify-content: center; color: var(--g2); font-size: 12px; }
dialog input[type=range] { width: 100%; accent-color: var(--g); }
.row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }

/* Login */
.loginwrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.loginwrap .panel { width: min(420px, 100%); }
.loginwrap form { display: grid; gap: 12px; }
.loginwrap label { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--g2); display: grid; gap: 6px; }
.term { font-size: 12px; color: var(--g2); margin: 0 0 18px; white-space: pre-line; line-height: 1.5; }
.msg { min-height: 20px; font-size: 13px; }
.msg.err { color: var(--warn); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #000; border: 1px solid var(--g); padding: 10px 16px; box-shadow: var(--glow); z-index: 60; font-size: 13px; }
.toast.err { border-color: var(--warn); color: var(--warn); }
.cursor::after { content: "_"; animation: blink 1s steps(1) infinite; }
.ro { font-size: 10px; letter-spacing: .2em; color: var(--dim); text-transform: uppercase; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes sweep { from { left: -40%; } to { left: 100%; } }
@keyframes gl { 0%,92%,100% { transform: translate(0,0); opacity: 0; } 93% { transform: translate(3px,-1px); opacity: .7; } 96% { transform: translate(-3px,1px); opacity: .7; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { transform-origin: center; transform-box: fill-box; animation: spin 24s linear infinite; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
.calrow { margin-top: 12px; }
.stagewrap { display: flex; align-items: center; gap: 14px; }
.stagewrap .stage { flex: 1 1 0; min-width: 0; }
.depth { flex: 0 0 92px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.depth .dl { font-family: var(--head); font-size: 9px; letter-spacing: .18em; text-transform: uppercase; text-shadow: var(--glow); line-height: 1.3; }
.depth .dv { font-family: var(--head); font-weight: 700; font-size: 18px; text-shadow: var(--glow); margin-bottom: 6px; }
.depth .dv small { font-size: 10px; color: var(--g2); margin-left: 3px; }
.depth .goal { color: #00e5ff; text-shadow: 0 0 6px rgba(0,229,255,.5); }
.depth .dv.goal { margin: 6px 0 0; }
#depthgauge svg { display: block; overflow: visible; }
.diam .edit .brk { flex-basis: 100%; height: 0; }
.diam .edit label.goal { color: #00e5ff; }
.diam .edit label.goal input { border-color: #0a4a55; color: #00e5ff; }
.goals { display: flex; gap: 6px 18px; justify-content: center; flex-wrap: wrap; margin-top: 10px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #00e5ff; }
.goals .gl { display: inline-flex; align-items: center; gap: 6px; }
.goals .sw { display: inline-block; width: 18px; border-top: 2px dashed #00e5ff; }
.goals .sw.closed { border-top-style: dotted; }
.goals[hidden] { display: none !important; } .pwform { display: grid; gap: 10px; }
[hidden] { display: none !important; }
#in-expose { background: #000; color: var(--g); border: 1px solid var(--dim); font: inherit; font-size: 13px; padding: 3px 6px; letter-spacing: .08em; cursor: pointer; outline: none; max-width: 100%; }
#in-expose:focus, #in-expose:hover { border-color: var(--g); box-shadow: var(--glow); }
.expose[data-level="0"], #in-expose[data-level="0"] { color: var(--g2); }
.expose[data-level="1"], #in-expose[data-level="1"] { color: #b6ff00; text-shadow: var(--glow); }
.expose[data-level="2"], #in-expose[data-level="2"] { color: #ffd000; text-shadow: 0 0 6px rgba(255,208,0,.5); }
.expose[data-level="3"], #in-expose[data-level="3"] { color: var(--warn); text-shadow: 0 0 6px rgba(255,59,92,.6); animation: blink 1.6s steps(1) infinite; }
main.grid > * { min-width: 0; }
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; padding: 8px 14px; letter-spacing: .1em; }
  .topbar .right { gap: 8px; flex-wrap: wrap; }
  #clock { display: none; }
}
