@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #8b5cf6;
    --bg-dark: #0f111a;
    --bg-panel: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08), transparent 25%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    line-height: 1.5;
}

.app {
    width: 100%;
    max-width: 800px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ========== HEADER ========== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    font-size: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.3));
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo p {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========== RECORDER SECTION ========== */
.recorder-section {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.wave-container {
    width: 100%;
    height: 140px;
    margin-bottom: 24px;
    /* Fondo negro mate, como el salpicadero interior de KITT */
    background: #000;
    /* Borde cromado-rojo del panel de voz */
    border: 1px solid rgba(180, 30, 10, 0.4);
    border-radius: 12px;
    overflow: hidden;
    /* Resplandor rojo externo que envuelve al panel cuando hay actividad */
    box-shadow:
        0 0 28px rgba(220, 30, 10, 0.22),
        inset 0 0 22px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    position: relative;
}

/* Reflejo cromado superior del panel */
.wave-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 35%;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.06) 0%,
        rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 2;
}

.wave-canvas {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    z-index: 1;
}

.status-display {
    margin-bottom: 32px;
}

.status {
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.status.recording {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    animation: pulse 2s infinite;
}

.status.processing {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
}

.status.done {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

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

.controls-recorder {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
}

.btn-record {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.btn-record:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.4);
}

.btn-record.recording {
    background: var(--danger);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.btn-playback {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 16px 24px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.btn-playback:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.btn-playback:disabled, .btn-action:disabled, .btn-listen:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.text-area {
    width: 100%;
    text-align: left;
    margin-bottom: 24px;
}

.text-area h3 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.text-display {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    font-size: 16px;
    min-height: 80px;
    color: #e2e8f0;
}

.text-display.translation {
    font-size: 18px;
    font-weight: 500;
    color: white;
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.05);
}

.btn-listen {
    margin: 16px auto 0;            /* centrado horizontal */
    background: linear-gradient(135deg, #facc15, #f59e0b); /* amarillo KITT */
    color: #1a1300;                 /* texto oscuro sobre amarillo */
    border: none;
    padding: 16px 32px;             /* mismo tamaño que .btn-record */
    border-radius: 50px;            /* misma forma que .btn-record */
    font-size: 16px;                /* mismo tamaño de fuente */
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 24px rgba(250, 204, 21, 0.35);
}

.btn-listen:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(250, 204, 21, 0.5);
    background: linear-gradient(135deg, #fde047, #fbbf24);
}

.actions {
    display: flex;
    gap: 12px;
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.btn-action {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-action:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.1);
}

/* ========== HISTORY SECTION ========== */
.history-section {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
    backdrop-filter: blur(12px);
}

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

.history-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-list li {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.history-list li:not(.empty):hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.history-item-content {
    flex: 1;
    cursor: pointer;
}

.history-item-text .original {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.history-item-text .translated {
    font-size: 16px;
    font-weight: 500;
    color: white;
}

.history-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.history-item-date {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-delete-item {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete-item:hover {
    background: var(--danger);
    color: white;
}

.history-list li.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.history-list li.empty i {
    font-size: 24px;
    opacity: 0.5;
}

/* ========== FOOTER ========== */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

.version {
    margin-top: 4px;
    opacity: 0.5;
}

/* ========== UPDATE BANNER (Restyled) ========== */
.update-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 17, 26, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    padding: 16px 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 320px;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.update-banner.hidden {
    display: none !important;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.update-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.update-icon {
    font-size: 24px;
    color: var(--primary);
}

.update-text strong {
    display: block;
    color: white;
    font-size: 15px;
}

.update-text small {
    color: var(--text-muted);
}

.update-actions {
    display: flex;
    gap: 12px;
}

.update-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-update-now {
    background: var(--primary);
    color: white;
}
.btn-update-now:hover { background: var(--primary-hover); }

.btn-update-later {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}
.btn-update-later:hover { background: rgba(255, 255, 255, 0.2); }

/* Header Actions */
.header-actions {
    display: flex;
    gap: 12px;
}

.btn-update, .btn-install {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-update:hover, .btn-install:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.hidden {
    display: none !important;
}

/* ========== NAV TABS SYSTEM ========== */
.navigation-tabs {
    display: flex;
    justify-content: space-around;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px;
    gap: 8px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-tab i {
    font-size: 18px;
}

.nav-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.02);
}

.nav-tab.active {
    color: white;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.tab-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeInTab 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== EXERCISE STYLE ========== */
.exercise-section {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    min-height: 380px;
}

.exercise-header {
    width: 100%;
    margin-bottom: 8px;
}

.exercise-progress-container {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.btn-icon-only {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.2s;
}

.btn-icon-only:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.15);
}

.exercise-progress-bar-bg {
    flex: 1;
    height: 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.exercise-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 6px;
    width: 0%;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#exercise-progress-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 32px;
    text-align: right;
}

.exercise-setup-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 0 16px;
    gap: 20px;
    animation: fadeInTab 0.3s ease-out;
}

.exercise-logo {
    font-size: 64px;
    filter: drop-shadow(0 8px 16px rgba(99, 102, 241, 0.25));
    animation: floatMascot 4s ease-in-out infinite;
}

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

.exercise-setup-screen h2 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, white, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.exercise-setup-screen p {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 440px;
    line-height: 1.6;
}

.exercise-mode-selectors {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    width: 100%;
    justify-content: center;
    max-width: 400px;
}

.exercise-mode-selectors button {
    flex: 1;
}

.exercise-game-screen {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    animation: fadeInTab 0.3s ease-out;
    padding-bottom: 80px; /* Margen para el banner de feedback */
}

.exercise-prompt {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.prompt-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prompt-bubble {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    padding: 16px 20px;
    border-radius: 20px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.prompt-bubble::after {
    content: '';
    position: absolute;
    left: 28px;
    top: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid rgba(255, 255, 255, 0.08);
}

.mascot-avatar {
    font-size: 32px;
}

.prompt-text {
    font-size: 17px;
    font-weight: 600;
    color: white;
}

/* Slots area */
.slots-area {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    min-height: 80px;
    padding: 14px;
    position: relative;
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.slots-area.active {
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.02);
}

.slots-label {
    position: absolute;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    text-align: center;
    width: 100%;
    padding: 0 16px;
    transition: opacity 0.2s;
}

.slots-container, .words-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    z-index: 2;
}

.words-area {
    margin-top: 12px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

/* Fichas de palabras */
.word-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: white;
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.word-chip:hover {
    background: rgba(255, 255, 255, 0.09);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.1);
}

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

.word-chip.used {
    opacity: 0.12;
    pointer-events: none;
    transform: scale(0.95);
    box-shadow: none;
}

.exercise-actions {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

/* Banner de feedback Duolingo-style */
.feedback-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 32px;
    z-index: 100;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    animation: slideUpBanner 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.feedback-banner.correct {
    background: rgba(16, 185, 129, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(16, 185, 129, 0.3);
}

.feedback-banner.incorrect {
    background: rgba(239, 68, 68, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(239, 68, 68, 0.3);
}

.feedback-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 16px;
}

.feedback-message {
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
    text-align: left;
}

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

.feedback-text strong {
    display: block;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}

.feedback-text span {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 500;
}

.feedback-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-listen-exercise {
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    width: 44px;
    height: 44px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px !important;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-listen-exercise:hover {
    background: rgba(255, 255, 255, 0.25) !important;
}

.feedback-banner.correct .btn-record {
    background: white;
    color: var(--success);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.feedback-banner.correct .btn-record:hover {
    background: #f8fafc;
}

.feedback-banner.incorrect .btn-record {
    background: white;
    color: var(--danger);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.feedback-banner.incorrect .btn-record:hover {
    background: #f8fafc;
}

/* ========== PROGRESS & GAMIFICATION STYLE ========== */
.progress-section {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Tarjeta Perfil */
.profile-header-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
}

.profile-avatar-container {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
}

.profile-avatar {
    font-size: 32px;
}

.profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.profile-info h2 {
    font-size: 19px;
    font-weight: 700;
    color: white;
}

.xp-range {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.xp-progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
    border: 1px solid var(--border);
}

.xp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Grilla Estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
}

.stat-icon {
    font-size: 20px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.streak { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.stat-icon.xp { background: rgba(251, 191, 36, 0.1); color: #fbbf24; }
.stat-icon.exercises { background: rgba(139, 92, 246, 0.1); color: var(--secondary); }
.stat-icon.practices { background: rgba(99, 102, 241, 0.1); color: var(--primary); }

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

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Logros / Medallas */
.achievements-section {
    text-align: left;
}

.achievements-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.achievements-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.achievement-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px 20px;
    transition: all 0.25s ease;
}

.achievement-card.locked {
    opacity: 0.45;
}

.achievement-card:not(.locked) {
    border-color: rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.03);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.05);
}

.achievement-icon {
    font-size: 26px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.achievement-card.locked .achievement-icon {
    filter: grayscale(1);
}

.achievement-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.achievement-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: white;
}

.achievement-info p {
    font-size: 13px;
    color: var(--text-muted);
}

.achievement-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.achievement-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 3px;
    overflow: hidden;
}

.achievement-progress-fill {
    height: 100%;
    background: var(--text-muted);
    border-radius: 3px;
    width: 0%;
    transition: width 0.35s ease-out;
}

.achievement-card:not(.locked) .achievement-progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.achievement-progress-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 32px;
    text-align: right;
}

/* ========== RESPONSIVE RULES ========== */
@media (max-width: 600px) {
    .app {
        padding: 16px 12px;
    }
    
    .navigation-tabs {
        border-radius: 16px;
    }
    
    .nav-tab {
        padding: 10px 4px;
        font-size: 11px;
    }
    
    .nav-tab i {
        font-size: 16px;
    }
    
    .recorder-section, .history-section, .exercise-section, .progress-section {
        padding: 20px;
    }
    
    .exercise-mode-selectors {
        flex-direction: column;
        width: 100%;
    }
    
    .controls-recorder {
        flex-direction: column;
        width: 100%;
    }
    .btn-record, .btn-playback {
        width: 100%;
        justify-content: center;
    }
    .history-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .history-item-meta {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .feedback-banner {
        padding: 16px 20px;
    }
    
    .feedback-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .feedback-actions {
        margin-top: 12px;
        justify-content: flex-end;
    }
    
    .feedback-actions button {
        flex: 1;
    }
}
/* ============================================================
   NUEVOS ESTILOS v1.3.0 (de Christiam)
   ============================================================ */

/* Botón engranaje (Settings) en el header */
#btn-settings {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#btn-settings:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transform: rotate(45deg);
}

/* Botón "Escuchar grabación" (Playback) junto al de Grabar */
.btn-playback {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 16px 24px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

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

.btn-playback:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Animación shake al fallar un ejercicio */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

.exercise-section.shake {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* Botón "Saltar" ejercicio */
.exercise-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.exercise-actions .btn-action {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.exercise-actions .btn-action:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

/* Grid de 4 stats en pestaña Progreso (en lugar de 3) */
.stats-grid {
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================================
   NUEVOS ESTILOS v1.4.0: SRS, LIGAS, MODO ESCUCHA
   ============================================================ */

/* ===== PANTALLA MODO ESCUCHA (LISTENING) ===== */
.listening-game-screen {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeInTab 0.3s ease-out;
}

.listening-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.listening-prompt .prompt-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 8px;
}

.btn-listening-replay {
    align-self: flex-start;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
    transition: all 0.2s;
}

.btn-listening-replay:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}

.btn-listening-replay:active {
    transform: scale(0.97);
}

.listening-input-area {
    width: 100%;
}

#listening-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: white;
    font-size: 17px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

#listening-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

#listening-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#listening-input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.listening-feedback {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 14px;
    animation: fadeInTab 0.3s ease-out;
}

.listening-feedback.correct {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.listening-feedback.incorrect {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.listening-feedback-icon {
    font-size: 28px;
    line-height: 1;
}

.listening-feedback-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.listening-feedback-content strong {
    font-size: 16px;
    color: white;
}

.listening-feedback-content span {
    font-size: 14px;
    color: var(--text-muted);
}

.listening-feedback-answer {
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 15px;
    color: #fbbf24;
    font-weight: 500;
}

/* ===== SECCIÓN LIGA SEMANAL ===== */
.league-section {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
}

.league-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.league-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, 
        color-mix(in srgb, var(--tier-color, #6366f1) 25%, transparent), 
        rgba(0, 0, 0, 0.3));
    border: 1px solid color-mix(in srgb, var(--tier-color, #6366f1) 40%, transparent);
    border-radius: 16px;
    margin-bottom: 12px;
}

.league-tier-badge {
    font-size: 40px;
    line-height: 1;
    filter: drop-shadow(0 4px 8px color-mix(in srgb, var(--tier-color, #6366f1) 40%, transparent));
}

.league-tier-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.league-tier-info h3 {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
}

.league-position {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.league-days-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    min-width: 60px;
}

.league-days-left small {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.league-days-left strong {
    font-size: 22px;
    color: white;
    font-weight: 700;
}

.league-status {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    margin-bottom: 14px;
}

.league-status.promo {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.league-status.demo {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.league-status.safe {
    background: rgba(99, 102, 241, 0.08);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.league-standings {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.league-row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    border-radius: 10px;
    transition: all 0.2s;
}

.league-row.me {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.league-row.top3 {
    border-color: rgba(255, 215, 0, 0.2);
}

.league-row.bottom3 {
    opacity: 0.65;
}

.league-rank {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}

.league-row.top3 .league-rank {
    font-size: 22px;
}

.league-name {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
}

.league-row.me .league-name {
    color: white;
    font-weight: 700;
}

.league-xp {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.league-row.me .league-xp {
    color: #a5b4fc;
}

/* ===== SECCIÓN REPETICIÓN ESPACIADA (SRS) ===== */
.srs-section {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
}

.srs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .srs-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.srs-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.srs-column-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.srs-count {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.srs-word-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.srs-word-list::-webkit-scrollbar {
    width: 6px;
}

.srs-word-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.srs-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}

.srs-word-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s;
}

.srs-word-card.hard {
    border-left: 3px solid #ef4444;
}

.srs-word-card.mastered {
    border-left: 3px solid #10b981;
    background: rgba(16, 185, 129, 0.06);
}

.srs-word {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.srs-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.srs-mastery {
    font-size: 11px;
    letter-spacing: 1px;
}

.srs-mastery.mastery-0 { color: #6b7280; }
.srs-mastery.mastery-1 { color: #ef4444; }
.srs-mastery.mastery-2 { color: #f97316; }
.srs-mastery.mastery-3 { color: #eab308; }
.srs-mastery.mastery-4 { color: #84cc16; }
.srs-mastery.mastery-5 { color: #10b981; }

.srs-detail {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== HINT DE EJERCICIOS ===== */
.exercise-hint {
    margin-top: 18px;
    padding: 14px 16px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    text-align: left;
    max-width: 460px;
}

.exercise-hint i {
    color: #fbbf24;
    margin-right: 4px;
}

.exercise-hint strong {
    color: var(--text-main);
}

/* ===== RESPONSIVE: 3 botones en selección de ejercicios ===== */
.exercise-mode-selectors {
    flex-wrap: wrap;
}

.exercise-mode-selectors button {
    flex: 1 1 200px;
}


/* ============================================================
   NUEVOS ESTILOS v1.5.0: DESAFÍO DIARIO, CATEGORÍAS, TORMENTA
   ============================================================ */

/* ===== DESAFÍO DIARIO ===== */
.daily-challenge-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.15), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(250, 204, 21, 0.3);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}

.daily-challenge-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(250, 204, 21, 0.2);
    border-color: rgba(250, 204, 21, 0.5);
}

.daily-challenge-card.completed {
    background: rgba(0, 0, 0, 0.2);
    border-color: var(--border);
    opacity: 0.7;
}

.daily-icon {
    font-size: 36px;
    filter: drop-shadow(0 4px 8px rgba(250, 204, 21, 0.3));
    animation: floatMascot 3s ease-in-out infinite;
}

.daily-info-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.daily-info-block strong {
    font-size: 16px;
    color: white;
    font-weight: 700;
}

.daily-info-block small {
    font-size: 12px;
    color: var(--text-muted);
}

.daily-info-block small.completed {
    color: #fbbf24;
    font-weight: 600;
}

.daily-arrow {
    color: var(--text-muted);
    font-size: 14px;
    transition: transform 0.2s;
}

.daily-challenge-card:hover .daily-arrow {
    transform: translateX(4px);
    color: #fbbf24;
}

/* ===== SELECTOR DE CATEGORÍAS ===== */
.category-section {
    margin-top: 20px;
    width: 100%;
}

.category-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.category-chip {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.category-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.category-chip.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.15));
    border-color: rgba(99, 102, 241, 0.5);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.category-chip .cat-emoji {
    font-size: 14px;
}

/* ===== MODO TORMENTA ===== */
.storm-game-screen {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeInTab 0.3s ease-out;
}

.storm-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(0, 0, 0, 0.3));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.storm-header {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 14px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    border: 1px solid var(--border);
}

.storm-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.storm-stat small {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.storm-stat strong {
    font-size: 22px;
    color: white;
    font-weight: 700;
}

.storm-timer.ok { color: #10b981; }
.storm-timer.warning { color: #fbbf24; }
.storm-timer.danger {
    color: #ef4444;
    animation: pulse 1s infinite;
}

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

.storm-prompt {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 14px;
}

.storm-prompt .prompt-title {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 12px;
}

.storm-phrase {
    font-size: 28px;
    font-weight: 700;
    color: white;
    line-height: 1.3;
}

.storm-input-area {
    display: flex;
    gap: 10px;
}

#storm-input {
    flex: 1;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#storm-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.storm-input-area .btn-record {
    padding: 14px 18px;
    min-width: 50px;
}

.storm-feedback {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    animation: fadeInTab 0.3s ease-out;
}

.storm-feedback.correct {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.storm-feedback.incorrect {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.storm-feedback small {
    color: var(--text-muted);
}

.storm-quit {
    align-self: center;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.storm-quit:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ===== BOTÓN TORMENTA destacado ===== */
.storm-btn {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(99, 102, 241, 0.1)) !important;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
}

.storm-btn:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(99, 102, 241, 0.2)) !important;
    border-color: rgba(168, 85, 247, 0.5) !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .storm-header {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .storm-phrase {
        font-size: 22px;
    }
    .storm-input-area {
        flex-direction: column;
    }
    .storm-input-area .btn-record {
        width: 100%;
    }
}


/* ============================================================
   NUEVOS ESTILOS v1.6.0: TRACKER, MASCOT, REVIEW
   ============================================================ */

/* ===== SECCIÓN TIEMPO DE PRÁCTICA (TRACKER) ===== */
.tracker-section {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
}

.tracker-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tracker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .tracker-grid {
        grid-template-columns: 1fr;
    }
}

.tracker-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: all 0.2s;
}

.tracker-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.tracker-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    color: var(--primary);
    font-size: 16px;
    flex-shrink: 0;
}

.tracker-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tracker-value {
    font-size: 18px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

.tracker-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== MASCOTA FLOTANTE ===== */
.mascot-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: floatMascot 4s ease-in-out infinite;
    user-select: none;
}

.mascot-bubble:hover {
    transform: scale(1.1);
}

.mascot-emoji {
    font-size: 32px;
    line-height: 1;
    transition: transform 0.3s;
}

.mascot-bubble.happy {
    background: linear-gradient(135deg, #10b981, #34d399);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5), 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.mascot-bubble.happy .mascot-emoji {
    animation: bounce 0.6s ease-in-out;
}

.mascot-bubble.sad {
    background: linear-gradient(135deg, #ef4444, #f87171);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.mascot-bubble.sad .mascot-emoji {
    animation: shake-head 0.5s ease-in-out;
}

.mascot-bubble.celebrate {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 8px 24px rgba(250, 204, 21, 0.6), 0 0 0 3px rgba(255, 255, 255, 0.2);
    animation: celebrate 0.8s ease-in-out;
}

.mascot-bubble.sleeping {
    background: linear-gradient(135deg, #4b5563, #6b7280);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: floatMascot 6s ease-in-out infinite;
}

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

@keyframes shake-head {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

@keyframes celebrate {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-10deg); }
    50% { transform: scale(1.3) rotate(10deg); }
    75% { transform: scale(1.2) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.mascot-speech {
    position: fixed;
    bottom: 88px;
    right: 20px;
    background: white;
    color: #1f2937;
    padding: 10px 16px;
    border-radius: 16px 16px 4px 16px;
    font-size: 13px;
    font-weight: 600;
    max-width: 200px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(10px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 101;
}

.mascot-speech.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.mascot-speech::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

@media (max-width: 600px) {
    .mascot-bubble {
        width: 50px;
        height: 50px;
        bottom: 16px;
        right: 16px;
    }
    .mascot-emoji {
        font-size: 26px;
    }
    .mascot-speech {
        bottom: 74px;
        right: 16px;
        max-width: 160px;
        font-size: 12px;
    }
}

/* ===== BOTÓN MODO REPASO ===== */
.review-btn {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(99, 102, 241, 0.1)) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.review-btn:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(99, 102, 241, 0.2)) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
}

/* ===== ACHIEVEMENTS TOTAL BADGE ===== */
.achievements-total {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    margin-left: 4px;
}


/* ============================================================
   NUEVOS ESTILOS v1.7.0: BINGO, STATS_CHART, BACKUP, REMINDERS
   ============================================================ */

/* ===== MODO BINGO AUDITIVO ===== */
.bingo-game-screen {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeInTab 0.3s ease-out;
}

.bingo-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.bingo-prompt .prompt-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 8px;
}

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

@media (max-width: 600px) {
    .bingo-options {
        grid-template-columns: 1fr;
    }
}

.bingo-option {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    border: 2px solid var(--border);
    padding: 16px 18px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    min-height: 56px;
    display: flex;
    align-items: center;
}

.bingo-option:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.bingo-option:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.bingo-option.correct {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #34d399;
    opacity: 1;
}

.bingo-option.incorrect {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #f87171;
    opacity: 1;
}

.bingo-feedback {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 14px;
    animation: fadeInTab 0.3s ease-out;
}

.bingo-feedback.correct {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.bingo-feedback.incorrect {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.bingo-feedback-icon {
    font-size: 28px;
    line-height: 1;
}

.bingo-feedback-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bingo-feedback-content strong {
    font-size: 16px;
    color: white;
}

.bingo-feedback-content span {
    font-size: 14px;
    color: var(--text-muted);
}

/* Botón Bingo en selector de modos */
.bingo-btn {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(217, 70, 239, 0.1)) !important;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
}

.bingo-btn:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(217, 70, 239, 0.2)) !important;
    border-color: rgba(168, 85, 247, 0.5) !important;
}

/* ===== GRÁFICO XP SEMANAL ===== */
.stats-chart-section {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
}

.stats-chart-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.chart-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.chart-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.chart-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 160px;
    gap: 6px;
    padding: 12px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar-value {
    font-size: 11px;
    color: var(--text-main);
    font-weight: 700;
    min-height: 14px;
}

.chart-bar-bg {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px 6px 0 0;
    overflow: hidden;
}

.chart-bar {
    width: 100%;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 6px 6px 0 0;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 2px;
}

.chart-bar.today {
    background: linear-gradient(180deg, #fbbf24, #f59e0b);
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.4);
}

.chart-bar.empty {
    background: rgba(255, 255, 255, 0.05);
}

.chart-bar-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.chart-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.chart-legend-today,
.chart-legend-other {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 4px;
}

.chart-legend-today {
    background: linear-gradient(180deg, #fbbf24, #f59e0b);
}

.chart-legend-other {
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}

/* ===== SECCIÓN RECORDATORIOS ===== */
.reminders-section {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
}

.reminders-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reminders-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.reminders-info p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

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

.reminders-controls label {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
}

#reminder-time {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 14px;
}

#reminder-time:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#btn-toggle-reminder.active {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.reminder-status {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.reminder-status.enabled {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.reminder-status.disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* ===== SECCIÓN BACKUP ===== */
.backup-section {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
}

.backup-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.backup-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.5;
}

.backup-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.backup-buttons .btn-action {
    flex: 1;
    min-width: 120px;
    justify-content: center;
}


/* ============================================================
   NUEVOS ESTILOS v1.8.0: MODO NINJA (Fruit Ninja style)
   ============================================================ */

/* Botón Ninja en selector de modos */
.ninja-btn {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(168, 85, 247, 0.12)) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.ninja-btn:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.28), rgba(168, 85, 247, 0.2)) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
}

/* === Selector de modo Ninja === */
.ninja-mode-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 30px 20px;
    animation: fadeInTab 0.3s ease-out;
}

.ninja-logo {
    font-size: 64px;
    filter: drop-shadow(0 4px 12px rgba(239, 68, 68, 0.3));
    animation: floatMascot 3s ease-in-out infinite;
}

.ninja-mode-selector h2 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, white, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ninja-mode-selector > p {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    max-width: 460px;
    line-height: 1.5;
}

.ninja-mode-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 500px;
    margin-top: 12px;
}

.ninja-mode-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
    color: var(--text-main);
}

.ninja-mode-card:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.15);
}

.ninja-mode-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.ninja-mode-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.ninja-mode-info strong {
    font-size: 16px;
    color: white;
    font-weight: 700;
}

.ninja-mode-info small {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* === Pantalla de juego Ninja === */
.ninja-game-screen {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: fadeInTab 0.3s ease-out;
}

.ninja-hud {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 14px;
    border: 1px solid var(--border);
}

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

.ninja-hud-stat small {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ninja-hud-stat strong {
    font-size: 20px;
    color: white;
    font-weight: 700;
}

.ninja-stat-value.ok { color: #10b981; }
.ninja-stat-value.warning { color: #fbbf24; }
.ninja-stat-value.danger {
    color: #ef4444;
    animation: pulse 1s infinite;
}

.ninja-target {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 16px;
    color: white;
    text-align: center;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ninja-target strong {
    color: #fbbf24;
    font-weight: 700;
    margin: 0 4px;
}

.ninja-canvas-wrapper {
    width: 100%;
    height: 400px;
    background: #0f0f1e;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid rgba(99, 102, 241, 0.3);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
    touch-action: none; /* importante para que el touch no scrollee */
}

#ninja-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

@media (max-width: 600px) {
    .ninja-hud {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .ninja-hud-stat strong {
        font-size: 18px;
    }
    .ninja-canvas-wrapper {
        height: 350px;
    }
    .ninja-mode-info small {
        font-size: 11px;
    }
}


/* === PARCHÉ v1.8.2: Botón Ninja SIEMPRE clickeable === */
/* === PARCHÉ v1.8.11: Botón Terminar más vistoso y centrado === */
/* === PARCHÉ v1.8.12: Texto más pequeño, sin icono X, mejor proporcionado === */
.ninja-controls-bar {
    position: relative;
    z-index: 10;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.ninja-quit-btn {
    /* Centrado y con ancho fijo para que se vea bien proporcionado */
    width: auto;
    min-width: 180px;
    margin: 0 auto;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    /* Área táctil más grande */
    min-height: 48px;
    padding: 12px 28px;
    /* PARCHÉ v1.8.12: texto más pequeño */
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    /* Color de fondo vistoso: rojo intenso con degradado */
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 30px !important;
    /* Sombra llamativa */
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ninja-quit-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 22px rgba(239, 68, 68, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.2) inset !important;
    background: linear-gradient(135deg, #f87171, #ef4444) !important;
}

.ninja-quit-btn:active {
    transform: translateY(0) scale(0.98);
}

/* PARCHÉ v1.8.12: ocultar el icono X (parece letra X) */
.ninja-quit-btn i {
    display: none;
}

.ninja-emergency-btn {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: 2px solid white;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    z-index: 20;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);
    animation: pulse 1s infinite;
}

.ninja-emergency-btn.hidden {
    display: none;
}

/* Asegurar que el canvas NO capture eventos fuera de su área */
.ninja-canvas-wrapper {
    position: relative;
    isolation: isolate;
}

/* === PARCHÉ v1.8.10: Botón "Volver al menú" después de terminar === */
.ninja-back-after-end-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 16px 32px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: 2px solid white;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    z-index: 25;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5);
    font-family: inherit;
    transition: transform 0.2s;
}

.ninja-back-after-end-btn:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.ninja-back-after-end-btn.hidden {
    display: none;
}
