/* PlexLounge – dunkles Design mit goldgelben Akzenten */
:root {
  --bg: #0b0b0d;
  --surface: #151518;
  --surface-2: #1f1e22;
  --surface-3: #26272c;
  --line: #2e2f35;
  --text: #fdf3e2;
  --muted: #a3a19b;
  --gold: #f2b005;
  --gold-strong: #ffc42e;
  --gold-soft: rgba(242, 176, 5, .12);
  --on-gold: #17130a;
  --green: #6fcf8f;
  --blue: #7fb2ff;
  --violet: #b9a2ff;
  --red: #ff8a7a;
  --orange: #f0a35e;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 68px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--font);
  min-height: 100vh;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden { display: none !important; }
svg.i { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(11, 11, 13, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.05rem; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 38px; height: 38px; flex: none; display: block; }
.brand-mark img { width: 100%; height: 100%; display: block; border-radius: 22%; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-name b { color: var(--gold); font-weight: 700; }
.topbar .spacer { flex: 1; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line); cursor: pointer;
}
.icon-btn:hover { border-color: var(--gold); text-decoration: none; }
.badge-dot {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--gold); color: var(--on-gold); font-size: .75rem; font-weight: 800;
  display: grid; place-items: center;
}

.desktop-nav { display: none; gap: 4px; }
.desktop-nav a {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; color: var(--muted); font-weight: 600;
}
.desktop-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.desktop-nav a.active { color: var(--gold); background: var(--gold-soft); }

main.page {
  max-width: 1040px; margin: 0 auto;
  padding: 20px 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom));
}

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-around;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(17, 17, 20, .97); border-top: 1px solid var(--line);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: .74rem; font-weight: 600;
}
.bottom-nav a svg.i { width: 24px; height: 24px; }
.bottom-nav a.active { color: var(--gold); }
.bottom-nav a:hover { text-decoration: none; }

@media (min-width: 860px) {
  .desktop-nav { display: flex; }
  .bottom-nav { display: none; }
  main.page { padding-bottom: 48px; padding-top: 32px; }
  h1 { font-size: 2rem; }
}

/* ---------- Elemente ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px;
}
.card.gold { border-color: rgba(242,176,5,.45); background: linear-gradient(180deg, rgba(242,176,5,.08), rgba(242,176,5,0) 70%), var(--surface); }
.section { margin: 28px 0 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section h2 { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 650; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--gold); text-decoration: none; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.btn.primary:hover { background: var(--gold-strong); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .92rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.big-actions { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 18px 0 8px; }
@media (min-width: 620px) { .big-actions { grid-template-columns: repeat(3, 1fr); } }
.big-action {
  display: flex; align-items: center; gap: 14px; padding: 18px; min-height: 84px;
  border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
}
.big-action:hover { border-color: var(--gold); text-decoration: none; }
.big-action .ico { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-3); color: var(--gold); flex: none; }
.big-action .ico svg.i { width: 26px; height: 26px; }
.big-action b { display: block; font-size: 1.08rem; }
.big-action span.muted { font-size: .9rem; }
.big-action.primary { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.big-action.primary .ico { background: rgba(0,0,0,.14); color: var(--on-gold); }
.big-action.primary span.muted { color: rgba(23,19,10,.75); }

/* Formulare */
label.field, div.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-weight: 650; margin-bottom: 6px; }
label.field > span em { font-style: normal; font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
::placeholder { color: #6f6d68; }
.hint { color: var(--muted); font-size: .88rem; margin-top: 6px; }
.form-error { background: rgba(255,138,122,.1); border: 1px solid rgba(255,138,122,.45); color: #ffc2b8; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; }
.form-ok { background: rgba(111,207,143,.1); border: 1px solid rgba(111,207,143,.45); color: #bdf0cc; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-weight: 650;
}
.segmented input:checked + label { border-color: var(--gold); background: var(--gold-soft); color: var(--gold); }
.segmented input:focus-visible + label { outline: 3px solid var(--gold); outline-offset: 2px; }

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--gold); }

/* Chips & Filter */
.filters { display: grid; gap: 10px; margin-bottom: 16px; }
.search-wrap { position: relative; }
.search-wrap svg.i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-wrap input { padding-left: 44px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
}
.chip.active { color: var(--on-gold); background: var(--gold); border-color: var(--gold); }
.filter-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 620px) { .filter-row { grid-template-columns: 1fr 1fr; } }

/* Status */
.status {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: .8rem; font-weight: 700; white-space: nowrap; border: 1px solid currentColor;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-eingegangen { color: var(--muted); }
.st-pruefung { color: var(--blue); }
.st-geplant { color: var(--violet); }
.st-verfuegbar { color: var(--green); }
.st-nicht_moeglich { color: var(--red); }
.st-offen { color: var(--orange); }
.st-bearbeitung { color: var(--blue); }
.st-erledigt { color: var(--green); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.tag-example { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--on-gold); background: var(--orange); padding: 2px 8px; border-radius: 6px; vertical-align: middle; }

/* Listen */
.list { display: grid; gap: 10px; }
.item {
  display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
}
a.item:hover { border-color: var(--gold); text-decoration: none; }
.item .poster {
  width: 46px; height: 62px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--surface-3), var(--surface-2)); color: var(--gold); border: 1px solid var(--line);
}
.item .body { flex: 1; min-width: 0; }
.item .title { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; }
.item .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 4px; font-size: .86rem; color: var(--muted); }
.item .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty svg.i { width: 36px; height: 36px; color: var(--gold); margin-bottom: 8px; }

.grid-2 { display: grid; gap: 16px; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Ankündigungen */
.announcement { position: relative; }
.announcement h3 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.announcement .pin { color: var(--gold); }
.prose p:last-child { margin-bottom: 0; }

/* Wunsch-Detail: Fortschritt */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 16px 0 8px; }
.step { text-align: center; font-size: .78rem; color: var(--muted); font-weight: 600; }
.step::before { content: ""; display: block; height: 6px; border-radius: 3px; background: var(--surface-3); margin-bottom: 8px; }
.step.done::before { background: var(--gold); }
.step.done { color: var(--text); }
.step.current { color: var(--gold); }
.notice { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--gold); margin: 12px 0; }
.notice.red { border-left-color: var(--red); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 12px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.similar { margin: -4px 0 16px; padding: 14px; border-radius: 12px; border: 1px solid rgba(242,176,5,.45); background: var(--gold-soft); }
.similar h3 { color: var(--gold); display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.similar .item { background: var(--surface); }

/* Hilfe */
details.acc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; }
details.acc summary {
  list-style: none; cursor: pointer; padding: 16px 18px; font-weight: 650; display: flex; gap: 12px; align-items: center;
}
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: "+"; margin-left: auto; color: var(--gold); font-size: 1.4rem; line-height: 1; font-weight: 400; }
details.acc[open] summary::after { content: "–"; }
details.acc[open] { border-color: rgba(242,176,5,.4); }
details.acc .acc-body { padding: 0 18px 18px; color: #dcdad4; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs .chip { min-height: 44px; }

/* Statistik */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 860px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.stat b { display: block; font-size: 1.8rem; line-height: 1.1; color: var(--gold); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .88rem; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 36px; align-items: center; gap: 10px; font-size: .9rem; }
.bar { height: 10px; background: var(--surface-3); border-radius: 5px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--gold); border-radius: 5px; }
.bar-row .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.subnav { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 20px; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; }

.user-row { display: grid; gap: 10px; }
@media (min-width: 720px) { .user-row { grid-template-columns: 1fr auto; align-items: center; } }
.role-admin { color: var(--gold); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.15rem; letter-spacing: .08em; color: var(--gold); background: var(--surface-2); padding: 4px 10px; border-radius: 8px; border: 1px dashed rgba(242,176,5,.5); }

.screenshot { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); margin-top: 8px; }
.preview-img { max-width: 220px; max-height: 220px; border-radius: 10px; border: 1px solid var(--line); display: block; margin-top: 10px; }

/* Benachrichtigungen */
.notif { display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.notif.unread { border-color: rgba(242,176,5,.5); background: linear-gradient(90deg, var(--gold-soft), transparent 60%), var(--surface); }
.notif .dot { width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.notif.read .dot { background: transparent; }
a.notif:hover { text-decoration: none; border-color: var(--gold); }

/* Anmeldung */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand .brand-mark { width: 88px; height: 88px; margin: 0 auto 16px; }
.auth-brand .brand-mark img { box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.auth-brand h1 { margin-bottom: 4px; }
.auth-switch { text-align: center; margin-top: 18px; color: var(--muted); }

/* Toast & Laden */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--surface-3); color: var(--text); border: 1px solid var(--gold); padding: 12px 18px; border-radius: 12px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: calc(100% - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 860px) { #toast { bottom: 28px; } }
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 40px; display: grid; place-items: center; }

.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 14px; font-weight: 600; min-height: 40px; }
.back:hover { color: var(--gold); text-decoration: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.banner { background: var(--gold-soft); border: 1px solid rgba(242,176,5,.5); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.mt { margin-top: 14px; }
.btn-row.center { justify-content: center; }
.field-label { display: block; margin-bottom: 6px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.auth-brand h1 b { color: var(--gold); }
.similar .item { flex-wrap: wrap; }
.similar .item .side { flex-basis: 100%; align-items: stretch; }
@media (min-width: 620px) { .similar .item { flex-wrap: nowrap; } .similar .item .side { flex-basis: auto; align-items: flex-end; } }
.item .title, .item .body { overflow-wrap: anywhere; }

.status-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.status-pick input { position: absolute; opacity: 0; pointer-events: none; }
.status-pick label { display: inline-flex; align-items: center; min-height: 46px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 650; cursor: pointer; }
.status-pick input:checked + label { border-color: currentColor; background: var(--surface-3); box-shadow: inset 0 0 0 1px currentColor; }
.status-pick input:not(:checked) + label { color: var(--muted); }
.status-pick input:focus-visible + label { outline: 3px solid var(--gold); outline-offset: 2px; }

.banner .grow { flex: 1 1 220px; }
.ok-line { color: var(--green); display: flex; gap: 8px; align-items: flex-start; }
.steps-list { margin: 0 0 8px; padding-left: 1.3em; display: grid; gap: 4px; }
#appbox .btn-row { margin-top: 4px; }
