/* ========== SUBPAGE SHARED STYLES ========== */
/* Common nav, breadcrumb, body and footer for all static subpages */

/* ---- Static header & nav ---- */
.static-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.static-nav {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #ffffff;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.3s ease;
}

.static-nav.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

.static-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
}

.static-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #7c6ff7;
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 700;
    transition: color 0.2s ease;
}

.static-logo:hover {
    color: #6459d4;
}

.static-logo svg {
    flex-shrink: 0;
}

.static-links {
    display: flex;
    gap: 2px;
}

.static-links a {
    position: relative;
    color: #5a5a72;
    font-size: 0.84rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.static-links a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #7c6ff7;
    border-radius: 1px;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.static-links a:hover {
    color: #1a1a2e;
    background: rgba(124, 111, 247, 0.06);
    transform: translateY(-1px);
}

.static-links a:hover::after {
    width: 60%;
    left: 20%;
}

.static-links a:active {
    transform: translateY(0) scale(0.97);
}

.static-links a.active {
    color: #7c6ff7;
    background: rgba(124, 111, 247, 0.08);
    font-weight: 600;
}

.static-links a.active::after {
    width: 60%;
    left: 20%;
}

/* ---- Mobile burger for subpages ---- */
.static-burger {
    display: none;
    width: 38px;
    height: 38px;
    padding: 10px 8px;
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.static-burger:hover {
    background: rgba(124, 111, 247, 0.06);
    border-color: rgba(124, 111, 247, 0.2);
}

.static-burger:active {
    transform: scale(0.92);
}

.static-burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #5a5a72;
    border-radius: 2px;
    margin-bottom: 5px;
    transition: all 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    transform-origin: center;
}

.static-burger span:last-child { margin-bottom: 0; }

.static-burger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    background: #7c6ff7;
}
.static-burger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.static-burger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    background: #7c6ff7;
}

/* ---- Mobile menu ---- */
.static-mobile-menu {
    display: none;
    flex-direction: column;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 8px 24px 16px;
    animation: subpageMenuIn 0.25s ease forwards;
}

@keyframes subpageMenuIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.static-mobile-menu.open {
    display: flex;
}

.static-mobile-menu a {
    color: #2a2a3e;
    text-decoration: none;
    padding: 12px 0;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.static-mobile-menu a:last-child {
    border-bottom: none;
}

.static-mobile-menu a:hover {
    color: #7c6ff7;
    padding-left: 6px;
}

.static-mobile-menu a.active {
    color: #7c6ff7;
    font-weight: 600;
}

@media (max-width: 600px) {
    .static-links { display: none; }
    .static-burger { display: block; }
    .static-logo span { font-size: 0.9rem; }
}

/* ---- Subpage body override ---- */
body {
    background: #ffffff;
    color: #1a1a2e;
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    line-height: 1.7;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    color: #1a1a2e;
}

/* ---- Breadcrumb (subpages) ---- */
.breadcrumb {
    font-size: 0.9rem;
    color: #6a6a84;
    margin-bottom: 1.5rem;
    padding: 1rem 2rem;
    max-width: 900px;
}

.breadcrumb a {
    color: #7c6ff7;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #6459d4;
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 0.4rem;
    color: #999;
}

/* ---- Site footer (subpages) ---- */
.site-footer {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    border-top: 1px solid rgba(124, 111, 247, 0.12);
    text-align: center;
    color: #6a6a84;
    font-size: 0.9rem;
}

/* ---- Glossary styles ---- */
.glossary-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.glossary-h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1rem;
    line-height: 1.25;
}

.glossary-intro {
    font-size: 1.1rem;
    color: #6a6a84;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 720px;
}

.glossary-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 3rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(124, 111, 247, 0.15);
}

.glossary-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.5rem;
    background: rgba(124, 111, 247, 0.08);
    color: #7c6ff7;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, transform 0.15s;
}

.glossary-nav a:hover {
    background: #7c6ff7;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(124, 111, 247, 0.25);
}

.letter-section {
    margin-bottom: 2.5rem;
}

.letter-heading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 0.6rem;
    background: linear-gradient(135deg, #7c6ff7, #6355d8);
    color: #fff;
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    box-shadow: 0 4px 12px rgba(124, 111, 247, 0.2);
}

.glossary-list {
    margin: 0;
    padding: 0;
}

.glossary-list dt {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: #7c6ff7;
    margin-top: 1.2rem;
    margin-bottom: 0.3rem;
    padding-left: 0.25rem;
}

.glossary-list dt:first-of-type {
    margin-top: 0;
}

.glossary-list dd {
    margin: 0 0 0.8rem 0;
    padding-left: 1rem;
    color: #5a5a72;
    line-height: 1.65;
    font-size: 0.98rem;
    border-left: 2px solid rgba(124, 111, 247, 0.15);
}

.glossary-list dd a {
    color: #7c6ff7;
    text-decoration: none;
    border-bottom: 1px solid rgba(124, 111, 247, 0.25);
    transition: color 0.2s, border-color 0.2s;
}

.glossary-list dd a:hover {
    color: #6459d4;
    border-bottom-color: #6459d4;
}

@media (max-width: 600px) {
    .glossary-h1 { font-size: 1.6rem; }
    .glossary-nav a { width: 2rem; height: 2rem; font-size: 0.85rem; }
    .letter-heading { width: 2.4rem; height: 2.4rem; font-size: 1.2rem; }
}

/* ---- Theorie index cards ---- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background: #f8f8fc;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    color: #1a1a2e;
    transition: border-color 0.3s, transform 0.2s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    border-color: #7c6ff7;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(124, 111, 247, 0.08);
}

.card .icon {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.card h2 {
    font-size: 1.3rem;
    margin: 0 0 0.6rem 0;
    font-family: 'Playfair Display', serif;
}

.card p {
    font-size: 0.95rem;
    color: #6a6a84;
    margin: 0;
    flex-grow: 1;
}

.card .arrow {
    margin-top: 1.2rem;
    color: #7c6ff7;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ---- Outils index cards ---- */
.tools-intro {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 48px;
    color: #6a6a84;
    font-size: 1.1rem;
    line-height: 1.7;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 64px;
}

.tool-card {
    background: #f8f8fc;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 36px 32px;
    text-decoration: none;
    color: #1a1a2e;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tool-card:hover {
    background: #f0f0f8;
    border-color: rgba(124, 111, 247, 0.35);
    box-shadow: 0 0 40px rgba(124, 111, 247, 0.06), 0 8px 32px rgba(0, 0, 0, 0.06);
    transform: translateY(-4px);
}

.tool-card-icon {
    font-size: 2.8rem;
    line-height: 1;
}

.tool-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.tool-card:hover h2 {
    color: #6459d4;
}

.tool-card p {
    color: #6a6a84;
    font-size: 0.95rem;
    line-height: 1.65;
    margin: 0;
}

.tool-card-arrow {
    margin-top: auto;
    padding-top: 8px;
    color: #7c6ff7;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-card:hover .tool-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ---- Subpage footer ---- */
.subpage-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    text-align: center;
    padding: 2rem;
    color: #6a6a84;
    font-size: 0.85rem;
    margin-top: 4rem;
}

@media (max-width: 768px) {
    .tools-grid { grid-template-columns: 1fr; gap: 16px; }
    .tool-card { padding: 28px 24px; }
    .tool-card-icon { font-size: 2.2rem; }
    .tool-card h2 { font-size: 1.15rem; }
}

@media (max-width: 600px) {
    h1 { font-size: 1.8rem; }
    .cards-grid { grid-template-columns: 1fr; }
}

/* ========== SHARED TOOL PAGE STYLES ========== */

/* ---- Common: main, intro, footer ---- */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

main h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1.2rem;
}

main h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 2rem 0 1rem;
}

.intro, .intro-text {
    color: #5a5a72;
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 2rem;
}

.intro p, .intro-text p {
    margin-bottom: 1rem;
}

.content-section {
    margin-top: 3rem;
    color: #5a5a72;
    line-height: 1.75;
}

.content-section h2 {
    color: #1a1a2e;
    margin-top: 2.5rem;
    margin-bottom: 0.8rem;
}

.content-section p {
    margin-bottom: 1rem;
}

/* ----- Liste des types d'accords (piano virtuel) ----- */
.chord-types-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1.4rem;
}
.chord-types-list li {
    padding-left: 1rem;
    position: relative;
    line-height: 1.55;
}
.chord-types-list li::before {
    content: "♪";
    position: absolute;
    left: 0;
    color: #7c6ff7;
    font-weight: 700;
}
.chord-types-list a {
    color: #7c6ff7;
    text-decoration: none;
}
.chord-types-list a:hover {
    text-decoration: underline;
}

/* ----- Table des accords populaires ----- */
.popular-chords-wrap {
    overflow-x: auto;
    margin: 1rem 0 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(124, 111, 247, 0.18);
}
.popular-chords {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 0.95rem;
}
.popular-chords thead th {
    background: #f5f3ff;
    color: #1a1a2e;
    text-align: left;
    padding: 12px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(124, 111, 247, 0.18);
}
.popular-chords td {
    padding: 11px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    color: #1a1a2e;
    vertical-align: middle;
}
.popular-chords tbody tr:last-child td {
    border-bottom: none;
}
.popular-chords tbody tr:hover {
    background: #faf9ff;
}
.popular-chords a {
    color: #7c6ff7;
    text-decoration: none;
    font-weight: 600;
}
.popular-chords a:hover {
    text-decoration: underline;
}
.popular-chords kbd {
    display: inline-block;
    min-width: 22px;
    padding: 2px 7px;
    margin: 0 1px;
    border: 1px solid #c8c8d8;
    border-bottom-width: 2px;
    border-radius: 5px;
    background: #f8f8fc;
    color: #1a1a2e;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
}

/* ----- FAQ accordéon ----- */
.faq-list {
    margin: 1rem 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.faq-item {
    background: #ffffff;
    border: 1px solid rgba(124, 111, 247, 0.18);
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.faq-item[open] {
    border-color: rgba(124, 111, 247, 0.5);
    box-shadow: 0 4px 16px rgba(124, 111, 247, 0.08);
}
.faq-item summary {
    padding: 14px 18px;
    font-weight: 600;
    color: #1a1a2e;
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-right: 44px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #7c6ff7;
    font-size: 1.4rem;
    font-weight: 600;
    transition: transform 0.2s;
}
.faq-item[open] summary::after {
    content: "−";
}
.faq-item p {
    padding: 0 18px 16px;
    margin: 0;
    color: #5a5a72;
    line-height: 1.65;
}

@media (max-width: 600px) {
    .chord-types-list {
        grid-template-columns: 1fr;
    }
    .popular-chords thead th,
    .popular-chords td {
        padding: 9px 10px;
        font-size: 0.85rem;
    }
}

footer {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    border-top: 1px solid rgba(124, 111, 247, 0.12);
    text-align: center;
    color: #6a6a84;
    font-size: 0.9rem;
}

footer a {
    color: #7c6ff7;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ========== PIANO VIRTUEL ========== */

.piano-container {
    background: #f8f8fc;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
}

.chord-display {
    text-align: center;
    margin-bottom: 1.5rem;
    /* Fixed dimensions — no layout shift when a chord is detected */
    height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.chord-display .chord-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.3rem;
    height: 2.2rem;
    line-height: 2.2rem;
}

.chord-display .chord-hint {
    height: 1.2rem;
    line-height: 1.2rem;
}

.chord-display .chord-name a {
    color: #7c6ff7;
    text-decoration: none;
    transition: color 0.2s;
}

.chord-display .chord-name a:hover {
    color: #6459d4;
    text-decoration: underline;
}

.chord-hint {
    font-size: 0.9rem;
    color: #6a6a84;
}

.chord-hint a {
    color: #6a6a84;
    text-decoration: underline;
}

.piano-svg-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
}

#pianoSvg {
    display: block;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* SVG piano keys */
.white-key {
    fill: #ffffff;
    stroke: #c8c8d8;
    stroke-width: 1;
    cursor: pointer;
    transition: fill 0.1s;
}

.white-key:hover {
    fill: #f0eeff;
}

.white-key.active {
    fill: #7c6ff7;
}

.white-key.memorized {
    fill: #d4cffa;
}

.black-key {
    fill: #1a1a2e;
    stroke: #0d0d1a;
    stroke-width: 0.5;
    cursor: pointer;
    transition: fill 0.1s;
}

.black-key:hover {
    fill: #2d2d4e;
}

.black-key.active {
    fill: #9d93fa;
}

.black-key.memorized {
    fill: #6355d8;
}

.key-label {
    fill: #6a6a84;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    text-anchor: middle;
    pointer-events: none;
    user-select: none;
}

.key-shortcut {
    fill: #b0b0c0;
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 600;
    text-anchor: middle;
    pointer-events: none;
    user-select: none;
}

.black-key-label {
    fill: rgba(255, 255, 255, 0.6);
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 600;
    text-anchor: middle;
    pointer-events: none;
    user-select: none;
}

/* Piano controls */
.piano-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.control-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6a6a84;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sustain-btn {
    padding: 6px 20px;
    border: 1px solid rgba(124, 111, 247, 0.3);
    border-radius: 8px;
    background: #ffffff;
    color: #7c6ff7;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    /* Stable width — no shift when label changes (Off ↔ On) */
    min-width: 90px;
    text-align: center;
}

.sustain-btn:hover {
    background: rgba(124, 111, 247, 0.06);
    border-color: #7c6ff7;
}

.sustain-btn.active {
    background: #7c6ff7;
    color: #ffffff;
    border-color: #7c6ff7;
}

.volume-slider {
    width: 120px;
    accent-color: #7c6ff7;
    cursor: pointer;
}

/* ========== RECHERCHE ACCORD ========== */

.tool-section {
    margin: 2rem 0;
}

.piano-keyboard {
    display: block;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

/* Recherche: selected state for white/black keys */
.white-key.selected {
    fill: #7c6ff7;
}

.black-key.selected {
    fill: #9d93fa;
}

.selected-label {
    fill: #ffffff !important;
}

.black-label {
    fill: rgba(255, 255, 255, 0.5);
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
    text-anchor: middle;
    pointer-events: none;
    user-select: none;
}

.selected-notes {
    text-align: center;
    margin: 1.5rem 0 1rem;
    font-size: 1rem;
    color: #5a5a72;
}

.btn-reset {
    display: block;
    margin: 0 auto 2rem;
    padding: 8px 24px;
    background: #ffffff;
    border: 1px solid rgba(124, 111, 247, 0.3);
    border-radius: 8px;
    color: #7c6ff7;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset:hover {
    background: rgba(124, 111, 247, 0.06);
    border-color: #7c6ff7;
}

.results-section {
    margin-top: 2rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.result-card {
    background: #f8f8fc;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 1.2rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.result-card:hover {
    border-color: rgba(124, 111, 247, 0.35);
    box-shadow: 0 4px 16px rgba(124, 111, 247, 0.08);
}

.result-card .chord-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.4rem;
}

.result-card .chord-notes {
    font-size: 0.9rem;
    color: #6a6a84;
    margin-bottom: 0.5rem;
}

.chord-link {
    display: inline-block;
    color: #7c6ff7;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.chord-link:hover {
    color: #6459d4;
    text-decoration: underline;
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: #6a6a84;
    font-size: 0.95rem;
}

/* ========== QUIZ ========== */

.selector-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.selector-row label {
    font-weight: 600;
    color: #5a5a72;
    font-size: 0.9rem;
    min-width: 110px;
}

.selector-btn {
    padding: 7px 16px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    background: #ffffff;
    color: #5a5a72;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.selector-btn:hover {
    border-color: rgba(124, 111, 247, 0.3);
    color: #7c6ff7;
    background: rgba(124, 111, 247, 0.04);
}

.selector-btn.active {
    background: #7c6ff7;
    color: #ffffff;
    border-color: #7c6ff7;
    font-weight: 600;
}

.score-bar {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    padding: 1rem 1.2rem;
    background: #f8f8fc;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.score-item {
    font-size: 0.9rem;
    color: #5a5a72;
}

.score-item.best {
    margin-left: auto;
    color: #7c6ff7;
}

.quiz-card {
    background: #f8f8fc;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.quiz-prompt-label {
    font-size: 0.9rem;
    color: #6a6a84;
    margin-bottom: 0.5rem;
}

.quiz-prompt {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1.5rem;
}

.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    max-width: 500px;
    margin: 0 auto 1.5rem;
}

.answer-btn {
    padding: 12px 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    background: #ffffff;
    color: #1a1a2e;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.answer-btn:hover:not(.disabled) {
    border-color: #7c6ff7;
    background: rgba(124, 111, 247, 0.04);
    transform: translateY(-1px);
}

.answer-btn.correct {
    border-color: #16a34a;
    background: rgba(22, 163, 74, 0.08);
    color: #16a34a;
    font-weight: 700;
}

.answer-btn.wrong {
    border-color: #e11d48;
    background: rgba(225, 29, 72, 0.06);
    color: #e11d48;
}

.answer-btn.disabled {
    cursor: default;
    opacity: 0.7;
}

.feedback {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    min-height: 1.5rem;
}

.feedback.is-correct {
    color: #16a34a;
}

.feedback.is-wrong {
    color: #e11d48;
}

.actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
}

.btn-primary {
    padding: 10px 24px;
    background: #7c6ff7;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #6459d4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 111, 247, 0.25);
}

.btn-secondary {
    padding: 10px 24px;
    background: #ffffff;
    color: #7c6ff7;
    border: 1px solid rgba(124, 111, 247, 0.3);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(124, 111, 247, 0.06);
    border-color: #7c6ff7;
}

/* ========== TRANSPOSITION ========== */

.tool-card h2 {
    margin-top: 0;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #5a5a72;
    margin-bottom: 0.4rem;
}

.input-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #1a1a2e;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: #7c6ff7;
    box-shadow: 0 0 0 3px rgba(124, 111, 247, 0.1);
}

.input-group input[type="text"]::placeholder {
    color: #b0b0c0;
}

.slider-container {
    margin-bottom: 1.5rem;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.slider-label label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #5a5a72;
}

.slider-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #7c6ff7;
}

.slider-container input[type="range"] {
    width: 100%;
    accent-color: #7c6ff7;
    cursor: pointer;
}

.separator-text {
    text-align: center;
    color: #b0b0c0;
    font-size: 0.85rem;
    margin: 1.5rem 0;
    position: relative;
}

.separator-text::before,
.separator-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
}

.separator-text::before { left: 0; }
.separator-text::after { right: 0; }

.key-selector {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.key-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.key-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6a6a84;
}

.key-group select {
    padding: 10px 14px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #1a1a2e;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.key-group select:focus {
    outline: none;
    border-color: #7c6ff7;
}

.key-selector .arrow {
    font-size: 1.5rem;
    color: #7c6ff7;
    padding-bottom: 6px;
}

.btn-group {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
}

.btn {
    padding: 10px 24px;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn.btn-primary {
    background: #7c6ff7;
    color: #ffffff;
}

.btn.btn-primary:hover {
    background: #6459d4;
}

.btn.btn-secondary {
    background: #ffffff;
    color: #7c6ff7;
    border: 1px solid rgba(124, 111, 247, 0.3);
}

.btn.btn-secondary:hover {
    background: rgba(124, 111, 247, 0.06);
}

/* Transposition results */
.results-section.visible {
    display: block;
}

.tool-card.results-section {
    display: none;
}

.tool-card.results-section.visible {
    display: block;
}

.results-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
}

.results-arrow {
    text-align: center;
    font-size: 1.5rem;
    color: #7c6ff7;
    margin: 0.8rem 0;
}

.chord-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
}

.chord-badge.chord-original {
    background: rgba(0, 0, 0, 0.05);
    color: #5a5a72;
}

.chord-badge.chord-transposed {
    background: rgba(124, 111, 247, 0.1);
    color: #7c6ff7;
}

.chord-badge.chord-transposed a {
    color: #7c6ff7;
    text-decoration: none;
}

.chord-badge.chord-transposed a:hover {
    text-decoration: underline;
}

.comparison {
    margin-top: 2rem;
}

.comparison table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.comparison th {
    text-align: left;
    padding: 10px 14px;
    background: rgba(124, 111, 247, 0.06);
    color: #5a5a72;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.comparison td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    color: #1a1a2e;
}

/* ========== RESPONSIVE: TOOL PAGES ========== */

@media (max-width: 768px) {
    .piano-controls {
        gap: 1.2rem;
    }

    .answers-grid {
        grid-template-columns: 1fr;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .key-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .key-selector .arrow {
        text-align: center;
        padding: 0;
    }
}

@media (max-width: 600px) {
    main {
        padding: 0 1rem 3rem;
    }

    main h1 {
        font-size: 1.6rem;
    }

    .piano-container {
        /* Full-screen-width box on mobile so the keys are as large as possible */
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        border-left: none;
        border-right: none;
        border-radius: 0;
        padding: 0.85rem 0.5rem 1rem;
    }

    .piano-container .chord-display {
        height: 56px;
        margin-bottom: 0.6rem;
    }

    .piano-container .piano-controls {
        margin-top: 0.8rem;
        gap: 0.9rem;
    }

    .piano-container .control-group {
        gap: 0.25rem;
    }

    .piano-container .control-group label {
        font-size: 0.68rem;
    }

    .piano-container .sustain-btn {
        padding: 5px 10px;
        font-size: 0.78rem;
        min-width: 72px;
    }

    .piano-container .volume-slider {
        width: 90px;
    }

    .quiz-card {
        padding: 1.2rem;
    }

    .quiz-prompt {
        font-size: 1.4rem;
    }

    .chord-display .chord-name {
        font-size: 1.4rem;
        height: 1.9rem;
        line-height: 1.9rem;
    }

    .selector-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .score-bar {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .score-item.best {
        margin-left: 0;
    }
}

/* ---- Scroll shadow (auto-init) ---- */
/* Inline script for subpages: */
/* <script>window.addEventListener('scroll',()=>document.querySelector('.static-nav')?.classList.toggle('scrolled',scrollY>8),{passive:true})</script> */
