:root {
  --bg: #03110c;
  --bg2: #062219;
  --ink: #e9fff6;
  --muted: #8fb8a8;
  --line: rgba(160, 255, 215, .14);
  --glass: rgba(6, 30, 22, .62);
  --accent: #5ff2b4;
  --fajr: #5aa9ff;
  --dhuhr: #ffd45c;
  --asr: #ff8f4d;
  --maghrib: #ff5fa2;
  --ishaa: #a98bff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(120% 90% at 30% 40%, #0a3426 0%, var(--bg2) 38%, var(--bg) 75%);
  color: var(--ink);
  font: 15px/1.45 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
#stage { position: fixed; inset: 0; }
#stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#gl, #fx { touch-action: none; cursor: grab; }
#fx { pointer-events: none; }
#gl:active { cursor: grabbing; }

.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) 22px 0;
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; letter-spacing: .02em; color: var(--muted); }
.brand b { color: var(--ink); font-weight: 650; }
.brand img { width: 30px; height: 30px; border-radius: 6px; display: block; }
.actions { display: flex; gap: 8px; pointer-events: auto; }
.chip {
  appearance: none; border: 1px solid var(--line); background: var(--glass); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background .2s, border-color .2s;
}
.chip:hover { border-color: rgba(160, 255, 215, .35); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip svg { width: 18px; height: 18px; }
.sound .ico-on { display: none; }
.sound[aria-pressed="true"] { background: linear-gradient(135deg, #12a777, #0b6b4d); border-color: transparent; }
.sound[aria-pressed="true"] .ico-on { display: block; }
.sound[aria-pressed="true"] .ico-off { display: none; }

.panel {
  position: fixed; z-index: 2; right: 28px; top: 50%; transform: translateY(-56%);
  width: 340px; max-height: calc(100vh - 230px); overflow: auto;
  padding: 22px 22px 18px; border-radius: 20px;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  scrollbar-width: thin;
}
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ff4d6a; margin-right: 8px; vertical-align: 1px; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .25; } }
h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.1; letter-spacing: -.01em; font-weight: 750; }
.lead { margin: 0 0 18px; color: var(--muted); font-size: 14px; }

.now { padding: 14px 14px 12px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); margin-bottom: 16px; }
.now-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 650; }
.now-head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px currentColor; }
.now-city { font-size: 22px; font-weight: 700; margin-top: 6px; line-height: 1.2; overflow-wrap: anywhere; }
.now-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.now-meta b { font-weight: 650; }

.stat { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.stat .big { font-size: 34px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--accent); }
.stat .small { color: var(--muted); font-size: 13px; }

.legend { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 10px currentColor; }
.legend b { color: var(--ink); font-weight: 600; margin-left: auto; font-variant-numeric: tabular-nums; }

.feed-head { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 650; margin-bottom: 6px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; animation: fadein .6s ease; }
.feed li:first-child { border-top: 0; }
.feed i { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.feed .c { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .c small { color: var(--muted); margin-left: 6px; }
.feed .t { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }
@keyframes fadein { from { opacity: 0; transform: translateY(-4px); } }

.timeline {
  position: fixed; z-index: 2; left: 0; right: 0; bottom: 0;
  padding: 10px 28px max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(2, 12, 9, .92), rgba(2, 12, 9, .55) 70%, transparent);
}
.tl-head { display: flex; gap: 12px; white-space: nowrap; justify-content: space-between; font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; margin-bottom: 4px; }
.tl-head > span:first-child { overflow: hidden; text-overflow: ellipsis; }
#clock { font-variant-numeric: tabular-nums; color: var(--ink); }
#tl { width: 100%; height: 86px; display: block; }

#toast {
  position: fixed; z-index: 5; left: 50%; top: 74px; transform: translateX(-50%) translateY(-10px);
  background: rgba(6, 30, 22, .95); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.noscript { position: fixed; inset: auto 0 50% 0; text-align: center; }

@media (max-width: 900px) {
  body { overflow: auto; }
  .panel {
    position: absolute; left: 16px; right: 16px; width: auto; top: auto; bottom: 136px; transform: none;
    max-height: 40vh; padding: 16px;
  }
  .panel .lead, .panel .feed-head, .panel .feed, .panel .legend { display: none; }
  h1 { font-size: 22px; }
  .now { margin-bottom: 10px; }
  .stat { margin-bottom: 0; }
  .stat .big { font-size: 26px; }
  .timeline { padding: 8px 16px max(12px, env(safe-area-inset-bottom)); }
  #tl { height: 70px; }
  .top { padding: max(12px, env(safe-area-inset-top)) 16px 0; }
  .chip span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .eyebrow::before, .feed li { animation: none; }
}

/* ---------- Anmeldung (/admin/login): Kugel links, Karte rechts wie im Tesbih-Vorbild */
.login-wrap { position: fixed; z-index: 4; right: max(28px, 7vw); top: 50%; transform: translateY(-56%); width: min(360px, calc(100vw - 32px)); }
.login-wrap[hidden] { display: none; }
body.mode-login .panel { display: none; }
.login-card {
  display: grid; gap: 14px; padding: 28px 26px 22px; border-radius: 20px;
  background: #f3f6f4; color: #14211b; box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .5) inset;
}
.login-logo { width: 190px; height: auto; margin: 2px auto 0; display: block; }
.login-sub { text-align: center; color: #5b6e66; font-size: 13px; font-weight: 600; letter-spacing: .04em; margin-top: -4px; margin-bottom: 4px; }
.login-card label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 650; color: #33443d; }
.login-card input {
  width: 100%; font: inherit; font-size: 15px; font-weight: 500; color: #14211b; background: #fff;
  border: 1px solid #d5dfda; border-radius: 10px; padding: 11px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus { border-color: #12a777; box-shadow: 0 0 0 3px rgba(18, 167, 119, .18); }
.pw { position: relative; display: block; }
.pw input { padding-right: 42px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: #6b7d75; padding: 6px; cursor: pointer; border-radius: 8px; }
.pw-toggle svg { width: 20px; height: 20px; display: block; }
.login-btn {
  appearance: none; border: 0; border-radius: 10px; padding: 12px; font: inherit; font-size: 15px; font-weight: 700; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #12a777, #0b6b4d); box-shadow: 0 8px 20px rgba(11, 107, 77, .3); margin-top: 4px;
}
.login-btn:hover { filter: brightness(1.06); }
.login-btn:disabled { opacity: .7; cursor: wait; }
.login-btn:focus-visible, .pw-toggle:focus-visible { outline: 2px solid #0b6b4d; outline-offset: 2px; }
.login-error { margin: 0; min-height: 18px; color: #c0262d; font-size: 13px; text-align: center; }
.login-now { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 12.5px; color: #5b6e66; border-top: 1px solid #dde6e1; padding-top: 12px; min-height: 30px; }
.login-now .dot { width: 8px; height: 8px; border-radius: 50%; background: #12a777; flex: none; }
.login-now b { color: #14211b; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin: 12px 0 0; }
@media (max-width: 900px) {
  .login-wrap { position: absolute; right: 16px; left: 16px; width: auto; top: auto; bottom: 120px; transform: none; }
  .login-card { padding: 20px 18px 16px; gap: 10px; }
  .login-logo { width: 150px; }
  .login-foot { display: none; }
}
