@font-face {
  font-family: "Edo";
  src: url("/fonts/edo.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #000;
  --surface: #0d0d0d;
  --surface-2: #171717;
  --line: #242424;
  --text: #f4f4f4;
  --muted: #8a8a8a;
  --accent: #fff;
  --ok: #4ade80;
  --bad: #f87171;
  --radius: 16px;
  --brand: "Edo", Impact, "Arial Black", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  padding-bottom: calc(68px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--text); }
svg.i { flex: none; display: block; }

/* Marke */
.brand { font-family: var(--brand); font-weight: normal; letter-spacing: .03em; line-height: 1; }

/* Kopf */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(0, 0, 0, .85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top h1 { margin: 0; flex: 1; font-size: 30px; }
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(74, 222, 128, .15); }

main { max-width: 860px; margin: 0 auto; padding: 16px; display: grid; gap: 14px; }

/* Navigation unten */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(0, 0, 0, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs button {
  background: none; border: 0; padding: 10px 2px 9px; display: grid; justify-items: center; gap: 4px;
  font-size: 11px; color: var(--muted); cursor: pointer;
}
nav.tabs button[aria-current="page"] { color: var(--text); }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
h2, .card h2 { font-family: var(--brand); font-weight: normal; font-size: 24px; letter-spacing: .03em; text-transform: uppercase; margin: 0 0 12px; line-height: 1; }
.card h3 { font-size: 12px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.warn { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 12px 0 0; }
.warn svg { margin-top: 1px; color: var(--muted); }
.head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.head h2 { margin: 0; flex: 1; }

.now { display: flex; gap: 14px; align-items: center; }
.now .icon { width: 48px; height: 48px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); flex: none; }
.now .icon.on { color: var(--text); }
.now .title { font-size: 20px; font-weight: 700; line-height: 1.2; }
.now .sub { color: var(--muted); font-size: 13px; }

.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fact { display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2); border-radius: 99px; padding: 6px 12px; font-size: 13px; }
.fact svg { color: var(--muted); }

/* Programme */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; } }
.prog {
  background: var(--surface-2); border: 1px solid transparent; border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
}
.prog.active { border-color: var(--accent); }
.thumb { aspect-ratio: 16/9; background: #080808 center/cover; display: grid; place-items: center; color: #444; position: relative; }
.thumb .tag { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; background: #fff; color: #000; padding: 3px 9px; border-radius: 99px; }
.prog .body { padding: 10px 10px 10px; display: grid; gap: 8px; flex: 1; }
.prog .name { font-weight: 650; font-size: 15px; line-height: 1.25; }
.meta { font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta.err { color: var(--bad); }
.prog .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

.item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.item:first-of-type { border-top: 0; }
.item .thumb { width: 96px; border-radius: 8px; flex: none; }
.item .info { flex: 1; min-width: 150px; }
.item .name { font-weight: 650; }
.item .tools { display: flex; gap: 6px; align-items: center; margin-left: auto; }

.progress { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .4s; }

/* Buttons & Formulare */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px;
  padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 15px; min-height: 42px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--text);
}
.btn:hover { border-color: #3a3a3a; }
.btn.primary { background: var(--accent); color: #000; border-color: transparent; }
.btn.primary:hover { background: #ddd; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 6px 10px; min-height: 36px; font-size: 14px; }
.btn.icon { padding: 0; width: 38px; min-height: 38px; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn[disabled] { opacity: .35; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

label.field { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; background: #000; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; color: var(--text);
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, nav.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 8px 0; }
.switch svg { color: var(--muted); }
.switch .lbl { flex: 1; }
.switch input { appearance: none; width: 46px; height: 26px; border-radius: 99px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #777; transition: transform .2s, background .2s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(20px); background: #000; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 7px 12px; cursor: pointer; font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); font-weight: 600; }
.seg button[disabled] { opacity: .35; cursor: default; }

/* Diashow-Editor */
.drop {
  border: 1px dashed #3a3a3a; border-radius: 12px; padding: 22px; color: var(--muted); cursor: pointer;
  display: grid; justify-items: center; gap: 8px; text-align: center;
}
.drop.over { border-color: var(--accent); color: var(--text); }
.slides { display: grid; gap: 10px; }
.slide { display: grid; grid-template-columns: 120px 1fr; gap: 12px; background: var(--surface-2); border-radius: 12px; padding: 10px; align-items: start; }
.slide.dragging { opacity: .4; }
.slide img { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; display: block; }
.slide .opts { display: grid; grid-template-columns: 90px 1fr; gap: 8px; }
.slide .opts .full { grid-column: 1 / -1; }
.slide .tools { display: flex; gap: 6px; margin-top: 8px; }
@media (max-width: 520px) {
  .slide { grid-template-columns: 1fr; }
  .slide img { width: 100%; }
}

/* Galerie */
.prog.album { padding: 0; text-align: left; color: inherit; cursor: pointer; font: inherit; }
.prog.album:hover { border-color: var(--line); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 4px; margin-top: 14px; }
.photo { padding: 0; border: 0; background: #080808; border-radius: 6px; overflow: hidden; aspect-ratio: 1; cursor: pointer; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.photo:hover img { transform: scale(1.04); }
dialog img.lb { width: 100%; max-height: 68dvh; object-fit: contain; background: #000; border-radius: 10px; display: block; }

/* WLAN */
.net { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.net:last-child { border-bottom: 0; }
.net .ssid { font-weight: 600; }
.net .meta { margin-top: 2px; }
.bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 13px; }
.bars i { width: 3px; background: #333; border-radius: 1px; }
.bars i.on { background: var(--text); }

/* Dialog */
dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 0; width: min(760px, 100vw - 24px); max-height: 92dvh; }
dialog::backdrop { background: rgba(0, 0, 0, .75); }
dialog .dhead { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
dialog .dhead h2 { margin: 0; font-size: 22px; flex: 1; }
dialog .dbody { padding: 16px; display: grid; gap: 14px; }
dialog video { width: 100%; border-radius: 10px; background: #000; }

/* Login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; margin-bottom: calc(-68px - env(safe-area-inset-bottom)); }
.login form { width: min(340px, 100%); display: grid; gap: 12px; text-align: center; }
.login h1 { font-size: 76px; margin: 0 0 18px; }
.pw { position: relative; }
.pw input { padding-right: 50px; }
.pw .eye {
  position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 42px; height: 38px;
  display: grid; place-items: center; background: none; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer;
}
.pw .eye:hover, .pw .eye[aria-pressed="true"] { color: var(--text); }
.pw .eye:focus-visible { outline: 2px solid var(--accent); }

#toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: #fff; color: #000; font-size: 14px; font-weight: 500; padding: 10px 16px; border-radius: 99px; opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { background: var(--bad); color: #000; }

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .login { margin-bottom: 0; }
  nav.tabs { position: sticky; top: 63px; bottom: auto; max-width: 860px; margin: 0 auto; background: none; backdrop-filter: none; border: 0; grid-template-columns: repeat(5, max-content); gap: 4px; padding: 12px 16px 0; }
  nav.tabs button { grid-auto-flow: column; gap: 8px; font-size: 14px; padding: 8px 14px; border-radius: 10px; }
  nav.tabs button[aria-current="page"] { background: var(--surface-2); }
  #toast { bottom: 24px; }
}
