/*
 * Kompakter Quintenzirkel (createQuintenzirkelKompakt aus
 * js/quintenzirkel-kompakt.js). Helle Karte im Board-Scale-Stil; Farben über
 * CSS-Variablen, die eine Seite bei Bedarf überschreiben kann. Die aktuelle
 * Tonart nutzt die Grundton-Farbe (wie Tonika im Zirkel und der
 * „Akkord abspielen"-Button im Töne-Panel).
 *
 * Selektoren sind bewusst zweistufig (.qzk .qzk__…), damit allgemeine
 * Regeln wie `.quintenzirkel-section button` nicht durchschlagen.
 */

.qzk {
    --qzk-accent: var(--color-root, #e53935);
    --qzk-accent-text: #fff;
    --qzk-bg: #fff;
    --qzk-text: #333;
    --qzk-muted: #777;
    --qzk-border: #d5d5d5;
    --qzk-hover: #f5f5f5;
    --qzk-tick: #d5d5d5;
    --qzk-toggle-active: var(--color-interval, #1976d2);

    box-sizing: border-box;
    width: 420px;
    max-width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: var(--qzk-bg);
    color: var(--qzk-text);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
    font-family: Arial, sans-serif;
    text-align: left;
}

/* ─── Obere Reihe: Quarte | aktuelle Tonart | Quinte ───────────────── */
.qzk .qzk__row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    height: 100px;
}

.qzk .qzk__step {
    flex: 0 0 76px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--qzk-border);
    border-radius: 12px;
    background: var(--qzk-bg);
    color: var(--qzk-text);
    font: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
}

.qzk .qzk__step:hover {
    background: var(--qzk-hover);
    border-color: #bbb;
}

.qzk .qzk__step:active {
    transform: scale(.97);
}

.qzk .qzk__step-key {
    font-size: 20px;
    font-weight: bold;
    white-space: nowrap;
}

.qzk .qzk__step-label {
    font-size: 12px;
    color: var(--qzk-muted);
    text-align: center;
    padding: 0 4px;
}

.qzk .qzk__current {
    flex: 1 1 0;
    min-width: 0;
    border-radius: 12px;
    background: var(--qzk-accent);
    color: var(--qzk-accent-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    transition: background .2s;
}

.qzk .qzk__current-title {
    font-size: 30px;
    font-weight: bold;
    line-height: 1;
}

.qzk .qzk__current-sub {
    font-size: 13px;
    padding: 0 6px;
}

/* ─── Leiste: Vorzeichen 6♭ … 6♯ bzw. chromatisch C … B (Spaltenzahl
       setzt das JS), beschriftet mit der Tonart ───────────────────────── */
.qzk .qzk__ticks {
    display: grid;
    grid-template-columns: repeat(13, minmax(0, 1fr));
    gap: 4px;
}

/* Balken + Tonname bilden zusammen eine klickbare Spalte. */
.qzk .qzk__tick {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    cursor: pointer;
}

.qzk .qzk__tick-track {
    height: 22px;
    display: flex;
    align-items: flex-end;
}

.qzk .qzk__tick-bar {
    display: block;
    width: 100%;
    height: 8px;
    border-radius: 3px;
    background: var(--qzk-tick);
    transition: height .2s, background .2s;
}

.qzk .qzk__tick--zero .qzk__tick-bar {
    height: 12px;
}

.qzk .qzk__tick-label {
    font-size: 11px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    color: var(--qzk-muted);
}

.qzk .qzk__tick:hover .qzk__tick-bar {
    background: #b5b5b5;
}

.qzk .qzk__tick:hover .qzk__tick-label {
    color: var(--qzk-text);
}

.qzk .qzk__tick.is-active .qzk__tick-bar {
    height: 22px;
    background: var(--qzk-accent);
}

.qzk .qzk__tick.is-active .qzk__tick-label {
    color: var(--qzk-accent);
    font-weight: bold;
}

/* ─── Kopfzeile: Reihenfolge-Schalter oben links ────────────────────── */
.qzk .qzk__head {
    display: flex;
    justify-content: flex-start;
    margin-bottom: -8px;
}

.qzk .qzk__head .qzk__mode-btn {
    padding: 4px 10px;
    font-size: 12px;
}

/* ─── Fußzeile: Dur/Moll + Hilfe ──────────────────────── */
.qzk .qzk__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.qzk .qzk__mode {
    display: flex;
    gap: 4px;
}

/* Gleiche Optik wie .toggle-group in base.css, etwas kompakter. */
.qzk .qzk__mode-btn {
    margin: 0;
    padding: 6px 14px;
    font: inherit;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #f5f5f5;
    color: var(--qzk-text);
    cursor: pointer;
}

.qzk .qzk__mode-btn.is-active {
    background: var(--qzk-toggle-active);
    border-color: var(--qzk-toggle-active);
    color: #fff;
}

/* Runder „?"-Link – wie .zirkel-help in scale-panel.css, aber im Fluss. */
.qzk .qzk__help {
    width: 30px;
    height: 30px;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f0f0f0;
    border: 1px solid #d5d5d5;
    color: #666;
    font: bold 16px/1 Arial, sans-serif;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s, transform .1s;
}

.qzk .qzk__help:hover {
    background: var(--color-root, #e53935);
    border-color: var(--color-root, #e53935);
    color: #fff;
    transform: scale(1.08);
}

.qzk button:focus-visible,
.qzk .qzk__help:focus-visible {
    outline: 2px solid var(--qzk-toggle-active);
    outline-offset: 2px;
}

/* Schmale Screens: Nachbar-Buttons etwas schmaler, Titel kleiner. */
@media (max-width: 420px) {
    .qzk {
        padding: 14px;
    }

    .qzk .qzk__step {
        flex-basis: 64px;
    }

    .qzk .qzk__current-title {
        font-size: 26px;
    }

    .qzk .qzk__mode-btn {
        padding: 6px 10px;
    }
}
