/*
 * Party: Tempoverlauf, Tanzflächen-Knöpfe, Anzeige-Vorschau, Set teilen, Controller.
 * Farben aus styles.css (:root).
 */

/* Kopfzeile: Knopf „Anzeige“ */
.display-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 22%, var(--panel-2)); border-color: var(--accent); }

/* ---------- Tempoverlauf ---------- */
.tf-panel { display: flex; flex-direction: column; gap: 4px; height: 100%; min-height: 150px; padding: 4px 10px 6px; box-sizing: border-box; }
.tf-info { color: var(--muted); }
.tf-canvas { flex: 1 1 auto; width: 100%; min-height: 80px; display: block; background: var(--bg); border-radius: 6px; }
.tf-warn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tf-w { font-size: 12px; color: var(--warn); padding-left: 16px; position: relative; }
.tf-w::before { content: "⚠"; position: absolute; left: 0; }
.tf-w.planned { color: var(--muted); }
.tf-w.planned::before { content: "◌"; }

/* ---------- Tanzfläche am laufenden Deck ---------- */
.floor-btns { display: flex; gap: 4px; flex: none; }
.deck-head .floor-btns button { padding: 3px 9px; font-size: 13px; font-weight: 800; line-height: 1.25; }
.floor-full[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #0f2414; }
.floor-empty[aria-pressed="true"] { background: #e5776b; border-color: #e5776b; color: #2a0f0b; }

/* ---------- Anzeige-Vorschau ---------- */
.dp-panel { display: flex; flex-direction: column; gap: 6px; }
.dp-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dp-bar button { padding: 4px 9px; }
.dp-bar button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.dp-text { flex: 1 1 140px; min-width: 120px; padding: 4px 8px; }
.dp-note { margin: 0; }

/* Verkleinerte Publikumsanzeige: dieselbe Aufteilung wie anzeige.css, in Container-Einheiten. */
.dp-stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; container-type: size; overflow: hidden;
  background: #14110f; color: #f3e9dc; border-radius: 6px; border: 1px solid var(--line); font-weight: 700;
}
.dp-stage > div { position: absolute; inset: 0; padding: 4cqh; }
.dp-idle, .dp-now, .dp-timer { display: none; }
.dp-stage[data-mode="idle"] .dp-idle { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 3cqh; }
.dp-idle-party { font-size: 14cqh; font-weight: 800; color: var(--accent); line-height: 1.05; }
.dp-idle-text { font-size: 7cqh; }
.dp-stage[data-mode="timer"] .dp-timer { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2cqh; }
.dp-timer-label { font-size: 8cqh; }
.dp-timer-time { font-size: 44cqh; font-weight: 900; line-height: 0.9; color: var(--accent); font-variant-numeric: tabular-nums; }
.dp-stage[data-mode="now"] .dp-now {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "party party" "bpm media" "text text"; column-gap: 4cqw; row-gap: 1.5cqh;
}
.dp-stage[data-media="none"] .dp-now { grid-template-columns: minmax(0, 1fr); grid-template-areas: "party" "bpm" "text"; }
.dp-stage[data-media="none"] .dp-media { display: none; }
.dp-party { grid-area: party; font-size: 3.4cqh; color: #a8998a; min-height: 0; }
.dp-bpm-box { grid-area: bpm; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.dp-stage[data-media="none"] .dp-bpm-box { align-items: center; }
.dp-bpm { font-size: min(40cqh, 25cqw); font-weight: 900; line-height: 0.85; color: var(--accent); font-variant-numeric: tabular-nums; }
.dp-unit { font-size: 7cqh; letter-spacing: 0.12em; margin-top: 1.5cqh; }
.dp-media { grid-area: media; position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; }
.dp-cover, .dp-photo { display: block; border-radius: 1.5cqh; object-fit: cover; }
.dp-cover { height: 100%; max-width: 100%; aspect-ratio: 1; }
.dp-photo { width: 100%; height: 100%; }
.dp-stage[data-photo="yes"] .dp-cover { position: absolute; left: 1.5cqh; bottom: 1.5cqh; height: 40%; width: auto; border: 0.8cqh solid #14110f; }
.dp-text-box { grid-area: text; min-width: 0; display: flex; flex-direction: column; gap: 0.8cqh; }
.dp-title { font-size: 9cqh; font-weight: 800; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-artist { font-size: 5.5cqh; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-saying { font-size: 4cqh; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-credit { position: absolute; right: 4cqh; bottom: 1.6cqh; max-width: 60%; font-size: 2.2cqh; color: #a8998a; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-line { position: absolute; left: 0; right: 0; bottom: 0; height: 0.9cqh; background: #26201c; }
.dp-fill { height: 100%; width: 0; background: var(--accent); opacity: 0.7; }
.dp-stage > .dp-badge {
  inset: auto; top: 1.5cqh; right: 1.5cqh; padding: 0.6cqh 1.6cqh; border-radius: 1cqh;
  background: var(--accent); color: var(--accent-ink); font-size: 3.6cqh; font-weight: 800;
}


/* ---------- Set teilen ---------- */
.set-text { width: 100%; font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.set-msg { min-height: 1.4em; margin-top: 6px; }
.set-msg .ok, .set-msg.ok { color: var(--ok); }
.set-msg .warn, .set-msg.warn { color: var(--warn); }
.set-missing { margin: 4px 0 0; padding-left: 18px; max-height: 120px; overflow: auto; }

/* ---------- Controller ---------- */
dialog.ctrl-dialog { width: min(980px, 94vw); }
.ctrl-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.ctrl-tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.ctrl-devs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.ctrl-dev { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.ctrl-dev h4 { margin: 0 0 4px; }
.ctrl-dev p { margin: 4px 0; }
.ctrl-learn { background: color-mix(in srgb, var(--accent) 20%, var(--panel-2)); border: 1px solid var(--accent); border-radius: 6px; padding: 6px 10px; font-weight: 700; }
.ctrl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ctrl-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.ctrl-table td { padding: 3px 6px; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.ctrl-table tr.learning td { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.ctrl-btns { white-space: nowrap; text-align: right; }
.ctrl-btns button { padding: 2px 8px; font-size: 12px; }
.ctrl-test h4 { margin: 12px 0 6px; }
.ctrl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.ctrl-cell { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; }
.ctrl-cell.recent { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ctrl-bar { height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.ctrl-fill { height: 100%; background: var(--accent); }
.ctrl-lamp { width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); }
.ctrl-lamp.on { background: #ff5b4a; border-color: #ff8a7d; box-shadow: 0 0 8px #ff5b4a; }
.ctrl-raw { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 11px; max-height: 160px; overflow: auto; white-space: pre-wrap; word-break: break-all; }

/* Autoplay-Optionen: Wellen von … bis … braucht zwei Spalten */
.ap-grid .ap-wave-range { grid-column: span 2; }
#ap-dialog .ap-grid .ap-wave-range input[type="number"] { width: 72px; }
.ctrl-table { table-layout: fixed; }
.ctrl-table th:nth-child(1) { width: 33%; }
.ctrl-table th:nth-child(2) { width: 24%; }
.ctrl-table th:nth-child(3) { width: 22%; }
.ctrl-table th:nth-child(4) { width: 21%; }
.ctrl-table td { overflow-wrap: anywhere; }
.ctrl-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* Einstellungen „Party und Anzeige“ */
#s-party label.check { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--text); margin: 4px 0; }
#s-party input[type="number"] { width: 80px; }
