:root {
    --primary: #6C63FF;
    --primary-dark: #5A52D5;
    --secondary: #4ECDC4;
    --secondary-dark: #3DB8AF;
    --accent: #FFD166;
    --success: #06D6A0;
    --warning: #FF9E64;
    --danger: #EF476F;
    --dark: #1A1A2E;
    --darker: #16213E;
    --light: #2A2A4A;
    --lighter: #3A3A5A;
    --text: #FFFFFF;
    --text-secondary: #B8B8D0;

    --math-primary: #6C63FF;
    --math-secondary: #4ECDC4;
    --science-primary: #06D6A0;
    --science-secondary: #4ECDC4;
    --social-primary: #FF9E64;
    --social-secondary: #FFD166;
    --lengua-primary: #C77DFF;
    --lengua-secondary: #E0AAFF;
    --language-primary: #EF476F;
    --language-secondary: #FF9E64;
    --english-primary: #4ECDC4;
    --english-secondary: #6C63FF;

    --sidebar-width: 260px;
    --sidebar-collapsed: 80px;
    --neon-glow: 0 0 10px rgba(108, 99, 255, 0.4);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

body.light-mode {
    --dark: #f0f0f0;
    --darker: #e0e0e0;
    --light: #ffffff;
    --lighter: #f8f8f8;
    --text: #000000;
    --text-secondary: #666666;
    --neon-glow: 0 0 10px rgba(108, 99, 255, 0.2);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.hidden {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 50%, var(--light) 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 18px;
    /* Increased from default 14px */
}

.app-container {
    display: flex;
    flex-wrap: wrap;
    /* Permite que los elementos se envuelvan */
    min-height: 100vh;
    position: relative;
}

.top-bar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: 80px;
    background: linear-gradient(90deg, rgba(108, 99, 255, 0.15) 0%, rgba(78, 205, 196, 0.15) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 99;
    transition: var(--transition);
}

.sidebar.collapsed~.main-content .top-bar {
    left: var(--sidebar-collapsed);
}

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

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    position: relative;
    box-shadow: var(--neon-glow);
}

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

.user-name {
    font-weight: 700;
    font-size: 1rem;
}

.user-level {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* --- NUEVOS ESTILOS PARA BARRA DE XP --- */
.xp-bar-container-top {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.xp-bar-fill-top {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.xp-bar-text-top {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 2px;
    text-align: center;
}

.xp-bar-container-gamification {
    width: 80%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.xp-bar-fill-gamification {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--warning));
    border-radius: 6px;
    transition: width 0.5s ease;
}

.xp-bar-text-gamification {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 5px;
    font-weight: 600;
}

/* --- FIN NUEVOS ESTILOS --- */


.user-switcher {
    margin-left: 20px;
}

.user-switcher select {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.user-switcher select:hover {
    background: rgba(255, 255, 255, 0.15);
}

.user-switcher select option {
    background: var(--dark);
    color: var(--text);
}

.user-stats {
    display: flex;
    align-items: center;
    gap: 25px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.stat-value {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.8;
}

.stat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent);
    color: var(--dark);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
}

.daily-quote {
    font-style: italic;
    font-size: 0.9rem;
    opacity: 0.9;
    max-width: 40%;
    text-align: center;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--darker) 0%, var(--dark) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 102;
    box-shadow: var(--shadow);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 101;
    display: none;
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: pulse-glow 3s infinite;
    box-shadow: var(--neon-glow);
}

@keyframes pulse-glow {

    0%,
    100% {
        transform: scale(1);
        box-shadow: var(--neon-glow);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(108, 99, 255, 0.6);
    }
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition);
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.nav-item.active {
    background: rgba(108, 99, 255, 0.1);
    color: var(--text);
    border-left-color: var(--primary);
}

.nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-text {
    font-weight: 600;
    transition: var(--transition);
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-sidebar {
    position: absolute;
    top: 20px;
    right: -15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--neon-glow);
    z-index: 101;
    border: none;
    color: white;
    font-size: 0.9rem;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    padding: 100px 20px 20px 20px;
    min-height: 100vh;
}

/* Reducir padding cuando gamificación está activa */
.main-content:has(#gamification.active) {
    padding-top: 20px !important;
}

.sidebar.collapsed~.main-content {
    margin-left: var(--sidebar-collapsed);
}

.content-section {
    display: none;
    animation: slideInUp 0.5s ease-out;
}

.content-section.active {
    display: block !important;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

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

.stat-card {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0.05) 100%);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: rgba(255, 255, 255, 0.2);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.8;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.module-card {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0.05) 100%);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: rgba(255, 255, 255, 0.2);
}

.module-card.active-user {
    border: 2px solid var(--success) !important;
    background: linear-gradient(135deg,
            rgba(6, 214, 160, 0.1) 0%,
            rgba(6, 214, 160, 0.05) 100%) !important;
}

.module-icon {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.module-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.module-description {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.5;
    font-size: 0.9rem;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.1);
    height: 6px;
    border-radius: 3px;
    margin: 12px 0;
    overflow: hidden;
}

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

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    touch-action: manipulation;
    /* Mejor para táctil */
    min-width: 80px;
    /* Botones más grandes para táctil */
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #D91E4E);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 71, 111, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 71, 111, 0.6);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #05C78F);
    color: white;
    box-shadow: 0 4px 12px rgba(6, 214, 160, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 214, 160, 0.6);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #FF8C42);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 158, 100, 0.4);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 158, 100, 0.6);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.75rem;
    border-radius: 15px;
}

.content-container {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0.05) 100%);
    border-radius: var(--border-radius);
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

/* Estilos para el nuevo editor integrado */
.editor-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.dynamic-list .dynamic-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid var(--primary);
    position: relative;
}

.dynamic-item .remove-item-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-container h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.2);
}

textarea.form-input {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

.subjects-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    flex-wrap: wrap;
}

.subject-tab {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}

.subject-tab.active {
    background: rgba(108, 99, 255, 0.2);
    border-color: var(--primary);
}

.subject-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
}

.upload-area {
    border: 2px dashed var(--primary);
    padding: 30px;
    text-align: center;
    border-radius: 12px;
    margin: 15px 0;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area:hover {
    background: rgba(108, 99, 255, 0.05);
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.7;
}

.question-container {
    margin-bottom: 25px;
}

.question-text {
    font-size: 1.1rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.option {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

.option.selected {
    background: rgba(108, 99, 255, 0.2);
    border-color: var(--primary);
}

.option.correct {
    background: rgba(6, 214, 160, 0.2);
    border-color: var(--success);
}

.option.incorrect {
    background: rgba(239, 71, 111, 0.2);
    border-color: var(--danger);
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
}

/* INICIO NUEVOS ESTILOS LECTOR */
.reader-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    flex-wrap: wrap;
}

.reader-controls .btn-sm {
    min-width: 40px;
    justify-content: center;
}

.theory-content {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
    margin-top: 12px;
    max-height: 500px;
    overflow-y: auto;
    font-size: 0.95rem;
    /* Tamaño por defecto */
    line-height: 1.8;
    /* Aumentado */
    font-family: inherit;
    /* Hereda la fuente principal */
    transition: font-size 0.3s ease;
}

.theory-content.font-size-s {
    font-size: 0.8rem;
}

.theory-content.font-size-m {
    font-size: 0.95rem;
}

.theory-content.font-size-l {
    font-size: 1.1rem;
}

.theory-content.font-size-xl {
    font-size: 1.25rem;
}

/* FIN NUEVOS ESTILOS LECTOR */

/* Estilos para contenido embebido */
.embedded-video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin: 15px 0;
    border-radius: 8px;
}

.embedded-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.embedded-audio {
    width: 100%;
    margin: 15px 0;
}

.theory-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.theory-tab {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.theory-tab.active {
    background: rgba(108, 99, 255, 0.2);
    color: var(--primary);
}

.theory-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
}

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

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

.theory-section {
    margin-bottom: 25px;
    padding: 25px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.04) 100%);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.theory-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(108, 99, 255, 0.05) 0%,
            transparent 100%);
    z-index: 0;
}

.theory-section:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.theory-section-title {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}


/* Beat the Clock Timer Fix */
.timer-circle {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.timer-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-circle circle {
    fill: none;
    stroke-width: 8;
    stroke: rgba(255, 255, 255, 0.1);
}

#btc-progress-circle {
    stroke: var(--success);
    stroke-dasharray: 283;
    /* 2 * PI * 45 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

#btc-time {
    position: absolute;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

/* 
color: var(--text);
position: relative;
z-index: 1; 
*/

.theory-section-content p {
    margin-bottom: 15px;
}

.theory-key-point {
    background: linear-gradient(135deg,
            rgba(108, 99, 255, 0.15) 0%,
            rgba(108, 99, 255, 0.05) 100%);
    border-left: 4px solid var(--primary);
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    position: relative;
    overflow: hidden;
}

.theory-key-point::before {
    content: '💡';
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1.2rem;
}

.theory-key-point strong {
    margin-left: 25px;
    display: block;
    margin-bottom: 5px;
}

.theory-example {
    background: linear-gradient(135deg,
            rgba(255, 209, 102, 0.15) 0%,
            rgba(255, 209, 102, 0.05) 100%);
    border-left: 4px solid var(--accent);
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    position: relative;
    overflow: hidden;
}

.theory-example::before {
    content: '🌱';
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1.2rem;
}

.theory-example strong {
    margin-left: 25px;
    display: block;
    margin-bottom: 5px;
}

.theory-note {
    background: linear-gradient(135deg,
            rgba(78, 205, 196, 0.15) 0%,
            rgba(78, 205, 196, 0.05) 100%);
    border-left: 4px solid var(--secondary);
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    position: relative;
    overflow: hidden;
}

.theory-note::before {
    content: '📝';
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1.2rem;
}

.theory-note strong {
    margin-left: 25px;
    display: block;
    margin-bottom: 5px;
}

.theory-image {
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    margin: 15px 0;
    box-shadow: var(--shadow);
}

.theory-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.theory-progress-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.theory-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.theory-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.flashcard-container {
    perspective: 1000px;
    margin: 20px auto;
    max-width: 500px;
}

.flashcard {
    width: 100%;
    min-height: 300px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

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

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--border-radius);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow);
}

.flashcard-front {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.flashcard-back {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: white;
    transform: rotateY(180deg);
}

.flashcard-image {
    max-width: 100%;
    max-height: 120px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    display: none;
    /* Oculta por defecto */
}

.flashcard-question {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.flashcard-answer {
    font-size: 1.2rem;
    line-height: 1.5;
}

.flashcard-hint {
    margin-top: 15px;
    font-size: 0.9rem;
    opacity: 0.8;
    font-style: italic;
}

.flashcard-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.flashcard-progress {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.anki-card {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.15) 0%,
            rgba(255, 255, 255, 0.08) 100%);
    border-radius: var(--border-radius);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.anki-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.anki-question {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
    line-height: 1.4;
}

.anki-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 25px;
}

.anki-option-btn {
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: left;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    width: 100%;
}

.anki-option-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.anki-option-btn.selected {
    background: rgba(108, 99, 255, 0.2);
    border-color: var(--primary);
}

.anki-option-btn.correct {
    background: rgba(6, 214, 160, 0.2);
    border-color: var(--success);
}

.anki-option-btn.incorrect {
    background: rgba(239, 71, 111, 0.2);
    border-color: var(--danger);
}

.anki-answer {
    font-size: 1.2rem;
    line-height: 1.5;
    margin-bottom: 25px;
    text-align: center;
    display: none;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.anki-explanation {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    font-size: 0.9rem;
    display: none;
}

.anki-rating {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.anki-rating-btn {
    padding: 10px 20px;
    border-radius: 20px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.anki-rating-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.difficulty-badge {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
}

.difficulty-easy {
    background: rgba(6, 214, 160, 0.2);
    color: var(--success);
}

.difficulty-medium {
    background: rgba(255, 209, 102, 0.2);
    color: var(--accent);
}

.difficulty-hard {
    background: rgba(239, 71, 111, 0.2);
    color: var(--danger);
}

.badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-right: 8px;
    margin-bottom: 8px;
}

.achievement-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.achievement-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.achievement-info {
    flex: 1;
}

.achievement-title {
    font-weight: 700;
    margin-bottom: 5px;
}

.achievement-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.achievement-progress {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.achievement-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.leaderboard-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--neon-glow);
}

.avatar-accessory {
    position: absolute;
    font-size: 1.5rem;
}

.avatar-hat {
    top: -5px;
}

.avatar-glasses {
    top: 35px;
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.shop-item {
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius);
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shop-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.2);
}

.shop-item-premium {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.1), rgba(255, 158, 100, 0.1));
}

.shop-item-premium:hover {
    border-color: var(--accent);
    box-shadow: 0 5px 20px rgba(255, 209, 102, 0.3);
}

.shop-item-icon {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.shop-item-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}

.shop-item-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
    min-height: 32px;
}

.shop-item-price {
    color: var(--accent);
    font-weight: 700;
    margin-top: auto;
    font-size: 1rem;
}

.shop-item-price-expensive {
    color: var(--danger);
}

.shop-item-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, var(--accent), var(--warning));
    color: var(--dark);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(255, 209, 102, 0.5);
}

.event-card {
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.1), rgba(255, 158, 100, 0.1));
    border: 1px solid rgba(255, 209, 102, 0.3);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 15px;
}

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

.event-icon {
    font-size: 1.5rem;
}

.event-title {
    font-weight: 700;
    color: var(--accent);
}

.event-timer {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-left: auto;
}

.power-ups {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.power-up {
    background: rgba(108, 99, 255, 0.2);
    border: 1px solid var(--primary);
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.power-up:hover {
    background: rgba(108, 99, 255, 0.3);
}

.power-up.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Nuevos estilos para gamificación */
/* Estilos para minijuegos */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin: 20px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.memory-card {
    width: 100%;
    aspect-ratio: 5 / 6;
    perspective: 1000px;
    cursor: pointer;
}

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

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

.memory-card-front,
.memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-align: center;
    font-size: clamp(0.75rem, 2.5vw, 1rem);
    /* MEJORA: Fuente adaptable */
    overflow-wrap: break-word;
    /* MEJORA: Evita desbordamiento de texto */
}

.memory-card-front {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-size: 2rem;
}

.memory-card-back {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: white;
    transform: rotateY(180deg);
}

.memory-card.matched {
    opacity: 0.6;
    cursor: default;
    transform: scale(0.95);
}

.crossword-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.crossword-grid-wrapper {
    overflow-x: auto;
    padding: 10px;
}

.crossword-grid {
    display: grid;
    gap: 1px;
    background: var(--dark);
    border: 2px solid var(--primary);
}

.crossword-cell {
    width: clamp(25px, 6vw, 40px);
    height: clamp(25px, 6vw, 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.crossword-cell.empty {
    background: var(--darker);
}

.crossword-cell input {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--light);
    color: var(--text);
    text-align: center;
    font-size: 1.2rem;
    text-transform: uppercase;
    padding: 0;
}

.crossword-cell input:focus {
    outline: 2px solid var(--accent);
    z-index: 1;
}

.crossword-cell .word-number {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 0.6rem;
    color: var(--text-secondary);
}

.crossword-clues {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
    max-width: 600px;
}

.clue-list h4 {
    color: var(--primary);
}

.clue-item {
    font-size: 0.9rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
}

.clue-item.active {
    background: rgba(108, 99, 255, 0.2);
}

.trivia-container {
    max-width: 700px;
    margin: 0 auto;
}

.trivia-header {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-bottom: 20px;
}

.trivia-player,
.trivia-opponent {
    padding: 10px;
    border-radius: 8px;
    width: 45%;
}

.trivia-player {
    border: 2px solid var(--success);
}

.trivia-opponent {
    border: 2px solid var(--danger);
}

.trivia-timer {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin: 15px 0;
}

.trivia-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-top: 5px;
}

.trivia-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

@keyframes streakPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

.streak-celebration {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.streak-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse-glow 1s infinite;
}

.streak-rewards {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    font-size: 1.2rem;
}

.mission-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: var(--transition);
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.mission-card.completed {
    background: rgba(6, 214, 160, 0.2);
    border: 1px solid var(--success);
}

.mission-card.completed::after {
    content: '✓';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--success);
    font-size: 1.5rem;
    font-weight: bold;
}

.mission-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.mission-info {
    flex: 1;
}

.mission-name {
    font-weight: 700;
    margin-bottom: 5px;
}

.mission-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.mission-reward {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.9rem;
}

.duel-interface {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 30px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.duel-interface::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% {
        transform: translate(-50%, -50%) translateX(-100%);
    }

    100% {
        transform: translate(-50%, -50%) translateX(100%);
    }
}

.duel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.player {
    text-align: center;
}

.player-avatar {
    font-size: 3rem;
    margin-bottom: 10px;
}

.player-name {
    font-weight: 700;
    margin-bottom: 5px;
}

.player-score {
    font-size: 2rem;
    color: var(--accent);
}

.vs-badge {
    font-size: 2rem;
    font-weight: bold;
    color: var(--danger);
    animation: pulse-glow 1s infinite;
}

.duel-timer {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.league-progress {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
    position: relative;
}

.league-current,
.league-next {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.league-icon {
    font-size: 1.5rem;
}

.league-name {
    font-weight: 700;
}

.league-bar {
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    margin: 15px 0;
}

.league-fill {
    height: 100%;
    transition: width 0.5s ease;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    position: relative;
}

.league-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

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

    100% {
        transform: translateX(100%);
    }
}

.max-league {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 30px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    border-radius: 15px;
    border: 2px solid var(--accent);
}

.lootbox-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.lootbox-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.lootbox-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.lootbox-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.lootbox-name {
    font-weight: 700;
    margin-bottom: 5px;
}

.lootbox-price {
    color: var(--accent);
    font-weight: bold;
    font-size: 1.1rem;
}

.title-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 10px 15px;
    margin: 5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

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

.title-icon {
    font-size: 1.2rem;
}

.daily-reward-container {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    margin: 20px 0;
}

.daily-reward-timer {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--accent);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Avatar Picker Styles */
.avatar-picker-content {
    max-width: 600px;
    padding: 30px;
}

.gender-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.gender-tab {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-secondary);
}

.gender-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.gender-tab.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.4);
}

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

.avatar-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.05);
}

.avatar-option:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.avatar-option.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.2) 0%, rgba(78, 205, 196, 0.2) 100%);
    box-shadow: 0 5px 20px rgba(108, 99, 255, 0.5);
}

.avatar-emoji {
    font-size: 48px;
    margin-bottom: 8px;
    line-height: 1;
}

.avatar-name {
    font-size: 12px;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 600;
}

.avatar-option.selected .avatar-name {
    color: var(--text);
}

/* Make avatar clickable */
.user-avatar {
    cursor: pointer;
    transition: transform 0.3s;
}

.user-avatar:hover {
    transform: scale(1.1);
}

#top-avatar-base {
    cursor: pointer;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.modal-icon {
    font-size: 1.8rem;
    color: var(--danger);
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.modal-body {
    margin-bottom: 25px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.subject-math {
    --primary: var(--math-primary);
    --secondary: var(--math-secondary);
}

.subject-science {
    --primary: var(--science-primary);
    --secondary: var(--science-secondary);
}

.subject-social {
    --primary: var(--social-primary);
    --secondary: var(--social-secondary);
}

.subject-language {
    --primary: var(--language-primary);
    --secondary: var(--language-secondary);
}

.subject-english {
    --primary: var(--english-primary);
    --secondary: var(--english-secondary);
}

.json-example {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    border-left: 3px solid var(--primary);
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

.format-option {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.format-option:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.format-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.format-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(108, 99, 255, 0.2);
}

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1000;
    background: var(--primary);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: var(--neon-glow);
    border: none;
    cursor: pointer;
}

.search-input {
    margin-bottom: 15px;
    padding: 10px;
    width: 100%;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    cursor: pointer;
    font-size: 1.5rem;
}

/* Contenedor para feedback inteligente */
#intelligent-feedback-container {
    background: linear-gradient(135deg, rgba(255, 158, 100, 0.15), rgba(239, 71, 111, 0.15));
    border: 1px solid var(--warning);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Force full width and visibility in mobile even if collapsed class is present */
    .sidebar.collapsed {
        width: var(--sidebar-width);
    }

    .sidebar.collapsed .nav-text,
    .sidebar.collapsed .logo-text {
        opacity: 1;
        width: auto;
        overflow: visible;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .mobile-nav-bar {
        display: flex;
        position: fixed;
        top: 60px;
        /* Debajo de la top-bar ajustada */
        left: 0;
        right: 0;
        height: 60px;
        background: var(--dark);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 98;
        overflow-x: auto;
        padding: 0 10px;
        align-items: center;
        gap: 5px;
        scrollbar-width: none;
    }

    .mobile-nav-bar::-webkit-scrollbar {
        display: none;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 70px;
        height: 100%;
        color: var(--text-secondary);
        text-decoration: none;
        transition: var(--transition);
        padding: 5px;
    }

    .mobile-nav-item.active {
        color: var(--primary);
        background: rgba(108, 99, 255, 0.1);
    }

    .m-nav-icon {
        font-size: 1.2rem;
    }

    .m-nav-text {
        font-size: 0.65rem;
        font-weight: 600;
        margin-top: 2px;
        white-space: nowrap;
    }

    .top-bar {
        left: 0;
        height: 60px;
        padding: 0 15px;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding-top: 130px;
        /* Espacio para top-bar + mobile-nav-bar */
    }

    .user-info {
        display: none;
        /* Ocultar info extendida en móvil */
    }

    .daily-quote {
        display: none;
    }

    .user-stats {
        gap: 10px;
    }

    .mobile-course-container {
        display: block !important;
    }

    #top-course-selector-container {
        display: none;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 20px;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

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

    .main-content {
        padding: 120px 15px 15px 15px;
    }

    .content-container {
        padding: 20px;
    }

    .user-stats {
        gap: 10px;
    }

    .stat-item {
        min-width: 60px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .flashcard {
        height: auto;
        min-height: 250px;
    }

    .flashcard-question {
        font-size: 1.2rem;
    }

    .flashcard-answer {
        font-size: 1rem;
    }

    .anki-card {
        padding: 20px;
    }

    .anki-question {
        font-size: 1.2rem;
    }

    .shop-items {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .theory-content {
        max-height: 400px;
    }

    .modal-content {
        padding: 20px;
    }

    .theory-tabs,
    .subjects-tabs {
        flex-wrap: wrap;
    }

    .theory-tab,
    .subject-tab {
        flex: 1;
        min-width: 120px;
        text-align: center;
        justify-content: center;
    }

    .theory-section {
        padding: 20px;
    }

    .json-example {
        font-size: 0.75rem;
        padding: 10px;
    }

    .crossword-clues {
        grid-template-columns: 1fr;
    }

    .trivia-header {
        flex-direction: column;
        gap: 10px;
    }

    .trivia-player,
    .trivia-opponent {
        width: 100%;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 9999;
    animation: confetti-fall 3s linear;
}

/* Estilos para Controles de Audio */
.audio-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    max-width: 400px;
}

.audio-control-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.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.4s;
    border-radius: 24px;
}

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

input:checked+.slider {
    background-color: var(--primary);
}

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

/* --- ESTILOS PARA GESTOR DE CONTENIDO --- */
.content-manager-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    flex-wrap: wrap;
}

.manager-tab {
    padding: 12px 24px;
    background: transparent;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    border-bottom: none;
    color: var(--text-secondary);
}

.manager-tab.active {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.manager-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.manager-tab-content {
    display: none;
    animation: slideInUp 0.5s ease-out;
}

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

/* --- ESTILOS PARA EJERCICIOS GUIADOS (STEP-BY-STEP) --- */
.step-by-step-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--math-primary, var(--primary));
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 25px 0;
}

.sbs-problem {
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sbs-steps-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sbs-step {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.sbs-step-number {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
}

.sbs-step-content {
    flex: 1;
}

.sbs-explanation {
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    color: var(--text-secondary);
}

.sbs-formula {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

/* --- ESTILOS PARA KEYWORDS --- */
.keywords-container {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.keywords-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-right: 5px;
}

.keyword-tag {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.keyword-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* --- ESTILOS PARA FRACCIONES --- */
.math-expr {
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: 1.1rem;
    display: inline-block;
    margin: 0 0.5rem;
}

.fraction {
    display: inline-block;
    vertical-align: middle;
    margin: 0 0.2em;
    text-align: center;
}

.fraction>span {
    display: block;
}

.fraction .numerator {
    border-bottom: 1px solid currentColor;
    padding-bottom: 0.05em;
}

.fraction .denominator {
    padding-top: 0.05em;
}

/* RAPID FIRE MINIGAME STYLES */
.rapid-fire-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.rf-timer {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    width: 80px;
    text-align: center;
}

.rf-score,
.rf-streak {
    font-size: 1.2rem;
    font-weight: 600;
}

.rf-question-area {
    text-align: center;
    margin-bottom: 3rem;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rf-question-area h2 {
    font-size: 2rem;
    color: var(--text);
    line-height: 1.4;
}

.rf-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.rf-option-btn {
    padding: 3rem 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.rf-option-btn:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
}

.rf-option-btn:active {
    transform: scale(0.98);
}

/* Feedback Overlay */
.rf-feedback {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
}

.rf-feedback.correct {
    background: radial-gradient(circle, rgba(46, 204, 113, 0.4) 0%, transparent 70%);
    animation: flash-green 0.3s ease-out;
}

.rf-feedback.wrong {
    background: radial-gradient(circle, rgba(231, 76, 60, 0.4) 0%, transparent 70%);
    animation: flash-red 0.3s ease-out;
}

@keyframes flash-green {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@keyframes flash-red {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* Results Screen */
.game-results {
    text-align: center;
    padding: 2rem;
    animation: fadeIn 0.5s ease-out;
}

.results-summary {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
}

.result-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-item .label {
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-item .value {
    font-size: 2.5rem;
    font-weight: 800;
}

.result-item .value.highlight {
    color: var(--primary);
    font-size: 3.5rem;
}

.ranking-container {
    margin: 2rem auto;
    max-width: 600px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.ranking-table th,
.ranking-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ranking-table th {
    font-weight: 600;
    color: var(--primary);
}

.ranking-table tr.current-run {
    background: rgba(var(--primary-rgb), 0.2);
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
    .rf-options-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .rf-option-btn {
        padding: 2rem 1rem;
    }

    .results-summary {
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* =========================================
   🎮 MINIGAME SYSTEM STYLES
   ========================================= */

/* --- SELECTOR GRID --- */
.minigame-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.minigame-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.minigame-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.2);
}

.minigame-card.priority-high {
    border-color: var(--accent);
    background: linear-gradient(145deg, rgba(255, 209, 102, 0.1), rgba(255, 209, 102, 0.05));
}

.minigame-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.minigame-name {
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--text);
}

.minigame-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.minigame-difficulty {
    font-size: 0.8rem;
    letter-spacing: 2px;
}

/* --- COMMON GAME ELEMENTS --- */
.game-wrapper {
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-out;
}

.game-hud {
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 25px;
    border-radius: 50px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
}

/* --- CHAIN REACTION STYLES --- */
.chain-bar-container {
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    margin-bottom: 30px;
    overflow: hidden;
    position: relative;
}

.chain-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease-out;
    box-shadow: 0 0 15px var(--primary);
}

.multiplier-display {
    color: var(--accent);
    text-shadow: 0 0 10px rgba(255, 209, 102, 0.5);
}

.bank-btn {
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    font-size: 1.2rem;
    animation: pulse 2s infinite;
}

/* --- BEAT THE CLOCK STYLES --- */
.clock-display {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
}

.clock-circle {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.clock-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 10;
}

.clock-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 10;
    stroke-dasharray: 565;
    /* 2 * PI * 90 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.clock-time {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: 900;
}

/* --- WHEEL OF KNOWLEDGE STYLES --- */
.wheel-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto 30px;
}

#wheel-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    transition: transform 4s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    color: var(--accent);
    filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.5));
    z-index: 10;
}

/* --- TRIVIA ROYALE STYLES --- */
.royale-bracket {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 30px;
}

.competitors-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
}

.competitor {
    text-align: center;
    opacity: 0.5;
    transition: all 0.3s;
}

.competitor.active {
    opacity: 1;
    transform: scale(1.1);
}

.competitor.eliminated {
    opacity: 0.2;
    filter: grayscale(100%);
}

.competitor-avatar {
    font-size: 2rem;
    margin-bottom: 5px;
}

/* --- MYSTERY BOX STYLES --- */
.boxes-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.mystery-box {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #444, #222);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.mystery-box:hover {
    transform: translateY(-5px) rotate(5deg);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(255, 209, 102, 0.3);
}

.mystery-box.opened {
    background: rgba(0, 0, 0, 0.5);
    cursor: default;
    transform: none;
}

/* --- SNIPER QUIZ STYLES --- */
.sniper-arena {
    height: 400px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    cursor: none;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.crosshair {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid var(--danger);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 100;
}

.crosshair::before,
.crosshair::after {
    content: '';
    position: absolute;
    background: var(--danger);
}

.crosshair::before {
    top: 50%;
    left: -10px;
    right: -10px;
    height: 1px;
}

.crosshair::after {
    left: 50%;
    top: -10px;
    bottom: -10px;
    width: 1px;
}

.question-floating {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 15px;
    border-radius: 8px;
    max-width: 200px;
    font-size: 0.9rem;
    pointer-events: auto;
    cursor: crosshair;
    transition: transform 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.question-floating:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--danger);
}

.sniper-target {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: crosshair;
    transition: all 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    min-width: 80px;
    text-align: center;
    animation: float 3s ease-in-out infinite;
}

.sniper-target:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}


/* --- VISUAL MATCH STYLES --- */
.match-grid {
    display: flex;
    justify-content: space-between;
    position: relative;
    height: 500px;
}

.connection-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.concepts-column,
.images-column {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 40%;
}

.match-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.match-item.selected {
    border-color: var(--primary);
    background: rgba(108, 99, 255, 0.2);
}

.match-item.matched {
    border-color: var(--success);
    opacity: 0.5;
    pointer-events: none;
}

/* --- PUZZLE MASTER STYLES --- */
.puzzle-drop-zone {
    min-height: 100px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    align-items: center;
    justify-content: center;
}

.puzzle-pieces {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.puzzle-piece {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: grab;
    user-select: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.puzzle-piece:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* --- ANIMATIONS --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .minigame-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .game-hud {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .hud-item {
        font-size: 1rem;
    }
}

/* --- TIRO AL BLANCO --- */
#target-container {
    position: relative;
    overflow: hidden;
}

.question-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 20px 40px;
    border-radius: 15px;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    z-index: 10;
    pointer-events: none;
    /* Allow clicking through if needed */
    border: 2px solid var(--primary);
    box-shadow: 0 0 20px rgba(108, 99, 255, 0.5);
    width: auto;
    max-width: 80%;
}

/* Mind Map Styles */
.mind-map-area {
    position: relative;
    width: 100%;
    height: 500px;
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
}

.mind-map-canvas {
    position: relative;
    width: 100%;
    height: 100%;
}

.mm-node {
    position: absolute;
    padding: 15px 20px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
    min-width: 80px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid transparent;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mm-node.center {
    background: var(--accent);
    font-size: 1.2rem;
    min-width: 120px;
    min-height: 120px;
    cursor: default;
    z-index: 10;
    color: var(--dark);
}

.mm-node.concept:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.mm-node.connected {
    background: var(--success);
    border-color: var(--success);
    cursor: default;
}

.mm-node.wrong {
    background: var(--danger);
    animation: shake 0.5s;
}

@keyframes shake {

    0%,
    100% {
        transform: translate(-50%, -50%) translateX(0);
    }

    25% {
        transform: translate(-50%, -50%) translateX(-10px);
    }

    75% {
        transform: translate(-50%, -50%) translateX(10px);
    }
}

/* Quick Login Styles */
.quick-login-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    min-width: 80px;
    padding: 10px;
    border-radius: 12px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.05);
}

.quick-login-user:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.quick-login-user.selected {
    border-color: var(--primary);
    background: rgba(108, 99, 255, 0.2);
}

.quick-login-avatar {
    font-size: 2rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.quick-login-name {
    font-size: 0.85rem;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

/* Settings Section Styles */
.settings-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-item>div {
    flex: 1;
}

.setting-item button {
    margin-left: 20px;
    white-space: nowrap;
}

/* =========================================
   V3 AUTHENTICATION STYLES
   ========================================= */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.auth-container {
    position: relative;
    z-index: 10001;
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 25px 20px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    animation: authFadeIn 0.5s ease-out;
    -webkit-overflow-scrolling: touch;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-icon,
.auth-logo {
    font-size: 4rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 15px rgba(108, 99, 255, 0.5));
}

.auth-header h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff, #a5a5a5);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

.auth-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-input {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(108, 99, 255, 0.2);
    outline: none;
}

.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    max-height: 300px;
    overflow-y: auto;
}

.user-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.user-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    border-color: var(--primary);
}

.user-card-avatar {
    font-size: 3rem;
    margin-bottom: 10px;
}

.user-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.avatar-option {
    font-size: 2rem;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.avatar-option:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.auth-avatar-preview {
    font-size: 5rem;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
}

.btn-block {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
}

.btn-text {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9rem;
    margin-top: 10px;
}

.btn-text:hover {
    color: white;
}

/* ========================================
   FIX: RESPONSIVE PARA TABLETS Y MÓVILES
   Fecha: 28/12/2025
   ======================================== */

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 768px) {

    /* Generador de contenido */
    .content-generator-container {
        max-height: 65vh !important;
        overflow-y: auto !important;
    }

    .content-generator-form {
        padding: 15px !important;
    }

    .form-group {
        margin-bottom: 12px !important;
    }

    .form-group label {
        font-size: 0.9rem !important;
    }

    .form-input,
    .form-textarea {
        font-size: 0.9rem !important;
        padding: 8px !important;
    }

    /* Botón procesar siempre visible */
    .btn-process-content,
    button[onclick*="processAIContent"] {
        position: sticky !important;
        bottom: 0 !important;
        z-index: 100 !important;
        width: 100% !important;
        margin-top: 15px !important;
        box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.2) !important;
        background: var(--primary) !important;
    }

    /* Reducir padding general */
    .content-section {
        padding: 15px !important;
    }

    /* Ajustar módulos grid */
    .modules-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    }

    /* Ajustar stats grid */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    }
}

/* Móviles (hasta 767px) */
@media (max-width: 767px) {
    .content-generator-container {
        max-height: 60vh !important;
    }

    .form-group label {
        font-size: 0.85rem !important;
    }

    .btn-process-content,
    button[onclick*="processAIContent"] {
        font-size: 0.9rem !important;
        padding: 12px !important;
        position: sticky !important;
        bottom: 0 !important;
        z-index: 100 !important;
    }

    .modules-grid {
        grid-template-columns: 1fr !important;
    }

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

/* ========================================
   FIX: VISUAL MATCH GAME STYLES
   Fecha: 28/12/2025
   ======================================== */

.visual-match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    padding: 20px;
    margin-top: 20px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.vm-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.vm-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.vm-card.selected {
    border-color: var(--primary);
    background: rgba(108, 99, 255, 0.25);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(108, 99, 255, 0.4);
    z-index: 10;
}

.vm-card.matched {
    border-color: var(--success);
    background: rgba(6, 214, 160, 0.2);
    transform: scale(0.95);
    opacity: 0.6;
    pointer-events: none;
    animation: pulse-success 0.5s ease;
}

.vm-card img {
    max-width: 100%;
    max-height: 100px;
    border-radius: 4px;
}

@keyframes pulse-success {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(0.95);
    }
}

/* Ajuste para móviles */
@media (max-width: 767px) {
    .visual-match-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .vm-card {
        min-height: 100px;
        font-size: 0.85rem;
        padding: 10px;
    }
}

/* ========================================
   FIX: PUZZLE MASTER GAME STYLES
   Fecha: 28/12/2025
   ======================================== */

.puzzle-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 25px;
    justify-content: center;
    min-height: 150px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-top: 20px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
}

.pm-piece {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pm-piece:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.pm-piece.selected {
    background: var(--accent);
    color: var(--dark);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 209, 102, 0.5);
    z-index: 10;
    border-color: white;
}

.pm-piece.correct-pos {
    border-bottom: 3px solid var(--success);
}

/* Ajuste móvil */
@media (max-width: 767px) {
    .pm-piece {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* ========================================
   SETTINGS PAGE STYLES
   Fecha: 29/12/2025
   ======================================== */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.settings-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.settings-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.settings-card h3 {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

.settings-card h3 span {
    font-size: 1.5rem;
}

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

.audio-control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.level-badge {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    display: inline-block;
    margin-top: 5px;
}

/* === DYNAMIC CHALLENGES STYLES === */
.dynamic-exercise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.dynamic-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dynamic-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.bg-dark-soft {
    background: rgba(42, 42, 74, 0.4) !important;
}

.dynamic-steps {
    animation: slideDown 0.3s ease-out;
    background: rgba(108, 99, 255, 0.1);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-group {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 12px;
}

.btn-group .btn {
    border-radius: 8px !important;
    margin: 0 !important;
}

#anki-dynamic-view .dynamic-controls {
    margin-bottom: 25px;
}/* ========================================
   MINDMAP VIEWER - Neon Tree Design
   ======================================== */

.mindmap-viewer {
    width: 100%;
    height: 100%;
    min-height: 600px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: var(--border-radius);
    padding: 20px;
    overflow: auto;
}

.mindmap-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    gap: 10px;
}

.mindmap-tree-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
}

/* Nodo Raíz (Central) */
.mindmap-node-root {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 20px 40px;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 0 30px rgba(108, 99, 255, 0.6),
        0 0 60px rgba(78, 205, 196, 0.4);
    margin-bottom: 60px;
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(108, 99, 255, 0.6),
            0 0 60px rgba(78, 205, 196, 0.4);
    }

    50% {
        box-shadow: 0 0 40px rgba(108, 99, 255, 0.8),
            0 0 80px rgba(78, 205, 196, 0.6);
    }
}

/* Contenedor de Ramas */
.mindmap-branches {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    width: 100%;
}

/* Rama Individual */
.mindmap-branch {
    flex: 1 1 300px;
    max-width: 400px;
    min-width: 250px;
}

/* Nodo de Rama Principal */
.mindmap-node-branch {
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.2), rgba(255, 158, 100, 0.2));
    border: 2px solid var(--accent);
    color: var(--accent);
    padding: 15px 25px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 209, 102, 0.3);
    margin-bottom: 20px;
    position: relative;
}

.mindmap-node-branch:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 30px rgba(255, 209, 102, 0.6);
    border-color: var(--warning);
}

.mindmap-node-branch::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 30px;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
    box-shadow: 0 0 10px rgba(108, 99, 255, 0.5);
}

/* Indicador de Colapso */
.mindmap-node-branch .collapse-indicator {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.mindmap-node-branch.collapsed .collapse-indicator {
    transform: rotate(-90deg);
}

/* Contenedor de Hijos */
.mindmap-children {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 20px;
    border-left: 2px solid rgba(78, 205, 196, 0.3);
    margin-left: 20px;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.3s ease;
    opacity: 1;
}

.mindmap-children.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
}

/* Nodo Hijo */
.mindmap-node-child {
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid var(--secondary);
    color: var(--secondary);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.2);
    position: relative;
}

.mindmap-node-child:hover {
    background: rgba(78, 205, 196, 0.2);
    transform: translateX(5px);
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.4);
}

.mindmap-node-child::before {
    content: '→';
    position: absolute;
    left: -15px;
    color: var(--secondary);
    font-weight: bold;
}

/* Estado Vacío */
.mindmap-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.mindmap-empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .mindmap-branches {
        flex-direction: column;
        align-items: center;
    }

    .mindmap-branch {
        max-width: 100%;
    }

    .mindmap-node-root {
        font-size: 1.2rem;
        padding: 15px 30px;
    }

    .mindmap-node-branch {
        font-size: 1rem;
    }
}/* ========================================
   MINDMAP GAME - Styles
   ======================================== */

.mm-game-canvas {
    width: 100%;
    height: 100%;
    min-height: 600px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: auto;
    position: relative;
    color: var(--text);
}

.mm-game-header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(108, 99, 255, 0.1);
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(108, 99, 255, 0.2);
}

.mm-game-header h3 {
    margin: 0;
    color: var(--accent);
    font-size: 1.5rem;
}

.mm-game-header p {
    margin: 5px 0 0;
    opacity: 0.8;
}

.mm-game-tree {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 120px;
    /* Espacio para el inventario fijo abajo */
}

.mm-game-root {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(108, 99, 255, 0.4);
    margin-bottom: 50px;
    z-index: 2;
}

.mm-game-branches {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    width: 100%;
}

.mm-game-branch {
    flex: 1 1 250px;
    max-width: 350px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
}

.mm-game-branch-label {
    background: rgba(255, 209, 102, 0.1);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    text-align: center;
    font-size: 1rem;
}

.mm-game-slots {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mm-game-slot {
    min-height: 45px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 15px;
    transition: all 0.3s ease;
    position: relative;
}

.mm-game-slot.drag-over {
    background: rgba(108, 99, 255, 0.2);
    border-color: var(--primary);
    transform: scale(1.02);
}

.mm-game-slot.filled.correct {
    background: rgba(6, 214, 160, 0.2);
    border: 2px solid var(--success);
}

.mm-game-slot.wrong {
    background: rgba(239, 71, 111, 0.2);
    border: 2px solid var(--danger);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.slot-number {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
}

.concept-placed {
    font-weight: 500;
    color: var(--text);
    text-align: center;
}

/* Inventario */
.mm-game-inventory {
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--primary);
    padding: 20px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    z-index: 10;
}

.mm-game-inventory h4 {
    margin: 0 0 15px;
    text-align: center;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
}

.mm-game-concepts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-height: 150px;
    overflow-y: auto;
    padding: 10px;
}

.mm-game-concept {
    background: var(--light);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: grab;
    user-select: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
    white-space: nowrap;
}

.mm-game-concept:hover {
    background: var(--lighter);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.mm-game-concept:active {
    cursor: grabbing;
}

.mm-game-concept.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

/* Responsive */
@media (max-width: 768px) {
    .mm-game-branches {
        flex-direction: column;
    }

    .mm-game-inventory {
        padding: 10px;
    }

    .mm-game-concept {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* === NATIVE MOBILE UI & BARRA INFERIOR === */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .sidebar {
        display: none !important;
    }

    .main-content {
        padding: 70px 12px 85px 12px !important;
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100vw;
        height: 65px;
        background: rgba(18, 18, 24, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 99999;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: rgba(255, 255, 255, 0.6);
        font-size: 0.75rem;
        flex: 1;
        height: 100%;
        transition: all 0.2s ease;
    }

    .mobile-nav-item.active, .mobile-nav-item:hover {
        color: var(--primary);
        transform: translateY(-2px);
    }

    .mobile-nav-icon {
        font-size: 1.3rem;
        margin-bottom: 2px;
    }

    body {
        padding-top: env(safe-area-inset-top);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        touch-action: manipulation;
    }
}