.rules-overlay {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    pointer-events: auto;
    justify-content: center;
    align-items: center;
}
.rules-scroll::-webkit-scrollbar {
    width: 4px;
}
.rules-scroll::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(15, 18, 45, 0.18);
}
.rules-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(180deg, #B2BDD4 0%, #9EB0CC 100%);
}
.rules-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(11, 15, 35, 0.80);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: auto;
    z-index: 0;
}
.rules-dialog {
    width: min(90vw, 520px);
    height: 516px;
    max-height: 70vh;

    display: flex;
    flex-direction: column;

    pointer-events: auto;
    border-radius: 18px;
    background: radial-gradient(100% 100% at 50% 0%, #A5AFDC 0%, #434F87 67.57%, #2E3866 100%);
    box-shadow: 0 0.7px 0 0 rgba(255, 255, 255, 0.55) inset,
    0 -1px 5px 0 rgba(210, 220, 239, 0.17) inset,
    0 2px 2px 0 rgba(1, 19, 42, 0.80);
    backdrop-filter: blur(20px);
    padding: 18px 10px 18px 20px;
}
.rules-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-right: 8px;
    scrollbar-gutter: stable;
}
#rules-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 28px;
    height: 28px;
    cursor: pointer;
}
.rules.title{
    background: linear-gradient(180deg, #1b213d 0%, #2C3560 32%, #2C3560 72%, #1f2646 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    font-family: var(--basic-font);
    font-size: 16px;
    font-style: normal;
    font-weight: 900;
    line-height: normal;
    position: relative;
    display: inline-block;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: visible;
    text-align: center;
}
.title::before {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    z-index: -1;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 -0.5px 0 rgba(36, 44, 79, 0.55), 0 0.5px 0 rgba(176, 187, 211, 0.85);
    filter: none;
    transform: none;
}
.rules-divider {
    width: 100%;
    height: 1px;
    margin: 8px 0;
    background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.00) 4.31%,
    rgba(255, 255, 255, 0.13) 49.04%,
    rgba(255, 255, 255, 0.00) 100%);
    flex: 0 0 auto;
    align-self: stretch;
}
#rules-overlay h3 {
    font-family: var(--basic-font);
    font-size: 15px;
    color: #FFF;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.50);
    font-weight: 800;
    line-height: 18px;
}
#rules-overlay p {
    font-family: var(--basic-font);
    color: #D3DBFF;
    text-align: justify;
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
}
.rules-scroll p strong {
    color: #fff;
    font-weight: 800;
}
.rules-dialog{
    position: relative;
}
.rules-scroll > h3:first-child{
    margin-top: 0;
}
.rules-scroll > :first-child{
    margin-top: 0;
}
#rules-overlay h4 {
    font-family: var(--basic-font);
    color: #D3DBFF;
    text-align: justify;
    font-size: 13px;
    font-weight: 800;
    line-height: 18px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.50);
}
.rules-dialog ul {
    list-style: none;
    margin: 8px 0 8px;
    padding: 0;
}
.rules-dialog li {
    display: grid;
    grid-template-columns: 16px 1fr;
    column-gap: 10px;
    align-items: start;
    margin: 10px 0;
}
.rules-dialog li::before {
    content: "•";
    line-height: 1;
    color: #D3DBFF;
    text-align: justify;
    font-size: 13px;
    margin-top: 2px;
}
.rules-dialog li > p {
    color: #D3DBFF;
    font-size: 13px;
    margin: 0;
}
.rules-dialog li p {
    line-height: 1.35;
    letter-spacing: .01em;
}
.rules-dialog h4 {
    margin: 12px 0 6px;
    font-size: 13px;
    font-weight: 900;
    color: #D3DBFF;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.50);
    letter-spacing: .05em;
}
.rules-dialog li strong {
    color: #ffffff;
    font-weight: 800;
}
#rules-close-btn {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    /*right: var(--console-pad-x);*/
    right: max(env(safe-area-inset-right), 2%);
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: radial-gradient(
            100% 100% at 50% 0%,
            #B7C9E9 0%,
            #92A6CA 57.77%,
            #717FA9 100%
    );
    place-items: center;
    pointer-events: auto;
}

#rules-close-btn .icon {
    width: 26px;
    height: 26px;
    position: absolute;
    z-index: 1;
    top: 53%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 0;
}

#rules-close-btn .x {
    position: absolute;
    inset: 0;
    width: 19px;
    height: 19px;
    margin: auto;
    display: block;
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.rules-menu-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
}

.rules-menu-text {
    flex: 1 1 auto;
    display: block;
}

.rules-menu-btn {
    width: 46px;
    height: 46px;
    min-width: 46px;
    flex: 0 0 46px;
    border: 0;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    position: relative;
    display: grid;
    place-items: center;
    pointer-events: none;
    -webkit-tap-highlight-color: transparent;
}

.rules-menu-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(
            100% 100% at 50% 0%,
            #B7C9E9 0%,
            #92A6CA 57.77%,
            #717FA9 100%
    );
    box-shadow:
            0 0.587px 0 0 rgba(255, 255, 255, 0.55) inset,
            0 1.676px 1.676px 0 rgba(0, 0, 0, 0.50);
}

.rules-menu-btn .icon {
    width: 26px;
    height: 26px;
    position: absolute;
    z-index: 1;
    top: 56%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.rules-menu-btn .burger {
    position: absolute;
    inset: 0;
    margin: auto;
    display: block;
}

.rules-dialog li {
    display: grid;
    grid-template-columns: 16px 1fr;
    column-gap: 10px;
}

.rules-dialog li::before {
    content: "•";
}

#fairness-seeds {
    display: inline-block;
    vertical-align: text-bottom;
    margin-top: 2px;
    margin-right: 4px;
}

.rules-menu-sublist {
    grid-column: 2 / -1;
    width: 100%;
    min-width: 0;
    margin: 8px 0 0;
}
.rules-menu-sublist > li::before {
    content: "";
    width: 5px;
    height: 5px;
    margin-top: 7px;
    background: #d3dbff;
    transform: rotate(45deg);
    border-radius: 2px;
}
