.dungeon-rules-page {
    --rules-red: #e63946;
    --rules-red-bright: #ff6570;
    --rules-gold: #f0b84b;
    margin: 0 auto;
    max-width: 1180px;
    min-width: 0;
    padding: clamp(18px, 4vw, 44px) 20px 72px;
    width: 100%;
}

.dungeon-rules-hero {
    align-items: center;
    background:
        radial-gradient(circle at 78% 18%, rgba(230, 57, 70, .3), transparent 35%),
        linear-gradient(145deg, #1d1d20, #0e0e10 72%);
    border: 1px solid #3a3a40;
    border-top: 4px solid var(--rules-red);
    border-radius: 22px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .32);
    display: grid;
    gap: clamp(20px, 4vw, 48px);
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
    min-height: 500px;
    overflow: hidden;
    padding: clamp(30px, 6vw, 66px) clamp(24px, 5vw, 60px) 0;
    position: relative;
}

.dungeon-rules-hero::after {
    background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px);
    background-size: 18px 18px;
    content: '';
    inset: 0;
    mask-image: linear-gradient(90deg, #000, transparent 58%);
    opacity: .25;
    pointer-events: none;
    position: absolute;
}

.dungeon-rules-hero__copy,
.dungeon-rules-hero__art {
    position: relative;
    z-index: 1;
}
.dungeon-rules-hero__copy { min-width: 0; }

.dungeon-rules-kicker {
    align-items: center;
    color: #ff9ca4;
    display: inline-flex;
    font-size: .76rem;
    font-weight: 900;
    gap: 9px;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.dungeon-rules-kicker::before {
    background: var(--rules-red);
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(230, 57, 70, .15);
    content: '';
    height: 9px;
    width: 9px;
}

.dungeon-rules-hero h1 {
    color: #fff;
    font-size: clamp(2.7rem, 8vw, 5.9rem);
    letter-spacing: -.055em;
    line-height: .92;
    margin: 20px 0 22px;
    max-width: 680px;
}

.dungeon-rules-hero__intro {
    color: #c6c6cb;
    font-size: clamp(1rem, 2vw, 1.16rem);
    line-height: 1.62;
    margin: 0;
    max-width: 650px;
}

.dungeon-rules-hero__note {
    align-items: flex-start;
    background: rgba(255, 255, 255, .055);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    color: #aaaab0;
    display: flex;
    font-size: .86rem;
    gap: 10px;
    line-height: 1.5;
    margin: 24px 0 48px;
    padding: 13px 15px;
}

.dungeon-rules-hero__note i { color: var(--rules-red-bright); margin-top: 3px; }
.dungeon-rules-hero__art { align-self: end; display: flex; justify-content: center; }
.dungeon-rules-hero__art img { display: block; height: auto; max-height: 520px; max-width: 100%; object-fit: contain; }

.dungeon-rules-jump {
    align-items: center;
    background: #171719;
    border: 1px solid #35353a;
    border-radius: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    height: auto;
    justify-content: flex-start;
    margin: 22px 0;
    padding: 12px;
    position: static;
    top: auto;
    width: auto;
    z-index: auto;
}

.dungeon-rules-jump > span {
    color: #85858c;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .1em;
    padding: 7px 9px;
    text-transform: uppercase;
}

.dungeon-rules-jump a {
    background: #242427;
    border: 1px solid #404046;
    border-radius: 999px;
    color: #dddde0;
    font-size: .78rem;
    font-weight: 800;
    padding: 8px 12px;
    text-decoration: none;
}

.dungeon-rules-jump a:hover,
.dungeon-rules-jump a:focus-visible {
    border-color: var(--rules-red-bright);
    color: #fff;
    outline: none;
}

.dungeon-rules-priorities {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 22px;
}

.dungeon-rules-priority {
    background: linear-gradient(150deg, #222225, #171719);
    border: 1px solid #3b3b40;
    border-radius: 16px;
    padding: 21px;
}

.dungeon-rules-priority__icon { color: var(--rules-red-bright); font-size: 1.45rem; margin-bottom: 13px; }
.dungeon-rules-priority h2 { color: #fff; font-size: 1.18rem; margin: 0 0 7px; }
.dungeon-rules-priority p { color: #b7b7bc; font-size: .9rem; line-height: 1.55; margin: 0; }

.dungeon-rules-red {
    background: linear-gradient(135deg, #9f202b, #6f131c);
    border: 1px solid #e55763;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(120, 14, 23, .22);
    display: grid;
    gap: 18px;
    grid-template-columns: auto minmax(0, 1fr);
    margin: 0 0 22px;
    padding: clamp(22px, 4vw, 34px);
}

.dungeon-rules-red__word {
    align-items: center;
    background: #fff;
    border-radius: 12px;
    color: #8f1722;
    display: flex;
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    font-weight: 950;
    justify-content: center;
    letter-spacing: -.03em;
    min-height: 86px;
    min-width: 132px;
    padding: 12px 18px;
    text-transform: uppercase;
}

.dungeon-rules-red h2 { color: #fff; font-size: clamp(1.45rem, 4vw, 2rem); margin: 1px 0 7px; }
.dungeon-rules-red p { color: #ffe5e7; line-height: 1.55; margin: 0; }

.dungeon-rules-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dungeon-rules-card {
    background: #19191b;
    border: 1px solid #36363b;
    border-radius: 18px;
    box-shadow: 0 15px 38px rgba(0, 0, 0, .18);
    overflow: hidden;
    padding: clamp(22px, 4vw, 30px);
    scroll-margin-top: 92px;
}

.dungeon-rules-card--wide { grid-column: 1 / -1; }
.dungeon-rules-card--illustrated {
    align-content: start;
    align-items: start;
    display: grid;
    gap: clamp(12px, 2vw, 22px);
    grid-template-columns: minmax(0, 1.25fr) minmax(190px, .75fr);
}
.dungeon-rules-card--wide.dungeon-rules-card--illustrated { grid-template-columns: minmax(0, 1fr) minmax(280px, .42fr); }
.dungeon-rules-card--illustrated > .dungeon-rules-card__heading {
    grid-column: 1 / -1;
    margin-bottom: 0;
}
.dungeon-rules-card__content {
    min-width: 0;
}
.dungeon-rules-card__art {
    align-self: center;
    display: flex;
    justify-content: center;
    margin: 0;
    max-width: 290px;
    min-width: 0;
    position: relative;
    width: 100%;
}
.dungeon-rules-card__art--wide { max-width: 390px; }
.dungeon-rules-card__art::before {
    background: radial-gradient(circle, rgba(230, 57, 70, .2), transparent 68%);
    content: '';
    inset: 14% 2% 4%;
    pointer-events: none;
    position: absolute;
}
.dungeon-rules-card__art img {
    display: block;
    height: auto;
    max-height: 330px;
    object-fit: contain;
    position: relative;
    width: 100%;
}
.dungeon-rules-card__heading { align-items: center; display: flex; gap: 13px; margin-bottom: 18px; }
.dungeon-rules-card__heading i {
    align-items: center;
    background: rgba(230, 57, 70, .13);
    border: 1px solid rgba(230, 57, 70, .35);
    border-radius: 11px;
    color: var(--rules-red-bright);
    display: flex;
    flex: 0 0 auto;
    font-size: 1.15rem;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.dungeon-rules-card h2 { color: #fff; font-size: clamp(1.28rem, 3vw, 1.65rem); margin: 0; }
.dungeon-rules-list { list-style: none; margin: 0; padding: 0; }
.dungeon-rules-list li { color: #cacace; line-height: 1.62; padding: 0 0 15px 27px; position: relative; }
.dungeon-rules-list li:last-child { padding-bottom: 0; }
.dungeon-rules-list li::before {
    color: var(--rules-red-bright);
    content: '\2713';
    font-size: .82rem;
    font-weight: 900;
    left: 2px;
    position: absolute;
    top: 4px;
}

.dungeon-rules-list strong { color: #fff; }
.dungeon-rules-card__aside {
    background: #302610;
    border-left: 3px solid var(--rules-gold);
    color: #ffe5ad;
    line-height: 1.55;
    margin: 20px 0 0;
    padding: 14px 16px;
}

.dungeon-rules-closing {
    align-items: center;
    background: linear-gradient(135deg, #1d2348, #202750);
    border: 1px solid #4a568e;
    border-radius: 18px;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin-top: 22px;
    padding: clamp(24px, 4vw, 36px);
}

.dungeon-rules-closing h2 { color: #fff; font-size: clamp(1.35rem, 4vw, 1.9rem); margin: 0 0 8px; }
.dungeon-rules-closing p { color: #d9def4; line-height: 1.55; margin: 0; max-width: 700px; }
.dungeon-rules-closing__actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 9px; }
.dungeon-rules-button {
    align-items: center;
    background: var(--rules-red);
    border: 1px solid var(--rules-red);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: .86rem;
    font-weight: 900;
    gap: 8px;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    text-decoration: none;
}

.dungeon-rules-button--quiet { background: transparent; border-color: #7f89b9; }
.dungeon-rules-button:hover,
.dungeon-rules-button:focus-visible { background: var(--rules-red-bright); border-color: var(--rules-red-bright); color: #fff; outline: none; }
.dungeon-rules-button--quiet:hover,
.dungeon-rules-button--quiet:focus-visible { background: rgba(255, 255, 255, .1); border-color: #fff; }

html[data-theme="light"] .dungeon-rules-hero { background: radial-gradient(circle at 78% 18%, rgba(230, 57, 70, .16), transparent 35%), linear-gradient(145deg, #fff, #f2f4f7 72%); border-color: #cfd3d9; }
html[data-theme="light"] .dungeon-rules-hero h1 { color: #1d2025; }
html[data-theme="light"] .dungeon-rules-hero__intro { color: #4e535b; }
html[data-theme="light"] .dungeon-rules-hero__note { background: rgba(255, 255, 255, .7); border-color: #d5d9df; color: #61656d; }
html[data-theme="light"] .dungeon-rules-kicker { color: #a51f2b; }
html[data-theme="light"] .dungeon-rules-jump { background: #fff; border-color: #d6d9de; }
html[data-theme="light"] .dungeon-rules-jump a { background: #f5f6f8; border-color: #cdd1d7; color: #30343a; }
html[data-theme="light"] .dungeon-rules-priority,
html[data-theme="light"] .dungeon-rules-card { background: #fff; border-color: #dfe2e7; box-shadow: 0 15px 36px rgba(24, 28, 35, .08); }
html[data-theme="light"] .dungeon-rules-priority h2,
html[data-theme="light"] .dungeon-rules-card h2,
html[data-theme="light"] .dungeon-rules-list strong { color: #202328; }
html[data-theme="light"] .dungeon-rules-priority p,
html[data-theme="light"] .dungeon-rules-list li { color: #4f535a; }
html[data-theme="light"] .dungeon-rules-card__aside { background: #fff7e5; color: #654b16; }

@media (max-width: 1040px) {
    .dungeon-rules-hero { grid-template-columns: 1fr; padding-bottom: 0; text-align: center; }
    .dungeon-rules-hero__intro { margin-inline: auto; }
    .dungeon-rules-hero__note { margin: 22px auto 0; max-width: 610px; text-align: left; }
    .dungeon-rules-hero__art img { max-height: 430px; }
    .dungeon-rules-grid { grid-template-columns: 1fr; }
    .dungeon-rules-card--wide { grid-column: auto; }
    .dungeon-rules-closing { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 760px) {
    .dungeon-rules-priorities { grid-template-columns: 1fr; }
    .dungeon-rules-card--illustrated,
    .dungeon-rules-card--wide.dungeon-rules-card--illustrated { grid-template-columns: 1fr; }
    .dungeon-rules-card__art,
    .dungeon-rules-card__art--wide { justify-self: center; margin-top: 6px; max-width: 390px; }
}

@media (max-width: 560px) {
    .dungeon-rules-page { padding: 12px 10px 46px; }
    .dungeon-rules-hero { border-radius: 15px; min-height: 0; padding-inline: 18px; }
    .dungeon-rules-hero h1 { font-size: clamp(2.65rem, 16vw, 4rem); }
    .dungeon-rules-hero__art img { max-height: 350px; }
    .dungeon-rules-jump { align-items: stretch; }
    .dungeon-rules-jump > span { width: 100%; }
    .dungeon-rules-jump a { flex: 1 1 calc(50% - 8px); text-align: center; }
    .dungeon-rules-red { grid-template-columns: 1fr; text-align: center; }
    .dungeon-rules-red__word { min-height: 70px; }
    .dungeon-rules-card { border-radius: 14px; }
    .dungeon-rules-closing__actions,
    .dungeon-rules-button { width: 100%; }
}

@media (max-width: 380px) {
    .dungeon-rules-page { padding-inline: 8px; }
    .dungeon-rules-hero { padding-inline: 15px; }
    .dungeon-rules-hero h1 { font-size: clamp(2.25rem, 15vw, 3rem); }
    .dungeon-rules-jump a { flex-basis: 100%; }
    .dungeon-rules-card__heading { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .dungeon-rules-jump a,
    .dungeon-rules-button { transition: none; }
}
