:root {
  --bg: #12131a;
  --card: #1c1e28;
  --card-2: #252836;
  --text: #f1f1f4;
  --muted: #9a9cab;
  --accent: #ff7a45;
  --accent-2: #ffb347;
  --ok: #4cd18a;
  --warn: #f5c04a;
  --err: #ff5d5d;
  --radius: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  padding: env(safe-area-inset-top) 16px calc(24px + env(safe-area-inset-bottom));
}
main { max-width: 520px; margin: 0 auto; }
header { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 14px; }
.logo { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; margin-right: 6px; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.err { background: var(--err); }
.conn { color: var(--muted); font-size: .85rem; display: flex; align-items: center; }

.card { background: var(--card); border-radius: var(--radius); padding: 20px; margin-bottom: 14px; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.badge { font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--card-2); color: var(--muted); }
.badge.kind { background: rgba(255,122,69,.15); color: var(--accent); }
#title { font-size: 1.35rem; font-weight: 700; margin: 0 0 4px; overflow-wrap: anywhere; }
#subtitle { color: var(--muted); margin: 0; }
.progress { height: 6px; background: var(--card-2); border-radius: 3px; margin: 18px 0 6px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s linear; }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }

button { font: inherit; border: 0; cursor: pointer; color: var(--text); }
.controls { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin-bottom: 14px; }
.btn { background: var(--card-2); border-radius: var(--radius); padding: 18px; font-weight: 600; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1b0f08; font-size: 1.15rem; font-weight: 800; }
.btn:disabled { opacity: .45; }

h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
ol.next { list-style: none; margin: 0; padding: 0; }
ol.next li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--card-2); }
ol.next li:first-child { border-top: 0; }
ol.next .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ol.next .m { color: var(--muted); font-size: .85rem; white-space: nowrap; }

details { background: var(--card); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 14px; }
summary { font-weight: 600; cursor: pointer; }
.setting { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--card-2); }
.setting:first-of-type { margin-top: 10px; }
.setting input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; margin-top: 2px; }
.setting small { display: block; color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--card-2); align-items: center; }
.row .btn { padding: 10px 14px; }
.muted { color: var(--muted); font-size: .85rem; }
#log { font: 12px/1.5 ui-monospace, Menlo, monospace; color: var(--muted); max-height: 260px; overflow-y: auto; margin: 10px 0 0; padding: 0; list-style: none; }
#log li.client { color: #b9c7ff; }

/* Einschalt-Overlay: der erste Tipp gibt die Audiowiedergabe im Browser frei */
#overlay { position: fixed; inset: 0; background: rgba(10,10,14,.92); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 24px; }
#overlay[hidden] { display: none; }
#overlay .inner { text-align: center; max-width: 340px; }
#overlay .btn { width: 100%; margin-top: 18px; }

/* Login */
.login { max-width: 360px; margin: 18vh auto 0; }
.login input { width: 100%; font: inherit; padding: 16px; border-radius: 14px; border: 1px solid var(--card-2); background: var(--card); color: var(--text); margin: 14px 0; }
.login .btn { width: 100%; }
.error { color: var(--err); }
#toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--card-2); padding: 10px 16px; border-radius: 12px; font-size: .9rem; max-width: 90vw; z-index: 20; }
#toast[hidden] { display: none; }
