/* ==========================================================================
   GOONS - pages /piano-chords/ et /piano-scales/ (includes/piano-theory-render.php)
   En plus de play.css, lp.css et piano-sheet.css : la scène jouable (portée +
   piano public + boutons), les renversements, les accords d'une tonalité, les
   tableaux, les pastilles de liens. Le thème piano a un accent gris : les
   actions principales prennent le dégradé du site, les repères le cyan.
   ========================================================================== */

.theory-stage {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}

.theory-staff {
    position: relative;
    height: 150px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.32);
    --gst-bg: #07070f;
    --gst-accent: #00e5ff;
    --gst-font: var(--play-font, system-ui, sans-serif);
}

.theory-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.theory-btn {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--play-border-strong, rgba(255, 255, 255, 0.18));
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.theory-btn:hover, .theory-btn:focus-visible { border-color: var(--play-cyan, #00e5ff); }
.theory-btn--primary {
    border-color: transparent;
    background: linear-gradient(102deg, var(--play-magenta, #ff2bd6), var(--play-cyan, #00e5ff));
    color: #05050a;
}
.theory-btn--ghost { background: transparent; }
.theory-btn--sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.theory-btn.is-playing { box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.45); }

.theory-tempo, .theory-metro, .theory-select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--play-muted, rgba(232, 236, 255, 0.72));
    font-size: 13px;
    font-weight: 600;
}
.theory-tempo output { min-width: 62px; color: #fff; font-family: var(--play-mono, monospace); }
.theory-select select {
    height: 38px;
    padding: 0 30px 0 12px;
    border: 1px solid var(--play-border-strong, rgba(255, 255, 255, 0.18));
    border-radius: 10px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(0, 0, 0, 0.45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23e8ecff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center / 10px 6px;
    color: #fff;
    color-scheme: dark;
    font: inherit;
    font-size: 14px;
}
.theory-select option { background: #0b0b16; color: #fff; }

.theory-alt { margin: 6px 0 0; color: var(--play-muted, rgba(232, 236, 255, 0.72)); font-size: 15px; }
.theory-alt b { color: #fff; }

/* Chercheurs */
.theory-finder { flex: 1 1 100%; }
.theory-finder-name { margin: 0; min-height: 34px; font-size: clamp(22px, 3vw, 30px); font-weight: 800; color: #fff; }
.theory-finder-notes { margin: 2px 0 0; min-height: 20px; color: var(--play-muted, rgba(232, 236, 255, 0.72)); font-family: var(--play-mono, monospace); }
.lp-page .theory-finder-link { display: inline-block; margin-top: 6px; color: var(--play-cyan, #00e5ff); font-weight: 700; }

/* Tableaux */
.theory-table td, .theory-table th { white-space: nowrap; }
.theory-table small { color: var(--play-muted, rgba(232, 236, 255, 0.6)); font-weight: 500; }
.theory-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.theory-grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.theory-grid th, .theory-grid td { padding: 8px 10px; border-bottom: 1px solid var(--play-border, rgba(255, 255, 255, 0.09)); text-align: left; white-space: nowrap; }
.theory-grid thead th { color: var(--play-muted, rgba(232, 236, 255, 0.62)); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.lp-page .theory-grid a { color: #fff; text-decoration: none; font-weight: 600; }
.lp-page .theory-grid a:hover, .lp-page .theory-grid a:focus-visible { color: var(--play-cyan, #00e5ff); text-decoration: underline; }

/* Renversements */
.theory-invs { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.theory-inv {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--play-border, rgba(255, 255, 255, 0.09));
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}
.theory-inv h3 { margin: 0; font-size: 15px; color: #fff; }
.theory-inv h3 span { margin-left: 6px; color: var(--play-cyan, #00e5ff); font-family: var(--play-mono, monospace); }
.theory-inv .lps { max-height: 130px; }
.theory-inv-notes { margin: 0; font-family: var(--play-mono, monospace); color: #fff; }
.theory-fingers { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; color: var(--play-muted, rgba(232, 236, 255, 0.72)); font-size: 13.5px; }
.theory-fingers b { color: #fff; font-family: var(--play-mono, monospace); }
.theory-heard { margin: 0; color: var(--play-muted, rgba(232, 236, 255, 0.65)); font-size: 13px; }
.theory-heard b { color: #fbbf24; }
.theory-inv .theory-btn { align-self: flex-start; }

/* Pastilles de liens */
.theory-sub { margin: 18px 0 8px; font-size: 14px; color: var(--play-muted, rgba(232, 236, 255, 0.72)); font-weight: 700; letter-spacing: 0.03em; }
.theory-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.lp-page .theory-chips a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--play-border, rgba(255, 255, 255, 0.12));
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}
.lp-page .theory-chips a:hover, .lp-page .theory-chips a:focus-visible { border-color: var(--play-cyan, #00e5ff); color: var(--play-cyan, #00e5ff); }

/* Accords d'une tonalité */
.theory-keychords { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.theory-keychord {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--play-border, rgba(255, 255, 255, 0.09));
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}
.theory-roman { color: var(--play-cyan, #00e5ff); font: 800 13px/1 var(--play-mono, monospace); }
.theory-keychord b { font-size: 18px; color: #fff; }
.lp-page .theory-keychord b a { color: #fff; text-decoration: none; }
.lp-page .theory-keychord b a:hover { text-decoration: underline; }
.theory-keychord-notes { color: var(--play-muted, rgba(232, 236, 255, 0.72)); font-family: var(--play-mono, monospace); font-size: 13px; }
.theory-keychord .theory-btn { align-self: flex-start; margin-top: 4px; }
.theory-progressions { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.theory-progressions li { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 10px 14px; border: 1px solid var(--play-border, rgba(255, 255, 255, 0.09)); border-radius: 12px; }
.theory-progressions b { color: var(--play-cyan, #00e5ff); font-family: var(--play-mono, monospace); }
.theory-progressions span { color: #fff; font-weight: 600; }
.theory-note { color: var(--play-muted, rgba(232, 236, 255, 0.72)); }

@media (max-width: 720px) {
    .theory-staff { height: 128px; }
    .theory-btn { min-height: 44px; }
    .theory-buttons { gap: 10px; }
}
