:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --accent: #ff5a5f;
  --accent2: #4cc9f0;
  --text: #f0f2f5;
  --muted: #8a91a0;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: 24px 16px 48px;
}

.app { width: 100%; max-width: 460px; }

h1 { text-align: center; font-size: 1.6rem; margin: 0 0 20px; }
h2 { font-size: 1rem; margin: 0 0 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

/* Visuelle Beats */
.beats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-height: 26px;
  margin-bottom: 18px;
}
.beat-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #2c313c;
  transition: transform .05s ease, background .05s ease;
}
.beat-dot.active { background: var(--accent2); transform: scale(1.35); }
.beat-dot.accent.active { background: var(--accent); }

/* Tempo */
.bpm-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.bpm-value { text-align: center; }
.bpm-value span { font-size: 3rem; font-weight: 700; line-height: 1; }
.bpm-value small { display: block; color: var(--muted); letter-spacing: .1em; }
.round {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  background: #2c313c;
  color: var(--text);
  font-size: 1.6rem;
  cursor: pointer;
}
.round:active { background: #3a4150; }
input[type=range] { width: 100%; accent-color: var(--accent); }

.tap {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed var(--muted);
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius);
  cursor: pointer;
}

/* Taktart */
.timesig label { display: block; }
.timesig-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.8rem;
  margin: 8px 0 14px;
}
.timesig-inputs input, .timesig-inputs select {
  width: 72px;
  font-size: 1.6rem;
  text-align: center;
  background: #2c313c;
  color: var(--text);
  border: none;
  border-radius: 10px;
  padding: 6px;
}
#subdivision {
  display: block;
  width: 100%;
  margin: 6px 0 14px;
  font-size: 1rem;
  background: #2c313c;
  color: var(--text);
  border: none;
  border-radius: 10px;
  padding: 10px;
}
.timesig > label { color: var(--muted); }
.checkbox { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.checkbox input { width: auto; }

/* Klang */
.sound label { display: block; color: var(--muted); margin-bottom: 12px; }
.sound label:last-child { margin-bottom: 0; }
.sound select {
  display: block;
  width: 100%;
  margin-top: 6px;
  font-size: 1rem;
  background: #2c313c;
  color: var(--text);
  border: none;
  border-radius: 10px;
  padding: 10px;
}

/* Play */
.play {
  width: 100%;
  padding: 18px;
  font-size: 1.3rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: white;
  cursor: pointer;
  margin-bottom: 16px;
}
.play.running { background: #2c313c; }

/* Sync */
.secondary {
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: var(--accent2);
  color: #06222e;
  font-weight: 600;
  cursor: pointer;
}
.sync .join { display: flex; gap: 8px; margin-top: 12px; }
.join input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: .2em;
  text-align: center;
  font-size: 1.2rem;
  background: #2c313c;
  color: var(--text);
  border: none;
  border-radius: 10px;
  padding: 10px;
}
.room-line strong { font-size: 1.4rem; letter-spacing: .2em; color: var(--accent2); }
.room-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.badge {
  background: var(--accent);
  color: white;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
}
.badge.follower { background: #2c313c; color: var(--muted); }
.muted { color: var(--muted); }
.link {
  background: none;
  border: none;
  color: var(--accent2);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-size: .9rem;
}
.status { color: var(--muted); font-size: .85rem; min-height: 1.2em; margin: 10px 0 0; }
.status.error { color: var(--accent); }

/* Follower kann Steuerung nicht bedienen */
.locked .play,
.locked #bpmSlider,
.locked .round,
.locked .tap,
.locked #beatsPerBar,
.locked #beatUnit,
.locked #subdivision,
.locked #accentFirst { opacity: .5; pointer-events: none; }
