/* ====================
   POPUP REGOLE PRONOSTICI
   ==================== */

/* Overlay sfondo sfocato */
.rules-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 20px;
}

/* Container del popup */
.rules-popup {
    background: #111;
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    width: 95%;
    max-width: 700px;
    position: relative;
    animation: kickoffZoom 0.4s ease-out;
    font-family: 'Montserrat Alternates', sans-serif;
    margin: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* Header del popup */
.rules-popup-header {
    background: linear-gradient(135deg, rgba(207, 174, 112, 0.2) 0%, rgba(207, 174, 112, 0.05) 100%);
    border-bottom: 2px solid var(--primary-color);
    padding: 1.5rem 2rem;
    border-radius: 13px 13px 0 0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.rules-popup-header h2 {
    color: var(--primary-color);
    text-align: center;
    margin: 0;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.rules-popup-header svg {
    flex-shrink: 0;
}

/* Contenuto scrollabile */
.rules-popup-content {
    padding: 2rem 2.5rem;
    color: #fff;
    line-height: 1.8;
    overflow-y: auto;
    flex: 1;
}

/* Scrollbar personalizzata per il contenuto */
.rules-popup-content::-webkit-scrollbar {
    width: 8px;
}

.rules-popup-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.rules-popup-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.rules-popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(207, 174, 112, 0.8);
}

/* Stili per il testo delle regole */
.rules-popup-content h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(207, 174, 112, 0.3);
    padding-bottom: 0.5rem;
}

.rules-popup-content h3:first-child {
    margin-top: 0;
}

.rules-popup-content p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.rules-popup-content ul,
.rules-popup-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.rules-popup-content li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.rules-popup-content strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* Footer con pulsante chiusura */
.rules-popup-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 13px 13px;
    position: sticky;
    bottom: 0;
}

.rules-close-btn {
    background: var(--primary-color);
    border: none;
    padding: 14px;
    width: 100%;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    font-family: 'Montserrat Alternates', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 15px;
    transition: all 0.3s;
    color: #000;
    letter-spacing: 1px;
}

.rules-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(207, 174, 112, 0.5);
    background: rgba(207, 174, 112, 1);
}

/* Bottone X di chiusura in alto a destra */
.rules-close-x {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    position: absolute;
    top: 10px;
    right: 15px;
    color: var(--primary-color);
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s, color 0.2s;
    z-index: 2;
}

.rules-close-x:hover {
    color: #fff;
    transform: rotate(90deg);
}

/* Pulsante Regole nel navigatore - conforme agli altri */
.rules-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 80px;
    text-align: center;
    flex-shrink: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.rules-btn:hover {
    background: rgba(207, 174, 112, .2);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(207, 174, 112, .3);
}

/* Animazione kickoff */
@keyframes kickoffZoom {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Media query per dispositivi mobili */
@media (max-width: 720px) {
    .rules-popup {
        width: 98%;
        max-height: 95vh;
    }

    .rules-popup-header {
        padding: 1.2rem 1.5rem;
    }

    .rules-popup-header h2 {
        font-size: 1.2rem;
    }

    .rules-popup-content {
        padding: 1.5rem 1.5rem;
    }

    .rules-popup-content h3 {
        font-size: 1.1rem;
    }

    .rules-popup-content p,
    .rules-popup-content li {
        font-size: 0.9rem;
    }

    .rules-popup-footer {
        padding: 1.2rem 1.5rem;
    }

    .rules-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-width: 70px;
    }
}

@media (max-width: 600px) {
    .rules-popup-overlay {
        padding: 10px;
    }
}
