/* ── Circle of Fifths page ── */

.circle-wrap {
    width: 100%;
    margin: 0;
    padding: 1rem 1.5rem 1.5rem;
    min-height: calc(100vh - 56px);
    display: flex;
    align-items: stretch;
}

.circle-layout {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 0;
}

/* ── SVG container ── */
#circleContainer {
    flex: 1 1 0;
    min-width: 0;
    max-width: min(55vw, 560px);
    align-self: center;
}
#circleSvg { width: 100%; height: auto; display: block; }

/* ── Segments ── */
.cof-segment {
    cursor: pointer;
    transition: filter .2s, opacity .2s;
    stroke: #fff;
    stroke-width: 2;
    outline: none;
}
.cof-segment:hover {
    filter: brightness(.88) drop-shadow(0 0 6px rgba(0,0,0,.15));
}
.cof-segment.selected {
    filter: brightness(.78) drop-shadow(0 2px 8px rgba(0,0,0,.3));
    stroke-width: 2.5;
}
.cof-segment.related {
    filter: brightness(.84);
    stroke: #0d9488;
    stroke-width: 3;
}

/* ── SVG text labels ── */
.cof-label {
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: 700;
    fill: #1e293b;
    pointer-events: none;
    user-select: none;
}
.cof-label-major { font-size: 18px; }
.cof-label-minor { font-size: 14px; fill: #475569; font-weight: 600; }
.cof-label-selected { fill: #fff; }
.cof-label-center {
    font-size: 16px;
    fill: #64748b;
    font-weight: 600;
}

/* ── Info panel ── */
#infoPanel {
    flex: 0 1 380px;
    min-width: 260px;
    border-radius: 1rem;
    background: rgba(255,255,255,.80);
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    border: none;
}

.info-section {
    padding: .75rem 0;
    border-bottom: 1px solid rgba(0,0,0,.06);
}
.info-section:last-child { border-bottom: none; }

.info-section-title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #94a3b8;
    margin-bottom: .4rem;
}

.key-name {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.2;
}

.signature-symbols {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: .15em;
}
.sig-sharp { color: #0d9488; }
.sig-flat { color: #6366f1; }

.sig-notes {
    font-size: .85rem;
    color: #64748b;
}

.chord-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.chord-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: .3rem .55rem;
    border-radius: .6rem;
    background: rgba(13,148,136,.08);
    font-weight: 600;
    font-size: .82rem;
    line-height: 1.2;
    min-width: 44px;
    text-align: center;
}
.chord-badge .roman {
    font-size: .6rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
}
.chord-badge.chord-link { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.chord-badge.chord-link:hover { transform: translateY(-2px); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.chord-badge.tonic {
    background: #0d9488;
    color: #fff;
}
.chord-badge.tonic .roman { color: rgba(255,255,255,.7); }

.related-key-link {
    color: #0d9488;
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}
.related-key-link:hover { color: #0f766e; }

/* ── Play button ── */
.btn-play-scale {
    border-radius: 2rem;
    font-size: .8rem;
    padding: .3rem .8rem;
}

/* ── Empty state ── */
.info-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #94a3b8;
}
.info-empty i { font-size: 2rem; margin-bottom: .5rem; display: block; }

/* ── Responsive ── */

/* Stacked layout on tablets and below */
@media (max-width: 991.98px) {
    .circle-wrap {
        min-height: auto;
        padding: .75rem 1rem 2rem;
    }
    .circle-layout {
        flex-direction: column;
        align-items: center;
    }
    #circleContainer {
        max-width: min(80vw, 480px);
    }
    #infoPanel {
        flex: none;
        width: 100%;
        max-width: 520px;
    }
}

/* Small phones */
@media (max-width: 575.98px) {
    .circle-wrap { padding: .5rem .5rem 1.5rem; }
    #circleContainer { max-width: min(90vw, 380px); }
    .cof-label-major { font-size: 14px; }
    .cof-label-minor { font-size: 11px; }
    .key-name { font-size: 1.4rem; }
    .chord-badge { min-width: 38px; padding: .25rem .4rem; font-size: .78rem; }
}

/* Large desktops */
@media (min-width: 1400px) {
    #circleContainer { max-width: 600px; }
    #infoPanel { flex: 0 1 420px; }
}
