@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,700&display=swap');

/* === INSIGNIA / SELLO SILABOS === */
.silabos-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #C4C4D6;
    font-weight: 700;
}
.silabos-badge svg { width: 34px; height: 34px; display: block; filter: drop-shadow(0 0 6px rgba(168,85,247,0.5)); }
.silabos-badge.sm { font-size: 9px; letter-spacing: 2px; gap: 6px; }
.silabos-badge.sm svg { width: 26px; height: 26px; }

/* === MENÚ INICIAL === */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(168,85,247,0.18), transparent 60%), radial-gradient(ellipse at 70% 80%, rgba(0,200,255,0.12), transparent 60%), #0A0A12;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.menu-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.menu-container {
    background: var(--background-color);
    border-radius: 16px;
    padding: 36px 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 40px rgba(168,85,247,0.2);
    border: 1px solid rgba(168,85,247,0.5);
}

.menu-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.menu-header h1 {
    color: var(--text-color);
    margin: 4px 0 6px 0;
    font-family: var(--font-head);
    font-size: 1.9em;
    font-weight: 700;
    text-shadow: 0 0 18px rgba(255,45,166,0.55);
}

.menu-header p {
    color: var(--text-2);
    margin: 0 0 26px 0;
    font-size: 1.05em;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.menu-option-btn {
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 1.05em;
    font-weight: 700;
    width: 100%;
}

.menu-option-btn:hover {
    background: rgba(255,45,166,0.08);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 0 22px rgba(255, 45, 166, 0.28);
}

.menu-option-btn.quick-start {
    background: var(--primary-color);
    color: #0A0A12;
    border-color: var(--primary-color);
}

.menu-option-btn.quick-start:hover {
    background: #FF52B8;
    box-shadow: 0 0 25px rgba(255, 77, 166, 0.6);
}

.menu-option-btn span {
    font-size: 0.85em;
    font-weight: 400;
    color: var(--text-3);
}

.menu-version {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 18px;
    margin-top: 6px;
}

.menu-version p {
    color: var(--text-3);
    font-size: 0.8em;
    margin: 0;
}

/* Responsive para el menú */
@media (max-width: 480px) {
    .menu-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .menu-header h1 {
        font-size: 1.8em;
    }
    
    .menu-option-btn {
        padding: 15px;
        font-size: 1em;
    }
}


/*ROOT//////////////////////////////////*/ 
/*colores de la app, del root*/
:root {
    /* === SILABOS · acentos de marca (recolorean toda la UI vía variables) === */
    --primary-color: #FF2DA6;     /* fuxia */
    --secondary-color: #A855F7;   /* morado */
    --success-color: #39FF14;     /* verde neón */
    --warning-color: #FACC15;     /* amarillo */
    --danger-color: #FF4D6D;      /* rojo SILABOS */
    --accent-cyan: #00C8FF;       /* cian */
    /* superficie y texto SILABOS */
    --background-color: #12121E;  /* superficie/modal oscuro (UI general) */
    --surface: rgba(255,255,255,0.05);
    --text-color: #EDEDF5;        /* texto principal claro */
    --text-2: #C4C4D6;
    --text-3: #9A9AB0;
    --border-color: rgba(168,85,247,0.45);
    /* === ZONA DE JUEGO: el tablero se mantiene CLARO (fidelidad a la imagen objetivo) === */
    --grid-bg: #fdfdfd;
    --grid-line: rgba(60,60,70,0.22);
    /* === GEOMETRÍA — NO TOCAR (encaje imagen objetivo / rejilla / bloques) === */
    --cell-size: 46px;
    --block-padding: 8px;
    /* tipografías */
    --font-head: 'Orbitron', sans-serif;
    --font-body: 'DM Sans', 'Segoe UI', Tahoma, sans-serif;
}

/* Helper de glows translúcidos disponible vía rgba directos en el CSS */

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    margin: 0;
    padding: 15px;
    background: #0A0A12;
    min-height: 100vh;
    color: var(--text-color);
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--background-color);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(34, 34, 34, 0.15);
    overflow: hidden;
}

.header {
    background: linear-gradient(120deg, rgba(168,85,247,0.18), rgba(255,45,166,0.18));
    color: var(--text-color);
    padding: 10px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(168,85,247,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    position: relative;
}

.header-menu-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 7px 14px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.25s ease;
}

.header-menu-btn:hover {
    background: rgba(0,200,255,0.1);
    box-shadow: 0 0 14px rgba(0,200,255,0.3);
}

@media (max-width: 600px) {
    .header-menu-btn {
        position: static;
        order: 3;
        margin-top: 4px;
    }
}

.header h1 {
    margin: 0;
    font-family: var(--font-head);
    font-size: 1.1em;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 0 14px rgba(0,200,255,0.4);
}

.header p {
    margin: 2px 0 0 0;
    color: var(--text-2);
    font-size: 0.8em;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 16px;
    padding: 14px 16px;
}

.game-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.grid-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.verify-button {
    background: var(--primary-color);
    color: #0A0A12;
    border: none;
    padding: 10px 24px;
    border-radius: 11px;
    font-family: var(--font-head);
    font-size: 0.85em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 45, 166, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.verify-button:hover {
    background: #FF2DA6;
    transform: translateY(-2px);
    box-shadow: 0 0 28px rgba(255, 45, 166, 0.7);
}

.verify-button:active {
    transform: translateY(0);
}

.grid-container {
    border: 3px solid var(--secondary-color);
    border-radius: 10px;
    position: relative;
    width: calc(var(--cell-size) * 6);
    height: calc(var(--cell-size) * 6);
    background: var(--grid-bg);
    box-shadow: 0 0 26px rgba(168,85,247,0.22), inset 0 2px 10px rgba(34, 34, 34, 0.1);
    overflow: hidden;
}

/* Imagen objetivo como fondo - MEJORADA PARA SER MÁS VISIBLE */
.grid-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--puzzle-bg-image, url('imagenes/target_puzzle_solution_1.png'));
    background-size: 269px 269px;
    background-position: 0 0;
    background-repeat: no-repeat;
    opacity: 0.6; /* Aumentado de 0.15 a 0.6 para mejor visibilidad */
    z-index: 1;
    pointer-events: none;
}

#gameGrid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); 
    grid-template-rows: repeat(6, 1fr);
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
}

.grid-cell {
    border: 1px solid rgba(167, 196, 250, 0.1); /* Bordes más sutiles */
    background: rgba(255, 255, 255, 0.1) !important; /* Fondo más transparente */
    position: relative;
}

/* COORDENADAS COMPLETAMENTE TRANSPARENTES */
.grid-cell::before {
    content: attr(data-coord);
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 8px;
    color: transparent; /* Completamente transparente */
    pointer-events: none;
    display: none;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-panel {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    background: var(--surface);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 10px 16px;
}

.control-panel h3 {
    margin: 0;
    color: var(--accent-cyan);
    font-family: var(--font-head);
    font-size: 0.78em;
    text-shadow: 0 0 10px rgba(0,200,255,0.35);
    white-space: nowrap;
}

#startButton {
    width: auto;
    padding: 9px 18px;
    font-size: 0.9em;
    font-weight: 700;
    font-family: var(--font-body);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--accent-cyan);
    color: #0A0A12;
    margin: 0;
    box-shadow: 0 0 14px rgba(0,200,255,0.35);
    white-space: nowrap;
}

#startButton:hover {
    background: #33D4FF;
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(0,200,255,0.55);
}

#startButton.listening {
    background: var(--danger-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0); }
}

.status-panel {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    background: rgba(0,200,255,0.06);
    border: 1px solid rgba(0,200,255,0.25);
    border-radius: 10px;
    padding: 7px 12px;
}

.status-item {
    margin: 0;
    font-size: 0.8em;
    color: var(--text-2);
}

.status-item strong {
    color: var(--accent-cyan);
}

.score-panel {
    background: linear-gradient(135deg, rgba(255,45,166,0.15), rgba(168,85,247,0.15));
    border: 1px solid rgba(255,45,166,0.35);
    color: var(--text-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.score-panel h3 {
    color: var(--primary-color);
    font-family: var(--font-head);
    font-size: 1em;
    margin: 0 0 6px 0;
    text-shadow: 0 0 10px rgba(255,45,166,0.45);
}

.score-display {
    font-family: var(--font-head);
    font-size: 2.2em;
    font-weight: 900;
    margin: 8px 0;
    color: var(--warning-color);
    text-shadow: 0 0 18px rgba(250,204,21,0.55);
}

.complexity-meter {
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
}

.complexity-bar {
    background: rgba(255,255,255,0.12);
    height: 16px;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 5px;
}

.complexity-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--secondary-color), var(--primary-color));
    transition: width 0.5s ease;
    border-radius: 8px;
}

.available-blocks {
    width: calc(var(--cell-size) * 6);
    max-width: 100%;
    background: rgba(255,45,166,0.05);
    border: 1px solid rgba(255,45,166,0.3);
    border-radius: 12px;
    padding: 9px 12px;
}

.available-blocks h3 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
    font-family: var(--font-head);
    font-size: 0.85em;
    text-align: center;
    text-shadow: 0 0 8px rgba(255,45,166,0.35);
}

#availableBlocksContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.available-block-item {
    min-width: 64px;
    height: 34px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.72em;
    letter-spacing: 0.5px;
    border-radius: 7px;
    cursor: pointer;
    transition: transform 0.15s ease;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

.available-block-item:hover {
    transform: translateY(-2px);
}

.available-block-item.selected {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 0 15px rgba(255,255,255,0.5);
    outline: 2px solid #F4F4FF;
}

/* Bloques en el juego - MEJORADOS PARA MEJOR CONTRASTE CON LA IMAGEN DE FONDO */
.block {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    box-shadow: 3px 3px 12px rgba(0,0,0,0.4);
    font-weight: bold;
    color: white;
    z-index: 10;
    transition: all 0.3s ease;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    border: 3px solid rgba(255,255,255,0.8);
    box-sizing: border-box;
}



/* Colores de bloques */
.block.red { background-color: #dc3545; border-color: #b02a37; }
.block.blue { background-color: #007bff; border-color: #0056b3; }
.block.green { background-color: #28a745; border-color: #1e7e34; }
.block.yellow { background-color: #ffc107; border-color: #d39e00; color: #212529; }
.block.purple { background-color: #A855F7; border-color: #7C3AED; }
.block.orange { background-color: #fd7e14; border-color: #e8590c; }
.block.pink { background-color: #e83e8c; border-color: #d3166c; }
.block.darkgreen { background-color: #155724; border-color: #0f3b15; }
.block.brown { background-color: #8b4513; border-color: #6d340f; }
.block.teal { background-color: #20c997; border-color: #1aa67a; }
.block.coral { background-color: #ff6b6b; border-color: #ff5252; }

/* Tamaños de bloques - REDUCIDOS PARA MEJOR AJUSTE */
.block.length-2.horizontal { 
    width: calc(var(--cell-size) * 2 - var(--block-padding)); 
    height: calc(var(--cell-size) - var(--block-padding)); 
}
.block.length-2.vertical { 
    width: calc(var(--cell-size) - var(--block-padding)); 
    height: calc(var(--cell-size) * 2 - var(--block-padding)); 
}
.block.length-3.horizontal { 
    width: calc(var(--cell-size) * 3 - var(--block-padding)); 
    height: calc(var(--cell-size) - var(--block-padding)); 
}
.block.length-3.vertical { 
    width: calc(var(--cell-size) - var(--block-padding)); 
    height: calc(var(--cell-size) * 3 - var(--block-padding)); 
}

.completion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* ESTILOS OPTIMIZADOS PARA EL MODAL DE COMPLETADO */
.completion-modal {
    background: var(--background-color);
    padding: 36px;
    border-radius: 16px;
    text-align: center;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(168,85,247,0.25);
    display: flex;
    flex-direction: column;
    gap: 18px;
    border: 1px solid rgba(168,85,247,0.5);
}

.completion-modal h2 {
    color: var(--primary-color);
    margin: 0;
    font-family: var(--font-head);
    font-size: 1.8em;
    font-weight: 700;
    text-shadow: 0 0 18px rgba(255,45,166,0.5);
}

/* Contenedor principal para puntuación y análisis */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* Sección de puntuación */
.summary-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 22px;
    border-radius: 12px;
}

.final-score {
    font-family: var(--font-head);
    font-size: 3em;
    font-weight: 900;
    color: var(--warning-color);
    margin: 0;
    text-shadow: 0 0 22px rgba(250,204,21,0.5);
}

.summary-content p {
    font-size: 1.1em;
    margin: 0;
    line-height: 1.5;
    color: var(--text-2);
}

.summary-content p span {
    font-weight: 700;
    color: var(--accent-cyan);
}

/* Sección de análisis de lenguaje */
#languageAnalysis {
    width: 100%;
    text-align: left;
    background: var(--surface);
    border-radius: 12px;
    padding: 22px;
    border-left: 4px solid var(--primary-color);
}

#languageAnalysis h4 {
    margin: 0 0 15px 0;
    color: var(--text-color);
    font-size: 1.3em;
    font-weight: 700;
    text-align: center;
}

#languageAnalysis ul {
    margin: 0;
    padding-left: 25px;
    list-style-type: none;
}

#languageAnalysis li {
    margin: 8px 0;
    font-size: 1.05em;
    line-height: 1.5;
    position: relative;
    padding-left: 20px;
    color: var(--text-2);
}

#languageAnalysis li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.2em;
}

/* Contenedor de botones */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 10px;
}

.restart-btn, .next-puzzle-btn, .menu-btn {
    color: #0A0A12;
    border: none;
    padding: 16px 35px;
    border-radius: 12px;
    font-family: var(--font-head);
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    max-width: 350px;
    align-self: center;
    transition: all 0.3s ease;
}

.restart-btn {
    background: var(--primary-color);
    box-shadow: 0 0 18px rgba(255, 45, 166, 0.45);
}

.restart-btn:hover {
    background: #FF52B8;
    transform: translateY(-2px);
    box-shadow: 0 0 26px rgba(255, 45, 166, 0.6);
}

.next-puzzle-btn {
    background: var(--accent-cyan);
    box-shadow: 0 0 18px rgba(0, 200, 255, 0.4);
}

.next-puzzle-btn:hover {
    background: #33D4FF;
    transform: translateY(-2px);
    box-shadow: 0 0 26px rgba(0, 200, 255, 0.55);
}

.menu-btn {
    background: var(--surface);
    color: var(--text-color);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: none;
}

.menu-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

/* MEDIA QUERIES PARA RESPONSIVIDAD - MEJORADOS */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .game-area {
        flex-direction: column;
        align-items: center;
    }
    
    /* Reducir tamaño de celdas en pantallas pequeñas */
    :root {
        --cell-size: 35px;
    }

    /* Asegurar que la cuadrícula se mantenga centrada */
    .grid-container {
        width: calc(var(--cell-size) * 6);
        height: calc(var(--cell-size) * 6);
    }

    .grid-container::before {
        background-size: contain; 
    }

    #gameGrid {
        grid-template-columns: repeat(6, var(--cell-size));
        grid-template-rows: repeat(6, var(--cell-size));
    }

    .completion-modal {
        padding: 25px;
        gap: 20px;
        max-width: 95%;
    }

    .completion-modal h2 {
        font-size: 1.8em;
    }

    .final-score {
        font-size: 2.8em;
    }

    .summary-content {
        padding: 20px;
    }

    .summary-content p {
        font-size: 1.1em;
    }
    
    #languageAnalysis {
        padding: 20px;
    }

    #languageAnalysis h4 {
        font-size: 1.2em;
    }

    #languageAnalysis li {
        font-size: 1em;
    }

    .restart-btn, .next-puzzle-btn, .menu-btn {
        max-width: 280px;
        font-size: 1.1em;
        padding: 15px 25px;
    }
}

@media (max-width: 480px) {
    /* Tamaño aún más pequeño para móviles */
    :root {
        --cell-size: calc((100vw - 80px) / 8);
    }



    /* Asegurar que la cuadrícula se mantenga correcta */
    .grid-container {
        width: calc(var(--cell-size) * 6);
        height: calc(var(--cell-size) * 6);
    }

    /* La imagen de fondo ahora se ajusta para ser visible completamente */
    .grid-container::before {
        background-size: contain; 
    }

    #gameGrid {
        grid-template-columns: repeat(6, var(--cell-size));
        grid-template-rows: repeat(6, var(--cell-size));
    }

    .completion-modal {
        padding: 20px;
        gap: 15px;
    }

    .completion-modal h2 {
        font-size: 1.6em;
    }

    .final-score {
        font-size: 2.4em;
    }

    .summary-content {
        padding: 15px;
    }

    .summary-content p {
        font-size: 1em;
    }

    #languageAnalysis {
        padding: 15px;
    }

    #languageAnalysis h4 {
        font-size: 1.1em;
    }

    #languageAnalysis li {
        font-size: 0.95em;
    }

    .restart-btn, .next-puzzle-btn, .menu-btn {
        max-width: 250px;
        font-size: 1em;
        padding: 12px 20px;
    }
}

/* OCULTAR BOTONES DE DEBUG */
.debug-button,
.verify-complete-button,
button[id*="debug"],
button[id*="Debug"],
button[onclick*="debug"],
button[onclick*="Debug"],
.debug-panel,
.debug-controls {
    display: none !important;
}

.block.correct-position {
    border: 3px solid #39FF14 !important;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.6) !important;
}

.notification {
    font-family: var(--font-body);
    font-size: 14px;
}

/* Respetar preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

#completionOverlay {
    z-index: 1000;
}

/* === ESTILOS PARA EL ANÁLISIS DETALLADO === */
#detailedAnalysisContainer {
    display: none; /* Oculto por defecto, se mostrará con JavaScript */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--background-color);
    padding: 36px;
    border: 1px solid rgba(168,85,247,0.5);
    border-radius: 16px;
    box-shadow: 0 0 50px rgba(168,85,247,0.25);
    z-index: 1000;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

#detailedAnalysisContainer h3 {
    color: var(--secondary-color);
    font-family: var(--font-head);
    font-size: 1.4em;
    font-weight: 700;
}

#detailedAnalysisContent {
    text-align: left;
}

.analysis-btn {
    background: var(--secondary-color);
    color: #0A0A12;
    border: none;
    padding: 16px 35px;
    border-radius: 12px;
    font-family: var(--font-head);
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    max-width: 350px;
    align-self: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.4);
}

.analysis-btn:hover {
    background: #B978F9;
    transform: translateY(-2px);
    box-shadow: 0 0 26px rgba(168, 85, 247, 0.55);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.5em;
    cursor: pointer;
    transition: transform 0.2s ease;
    font-weight: bold;
}

.close-btn:hover {
    transform: scale(1.2);
}

/* MEDIAS QUERIES para los nuevos elementos */
@media (max-width: 768px) {
    #detailedAnalysisContainer {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    #detailedAnalysisContainer {
        padding: 20px;
    }
    .analysis-btn {
        max-width: 250px;
        font-size: 1em;
        padding: 12px 20px;
    }
}

/* === Aviso de navegador para la voz (iPhone/Android) === */
.aviso-voz {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 8px 16px;
    background: rgba(250,204,21,0.09);
    border-bottom: 1px solid rgba(250,204,21,0.35);
    font-size: 0.83em;
    color: var(--text-2);
}
.aviso-voz b { color: var(--warning-color); }
.aviso-voz button {
    background: transparent;
    border: none;
    color: var(--text-3);
    font-size: 1em;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 6px;
}
.aviso-voz button:hover { color: var(--text-color); background: rgba(255,255,255,0.08); }
