/* 
 * Prefix ALL classes and ids with dtp- (Diapason Trainer Plugin) to avoid conflicts
 */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Lato:wght@300;400;700&display=swap');

/* --- Forzar centrado inamovible --- */
#dtp-full-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    width: 100% !important;
    margin: 0 auto !important;
    text-align: center !important;
}

.dtp-app {
    font-family: 'Lato', sans-serif;
    color: #e8dcc5;
    background-color: transparent;
    width: 100%;
    max-width: 1100px;
    /* Isla central de ancho elegante */
    margin: 0 auto;
    /* Centrado físico adicional dentro del full wrapper */
    min-height: auto;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

.dtp-app * {
    box-sizing: border-box;
}

/* Cabecera Centralizada y Elegante */
.dtp-header {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    position: relative;
}

.dtp-titles {
    text-align: center;
}

.dtp-titles h2 {
    font-family: 'Playfair Display', serif;
    margin: 0;
    font-size: 2.5rem;
    color: #d4af37;
    /* Oro */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.dtp-titles p {
    margin: 5px 0 0;
    color: #bfa15f;
    font-size: 1.1rem;
    font-style: italic;
    font-family: 'Playfair Display', serif;
}

/* Botones Principales (Oro y Madera Oscura) */
.dtp-btn {
    appearance: none;
    border: 1px solid #d4af37;
    background: #1a110a;
    background-image: linear-gradient(180deg, #2e1e12 0%, #1a110a 100%);
    color: #d4af37;
    /* Oro */
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Lato', sans-serif;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

.dtp-btn:hover {
    background: #d4af37;
    color: #1a110a;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.dtp-btn-danger {
    border-color: #bfa15f;
    color: #e8dcc5;
}

.dtp-btn-danger:hover {
    background: #8b0000;
    /* Rojo elegantemente oscuro */
    color: #fff;
    border-color: #8b0000;
}

/* Icono de Configuración */
.dtp-btn-icon {
    position: absolute;
    right: 0;
    padding: 5px 10px;
    font-size: 1.8rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    color: #d4af37;
    background-image: none;
    box-shadow: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.dtp-btn-icon:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: #d4af37;
    color: #fff;
    transform: rotate(45deg);
}

.dtp-btn-small {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.dtp-full-width {
    width: 100%;
    display: block;
    margin-top: 25px;
}

.dtp-challenge-banner {
    width: 100%;
    max-width: 1000px;
    background: #1a110a;
    /* Ébano */
    border: 2px solid #d4af37;
    /* Oro */
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(212, 175, 55, 0.1);
}

.dtp-challenge-banner.dtp-flash-correct {
    animation: dtpFlashGold 0.5s ease-out;
}

@keyframes dtpFlashGold {
    0% {
        background-color: #d4af37;
        box-shadow: 0 0 30px #d4af37;
    }

    100% {
        background-color: #1a110a;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(212, 175, 55, 0.1);
    }
}

.dtp-challenge-banner span {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: #fff8dc;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.8);
    font-weight: 700;
}

/* Status Bar */
.dtp-status-bar {
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: space-between;
    background: rgba(38, 24, 15, 0.85);
    /* Madera media */
    border: 1px solid #5a422b;
    padding: 15px 25px;
    border-radius: 6px;
    margin-bottom: 30px;
    font-size: 1.1rem;
    font-family: 'Playfair Display', serif;
    color: #d4af37;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8), 0 5px 15px rgba(0, 0, 0, 0.5);
}

.dtp-status-bar span {
    font-weight: 700;
}

/* --- Controls Group --- */
.dtp-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    gap: 20px;
    margin-top: 35px;
}

.dtp-surprise-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(38, 24, 15, 0.8);
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid #5a422b;
}

.dtp-surprise-label {
    color: #bfa15f;
    font-family: 'Playfair Display', serif;
    font-weight: bold;
    font-size: 1.1rem;
    margin-right: 5px;
}

.dtp-btn-surprise {
    background: #2e1e12;
    border: 1px solid #d4af37;
    color: #d4af37;
    font-size: 0.85rem;
    padding: 8px 12px;
}

.dtp-btn-surprise:hover {
    background: #d4af37;
    color: #1a110a;
}

/* Fretboard */
.dtp-fretboard-container {
    width: 100%;
    max-width: 1100px;
    overflow-x: auto;
    padding-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dtp-fretboard {
    display: flex;
    flex-direction: column;
    width: max-content;
    min-width: 100%;
    background: #3e2723;
    /* Madera caoba oscura */
    background-image: linear-gradient(90deg, #2c1e16 0%, #4e342e 50%, #2c1e16 100%);
    border-radius: 6px;
    position: relative;
    padding: 15px 0;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.8);
    border: 3px solid #1a110a;
}

.dtp-fret-numbers {
    display: flex;
    margin-left: 50px;
    /* Offset ampliado para espacio de notas solfeo */
    color: #bfa15f;
    font-size: 0.95rem;
    margin-bottom: 8px;
    font-family: 'Playfair Display', serif;
}

.dtp-fret-num {
    width: 70px;
    text-align: center;
}

.dtp-fret-num.dtp-zero {
    width: 40px;
}

.dtp-string-row {
    display: flex;
    align-items: center;
    position: relative;
    height: 44px;
}

.dtp-string-row:hover {
    background: rgba(212, 175, 55, 0.05);
    /* Hover dorado sutil */
}

.dtp-string-name {
    width: 50px;
    /* Ampliado para que quepa "Sol" sin ser tachado */
    text-align: left;
    /* Alineado para elegancia */
    padding-left: 5px;
    font-weight: bold;
    color: #d4af37;
    z-index: 2;
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    /* Letra un poco más grande */
}

.dtp-fret {
    width: 70px;
    height: 100%;
    border-right: 3px solid #6b5c47;
    /* Traste de metal bronce envejecido */
    box-shadow: inset -1px 0 3px rgba(0, 0, 0, 0.6);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    /* Grid interactivo por sobre la cuerda visual */
}

.dtp-fret::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 15;
    /* Área transparente clickeable */
}

.dtp-fret.dtp-zero {
    width: 40px;
    border-right: 8px solid #f5f5dc;
    /* Cejuela hueso */
    background: #1a110a;
}

/* La línea de la cuerda visual (Cuerdas de Bronce/Oro) */
.dtp-string-line {
    position: absolute;
    left: 55px;
    /* Evita que la línea tache el nombre de la cuerda */
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(to bottom, #f0e68c, #d4af37, #6b4e05);
    z-index: 1;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

/* Grosores de cuerdas */
.dtp-str-1 .dtp-string-line {
    height: 1.5px;
}

.dtp-str-2 .dtp-string-line {
    height: 2px;
}

.dtp-str-3 .dtp-string-line {
    height: 2.5px;
}

.dtp-str-4 .dtp-string-line {
    height: 3.5px;
}

.dtp-str-5 .dtp-string-line {
    height: 4.5px;
}

.dtp-str-6 .dtp-string-line {
    height: 6px;
}

/* Marcadores de posición (Inlays dorados resplandecientes) */
.dtp-inlay {
    position: absolute;
    width: 18px;
    height: 18px;
    background: radial-gradient(circle at center, #fff8dc 0%, #d4af37 100%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.8;
    pointer-events: none;
    z-index: 0;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Nota Circle */
.dtp-note-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #d4af37;
    /* Oro base */
    color: #1a110a;
    /* Letra oscura */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.95rem;
    font-weight: bold;
    font-family: 'Lato', sans-serif;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
    border: 2px solid #fff8dc;
}

.dtp-fret:hover .dtp-note-circle.dtp-study-mode {
    opacity: 0.7;
}

.dtp-note-active .dtp-note-circle {
    opacity: 1 !important;
}

/* Feedback de reto  */
.dtp-note-correct .dtp-note-circle {
    background: #d4af37 !important;
    border-color: #fff;
    box-shadow: 0 0 20px #d4af37, inset 0 0 10px #fff;
    opacity: 1 !important;
    transform: scale(1.3);
}

.dtp-note-wrong .dtp-note-circle {
    background: #8b0000 !important;
    /* Rojo caoba oscuro elegante */
    color: #fff;
    border-color: #d4af37;
    box-shadow: 0 0 15px #8b0000;
    opacity: 1 !important;
    transform: scale(1.2);
}

.dtp-note-hint .dtp-note-circle {
    background: rgba(26, 17, 10, 0.9) !important;
    border: 2px solid #d4af37;
    color: #d4af37;
    opacity: 1 !important;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.dtp-main {
    width: 100%;
}

/* (Eliminado control anterior para usar layout flexible global) */

/* Modals */
.dtp-modal {
    display: none;
    /* Flex when visible */
    position: fixed;
    /* Fix to viewport */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 5, 2, 0.95);
    z-index: 9999;
    /* Ensure on top */
    justify-content: center;
    align-items: center;
}

.dtp-modal.dtp-show {
    display: flex;
}

.dtp-modal-content {
    background: #1a110a;
    padding: 35px;
    border-radius: 8px;
    width: 90%;
    max-width: 480px;
    border: 2px solid #d4af37;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
}

.dtp-modal-content h3 {
    margin-top: 0;
    color: #d4af37;
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    text-align: center;
    border-bottom: 1px solid #5a422b;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.dtp-setting-group {
    margin-bottom: 25px;
}

.dtp-setting-group label {
    display: block;
    margin-bottom: 10px;
    color: #bfa15f;
    font-size: 1.05rem;
    font-family: 'Playfair Display', serif;
}

.dtp-setting-toggles {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.dtp-toggle-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    background: #2e1e12;
    padding: 10px 15px;
    border-radius: 4px;
    border: 1px solid #5a422b;
    cursor: pointer;
    flex: 1;
}

.dtp-toggle-label input {
    accent-color: #d4af37;
    transform: scale(1.2);
}

.dtp-lang-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.dtp-lang-btn {
    background: #2e1e12;
    border: 1px solid #5a422b;
    color: #e8dcc5;
    padding: 8px 16px;
    border-radius: 4px;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.dtp-lang-btn.dtp-active {
    background: #d4af37;
    color: #1a110a;
    border-color: #d4af37;
    font-weight: bold;
}

.dtp-notes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.dtp-note-toggle {
    background: #2e1e12;
    border: 1px solid #5a422b;
    color: #e8dcc5;
    padding: 12px 0;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    user-select: none;
    transition: all 0.2s;
    font-family: 'Lato', sans-serif;
    font-weight: bold;
    font-size: 1rem;
}

.dtp-note-toggle:hover {
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.dtp-note-toggle.dtp-selected {
    background: #d4af37;
    color: #1a110a;
    border-color: #d4af37;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.dtp-setting-group input[type="number"] {
    width: 100%;
    background: #2e1e12;
    border: 1px solid #5a422b;
    color: #d4af37;
    padding: 14px;
    border-radius: 4px;
    font-size: 1.1rem;
    font-family: 'Lato', sans-serif;
    transition: all 0.3s;
}

.dtp-setting-group input[type="number"]:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.dtp-modal-content p {
    font-size: 1.2rem;
    color: #e8dcc5;
    font-family: 'Lato', sans-serif;
    text-align: center;
    margin: 15px 0;
}

.dtp-setting-desc {
    font-size: 0.85rem;
    color: #bfa15f;
    margin-top: 5px;
    font-style: italic;
}

/* Inputs */
.dtp-input-text {
    width: 100%;
    padding: 10px;
    background: #1a110a;
    border: 1px solid #d4af37;
    color: #e8dcc5;
    border-radius: 4px;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.3s ease;
}

.dtp-input-text:focus {
    outline: none;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.8), inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Modal Content and Leaderboard */
.dtp-leaderboard-content {
    max-width: 500px;
}

.dtp-leaderboard-table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
    border: 1px solid #5a422b;
    border-radius: 4px;
    background: rgba(26, 17, 10, 0.8);
}

.dtp-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    color: #e8dcc5;
    font-family: 'Lato', sans-serif;
}

.dtp-leaderboard-table th,
.dtp-leaderboard-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #5a422b;
}

.dtp-leaderboard-table th {
    background: #2e1e12;
    color: #d4af37;
    font-family: 'Playfair Display', serif;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.dtp-leaderboard-table tr:hover {
    background: rgba(212, 175, 55, 0.1);
}

.dtp-leaderboard-table tr:last-child td {
    border-bottom: none;
}

/* --- Sliders --- */
.dtp-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dtp-slider-header label {
    margin-bottom: 0;
}

.dtp-slider-val {
    background: #2e1e12;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #5a422b;
    color: #d4af37;
    font-weight: bold;
    font-family: 'Lato', sans-serif;
}

.dtp-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #5a422b;
    border-radius: 3px;
    outline: none;
    padding: 0;
    margin: 10px 0;
}

.dtp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #d4af37;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    transition: transform 0.1s;
}

.dtp-slider::-moz-range-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #d4af37;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    transition: transform 0.1s;
    border: none;
}

.dtp-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.dtp-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* --- Toggle Switch --- */
.dtp-switch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dtp-switch-header label {
    margin-bottom: 0;
}

.dtp-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

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

.dtp-slider-round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #5a422b;
    transition: .3s;
    border-radius: 34px;
}

.dtp-slider-round:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: #e8dcc5;
    transition: .3s;
    border-radius: 50%;
}

input:checked+.dtp-slider-round {
    background-color: #d4af37;
}

input:checked+.dtp-slider-round:before {
    transform: translateX(24px);
    background-color: #1a110a;
}

/* --- Tutorial Nav --- */
.dtp-tutorial-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
}

.dtp-tut-dots {
    display: flex;
    gap: 5px;
}

.dtp-tut-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #5a422b;
    transition: all 0.3s;
}

.dtp-tut-dot.dtp-active {
    background: #d4af37;
    transform: scale(1.2);
}

.dtp-btn-outline {
    background: transparent;
    border-color: #5a422b;
    color: #e8dcc5;
}

.dtp-btn-outline:hover:not(:disabled) {
    background: rgba(212, 175, 55, 0.1);
    border-color: #d4af37;
    color: #d4af37;
}

.dtp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #1a110a !important;
    border-color: #5a422b !important;
    color: #5a422b !important;
}

.dtp-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dtp-header-actions .dtp-btn-icon {
    position: static;
}

/* --- Footer y Responsividad --- */
.dtp-footer {
    width: 100%;
    text-align: center;
    margin-top: 30px;
    padding: 15px 0;
    font-family: 'Playfair Display', serif;
    color: #d4af37;
    font-size: 1.1rem;
    font-style: italic;
    border-top: 1px solid #5a422b;
}

@media (max-width: 1100px) {
    .dtp-fret {
        width: 60px;
    }

    .dtp-fret-num {
        width: 60px;
    }

    .dtp-fret.dtp-zero {
        width: 35px;
    }

    .dtp-fret-num.dtp-zero {
        width: 35px;
    }
}

@media (max-width: 950px) {
    .dtp-fret {
        width: 45px;
    }

    .dtp-fret-num {
        width: 45px;
    }

    .dtp-fret.dtp-zero {
        width: 30px;
    }

    .dtp-fret-num.dtp-zero {
        width: 30px;
    }

    .dtp-note-circle {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }

    .dtp-string-name {
        font-size: 1rem;
        width: 40px;
    }

    .dtp-fret-numbers {
        margin-left: 40px;
    }
}

@media (max-width: 768px) {
    .dtp-fret {
        width: 35px;
    }

    .dtp-fret-num {
        width: 35px;
    }

    .dtp-fret.dtp-zero {
        width: 25px;
    }

    .dtp-fret-num.dtp-zero {
        width: 25px;
    }

    .dtp-note-circle {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
        border-width: 1px;
    }

    .dtp-string-name {
        font-size: 0.8rem;
        width: 30px;
    }

    .dtp-fret-numbers {
        margin-left: 30px;
        font-size: 0.75rem;
    }

    .dtp-string-row {
        height: 35px;
    }

    .dtp-inlay {
        width: 14px;
        height: 14px;
    }

    .dtp-titles h2 {
        font-size: 1.8rem;
    }

    .dtp-status-bar {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .dtp-controls {
        flex-direction: column;
    }

    .dtp-notes-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .dtp-challenge-banner span {
        font-size: 1.5rem;
    }
}

@media (max-width: 500px) {
    .dtp-fret {
        width: 22px;
    }

    .dtp-fret-num {
        width: 22px;
    }

    .dtp-fret.dtp-zero {
        width: 17px;
    }

    .dtp-fret-num.dtp-zero {
        width: 17px;
    }

    .dtp-note-circle {
        width: 18px;
        height: 18px;
        font-size: 0.55rem;
    }

    .dtp-string-name {
        font-size: 0.65rem;
        width: 25px;
        padding-left: 2px;
    }

    .dtp-fret-numbers {
        margin-left: 25px;
        font-size: 0.6rem;
    }

    .dtp-string-row {
        height: 28px;
    }

    .dtp-inlay {
        width: 10px;
        height: 10px;
    }

    .dtp-titles h2 {
        font-size: 1.5rem;
    }

    .dtp-leaderboard-table th,
    .dtp-leaderboard-table td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
}