/**
 * CHORD TRAINER CSS
 * Layout de 3 columnas: Stats | Práctica | Settings
 * Soporte para modo claro y oscuro, sin scroll
 */

/* ═══════════════════════════════════════════════════════════════
   VARIABLES - MODO OSCURO (default)
   ═══════════════════════════════════════════════════════════════ */

:root {
    --ct-bg: #1a1a2e;
    --ct-bg-light: #222240;
    --ct-bg-card: #2a2a4a;
    --ct-bg-input: #2a2a4a;
    --ct-primary: #6c63ff;
    --ct-primary-light: #8b84ff;
    --ct-primary-dark: #5046e5;
    --ct-success: #4ade80;
    --ct-error: #f87171;
    --ct-text: #f1f1f1;
    --ct-text-dim: #9ca3af;
    --ct-text-muted: #6b7280;
    --ct-border: rgba(255, 255, 255, 0.1);
    --ct-shadow: rgba(0, 0, 0, 0.3);
    --ct-key-white: linear-gradient(to bottom, #fafafa 0%, #e8e8e8 90%, #d0d0d0 100%);
    --ct-key-white-border: #aaa;
    --ct-key-black: linear-gradient(to bottom, #404040 0%, #1a1a1a 90%, #0a0a0a 100%);
    --ct-key-label: #666;
    --ct-keyboard-bg: #0a0a12;
    --ct-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --ct-font-mono: 'JetBrains Mono', 'SF Mono', monospace;
}

/* ═══════════════════════════════════════════════════════════════
   VARIABLES - MODO CLARO
   ═══════════════════════════════════════════════════════════════ */

[data-theme="light"] .ct-app,
.light-theme .ct-app,
body.light .ct-app,
:root[data-theme="light"] .ct-app {
    --ct-bg: #f5f5f7;
    --ct-bg-light: #ffffff;
    --ct-bg-card: #e8e8ec;
    --ct-bg-input: #ffffff;
    --ct-primary: #6c63ff;
    --ct-primary-light: #8b84ff;
    --ct-primary-dark: #5046e5;
    --ct-success: #22c55e;
    --ct-error: #ef4444;
    --ct-text: #1a1a2e;
    --ct-text-dim: #4b5563;
    --ct-text-muted: #6b7280;
    --ct-border: rgba(0, 0, 0, 0.1);
    --ct-shadow: rgba(0, 0, 0, 0.1);
    --ct-key-white: linear-gradient(to bottom, #ffffff 0%, #f5f5f5 90%, #e8e8e8 100%);
    --ct-key-white-border: #ccc;
    --ct-key-black: linear-gradient(to bottom, #3a3a3a 0%, #1a1a1a 90%, #0a0a0a 100%);
    --ct-key-label: #888;
    --ct-keyboard-bg: #d0d0d8;
}

/* ═══════════════════════════════════════════════════════════════
   APP LAYOUT - 3 Columnas fijas a la ventana
   ═══════════════════════════════════════════════════════════════ */

.ct-app {
    font-family: var(--ct-font);
    background: var(--ct-bg);
    color: var(--ct-text);
    height: 100%;
    max-height: 100%;
    display: grid;
    grid-template-columns: 180px 1fr 240px;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   STATS PANEL (Left)
   ═══════════════════════════════════════════════════════════════ */

.ct-stats-panel {
    background: var(--ct-bg-light);
    border-right: 1px solid var(--ct-border);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.ct-stats-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--ct-text-dim);
    letter-spacing: 0.05em;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--ct-border);
}

.ct-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.ct-stat-card {
    background: var(--ct-bg-card);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
}

.ct-stat-num {
    display: block;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--ct-font-mono);
    color: var(--ct-primary-light);
}

.ct-stat-lbl {
    font-size: 8px;
    color: var(--ct-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ct-stats-btn {
    margin-top: auto;
    padding: 10px 12px;
    background: var(--ct-bg-card);
    border: 1px solid var(--ct-border);
    border-radius: 6px;
    color: var(--ct-text);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.ct-stats-btn:hover {
    border-color: var(--ct-primary);
    background: var(--ct-primary);
    color: white;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN AREA (Center)
   ═══════════════════════════════════════════════════════════════ */

.ct-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.ct-practice-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    gap: 10px;
    min-height: 0;
}

/* Current Chord (BIG) */
.ct-current-chord {
    font-size: 120px;
    font-weight: 700;
    line-height: 1;
    color: var(--ct-text);
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ct-current-chord.ct-chord-new {
    animation: chord-pop 0.15s ease-out;
}

@keyframes chord-pop {
    0% { transform: scale(0.95); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Next Chord (small) */
.ct-next-chord-section {
    text-align: center;
    flex-shrink: 0;
}

.ct-next-label {
    display: block;
    font-size: 11px;
    color: var(--ct-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.ct-next-chord {
    font-size: 32px;
    font-weight: 600;
    color: var(--ct-text-dim);
}

/* Beat Indicator */
.ct-beats {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.ct-beat {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--ct-bg-card);
    border: 2px solid var(--ct-border);
    transition: all 0.08s;
}

.ct-beat.active {
    background: var(--ct-primary);
    border-color: var(--ct-primary);
}

.ct-beat.current {
    transform: scale(1.3);
    box-shadow: 0 0 10px var(--ct-primary);
}

/* Start Button */
.ct-start-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    background: var(--ct-primary);
    color: white;
    font-size: 26px;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ct-start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.5);
}

.ct-start-btn:active {
    transform: scale(0.98);
}

.ct-start-btn.playing {
    background: var(--ct-bg-card);
    border: 2px solid var(--ct-text-dim);
    box-shadow: none;
    color: var(--ct-text);
}

.ct-start-btn.playing:hover {
    border-color: var(--ct-error);
    color: var(--ct-error);
}

/* ═══════════════════════════════════════════════════════════════
   KEYBOARD - 61 Keys GRANDE
   ═══════════════════════════════════════════════════════════════ */

.ct-keyboard-wrapper {
    background: var(--ct-keyboard-bg);
    padding: 10px;
    border-top: 1px solid var(--ct-border);
    display: flex;
    justify-content: center;
    flex-shrink: 0;
    overflow-x: auto;
}

.ct-keyboard {
    display: flex;
    position: relative;
    background: var(--ct-keyboard-bg);
    padding: 8px 8px 6px;
    border-radius: 4px;
    box-shadow: inset 0 2px 6px var(--ct-shadow);
}

.ct-key {
    position: relative;
    cursor: pointer;
    transition: all 0.06s;
}

.ct-key-white {
    width: 22px;
    height: 100px;
    background: var(--ct-key-white);
    border: 1px solid var(--ct-key-white-border);
    border-radius: 0 0 4px 4px;
    margin-right: 1px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 4px;
}

.ct-key-white:last-child {
    margin-right: 0;
}

.ct-key-black {
    width: 14px;
    height: 62px;
    background: var(--ct-key-black);
    border-radius: 0 0 3px 3px;
    margin-left: -8px;
    margin-right: -8px;
    z-index: 2;
    box-shadow: 0 3px 6px rgba(0,0,0,0.5), inset 0 -2px 3px rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 3px;
}

.ct-key-label {
    font-size: 8px;
    font-family: var(--ct-font-mono);
    color: var(--ct-key-label);
    pointer-events: none;
}

.ct-key-label-black {
    font-size: 7px;
    font-family: var(--ct-font-mono);
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

/* Key States */
.ct-key-white.expected {
    background: linear-gradient(to bottom, rgba(108, 99, 255, 0.3) 0%, rgba(108, 99, 255, 0.4) 100%);
    box-shadow: inset 0 0 0 2px var(--ct-primary);
}

.ct-key-black.expected {
    background: linear-gradient(to bottom, #4a3d8c 0%, #3d2d7a 100%);
    box-shadow: inset 0 0 0 2px var(--ct-primary);
}

.ct-key-white.active.correct {
    background: linear-gradient(to bottom, rgba(74, 222, 128, 0.4) 0%, rgba(74, 222, 128, 0.5) 100%);
    box-shadow: inset 0 0 0 2px var(--ct-success);
}

.ct-key-black.active.correct {
    background: linear-gradient(to bottom, #2d5a3d 0%, #1f4a2f 100%);
    box-shadow: inset 0 0 0 2px var(--ct-success);
}

.ct-key-white.active.wrong {
    background: linear-gradient(to bottom, rgba(248, 113, 113, 0.4) 0%, rgba(248, 113, 113, 0.5) 100%);
    box-shadow: inset 0 0 0 2px var(--ct-error);
}

.ct-key-black.active.wrong {
    background: linear-gradient(to bottom, #6b2d2d 0%, #5a1f1f 100%);
    box-shadow: inset 0 0 0 2px var(--ct-error);
}

/* ═══════════════════════════════════════════════════════════════
   SETTINGS PANEL (Right)
   ═══════════════════════════════════════════════════════════════ */

.ct-settings {
    background: var(--ct-bg-light);
    border-left: 1px solid var(--ct-border);
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* MIDI Button */
.ct-midi-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--ct-bg-card);
    border: 1px solid var(--ct-border);
    border-radius: 6px;
    color: var(--ct-text-dim);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
}

.ct-midi-btn:hover {
    border-color: var(--ct-primary);
    color: var(--ct-text);
}

.ct-midi-btn.connected {
    border-color: var(--ct-success);
    color: var(--ct-success);
}

.ct-midi-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ct-error);
    flex-shrink: 0;
}

.ct-midi-btn.connected .ct-midi-dot {
    background: var(--ct-success);
    box-shadow: 0 0 6px var(--ct-success);
}

/* Setting Groups */
.ct-setting-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ct-setting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ct-setting-title {
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--ct-text-dim);
    letter-spacing: 0.05em;
}

.ct-setting-value {
    font-size: 12px;
    font-weight: 600;
    font-family: var(--ct-font-mono);
    color: var(--ct-primary-light);
}

/* Setting Row */
.ct-setting-row {
    display: flex;
    gap: 8px;
}

.ct-setting-row .ct-half {
    flex: 1;
}

/* Slider */
.ct-slider {
    width: 100%;
    height: 4px;
    border-radius: 3px;
    background: var(--ct-bg-card);
    appearance: none;
    cursor: pointer;
}

.ct-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ct-primary);
    cursor: pointer;
    border: none;
}

.ct-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ct-primary);
    cursor: pointer;
    border: none;
}

/* Select */
.ct-select {
    width: 100%;
    padding: 6px 8px;
    background: var(--ct-bg-input);
    border: 1px solid var(--ct-border);
    border-radius: 4px;
    color: var(--ct-text);
    font-size: 11px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

.ct-select:focus {
    outline: none;
    border-color: var(--ct-primary);
}

.ct-select option {
    background: var(--ct-bg-light);
    color: var(--ct-text);
}

/* Level Button */
.ct-level-btn {
    width: 100%;
    padding: 7px 10px;
    background: var(--ct-primary);
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.ct-level-btn:hover {
    background: var(--ct-primary-dark);
}

/* Checkbox */
.ct-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 10px;
    color: var(--ct-text-dim);
    padding: 3px 0;
}

.ct-checkbox-label input {
    display: none;
}

.ct-checkbox-box {
    width: 14px;
    height: 14px;
    background: var(--ct-bg-card);
    border: 2px solid var(--ct-border);
    border-radius: 3px;
    position: relative;
    transition: all 0.15s;
    flex-shrink: 0;
}

.ct-checkbox-label input:checked + .ct-checkbox-box {
    background: var(--ct-primary);
    border-color: var(--ct-primary);
}

.ct-checkbox-label input:checked + .ct-checkbox-box::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 9px;
    font-weight: bold;
}

/* Audio Row */
.ct-audio-row {
    display: flex;
    gap: 10px;
    padding: 6px 0;
    border-top: 1px solid var(--ct-border);
    border-bottom: 1px solid var(--ct-border);
}

.ct-toggle-compact {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 9px;
    color: var(--ct-text-dim);
}

.ct-toggle-compact input {
    display: none;
}

.ct-toggle-box {
    width: 26px;
    height: 14px;
    background: var(--ct-bg-card);
    border-radius: 7px;
    position: relative;
    transition: background 0.15s;
    flex-shrink: 0;
}

.ct-toggle-box::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.15s;
}

.ct-toggle-compact input:checked + .ct-toggle-box {
    background: var(--ct-primary);
}

.ct-toggle-compact input:checked + .ct-toggle-box::after {
    transform: translateX(12px);
}

/* ═══════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════ */

.ct-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.ct-modal.show {
    opacity: 1;
    visibility: visible;
}

.ct-modal-content {
    background: var(--ct-bg-light);
    border-radius: 10px;
    width: 90%;
    max-width: 360px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 16px 48px var(--ct-shadow);
    transform: scale(0.95);
    transition: transform 0.2s;
    border: 1px solid var(--ct-border);
}

.ct-modal.show .ct-modal-content {
    transform: scale(1);
}

.ct-modal-large {
    max-width: 520px;
}

.ct-modal-stats {
    max-width: 600px;
    max-height: 85vh;
}

.ct-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ct-border);
    background: var(--ct-bg-card);
}

.ct-modal-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ct-text);
}

.ct-modal-close {
    width: 26px;
    height: 26px;
    background: var(--ct-bg-light);
    border: 1px solid var(--ct-border);
    border-radius: 4px;
    color: var(--ct-text-dim);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.ct-modal-close:hover {
    background: var(--ct-error);
    border-color: var(--ct-error);
    color: white;
}

.ct-modal-body {
    padding: 14px;
    overflow-y: auto;
    max-height: calc(80vh - 50px);
}

.ct-modal-stats .ct-modal-body {
    max-height: calc(85vh - 50px);
}

/* MIDI Modal */
.ct-no-devices {
    text-align: center;
    color: var(--ct-text-dim);
    padding: 14px;
    font-size: 12px;
}

.ct-device-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ct-device-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--ct-bg-card);
    border: 2px solid var(--ct-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.ct-device-item:hover {
    border-color: var(--ct-primary);
}

.ct-device-item.selected {
    border-color: var(--ct-success);
    background: rgba(74, 222, 128, 0.1);
}

.ct-device-item input {
    display: none;
}

.ct-device-name {
    font-size: 12px;
    color: var(--ct-text);
}

/* Chord Modal */
.ct-quick-select {
    display: flex;
    gap: 5px;
    margin-bottom: 12px;
}

.ct-quick-btn {
    flex: 1;
    padding: 7px;
    background: var(--ct-bg-card);
    border: 1px solid var(--ct-border);
    border-radius: 4px;
    color: var(--ct-text-dim);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.ct-quick-btn:hover {
    border-color: var(--ct-primary);
    color: var(--ct-text);
    background: var(--ct-primary);
}

.ct-chord-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.ct-chord-category h4 {
    font-size: 9px;
    font-weight: 600;
    color: var(--ct-text-dim);
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ct-chord-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ct-chord-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    background: var(--ct-bg-card);
    border: 1px solid var(--ct-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.1s;
    font-size: 10px;
    color: var(--ct-text);
}

.ct-chord-item:hover {
    border-color: var(--ct-primary);
}

.ct-chord-item.selected {
    background: var(--ct-primary);
    border-color: var(--ct-primary);
    color: white;
}

.ct-chord-item input {
    display: none;
}

/* Modifiers */
.ct-modifiers {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--ct-border);
}

.ct-modifier-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 11px;
    color: var(--ct-text);
}

.ct-modifier-item input {
    width: 13px;
    height: 13px;
    accent-color: var(--ct-primary);
}

/* ═══════════════════════════════════════════════════════════════
   STATS MODAL
   ═══════════════════════════════════════════════════════════════ */

.ct-stats-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ct-stats-section h4 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--ct-text-dim);
    margin: 0 0 10px;
    letter-spacing: 0.03em;
}

/* Chart */
.ct-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ct-chart-header h4 {
    margin: 0;
}

.ct-chart-tabs {
    display: flex;
    gap: 4px;
}

.ct-chart-tab {
    padding: 4px 8px;
    background: var(--ct-bg-card);
    border: 1px solid var(--ct-border);
    border-radius: 4px;
    color: var(--ct-text-dim);
    font-size: 9px;
    cursor: pointer;
    transition: all 0.15s;
}

.ct-chart-tab:hover {
    border-color: var(--ct-primary);
    color: var(--ct-text);
}

.ct-chart-tab.active {
    background: var(--ct-primary);
    border-color: var(--ct-primary);
    color: white;
}

.ct-chart {
    background: var(--ct-bg-card);
    border-radius: 8px;
    padding: 12px;
    height: 160px;
    display: flex;
    flex-direction: column;
}

.ct-chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    flex: 1;
    gap: 4px;
    padding-top: 20px;
}

.ct-chart-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
    max-width: 40px;
}

.ct-chart-bar-container {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
}

.ct-chart-bar {
    width: 100%;
    background: linear-gradient(to top, var(--ct-primary), var(--ct-primary-light));
    border-radius: 3px 3px 0 0;
    position: relative;
    min-height: 4px;
    transition: height 0.3s ease;
}

.ct-chart-bar.empty {
    background: var(--ct-bg-light);
    opacity: 0.5;
}

.ct-chart-val {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 4px;
    font-size: 9px;
    font-weight: 600;
    font-family: var(--ct-font-mono);
    color: var(--ct-text);
    white-space: nowrap;
}

.ct-chart-labels {
    display: flex;
    justify-content: space-around;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--ct-border);
    margin-top: 8px;
}

.ct-chart-label {
    flex: 1;
    max-width: 40px;
    font-size: 9px;
    color: var(--ct-text-muted);
    text-transform: capitalize;
    text-align: center;
}

/* Multi-bar Chart (by category) */
.ct-chart-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
}

.ct-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    color: var(--ct-text-dim);
}

.ct-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.ct-legend-beginner {
    background: #4ade80;
}

.ct-legend-intermediate {
    background: #fbbf24;
}

.ct-legend-advanced {
    background: #f87171;
}

.ct-chart-multi {
    height: 140px;
}

.ct-chart-multi .ct-chart-bars {
    padding-top: 8px;
}

.ct-chart-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
    max-width: 50px;
}

.ct-chart-bar-multi {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
}

.ct-bar-col {
    width: 8px;
    min-height: 3px;
    border-radius: 2px 2px 0 0;
    transition: height 0.3s ease;
    cursor: default;
}

.ct-bar-col.empty {
    opacity: 0.3;
}

.ct-bar-beginner {
    background: linear-gradient(to top, #22c55e, #4ade80);
}

.ct-bar-intermediate {
    background: linear-gradient(to top, #d97706, #fbbf24);
}

.ct-bar-advanced {
    background: linear-gradient(to top, #dc2626, #f87171);
}

.ct-bar-beginner.empty,
.ct-bar-intermediate.empty,
.ct-bar-advanced.empty {
    background: var(--ct-bg-light);
}

/* Category Accuracy Cards */
.ct-category-accuracy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.ct-category-card {
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ct-category-beginner {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(74, 222, 128, 0.08) 100%);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.ct-category-intermediate {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.15) 0%, rgba(251, 191, 36, 0.08) 100%);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.ct-category-advanced {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15) 0%, rgba(248, 113, 113, 0.08) 100%);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.ct-category-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ct-text-dim);
}

.ct-category-value {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--ct-font-mono);
}

.ct-category-beginner .ct-category-value {
    color: #4ade80;
}

.ct-category-intermediate .ct-category-value {
    color: #fbbf24;
}

.ct-category-advanced .ct-category-value {
    color: #f87171;
}

.ct-category-count {
    font-size: 9px;
    color: var(--ct-text-muted);
}

/* KPIs */
.ct-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.ct-kpi {
    background: var(--ct-bg-card);
    border-radius: 6px;
    padding: 10px 8px;
    text-align: center;
}

.ct-kpi-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    font-family: var(--ct-font-mono);
    color: var(--ct-primary-light);
}

.ct-kpi-label {
    font-size: 8px;
    color: var(--ct-text-dim);
    text-transform: uppercase;
}

.ct-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.ct-stats-table th,
.ct-stats-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid var(--ct-border);
}

.ct-stats-table th {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--ct-text-dim);
}

.ct-stats-table td {
    color: var(--ct-text);
}

.ct-good { color: var(--ct-success); }
.ct-medium { color: #fbbf24; }
.ct-bad { color: var(--ct-error); }

.ct-weak-chords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ct-weak-chord {
    background: var(--ct-bg-card);
    border-radius: 4px;
    padding: 6px 10px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.ct-weak-name {
    font-weight: 600;
    font-size: 12px;
}

.ct-weak-acc {
    font-size: 10px;
    font-family: var(--ct-font-mono);
}

.ct-no-data {
    text-align: center;
    color: var(--ct-text-muted);
    font-size: 12px;
    padding: 16px;
}

.ct-reset-stats {
    margin-top: 8px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--ct-error);
    border-radius: 4px;
    color: var(--ct-error);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}

.ct-reset-stats:hover {
    background: var(--ct-error);
    color: white;
}

/* ═══════════════════════════════════════════════════════════════
   FEEDBACK
   ═══════════════════════════════════════════════════════════════ */

.ct-feedback {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s;
    z-index: 100;
}

.ct-feedback.show {
    opacity: 1;
}

.ct-feedback.correct {
    background: radial-gradient(circle at center, rgba(74, 222, 128, 0.2) 0%, transparent 50%);
}

.ct-feedback.wrong {
    background: radial-gradient(circle at center, rgba(248, 113, 113, 0.2) 0%, transparent 50%);
}

/* Animated Feedback Icon */
.ct-feedback-icon {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: none;
}

.ct-feedback-icon svg {
    width: 70px;
    height: 70px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ct-feedback-icon.show {
    animation: feedback-pop 0.6s ease-out forwards;
}

.ct-feedback-icon.show.correct {
    background: radial-gradient(circle, rgba(74, 222, 128, 0.25) 0%, rgba(74, 222, 128, 0.1) 60%, transparent 100%);
    color: var(--ct-success);
}

.ct-feedback-icon.show.correct svg {
    animation: checkmark-draw 0.4s ease-out 0.1s forwards;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
}

.ct-feedback-icon.show.wrong {
    background: radial-gradient(circle, rgba(248, 113, 113, 0.25) 0%, rgba(248, 113, 113, 0.1) 60%, transparent 100%);
    color: var(--ct-error);
}

.ct-feedback-icon.show.wrong svg {
    animation: x-draw 0.4s ease-out 0.1s forwards;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
}

@keyframes feedback-pop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

@keyframes checkmark-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes x-draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1000px) {
    .ct-app {
        grid-template-columns: 1fr 220px;
    }

    .ct-stats-panel {
        display: none;
    }
}

@media (max-width: 800px) {
    .ct-app {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }

    .ct-settings {
        border-left: none;
        border-top: 1px solid var(--ct-border);
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px;
        max-height: 140px;
        overflow-y: auto;
    }

    .ct-setting-group {
        flex: 1 1 45%;
        min-width: 90px;
    }

    .ct-midi-btn {
        flex: 1 1 100%;
    }

    .ct-current-chord {
        font-size: 56px;
        min-height: 64px;
    }

    .ct-key-white {
        width: 18px;
        height: 80px;
    }

    .ct-key-black {
        width: 12px;
        height: 50px;
        margin-left: -7px;
        margin-right: -7px;
    }
}

@media (max-height: 700px) {
    .ct-practice-area {
        padding: 6px 12px;
        gap: 6px;
    }

    .ct-current-chord {
        font-size: 60px;
        min-height: 68px;
    }

    .ct-next-chord {
        font-size: 20px;
    }

    .ct-start-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .ct-key-white {
        height: 85px;
        width: 20px;
    }

    .ct-key-black {
        height: 54px;
        width: 13px;
        margin-left: -7px;
        margin-right: -7px;
    }

    .ct-keyboard-wrapper {
        padding: 8px;
    }
}

@media (max-width: 600px) {
    .ct-current-chord {
        font-size: 48px;
        min-height: 56px;
    }

    .ct-start-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    .ct-key-white {
        width: 16px;
        height: 70px;
    }

    .ct-key-black {
        width: 10px;
        height: 44px;
        margin-left: -6px;
        margin-right: -6px;
    }

    .ct-chord-categories {
        grid-template-columns: 1fr;
    }

    .ct-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ═══════════════════════════════════════════════════════════════
   MODE SELECTOR - Acordes / Grados
   ═══════════════════════════════════════════════════════════════ */

.ct-mode-selector {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--ct-bg);
    border-radius: 10px;
    margin-bottom: 8px;
}

.ct-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--ct-text-dim);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ct-mode-btn:hover {
    background: var(--ct-bg-light);
    color: var(--ct-text);
}

.ct-mode-btn.active {
    background: var(--ct-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
}

.ct-mode-icon {
    font-size: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   DEGREES MODE - Practice Area Display
   ═══════════════════════════════════════════════════════════════ */

/* Tonality Badge - prominent pill with scale info */
.ct-tonality-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ct-tonality-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: linear-gradient(135deg, var(--ct-primary) 0%, var(--ct-primary-light) 100%);
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
}

.ct-tonality-key {
    font-size: 18px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.02em;
}

.ct-tonality-scale {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

/* Degree display - same as ct-current-chord */
.ct-degree-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 130px;
    flex-shrink: 0;
}

/* Main degree numeral - same size as chord name (96px) */
.ct-degree-numeral {
    font-size: 120px;
    font-weight: 700;
    line-height: 1;
    color: var(--ct-text);
}

.ct-degree-function-hint {
    font-size: 11px;
    color: var(--ct-text-muted);
}

/* Chord hint - shows chord name next to degree when "Siempre" is selected */
.ct-degree-chord-hint {
    font-size: 24px;
    font-weight: 600;
    color: var(--ct-primary-light);
    margin-top: 4px;
    opacity: 0.9;
}

/* Chord hint for next degree (smaller) */
.ct-next-chord-hint {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--ct-text-muted);
    margin-top: 2px;
}


/* Function badge - small and subtle */
.ct-degree-function {
    display: inline-block;
    padding: 2px 8px;
    background: var(--ct-bg-card);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ct-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ct-degree-function.tonic {
    background: rgba(74, 222, 128, 0.2);
    color: var(--ct-success);
}

.ct-degree-function.dominant {
    background: rgba(248, 113, 113, 0.2);
    color: var(--ct-error);
}

.ct-degree-function.subdominant {
    background: rgba(108, 99, 255, 0.2);
    color: var(--ct-primary-light);
}

.ct-degree-resolution {
    font-size: 16px;
    color: var(--ct-text-muted);
    font-style: italic;
}

.ct-chord-feedback {
    margin-top: 12px;
    font-size: 24px;
    font-weight: 600;
    color: var(--ct-success);
    min-height: 32px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ct-chord-feedback.show {
    opacity: 1;
}

/* Next degree section - same as ct-next-chord-section */
.ct-next-degree {
    text-align: center;
    flex-shrink: 0;
}

.ct-next-degree-label {
    display: block;
    font-size: 11px;
    color: var(--ct-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

/* Same size as ct-next-chord (32px) */
.ct-degree-numeral-small {
    font-size: 32px;
    font-weight: 600;
    color: var(--ct-text-dim);
}

/* ═══════════════════════════════════════════════════════════════
   DEGREES MODAL - Same format as Chord Modal
   ═══════════════════════════════════════════════════════════════ */

.ct-degree-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.ct-degree-category h4 {
    font-size: 9px;
    font-weight: 600;
    color: var(--ct-text-dim);
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ct-degree-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ct-degree-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    background: var(--ct-bg-card);
    border: 1px solid var(--ct-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.1s;
    font-size: 10px;
    color: var(--ct-text);
}

.ct-degree-item:hover {
    border-color: var(--ct-primary);
}

.ct-degree-item.selected {
    background: var(--ct-primary);
    border-color: var(--ct-primary);
    color: white;
}

.ct-degree-item input {
    display: none;
}

/* Degree numeral inside modal item (small) */
.ct-degree-item-numeral {
    font-size: 10px;
    font-weight: 600;
    font-family: var(--ct-font-mono);
}

.ct-degree-func-small {
    font-size: 8px;
    padding: 1px 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    text-transform: uppercase;
}

.ct-degree-item.selected .ct-degree-func-small {
    background: rgba(255,255,255,0.2);
}

/* Degrees Settings - same style as modifiers */
.ct-degrees-settings {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--ct-border);
}

.ct-degrees-settings h4 {
    font-size: 9px;
    font-weight: 600;
    color: var(--ct-text-dim);
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ct-degrees-settings .ct-setting-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--ct-text);
}

.ct-degrees-settings .ct-setting-row label {
    font-size: 11px;
    color: var(--ct-text);
    min-width: 120px;
}

.ct-degrees-settings .ct-setting-row select {
    flex: 1;
    max-width: 140px;
    padding: 4px 8px;
    background: var(--ct-bg-card);
    border: 1px solid var(--ct-border);
    border-radius: 4px;
    color: var(--ct-text);
    font-size: 10px;
    cursor: pointer;
}

.ct-degrees-settings .ct-setting-row select:hover {
    border-color: var(--ct-primary);
}

/* Checkbox styling for degrees modal */
.ct-degrees-settings .ct-checkbox-label {
    font-size: 11px;
}

.ct-degrees-settings .ct-checkbox-label input[type="checkbox"] {
    display: inline-block;
    width: 13px;
    height: 13px;
    accent-color: var(--ct-primary);
}

/* ═══════════════════════════════════════════════════════════════
   MODE-SPECIFIC SETTINGS VISIBILITY
   ═══════════════════════════════════════════════════════════════ */

.ct-mode-settings {
    margin-top: 8px;
}

.ct-mode-settings[data-mode="chords"] .ct-degrees-settings-inline,
.ct-mode-settings[data-mode="degrees"] .ct-chords-settings-inline {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE - Degrees Mode (matching chord mode responsive)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .ct-degree-categories {
        grid-template-columns: 1fr;
    }

    .ct-degree-numeral {
        font-size: 56px;
    }

    .ct-degree-display {
        min-height: 64px;
    }

    .ct-degree-numeral-small {
        font-size: 20px;
    }

    .ct-mode-selector {
        flex-direction: column;
    }
}

@media (max-height: 700px) {
    .ct-degree-numeral {
        font-size: 60px;
    }

    .ct-degree-display {
        min-height: 68px;
    }

    .ct-degree-numeral-small {
        font-size: 20px;
    }
}

@media (max-width: 600px) {
    .ct-degree-numeral {
        font-size: 48px;
    }

    .ct-degree-display {
        min-height: 56px;
    }

    .ct-degree-numeral-small {
        font-size: 18px;
    }
}



/* ═══════════════════════════════════════════════════════════════
   MINI PIANO - Scale Visualization (Realistic Piano Layout)
   ═══════════════════════════════════════════════════════════════ */

.ct-mini-piano {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px 10px;
    background: var(--ct-bg-card);
    border: 1px solid var(--ct-border);
    border-radius: 10px;
    transition: all 0.2s ease;
    z-index: 10;
}

.ct-mini-piano:hover {
    border-color: var(--ct-primary);
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.25);
    transform: translateY(-2px);
}

.ct-mini-piano:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.2);
}

.ct-mini-piano-container {
    position: relative;
    height: 48px;
    width: 98px;
    background: linear-gradient(to bottom, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 4px;
    padding: 3px 3px 0 3px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.ct-mini-piano-whites {
    display: flex;
    height: 100%;
    gap: 1px;
}

.ct-mini-white {
    width: 13px;
    height: 100%;
    background: linear-gradient(to bottom, #fafafa 0%, #e8e8e8 85%, #d0d0d0 100%);
    border-radius: 0 0 3px 3px;
    box-shadow: 
        0 2px 3px rgba(0,0,0,0.2),
        inset 0 -1px 1px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.8);
    transition: all 0.1s ease;
}

.ct-mini-white:hover {
    background: linear-gradient(to bottom, #ffffff 0%, #f0f0f0 85%, #e0e0e0 100%);
}

.ct-mini-white:active {
    background: linear-gradient(to bottom, #e8e8e8 0%, #d8d8d8 85%, #c8c8c8 100%);
    box-shadow: 
        0 1px 2px rgba(0,0,0,0.15),
        inset 0 1px 2px rgba(0,0,0,0.1);
}

/* White key in scale - blue tint */
.ct-mini-white.in-scale {
    background: linear-gradient(to bottom, #b8d4f0 0%, #90c0e8 85%, #78b0d8 100%);
    box-shadow: 
        0 2px 3px rgba(0,0,0,0.2),
        inset 0 -1px 1px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.6);
}

/* White key as root - purple/primary color */
.ct-mini-white.is-root {
    background: linear-gradient(to bottom, #b8a8ff 0%, #9080f0 85%, #7868e0 100%);
    box-shadow: 
        0 2px 4px rgba(108, 99, 255, 0.4),
        inset 0 -1px 1px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.5);
}

/* White key playing - yellow highlight */
.ct-mini-white.playing {
    background: linear-gradient(to bottom, #fff176 0%, #ffeb3b 85%, #ffc107 100%) !important;
    box-shadow: 
        0 2px 8px rgba(255, 193, 7, 0.6),
        inset 0 -1px 1px rgba(0,0,0,0.1);
    transform: translateY(1px);
}

/* Black keys container */
.ct-mini-piano-blacks {
    position: absolute;
    top: 3px;
    left: 3px;
    height: 28px;
    pointer-events: none;
}

.ct-mini-black {
    position: absolute;
    width: 8px;
    height: 28px;
    background: linear-gradient(to bottom, #3a3a3a 0%, #1a1a1a 70%, #0a0a0a 100%);
    border-radius: 0 0 2px 2px;
    box-shadow: 
        0 2px 4px rgba(0,0,0,0.5),
        inset 0 -2px 2px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(80,80,80,0.3);
    pointer-events: auto;
    transition: all 0.1s ease;
}

.ct-mini-black:hover {
    background: linear-gradient(to bottom, #4a4a4a 0%, #2a2a2a 70%, #1a1a1a 100%);
}

.ct-mini-black:active {
    background: linear-gradient(to bottom, #2a2a2a 0%, #1a1a1a 70%, #0a0a0a 100%);
    height: 26px;
}

/* Black key in scale - darker blue */
.ct-mini-black.in-scale {
    background: linear-gradient(to bottom, #4080b0 0%, #2a6090 70%, #1a4070 100%);
    box-shadow: 
        0 2px 4px rgba(0,0,0,0.5),
        inset 0 -2px 2px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(100,160,200,0.3);
}

/* Black key as root - dark purple */
.ct-mini-black.is-root {
    background: linear-gradient(to bottom, #6858c8 0%, #4838a0 70%, #382880 100%);
    box-shadow: 
        0 2px 6px rgba(108, 99, 255, 0.5),
        inset 0 -2px 2px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(140,130,255,0.3);
}

/* Black key playing - orange highlight */
.ct-mini-black.playing {
    background: linear-gradient(to bottom, #ff9800 0%, #e65100 70%, #bf360c 100%) !important;
    box-shadow: 
        0 2px 8px rgba(255, 152, 0, 0.6),
        inset 0 -2px 2px rgba(0,0,0,0.3);
    height: 26px;
}

.ct-mini-piano-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--ct-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Make practice area relative for absolute positioning */
.ct-practice-area {
    position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE - Mini Piano
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .ct-mini-piano {
        top: 5px;
        right: 5px;
        padding: 6px 8px;
    }

    .ct-mini-piano-container {
        height: 40px;
        width: 84px;
    }

    .ct-mini-white {
        width: 11px;
    }

    .ct-mini-black {
        width: 7px;
        height: 24px;
    }

    .ct-mini-piano-label {
        font-size: 9px;
    }
}

@media (max-width: 600px) {
    .ct-mini-piano {
        top: 3px;
        right: 3px;
        padding: 4px 6px;
        gap: 4px;
    }

    .ct-mini-piano-container {
        height: 32px;
        width: 70px;
    }

    .ct-mini-white {
        width: 9px;
    }

    .ct-mini-black {
        width: 6px;
        height: 18px;
    }

    .ct-mini-piano-label {
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .ct-mini-piano {
        display: none;
    }
}


/* ═══════════════════════════════════════════════════════════════
   DEGREES STATISTICS - Advanced Stats Modal
   ═══════════════════════════════════════════════════════════════ */

/* Section divider for Degrees */
.ct-stats-divider {
    border-top: 2px solid var(--ct-primary);
    padding-top: 20px !important;
    margin-top: 20px !important;
}

.ct-section-main-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--ct-primary) !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px !important;
}

/* Function Accuracy Grid (Tonic, Subdominant, Dominant) */
.ct-function-accuracy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.ct-function-card {
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.ct-function-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

/* Tonic - Green (stability, home) */
.ct-function-tonic {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.12) 0%, rgba(74, 222, 128, 0.05) 100%);
    border: 1px solid rgba(74, 222, 128, 0.25);
}

.ct-function-tonic::before {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.ct-function-tonic .ct-function-value {
    color: #4ade80;
}

/* Subdominant - Blue/Purple (movement, preparation) */
.ct-function-subdominant {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.12) 0%, rgba(147, 141, 255, 0.05) 100%);
    border: 1px solid rgba(108, 99, 255, 0.25);
}

.ct-function-subdominant::before {
    background: linear-gradient(90deg, #6c63ff, #938dff);
}

.ct-function-subdominant .ct-function-value {
    color: var(--ct-primary-light);
}

/* Dominant - Orange/Red (tension, resolution needed) */
.ct-function-dominant {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.12) 0%, rgba(251, 191, 36, 0.05) 100%);
    border: 1px solid rgba(251, 146, 60, 0.25);
}

.ct-function-dominant::before {
    background: linear-gradient(90deg, #f97316, #fbbf24);
}

.ct-function-dominant .ct-function-value {
    color: #fb923c;
}

.ct-function-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ct-text-dim);
}

.ct-function-value {
    font-size: 28px;
    font-weight: 700;
    font-family: var(--ct-font-mono);
    line-height: 1.1;
}

.ct-function-count {
    font-size: 10px;
    color: var(--ct-text-muted);
}

.ct-function-degrees {
    font-size: 9px;
    color: var(--ct-text-muted);
    font-style: italic;
    margin-top: 2px;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 600px) {
    .ct-function-accuracy-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .ct-function-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 10px 14px;
    }

    .ct-function-card::before {
        width: 3px;
        height: 100%;
        top: 0;
        left: 0;
        right: auto;
    }

    .ct-function-value {
        font-size: 24px;
    }

    .ct-function-degrees {
        display: none;
    }
}


/* ═══════════════════════════════════════════════════════════════
   STATS MODAL - WIDER & TABS
   ═══════════════════════════════════════════════════════════════ */

/* Extra Large Modal for Stats */
.ct-modal-xlarge {
    max-width: 900px !important;
    width: 95% !important;
}

/* Stats Tabs */
.ct-stats-tabs {
    display: flex;
    gap: 4px;
    padding: 0 20px;
    background: var(--ct-bg);
    border-bottom: 1px solid var(--ct-border);
}

.ct-stats-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: var(--ct-text-dim);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}

.ct-stats-tab:hover {
    color: var(--ct-text);
    background: var(--ct-bg-light);
}

.ct-stats-tab.active {
    color: var(--ct-primary);
    border-bottom-color: var(--ct-primary);
    background: var(--ct-bg-card);
}

.ct-tab-icon {
    font-size: 18px;
}

/* Tab Content */
.ct-stats-tab-content {
    display: none;
}

.ct-stats-tab-content.active {
    display: block;
}

/* Two Columns Layout */
.ct-stats-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.ct-stats-two-columns .ct-stats-section {
    margin-bottom: 0;
}

/* KPI Grid with 4 columns */
.ct-kpi-grid-4 {
    grid-template-columns: repeat(4, 1fr) !important;
}

/* No data message */
.ct-no-data {
    text-align: center;
    color: var(--ct-text-muted);
    font-size: 12px;
    padding: 20px;
    font-style: italic;
}

/* Responsive for stats modal */
@media (max-width: 768px) {
    .ct-modal-xlarge {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0;
        border-radius: 0;
    }

    .ct-stats-two-columns {
        grid-template-columns: 1fr;
    }

    .ct-kpi-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .ct-stats-tab {
        padding: 12px 10px;
        font-size: 13px;
    }

    .ct-tab-icon {
        font-size: 16px;
    }
}

@media (max-width: 500px) {
    .ct-kpi-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .ct-function-accuracy-grid {
        grid-template-columns: 1fr !important;
    }
}




/* ═══════════════════════════════════════════════════════════════
   STATS MODAL - COMPACT MINIMALIST
   ═══════════════════════════════════════════════════════════════ */

/* Modal body */
.ct-stats-modal-body {
    padding: 16px 20px !important;
    max-height: 70vh;
    overflow-y: auto;
}

/* Sections - tight spacing */
.ct-stats-section {
    margin-bottom: 16px !important;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ct-border);
}

.ct-stats-section:last-child {
    border-bottom: none;
    margin-bottom: 8px !important;
    padding-bottom: 0;
}

/* Section titles - small and subtle */
.ct-stats-section h4 {
    font-size: 10px !important;
    font-weight: 600 !important;
    color: var(--ct-text-muted) !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
    border: none !important;
    display: block !important;
}

/* Category cards - compact */
.ct-category-accuracy-grid {
    gap: 8px !important;
    margin-top: 8px !important;
}

.ct-category-card {
    padding: 10px 8px !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    gap: 2px !important;
}

.ct-category-card:hover {
    transform: none !important;
    box-shadow: none !important;
}

.ct-category-label {
    font-size: 9px !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em;
    margin-bottom: 2px !important;
}

.ct-category-value {
    font-size: 20px !important;
    margin-bottom: 2px !important;
}

.ct-category-count {
    font-size: 9px !important;
}

/* KPI Grid - minimal */
.ct-kpi-grid {
    gap: 8px !important;
    margin-top: 8px !important;
}

.ct-kpi-grid-4 {
    grid-template-columns: repeat(4, 1fr) !important;
}

.ct-kpi {
    background: var(--ct-bg) !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 10px 8px !important;
}

.ct-kpi:hover {
    border-color: transparent !important;
}

.ct-kpi-value {
    font-size: 18px !important;
    font-weight: 700 !important;
    margin-bottom: 2px !important;
}

.ct-kpi-label {
    font-size: 8px !important;
    font-weight: 600 !important;
    letter-spacing: 0.03em;
}

/* Two columns - compact */
.ct-stats-two-columns {
    gap: 12px !important;
    margin: 12px 0 16px 0 !important;
}

.ct-stats-two-columns .ct-stats-section {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-bottom: none !important;
}

.ct-stats-two-columns .ct-stats-section h4 {
    font-size: 9px !important;
    margin-bottom: 8px !important;
}

/* Tables - compact */
.ct-stats-table {
    font-size: 11px !important;
    margin-top: 6px !important;
}

.ct-stats-table thead th {
    background: transparent !important;
    font-size: 9px !important;
    padding: 6px 8px !important;
    border-bottom: 1px solid var(--ct-border) !important;
}

.ct-stats-table tbody td {
    padding: 6px 8px !important;
    font-size: 11px !important;
}

.ct-stats-table tbody tr:hover {
    background: var(--ct-bg);
}

/* Function cards - compact */
.ct-function-accuracy-grid {
    gap: 8px !important;
    margin-top: 8px !important;
}

.ct-function-card {
    padding: 10px 8px !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    gap: 2px !important;
}

.ct-function-card:hover {
    transform: none !important;
    box-shadow: none !important;
}

.ct-function-card::before {
    height: 2px !important;
}

.ct-function-label {
    font-size: 9px !important;
    margin-bottom: 2px !important;
}

.ct-function-value {
    font-size: 20px !important;
    margin-bottom: 2px !important;
}

.ct-function-count {
    font-size: 9px !important;
    margin-bottom: 2px !important;
}

.ct-function-degrees {
    font-size: 8px !important;
}

/* Tabs - slim */
.ct-stats-tabs {
    padding: 0 16px !important;
    gap: 0 !important;
}

.ct-stats-tab {
    padding: 10px 16px !important;
    font-size: 12px !important;
    gap: 6px !important;
}

.ct-tab-icon {
    font-size: 14px !important;
}

/* No data - minimal */
.ct-no-data {
    background: transparent !important;
    border: none !important;
    padding: 12px 8px !important;
    font-size: 11px !important;
    color: var(--ct-text-muted) !important;
}

/* Reset button - subtle */
.ct-reset-stats {
    margin-top: 12px !important;
    padding: 8px 16px !important;
    font-size: 10px !important;
}

/* Scrollbar - thin */
.ct-stats-modal-body::-webkit-scrollbar {
    width: 4px;
}


/* ═══════════════════════════════════════════════════════════════
   CONSISTENCY PANEL
   ═══════════════════════════════════════════════════════════════ */

.ct-consistency-panel {
    background: var(--ct-bg-card);
    border: 1px solid var(--ct-border);
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
}

.ct-consistency-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ct-consistency-title {
    font-size: 10px;
    font-weight: 600;
    color: var(--ct-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ct-consistency-score {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--ct-font-mono);
    transition: color 0.3s;
}

/* Score level colors */
.ct-consistency-score.excellent { color: #22c55e; }
.ct-consistency-score.consistent { color: #4ade80; }
.ct-consistency-score.progressing { color: #fbbf24; }
.ct-consistency-score.irregular { color: #f97316; }
.ct-consistency-score.unstable { color: #ef4444; }

/* Progress bar */
.ct-consistency-bar {
    height: 6px;
    background: var(--ct-bg);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
}

.ct-consistency-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #f97316 25%, #fbbf24 50%, #4ade80 75%, #22c55e 100%);
    background-size: 200% 100%;
    background-position: right;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.ct-consistency-threshold {
    position: absolute;
    left: 75%;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: var(--ct-text);
    opacity: 0.3;
}

/* Metrics */
.ct-consistency-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}

.ct-consistency-metric {
    text-align: center;
    padding: 4px;
    background: var(--ct-bg);
    border-radius: 4px;
}

.ct-metric-val {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ct-text);
    font-family: var(--ct-font-mono);
}

.ct-metric-lbl {
    display: block;
    font-size: 8px;
    color: var(--ct-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Status */
.ct-consistency-status {
    text-align: center;
    font-size: 10px;
    padding-top: 6px;
    border-top: 1px solid var(--ct-border);
}

.ct-status-consistent {
    color: #22c55e;
    font-weight: 600;
}

.ct-status-progress {
    color: var(--ct-text-muted);
}

/* Animation when consistent */
.ct-consistency-panel.is-consistent {
    border-color: rgba(34, 197, 94, 0.4);
    background: linear-gradient(135deg, var(--ct-bg-card) 0%, rgba(34, 197, 94, 0.05) 100%);
}


/* ═══════════════════════════════════════════════════════════════
   SESSION MINI STATS (Sidebar)
   ═══════════════════════════════════════════════════════════════ */

.ct-session-mini {
    background: var(--ct-bg);
    border-radius: 6px;
    padding: 8px;
    margin-top: 10px;
}

.ct-session-mini-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.ct-mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.ct-mini-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--ct-text);
    font-family: var(--ct-font-mono);
}

.ct-mini-lbl {
    font-size: 8px;
    color: var(--ct-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Stats Button */
.ct-stats-btn {
    width: 100%;
    padding: 10px 16px;
    margin-top: 10px;
    background: var(--ct-bg);
    border: 1px solid var(--ct-border);
    border-radius: 6px;
    color: var(--ct-text-dim);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ct-stats-btn:hover {
    background: var(--ct-bg-card);
    border-color: var(--ct-primary);
    color: var(--ct-text);
}


/* ═══════════════════════════════════════════════════════════════
   STATS MODAL SCROLL FIX
   ═══════════════════════════════════════════════════════════════ */

/* Ensure modal body scrolls properly */
.ct-stats-modal-body {
    max-height: calc(80vh - 120px) !important;
    overflow-y: auto !important;
    padding-bottom: 20px !important;
}

/* Reset button container - always visible at bottom */
.ct-stats-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--ct-border);
    background: var(--ct-bg-card);
    margin-top: auto;
}

/* Make reset button more visible */
.ct-reset-stats {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 12px 20px !important;
    font-size: 12px !important;
    background: var(--ct-bg) !important;
    border: 1px solid var(--ct-border) !important;
    border-radius: 6px !important;
    color: var(--ct-text-muted) !important;
    cursor: pointer;
    transition: all 0.2s;
}

.ct-reset-stats:hover {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
}

/* Modal content wrapper for proper layout */
.ct-modal-xlarge .ct-modal-content {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}


/* ═══════════════════════════════════════════════════════════════
   LAYOUT FIXES - Panel width & Modal size
   ═══════════════════════════════════════════════════════════════ */

/* Left panel wider to fit consistency metrics */
.ct-stats-panel {
    min-width: 220px !important;
    width: 220px !important;
}

/* Consistency panel adjustments */
.ct-consistency-panel {
    width: 100%;
}

.ct-consistency-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.ct-consistency-metric {
    padding: 6px 2px !important;
    min-width: 0;
}

.ct-metric-val {
    font-size: 11px !important;
    white-space: nowrap;
}

.ct-metric-lbl {
    font-size: 7px !important;
    white-space: nowrap;
}

/* Stats modal wider */
.ct-modal-xlarge {
    max-width: 1000px !important;
    width: 95% !important;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE/TABLET BLOCK - Desktop only app
   ═══════════════════════════════════════════════════════════════ */

/* Mobile block overlay */
.ct-mobile-block {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    z-index: var(--z-loading);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 40px;
    text-align: center;
}

.ct-mobile-block-content {
    max-width: 400px;
}

.ct-mobile-block-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.9;
}

.ct-mobile-block-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.ct-mobile-block-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 24px;
}

.ct-mobile-block-features {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.ct-mobile-block-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.ct-mobile-block-feature span:first-child {
    font-size: 28px;
}

/* Show mobile block on small screens */
@media (max-width: 1024px) {
    .ct-mobile-block {
        display: flex !important;
    }

    .ct-app {
        display: none !important;
    }
}

/* Ensure app is visible on desktop */
@media (min-width: 1025px) {
    .ct-mobile-block {
        display: none !important;
    }
}


/* ═══════════════════════════════════════════════════════════════
   CONSISTENCY MODAL STYLES
   ═══════════════════════════════════════════════════════════════ */

.ct-consistency-explanation {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--ct-bg);
    border-radius: 6px;
    border-left: 3px solid var(--ct-primary);
}

.ct-consistency-explanation small {
    color: var(--ct-text-muted);
    font-size: 11px;
    line-height: 1.5;
}

.ct-consistency-score-modal {
    color: var(--ct-primary) !important;
}

/* ===== PROGRESS BAR CHART ===== */
.ct-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.ct-chart-header h4 {
    margin: 0;
}

.ct-chart-period-selector {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary, #1a1a2e);
    padding: 4px;
    border-radius: 8px;
}

.ct-period-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-muted, #888);
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.ct-period-btn:hover {
    color: var(--text-primary, #fff);
}

.ct-period-btn.active {
    background: var(--color-primary, #6366f1);
    color: white;
}

.ct-chart-container {
    background: var(--bg-tertiary, #1a1a2e);
    border-radius: 12px;
    padding: 20px;
}

.ct-bar-chart {
    display: flex;
    gap: 12px;
    height: 200px;
}

.ct-chart-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted, #888);
    text-align: right;
    padding: 0 8px 20px 0;
    min-width: 40px;
}

.ct-chart-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    border-left: 1px solid var(--border-color, #333);
    border-bottom: 1px solid var(--border-color, #333);
    padding: 0 8px 0 12px;
    position: relative;
}

.ct-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 60px;
}

.ct-bar-stack {
    width: 100%;
    height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
}

.ct-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
}

.ct-bar-beginner {
    background: linear-gradient(180deg, #22c55e, #16a34a);
}

.ct-bar-intermediate {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.ct-bar-advanced {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

.ct-bar-total {
    background: linear-gradient(180deg, #6366f1, #4f46e5);
}

.ct-bar-label {
    font-size: 10px;
    color: var(--text-muted, #888);
    text-transform: capitalize;
    white-space: nowrap;
}

.ct-chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.ct-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary, #aaa);
}

.ct-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.ct-legend-beginner {
    background: #22c55e;
}

.ct-legend-intermediate {
    background: #f59e0b;
}

.ct-legend-advanced {
    background: #ef4444;
}

/* Responsive */
@media (max-width: 600px) {
    .ct-chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ct-bar-chart {
        height: 150px;
    }
    
    .ct-chart-y-axis {
        font-size: 9px;
        min-width: 30px;
    }
    
    .ct-bar-label {
        font-size: 8px;
    }
    
    .ct-bar-stack {
        height: 120px;
    }
}

/* ===== CUSTOM TOOLTIP FOR BAR CHART ===== */
.ct-bar-group {
    position: relative;
}

.ct-bar-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary, #0f0f1a);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    pointer-events: none;
    margin-bottom: 8px;
}

.ct-bar-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border-color, #333);
}

.ct-bar-group:hover .ct-bar-tooltip {
    opacity: 1;
    visibility: visible;
}

.ct-bar-tooltip strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-primary, #fff);
    border-bottom: 1px solid var(--border-color, #333);
    padding-bottom: 6px;
}

.ct-tooltip-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    color: var(--text-secondary, #aaa);
}

.ct-tooltip-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.ct-tooltip-beginner .ct-tooltip-dot {
    background: #22c55e;
}

.ct-tooltip-intermediate .ct-tooltip-dot {
    background: #f59e0b;
}

.ct-tooltip-advanced .ct-tooltip-dot {
    background: #ef4444;
}

.ct-tooltip-total {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color, #333);
    color: var(--color-primary, #6366f1);
}

/* ===== TOOLTIP LIGHT THEME FIX ===== */
[data-theme="light"] .ct-bar-tooltip {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

[data-theme="light"] .ct-bar-tooltip::after {
    border-top-color: #e2e8f0;
}

[data-theme="light"] .ct-bar-tooltip strong {
    color: #1e293b;
    border-bottom-color: #e2e8f0;
}

[data-theme="light"] .ct-tooltip-row {
    color: #475569;
}

[data-theme="light"] .ct-tooltip-total {
    border-top-color: #e2e8f0;
    color: #4f46e5;
}

/* Also fix chart container for light theme */
[data-theme="light"] .ct-chart-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

[data-theme="light"] .ct-chart-y-axis {
    color: #64748b;
}

[data-theme="light"] .ct-chart-bars {
    border-left-color: #cbd5e1;
    border-bottom-color: #cbd5e1;
}

[data-theme="light"] .ct-bar-label {
    color: #64748b;
}

[data-theme="light"] .ct-chart-period-selector {
    background: #f1f5f9;
}

[data-theme="light"] .ct-period-btn {
    color: #64748b;
}

[data-theme="light"] .ct-period-btn:hover {
    color: #1e293b;
}

[data-theme="light"] .ct-period-btn.active {
    background: #4f46e5;
    color: white;
}

[data-theme="light"] .ct-legend-item {
    color: #475569;
}

/* ===== FUNCTION BARS CHART (Degrees) ===== */
.ct-function-bars {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    height: 250px;
}

.ct-function-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.ct-function-bar-container {
    width: 60px;
    height: 160px;
    background: var(--bg-tertiary, #1a1a2e);
    border-radius: 8px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border: 1px solid var(--border-color, #333);
}

.ct-function-bar {
    width: 100%;
    border-radius: 6px 6px 0 0;
    transition: height 0.5s ease;
    min-height: 4px;
}

.ct-bar-tonic {
    background: linear-gradient(180deg, #22c55e, #16a34a);
}

.ct-bar-subdominant {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.ct-bar-dominant {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

.ct-function-bar-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #aaa);
}

.ct-function-bar-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #fff);
}

/* Tooltip for function bars */
.ct-function-bar-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary, #0f0f1a);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    pointer-events: none;
    margin-bottom: 8px;
}

.ct-function-bar-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border-color, #333);
}

.ct-function-bar-group:hover .ct-function-bar-tooltip {
    opacity: 1;
    visibility: visible;
}

.ct-function-bar-tooltip strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text-primary, #fff);
}

/* Light theme for function bars */
[data-theme="light"] .ct-function-bar-container {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

[data-theme="light"] .ct-function-bar-label {
    color: #475569;
}

[data-theme="light"] .ct-function-bar-value {
    color: #1e293b;
}

[data-theme="light"] .ct-function-bar-tooltip {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

[data-theme="light"] .ct-function-bar-tooltip::after {
    border-top-color: #e2e8f0;
}

[data-theme="light"] .ct-function-bar-tooltip strong {
    color: #1e293b;
}

@media (max-width: 500px) {
    .ct-function-bars {
        gap: 20px;
    }
    
    .ct-function-bar-container {
        width: 50px;
        height: 120px;
    }
    
    .ct-function-bar-label {
        font-size: 10px;
    }
    
    .ct-function-bar-value {
        font-size: 14px;
    }
}

/* ===== DEGREES CHART COLORS ===== */
.ct-bar-tonic {
    background: linear-gradient(180deg, #22c55e, #16a34a);
}

.ct-bar-subdominant {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.ct-bar-dominant {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

.ct-legend-tonic {
    background: #22c55e;
}

.ct-legend-subdominant {
    background: #f59e0b;
}

.ct-legend-dominant {
    background: #ef4444;
}

.ct-tooltip-tonic .ct-tooltip-dot {
    background: #22c55e;
}

.ct-tooltip-subdominant .ct-tooltip-dot {
    background: #f59e0b;
}

.ct-tooltip-dominant .ct-tooltip-dot {
    background: #ef4444;
}
