/* assets/css/penales_desafio.css */
/* Estilos para el Desafío de Oro — Penales de Oro */

/* ─── Contenedor principal del desafío ─── */
.desafio-container {
    max-width: 1100px;
    margin: 0 auto;
}

.desafio-hero {
    text-align: center;
    margin-bottom: 2rem;
}

.desafio-hero h1 {
    font-family: "Russo One", sans-serif;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    color: #ffd54a;
    text-shadow: 0 4px 18px rgba(255, 213, 74, .35);
    margin: 0 0 .5rem;
}

.desafio-hero p {
    opacity: .7;
    margin: 0;
    font-size: 1rem;
}

/* ─── Grid de cartas de goleros ─── */
.desafio-cartas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 600px) {
    .desafio-cartas {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: .6rem;
    }
}

.desafio-card {
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: .8rem;
    text-align: center;
    transition: all .3s ease;
    position: relative;
    overflow: hidden;
}

.desafio-card.completada {
    border-color: rgba(46, 204, 113, .4);
    background: rgba(46, 204, 113, .08);
}

.desafio-card.completada.perdida {
    border-color: rgba(231, 76, 60, .4);
    background: rgba(231, 76, 60, .08);
}

.desafio-card.actual {
    border-color: #ffd54a;
    background: rgba(255, 213, 74, .1);
    box-shadow: 0 0 20px rgba(255, 213, 74, .2);
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 213, 74, .2); }
    50% { box-shadow: 0 0 30px rgba(255, 213, 74, .4); }
}

.desafio-card.bloqueada {
    opacity: .4;
    filter: grayscale(.8);
}

.card-foto-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto .6rem;
    position: relative;
    overflow: hidden;
    background: #1a1a2e;
    border: 2px solid var(--glass-border);
}

.desafio-card.actual .card-foto-wrap {
    border-color: #ffd54a;
}

.card-foto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter .4s ease, box-shadow .4s ease;
}

.desafio-card.completada .card-foto {
    filter: saturate(1.1) brightness(1.05);
}

.desafio-card.completada .card-foto-wrap {
    border-color: rgba(46, 204, 113, .6);
    box-shadow: 0 0 12px rgba(46, 204, 113, .3);
}

.card-deshabilitada {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: rgba(255, 255, 255, .3);
}

.card-info {
    font-size: .75rem;
}

.card-nombre {
    font-weight: 700;
    font-size: .8rem;
    margin-bottom: .2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-equipo {
    opacity: .6;
    font-size: .7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: .3rem;
}

.card-escudo {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.card-diff {
    display: flex;
    justify-content: center;
    gap: 1px;
}

.card-diff .star {
    color: #ffd54a;
    font-size: .65rem;
}

.card-diff .star.off {
    opacity: .25;
}

.card-resultado {
    margin-top: .5rem;
    font-size: .7rem;
    font-weight: 700;
    padding: .3rem .5rem;
    border-radius: 6px;
}

.card-resultado.ganada {
    background: rgba(46, 204, 113, .2);
    color: #2ecc71;
}

.card-resultado.perdida {
    background: rgba(231, 76, 60, .2);
    color: #e74c3c;
}

.card-actual-indicator {
    margin-top: .5rem;
    font-size: .7rem;
    font-weight: 700;
    color: #ffd54a;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* ─── Barra de progreso ─── */
.desafio-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, .08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: .5rem;
}

.desafio-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd54a, #f0b820);
    border-radius: 4px;
    transition: width .5s ease;
}

.desafio-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: .85rem;
    opacity: .7;
}

@media (max-width: 600px) {
    .desafio-progress-text {
        flex-direction: column;
        align-items: center;
        gap: .3rem;
    }
}

/* ─── Modal de transición ─── */
#desafio-transicion {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, .85);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
}

.transicion-content {
    background: #12122a;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.8rem 1.2rem;
    text-align: center;
    max-width: 420px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
}

@media (max-width: 480px) {
    .transicion-content {
        padding: 1.2rem .8rem;
        border-radius: 16px;
    }
}

.transicion-num {
    font-size: .85rem;
    opacity: .5;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.transicion-foto-wrap {
    position: relative;
    width: 160px;
    height: 110px;
    margin: 0 auto 1rem;
}

.transicion-foto {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    object-fit: cover;
    border: 3px solid #ffd54a;
    background: #1a1a2e;
    transition: border-color .4s ease, box-shadow .4s ease;
}

.transicion-foto.ya-derrotado {
    border-color: rgba(46, 204, 113, .7);
    box-shadow: 0 0 20px rgba(46, 204, 113, .3);
}

.transicion-escudo {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: #12122a;
    border-radius: 50%;
    padding: 4px;
    border: 2px solid var(--glass-border);
}

.transicion-nombre {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: .3rem;
}

.transicion-equipo {
    font-size: .95rem;
    opacity: .7;
    margin-bottom: .5rem;
}

.transicion-diff {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin-bottom: .8rem;
}

.transicion-diff .star {
    color: #ffd54a;
    font-size: 1rem;
}

.transicion-diff .star.off {
    opacity: .25;
}

.transicion-desc {
    font-size: .85rem;
    opacity: .6;
    line-height: 1.4;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.transicion-content .btn {
    padding: .8rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all .3s;
}

.transicion-content .btn:hover {
    transform: translateY(-2px);
}

/* ─── Resultado del golero ─── */
.transicion-resultado {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.transicion-resultado.ganado {
    color: #ffd54a;
    text-shadow: 0 4px 18px rgba(255, 213, 74, .4);
}

.transicion-resultado.perdido {
    color: #e74c3c;
    text-shadow: 0 4px 18px rgba(231, 76, 60, .4);
}

.transicion-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .8rem;
    margin: 1.5rem 0;
}

.transicion-stats div {
    background: rgba(255, 255, 255, .05);
    border-radius: 10px;
    padding: .8rem;
    font-size: .85rem;
    opacity: .8;
}

.transicion-stats strong {
    display: block;
    font-size: 1.3rem;
    color: var(--accent);
}

/* ─── Pantalla final ─── */
.transicion-final {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffd54a;
    margin-bottom: 1.5rem;
}

.transicion-resumen {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .8rem;
    margin-bottom: 1.5rem;
}

.resumen-item {
    background: rgba(255, 255, 255, .05);
    border-radius: 10px;
    padding: .8rem;
    font-size: .85rem;
    opacity: .8;
}

.resumen-item strong {
    display: block;
    font-size: 1.3rem;
    color: var(--accent);
}

.transicion-puntaje {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 213, 74, .1);
    border-radius: 12px;
    border: 1px solid rgba(255, 213, 74, .3);
}

.transicion-puntaje strong {
    color: #ffd54a;
    font-size: 1.8rem;
}

/* ─── Resumen horizontal de goleros (scrollable) ─── */
.goleros-resumen-scroll {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding: .3rem 0 .8rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,213,74,.3) transparent;
    margin: 0 -.5rem;
    padding-left: .5rem;
    padding-right: .5rem;
}

.goleros-resumen-scroll::-webkit-scrollbar {
    height: 4px;
}

.goleros-resumen-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.goleros-resumen-scroll::-webkit-scrollbar-thumb {
    background: rgba(255,213,74,.3);
    border-radius: 2px;
}

.golero-mini-card {
    flex: 0 0 auto;
    width: 64px;
    text-align: center;
    padding: .4rem .3rem;
    border-radius: 8px;
    scroll-snap-align: start;
    transition: all .3s;
}

.golero-mini-card.ganado {
    background: rgba(46,204,113,.1);
    border: 1px solid rgba(46,204,113,.3);
}

.golero-mini-card.pendiente {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    opacity: .45;
}

.golero-mini-card img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto .25rem;
    transition: filter .4s ease, border-color .4s ease;
    border: 2px solid transparent;
}

.golero-mini-card.ganado img {
    border-color: rgba(46, 204, 113, .6);
    filter: drop-shadow(0 0 4px rgba(46, 204, 113, .4));
}

.golero-mini-card.pendiente img {
    filter: grayscale(100%);
}

.golero-mini-card .nombre {
    font-size: .6rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.golero-mini-card .icono {
    font-size: .55rem;
    line-height: 1.2;
}

/* ─── Stats compactas en resumen ─── */
.transicion-resumen-compact {
    display: flex;
    gap: .4rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.transicion-resumen-compact .resumen-pill {
    background: rgba(255,255,255,.06);
    border-radius: 20px;
    padding: .35rem .7rem;
    font-size: .75rem;
    display: flex;
    align-items: center;
    gap: .3rem;
    white-space: nowrap;
}

.transicion-resumen-compact .resumen-pill strong {
    color: var(--accent);
    font-size: .9rem;
}

/* ─── Acciones horizontales ─── */
.transicion-actions {
    display: flex;
    flex-direction: row;
    gap: .6rem;
    justify-content: center;
    flex-wrap: wrap;
}

.transicion-actions .btn {
    padding: .8rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    text-align: center;
    transition: all .3s;
    color: white;
}

.transicion-actions .btn:hover {
    transform: translateY(-2px);
}

/* ─── Botón iniciar desafío ─── */
.desafio-start-btn {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 2rem auto;
    padding: 1.2rem 2rem;
    background: linear-gradient(135deg, #ffd54a, #f0b820);
    color: #0a0a14;
    border: none;
    border-radius: 14px;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    transition: all .3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.desafio-start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 213, 74, .35);
}

/* ─── Requiere login ─── */
.desafio-login-notice {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 213, 74, .08);
    border: 1px solid rgba(255, 213, 74, .3);
    border-radius: 14px;
    margin: 2rem 0;
}

.desafio-login-notice p {
    margin: 0 0 1rem;
    opacity: .8;
}

.desafio-login-notice .btn {
    display: inline-block;
    padding: .7rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: all .3s;
}

.desafio-login-notice .btn:hover {
    transform: translateY(-2px);
}

/* ─── Modo dentro del canvas ─── */
.penales-canvas-wrapper.desafio-mode {
    position: relative;
}

.desafio-hud {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

.desafio-hud-item {
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
    border-radius: 8px;
    padding: .4rem .8rem;
    font-size: .8rem;
    font-weight: 600;
    pointer-events: auto;
}

.desafio-hud-item strong {
    color: #ffd54a;
}
