/* Rules & Regulations modal — must live under body (see @stack modals) */

body.modal-open:has(#rulesRegulationModal.show) .modal-backdrop.show {
    opacity: 0.65 !important;
    background-color: rgba(15, 8, 30, 0.65) !important;
    pointer-events: auto !important;
}

#rulesRegulationModal {
    z-index: 1060 !important;
}

#rulesRegulationModal .rules-regulation-dialog {
    max-width: min(720px, 94vw);
    width: calc(100% - 2rem);
    height: calc(100vh - 2rem);
    max-height: calc(100vh - 2rem);
    margin: 1rem auto;
    display: flex;
    align-items: stretch;
}

#rulesRegulationModal .modal-content {
    width: 100%;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(20, 8, 40, 0.35);
}

#rulesRegulationModal .modal-header,
#rulesRegulationModal .modal-footer {
    flex-shrink: 0;
}

#rulesRegulationModal .modal-header {
    background: linear-gradient(135deg, #3d0f72 0%, #5a189a 100%);
    color: #fff;
    border-bottom: none;
}

#rulesRegulationModal .modal-title {
    font-weight: 700;
}

#rulesRegulationModal .btn-close {
    filter: invert(1);
    opacity: 0.85;
}

#rulesRegulationModal .modal-body.rules-regulation-body {
    overflow-y: auto !important;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    line-height: 1.65;
    color: #374151;
}

#rulesRegulationModal .modal-footer {
    border-top: 1px solid #eee;
}
