:root {
    --bg: #05050d;
    --panel: rgba(24, 22, 39, 0.86);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text: #f7f4ff;
    --muted: #a9a0c5;
    --accent: #ff9f2f;
    --accent-2: #ffd15c;
    --glow: rgba(255, 159, 47, 0.2);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: "Rajdhani", Arial, sans-serif;
    background:
        radial-gradient(circle at 9% 14%, rgba(255, 143, 38, 0.22), transparent 28%),
        radial-gradient(circle at 86% 82%, rgba(255, 188, 62, 0.14), transparent 30%),
        radial-gradient(circle at 55% 8%, rgba(255, 100, 35, 0.08), transparent 26%),
        linear-gradient(135deg, #070609 0%, #05050a 48%, #020306 100%);
    letter-spacing: 0;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
    background-size: 58px 58px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 72%);
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 12px 24px;
    border-bottom: 1px solid rgba(255, 171, 61, 0.16);
    background:
        radial-gradient(circle at 6% 0%, rgba(255, 159, 47, 0.14), transparent 34%),
        linear-gradient(90deg, rgba(11, 8, 10, 0.96), rgba(7, 6, 12, 0.9) 48%, rgba(17, 11, 6, 0.94));
    backdrop-filter: blur(18px);
    box-shadow: 0 1px 0 rgba(255, 209, 92, 0.08), 0 12px 36px rgba(0, 0, 0, 0.22);
}

.topbar::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 159, 47, 0.58), rgba(255, 209, 92, 0.22), transparent);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-copy strong {
    font-family: "Space Grotesk", Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #fff8ea;
}

.brand-copy small {
    margin-top: 5px;
    color: #ffb24c;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.logo {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #f3efff;
    background:
        linear-gradient(135deg, rgba(255, 159, 47, 0.88), rgba(28, 22, 13, 0.72)),
        #11100f;
    border: 1px solid rgba(255, 171, 61, 0.42);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.36), 0 0 38px var(--glow);
    overflow: hidden;
}

.logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-small {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.discord-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 15px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, #ff8c2b, #ffd15c);
    box-shadow: 0 12px 28px rgba(255, 159, 47, 0.18);
    font-size: 14px;
    font-weight: 700;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.discord-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.discord-button:hover,
.discord-button:focus-visible {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #ff9f2f, #ffe08a);
    box-shadow: 0 12px 30px rgba(255, 159, 47, 0.32);
}

.home {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
    padding: 82px 0 42px;
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-logo {
    width: 104px;
    height: 104px;
    border-radius: 24px;
}

.eyebrow {
    margin: 24px 0 12px;
    color: #ffb24c;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 8px;
}

h1 {
    margin: 0;
    font-family: "Space Grotesk", Arial, sans-serif;
    font-size: clamp(42px, 6vw, 76px);
    line-height: 1;
    font-weight: 800;
}

h1 span {
    color: transparent;
    background: linear-gradient(90deg, #fff8ea 0%, #ffb24c 54%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.subtitle {
    width: min(610px, 100%);
    margin: 18px auto 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.65;
    font-weight: 600;
}

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

.rule-card {
    position: relative;
    min-height: 220px;
    padding: 30px 28px;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(27, 24, 22, 0.98), rgba(14, 13, 15, 0.96)),
        var(--panel);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 20px 45px rgba(0, 0, 0, 0.18);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.rule-card:hover,
.rule-card:focus-visible {
    transform: translateY(-8px) scale(1.035);
    border-color: rgba(255, 171, 61, 0.62);
    background:
        linear-gradient(145deg, rgba(36, 28, 19, 0.99), rgba(17, 15, 14, 0.98)),
        var(--panel);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.3), 0 0 34px rgba(255, 159, 47, 0.18);
}

.card-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-bottom: 20px;
    color: #f3b45f;
    border-radius: 10px;
    background: rgba(241, 185, 62, 0.12);
}

.card-icon svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.rule-card strong {
    display: block;
    font-family: "Space Grotesk", Arial, sans-serif;
    font-size: 21px;
    font-weight: 800;
}

.rule-card p {
    margin: 16px 0 34px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.55;
    font-weight: 600;
}

.card-arrow {
    position: absolute;
    right: 26px;
    bottom: 24px;
    color: #ffb24c;
    font-size: 22px;
    transition: transform 180ms ease;
}

.rule-card:hover .card-arrow,
.rule-card:focus-visible .card-arrow {
    transform: translateX(5px);
}

footer {
    padding: 12px 16px 34px;
    color: rgba(169, 160, 197, 0.78);
    text-align: center;
    font-size: 12px;
    font-weight: 600;
}

.rules-page {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
    padding: 54px 0 70px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 0 16px;
    color: #d8d0ea;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(24, 22, 39, 0.82);
    font-size: 13px;
    font-weight: 700;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.back-link:hover,
.back-link:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(255, 171, 61, 0.46);
    background: rgba(36, 28, 19, 0.88);
}

.rules-heading {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin: 34px 0 18px;
}

.title-emoji {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-top: 2px;
    border-radius: 10px;
    background: rgba(255, 159, 47, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 171, 61, 0.18), 0 0 28px rgba(255, 159, 47, 0.1);
    font-size: 29px;
    line-height: 1;
}

.rules-heading h1 {
    font-size: clamp(30px, 4vw, 42px);
}

.rules-heading p {
    margin: 12px 0 8px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
}

.rules-heading small {
    display: none;
}

.rule-tabs {
    display: flex;
    gap: 18px;
    margin: 8px 0 26px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rule-tabs a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.rule-tabs a.active,
.rule-tabs a:hover,
.rule-tabs a:focus-visible {
    color: var(--text);
}

.rule-tabs a.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff8c2b, #ffd15c);
}

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

.summary-card {
    align-self: start;
    padding: 18px 12px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(25, 23, 38, 0.96), rgba(16, 15, 24, 0.96)),
        var(--panel);
}

.summary-card > span {
    display: block;
    margin: 0 6px 12px;
    color: rgba(169, 160, 197, 0.78);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.summary-card a {
    display: block;
    overflow: hidden;
    padding: 10px 12px;
    color: #d8d0ea;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 180ms ease, color 180ms ease;
}

.summary-card a:hover,
.summary-card a:focus-visible,
.summary-card a.active {
    color: #fff;
    background: rgba(255, 159, 47, 0.14);
}

.rules-content {
    min-width: 0;
}

.rule-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    margin-bottom: 16px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 16px;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: rgba(24, 22, 39, 0.86);
}

.search-box svg {
    width: 19px;
    height: 19px;
    fill: #9289ad;
}

.search-box input {
    width: 100%;
    min-width: 0;
    color: var(--text);
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
}

.search-box input::placeholder {
    color: rgba(169, 160, 197, 0.74);
}

.expand-all {
    min-height: 46px;
    padding: 0 18px;
    color: #d8d0ea;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: rgba(24, 22, 39, 0.86);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    transition: border-color 180ms ease, background 180ms ease;
}

.expand-all:hover,
.expand-all:focus-visible {
    border-color: rgba(255, 171, 61, 0.46);
    background: rgba(36, 28, 19, 0.88);
}

.accordion-list {
    display: grid;
    gap: 13px;
}

.rule-accordion {
    scroll-margin-top: 92px;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background:
        linear-gradient(145deg, rgba(24, 22, 39, 0.98), rgba(17, 16, 27, 0.98)),
        var(--panel);
}

.rule-accordion[hidden] {
    display: none;
}

.accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-height: 66px;
    padding: 0 22px;
    color: var(--text);
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 17px;
    font-weight: 800;
    text-align: left;
}

.accordion-actions {
    flex: 0 0 auto;
    color: rgba(169, 160, 197, 0.8);
    font-size: 15px;
    transition: transform 180ms ease;
}

.rule-accordion.open .accordion-actions {
    transform: rotate(180deg);
}

.accordion-panel {
    display: none;
    padding: 0 22px 22px 52px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
    font-weight: 600;
}

.rule-accordion.open .accordion-panel {
    display: block;
}

.accordion-panel p,
.rule-points {
    margin: 0;
}

.accordion-panel p {
    position: relative;
    padding-left: 20px;
}

.accordion-panel p::before,
.rule-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff8c2b, #ffd15c);
    box-shadow: 0 0 12px rgba(255, 159, 47, 0.48);
}

.rule-points {
    display: grid;
    gap: 10px;
    padding: 0;
    list-style: none;
}

.rule-points li {
    position: relative;
    padding-left: 20px;
}

.rule-points .rule-subheading {
    margin-top: 8px;
    padding-left: 0;
    color: var(--accent-2);
    font-weight: 800;
}

.rule-points .rule-subheading::before {
    display: none;
}

.scroll-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    color: #fff;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8c2b, #ffd15c);
    box-shadow: 0 14px 34px rgba(255, 159, 47, 0.28);
    cursor: pointer;
    font-size: 20px;
    font-weight: 800;
}

@media (max-width: 820px) {
    .home {
        padding-top: 54px;
    }

    .rules-grid {
        grid-template-columns: 1fr;
        max-width: 440px;
        margin-top: 54px;
    }

    .rule-card {
        min-height: 190px;
    }

    .rules-page {
        padding-top: 34px;
    }

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

    .summary-card {
        max-height: none;
    }
}

@media (max-width: 520px) {
    .topbar {
        min-height: 58px;
        padding: 10px 14px;
    }

    .brand {
        gap: 9px;
    }

    .brand-copy strong {
        font-size: 14px;
    }

    .brand-copy small {
        font-size: 9px;
        letter-spacing: 1.5px;
    }

    .discord-button {
        width: 38px;
        padding: 0;
        font-size: 0;
    }

    .discord-button svg {
        width: 19px;
        height: 19px;
    }

    .hero-logo {
        width: 86px;
        height: 86px;
        border-radius: 20px;
    }

    .eyebrow {
        letter-spacing: 5px;
    }

    h1 {
        font-size: clamp(36px, 12vw, 52px);
    }

    .rules-heading {
        gap: 12px;
    }

    .rule-tabs {
        gap: 4px;
        overflow-x: auto;
    }

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

    .accordion-toggle {
        min-height: 58px;
        padding: 0 16px;
        font-size: 15px;
    }

    .accordion-panel {
        padding: 0 16px 18px;
    }
}
