.rules-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    display: none;
}

.rules-overlay.visible {
    display: flex;
    justify-content: center;
    align-items: center;
}

.rules-container {
    position: relative;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    max-width: 90%;
    max-height: 85%;
    width: 800px;
    overflow: hidden;
    z-index: 9999;
}

.rules-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ffffff;
    transition: background-color 0.2s;
    z-index: 10000;
}

.rules-close-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.rules-close-button:active {
    background-color: rgba(0, 0, 0, 0.9);
}

.rules-content {
    padding: 40px 60px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 70vh;
    font-family: 'Arial Black', 'Arial Bold', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
    color: #ffffff;
}

.rules-content::-webkit-scrollbar {
    width: 12px;
}

.rules-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.rules-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.rules-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.rules-content p {
    margin: 12px 0 16px 0;
}

.rules-content h2 {
    color: #FFD700;
    font-size: 20px;
    font-weight: 900;
    text-align: center;
    margin: 30px 0 20px 0;
    padding-top: 25px;
    border-top: 2px solid #FFD700;
}

.rules-content h2:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.rules-content h3 {
    color: #FFD700;
    font-size: 17px;
    font-weight: 900;
    text-align: center;
    margin: 20px 0 15px 0;
}

.rules-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
}

@media (max-width: 768px) {
    .rules-container {
        max-width: 95%;
        max-height: 90%;
        width: 95%;
    }

    .rules-content {
        padding: 20px 30px;
        max-height: 75vh;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .rules-content {
        padding: 15px 20px;
        font-size: 12px;
    }
}

.rules-content table {
    width: 100%;
    margin: 20px auto;
    border-collapse: collapse;
    table-layout: fixed;
}

.rules-content table tr {
    height: auto;
}

.rules-content table tr:last-child {
    border-bottom: none;
}

.rules-content table td.symbol-image {
    width: 25%;
    padding: 10px;
    text-align: center;
    vertical-align: middle;
    height: auto;
}

.rules-content table td.symbol-image img {
    height: auto;
    display: block;
    margin: 0 auto;
}

.rules-content table td.symbol-image img[src*="Dice6.png"] { width: 120px; height: 120px; }
.rules-content table td.symbol-image img[src*="Dice5.png"] { width: 120px; height: 120px; }
.rules-content table td.symbol-image img[src*="Dice4.png"] { width: 120px; height: 120px; }
.rules-content table td.symbol-image img[src*="Dice3.png"] { width: 120px; height: 120px; }
.rules-content table td.symbol-image img[src*="Dice2.png"] { width: 120px; height: 120px; }
.rules-content table td.symbol-image img[src*="Dice1.png"] { width: 120px; height: 120px; }

.rules-content table td.symbol-payouts {
    width: 35%;
    padding: 10px 15px;
    vertical-align: middle;
    height: auto;
}


.rules-content table td.symbol-payouts p {
    margin: 4px 0;
    color: #ffffff;
    font-weight: 700;
    font-size: 8pt;
    line-height: 1.3;
}
