:root {
    --azul-oscuro: #060d1a;
    --azul-medio: #14294a;
    --azul-brillo: #3f6fb0;
    --azul-claro: #7aa6dd;
    --acero: #b9c6d6;
    --blanco: #ffffff;
    --texto-claro: #eef3f9;
    --texto-gris: #aab7c9;
}

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

html, body {
    min-height: 100%;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--texto-claro);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #060d1a url('fondo_bp.webp') center center / cover no-repeat fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(3,8,16,0.55) 0%, rgba(3,8,16,0.75) 100%);
    z-index: 0;
}

header, main, footer {
    position: relative;
    z-index: 1;
}

header {
    padding: 2.5rem 1rem 1.5rem;
    text-align: center;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.4rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

header p {
    color: var(--texto-gris);
    font-size: 0.95rem;
}

main {
    flex: 1;
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem 1.25rem 2rem;
    width: 100%;
}

.cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
    background: linear-gradient(155deg, var(--azul-medio) 0%, #0c1930 100%);
    border: 1px solid rgba(122, 166, 221, 0.25);
    padding: 1.75rem 1rem;
    min-height: 160px;
    border-radius: 18px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.05);
    text-decoration: none;
    color: var(--texto-claro);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    font-family: inherit;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 26px rgba(0,0,0,0.55);
    border-color: rgba(122, 166, 221, 0.6);
}

.card:active {
    transform: scale(0.97);
}

.card-icon {
    font-size: 2.3rem;
    width: 62px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, var(--azul-claro) 0%, var(--azul-brillo) 55%, var(--azul-medio) 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}

.card h2 {
    font-size: 1.1rem;
}

.card p {
    color: var(--texto-gris);
    font-size: 0.85rem;
    line-height: 1.4;
}

.card-download {
    background: linear-gradient(155deg, var(--azul-brillo) 0%, #16345c 100%);
    border-color: rgba(122, 166, 221, 0.55);
    min-height: 130px;
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    padding: 1.5rem 1.75rem;
    gap: 1rem;
}

.card-download-main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-width: 0;
}

.card-download .card-icon {
    background: radial-gradient(circle at 35% 30%, #ffffff 0%, var(--acero) 55%, var(--azul-brillo) 100%);
    flex-shrink: 0;
}

.card-download h2 {
    font-size: 1.3rem;
}

.card-download p {
    color: rgba(238, 243, 249, 0.85);
}

.download-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    border-radius: 14px;
    background: rgba(3, 8, 16, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.download-count .count-number {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1;
    color: var(--blanco);
    text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

.download-count .count-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(238, 243, 249, 0.8);
    margin-top: 0.15rem;
}

.card-download.disabled {
    opacity: 0.55;
    pointer-events: none;
    filter: grayscale(0.5);
}

footer {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--texto-gris);
    font-size: 0.85rem;
}

/* Panel informativo (en el flujo normal de la pagina, sin scroll interno,
   para que funcione en el navegador de Downloader / Fire TV) */
.info-panel {
    background: var(--azul-oscuro);
    border: 1px solid rgba(122, 166, 221, 0.3);
    border-radius: 18px;
    padding: 1.75rem;
    margin-top: 1.25rem;
}

.info-panel[hidden] {
    display: none;
}

.info-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.info-panel-header h2 {
    color: var(--azul-claro);
    font-size: 1.3rem;
}

.info-panel-close {
    background: var(--azul-medio);
    border: 1px solid rgba(122, 166, 221, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--texto-claro);
    font-family: inherit;
}

.info-panel-body h3 {
    color: var(--azul-claro);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.info-panel-body h3:first-child {
    margin-top: 0;
}

.info-panel-body ul, .info-panel-body ol {
    margin-left: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.info-panel-body li {
    margin-bottom: 0.35rem;
}

.info-panel-body p {
    line-height: 1.6;
    margin-bottom: 0.75rem;
    color: var(--texto-claro);
}

.info-panel-body .aviso {
    background: rgba(255, 193, 7, 0.12);
    border-left: 4px solid #ffc107;
    padding: 0.85rem 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.info-panel-body .ok {
    background: rgba(122, 166, 221, 0.15);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.25rem;
}

.info-panel-body a.btn-telegram {
    display: inline-block;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, var(--azul-brillo) 0%, var(--azul-claro) 100%);
    color: var(--blanco);
    text-decoration: none;
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
}

.info-panel-close-bottom {
    display: block;
    margin: 1.5rem auto 0;
    background: var(--azul-medio);
    border: 1px solid rgba(122, 166, 221, 0.4);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--texto-claro);
    font-family: inherit;
}

@media (max-width: 520px) {
    .cards {
        grid-template-columns: 1fr;
    }
    .card-download {
        flex-direction: row;
        padding: 1.25rem;
    }
    .card {
        padding: 1.5rem 1rem;
        min-height: 140px;
    }
    .download-count {
        padding: 0.4rem 0.75rem;
    }
    .download-count .count-number {
        font-size: 2.1rem;
    }
}

@media (max-width: 380px) {
    .card-download-main p {
        display: none;
    }
    .card-download .card-icon {
        width: 48px;
        height: 48px;
        font-size: 1.8rem;
    }
}
