/* --- Estructura general de la página --- */

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #0f1115;
    color: #e8ecf1;
}

.contenedor {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.panel {
    width: 100%;
    max-width: 700px;
    background-color: #171b22;
    border: 1px solid #2a3240;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.etiqueta {
    margin: 0 0 12px;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    color: #7aa2ff;
}

h1 {
    margin: 0 0 12px;
    font-size: 2.2rem;
}

.subtitulo {
    margin: 0 0 24px;
    color: #b8c0cc;
}

.bloque {
    margin-top: 16px;
    padding: 16px;
    background-color: #0f141c;
    border-radius: 8px;
}

/* --- Bloque de estado y barra de sincronización --- */

.estado-bloque {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.estado-linea {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sync-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sync-bar {
    position: relative;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(122, 162, 255, 0.14);
}

.sync-bar-fill {
    position: absolute;
    top: 0;
    left: -35%;
    width: 35%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(122,162,255,0.15), rgba(122,162,255,0.95), rgba(122,162,255,0.15));
    box-shadow: 0 0 12px rgba(122, 162, 255, 0.45);
    animation: sync-slide 2.2s ease-in-out infinite;
}

.sync-text {
    margin: 0;
    font-size: 0.92rem;
    color: #9fb3d9;
    letter-spacing: 0.03em;
}

/* --- Contador circular --- */

.countdown-circles {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 22px;
    justify-items: center;
}

.time-circle {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    transform: rotate(-90deg);
    overflow: visible;
}

.ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.10);
    stroke-width: 8;
}

/* 
   Los anillos usan SVG con stroke-dasharray y stroke-dashoffset
   para simular el progreso visual de cada unidad de tiempo.
*/
.ring-progress {
    fill: none;
    stroke: #7aa2ff;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 0.8s ease, stroke 0.4s ease;
    filter: drop-shadow(0 0 6px rgba(122, 162, 255, 0.28));
}

.time-content {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.time-number {
    font-size: 2.3rem;
    font-weight: 700;
    color: #f4f7fb;
    line-height: 1;
    letter-spacing: 0.03em;
}

.time-label {
    font-size: 0.78rem;
    color: #9fb3d9;
    letter-spacing: 0.14em;
}

.days-ring {
    stroke: #7aa2ff;
}

.hours-ring {
    stroke: #72e6c8;
}

.minutes-ring {
    stroke: #b6ff6a;
}

.seconds-ring {
    stroke: #8de969;
}

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

    .time-circle {
        width: 125px;
        height: 125px;
    }

    .progress-ring {
        width: 125px;
        height: 125px;
    }

    .time-number {
        font-size: 2rem;
    }
}

@keyframes sync-slide {
    0% {
        left: -35%;
    }
    100% {
        left: 100%;
    }
}

/* --- Botones y acciones generales --- */

.acciones {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.boton-sistema,
.boton-secundario {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.boton-sistema {
    background-color: #7aa2ff;
    color: #0d1320;
    border: none;
}

.boton-sistema:hover {
    filter: brightness(1.08);
}

.boton-sistema:disabled {
    background-color: #3a4354;
    color: #9ea8ba;
    cursor: not-allowed;
}

.boton-secundario {
    background-color: transparent;
    color: #c8d3e4;
    border: 1px solid #2a3240;
}

.boton-secundario:hover {
    border-color: #7aa2ff;
    color: #ffffff;
}

.texto-secundario {
    margin: 8px 0 0;
    color: #9fb3d9;
    line-height: 1.5;
}

/* --- Tarjetas de retos --- */

.retos-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.reto-card {
    background-color: #0f141c;
    border: 1px solid #243043;
    border-radius: 12px;
    padding: 18px;
    transition: transform 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.reto-card:hover {
    transform: translateY(-2px);
}

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

.reto-id {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: #7aa2ff;
}

.reto-estado {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.reto-card h2 {
    margin: 0 0 10px;
    font-size: 1.25rem;
    color: #f5f8fc;
}

.reto-card p {
    margin: 0 0 12px;
    color: #c7d0de;
    line-height: 1.45;
}

.reto-fecha {
    font-size: 0.9rem;
    color: #96a7c4;
}

/* --- Estados visuales --- */

.reto-disponible {
    border-color: #7aa2ff;
    box-shadow: 0 0 18px rgba(122, 162, 255, 0.08);
}

.reto-disponible .reto-estado {
    color: #72e6c8;
}

.reto-bloqueado {
    opacity: 0.62;
    filter: grayscale(0.15);
}

.reto-bloqueado .reto-estado {
    color: #ffb86b;
}

.reto-completado {
    border-color: #72e6c8;
    box-shadow: 0 0 18px rgba(114, 230, 200, 0.10);
    opacity: 1;
}

.reto-completado .reto-estado {
    color: #72e6c8;
}

.boton-deshabilitado {
    pointer-events: none;
    background-color: #3a4354;
    color: #9ea8ba;
    cursor: not-allowed;
}