.rules-main {
    width:
        min(
            1384px,
            calc(100% - (clamp(20px, 2.8vw, 42px) * 2))
        );

    margin: 0 auto;
    padding: 18px 0 54px;
}


/* Hero */

.rules-hero {
    position: relative;

    min-height: 330px;

    display: flex;
    align-items: stretch;

    overflow: hidden;

    border:
        1px solid
        rgba(128, 73, 239, .22);
    border-radius: 15px;

    background:
        linear-gradient(
            135deg,
            #080c19 0%,
            #090d1b 48%,
            #0c1020 100%
        );

    box-shadow:
        0 24px 70px
        rgba(0, 0, 0, .22);
}

.rules-hero__copy {
    position: relative;
    z-index: 4;

    width: 58%;

    padding:
        clamp(34px, 4vw, 55px)
        clamp(28px, 4vw, 54px);
}

.rules-kicker {
    color: #9270cf;

    font-size: 8px;
    font-weight: 900;
    letter-spacing: 3.6px;
}

.rules-hero h1 {
    margin: 14px 0 0;

    color: #fff;

    font-size:
        clamp(38px, 5.2vw, 68px);

    line-height: .94;
    letter-spacing: -2.2px;
}

.rules-hero h1 strong {
    display: block;

    color: #a947ff;

    font-weight: inherit;
}

.rules-hero p {
    max-width: 610px;

    margin: 19px 0 0;

    color: #8b93aa;

    font-size: 11px;
    line-height: 1.7;
}

.rules-hero__meta {
    display: flex;
    align-items: center;
    gap: 22px;

    margin-top: 24px;

    color: #6d768d;

    font-size: 8px;
    font-weight: 750;
}

.rules-hero__meta span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.rules-hero__meta i {
    width: 6px;
    height: 6px;

    display: block;

    border-radius: 50%;

    background: #7b4ce5;

    box-shadow:
        0 0 12px
        rgba(123, 76, 229, .65);
}

.rules-hero__art {
    position: absolute;
    z-index: 1;

    top: 0;
    right: 0;
    bottom: 0;

    width: 52%;

    background:
        url("../images/home/rules-guard.jpg")
        right center / cover
        no-repeat;

    opacity: .82;
}

.rules-hero__art::after {
    content: "";

    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            90deg,
            #080c19 0%,
            rgba(8,12,25,.92) 13%,
            rgba(8,12,25,.50) 43%,
            rgba(8,12,25,.06) 100%
        );
}

.rules-hero__glow {
    position: absolute;
    z-index: 2;

    top: -35%;
    right: 8%;

    width: 360px;
    height: 360px;

    border-radius: 50%;

    pointer-events: none;

    background:
        rgba(110, 50, 225, .12);

    filter: blur(70px);
}


/* Content layout */

.rules-layout {
    display: grid;
    grid-template-columns:
        248px
        minmax(0, 1fr);
    gap: 13px;

    margin-top: 13px;

    align-items: start;
}

.rules-sidebar {
    position: sticky;
    top: 82px;

    overflow: hidden;

    border:
        1px solid
        rgba(255, 255, 255, .06);
    border-radius: 12px;

    background:
        linear-gradient(
            160deg,
            rgba(12, 16, 32, .92),
            rgba(7, 10, 21, .96)
        );
}

.rules-sidebar__head {
    padding: 18px 18px 15px;

    border-bottom:
        1px solid
        rgba(255, 255, 255, .05);
}

.rules-sidebar__head span {
    display: block;

    color: #66577d;

    font-size: 7px;
    font-weight: 900;
    letter-spacing: 1.7px;
}

.rules-sidebar__head strong {
    display: block;

    margin-top: 5px;

    color: #d5d8e4;

    font-size: 11px;
}

.rules-menu {
    display: grid;

    padding: 8px;
}

.rules-menu a {
    min-height: 44px;

    display: grid;
    grid-template-columns:
        30px
        minmax(0, 1fr);
    align-items: center;
    gap: 6px;

    padding: 0 10px;

    border:
        1px solid
        transparent;
    border-radius: 8px;

    color: #7b839a;

    font-size: 9px;
    font-weight: 750;

    transition:
        color .16s ease,
        border-color .16s ease,
        background .16s ease;
}

.rules-menu a:hover {
    color: #d4c4f0;

    border-color:
        rgba(144, 82, 250, .14);

    background:
        rgba(144, 82, 250, .045);
}

.rules-menu b {
    color: #6d4aa4;

    font-size: 8px;
    font-weight: 900;
}

.rules-sidebar__note {
    display: grid;
    grid-template-columns:
        28px minmax(0, 1fr);
    gap: 8px;

    margin: 8px;
    padding: 12px;

    border:
        1px solid
        rgba(153, 84, 255, .12);
    border-radius: 8px;

    background:
        rgba(153, 84, 255, .035);
}

.rules-sidebar__note > span {
    width: 25px;
    height: 25px;

    display: grid;
    place-items: center;

    border:
        1px solid
        rgba(153, 84, 255, .18);
    border-radius: 7px;

    color: #a66be6;

    font-size: 10px;
    font-weight: 900;
}

.rules-sidebar__note p {
    margin: 0;

    color: #696f85;

    font-size: 8px;
    line-height: 1.5;
}


/* Rule sections */

.rules-content {
    display: grid;
    gap: 10px;
}

.rule-section {
    scroll-margin-top: 92px;

    min-height: 198px;

    display: grid;
    grid-template-columns:
        58px
        minmax(0, 1fr);

    overflow: hidden;

    border:
        1px solid
        rgba(255, 255, 255, .06);
    border-radius: 12px;

    background:
        linear-gradient(
            145deg,
            rgba(12, 16, 33, .92),
            rgba(8, 11, 23, .95)
        );

    transition:
        border-color .16s ease,
        transform .16s ease;
}

.rule-section:hover {
    border-color:
        rgba(131, 76, 231, .17);
}

.rule-section__number {
    display: flex;
    justify-content: center;

    padding-top: 22px;

    border-right:
        1px solid
        rgba(255, 255, 255, .045);

    color: #624797;

    background:
        rgba(255, 255, 255, .008);

    font-size: 9px;
    font-weight: 900;
}

.rule-section__body {
    min-width: 0;

    padding: 21px 23px 22px;
}

.rule-section__body header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.rule-section__body header > div > span {
    color: #635373;

    font-size: 7px;
    font-weight: 900;
    letter-spacing: 1.4px;
}

.rule-section h2 {
    margin: 4px 0 0;

    color: #ebeef5;

    font-size: 16px;
}

.rule-section__icon {
    min-width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border:
        1px solid
        rgba(132, 77, 235, .20);
    border-radius: 9px;

    color: #a164f1;

    background:
        rgba(132, 77, 235, .045);

    font-size: 10px;
    font-weight: 900;
}

.rule-section > .rule-section__body > p {
    max-width: 790px;

    margin: 12px 0 0;

    color: #747d94;

    font-size: 9px;
    line-height: 1.65;
}

.rule-placeholder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    margin-top: 16px;
    padding: 13px 14px;

    border:
        1px dashed
        rgba(126, 78, 207, .16);
    border-radius: 8px;

    background:
        rgba(3, 5, 12, .26);
}

.rule-placeholder span {
    color: #686f83;

    font-size: 9px;
}

.rule-placeholder small {
    color: #50495c;

    font-size: 7px;
}

.rule-section--danger
.rule-section__icon {
    border-color:
        rgba(255, 89, 131, .18);

    color: #d86a87;

    background:
        rgba(255, 89, 131, .035);
}


/* Responsive */

@media (max-width: 980px) {
    .rules-hero__copy {
        width: 66%;
    }

    .rules-hero__art {
        width: 55%;
    }

    .rules-layout {
        grid-template-columns:
            210px
            minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .rules-main {
        width:
            calc(100% - 16px);

        padding-top: 10px;
    }

    .rules-hero {
        min-height: 390px;
    }

    .rules-hero__copy {
        width: 100%;
        padding: 30px 22px;
    }

    .rules-hero__art {
        width: 100%;

        opacity: .33;
    }

    .rules-hero__art::after {
        background:
            linear-gradient(
                90deg,
                rgba(8,12,25,.97),
                rgba(8,12,25,.75)
            );
    }

    .rules-hero__meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .rules-layout {
        grid-template-columns: 1fr;
    }

    .rules-sidebar {
        position: static;
    }

    .rules-menu {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .rule-section {
        grid-template-columns:
            44px
            minmax(0, 1fr);
    }

    .rule-section__body {
        padding: 18px;
    }

    .rule-placeholder {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 460px) {
    .rules-menu {
        grid-template-columns: 1fr;
    }

    .rules-hero h1 {
        font-size: 39px;
    }

    .rule-section {
        grid-template-columns: 1fr;
    }

    .rule-section__number {
        min-height: 32px;

        align-items: center;
        justify-content: flex-start;

        padding: 0 18px;

        border-right: 0;
        border-bottom:
            1px solid
            rgba(255,255,255,.045);
    }
}


/* Rules Manager v1 — real rule entries */
.rule-items {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.rule-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 9px;
    background: rgba(3,5,12,.27);
}

.rule-item__code {
    min-height: 32px;
    display: grid;
    place-items: center;
    align-self: start;
    border: 1px solid rgba(140,81,235,.18);
    border-radius: 7px;
    color: #a26cea;
    background: rgba(140,81,235,.04);
    font-size: 8px;
    font-weight: 900;
}

.rule-item__copy h3 {
    margin: 0 0 6px;
    color: #dfe3ec;
    font-size: 11px;
}

.rule-item__copy > p {
    margin: 0;
    color: #858da2;
    font-size: 9px;
    line-height: 1.7;
}

.rule-item__note {
    margin-top: 10px;
    padding: 8px 10px;
    border-left: 2px solid rgba(153,95,239,.38);
    color: #857b93;
    background: rgba(153,95,239,.035);
    font-size: 8px;
    line-height: 1.5;
}

.rule-item--warning {
    border-color: rgba(240,179,76,.13);
}
.rule-item--warning .rule-item__code {
    border-color: rgba(240,179,76,.22);
    color: #d6a655;
    background: rgba(240,179,76,.035);
}
.rule-item--danger {
    border-color: rgba(255,91,125,.15);
}
.rule-item--danger .rule-item__code {
    border-color: rgba(255,91,125,.24);
    color: #df748e;
    background: rgba(255,91,125,.035);
}
.rules-empty-public {
    padding: 34px;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    color: #737c93;
    background: rgba(12,16,33,.9);
    font-size: 10px;
}

@media (max-width: 520px) {
    .rule-item { grid-template-columns: 38px minmax(0, 1fr); padding: 11px; }
}
