/* Reset básico */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Contenedor principal */
.swg-container {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100% !important;
    max-width: 1200px !important;
    background-color: #f0f0f0;
    padding: 20px;
    margin: 0 auto !important;
}

/* Mobile: aprovechar ancho completo */
@media (max-width: 768px) {
    .swg-container {
        padding: 10px 5px !important;
        max-width: 100% !important;
    }
}

/* Tabs de navegación */
.swg-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    width: 100%;
    justify-content: center;
}

.tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background-color: #f5f5f5;
}

.tab-button.active {
    border-bottom-color: #4caf50;
    color: #4caf50;
    font-weight: bold;
}

/* Contenido de tabs */
.tab-content {
    width: 100%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Información de progreso */
.progress-info {
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: bold;
    color: #333;
}

/* Estadísticas del usuario */
.stats-display {
    margin-bottom: 20px;
    width: 100%;
    max-width: 800px;
}

.stats-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.stat-item {
    font-size: 16px;
    padding: 5px 10px;
    background: #f5f5f5;
    border-radius: 5px;
}

/* Gestión de tarjetas */
.manage-header {
    margin-bottom: 20px;
}

.manage-header h2 {
    color: #333;
    margin-bottom: 15px;
}

.filter-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-controls select,
.filter-controls input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.filter-controls input {
    flex: 1;
    min-width: 200px;
}

/* Tabla de palabras */
.words-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.words-table {
    width: 100%;
    border-collapse: collapse;
}

.words-table thead {
    background-color: #4caf50;
    color: white;
}

.words-table th,
.words-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.words-table tbody tr:hover {
    background-color: #f5f5f5;
}

/* Celdas especiales */
.difficulty-cell {
    font-weight: bold;
}

.difficulty-cell.easy {
    color: #4caf50;
}

.difficulty-cell.medium {
    color: #ff9800;
}

.difficulty-cell.hard {
    color: #f44336;
}

.difficulty-stars {
    color: #ff9800;
}

.difficulty-value {
    font-size: 12px;
    color: #666;
}

.correct-cell {
    color: #4caf50;
    font-weight: bold;
}

.incorrect-cell {
    color: #f44336;
    font-weight: bold;
}

.hints-cell {
    color: #2196f3;
}

/* Barra de precisión */
.accuracy-bar {
    position: relative;
    width: 100px;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.accuracy-bar .accuracy-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #4caf50;
    transition: width 0.3s ease;
}

.accuracy-text {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    line-height: 20px;
    color: #333;
}

/* Botones de acción */
.actions-cell {
    white-space: nowrap;
}

.btn-small {
    padding: 5px 8px;
    margin: 0 2px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-edit {
    background-color: #2196f3;
}

.btn-reset {
    background-color: #ff9800;
}

.btn-delete {
    background-color: #f44336;
}

.btn-small:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 900px;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

.modal h3 {
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-primary {
    background-color: #4caf50;
}

.btn-secondary {
    background-color: #666;
}

/* Modal de palabras filtradas */
.filtered-words-filters {
    margin-bottom: 20px;
}

.filtered-words-filters select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 200px;
}

.filtered-words-container {
    max-height: 400px;
    overflow-y: auto;
}

/* Estadísticas clickables */
.stat-card.clickable {
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.stat-card.clickable:hover {
    border-color: #4caf50;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.clickable-stat {
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.clickable-stat:hover {
    background-color: #e8f5e9;
    text-decoration: underline;
}

/* Estadísticas globales */
.global-stats-container {
    padding: 20px;
}

.global-stats-container h2,
.global-stats-container h3 {
    color: #333;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.stat-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #4caf50;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

/* Estadísticas por categoría */
.category-stats {
    margin-bottom: 40px;
}

#categoryStatsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.category-stat-card {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.category-stat-card h4 {
    color: #4caf50;
    margin-bottom: 10px;
}

.category-stat-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.category-progress-bar {
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.category-progress-fill {
    height: 100%;
    background: #4caf50;
    transition: width 0.3s ease;
}

/* Contenedor de categorías */
.category-container {
    margin-bottom: 20px;
    text-align: center;
}

.category-container input {
    margin: 5px;
    padding: 10px;
    font-size: 16px;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 10px 0;
}

.category-item {
    background-color: #4caf50;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.category-delete {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-weight: bold;
}

/* Formulario para agregar palabras */
.form-container {
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 600px;
}

.form-container input,
.form-container select {
    margin: 5px;
    padding: 10px;
    font-size: 16px;
}

/* Contenedor del juego */
.container {
    display: grid;
    gap: 12px;
    margin: 0 auto 20px;
    width: 100%;
    max-width: 100%; /* Respetar el ancho del padre */
    padding: 10px;
    box-sizing: border-box;
}

/* Grid responsivo */
@media (max-width: 767px) {
    .container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
        padding: 0 5px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .container {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (min-width: 1280px) {
    #gameContainer.container {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

/* Palabra fija */
.fixed-word {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 70px;
    height: auto;
    border: 2px solid #333;
    border-radius: 10px;
    background-color: white;
    color: black;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    flex-direction: column;
    padding: 8px 15px;
    box-sizing: border-box;
}

/* Tarjetas más grandes en móvil */
@media (max-width: 767px) {
    .fixed-word {
        min-height: 75px;
        height: auto;
        font-size: 15px;
        border-radius: 12px;
    }
    
    .box {
        min-height: 75px;
        height: auto;
        font-size: 13px;
        border-radius: 12px;
        padding: 10px 28px;
    }
}

/* Información de dificultad de la palabra */
.word-difficulty-info {
    position: absolute;
    top: 2px;
    right: 28px;
    font-size: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.difficulty-stars {
    color: #ff9800;
    font-size: 12px;
}

.word-stats {
    color: #666;
    font-size: 10px;
}

/* Cajas de palabras */
.box {
    position: relative;
    width: 100%;
    min-height: 70px;
    height: auto;
    border: 2px dashed #666;
    border-radius: 15px;
    background-color: #e0e0e0;
    color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    overflow: visible;
    box-sizing: border-box;
    padding: 8px 30px 8px 30px;
    font-size: 14px;
    word-break: break-word;
    line-height: 1.3;
}

/* Indicador de dificultad */
.difficulty-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #5c6bc0;
    transition: width 0.3s ease;
}

/* Botón de eliminar */
.box .delete-btn {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    opacity: 0.8;
    transition: all 0.2s;
}

.box .delete-btn:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    background-color: #d32f2f;
}

/* Estados de las cajas */
.correct {
    background-color: limegreen;
    border: 2px solid green;
    animation: correctPulse 0.6s ease;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.wrong {
    background-color: tomato;
    border: 2px solid red;
    animation: shake 0.5s;
}

.dragging {
    opacity: 0.5;
}

/* Celda de traducción */
.translation-cell {
    width: 100%;
    min-height: 70px;
    height: auto;
    border: 2px dashed #2196F3;
    border-radius: 15px;
    background-color: #E3F2FD;
    color: #1976D2;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    font-size: inherit;
    transition: all 0.3s ease;
    padding: 8px 15px;
    box-sizing: border-box;
}

.translation-cell.dragging {
    background-color: #BBDEFB;
    border-color: #1565C0;
    transform: scale(1.05);
}

.translation-cell.show-translation {
    background-color: #FFF9C4;
    border-color: #F9A825;
    color: #F57C00;
}

.translation-cell.fade-out {
    opacity: 0.3;
}

.hint-text {
    font-size: 14px;
    opacity: 0.7;
}

/* Controles */
.controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
    flex-wrap: wrap;
}

/* Botones */
.btn {
    padding: 10px 20px;
    font-size: 18px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-smart {
    background-color: #2196F3;
}

.btn-smart:hover {
    background-color: #1976D2;
}

/* Input de archivo oculto */
#fileInput {
    display: none;
}

/* Animación shake */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Ajustes para temas de WordPress */
.entry-content,
.post-content,
.page-content,
.content-area,
.site-main {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Mensaje vacío */
.empty-message {
    text-align: center;
    padding: 20px;
    font-size: 18px;
    color: #666;
    grid-column: 1 / -1;
}

/* Estilos para móvil */
@media (max-width: 767px) {
    .fixed-word {
        height: 80px;
        font-size: 14px;
    }
    
    .box {
        height: 80px;
        font-size: 14px;
    }
    
    .translation-cell {
        height: 80px;
    }
    
    .stats-container {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-item {
        width: 100%;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .words-table {
        font-size: 12px;
    }
    
    .words-table th,
    .words-table td {
        padding: 5px;
    }
    
    .accuracy-bar {
        width: 60px;
    }
    
    .tab-button {
        font-size: 14px;
        padding: 8px 15px;
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    .filter-controls select,
    .filter-controls input {
        width: 100%;
    }
}
/* Estilos para encabezados ordenables */
.words-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.3s ease;
}

.words-table th.sortable:hover {
    background-color: #45a049;
}

/* Indicadores de ordenamiento */
.sort-indicator {
    margin-left: 5px;
    font-size: 12px;
    color: #fff;
    opacity: 0.9;
}

/* Estados de ordenamiento */
.words-table th.sorted-asc,
.words-table th.sorted-desc {
    background-color: #388e3c;
    font-weight: bold;
}

.words-table th.sorted-asc .sort-indicator,
.words-table th.sorted-desc .sort-indicator {
    font-weight: bold;
    opacity: 1;
}

/* Animación al cambiar ordenamiento */
.words-table tbody tr {
    animation: fadeIn 0.3s ease;
}

/* Tooltip para indicar que es clickable */
.words-table th.sortable::after {
    content: '';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    opacity: 0.3;
}

.words-table th.sortable:not(.sorted-asc):not(.sorted-desc)::after {
    border-top: 4px solid white;
    border-bottom: 4px solid white;
    height: 12px;
}

/* Mejorar visibilidad en móviles */
@media (max-width: 767px) {
    .sort-indicator {
        font-size: 10px;
    }
    
    .words-table th.sortable {
        padding-right: 20px;
    }
}
/* ============================================
   NUEVOS ESTILOS v3.0
   ============================================ */

/* Selector de cantidad de palabras */
.game-settings {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.display-count-select {
    padding: 8px 15px;
    border: 2px solid #4caf50;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    font-weight: 600;
    color: #4caf50;
}

.display-count-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

/* Campo de explicación en formulario */
#wordExplanation {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

#wordExplanation:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

#wordExplanation::placeholder {
    color: #999;
}

/* Botón de explicación en las cajas */
.explain-btn {
    position: absolute;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #2196f3;
    color: white;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.explain-btn:hover {
    opacity: 1;
    background: #1976d2;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.4);
}

/* Tab bloqueado */
.tab-button.tab-locked {
    background-color: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
}

.tab-button.tab-locked:hover {
    background-color: #f5f5f5;
}

/* Modal de explicación */
.modal-explanation {
    max-width: 700px;
    width: 90%;
}

.explanation-word-header {
    background: #e3f2fd;
    padding: 18px 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
    font-size: 20px;
}

.explanation-word-header .word-en,
.explanation-word-header .word-es {
    font-weight: bold;
    color: #1976d2;
    font-size: 22px;
}

.explanation-word-header .arrow {
    margin: 0 15px;
    color: #666;
    font-size: 20px;
}

.explanation-text-content {
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    line-height: 1.8;
    font-size: 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.explanation-text-content p {
    margin: 0 0 12px 0;
    color: #333;
}

.explanation-text-content p:last-child {
    margin-bottom: 0;
}

.no-explanation {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 30px;
    font-size: 16px;
}

/* Estadísticas - Gráficos */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
}

.chart-card h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.chart-card canvas {
    max-height: 220px;
}

/* Premium bloqueado */
.premium-locked-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 350px;
    padding: 40px;
}

.premium-locked-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
}

.lock-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.premium-locked-content h2 {
    color: #333;
    margin-bottom: 10px;
}

.premium-features-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.premium-features-list li {
    padding: 10px 15px;
    background: #f8f8f8;
    border-radius: 8px;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

/* Stats grid clickable */
.stat-card.clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card.clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

/* Responsive */
@media (max-width: 767px) {
    .game-settings {
        flex-direction: column;
        align-items: center;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .suggestions-grid {
        grid-template-columns: 1fr;
    }
    
    #categoryStatsContainer {
        grid-template-columns: 1fr;
    }
}

/* ===== TOAST DE ÉXITO CON EXPLICACIÓN ===== */
.match-success-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #4caf50;
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    min-width: 300px;
}

.match-success-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.toast-icon {
    font-size: 24px;
    animation: pulse-icon 0.5s ease;
}

@keyframes pulse-icon {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.toast-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.toast-word-en {
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
}

.toast-word-es {
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
}

.toast-arrow {
    font-size: 18px;
}

.toast-explain-btn {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid white;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.toast-explain-btn:hover {
    background: white;
    color: #4caf50;
    transform: scale(1.05);
}

.toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
    opacity: 0.7;
    transition: opacity 0.2s;
    margin-left: auto;
}

.toast-close:hover {
    opacity: 1;
}

/* Responsive para el toast */
@media (max-width: 600px) {
    .match-success-toast {
        bottom: 100px;
        left: 10px;
        right: 10px;
        transform: translateY(100px);
        padding: 12px;
        flex-direction: column;
        min-width: auto;
        width: auto;
        max-width: none;
        text-align: center;
        box-sizing: border-box;
    }
    
    .match-success-toast.show {
        transform: translateY(0);
    }
    
    .toast-content {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 8px;
    }
    
    .toast-icon {
        font-size: 20px;
    }
    
    .toast-text {
        font-size: 13px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
        width: 100%;
    }
    
    .toast-word-en,
    .toast-word-es {
        padding: 4px 8px;
        font-size: 12px;
        word-break: break-word;
        max-width: 100%;
        display: inline-block;
    }
    
    .toast-arrow {
        font-size: 14px;
    }
    
    .toast-explain-btn {
        width: 100%;
        margin-top: 6px;
        padding: 10px 12px;
        font-size: 13px;
        white-space: normal;
    }
    
    .toast-close {
        position: absolute;
        top: 5px;
        right: 5px;
        font-size: 18px;
        padding: 2px 6px;
    }
}

/* ============================================
   ESTILOS DE GAMIFICACIÓN v4.0
   ============================================ */

/* Contenedor de confeti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

/* Animación de confeti */
@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Notificación de logro */
.swg-achievement {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 18px 22px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 30px rgba(76, 175, 80, 0.4);
    z-index: 10001;
    max-width: 350px;
    animation: slideInRight 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideInRight {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.achievement-icon {
    font-size: 2.2rem;
}

.achievement-content {
    flex: 1;
}

.achievement-title {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 3px;
}

.achievement-desc {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Efectos de sonido indicator */
.sound-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    border: 2px solid #4caf50;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.sound-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.sound-toggle.muted {
    background: #f5f5f5;
    border-color: #ccc;
    opacity: 0.7;
}

/* Badge de racha */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ff9800;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4); }
    50% { box-shadow: 0 6px 20px rgba(255, 152, 0, 0.6); }
}

/* Mejora en animación correcta */
.box.correct {
    animation: correctBounce 0.6s ease;
}

@keyframes correctBounce {
    0% { transform: scale(1); background-color: limegreen; }
    30% { transform: scale(1.1); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); background-color: limegreen; }
}

/* Efecto de glow en la palabra actual */
.fixed-word:hover {
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
}

/* Responsive para logros */
@media (max-width: 500px) {
    .swg-achievement {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        padding: 15px;
    }
    
    .achievement-icon {
        font-size: 1.8rem;
    }
    
    .achievement-title {
        font-size: 0.95rem;
    }
    
    .achievement-desc {
        font-size: 0.8rem;
    }
}

/* ============================================
   EDITOR TINYMCE - ESTILOS v4.0
   ============================================ */

.explanation-editor-wrapper {
    width: 100%;
    margin: 10px 0;
}

.explanation-editor-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

/* Ajustar el contenedor del editor */
.explanation-editor-wrapper .wp-editor-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.explanation-editor-wrapper .wp-editor-tabs {
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.explanation-editor-wrapper .mce-panel {
    border: none !important;
}

.explanation-editor-wrapper .mce-toolbar-grp {
    background: #f9f9f9 !important;
    border-bottom: 1px solid #eee !important;
}

.explanation-editor-wrapper .mce-edit-area {
    border: none !important;
}

.explanation-editor-wrapper .mce-edit-area iframe {
    min-height: 100px !important;
}

/* Estilos para el textarea en modo texto */
.explanation-editor-wrapper .wp-editor-area {
    width: 100% !important;
    min-height: 100px;
    padding: 10px;
    font-size: 14px;
    line-height: 1.6;
    border: none;
}

/* Responsive */
@media (max-width: 767px) {
    .explanation-editor-wrapper .mce-toolbar .mce-btn-group {
        padding: 2px;
    }
    
    .explanation-editor-wrapper .mce-btn button {
        padding: 4px 6px;
    }
}

/* Mostrar explicación con formato preservado */
.explanation-text-content {
    line-height: 1.7;
}

.explanation-text-content p {
    margin: 0 0 10px 0;
}

.explanation-text-content p:last-child {
    margin-bottom: 0;
}

.explanation-text-content ul,
.explanation-text-content ol {
    margin: 10px 0;
    padding-left: 25px;
}

.explanation-text-content li {
    margin-bottom: 5px;
}

.explanation-text-content a {
    color: #2196f3;
    text-decoration: underline;
}

.explanation-text-content strong,
.explanation-text-content b {
    font-weight: bold;
}

.explanation-text-content em,
.explanation-text-content i {
    font-style: italic;
}

/* ===================================================================
   ESTILOS PARA SOPORTE TÁCTIL/MÓVIL (v4.1)
   =================================================================== */

/* Clon de arrastre táctil */
.touch-dragging-clone {
    background: #4caf50 !important;
    color: white !important;
    border-radius: 10px !important;
    padding: 15px 25px !important;
    font-size: 20px !important;
    font-weight: bold !important;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.5) !important;
    border: 3px solid rgba(255, 255, 255, 0.3) !important;
}

/* Elemento fuente durante arrastre */
.touch-dragging-source {
    opacity: 0.4 !important;
    transform: scale(0.95) !important;
}

/* Elemento objetivo durante arrastre táctil */
.touch-drag-over {
    transform: scale(1.08) !important;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.6) !important;
    border-color: #4caf50 !important;
    background-color: rgba(76, 175, 80, 0.15) !important;
}

/* Indicador visual de área táctil en móviles */
@media (hover: none) and (pointer: coarse) {
    .fixed-word {
        cursor: grab;
        position: relative;
    }
    
    .fixed-word::after {
        content: '👆 Toca y arrastra';
        position: absolute;
        bottom: -25px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 11px;
        color: #666;
        white-space: nowrap;
        opacity: 0.8;
    }
    
    .box:not(.correct) {
        cursor: pointer;
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .box:not(.correct):active {
        transform: scale(0.98);
        background-color: rgba(76, 175, 80, 0.1);
    }
    
    .translation-cell {
        cursor: pointer;
        min-height: 60px;
    }
    
    .translation-cell:active {
        background-color: rgba(33, 150, 243, 0.1);
    }
    
    /* Hacer botones más grandes en móvil */
    .delete-btn,
    .explain-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 16px !important;
    }
    
    /* Aumentar área táctil de controles */
    .btn {
        min-height: 48px;
        padding: 12px 20px;
    }
    
    /* Espaciado extra para evitar clics accidentales */
    .controls {
        gap: 12px;
    }
    
    .controls .btn {
        flex: 1;
        min-width: 120px;
    }
}

/* Mejoras responsivas adicionales para móviles */
@media (max-width: 600px) {
    .swg-container {
        padding: 10px;
    }
    
    .swg-tabs {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .tab-button {
        padding: 8px 12px;
        font-size: 14px;
        flex: 1;
        min-width: 100px;
        text-align: center;
    }
    
    .progress-info {
        font-size: 16px;
        text-align: center;
    }
    
    .stats-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stat-item {
        text-align: center;
        padding: 8px;
    }
    
    .container {
        padding: 10px;
        gap: 10px;
    }
    
    .fixed-word {
        font-size: 18px;
        padding: 12px 20px;
        margin-bottom: 15px;
    }
    
    .box {
        font-size: 14px;
        padding: 12px 15px;
        min-height: 55px;
    }
    
    .translation-cell {
        font-size: 14px;
        padding: 15px;
    }
    
    .form-container {
        padding: 15px;
    }
    
    .form-container input,
    .form-container select {
        font-size: 16px; /* Previene zoom en iOS */
        padding: 12px;
    }
    
    .category-container {
        padding: 15px;
    }
    
    .category-container input {
        font-size: 16px;
        padding: 12px;
    }
    
    .controls {
        flex-wrap: wrap;
    }
    
    .controls .btn {
        font-size: 14px;
        padding: 10px 15px;
    }
    
    /* Modales responsivos */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 10px auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-large {
        width: 98%;
    }
    
    /* Tabla responsiva */
    .words-table-container {
        margin: 0 -10px;
        border-radius: 0;
    }
    
    .words-table th,
    .words-table td {
        padding: 8px 5px;
        font-size: 12px;
    }
    
    /* Ocultar columnas menos importantes en móvil */
    .words-table th:nth-child(5),
    .words-table td:nth-child(5),
    .words-table th:nth-child(6),
    .words-table td:nth-child(6),
    .words-table th:nth-child(7),
    .words-table td:nth-child(7) {
        display: none;
    }
    
    /* Gráficos responsivos */
    .charts-container {
        flex-direction: column;
    }
    
    .chart-card {
        width: 100%;
    }
    
    /* Stats cards */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px 10px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    /* Toast en móvil */
    .match-success-toast {
        left: 10px;
        right: 10px;
        bottom: 20px;
        max-width: none;
    }
    
    /* Achievement en móvil */
    .swg-achievement {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Mejoras para tablets */
@media (min-width: 601px) and (max-width: 900px) {
    .container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .charts-container {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .chart-card {
        flex: 1 1 45%;
        min-width: 280px;
    }
}

/* Animación de feedback táctil */
@keyframes touchFeedback {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.touch-feedback {
    animation: touchFeedback 0.15s ease-out;
}

/* Prevenir selección de texto durante arrastre */
.swg-container {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Pero permitir selección en inputs */
.swg-container input,
.swg-container textarea,
.swg-container select {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Mejora de rendimiento para animaciones */
.fixed-word,
.box,
.touch-dragging-clone {
    will-change: transform;
}

/* Safe area para dispositivos con notch */
@supports (padding: max(0px)) {
    .swg-container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* ============================================
   MODO JUEGO - Ocultar formulario v4.2
   ============================================ */

/* Botón toggle para mostrar/ocultar formulario */
.toggle-form-btn {
    background: #5c6bc0;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.toggle-form-btn .icon {
    transition: transform 0.3s ease;
}

.toggle-form-btn.collapsed .icon {
    transform: rotate(180deg);
}

/* Contenedor colapsable para formulario */
.collapsible-form {
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    max-height: 800px;
    opacity: 1;
}

.collapsible-form.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0 !important;
    padding: 0 !important;
}

/* Cuando el juego está activo, mostrar indicador */
.game-active-indicator {
    background: #4caf50;
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 15px;
    display: none;
    align-items: center;
    gap: 8px;
    animation: pulse-soft 2s infinite;
}

.game-active-indicator.visible {
    display: inline-flex;
}

@keyframes pulse-soft {
    0%, 100% { box-shadow: 0 0 0 0 rgba(56, 239, 125, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(56, 239, 125, 0); }
}

/* Área de controles del toggle */
.form-toggle-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

/* ==========================================
   INDICADORES DE EXPLICACIÓN EN TABLA
   ========================================== */

.explanation-indicator {
    display: inline-block;
    margin-left: 8px;
    cursor: help;
    font-size: 14px;
    animation: pulse-glow 2s infinite;
}

.no-explanation-indicator {
    display: inline-block;
    margin-left: 8px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.no-explanation-indicator:hover {
    opacity: 1;
}

@keyframes pulse-glow {
    0%, 100% { 
        filter: brightness(1);
        transform: scale(1);
    }
    50% { 
        filter: brightness(1.3);
        transform: scale(1.1);
    }
}

/* Mejorar el modal de edición */
#editWordModal .modal-content {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

#editWordModal .explanation-editor-wrapper {
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

#editWordModal .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

#editWordModal .form-group {
    margin-bottom: 15px;
}

#editWordModal .modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* Tooltip para botones de acción */
.btn-small {
    position: relative;
}

.btn-small::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
}

.btn-small:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   LÍMITES DE CATEGORÍAS - VERSIÓN FREEMIUM
   ============================================ */

.limit-info {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
    width: 100%;
}

.limit-info small {
    color: #997300;
    font-size: 11px;
}

.limit-counter {
    background: #e8f5e9;
    border: 1px solid #4caf50;
    color: #2e7d32;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    margin-top: 10px;
    text-align: center;
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    background: #cccccc !important;
}

.btn-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Indicador de premium en la UI */
.premium-badge {
    display: inline-block;
    background: #ffd700;
    color: #333;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 5px;
    text-transform: uppercase;
}

/* ========================================
   ESTILOS DE ESTADÍSTICAS
   ======================================== */

/* Filtro de categorías */
.stats-filter-wrapper {
    margin-bottom: 25px;
}

.stats-filter-card {
    background: #5c6bc0;
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-icon {
    font-size: 24px;
    background: rgba(255,255,255,0.2);
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-content {
    flex: 1;
    min-width: 180px;
}

.filter-content label {
    display: block;
    color: rgba(255,255,255,0.85);
    font-size: 11px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.custom-select {
    width: 100%;
    padding: 10px 35px 10px 12px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
    appearance: none;
}

.btn-refresh {
    background: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #5c6bc0;
}

.btn-refresh:hover {
    background: #f0f0f0;
}

/* Estadísticas detalladas */
.detailed-stats-wrapper {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.section-title {
    font-size: 18px;
    color: #333;
    margin: 0 0 20px 0;
}

.detailed-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.detail-card {
    border-radius: 12px;
    padding: 18px;
}

.detail-card.accuracy-card { background: #e8f5e9; }
.detail-card.attempts-card { background: #e3f2fd; }
.detail-card.hints-card { background: #fff8e1; }
.detail-card.difficulty-card { background: #fce4ec; }

.detail-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.detail-icon {
    font-size: 22px;
}

.detail-title {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.big-stat {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
}

.accuracy-card .big-stat { color: #2e7d32; }
.attempts-card .big-stat { color: #1565c0; }
.hints-card .big-stat { color: #e65100; }
.difficulty-card .big-stat { color: #c2185b; }

.progress-bar-wrapper {
    margin-top: 10px;
}

.progress-bar-bg {
    height: 8px;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
}

.progress-bar-fill.accuracy-fill { background: #4caf50; }
.progress-bar-fill.difficulty-fill { background: #e91e63; }

.stat-breakdown {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    font-size: 14px;
}

.breakdown-item.correct { color: #4caf50; font-weight: 600; }
.breakdown-item.incorrect { color: #f44336; font-weight: 600; }

.stat-sub {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

/* Paneles de palabras */
.words-showcase-panel {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.words-showcase-panel.difficult-panel {
    border-left: 5px solid #f44336;
}

.words-showcase-panel.mastered-panel {
    border-left: 5px solid #4caf50;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.panel-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-emoji {
    font-size: 26px;
}

.panel-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.panel-badge {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
}

.difficult-badge {
    background: #ffebee;
    color: #c62828;
}

.mastered-badge {
    background: #e8f5e9;
    color: #2e7d32;
}

.words-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 15px;
}

/* Tarjetas de palabras */
.showcase-word-card {
    background: #fafafa;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
    transition: transform 0.2s ease;
}

.showcase-word-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.showcase-word-card.difficult-card {
    border-top: 3px solid #f44336;
}

.showcase-word-card.mastered-card {
    border-top: 3px solid #4caf50;
}

.card-top-section {
    padding: 16px;
    background: white;
    position: relative;
}

.card-rank {
    position: absolute;
    top: 12px;
    right: 12px;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.difficult-card .card-rank {
    background: #f44336;
    color: white;
}

.mastered-card .card-rank {
    background: #ffc107;
    color: #333;
    font-size: 16px;
}

.word-pair-display {
    padding-right: 40px;
}

.word-english {
    font-size: 17px;
    font-weight: 700;
    color: #1a237e;
    margin-bottom: 4px;
    display: block;
}

.word-spanish {
    font-size: 14px;
    color: #5c6bc0;
}

.word-category-tag {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 10px;
    font-size: 11px;
    color: #666;
}

.card-stats-section {
    padding: 12px 16px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-item-value {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    display: block;
}

.stat-item-label {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
}

.difficulty-mini-bar {
    flex: 1;
    max-width: 90px;
}

.difficulty-mini-track {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.difficulty-mini-fill {
    height: 100%;
    border-radius: 3px;
}

.difficulty-mini-fill.high { background: #f44336; }
.difficulty-mini-fill.low { background: #4caf50; }

.difficulty-value-badge {
    text-align: center;
    margin-top: 3px;
    font-size: 11px;
    font-weight: 700;
}

.difficulty-value-badge.high { color: #f44336; }
.difficulty-value-badge.low { color: #4caf50; }

.accuracy-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.accuracy-circle.low { background: #ffebee; color: #c62828; }
.accuracy-circle.medium { background: #fff8e1; color: #e65100; }
.accuracy-circle.high { background: #e8f5e9; color: #2e7d32; }
.accuracy-circle.perfect { background: #ffc107; color: #333; }

.mastery-stars-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mastery-stars {
    font-size: 13px;
}

.mastery-text {
    font-size: 9px;
    color: #4caf50;
    font-weight: 600;
    text-transform: uppercase;
    background: #e8f5e9;
    padding: 3px 7px;
    border-radius: 6px;
}

.empty-showcase-card {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 2px dashed #ddd;
}

.empty-showcase-card .empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
    display: block;
}

.empty-showcase-card .empty-title {
    font-size: 15px;
    color: #666;
    margin: 0 0 6px;
}

.empty-showcase-card .empty-hint {
    font-size: 12px;
    color: #999;
    margin: 0;
}

/* Responsive para estadísticas */
@media (max-width: 768px) {
    .stats-filter-card {
        flex-direction: column;
    }
    
    .filter-content {
        width: 100%;
    }
    
    .btn-refresh {
        width: 100%;
        justify-content: center;
    }
    
    .detailed-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .words-showcase-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .detailed-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .big-stat {
        font-size: 26px;
    }
    
    .card-stats-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .difficulty-mini-bar {
        max-width: none;
        width: 100%;
    }
}

/* ========================================
   PANEL DE RACHA DIARIA
   ======================================== */

.streak-panel {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.streak-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.streak-flame {
    font-size: 48px;
    animation: flameGlow 1s ease-in-out infinite alternate;
}

.streak-flame.inactive {
    filter: grayscale(100%);
    animation: none;
}

@keyframes flameGlow {
    from { transform: scale(1); filter: brightness(1); }
    to { transform: scale(1.1); filter: brightness(1.2); }
}

.streak-details {
    display: flex;
    flex-direction: column;
}

.streak-count {
    font-size: 36px;
    font-weight: 800;
    color: #ff6b35;
    line-height: 1;
}

.streak-label {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
}

.streak-stats {
    display: flex;
    gap: 25px;
}

.streak-stat {
    text-align: center;
    padding: 10px 20px;
    background: #f5f5f5;
    border-radius: 12px;
}

.streak-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.streak-stat-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
}

.streak-goal {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.streak-goal-text {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.streak-goal-bar {
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.streak-goal-fill {
    height: 100%;
    background: #ff6b35;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.streak-goal-fill.complete {
    background: #4caf50;
}

.streak-goal-progress {
    text-align: right;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* Celebración de racha */
.streak-celebration {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
    text-align: center;
    z-index: 10000;
    animation: celebrationPop 0.5s ease;
}

@keyframes celebrationPop {
    0% { transform: translate(-50%, -50%) scale(0); }
    70% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.streak-celebration .celebration-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.streak-celebration h2 {
    color: #ff6b35;
    margin: 0 0 10px;
}

.streak-celebration p {
    color: #666;
    margin: 0 0 20px;
}

.streak-celebration .btn {
    background: #ff6b35;
    color: white;
}

/* ========================================
   MODO CONTRARRELOJ
   ======================================== */

.timer-panel {
    background: #1a1a2e;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    color: white;
}

.timer-display {
    display: flex;
    align-items: center;
    gap: 15px;
}

.timer-icon {
    font-size: 36px;
}

.timer-time {
    font-size: 56px;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    min-width: 80px;
    text-align: center;
}

.timer-time.warning {
    color: #ffcc00;
    text-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
    animation: timerPulse 0.5s ease-in-out infinite;
}

.timer-time.danger {
    color: #ff4444;
    text-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
    animation: timerPulse 0.3s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.timer-label {
    font-size: 14px;
    color: #888;
    text-transform: uppercase;
}

.timer-score {
    text-align: center;
    padding: 15px 30px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
}

.timer-score-value {
    display: block;
    font-size: 42px;
    font-weight: 800;
    color: #00ff88;
}

.timer-score-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
}

.btn-timer {
    background: #1a1a2e !important;
    color: #00ff88 !important;
    border: 2px solid #00ff88 !important;
}

.btn-timer:hover {
    background: #00ff88 !important;
    color: #1a1a2e !important;
}

.btn-danger {
    background: #ff4444 !important;
    color: white !important;
    border: none !important;
}

.btn-danger:hover {
    background: #cc0000 !important;
}

/* Modal de selección de tiempo */
.timer-select-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.timer-select-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.timer-select-content h3 {
    margin: 0 0 20px;
    color: #333;
}

.timer-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.timer-option {
    padding: 20px 25px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.timer-option:hover {
    border-color: #5c6bc0;
    background: #f0f0ff;
}

.timer-option.selected {
    border-color: #5c6bc0;
    background: #5c6bc0;
    color: white;
}

.timer-option .time-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
}

.timer-option .time-label {
    font-size: 12px;
    color: inherit;
    opacity: 0.7;
}

/* Resultado del modo contrarreloj */
.timer-result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.timer-result-content {
    background: #1a1a2e;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    color: white;
    max-width: 400px;
    width: 90%;
}

.timer-result-content h2 {
    color: #00ff88;
    margin: 0 0 10px;
    font-size: 28px;
}

.timer-result-content .result-score {
    font-size: 72px;
    font-weight: 800;
    color: #00ff88;
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
    margin: 20px 0;
}

.timer-result-content .result-label {
    color: #888;
    margin-bottom: 20px;
}

.timer-result-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
}

.timer-result-stat {
    text-align: center;
}

.timer-result-stat .stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.timer-result-stat .stat-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
}

.timer-result-content .result-message {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 16px;
}

.new-record {
    color: #ffd700 !important;
    animation: recordGlow 1s ease-in-out infinite alternate;
}

@keyframes recordGlow {
    from { text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
    to { text-shadow: 0 0 30px rgba(255, 215, 0, 0.8); }
}

/* Responsive */
@media (max-width: 768px) {
    .streak-panel {
        flex-direction: column;
        text-align: center;
    }
    
    .streak-info {
        flex-direction: column;
    }
    
    .streak-goal {
        max-width: 100%;
        width: 100%;
    }
    
    .timer-panel {
        flex-direction: column;
        text-align: center;
    }
    
    .timer-time {
        font-size: 48px;
    }
    
    .timer-options {
        flex-direction: column;
    }
}

/* ========================================
   NUEVA INTERFAZ DE JUEGO v4.5
   ======================================== */

/* === PANTALLA DE INICIO === */
.game-start-screen {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* Barra de racha compacta */
.streak-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 25px;
    color: white;
}

.streak-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.streak-flame-mini {
    font-size: 24px;
}

.streak-count-mini {
    font-size: 24px;
    font-weight: 800;
}

.streak-text-mini {
    font-size: 12px;
    opacity: 0.9;
}

.streak-bar-center {
    flex: 1;
    max-width: 200px;
    margin: 0 20px;
}

.daily-progress-mini {
    font-size: 12px;
    text-align: center;
}

.progress-bar-mini {
    height: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    margin-top: 5px;
    overflow: hidden;
}

.progress-fill-mini {
    height: 100%;
    background: white;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.streak-bar-right {
    font-size: 14px;
}

.best-streak-mini {
    background: rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 15px;
}

/* Hero section */
.game-hero {
    text-align: center;
    padding: 30px 0;
}

.hero-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.hero-title {
    font-size: 36px;
    font-weight: 800;
    color: #333;
    margin: 0 0 10px;
}

.hero-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Selector de categoría */
.category-selector-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.selector-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
}

.category-select-styled {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

.category-select-styled:focus {
    outline: none;
    border-color: #5c6bc0;
}

.category-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    font-size: 13px;
    color: #888;
}

.category-info span {
    background: #f5f5f5;
    padding: 5px 12px;
    border-radius: 15px;
}

/* Panel de configuración */
.config-panel {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.config-title {
    font-size: 16px;
    color: #333;
    margin: 0 0 20px;
}

.config-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.config-item label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.config-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.config-btn {
    padding: 10px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.config-btn:hover {
    border-color: #5c6bc0;
}

.config-btn.active {
    background: #5c6bc0;
    border-color: #5c6bc0;
    color: white;
}

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

.toggle-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    border-color: #5c6bc0;
}

.toggle-btn.active {
    background: #5c6bc0;
    border-color: #5c6bc0;
    color: white;
}

.toggle-btn .flag {
    font-size: 18px;
}

/* Switch toggle */
.switch-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.switch-container input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.switch-slider {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    background-color: #ccc;
    border-radius: 28px;
    transition: 0.3s;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.switch-container input:checked + .switch-slider {
    background-color: #5c6bc0;
}

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

.switch {
    position: relative;
    width: 50px;
    height: 28px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #5c6bc0;
}

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

.switch-label {
    font-size: 13px;
    color: #666;
}

/* Botones de modo de juego */
.game-modes {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.mode-btn:hover {
    transform: translateY(-3px);
}

.mode-normal {
    background: linear-gradient(135deg, #5c6bc0, #3f51b5);
    color: white;
}

.mode-normal:hover {
    box-shadow: 0 8px 25px rgba(92, 107, 192, 0.4);
}

.mode-timer {
    background: linear-gradient(135deg, #ff6b35, #f44336);
    color: white;
}

.mode-timer:hover {
    box-shadow: 0 8px 25px rgba(244, 67, 54, 0.4);
}

.mode-icon {
    font-size: 36px;
}

.mode-info {
    display: flex;
    flex-direction: column;
}

.mode-title {
    font-size: 18px;
    font-weight: 700;
}

.mode-desc {
    font-size: 12px;
    opacity: 0.9;
}

/* Link para agregar palabras */
.add-words-link {
    text-align: center;
    margin-bottom: 20px;
}

.link-btn {
    background: none;
    border: none;
    color: #5c6bc0;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.link-btn:hover {
    color: #3f51b5;
}

/* Panel de agregar palabras */
.add-words-panel {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.panel-header-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.panel-header-mini h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.close-panel-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
}

.add-form-compact {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.input-styled {
    flex: 1;
    min-width: 120px;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.input-styled:focus {
    outline: none;
    border-color: #5c6bc0;
}

.btn-small {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    background: #e0e0e0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-small.btn-primary {
    background: #5c6bc0;
    color: white;
}

.explanation-compact {
    margin-top: 15px;
}

.explanation-compact label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

/* === PANTALLA DE JUEGO === */
.game-play-screen {
    max-width: 100%;
    margin: 0 auto;
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: white;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.back-btn {
    background: none;
    border: none;
    font-size: 14px;
    color: #5c6bc0;
    cursor: pointer;
    font-weight: 600;
}

.game-status {
    text-align: center;
}

.status-category {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.status-progress {
    font-size: 12px;
    color: #888;
}

.game-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: #f0f0f0;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.action-btn:hover {
    background: #e0e0e0;
}

/* Timer bar */
.timer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #1a1a2e;
    border-radius: 12px;
    margin-bottom: 15px;
    color: white;
}

.timer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-icon-small {
    font-size: 20px;
}

.timer-value {
    font-size: 32px;
    font-weight: 800;
    color: #00ff88;
    font-family: 'Courier New', monospace;
}

.timer-value.warning {
    color: #ffcc00;
}

.timer-value.danger {
    color: #ff4444;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.timer-unit {
    font-size: 12px;
    color: #888;
}

.timer-center {
    text-align: center;
}

.score-display {
    display: flex;
    flex-direction: column;
}

.score-value {
    font-size: 28px;
    font-weight: 800;
    color: #00ff88;
}

.score-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
}

.stop-btn {
    padding: 10px 20px;
    background: #ff4444;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.stop-btn:hover {
    background: #cc0000;
}

/* Game area */
.game-area {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    min-height: 300px;
    width: 100%;
    overflow: hidden; /* Evitar desbordamiento del container hijo */
    box-sizing: border-box;
}

/* Game area más compacto en móvil */
@media (max-width: 767px) {
    .game-area {
        padding: 12px 8px;
        border-radius: 12px;
        margin-bottom: 10px;
    }
}

/* Game footer */
.game-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 15px;
}

.footer-btn {
    padding: 12px 24px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.footer-btn:hover {
    border-color: #5c6bc0;
    background: #f8f9ff;
}

.footer-btn.btn-smart {
    background: #5c6bc0;
    border-color: #5c6bc0;
    color: white;
}

/* === MODAL DE TIMER === */
.timer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.timer-modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.timer-modal-content h3 {
    margin: 0 0 10px;
    font-size: 24px;
    color: #333;
}

.timer-modal-content p {
    margin: 0 0 20px;
    color: #666;
}

.time-options {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.time-option {
    width: 70px;
    height: 70px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.time-option:hover {
    border-color: #5c6bc0;
}

.time-option.active {
    background: #5c6bc0;
    border-color: #5c6bc0;
    color: white;
}

.time-num {
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.time-text {
    font-size: 11px;
}

.timer-modal-options {
    margin-bottom: 20px;
}

.checkbox-styled {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
}

.checkbox-styled input {
    width: 18px;
    height: 18px;
}

.timer-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-start-timer {
    padding: 14px 30px;
    background: linear-gradient(135deg, #ff6b35, #f44336);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-start-timer:hover {
    transform: scale(1.05);
}

.btn-cancel {
    padding: 14px 24px;
    background: #f0f0f0;
    border: none;
    border-radius: 10px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .game-modes {
        flex-direction: column;
    }
    
    .mode-btn {
        justify-content: center;
    }
    
    .streak-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .streak-bar-center {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin: 0;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-icon {
        font-size: 48px;
    }
    
    .game-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .game-actions {
        width: 100%;
        justify-content: center;
    }
    
    .timer-bar {
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }
    
    .game-footer {
        flex-wrap: wrap;
    }
    
    .footer-btn {
        flex: 1;
        min-width: 100px;
    }
}

/* ========================================
   BANNER PREMIUM CTA
   ======================================== */

.premium-cta-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 20px;
    padding: 30px 40px;
    margin: 25px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
}

.premium-cta-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.premium-cta-content {
    flex: 1;
    min-width: 250px;
    position: relative;
    z-index: 1;
}

.premium-cta-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.premium-cta-title {
    color: white;
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.premium-cta-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 16px;
    margin: 0;
}

.premium-cta-features {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.premium-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 14px;
}

.premium-feature-icon {
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.premium-cta-action {
    position: relative;
    z-index: 1;
}

.premium-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: white;
    color: #667eea;
    padding: 18px 35px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.premium-cta-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    color: #764ba2;
}

.premium-cta-btn .btn-icon {
    font-size: 24px;
}

.premium-cta-btn .btn-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.premium-cta-btn .btn-main {
    font-size: 18px;
    line-height: 1.2;
}

.premium-cta-btn .btn-sub {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.7;
}

.premium-cta-decoration {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 120px;
    opacity: 0.1;
    z-index: 0;
}

/* Banner compacto para usuarios free */
.premium-mini-banner {
    background: linear-gradient(90deg, #f093fb, #f5576c);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.premium-mini-text {
    font-size: 14px;
    font-weight: 600;
}

.premium-mini-text span {
    opacity: 0.9;
    font-weight: 400;
}

.premium-mini-btn {
    background: white;
    color: #f5576c;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.premium-mini-btn:hover {
    transform: scale(1.05);
    color: #f5576c;
}

/* Layout mejorado para pantalla de inicio */
.game-start-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 20px;
}

.game-start-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-start-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Hero más grande y centrado */
.game-hero {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    margin-bottom: 25px;
}

.hero-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 10px;
}

.hero-subtitle {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* Modos de juego más grandes */
.game-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.mode-btn {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 30px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-icon {
    font-size: 48px;
}

.mode-title {
    font-size: 20px;
    font-weight: 700;
}

.mode-desc {
    font-size: 13px;
    opacity: 0.9;
}

/* Responsive para el nuevo layout */
@media (max-width: 900px) {
    .game-start-content {
        grid-template-columns: 1fr;
    }
    
    .game-modes {
        grid-template-columns: 1fr 1fr;
    }
    
    .premium-cta-banner {
        flex-direction: column;
        text-align: center;
        padding: 25px;
    }
    
    .premium-cta-features {
        justify-content: center;
    }
    
    .premium-cta-decoration {
        display: none;
    }
}

@media (max-width: 600px) {
    .game-modes {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-icon {
        font-size: 60px;
    }
    
    .premium-cta-title {
        font-size: 22px;
    }
    
    .premium-cta-btn {
        padding: 15px 25px;
        font-size: 16px;
    }
}

/* Panel de agregar palabras visible en la columna derecha */
.game-start-right .add-words-panel {
    display: block !important;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.game-start-right .add-words-panel .panel-header-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.game-start-right .add-words-panel .panel-header-mini h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.game-start-right .add-words-panel .close-panel-btn {
    display: none;
}

/* Ajustar la grid de modos de juego en columna derecha */
.game-start-right .game-modes {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 0;
}

.game-start-right .mode-btn {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 25px;
}

.game-start-right .mode-icon {
    font-size: 40px;
    margin-right: 15px;
}

/* ============================================
   MEJORAS v4.6 - Interfaz Simplificada
   ============================================ */

/* Barra superior con racha y herramientas */
.swg-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 15px;
}

/* Badge de racha compacto con tooltip */
.streak-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #ff9800 0%, #ff5722 100%);
    border-radius: 25px;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.streak-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.streak-badge .streak-flame-mini {
    font-size: 16px;
}

.streak-badge .streak-count-mini {
    font-size: 15px;
    font-weight: 700;
    color: white;
}

/* Tooltip de racha */
.streak-tooltip-box {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.streak-badge:hover .streak-tooltip-box {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.streak-tooltip-box::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.tooltip-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.tooltip-stat:last-of-type {
    border-bottom: none;
}

.tooltip-label {
    font-size: 13px;
    color: #666;
}

.tooltip-value {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.tooltip-progress-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

.tooltip-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Botones de herramientas */
.tools-buttons {
    display: flex;
    gap: 8px;
}

.tool-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: #f5f5f5;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: #eee;
    transform: scale(1.08);
}

.tool-btn:active {
    transform: scale(0.95);
}

/* Banner Premium Sutil */
.premium-banner-slim {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(90deg, #fffde7 0%, #fff8e1 100%);
    border: 1px solid #ffe082;
    border-radius: 10px;
    margin-bottom: 20px;
}

.premium-slim-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #5d4037;
}

.premium-slim-icon {
    font-size: 18px;
}

.premium-slim-separator {
    color: #bbb;
    margin: 0 3px;
}

.premium-slim-link {
    color: #e65100;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.premium-slim-link:hover {
    color: #bf360c;
    text-decoration: underline;
}

.premium-slim-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.premium-slim-close:hover {
    color: #333;
    background: rgba(0,0,0,0.1);
}

.premium-slim-close:active {
    transform: scale(0.9);
}

/* Ocultar banner viejo si existe */
.premium-cta-banner {
    display: none !important;
}

.premium-mini-banner {
    display: none !important;
}

.premium-banner-slim {
    display: none !important;
}

/* ===== Selector de categoría con botón eliminar ===== */
.category-select-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.category-select-row .category-select-styled {
    flex: 1;
}

.delete-category-btn {
    width: 46px;
    height: 46px;
    border: 2px solid #ffcdd2;
    background: #fff5f5;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.delete-category-btn:hover {
    background: #ffebee;
    border-color: #ef5350;
    transform: scale(1.05);
}

.delete-category-btn:active {
    transform: scale(0.95);
    background: #ffcdd2;
}

/* ===== Banner de límite de categorías ===== */
.category-limit-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border: 1px solid #ffd54f;
    border-radius: 10px;
    margin-top: 12px;
}

.limit-banner-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.limit-banner-icon {
    font-size: 18px;
}

.limit-banner-text {
    font-size: 14px;
    color: #5d4037;
    font-weight: 500;
}

.limit-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.limit-banner-btn:hover {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
    color: white;
    text-decoration: none;
}

@media (max-width: 480px) {
    .category-select-row {
        flex-direction: column;
    }
    
    .delete-category-btn {
        width: 100%;
        height: 40px;
    }
    
    .category-limit-banner {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

/* ===== Panel Agregar Palabras Mejorado ===== */
.add-words-panel {
    background: #fafafa;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #e0e0e0;
}

.add-words-panel .panel-header-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.add-words-panel .panel-header-mini h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.add-section {
    margin-bottom: 18px;
}

.add-section-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
}

.category-destination-select {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    transition: border-color 0.2s ease;
}

.category-destination-select:focus {
    border-color: #4caf50;
    outline: none;
}

.toggle-new-category-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #f5f5f5;
    border: 1px dashed #ccc;
    border-radius: 8px;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
}

.toggle-new-category-btn:hover {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #4caf50;
}

.toggle-new-category-btn .toggle-icon {
    font-size: 16px;
    font-weight: bold;
}

.toggle-new-category-btn.active {
    background: #e8f5e9;
    border-style: solid;
    border-color: #4caf50;
    color: #4caf50;
}

.toggle-new-category-btn.active .toggle-icon {
    transform: rotate(45deg);
}

.new-category-form {
    margin-top: 10px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.inline-form {
    display: flex;
    gap: 10px;
}

.inline-form .input-styled {
    flex: 1;
}

.btn-success {
    background: linear-gradient(135deg, #4caf50, #43a047) !important;
    color: white !important;
}

.btn-success:hover {
    background: linear-gradient(135deg, #43a047, #388e3c) !important;
}

.add-word-section {
    background: white;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.word-inputs-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.word-input-group {
    flex: 1;
}

.mini-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.word-input-group .input-styled {
    width: 100%;
}

.btn-add-word {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #5c6bc0, #3f51b5);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-top: 15px;
}

.btn-add-word:hover {
    background: linear-gradient(135deg, #3f51b5, #303f9f);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(63, 81, 181, 0.3);
}

.btn-add-word:active {
    transform: translateY(0);
}

.btn-add-word:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-add-word .btn-icon {
    font-size: 18px;
}

@media (max-width: 600px) {
    .word-inputs-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .inline-form {
        flex-direction: column;
    }
    
    .inline-form .btn-small {
        width: 100%;
    }
}

/* Slider de palabras (4-12 consecutivo) */
.word-count-slider-wrapper {
    position: relative;
    padding: 15px 0 30px 0;
}

.word-count-range {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg, #e0e0e0, #e0e0e0);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.word-count-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.word-count-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5);
}

.word-count-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 2px;
}

.range-label {
    font-size: 12px;
    color: #999;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    user-select: none;
}

.range-label:hover {
    color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.range-label.active {
    color: #4caf50;
    font-weight: 700;
    background: rgba(76, 175, 80, 0.15);
}

.range-value-display {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    background: #4caf50;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.word-count-slider-wrapper:hover .range-value-display {
    opacity: 1;
}

/* Responsive */
@media (max-width: 600px) {
    .swg-top-bar {
        flex-direction: row;
        gap: 10px;
        padding: 8px 12px;
    }
    
    .streak-badge {
        padding: 6px 10px;
    }
    
    .streak-tooltip-box {
        left: -10px;
        min-width: 180px;
    }
    
    .tools-buttons {
        gap: 5px;
    }
    
    .tool-btn {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    
    .premium-banner-slim {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .range-label {
        font-size: 10px;
        padding: 2px 3px;
    }
}

/* ============================================
   ESTILOS SM-2 Y TOAST v5.0
   ============================================ */

.swg-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 10000;
    animation: toastSlideIn 0.3s ease;
    max-width: 400px;
}
.swg-toast-success { border-color: #4caf50; }
.swg-toast-error { border-color: #f44336; }
.swg-toast .toast-icon { font-size: 24px; }
.swg-toast .toast-title { font-weight: 600; color: #fff; margin-bottom: 4px; }
.swg-toast .toast-message { color: #aaa; font-size: 14px; }
.swg-toast .toast-close {
    background: none; border: none; color: #666;
    font-size: 20px; cursor: pointer; padding: 0 0 0 10px; margin-left: auto;
}
.swg-toast .toast-close:hover { color: #fff; }

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
    .swg-toast { left: 10px; right: 10px; bottom: 10px; max-width: none; }
}

/* Fix v5.1: Estilos para botón de pista */
.hint-highlight {
    animation: hint-pulse 1.5s ease-in-out;
    box-shadow: 0 0 20px #ffd700, 0 0 30px #ffc107 !important;
    border-color: #ffd700 !important;
    transform: scale(1.05);
}

@keyframes hint-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    50% { box-shadow: 0 0 25px 10px rgba(255, 215, 0, 0.5); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

/* Estilos para botones footer del juego */
#gameFooter .footer-btn {
    transition: all 0.2s ease;
}

#gameFooter .footer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#gameFooter .footer-btn:active {
    transform: translateY(0);
}

/* ========================================
   MARKETPLACE (v5.2)
   ======================================== */

/* Botón publicar en selector de categoría */
.publish-category-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-left: 8px;
}

.publish-category-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.publish-category-btn.published {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

/* Botón renombrar categoría */
.rename-category-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-left: 8px;
}

.rename-category-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

/* Iconos de lado (Frente/Reverso) */
.side-icon {
    font-size: 16px;
    margin-right: 4px;
}

.toggle-btn .side-icon {
    display: inline-block;
}

/* Container principal del marketplace */
.marketplace-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header del Marketplace */
.marketplace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.marketplace-title-section h2 {
    margin: 0 0 5px;
    font-size: 28px;
    color: #333;
}

.marketplace-subtitle {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.marketplace-tabs {
    display: flex;
    gap: 10px;
}

.mp-tab-btn {
    background: #f0f0f0;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.mp-tab-btn:hover {
    background: #e0e0e0;
}

.mp-tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.mp-tab-content {
    display: none;
}

.mp-tab-content.active {
    display: block;
}

/* Barra de búsqueda */
.marketplace-search-bar {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: #f5f7fa;
    border-radius: 30px;
    padding: 5px 5px 5px 20px;
    margin-bottom: 15px;
}

.search-input-wrapper .search-icon {
    font-size: 18px;
    margin-right: 10px;
    color: #888;
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 16px;
    outline: none;
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.search-filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    min-width: 180px;
}

/* Tags populares */
.marketplace-tags-section {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.tags-label {
    font-weight: 600;
    color: #666;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mp-tag {
    background: #f0f0f0;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.mp-tag:hover {
    background: #e0e0e0;
}

.mp-tag.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.mp-tag span {
    opacity: 0.7;
    font-size: 11px;
}

/* Grid de items */
.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.mp-item-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.mp-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-color: #667eea;
}

.mp-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.mp-item-title {
    margin: 0;
    font-size: 18px;
    color: #333;
    flex: 1;
}

.mp-item-langs {
    font-size: 14px;
    white-space: nowrap;
}

.mp-item-desc {
    color: #666;
    font-size: 14px;
    margin: 0 0 12px;
    line-height: 1.5;
}

.mp-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.mp-item-tag {
    background: #f0f0f0;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    color: #666;
}

.mp-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
}

.mp-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mp-item-actions {
    display: flex;
    gap: 10px;
}

.mp-download-btn, .mp-unpublish-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.mp-download-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.mp-download-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.mp-unpublish-btn {
    background: #ff6b6b;
    color: white;
}

.mp-unpublish-btn:hover {
    background: #ee5a5a;
}

.mp-unpublish-btn.btn-small {
    padding: 8px 12px;
    font-size: 12px;
}

/* Paginación */
.marketplace-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.mp-page-btn {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mp-page-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.mp-page-current {
    background: #667eea;
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: 600;
}

.mp-page-dots {
    color: #888;
    padding: 0 5px;
}

/* Estado vacío */
.marketplace-empty, .my-items-empty {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.marketplace-empty .empty-icon, .my-items-empty .empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.marketplace-empty h3, .my-items-empty h3 {
    margin: 0 0 10px;
    color: #333;
}

.marketplace-empty p, .my-items-empty p {
    color: #666;
    margin: 0 0 20px;
}

.btn-go-to-game {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-go-to-game:hover {
    transform: scale(1.05);
}

/* Mis publicaciones */
.my-items-header {
    margin-bottom: 20px;
}

.my-items-header h3 {
    margin: 0 0 5px;
    font-size: 22px;
}

.my-items-header p {
    margin: 0;
    color: #666;
}

.my-items-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.my-item-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.my-item-info h4 {
    margin: 0 0 5px;
    color: #333;
}

.my-item-info p {
    margin: 0 0 3px;
    color: #666;
    font-size: 14px;
}

.my-item-info small {
    color: #999;
    font-size: 12px;
}

/* Loading y error */
.mp-loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

.mp-error {
    text-align: center;
    padding: 40px;
    color: #e74c3c;
}

/* Modal de publicar */
.modal-marketplace {
    max-width: 550px;
}

.modal-header-mp {
    text-align: center;
    margin-bottom: 25px;
}

.modal-header-mp .modal-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.modal-header-mp h3 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.modal-marketplace .form-group {
    margin-bottom: 20px;
}

.modal-marketplace .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.modal-marketplace .form-group input,
.modal-marketplace .form-group textarea,
.modal-marketplace .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.modal-marketplace .form-group input:focus,
.modal-marketplace .form-group textarea:focus,
.modal-marketplace .form-group select:focus {
    border-color: #667eea;
    outline: none;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #888;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group.half {
    flex: 1;
}

.publish-info-box {
    background: #f0f7ff;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.publish-info-box .info-icon {
    font-size: 20px;
}

.publish-info-box p {
    margin: 0;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.btn-publish {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

/* Modal de preview */
.modal-preview {
    max-width: 600px;
}

.preview-header {
    margin-bottom: 20px;
}

.preview-header h2 {
    margin: 0 0 10px;
    font-size: 24px;
    color: #333;
}

.preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: #666;
    font-size: 14px;
}

.preview-desc {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.preview-tag {
    background: #f0f0f0;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    color: #666;
}

.preview-words {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.preview-words h4 {
    margin: 0 0 15px;
    color: #333;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
}

.preview-table th,
.preview-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.preview-table th {
    background: #f0f0f0;
    font-weight: 600;
    font-size: 13px;
    color: #666;
}

.preview-more {
    text-align: center;
    color: #888;
    font-style: italic;
}

.preview-actions {
    text-align: center;
}

.btn-large {
    padding: 15px 40px !important;
    font-size: 16px !important;
}

/* Responsive para marketplace */
@media (max-width: 768px) {
    .marketplace-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 10px;
    }
    
    .marketplace-tabs {
        width: 100%;
    }
    
    .mp-tab-btn {
        flex: 1;
        text-align: center;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .marketplace-search-bar {
        padding: 12px;
        border-radius: 12px;
    }
    
    .search-input-wrapper {
        flex-wrap: wrap;
        padding: 8px;
        border-radius: 12px;
        gap: 8px;
    }
    
    .search-input-wrapper input {
        flex: 1 1 100%;
        min-width: 0;
        padding: 10px;
        font-size: 14px;
    }
    
    .search-btn {
        width: 100%;
        padding: 12px 20px;
        border-radius: 10px;
        font-size: 14px;
    }
    
    .search-filters {
        flex-direction: column;
    }
    
    .filter-select {
        width: 100%;
        min-width: auto;
    }
    
    .marketplace-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .mp-item-card {
        padding: 15px;
    }
    
    .my-item-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group.half {
        width: 100%;
    }
    
    .preview-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .marketplace-tags-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tags-container {
        width: 100%;
    }
    
    /* Modal de marketplace en móvil */
    .modal-marketplace {
        width: 95% !important;
        max-width: none !important;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ===========================================
   MEJORAS GENERALES PARA MÓVILES
   =========================================== */

@media (max-width: 767px) {
    /* Tab content ancho completo */
    .tab-content {
        width: 100% !important;
        padding: 0 !important;
    }
    
    /* Selector de categoría más compacto */
    .category-selector-card {
        padding: 15px 10px;
        border-radius: 12px;
        margin-bottom: 12px;
    }
    
    .category-select-styled {
        padding: 12px 15px;
        font-size: 15px;
    }
    
    .selector-label {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    /* Config panel más compacto */
    .config-panel {
        padding: 15px 10px;
        border-radius: 12px;
        margin-bottom: 12px;
    }
    
    .config-title {
        font-size: 15px;
        margin-bottom: 15px;
    }
    
    /* Botones toggle más pequeños */
    .toggle-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Info de categoría */
    .category-info {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .category-info span {
        font-size: 12px;
        padding: 4px 10px;
    }
    
    /* Sección de agregar palabra más compacta */
    .add-section {
        padding: 15px 10px;
        border-radius: 12px;
    }
    
    .word-inputs-row {
        gap: 8px;
    }
    
    .word-input-group input {
        padding: 10px;
        font-size: 14px;
    }
    
    .btn-add-word {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    /* Footer del juego */
    .game-footer {
        padding: 10px;
        gap: 8px;
    }
    
    .footer-btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    /* Indicador de arrastre más pequeño */
    .drag-hint {
        font-size: 13px;
        margin-top: 8px;
    }
}

/* Pantallas muy pequeñas */
@media (max-width: 400px) {
    .swg-container {
        padding: 5px 2px !important;
    }
    
    .game-area {
        padding: 8px 5px;
    }
    
    .container {
        gap: 6px;
    }
    
    .fixed-word,
    .box {
        height: 75px;
        font-size: 13px;
    }
    
    .tab-button {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .swg-tabs {
        gap: 5px;
        flex-wrap: wrap;
        justify-content: center;
    }
}


/* =============================================
   ESTILOS PARA MODOS DE JUEGO v5.3
   - Flashcard
   - Memoria
   - TTS
   ============================================= */

/* Grid de modos de juego */
.game-modes.game-modes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.mode-btn.mode-flashcard {
    border-color: #9c27b0;
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
}

.mode-btn.mode-flashcard:hover {
    border-color: #7b1fa2;
    background: linear-gradient(135deg, #e1bee7 0%, #ce93d8 100%);
}

.mode-btn.mode-memory {
    border-color: #00bcd4;
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
}

.mode-btn.mode-memory:hover {
    border-color: #0097a7;
    background: linear-gradient(135deg, #b2ebf2 0%, #80deea 100%);
}

/* MODO FLASHCARD */
.flashcard-screen {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.flashcard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.flashcard-title {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mode-badge {
    font-size: 12px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
    color: white;
    border-radius: 20px;
    margin-bottom: 4px;
}

.mode-badge-memory {
    background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
}

.flashcard-category-name,
.memory-category-name {
    font-weight: bold;
    color: #333;
}

.flashcard-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flashcard-progress-text {
    font-size: 14px;
    color: #666;
}

.flashcard-stats-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.fc-stat {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.fc-easy { background: #e3f2fd; color: #1565c0; }
.fc-good { background: #e8f5e9; color: #2e7d32; }
.fc-hard { background: #fff3e0; color: #e65100; }
.fc-again { background: #ffebee; color: #c62828; }

.flashcard-container {
    perspective: 1000px;
    margin: 30px auto;
    max-width: 520px;
}

.flashcard-card {
    width: 100%;
    min-height: 350px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    cursor: pointer;
}

.flashcard-card.flipped {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    min-height: 350px;
    backface-visibility: hidden;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    box-sizing: border-box;
}

.flashcard-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.flashcard-back {
    background: white;
    border: 3px solid #4caf50;
    transform: rotateY(180deg);
    justify-content: flex-start;
    padding-top: 30px;
}

.flashcard-content {
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    word-break: break-word;
}

.flashcard-back .flashcard-content {
    color: #333;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.flashcard-explanation {
    font-size: 15px;
    color: #374151;
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
    padding: 16px 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    width: 100%;
    margin-top: 15px;
    border: 1px solid #e2e8f0;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
    flex-grow: 1;
}

.flashcard-explanation::-webkit-scrollbar {
    width: 6px;
}

.flashcard-explanation::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.flashcard-explanation::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.flashcard-explanation::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.flashcard-flip-hint {
    text-align: center;
    color: #888;
    font-size: 15px;
    margin: 20px 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.flashcard-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.flashcard-rating-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 15px 8px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.flashcard-rating-btn .btn-icon { font-size: 28px; }
.flashcard-rating-btn .btn-label { font-weight: bold; }
.flashcard-rating-btn .btn-hint { font-size: 10px; color: rgba(0,0,0,0.5); }

.flashcard-rating-btn.btn-again {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
}
.flashcard-rating-btn.btn-hard {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #e65100;
}
.flashcard-rating-btn.btn-good {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
}
.flashcard-rating-btn.btn-easy {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
}

.flashcard-rating-btn:hover {
    transform: translateY(-2px);
}

/* MODO MEMORIA */
.memory-screen {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

.memory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.memory-title {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.memory-stats {
    display: flex;
    gap: 15px;
}

.memory-stat {
    padding: 8px 15px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 20px auto;
    max-width: 600px;
}

.memory-card {
    aspect-ratio: 1;
    perspective: 1000px;
    cursor: pointer;
}

.memory-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card.matched {
    opacity: 0.7;
    pointer-events: none;
}

.memory-card.matched .memory-card-back {
    background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
    border-color: #4caf50;
}

.memory-card-front,
.memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.memory-card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.memory-card-front .card-icon { font-size: 32px; }

.memory-card-back {
    background: white;
    border: 2px solid #ddd;
    transform: rotateY(180deg);
    padding: 10px;
}

.memory-card-back .card-text {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    text-align: center;
    word-break: break-word;
    line-height: 1.2;
}

.memory-card-back .card-type {
    position: absolute;
    bottom: 5px;
    right: 8px;
    font-size: 12px;
    opacity: 0.7;
}

.memory-card:not(.flipped):not(.matched):hover .memory-card-inner {
    transform: scale(1.05);
}

/* RESULTADOS */
.flashcard-results,
.memory-results {
    text-align: center;
    padding: 30px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.flashcard-results .results-icon,
.memory-results .results-icon {
    font-size: 64px;
    margin-bottom: 10px;
}

.flashcard-results h2,
.memory-results h2 {
    color: #333;
    margin: 0 0 20px 0;
    font-size: 22px;
}

.results-grade {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 25px;
}

.grade-excellent { background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%); color: #333; }
.grade-great { background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%); color: #2e7d32; }
.grade-good { background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%); color: #1565c0; }
.grade-practice { background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%); color: #e65100; }
.grade-perfect {
    background: linear-gradient(135deg, #ff6f00 0%, #ff8f00 100%);
    color: white;
    animation: glow 1s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 10px rgba(255, 111, 0, 0.5); }
    to { box-shadow: 0 0 25px rgba(255, 111, 0, 0.8); }
}

.results-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.result-stat {
    background: white;
    padding: 18px 12px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.result-stat .stat-value {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.result-stat .stat-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.result-stat.stat-correct .stat-value { color: #4caf50; }
.result-stat.stat-incorrect .stat-value { color: #f44336; }
.result-stat.stat-perfect .stat-value { color: #ff6f00; }

.results-breakdown {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 25px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 10px;
}

.breakdown-item { font-size: 14px; color: #555; }

.perfect-badge {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
    color: #e65100;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.results-actions .btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.results-actions .btn-primary {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
}

.results-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.results-actions .btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 2px solid #ddd;
}

.results-actions .btn-secondary:hover { background: #eeeeee; }

/* TTS - AUDIO */
.audio-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.audio-toggle input { display: none; }
.audio-toggle .audio-icon {
    font-size: 20px;
    opacity: 0.5;
    transition: all 0.3s;
}
.audio-toggle input:checked + .audio-icon { opacity: 1; }

.tts-settings-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
    padding: 5px;
}
.tts-settings-btn:hover { opacity: 1; }

.tts-play-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.flashcard-front .tts-play-btn { background: rgba(255,255,255,0.2); color: white; }
.flashcard-back .tts-play-btn { background: rgba(0,0,0,0.05); color: #333; }
.tts-play-btn:hover { transform: scale(1.1); }
.tts-play-btn.playing { animation: tts-pulse 0.5s ease infinite; }

@keyframes tts-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.tts-settings-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tts-setting {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tts-setting label {
    min-width: 120px;
    font-weight: 500;
    color: #555;
}

.tts-select {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.tts-select:focus { border-color: #4caf50; outline: none; }

.tts-modal { max-width: 400px; }
.tts-modal .swg-modal-body { padding: 20px; }
.tts-modal .swg-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

/* RESPONSIVE */
@media (max-width: 600px) {
    .game-modes.game-modes-grid { grid-template-columns: 1fr; }
    .flashcard-buttons { grid-template-columns: repeat(2, 1fr); }
    .flashcard-rating-btn .btn-hint { display: none; }
    .flashcard-card { min-height: 300px; }
    .flashcard-front, .flashcard-back { min-height: 300px; padding: 20px; }
    .flashcard-content { font-size: 26px; }
    .flashcard-explanation { max-height: 150px; font-size: 14px; padding: 12px 14px; }
    .flashcard-container { max-width: 100%; padding: 0 10px; }
    .memory-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .memory-card-back .card-text { font-size: 11px; }
    .results-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .tts-play-btn { width: 35px; height: 35px; font-size: 16px; top: 10px; right: 10px; }
}

@media (max-width: 400px) {
    .memory-grid { grid-template-columns: repeat(3, 1fr); }
    .flashcard-card { min-height: 280px; }
    .flashcard-front, .flashcard-back { min-height: 280px; padding: 15px; }
    .flashcard-content { font-size: 22px; }
    .flashcard-explanation { max-height: 130px; font-size: 13px; padding: 10px 12px; line-height: 1.5; }
    .flashcard-header, .memory-header { flex-direction: column; text-align: center; }
}

/* =============================================
   ESTILOS PESTAÑA ESCUCHAR v5.3
   ============================================= */

.listen-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.listen-section {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.listen-section-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #333;
}

.listen-subtitle {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

/* Texto libre */
.listen-free-text {
    width: 100%;
}

.listen-input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.listen-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s;
}

.listen-textarea:focus {
    border-color: #4caf50;
    outline: none;
}

.listen-input-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.listen-lang-select,
.listen-select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.listen-lang-select:focus,
.listen-select:focus {
    border-color: #4caf50;
    outline: none;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.speed-control label {
    font-size: 14px;
    color: #666;
}

.speed-control input[type="range"] {
    width: 100px;
}

.btn-listen-play {
    padding: 12px 25px;
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-listen-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

/* Controles de palabras */
.listen-words-controls {
    margin-bottom: 20px;
}

.listen-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.listen-mode-toggle {
    display: flex;
    gap: 10px;
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.toggle-option:has(input:checked) {
    background: #e8f5e9;
    color: #2e7d32;
}

.toggle-option input {
    cursor: pointer;
}

.listen-auto-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 15px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 10px;
}

.btn-auto-play,
.btn-auto-stop {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-auto-play {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
}

.btn-auto-stop {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

/* Lista de palabras */
.listen-words-list {
    min-height: 200px;
}

.listen-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    color: #888;
}

.listen-empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.listen-loading {
    text-align: center;
    padding: 30px;
    color: #666;
    font-size: 16px;
}

.listen-words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.listen-word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.listen-word-item:hover {
    background: #e8f5e9;
    border-color: #4caf50;
}

.listen-word-item.active {
    background: #e3f2fd;
    border-color: #2196f3;
}

.listen-word-item.playing {
    background: #fff3e0;
    border-color: #ff9800;
    animation: listen-pulse 0.8s ease infinite;
}

@keyframes listen-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.listen-word-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.listen-word-en {
    font-weight: bold;
    color: #333;
    font-size: 15px;
}

.listen-word-es {
    color: #666;
    font-size: 14px;
}

.listen-word-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.listen-word-play {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 5px;
}

.listen-word-play:hover {
    transform: scale(1.2);
}

/* Reproductor "Now Playing" */
.listen-now-playing {
    margin-top: 25px;
}

.now-playing-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
}

.now-playing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.now-playing-badge {
    background: rgba(255,255,255,0.2);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 14px;
}

.now-playing-progress {
    font-size: 14px;
    opacity: 0.9;
}

.now-playing-content {
    margin-bottom: 25px;
}

.now-playing-word {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 10px;
}

.now-playing-translation {
    font-size: 24px;
    opacity: 0.9;
    margin-bottom: 15px;
}

.now-playing-explanation {
    font-size: 14px;
    opacity: 0.8;
    background: rgba(255,255,255,0.1);
    padding: 12px 20px;
    border-radius: 10px;
    max-height: 80px;
    overflow-y: auto;
}

.now-playing-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.btn-control {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-control:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.btn-play-large {
    width: 70px;
    height: 70px;
    font-size: 30px;
    background: rgba(255,255,255,0.3);
}

.now-playing-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.option-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.9;
}

.option-check input {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Auto-play complete */
.auto-play-complete {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.auto-play-complete .complete-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.auto-play-complete p {
    margin: 0 0 5px 0;
}

.auto-play-complete .complete-stats {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 15px;
}

/* Configuración de voz */
.listen-section-settings {
    background: #f8f9fa;
}

.listen-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.listen-setting {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.listen-setting label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.listen-setting input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    appearance: none;
    cursor: pointer;
}

.listen-setting input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4caf50;
    cursor: pointer;
}

.listen-setting span {
    font-size: 13px;
    color: #888;
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    .listen-container {
        padding: 15px;
    }
    
    .listen-section {
        padding: 20px 15px;
    }
    
    .listen-input-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .listen-lang-select {
        width: 100%;
    }
    
    .btn-listen-play {
        width: 100%;
    }
    
    .listen-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .listen-select {
        width: 100%;
    }
    
    .listen-words-grid {
        grid-template-columns: 1fr;
    }
    
    .now-playing-word {
        font-size: 28px;
    }
    
    .now-playing-translation {
        font-size: 20px;
    }
    
    .now-playing-controls {
        gap: 15px;
    }
    
    .btn-control {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .btn-play-large {
        width: 60px;
        height: 60px;
        font-size: 26px;
    }
    
    .now-playing-options {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .listen-mode-toggle {
        flex-direction: column;
        width: 100%;
    }
    
    .toggle-option {
        justify-content: center;
    }
    
    .listen-auto-settings {
        flex-direction: column;
    }
    
    .btn-auto-play,
    .btn-auto-stop {
        width: 100%;
    }
}

/* ========================================
   ESTILOS MEJORADOS PARA PESTAÑA ESCUCHAR v5.8.5
   ======================================== */

/* Header Banner */
.listen-header-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    color: white;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.listen-header-icon {
    font-size: 48px;
    background: rgba(255, 255, 255, 0.2);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.listen-header-text h2 {
    margin: 0 0 5px 0;
    font-size: 28px;
    font-weight: 700;
}

.listen-header-text p {
    margin: 0;
    opacity: 0.9;
    font-size: 15px;
}

/* Sección primaria */
.listen-section-primary {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border: 2px solid #e8e8e8;
}

.listen-section-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.section-icon {
    font-size: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-title h3 {
    margin: 0 0 5px 0;
    font-size: 20px;
    color: #333;
}

.section-title .listen-subtitle {
    margin: 0;
}

/* Controles de idioma/voz mejorados */
.listen-controls-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.listen-control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.listen-lang-select-enhanced,
.listen-voice-select-enhanced {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.listen-lang-select-enhanced:hover,
.listen-voice-select-enhanced:hover {
    border-color: #667eea;
}

.listen-lang-select-enhanced:focus,
.listen-voice-select-enhanced:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.listen-lang-select-enhanced optgroup {
    font-weight: 700;
    color: #333;
    background: #f5f5f5;
}

.listen-lang-select-enhanced option {
    padding: 8px;
    font-weight: 400;
}

/* Control de velocidad mejorado */
.speed-group .speed-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    padding: 10px 15px;
    border-radius: 12px;
}

.speed-slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
}

.speed-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.speed-value {
    font-weight: 700;
    color: #667eea;
    min-width: 40px;
}

/* Botones de acción */
.listen-action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-listen-play-main {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-listen-play-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-listen-play-main:active {
    transform: translateY(0);
}

.btn-listen-play-main .btn-icon {
    font-size: 20px;
}

.btn-listen-stop {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-listen-debug {
    padding: 12px 20px;
    background: #f5f5f5;
    color: #666;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-listen-debug:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

/* Estado de voz mejorado */
.listen-voice-status-enhanced {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    padding: 12px 18px;
    background: #e8f5e9;
    border-radius: 12px;
    font-size: 14px;
    border-left: 4px solid #4caf50;
}

.listen-voice-status-enhanced.loading {
    background: #e3f2fd;
    border-left-color: #2196f3;
}

.listen-voice-status-enhanced.error {
    background: #ffebee;
    border-left-color: #f44336;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4caf50;
    animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.btn-retry-enhanced {
    padding: 6px 14px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    margin-left: auto;
}

/* ========================================
   SECCIÓN DE CONFIGURACIÓN MEJORADA
   ======================================== */

/* Tarjeta de configuración VoiceRSS */
.voicerss-config-card {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.config-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.config-icon {
    font-size: 28px;
    background: white;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.config-title h4 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.config-badge {
    display: inline-block;
    background: linear-gradient(135deg, #4caf50, #43a047);
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 5px;
}

.config-card-body {
    margin-bottom: 20px;
}

.api-key-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.api-key-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
}

.api-key-input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.btn-save-key {
    padding: 14px 25px;
    background: linear-gradient(135deg, #4caf50 0%, #43a047 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-save-key:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.api-key-help {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.api-link {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

.api-link:hover {
    text-decoration: underline;
}

/* Estadísticas de voces */
.voicerss-stats {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
}

.stat-item {
    text-align: center;
    padding: 15px 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Selector de motor TTS */
.tts-engine-selector {
    margin-bottom: 25px;
}

.engine-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    font-size: 15px;
}

.engine-options {
    display: flex;
    gap: 15px;
}

.engine-option {
    flex: 1;
    cursor: pointer;
}

.engine-option input {
    display: none;
}

.engine-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    transition: all 0.3s;
    text-align: center;
}

.engine-option input:checked + .engine-card {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.engine-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.engine-name {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.engine-desc {
    font-size: 12px;
    color: #888;
}

/* Panel de configuración de voces */
.voice-config-panel {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid #e8e8e8;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.panel-icon {
    font-size: 24px;
}

.panel-header h4 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.voice-config-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 25px;
}

.voice-config-col {
    min-height: 200px;
}

.config-label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    font-size: 14px;
}

.voice-lang-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.voice-placeholder {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
}

/* Selector de voces */
.voice-selector-wrapper {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e0e0e0;
}

.voice-selector-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    font-size: 15px;
}

.voice-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.voice-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.voice-option:hover {
    background: #e8e8e8;
}

.voice-option.selected {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-color: #667eea;
}

.voice-option input {
    display: none;
}

.voice-name {
    font-size: 14px;
    font-weight: 500;
}

.voice-test-area {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.voice-test-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
}

.btn-voice-test {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-voice-test:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Ajustes de reproducción */
.playback-settings {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 25px;
    border: 2px solid #e8e8e8;
}

.settings-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
}

.listen-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.listen-setting-card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    border: 2px solid #e8e8e8;
}

.listen-setting-card label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
    font-size: 14px;
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setting-control input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: #e0e0e0;
    border-radius: 3px;
}

.setting-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    cursor: pointer;
}

.setting-value {
    font-weight: 700;
    color: #667eea;
    min-width: 50px;
    text-align: right;
}

.setting-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.setting-select:focus {
    border-color: #667eea;
    outline: none;
}

/* Responsive para la nueva interfaz */
@media (max-width: 768px) {
    .listen-header-banner {
        flex-direction: column;
        text-align: center;
        padding: 25px 20px;
    }
    
    .listen-header-icon {
        width: 70px;
        height: 70px;
        font-size: 40px;
    }
    
    .listen-header-text h2 {
        font-size: 24px;
    }
    
    .listen-controls-row {
        grid-template-columns: 1fr;
    }
    
    .voice-config-grid {
        grid-template-columns: 1fr;
    }
    
    .engine-options {
        flex-direction: column;
    }
    
    .voicerss-stats {
        flex-wrap: wrap;
    }
    
    .stat-item {
        flex: 1;
        min-width: 80px;
        padding: 12px 15px;
    }
    
    .api-key-input-group {
        flex-direction: column;
    }
    
    .btn-save-key {
        width: 100%;
    }
    
    .voice-test-area {
        flex-direction: column;
    }
    
    .listen-action-buttons {
        flex-direction: column;
    }
    
    .btn-listen-play-main,
    .btn-listen-stop {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .section-icon {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .section-title h3 {
        font-size: 18px;
    }
    
    .stat-number {
        font-size: 22px;
    }
    
    .voice-options {
        flex-direction: column;
    }
    
    .voice-option {
        width: 100%;
    }
}


/* ========================================
   MODAL DE DIAGNÓSTICO Y AYUDA DE VOCES
   ======================================== */

.swg-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.swg-modal-overlay.active {
    opacity: 1;
}

.swg-modal {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.swg-modal-overlay.active .swg-modal {
    transform: translateY(0) scale(1);
}

.swg-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.swg-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.swg-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.swg-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.swg-modal-body {
    padding: 25px;
    overflow-y: auto;
}

/* Contenido del diagnóstico */
.voice-diagnostic-content,
.voice-install-help {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.diagnostic-summary {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #e8f5e9 0%, #f3e5f5 100%);
    border-radius: 16px;
}

.summary-icon {
    font-size: 40px;
}

.summary-text {
    font-size: 16px;
    color: #333;
}

/* Grid de idiomas */
.diagnostic-languages h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.lang-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f5f5f5;
    border-radius: 10px;
    font-size: 14px;
}

.lang-item.status-ok {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
}

.lang-item.status-missing {
    background: #ffebee;
    border: 1px solid #ffcdd2;
}

.lang-status {
    font-weight: 600;
}

/* Lista de voces */
.diagnostic-voices-list h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #333;
}

.voices-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.voice-chip {
    padding: 6px 12px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 20px;
    font-size: 13px;
}

.voice-chip small {
    color: #888;
}

/* Alerta */
.diagnostic-alert {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 18px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 12px;
}

.alert-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.alert-text {
    font-size: 14px;
    color: #856404;
}

/* Botones de acción */
.diagnostic-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.btn-install-voices,
.btn-use-voicerss,
.btn-close-modal,
.btn-back-diagnostic {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-install-voices {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
}

.btn-install-voices:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
}

.btn-use-voicerss {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-use-voicerss:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-close-modal {
    background: #f5f5f5;
    color: #666;
    margin-left: auto;
}

.btn-close-modal:hover {
    background: #e0e0e0;
}

.btn-back-diagnostic {
    background: #f5f5f5;
    color: #666;
}

.btn-back-diagnostic:hover {
    background: #e0e0e0;
}

/* Instrucciones de instalación */
.os-detected {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 12px;
    margin-bottom: 10px;
}

.os-icon {
    font-size: 32px;
}

.os-name {
    font-size: 15px;
    color: #333;
}

.install-instructions h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
}

.instruction-step {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 12px;
}

.step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.step-content p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.step-content code {
    display: block;
    margin-top: 8px;
    padding: 10px 15px;
    background: #263238;
    color: #80cbc4;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    overflow-x: auto;
}

.step-content kbd {
    display: inline-block;
    padding: 3px 8px;
    background: #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    box-shadow: 0 2px 0 #bbb;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 12px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.quick-link code {
    padding: 8px 15px;
    background: #263238;
    color: #80cbc4;
    border-radius: 6px;
    font-size: 13px;
}

.btn-copy,
.btn-store {
    padding: 8px 16px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-copy:hover,
.btn-store:hover {
    background: #43a047;
    transform: translateY(-1px);
}

/* Alternativa VoiceRSS */
.voicerss-alternative {
    background: linear-gradient(135deg, #fff3e0 0%, #fce4ec 100%);
    border-radius: 16px;
    padding: 20px;
    border: 2px solid rgba(255, 152, 0, 0.3);
}

.voicerss-alternative h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #e65100;
}

.voicerss-alternative p {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #666;
}

/* Highlight de tarjeta */
.voicerss-config-card.highlight-card {
    animation: highlight-pulse 0.5s ease 3;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.5);
}

@keyframes highlight-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Responsive para modal */
@media (max-width: 600px) {
    .swg-modal {
        max-height: 90vh;
        border-radius: 15px;
    }
    
    .swg-modal-header {
        padding: 15px 20px;
    }
    
    .swg-modal-body {
        padding: 20px;
    }
    
    .lang-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .diagnostic-actions {
        flex-direction: column;
    }
    
    .diagnostic-actions button {
        width: 100%;
    }
    
    .btn-close-modal {
        margin-left: 0;
    }
    
    .instruction-step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin: 0 auto;
    }
    
    .quick-link {
        flex-direction: column;
        text-align: center;
    }
}

/* Botón inline para instalar voces */
.btn-install-voices-inline {
    padding: 12px 18px;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-install-voices-inline:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.4);
}

/* Mejorar botón debug */
.btn-listen-debug {
    padding: 12px 18px !important;
    background: #607d8b !important;
    color: white !important;
    font-size: 14px !important;
}

.btn-listen-debug:hover {
    background: #546e7a !important;
}

/* ========================================
   MODO ORDENAR LETRAS (Scramble) v1.0
   ======================================== */

.mode-btn.mode-scramble {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    border-color: #ff6b6b;
}

.mode-btn.mode-scramble:hover {
    background: linear-gradient(135deg, #ff5252 0%, #d32f2f 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.mode-badge-scramble {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.scramble-screen {
    padding: 20px;
    max-width: 700px;
    margin: 0 auto;
}

.scramble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.scramble-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scramble-category-name {
    font-size: 16px;
    color: #666;
}

.scramble-stats {
    display: flex;
    gap: 15px;
}

.scramble-stat {
    background: #f5f5f5;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.scramble-game-area {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.scramble-clue-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    margin-bottom: 25px;
    position: relative;
}

.scramble-clue-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 10px;
}

.scramble-clue-word {
    color: white;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 1px;
}

.scramble-listen-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.scramble-listen-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.scramble-listen-btn.speaking {
    animation: pulse-speak 0.5s ease infinite;
}

@keyframes pulse-speak {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.2); }
}

.scramble-answer-area {
    margin-bottom: 25px;
}

.scramble-answer-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.scramble-answer-box {
    min-height: 60px;
    background: #f8f9fa;
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.scramble-answer-box:has(.scramble-answer-letter) {
    border-style: solid;
    border-color: #667eea;
    background: white;
}

.scramble-placeholder {
    color: #aaa;
    font-style: italic;
}

.scramble-answer-letter {
    width: 45px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.scramble-answer-letter:hover {
    transform: scale(0.95);
    opacity: 0.8;
}

.scramble-answer-letter.correct-letter {
    background: linear-gradient(135deg, #4caf50 0%, #43a047 100%);
    animation: bounce-success 0.5s ease;
}

.scramble-answer-letter.incorrect-letter {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    animation: shake-error 0.5s ease;
}

@keyframes bounce-success {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes shake-error {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.scramble-letters-area {
    margin-bottom: 25px;
}

.scramble-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 20px;
    background: #f0f4f8;
    border-radius: 16px;
}

.scramble-letter {
    width: 50px;
    height: 55px;
    background: white;
    border: 3px solid #ddd;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.scramble-letter:hover:not(.used) {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.scramble-letter.used {
    opacity: 0.3;
    cursor: default;
    transform: scale(0.9);
}

.scramble-feedback {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.scramble-feedback .feedback-icon {
    font-size: 24px;
}

.scramble-feedback .feedback-text {
    font-size: 16px;
    font-weight: 500;
}

.scramble-feedback.feedback-correct {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    color: #2e7d32;
}

.scramble-feedback.feedback-incorrect {
    background: #ffebee;
    border: 2px solid #f44336;
    color: #c62828;
}

.scramble-feedback.feedback-warning {
    background: #fff3e0;
    border: 2px solid #ff9800;
    color: #e65100;
}

.scramble-feedback.feedback-hint {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    color: #1565c0;
}

.scramble-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-scramble-action {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-scramble-action.btn-hint {
    background: #fff3e0;
    color: #e65100;
    border: 2px solid #ffb74d;
}

.btn-scramble-action.btn-hint:hover {
    background: #ffe0b2;
}

.btn-scramble-action.btn-hint.hint-used {
    opacity: 0.5;
}

.btn-scramble-action.btn-clear {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #ddd;
}

.btn-scramble-action.btn-clear:hover {
    background: #e0e0e0;
}

.btn-scramble-action.btn-check {
    background: linear-gradient(135deg, #4caf50 0%, #43a047 100%);
    color: white;
}

.btn-scramble-action.btn-check:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.btn-scramble-action.btn-next {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-scramble-action.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.scramble-keyboard-hint {
    text-align: center;
    margin-top: 20px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 10px;
    font-size: 13px;
    color: #888;
}

.scramble-results {
    text-align: center;
    padding: 30px;
}

.scramble-results .results-header {
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
}

.scramble-results .results-header.grade-excellent {
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
}

.scramble-results .results-header.grade-good {
    background: linear-gradient(135deg, #4caf50 0%, #43a047 100%);
}

.scramble-results .results-header.grade-ok {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}

.scramble-results .results-header.grade-practice {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.scramble-results .results-grade {
    font-size: 32px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.scramble-results .results-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.scramble-results .result-stat {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.scramble-results .result-icon {
    font-size: 28px;
}

.scramble-results .result-label {
    font-size: 13px;
    color: #888;
}

.scramble-results .result-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.scramble-results .results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

@media (max-width: 600px) {
    .scramble-header {
        flex-direction: column;
        text-align: center;
    }
    
    .scramble-stats {
        justify-content: center;
    }
    
    .scramble-game-area {
        padding: 20px;
    }
    
    .scramble-clue-word {
        font-size: 26px;
    }
    
    .scramble-listen-btn {
        position: static;
        transform: none;
        margin-top: 15px;
    }
    
    .scramble-clue-card {
        padding-bottom: 20px;
    }
    
    .scramble-letter {
        width: 42px;
        height: 48px;
        font-size: 20px;
    }
    
    .scramble-answer-letter {
        width: 38px;
        height: 44px;
        font-size: 18px;
    }
    
    .scramble-actions {
        flex-direction: column;
    }
    
    .btn-scramble-action {
        width: 100%;
        justify-content: center;
    }
    
    .scramble-results .results-stats {
        grid-template-columns: 1fr;
    }
    
    .scramble-results .results-actions {
        flex-direction: column;
    }
    
    .scramble-results .results-actions .btn {
        width: 100%;
    }
}

/* ========================================
   CONTROLES DE AUDIO EN HEADER
   ======================================== */

/* Grupo de control de audio */
.audio-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f4f8;
    padding: 6px 10px;
    border-radius: 25px;
}

/* Botón de reproducir */
.audio-play-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.audio-play-btn.playing {
    animation: audio-pulse 0.5s ease infinite;
}

@keyframes audio-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Selector de idioma */
.audio-lang-selector {
    display: flex;
    gap: 4px;
}

.lang-option {
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.lang-option:hover {
    opacity: 1;
    transform: scale(1.1);
}

.lang-option.active {
    opacity: 1;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Colores específicos por idioma */
.lang-option.lang-en.active {
    border-color: #0052b4;
    box-shadow: 0 2px 8px rgba(0, 82, 180, 0.3);
}

.lang-option.lang-es.active {
    border-color: #c60b1e;
    box-shadow: 0 2px 8px rgba(198, 11, 30, 0.3);
}

.lang-option.lang-both.active {
    border-color: #9c27b0;
    box-shadow: 0 2px 8px rgba(156, 39, 176, 0.3);
}

/* Ajustes para el header de Flashcards */
.flashcard-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Ajustes para el header de Scramble */
.scramble-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scramble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

/* Responsive */
@media (max-width: 600px) {
    .audio-control-group {
        padding: 4px 8px;
    }
    
    .audio-play-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .lang-option {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .flashcard-controls,
    .scramble-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .scramble-header {
        flex-direction: column;
        text-align: center;
    }
    
    .scramble-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* ============================================
   PANEL DE AUDIO INTUITIVO - NUEVO DISEÑO
   ============================================ */

/* Panel principal de audio */
.audio-panel {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 12px 15px;
    margin: 10px 15px;
}

.audio-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

/* Cada item de audio (label + select + play) */
.audio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.audio-label {
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    white-space: nowrap;
}

/* Selector de idioma */
.audio-lang-select {
    padding: 6px 10px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    min-width: 140px;
    transition: border-color 0.2s;
}

.audio-lang-select:focus {
    outline: none;
    border-color: #4a90d9;
}

.audio-lang-select:hover {
    border-color: #4a90d9;
}

/* Botón mini play */
.audio-mini-play {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #28a745 0%, #20863a 100%);
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.audio-mini-play:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.4);
}

.audio-mini-play.playing {
    animation: pulse-play 0.6s infinite;
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

@keyframes pulse-play {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Botón reproducir ambos */
.audio-play-both {
    padding: 10px 20px;
    border-radius: 25px;
    border: none;
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(111, 66, 193, 0.3);
}

.audio-play-both:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(111, 66, 193, 0.4);
}

.audio-play-both.playing {
    animation: pulse-play 0.6s infinite;
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

/* ============================================
   RESPONSIVE - PANEL DE AUDIO
   ============================================ */

@media (max-width: 768px) {
    .audio-panel {
        padding: 10px;
        margin: 8px 10px;
    }
    
    .audio-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .audio-item {
        width: 100%;
        justify-content: space-between;
        padding: 10px 12px;
    }
    
    .audio-lang-select {
        flex: 1;
        min-width: unset;
        font-size: 14px;
    }
    
    .audio-mini-play {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    .audio-play-both {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 15px;
    }
}

@media (max-width: 400px) {
    .audio-label {
        font-size: 12px;
    }
    
    .audio-lang-select {
        font-size: 12px;
        padding: 5px 8px;
    }
}

/* ============================================
   NUEVO DISEÑO MODO ESCUCHAR - SIMPLIFICADO
   ============================================ */

/* Contenedor principal */
.listen-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 15px;
}

/* ========== PANTALLA DE INICIO ========== */
.listen-home {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.listen-home-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
    margin-bottom: 20px;
}

.listen-home-icon {
    font-size: 48px;
}

.listen-home-title h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.listen-home-title p {
    margin: 5px 0 0;
    opacity: 0.9;
    font-size: 14px;
}

/* Tarjetas principales */
.listen-home-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.listen-home-card {
    background: white;
    border-radius: 16px;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.listen-home-card:hover {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.listen-home-card .card-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.listen-home-card .card-content h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #333;
}

.listen-home-card .card-content p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.listen-home-card .card-badge {
    display: inline-block;
    background: #e8f4fd;
    color: #4a90d9;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 10px;
}

.listen-home-card .card-arrow {
    font-size: 24px;
    color: #ccc;
    margin-top: 10px;
    transition: transform 0.3s;
}

.listen-home-card:hover .card-arrow {
    transform: translateX(5px);
    color: #667eea;
}

/* Configuración rápida */
.listen-quick-config {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.quick-config-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
}

.quick-config-selectors {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.quick-lang-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-lang-item label {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.quick-lang-select {
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    background: white;
}

.quick-lang-select:focus {
    outline: none;
    border-color: #667eea;
}

/* Link configuración avanzada */
.listen-advanced-link {
    display: block;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px dashed #dee2e6;
    border-radius: 8px;
    color: #6c757d;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.listen-advanced-link:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

/* ========== PANELES ========== */
.listen-panel {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.listen-panel-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.listen-back-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.listen-back-btn:hover {
    background: #e9ecef;
}

.listen-panel-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.listen-panel-body {
    padding: 10px 0;
}

/* ========== PANEL TEXTO LIBRE ========== */
.listen-textarea-wrapper {
    margin-bottom: 15px;
}

.listen-textarea-new {
    width: 100%;
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    font-size: 16px;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s;
}

.listen-textarea-new:focus {
    outline: none;
    border-color: #667eea;
}

.listen-simple-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.listen-lang-voice-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    width: 100%;
}

.listen-control-item {
    flex: 1;
    min-width: 200px;
}

.control-mini-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 5px;
}

.listen-lang-dropdown,
.listen-voice-dropdown {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
}

.listen-lang-dropdown:focus,
.listen-voice-dropdown:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.listen-lang-dropdown optgroup {
    font-weight: bold;
    color: #333;
    background: #f8f9fa;
}

.listen-lang-dropdown option {
    font-weight: normal;
    padding: 8px;
}

.listen-play-big {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #28a745 0%, #20863a 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.listen-play-big:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.listen-play-big.playing {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.listen-play-big .play-icon {
    font-size: 22px;
}

/* Fila de botones (Escuchar + Descargar) */
.listen-buttons-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.listen-buttons-row .listen-play-big {
    flex: 1;
}

/* Botón descargar MP3 */
.listen-download-btn {
    padding: 18px 20px;
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
    min-width: 70px;
}

.listen-download-btn:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.listen-download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.listen-download-btn.downloading {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    animation: pulse 1s infinite;
}

.listen-download-btn .download-icon {
    font-size: 18px;
}

.listen-download-btn .download-text {
    font-size: 11px;
    text-transform: uppercase;
}

/* Botón STOP */
.listen-stop-btn {
    padding: 18px 20px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    min-width: 70px;
}

.listen-stop-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.listen-stop-btn .stop-icon {
    font-size: 18px;
}

.listen-stop-btn .stop-text {
    font-size: 11px;
    text-transform: uppercase;
}

/* Opciones avanzadas colapsables */
.listen-advanced-options {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 5px 15px;
}

.listen-advanced-options summary {
    padding: 10px 0;
    cursor: pointer;
    font-size: 13px;
    color: #6c757d;
}

.listen-advanced-options summary:hover {
    color: #667eea;
}

.advanced-content {
    padding: 15px 0;
    border-top: 1px solid #e9ecef;
}

.advanced-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.advanced-row label {
    min-width: 80px;
    font-size: 13px;
    color: #666;
}

.advanced-select {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 13px;
}

.btn-small {
    padding: 8px 12px;
    background: #e9ecef;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.btn-small:hover {
    background: #dee2e6;
}

/* ========== PANEL MIS PALABRAS ========== */
.listen-category-select {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.listen-category-select label {
    font-weight: 600;
    color: #495057;
}

.listen-category-dropdown {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
}

/* Reproductor estilo Spotify */
.listen-player {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 30px 25px;
    margin-bottom: 25px;
    color: white;
}

.player-card {
    text-align: center;
    margin-bottom: 25px;
}

.player-word-display {
    margin-bottom: 20px;
}

.player-word-main {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.player-word-sub {
    font-size: 20px;
    opacity: 0.8;
}

/* Indicador de audio animado */
.player-audio-indicator {
    display: flex;
    justify-content: center;
    gap: 4px;
    height: 30px;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s;
}

.player-audio-indicator.playing {
    opacity: 1;
}

.audio-bar {
    width: 4px;
    background: #1db954;
    border-radius: 2px;
    animation: audioWave 0.5s ease-in-out infinite alternate;
}

.audio-bar:nth-child(1) { height: 10px; animation-delay: 0s; }
.audio-bar:nth-child(2) { height: 20px; animation-delay: 0.1s; }
.audio-bar:nth-child(3) { height: 30px; animation-delay: 0.2s; }
.audio-bar:nth-child(4) { height: 20px; animation-delay: 0.3s; }
.audio-bar:nth-child(5) { height: 10px; animation-delay: 0.4s; }

@keyframes audioWave {
    from { height: 5px; }
    to { height: 25px; }
}

/* Selector de modo */
.listen-mode-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.mode-btn {
    padding: 12px 20px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 25px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.mode-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
}

.mode-btn.active {
    background: #1db954;
    border-color: #1db954;
}

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

.mode-btn .mode-label {
    font-size: 13px;
    font-weight: 500;
}

/* Controles de reproducción */
.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.player-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.player-btn-main {
    width: 70px;
    height: 70px;
    background: #1db954;
    font-size: 28px;
}

.player-btn-main:hover {
    background: #1ed760;
}

/* Barra de progreso */
.player-progress {
    margin-bottom: 20px;
}

.progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    margin-bottom: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #1db954;
    border-radius: 3px;
    width: 10%;
    transition: width 0.3s;
}

.progress-text {
    text-align: center;
    font-size: 13px;
    opacity: 0.7;
}

/* Opciones del reproductor */
.player-options {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.player-option-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.player-checkbox input {
    width: 16px;
    height: 16px;
}

.player-pause-select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 12px;
}

.player-auto-btn {
    padding: 10px 20px;
    border-radius: 20px;
    border: none;
    background: #1db954;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.player-auto-btn.stop {
    background: #dc3545;
}

/* ===== CONTROLES AVANZADOS DE AUDIO ===== */
.player-advanced-controls {
    width: 100%;
    margin-top: 15px;
}

.toggle-advanced-btn {
    width: 100%;
    padding: 10px 15px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.toggle-advanced-btn:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.toggle-advanced-btn .toggle-arrow {
    transition: transform 0.3s;
}

.toggle-advanced-btn.open .toggle-arrow {
    transform: rotate(180deg);
}

.advanced-controls-panel {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 10px;
}

.control-row:last-of-type {
    margin-bottom: 15px;
}

.control-row label {
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    min-width: 90px;
    flex-shrink: 0;
}

.control-slider-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.control-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    outline: none;
}

.control-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1db954;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.control-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1db954;
    cursor: pointer;
    border: 2px solid white;
}

.control-value {
    font-size: 12px;
    color: #1db954;
    min-width: 55px;
    text-align: right;
    font-weight: 600;
}

.control-select {
    flex: 1;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 12px;
    cursor: pointer;
    max-width: 180px;
}

.control-select option {
    background: #2d3748;
    color: white;
}

.save-voice-settings-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1db954, #1ed760);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.save-voice-settings-btn:hover {
    background: linear-gradient(135deg, #1ed760, #1db954);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.4);
}

.save-voice-settings-btn:active {
    transform: translateY(0);
}

/* Responsive para controles avanzados */
@media (max-width: 500px) {
    .control-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .control-row label {
        min-width: auto;
    }
    
    .control-slider-group,
    .control-select {
        width: 100%;
        max-width: none;
    }
}

/* Grid de palabras */
.listen-words-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.listen-word-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.listen-word-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.listen-word-card.active {
    border-color: #1db954;
    background: #f0fff4;
}

.listen-word-card .word-en {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.listen-word-card .word-es {
    font-size: 13px;
    color: #666;
}

.listen-word-card .word-play {
    float: right;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.listen-word-card:hover .word-play {
    opacity: 1;
}

.listen-empty {
    text-align: center;
    padding: 40px;
    color: #999;
}

.listen-empty .empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

/* ========== PANEL CONFIGURACIÓN AVANZADA ========== */
.config-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
}

.config-section h4 {
    margin: 0 0 5px;
    font-size: 16px;
    color: #333;
}

.config-desc {
    margin: 0 0 15px;
    font-size: 13px;
    color: #666;
}

.api-key-row {
    display: flex;
    gap: 10px;
}

.api-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
}

.btn-save {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.api-help {
    margin: 10px 0 0;
    font-size: 12px;
    color: #666;
}

.api-help a {
    color: #667eea;
}

.engine-buttons {
    display: flex;
    gap: 10px;
}

.engine-btn {
    flex: 1;
    padding: 12px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.engine-btn:has(input:checked) {
    border-color: #667eea;
    background: #f0f4ff;
}

.engine-btn input {
    display: none;
}

.speed-row, .volume-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.speed-row label {
    min-width: 150px;
    font-size: 13px;
}

.speed-row input[type="range"],
.volume-row input[type="range"] {
    flex: 1;
}

.tools-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-tool {
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

.btn-tool:hover {
    background: #e9ecef;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
    .listen-home-cards {
        grid-template-columns: 1fr;
    }
    
    .listen-home-card {
        flex-direction: row;
        text-align: left;
        padding: 20px;
    }
    
    .listen-home-card .card-icon {
        font-size: 36px;
        margin-bottom: 0;
        margin-right: 15px;
    }
    
    .listen-home-card .card-arrow {
        margin-left: auto;
        margin-top: 0;
    }
    
    .quick-config-selectors {
        flex-direction: column;
        gap: 10px;
    }
    
    .quick-lang-item {
        width: 100%;
    }
    
    .quick-lang-select {
        flex: 1;
        width: 100%;
    }
    
    .listen-lang-voice-row {
        flex-direction: column;
    }
    
    .listen-control-item {
        width: 100%;
        min-width: unset;
    }
    
    .listen-lang-dropdown,
    .listen-voice-dropdown {
        width: 100%;
    }
    
    .listen-mode-selector {
        flex-direction: column;
    }
    
    .mode-btn {
        width: 100%;
        justify-content: center;
    }
    
    .player-word-main {
        font-size: 28px;
    }
    
    .player-word-sub {
        font-size: 16px;
    }
    
    .listen-words-grid-new {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   MODAL DE IMPORTACIÓN - v5.9.2
   ============================================ */

#importOptionsModal {
    pointer-events: none;
}

#importOptionsModal.active {
    pointer-events: auto;
}

.import-options-modal {
    max-width: 480px;
    width: 95%;
}

.import-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid #bae6fd;
}

.import-file-icon {
    font-size: 32px;
}

.import-file-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.import-file-name {
    font-weight: 600;
    color: #0369a1;
    font-size: 14px;
}

.import-file-count {
    font-size: 13px;
    color: #0284c7;
}

.import-category-notice {
    text-align: center;
    padding: 10px;
    background: #fefce8;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #854d0e;
    border: 1px solid #fef08a;
}

.import-category-notice strong {
    color: #713f12;
}

.import-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.import-option-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.import-option-btn:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.import-option-btn.selected {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.import-option-warning:hover {
    border-color: #f59e0b;
    background: #fffbeb;
}

.import-option-warning.selected {
    border-color: #f59e0b;
    background: #fef3c7;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.import-option-new:hover {
    border-color: #10b981;
    background: #ecfdf5;
}

.import-option-new.selected {
    border-color: #10b981;
    background: #d1fae5;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.option-icon {
    font-size: 28px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 10px;
    flex-shrink: 0;
}

.import-option-btn.selected .option-icon {
    background: white;
}

.option-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.option-title {
    font-weight: 600;
    font-size: 15px;
    color: #1f2937;
}

.option-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.3;
}

.new-category-input-wrapper {
    margin-top: 15px;
    padding: 15px;
    background: #f0fdf4;
    border-radius: 10px;
    border: 1px solid #86efac;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.new-category-input-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #166534;
    font-size: 14px;
}

.new-category-input-wrapper input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #86efac;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.new-category-input-wrapper input:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.swg-modal-footer .btn-cancel {
    padding: 10px 20px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #4b5563;
    transition: all 0.2s;
}

.swg-modal-footer .btn-cancel:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.swg-modal-footer .btn-confirm {
    padding: 10px 25px;
    border: none;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.swg-modal-footer .btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.swg-modal-footer .btn-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 480px) {
    .import-options-modal {
        margin: 10px;
    }
    
    .import-option-btn {
        padding: 12px 14px;
    }
    
    .option-icon {
        width: 38px;
        height: 38px;
        font-size: 22px;
    }
    
    .option-title {
        font-size: 14px;
    }
    
    .option-desc {
        font-size: 11px;
    }
}

/* ============================================
   ESTILOS SM-2 PARA FLASHCARDS - v5.9.3
   ============================================ */

/* Info de sesión SM-2 */
.sm2-session-info {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    margin: 10px auto 15px;
    max-width: 500px;
    flex-wrap: wrap;
}

.sm2-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.sm2-overdue {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.sm2-new {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.sm2-review {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* Indicador SM-2 en la tarjeta */
.flashcard-sm2-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.sm2-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
}

.sm2-new-word {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

.flashcard-front .sm2-new-word {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.sm2-mastered {
    background: rgba(234, 179, 8, 0.15);
    color: #a16207;
}

.flashcard-front .sm2-mastered {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.sm2-learning {
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
}

.flashcard-front .sm2-learning {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.sm2-difficult {
    background: rgba(249, 115, 22, 0.15);
    color: #c2410c;
}

.flashcard-front .sm2-difficult {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.sm2-struggling {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.flashcard-front .sm2-struggling {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* Próxima revisión */
.flashcard-next-review {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 8px;
    margin-top: 10px;
    width: 100%;
}

/* Intervalo en botones de calificación */
.flashcard-rating-btn .btn-interval {
    display: block;
    font-size: 10px;
    color: rgba(0,0,0,0.5);
    margin-top: 2px;
    font-weight: 400;
}

.btn-again .btn-interval { color: rgba(198, 40, 40, 0.7); }
.btn-hard .btn-interval { color: rgba(194, 65, 12, 0.7); }
.btn-good .btn-interval { color: rgba(21, 128, 61, 0.7); }
.btn-easy .btn-interval { color: rgba(30, 64, 175, 0.7); }

/* Ajustar botones para incluir intervalo */
.flashcard-rating-btn {
    padding: 12px 8px 8px;
}

.flashcard-rating-btn .btn-hint {
    margin-bottom: 2px;
}

/* Responsive */
@media (max-width: 600px) {
    .sm2-session-info {
        gap: 8px;
        padding: 8px 10px;
    }
    
    .sm2-badge {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .flashcard-sm2-indicator {
        top: 8px;
        left: 8px;
    }
    
    .sm2-status {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .flashcard-rating-btn .btn-interval {
        font-size: 9px;
    }
}

@media (max-width: 400px) {
    .sm2-session-info {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
}

/* Selector de modo Flashcard */
.fc-mode-selector {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.fc-mode-selector.active {
    opacity: 1;
    pointer-events: auto;
}

.fc-mode-selector-content {
    background: white;
    border-radius: 20px;
    padding: 25px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.fc-mode-selector.active .fc-mode-selector-content {
    transform: translateY(0) scale(1);
}

.fc-mode-selector-title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
}

.fc-mode-option {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
    text-align: left;
}

.fc-mode-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.fc-mode-smart:hover {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
}

.fc-mode-random:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.fc-mode-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 12px;
    flex-shrink: 0;
}

.fc-mode-smart .fc-mode-icon {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
}

.fc-mode-random .fc-mode-icon {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.fc-mode-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.fc-mode-name {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.fc-mode-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.3;
}

.fc-mode-cancel {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 5px;
}

.fc-mode-cancel:hover {
    background: #e5e7eb;
}

@media (max-width: 480px) {
    .fc-mode-selector-content {
        margin: 10px;
        padding: 20px;
    }
    
    .fc-mode-option {
        padding: 12px 14px;
    }
    
    .fc-mode-icon {
        width: 42px;
        height: 42px;
        font-size: 26px;
    }
    
    .fc-mode-name {
        font-size: 15px;
    }
}

/* ==========================================
   VOICE CUSTOMIZER PANEL
   ========================================== */

.btn-tool.btn-full {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-tool.btn-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
}

/* Voice Config Cards */
.voice-config-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.voice-config-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 1px solid #e5e7eb;
}

.voice-config-icon {
    font-size: 32px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.voice-config-title h4 {
    margin: 0 0 3px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.voice-config-title p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.voice-config-body {
    padding: 20px;
}

/* Voice Fields */
.voice-field {
    margin-bottom: 20px;
}

.voice-field:last-child {
    margin-bottom: 0;
}

.voice-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

/* Voice Select Dropdown */
.voice-select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    color: #1f2937;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' 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 12px center;
}

.voice-select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* Voice Options Grid */
.voice-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.voice-option-btn {
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.voice-option-btn:hover {
    border-color: #a78bfa;
    background: #faf5ff;
}

.voice-option-btn.selected {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    color: #6d28d9;
    font-weight: 600;
}

.voice-option-btn .voice-emoji {
    font-size: 16px;
    display: block;
    margin-bottom: 4px;
}

/* Speed Slider Full Range */
.speed-slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.speed-label {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
}

.speed-slider-full {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #a78bfa, #c4b5fd, #ddd6fe, #c4b5fd, #a78bfa);
    outline: none;
    -webkit-appearance: none;
}

.speed-slider-full::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
    transition: transform 0.2s;
}

.speed-slider-full::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.speed-slider-full::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
    border: none;
}

/* Speed Value Display */
#learningSpeedValue,
#nativeSpeedValue {
    display: inline-block;
    padding: 3px 10px;
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #6d28d9;
    margin-left: 8px;
}

/* Voice Test Row */
.voice-test-row {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #e5e7eb;
}

.voice-test-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.voice-test-input:focus {
    outline: none;
    border-color: #8b5cf6;
}

.btn-test-voice {
    padding: 10px 18px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-test-voice:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-test-voice:active {
    transform: translateY(0);
}

/* Voice Save Section */
.voice-save-section {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 16px;
    margin-top: 10px;
}

.btn-save-voices {
    padding: 14px 40px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-save-voices:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.voice-save-hint {
    margin: 12px 0 0 0;
    font-size: 12px;
    color: #9ca3af;
}

/* Responsive */
@media (max-width: 480px) {
    .voice-config-header {
        padding: 14px 16px;
    }
    
    .voice-config-icon {
        width: 44px;
        height: 44px;
        font-size: 26px;
    }
    
    .voice-config-title h4 {
        font-size: 15px;
    }
    
    .voice-config-body {
        padding: 16px;
    }
    
    .voice-options-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .speed-slider-container {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .speed-slider-full {
        width: 100%;
        order: 2;
        margin-top: 8px;
    }
    
    .voice-test-row {
        flex-direction: column;
    }
    
    .btn-test-voice {
        width: 100%;
    }
}
