.hf-rules {
    --hf-rule-ink: #352d30;
    --hf-rule-muted: #6b6062;
    --hf-rule-line: #d2c2a9;
    --hf-rule-paper: #faf5ec;
    --hf-rule-soft: #ece2d3;
    --hf-rule-accent: #694077;
    --hf-rule-accent-dark: #432b4b;
    flex: 1 0 auto;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(91, 48, 108, .15), transparent 42rem),
        #150f1b;
    color: var(--hf-cream);
}

.hf-rules-heading {
    border-bottom: 1px solid rgba(217, 184, 115, .3);
    background: linear-gradient(120deg, #25172e, #180f20 70%, #21142b);
}

.hf-rules-heading-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 50px 30px;
}

.hf-rules-eyebrow {
    display: block;
    margin-bottom: 12px;
    color: var(--hf-gold);
    font-family: var(--hf-body);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .25em;
}

.hf-rules-heading h1 {
    margin: 0;
    color: var(--hf-cream);
    font-family: var(--hf-title);
    font-size: clamp(2.5rem, 4.5vw, 4rem);
    font-weight: 600;
    line-height: 1.2;
}

.hf-rules-heading p {
    max-width: 650px;
    margin: 14px 0 0;
    color: #c7bac7;
    font-size: 14px;
    line-height: 1.8;
}

.hf-rules-hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.hf-rules-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid rgba(217, 184, 115, .65);
    border-radius: 3px;
    color: var(--hf-cream);
    font-family: var(--hf-body);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.hf-rules-action-primary {
    border-color: #d9b873;
    background: #d9b873;
    color: #25172e;
}

.hf-rules-action-secondary {
    background: rgba(255, 255, 255, .04);
}

.hf-rules-action:hover,
.hf-rules-action:focus-visible {
    border-color: var(--hf-gold-light);
    background: #eed3a0;
    color: #25172e;
}

.hf-rules-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 34px;
    align-items: start;
    width: calc(100% - 48px);
    max-width: 1240px;
    margin: 0 auto;
    padding: 42px 0 85px;
}

.hf-rules-document {
    min-width: 0;
    padding: 45px 55px 55px;
    border: 1px solid #b9a27d;
    background: #f2eadc;
    color: var(--hf-rule-ink);
    box-shadow: 0 15px 42px rgba(0, 0, 0, .22);
}

.hf-rules-intro {
    margin-bottom: 32px;
    text-align: center;
}

.hf-rules-intro h2 {
    margin: 0;
    color: #432b4b;
    font-family: var(--hf-title);
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 600;
    line-height: 1.4;
}

.hf-rules-intro p {
    margin: 16px auto 0;
    max-width: 690px;
    color: #443c3c;
    font-family: var(--font-family-serif);
    font-size: 14px;
    line-height: 1.8;
}

.hf-rules-intro strong {
    color: var(--hf-rule-accent-dark);
}

.hf-rules-intro a {
    color: var(--hf-rule-accent);
    font-weight: 700;
    text-underline-offset: 3px;
}

.hf-rules-rule {
    height: 1px;
    max-width: 175px;
    margin: 18px auto 0;
    background: #b79c70;
}

.hf-rules-figure {
    margin: 0 0 36px;
}

.hf-rules-figure img {
    display: block;
    width: 100%;
    max-height: 390px;
    object-fit: cover;
    border: 1px solid #b6a38a;
    background: #d8c9b3;
}

.hf-rules-section {
    margin-bottom: 40px;
    scroll-margin-top: 100px;
}

.hf-rules-section:last-child {
    margin-bottom: 0;
}

.hf-rules-section h2 {
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #d2c2a9;
    color: #4b2c53;
    font-family: var(--hf-title);
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    font-weight: 600;
    line-height: 1.4;
}

.hf-rules-section h3 {
    margin: 26px 0 12px;
    color: var(--hf-rule-accent-dark);
    font-family: var(--hf-title);
    font-size: 1.18rem;
    font-weight: 600;
    line-height: 1.35;
}

.hf-rules-section p,
.hf-rules-section li {
    color: #443c3c;
    font-family: var(--font-family-serif);
    font-size: 14px;
    line-height: 1.85;
}

.hf-rules-section p {
    margin: 0 0 18px;
}

.hf-rules-section p:last-child {
    margin-bottom: 0;
}

.hf-rules-section ul,
.hf-rules-section ol {
    margin: 12px 0 22px;
    padding-left: 25px;
}

.hf-rules-section li {
    padding-left: 5px;
    margin-bottom: 11px;
}

.hf-rules-section li:last-child {
    margin-bottom: 0;
}

.hf-rules-section strong {
    color: #432b4b;
    font-weight: 700;
}

.hf-rules-section a {
    color: #694077;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hf-rules-section a:hover {
    color: #9a6537;
}

.hf-rules-aside {
    padding: 15px 18px;
    border-left: 3px solid #9d7b46;
    background: var(--hf-rule-soft);
    text-align: left;
}

.hf-rules-format-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 22px;
}

.hf-rules-format {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 16px;
    border: 1px solid var(--hf-rule-line);
    background: var(--hf-rule-paper);
    text-align: center;
}

.hf-rules-format-name {
    color: var(--hf-rule-accent);
    font-family: var(--hf-body);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.hf-rules-format strong {
    color: var(--hf-rule-accent-dark);
    font-family: var(--hf-title);
    font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.hf-rules-format > span:last-child {
    color: var(--hf-rule-muted);
    font-size: 12px;
}

.hf-rules-bounty-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
    margin: 20px 0;
}

.hf-rules-bounty-list > div {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--hf-rule-line);
    background: var(--hf-rule-paper);
}

.hf-rules-bounty-list p {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    min-width: 0;
    font-size: 13px;
    line-height: 1.45;
}

.hf-rules-bounty-list p span {
    margin-top: 2px;
    color: var(--hf-rule-muted);
    font-size: 12px;
}

/* Symbol images share the same asset set used by the card generator. */
.hf-bounty-key,
.hf-charge-key,
.hf-rules-inline-symbol,
.hf-rules-charge-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    vertical-align: -0.25em;
    line-height: 1;
}

.hf-bounty-key img,
.hf-charge-key img,
.hf-rules-inline-symbol img,
.hf-rules-charge-large img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hf-rules-bounty-list .hf-bounty-key {
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
    padding: 3px;
}

.hf-rules-bounty-list .hf-bounty-key img {
    width: 54px;
    height: 54px;
}

.hf-rules-inline-symbol,
.hf-charge-key {
    width: 1.38em;
    height: 1.38em;
    margin: 0 .08em;
    vertical-align: -0.30em;
}

.hf-rules-note .hf-bounty-key,
.hf-rules-reference-section p > .hf-bounty-key {
    width: 1.5em;
    height: 1.5em;
    margin: 0 .08em;
}

.hf-rules-symbol-code {
    color: #766456;
    font-size: .78em;
    font-weight: 500;
}

.hf-rules-charge-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 14px 0 16px;
}

.hf-rules-charge-examples > div {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--hf-rule-line);
    background: var(--hf-rule-paper);
}

.hf-rules-charge-large {
    width: 60px;
    height: 52px;
}

.hf-rules-charge-examples p {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    text-indent: 0;
    font-size: 13px;
    line-height: 1.5;
}

.hf-rules-charge-examples code {
    color: var(--hf-rule-muted);
    font-size: 12px;
}

.hf-rules-note {
    margin: 22px 0;
    padding: 18px 20px;
    border: 1px solid #c9b894;
    border-left: 4px solid #9d7b46;
    background: #f7f0e4;
}

.hf-rules-note h3 {
    margin: 0 0 7px;
    font-size: 1.05rem;
}

.hf-rules-note p {
    margin: 0;
}

.hf-rules-note-subtle {
    border-color: var(--hf-rule-line);
    border-left-color: #9a895d;
    background: var(--hf-rule-paper);
}

.hf-rules-card-anatomy {
    display: grid;
    grid-template-columns: minmax(145px, 215px) minmax(0, 1fr);
    align-items: start;
    gap: 26px;
}

.hf-rules-card-example {
    min-width: 0;
}

.hf-rules-card-example img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #a9957d;
    box-shadow: 0 6px 16px rgba(53, 40, 35, .15);
}

.hf-rules-image-caption {
    margin: 9px 0 0;
    color: var(--hf-rule-muted);
    font-family: var(--hf-body);
    font-size: 11px;
    text-align: center;
}

.hf-rules-phases {
    display: flex;
    flex-direction: column;
    margin: 20px 0;
    border-top: 1px solid var(--hf-rule-line);
}

.hf-rules-phases > div {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
    padding: 17px 0;
    border-bottom: 1px solid var(--hf-rule-line);
}

.hf-rules-phase-number {
    padding-top: 3px;
    color: #998054;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 1.1rem;
    font-weight: 800;
}

.hf-rules-phases h3 {
    margin: 0 0 4px;
    font-size: 1.06rem;
}

.hf-rules-phases p {
    margin: 0;
}

.hf-rules-card-types {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.hf-rules-card-types > div {
    padding: 16px;
    border: 1px solid var(--hf-rule-line);
    background: var(--hf-rule-paper);
}

.hf-rules-card-types h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
}

.hf-rules-card-types p {
    margin: 0;
    font-size: 13px;
}

.hf-rules-zones {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
}

.hf-rules-zones p {
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--hf-rule-line);
}

.hf-rules-quick-guide {
    padding: 28px;
    border: 2px solid #b79c70;
    background: #e9ddca;
}

.hf-rules-quick-guide h2 {
    margin-top: 7px;
}

.hf-rules-kicker {
    color: var(--hf-rule-accent);
    font-family: var(--hf-body);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
}

.hf-rules-quick-guide ol {
    margin-top: 20px;
    margin-bottom: 20px;
}

.hf-rules-quick-footer {
    border-top: 1px solid var(--hf-rule-line);
    padding-top: 16px;
}

.hf-rules-navigation {
    position: sticky;
    top: 24px;
    min-width: 0;
}

.hf-rules-navigation-inner {
    display: flex;
    flex-direction: column;
    padding: 22px 20px;
    border: 1px solid rgba(217, 184, 115, .35);
    background: #211628;
}

.hf-rules-nav-heading {
    display: block;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(217, 184, 115, .25);
    color: var(--hf-gold);
    font-family: var(--hf-body);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .2em;
}

.hf-rules-navigation a {
    display: block;
    padding: 9px 0;
    color: #d1c0d0;
    font-family: var(--hf-body);
    font-size: 12px;
    line-height: 1.45;
    text-decoration: none;
    transition: color var(--t-fast) var(--ease-std);
}

.hf-rules-navigation a:hover,
.hf-rules-navigation a:focus-visible {
    color: var(--hf-gold-light);
}

.hf-rules-nav-emphasis {
    color: var(--hf-gold) !important;
    font-weight: 800;
}

.hf-rules-reference .hf-rules-reference-section {
    padding-top: 2px;
}

.hf-rules-reference-section p {
    margin: 0 0 12px;
    padding-left: 4.2em;
    text-indent: -4.2em;
}

.hf-rules-reference-section p > strong:first-child {
    display: inline-block;
    min-width: 4em;
    color: var(--hf-rule-accent);
    font-variant-numeric: tabular-nums;
    text-indent: 0;
}

.hf-rules-reference-section h3 {
    padding-top: 9px;
    border-top: 1px solid var(--hf-rule-line);
}

.hf-rules-reference-section .hf-rules-bounty-list p {
    margin: 0;
    padding: 0;
    text-indent: 0;
}

.hf-rules-reference-section .hf-rules-bounty-list p > strong:first-child {
    min-width: 0;
    color: inherit;
}

.hf-rules-glossary {
    display: grid;
    grid-template-columns: minmax(115px, .3fr) minmax(0, 1fr);
    gap: 12px 20px;
    margin-top: 20px;
}

.hf-rules-glossary dt,
.hf-rules-glossary dd {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--hf-rule-line);
    line-height: 1.6;
}

.hf-rules-glossary dt {
    color: var(--hf-rule-accent-dark);
    font-weight: 800;
}

.hf-rules-glossary dd {
    margin: 0;
}

.hf-rules-reference-return {
    margin-top: 22px !important;
    padding-left: 0 !important;
    text-indent: 0 !important;
}

@media (max-width: 1050px) {
    .hf-rules-layout {
        grid-template-columns: minmax(0, 1fr);
        max-width: 900px;
    }

    .hf-rules-navigation {
        position: static;
        grid-row: 1;
    }

    .hf-rules-navigation-inner {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px 20px;
    }

    .hf-rules-nav-heading {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .hf-rules-heading-inner {
        padding: 38px 24px;
    }

    .hf-rules-layout {
        width: calc(100% - 28px);
        padding: 22px 0 50px;
        gap: 20px;
    }

    .hf-rules-document {
        padding: 30px 25px 38px;
    }

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

    .hf-rules-card-anatomy {
        grid-template-columns: 1fr;
    }

    .hf-rules-card-example {
        width: 100%;
        max-width: 240px;
        margin: 0 auto;
    }

    .hf-rules-format-grid,
    .hf-rules-card-types,
    .hf-rules-zones,
    .hf-rules-bounty-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hf-rules-heading-inner {
        padding: 32px 20px;
    }

    .hf-rules-document {
        padding: 25px 18px 30px;
    }

    .hf-rules-navigation-inner {
        grid-template-columns: 1fr;
    }

    .hf-rules-section {
        margin-bottom: 32px;
    }

    .hf-rules-section p,
    .hf-rules-section li {
        font-size: 13px;
        line-height: 1.85;
    }

    .hf-rules-quick-guide {
        padding: 18px;
    }

    .hf-rules-glossary {
        grid-template-columns: minmax(90px, .38fr) minmax(0, 1fr);
        gap: 10px;
    }
}

@media (max-width: 420px) {
    .hf-rules-hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .hf-rules-action {
        width: 100%;
    }

    .hf-rules-reference-section p {
        padding-left: 0;
        text-indent: 0;
    }

    .hf-rules-reference-section p > strong:first-child {
        display: inline;
        margin-right: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hf-rules-navigation a,
    .hf-rules-action {
        transition: none;
    }
}

@media print {
    .hf-rules {
        background: #fff;
    }

    .hf-rules-document {
        border: 0;
        box-shadow: none;
    }

    .hf-rules-navigation,
    .hf-rules-hero-actions {
        display: none !important;
    }

    .hf-rules-quick-guide,
    .hf-rules-note,
    .hf-rules-format {
        break-inside: avoid;
    }
}
