/* Gemeinsames Grundlayout, Navigation und Farbpalette für alle Seiten. */

:root {
    --bg: #f4f4f4;
    --fretboard-bg: #d8b07a;

    /* Tonfarben (zentral – sowohl CSS als auch JS lesen hieraus) */
    --color-root: #e53935;
    --color-interval: #1976d2;
    --color-third: #f9a825;
    --color-fifth: #1565c0;
    --color-scale: #43a047;

    /* Griffbrett-Linien */
    --string: #dcdcdc;
    --fret: #666;
    --nut: #222;
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg);
    margin: 0;
    padding-bottom: 40px;
}

h1 {
    text-align: center;
}

/* ── Navigation ─────────────────────────────── */
.topnav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
    margin-bottom: 24px;
}

.topnav a {
    text-decoration: none;
    color: #333;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: bold;
}

.topnav a:hover {
    background: #eee;
}

.topnav a.active {
    background: var(--color-interval);
    color: #fff;
}

/* ── Bedienelemente ─────────────────────────── */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

select {
    padding: 8px;
    font-size: 16px;
}

.toggle-group {
    display: flex;
    gap: 4px;
}

/* ── Schalter (Checkbox als Toggle) ─────────── */
.switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 39px;
    font-size: 16px;
    cursor: pointer;
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc;
    border-radius: 24px;
    transition: background .2s;
}

.switch-slider::before {
    content: "";
    position: absolute;
    left: 3px;
    bottom: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
}

.switch input:checked + .switch-slider {
    background: var(--color-interval);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(22px);
}

.toggle-group button {
    padding: 8px 14px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #f5f5f5;
    cursor: pointer;
}

.toggle-group button.active {
    background: var(--color-interval);
    border-color: var(--color-interval);
    color: #fff;
}

.function-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 2px 0 32px;
    padding: 14px 0;
    flex-wrap: wrap;
}

.function-buttons button {
    --wave-y: 0px;
    --wave-r: 0deg;
    padding: 8px 14px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #f5f5f5;
    cursor: pointer;
    transform: translateY(var(--wave-y)) rotate(var(--wave-r));
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

/* Leicht schlängelnde Anordnung: jeder Button etwas anders versetzt/gedreht */
.function-buttons button:nth-child(1) { --wave-y: 6px;   --wave-r: -1.5deg; }
.function-buttons button:nth-child(2) { --wave-y: -12px; --wave-r: 1deg; }
.function-buttons button:nth-child(3) { --wave-y: 8px;   --wave-r: -1deg; }
.function-buttons button:nth-child(4) { --wave-y: -10px; --wave-r: 1.5deg; }
.function-buttons button:nth-child(5) { --wave-y: 7px;   --wave-r: -1.2deg; }
.function-buttons button:nth-child(6) { --wave-y: -9px;  --wave-r: 1.3deg; }

.function-buttons button:hover {
    background: #e8e8e8;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
    transform: translateY(calc(var(--wave-y) - 4px)) rotate(var(--wave-r));
}

/* Auf schmalen Screens wird's zu eng für die Schlangenlinie */
@media (max-width: 640px) {
    .function-buttons button:nth-child(n) {
        --wave-y: 0px;
        --wave-r: 0deg;
    }
}

/* ── Legende & Infozeile ────────────────────── */
.legend {
    text-align: center;
    margin-top: 20px;
}

.legend span {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 6px;
    color: white;
    margin: 5px;
}

.info {
    text-align: center;
    margin-top: 15px;
    color: #444;
}

/* ── Erklärungs-Box (Einführungstexte, z.B. CAGED/Quintenzirkel) ────── */
.explainer-box {
    max-width: 760px;
    margin: 0 auto 24px;
    padding: 18px 24px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
    color: #333;
    line-height: 1.5;
}

.explainer-box h2 {
    margin-top: 0;
    color: var(--color-interval);
}

.explainer-box strong {
    color: var(--color-root);
}

/* ── Theorie-Hinweis für Einsteiger ─────────── */
.theory-hint {
    max-width: 760px;
    margin: -12px auto 24px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-left: 4px solid var(--color-scale);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
    color: #333;
    line-height: 1.45;
    margin-top: 15px;
}

.theory-hint .theory-hint-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.theory-hint p {
    margin: 0;
}

.theory-hint a {
    color: var(--color-scale);
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
}

.theory-hint a:hover {
    text-decoration: underline;
}

/* ── Griffbrett-Tipp-Box ────────────────────── */
.tip-box {
    max-width: 640px;
    margin: 20px auto 0;
    padding: 14px 18px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
    text-align: center;
    color: #333;
}

.tip-box strong {
    color: var(--color-interval);
}

.tip-caveat {
    margin-top: 8px;
    font-size: 13px;
    color: #888;
}

/* ── Startseite (Karten) ────────────────────── */
.thumbnail {
    display: block;
    max-width: 320px;
    width: 100%;
    height: auto;
    margin: 16px auto;
    border-radius: 12px;
}

.cards {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.card {
    display: block;
    width: 240px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
    text-decoration: none;
    color: inherit;
    transition: transform .15s, box-shadow .15s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
}

.card h2 {
    margin-top: 0;
}
