        :root {
            color-scheme: light dark;
            --bg: #0f172a;
            --panel: #1e293b;
            --accent: #38bdf8;
            --accent-strong: #0ea5e9;
            --text: #e2e8f0;
            --muted: #94a3b8;
            --success: #22c55e;
            --error: #ef4444;
        }

        * {
            box-sizing: border-box;
        }

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(circle at top, #1e3a8a 10%, #0f172a 70%);
    color: var(--text);
    min-height: 100vh;
}

.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

.auth-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-btn {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.auth-btn.primary {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.auth-btn:hover {
    background: rgba(56, 189, 248, 0.3);
    color: #f8fafc;
}

        .global-summary {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 12px;
            margin-bottom: 20px;
        }

        h1 {
            font-size: 2rem;
            margin-bottom: 12px;
            text-shadow: 0 10px 25px rgba(15, 23, 42, 0.9);
        }

        .subtitle {
            color: var(--muted);
            margin-bottom: 32px;
        }

        .layout {
            display: grid;
            grid-template-columns: minmax(0, 3fr) minmax(250px, 1fr);
            gap: 24px;
        }

        .card {
            background: rgba(15, 23, 42, 0.9);
            border: 1px solid rgba(148, 163, 184, 0.1);
            border-radius: 24px;
            padding: 24px;
            backdrop-filter: blur(16px);
            box-shadow: 0 20px 50px rgba(15, 23, 42, 0.5);
        }

        .text-display {
            min-height: 280px;
            line-height: 1.6;
            font-size: 1.15rem;
        }

        .text-display span {
            padding: 0 1px;
            border-radius: 6px;
            transition: background 0.1s ease, color 0.1s ease, box-shadow 0.1s ease;
        }

        .word-pending {
            color: rgba(255, 255, 255, 0.55); /* blanco apagado */
            text-shadow:
                0 0 1px rgba(255, 255, 255, 0.20),
                0 0 2px rgba(255, 255, 255, 0.10); /* brillo muy suave */
            font-weight: 500; /* un poco más ligero para un look más limpio */
        }

        .word-correct {
            color: rgba(34, 197, 94, 0.75); /* verde apagado */
            text-shadow:
                0 0 1px rgba(34, 197, 94, 0.25),
                0 0 2px rgba(34, 197, 94, 0.15);
            font-weight: 500;
        }

        .word-incorrect {
            color: rgba(239, 68, 68, 0.70); /* rojo apagado */
            text-decoration: line-through;
            text-decoration-color: rgba(239, 68, 68, 0.45);
            text-shadow:
                0 0 1px rgba(239, 68, 68, 0.25),
                0 0 2px rgba(239, 68, 68, 0.15);
            font-weight: 500;
        }
        .word-active-ok {
            background: rgba(34, 197, 94, 0.15); /* verde apagado */
            color: rgba(240, 255, 244, 0.85);    /* casi blanco con tinte verde */
            box-shadow:
                0 0 1px rgba(34, 197, 94, 0.25),
                0 0 3px rgba(34, 197, 94, 0.20);
            border-radius: 6px;
            font-weight: 500;
        }
        .word-active-error {
            background: rgba(239, 68, 68, 0.18); /* rojo apagado */
            color: rgba(255, 240, 240, 0.85);    /* blanco cálido apagado */
            box-shadow:
                0 0 1px rgba(239, 68, 68, 0.25),
                0 0 3px rgba(239, 68, 68, 0.18);
            border-radius: 6px;
            font-weight: 500;
        }

        .target-box {
            margin-top: 16px;
            padding: 16px;
            background: rgba(15, 23, 42, 0.6);
            border-radius: 16px;
            border: 1px solid rgba(148, 163, 184, 0.15);
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .word-input-shell {
            width: 100%;
            border-radius: 16px;
            border: 1px solid rgba(148, 163, 184, 0.2);
            padding: 12px 16px;
            background: rgba(15, 23, 42, 0.85);
            display: flex;
            align-items: center;
        }

        .word-input-wrapper {
            position: relative;
            width: 100%;
            display: flex;
            justify-content: flex-start;
            align-items: center;
        }

        .word-input {
            width: 50%;
            flex: 0 0 50%;
            border: none;
            border-radius: 0;
            margin: 0;
            padding: 0;
            font-size: 1.4rem;
            background: transparent;
            color: var(--text);
            outline: none;
            resize: none;
            overflow: hidden;
            white-space: nowrap;
            line-height: 1.4;
            font-family: inherit;
            height: 2.4em;
        }

        .word-input::placeholder {
            color: rgba(226, 232, 240, 0.35);
        }

        .word-input:focus {
            border: none;
            box-shadow: none;
        }

        .control-card {
            margin-bottom: 16px;
            padding: 14px;
            border-radius: 14px;
            border: 1px solid rgba(148, 163, 184, 0.25);
            background: rgba(15, 23, 42, 0.65);
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .lang-buttons {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
        }

        .gradient-number {
            font-weight: 800;
            font-size: 2.4rem; /* ajusta según tu diseño */

            background: linear-gradient(
                90deg,
                #ff6b6b,
                #f8e71c,
                #5ffbf1,
                #7c3aed
            );
            background-size: 300%;

            /* Propiedad estándar → evita advertencias */
            background-clip: text;

            /* Chrome/Safari */
            -webkit-background-clip: text;

            /* Necesario para que el número se vea con el gradiente */
            color: transparent;
            -webkit-text-fill-color: transparent;

            animation: number-flow 5s linear infinite;
        }

        @keyframes number-flow {
            0% { background-position: 0% }
            100% { background-position: 300% }
        }

        .holo-text {
            background: linear-gradient(
                120deg,
                #a1c4fd,
                #c2e9fb,
                #fbc2eb,
                #a6c1ee
            );
            background-size: 200%;

            /* Propiedad estándar */
            background-clip: text;

            /* Compatibilidad Chrome/Safari */
            -webkit-background-clip: text;

            color: transparent;
            -webkit-text-fill-color: transparent;

            font-weight: 800;

            /* Brillo base */
            filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.35));

            /* Aquí va la magia */
            animation: holoFlicker 27s infinite ease-in-out;
        }

        @keyframes holoFlicker {

            /* === 0% → 20% (primeros 5s): FLICKER RÁPIDO INTENSO === */

            0%, 5% { 
                opacity: 1;
                filter: drop-shadow(0 0 6px rgba(255,255,255,0.35));
            }

            6% {
                opacity: 0.3;
                filter: drop-shadow(0 0 2px rgba(255,255,255,0.15));
            }

            /* Parpadeos pequeños súper rápidos → mismos timings que antes */
            7% { opacity: 1; }
            8% { opacity: 0.4; }
            9% { opacity: 1; }

            /* Mini apagón */
            12% { opacity: 0.15; }
            13% { opacity: 1; }

            /* Parpadeos rápidos */
            16% { opacity: 0.7; }
            17% { opacity: 1; }
            28% { opacity: 0.5; }
            39% { opacity: 1; }

            /* === 20% → 100% = NEÓN ESTABLE DURANTE 20s === */
            40%, 100% {
                opacity: 1;
                filter: drop-shadow(0 0 7px rgba(255,255,255,0.4));
            }
        }

        .number-neon {
            color: #38bdf8;
            text-shadow:
                0 0 6px #38bdf8,
                0 0 12px #0ea5e9,
                0 0 24px #0ea5e9;
            font-weight: 700;
        }
        
        .number-aurora {
            background: linear-gradient(
                120deg,
                #00c6ff,
                #0072ff,
                #ff6bcb,
                #ffb86c
            );
            background-size: 250%;

            /* Propiedad estándar → evita el warning */
            background-clip: text;

            /* Necesario para Chrome y Safari */
            -webkit-background-clip: text;

            /* Para que el texto sea transparente en todos los navegadores */
            color: transparent;
            -webkit-text-fill-color: transparent;

            animation: auroraMoveNumbers 6s ease-in-out infinite;
            font-weight: 800;
        }

        @keyframes auroraMoveNumbers {
            0% { background-position: 0%; }
            50% { background-position: 100%; }
            100% { background-position: 0%; }
        }

        .lang-btn {
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.2);
            background: rgba(148, 163, 184, 0.08);
            color: var(--text);
            width: 44px;
            height: 44px;
            padding: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
        }

        .lang-btn.active {
            background: rgba(56, 189, 248, 0.2);
            border-color: var(--accent);
        }

        .dataset-control {
            display: flex;
            flex-direction: column;
            gap: 4px;
            font-size: 0.9rem;
            color: var(--muted);
        }

        .dataset-control select {
            border-radius: 12px;
            border: 1px solid rgba(148, 163, 184, 0.2);
            background: rgba(15, 23, 42, 0.75);
            color: var(--text);
            padding: 10px 12px;
            font-size: 1rem;
        }

        .length-control {
            display: flex;
            flex-direction: column;
            gap: 4px;
            color: var(--muted);
            font-size: 0.95rem;
            min-width: 220px;
        }

        .length-control input[type="range"] {
            width: calc(100% - 20px);
            margin: 0 10px 0 4px;
            height: 6px;
            accent-color: var(--accent);
            border-radius: 999px;
            background: rgba(148, 163, 184, 0.3);
        }

        .buttons {
            margin-top: 4px;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 12px;
        }

        button {
            border: none;
            border-radius: 14px;
            padding: 14px 18px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        button.primary {
            background: linear-gradient(120deg, var(--accent-strong), #7c3aed);
            color: #f8fafc;
        }

        button.secondary {
            background: rgba(148, 163, 184, 0.2);
            color: var(--text);
        }

        button:hover {
            transform: translateY(-2px);
            color: #f8fafc;
            box-shadow: 0 10px 30px rgba(15, 23, 42, 0.4);
        }

        .flag-btn {
            margin-top: 10px;
            width: fit-content;
            background: rgba(239, 68, 68, 0.15);
            color: var(--error);
            font-size: 0.9rem;
            padding: 10px 14px;
            border-radius: 10px;
        }

        .flag-btn:hover {
            background: rgba(239, 68, 68, 0.3);
        }

        .extra-actions {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .fav-icon {
            background: transparent;
            padding: 6px;
            font-size: 1.2rem;
            color: rgba(253, 230, 138, 0.65); /* amarillo suave */
            line-height: 1;
            margin-top: 12px;
            cursor: pointer;
            border-radius: 50%; /* icono circular limpio */
            transition: 
                color 0.18s ease,
                border-color 0.18s ease,
                transform 0.18s ease;
            
            outline: none; /* quita el borde azul */
            -webkit-tap-highlight-color: transparent; /* Safari/iOS */
        }

        .fav-icon:hover {
            color: #fbbf24; /* amarillo vivo */
            border-color: #fbbf24;
            transform: scale(1.15);
        }

        .fav-icon:active {
            color: #fbbf24;/* más oscuro al click */
            border-color: #fbbf24;
            transform: scale(0.95); /* efecto “press” */
        }

        .fav-icon.saved {
            color: #fbbf24; /* tono más oscuro */
            border-color: #fbbf24;
        }

        .stats-grid {
            display: grid;
            gap: 16px;
        }

        .stat {
            padding: 12px 14px;
            border-radius: 16px;
            position: relative;
            background: rgba(15, 23, 42, 0.6);
            border: 1px solid rgba(148, 163, 184, 0.1);
            overflow: hidden;
        }

        .stat label {
            display: block;
            font-size: 0.85rem;
            letter-spacing: 0.05em;
            color: var(--muted);
        }

        .stat value {
            display: block;
            font-size: 1.8rem;
            font-weight: 700;
            margin-top: 4px;
            transition: color 0.2s ease;
        }

        .stat value.completed {
            color: var(--success);
        }

        .global-summary .stat {
            background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(14, 165, 233, 0.15));
            border: 1px solid rgba(56, 189, 248, 0.3);
        }

        .source {
            margin-top: 20px;
            color: var(--muted);
            font-size: 0.95rem;
        }

        .text-measure {
            position: absolute;
            visibility: hidden;
            pointer-events: none;
            white-space: pre;
            font-size: 1.4rem;
            font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
            font-weight: 400;
            line-height: 1.4;
        }

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