:root {
    color-scheme: dark;
    font-family: "JetBrains Mono", "Cascadia Code", "Cascadia Mono", Consolas, monospace;
    color: #e8e9eb;
    background: #111315;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    --ink: #e8e9eb;
    --muted: #a0a5ab;
    --accent: #bd2935;
    --accent-dark: #98202a;
    --line: #303438;
    --surface: #191c1f;
}

* {
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: #111315;
    color: var(--ink);
}

button {
    font: inherit;
}

.site-header {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px max(6vw, 24px);
    border-top: 3px solid var(--accent);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    color: var(--ink);
    text-decoration: none;
}

.brand-name {
    color: #f0f0f1;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1;
    text-transform: uppercase;
}

.brand-mark {
    position: relative;
    display: block;
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid #34383c;
    border-radius: 8px;
    background: #080909;
    box-shadow: 0 0 18px rgba(189, 41, 53, 0.1);
}

.brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(1.08);
    -webkit-user-drag: none;
}

.brand-mark::after {
    position: absolute;
    top: -35%;
    right: 0;
    left: 0;
    height: 30%;
    background: linear-gradient(180deg, transparent, rgba(220, 72, 83, 0.2), transparent);
    content: "";
    pointer-events: none;
    animation: logo-scan 3.6s ease-in-out infinite;
}

@keyframes logo-scan {
    0%,
    100% {
        transform: translateY(0);
        opacity: 0;
    }

    18%,
    82% {
        opacity: 1;
    }

    55% {
        transform: translateY(460%);
        opacity: 0.8;
    }
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.discord-auth-controls {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.discord-auth-controls::before {
    color: #596067;
    content: "|";
    font-size: 1.1rem;
    line-height: 1;
}

.discord-profile-toggle {
    display: inline-flex;
    min-width: 42px;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
}

.discord-profile-toggle:hover,
.discord-profile-toggle:active,
.discord-profile-toggle:focus,
.discord-profile-toggle:focus-visible {
    border: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
}

.discord-profile-toggle:hover .discord-login-icon,
.discord-profile-toggle:focus-visible .discord-login-icon {
    filter: invert(30%) sepia(62%) saturate(2500%) hue-rotate(322deg) brightness(112%);
}

.discord-login-icon {
    display: block;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    filter: invert(88%) sepia(9%) saturate(250%) hue-rotate(220deg) brightness(95%);
    transition: filter 160ms ease;
}

.discord-user[hidden],
.discord-profile-menu[hidden],
.discord-login-icon[hidden],
.discord-profile-action[hidden],
.discord-auth-status[hidden] {
    display: none;
}

.discord-user {
    display: inline-flex;
    max-width: 200px;
    align-items: center;
    gap: 8px;
    color: #d8c9e3;
    font-size: 0.8rem;
    font-weight: 700;
}

.discord-user-avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border: 1px solid #514059;
    border-radius: 50%;
    object-fit: cover;
}

.discord-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discord-profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 10;
    min-width: 148px;
    padding: 5px;
    border: 1px solid #3a343f;
    border-radius: 6px;
    background: #191c1f;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.discord-profile-action {
    display: block;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #d8c9e3;
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
}

.discord-profile-action:hover,
.discord-profile-action:focus-visible {
    outline: none;
    background: #2c1c1f;
    color: #f0b5ba;
}

.discord-auth-status {
    flex-basis: 100%;
    color: #e58a91;
    font-size: 0.72rem;
    text-align: right;
}

.nav-button {
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.nav-button:hover {
    background: #292124;
    color: #f0b5ba;
}

.nav-button[aria-current="page"] {
    border-color: #57272c;
    background: #2c1c1f;
    color: #f0b5ba;
}

.nav-button:focus-visible {
    outline: 3px solid #d45b65;
    outline-offset: 3px;
}

main {
    width: min(100% - 48px, 1060px);
    margin: 0 auto;
    padding: 72px 0 88px;
    flex: 1;
}

main:focus {
    outline: none;
}

.page[hidden] {
    display: none;
}

.eyebrow {
    margin: 0 0 18px;
    color: #df626c;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    color: var(--ink);
    line-height: 1.2;
}

h1 {
    max-width: 720px;
    margin-bottom: 20px;
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    letter-spacing: -0.06em;
}

h2 {
    margin-bottom: 14px;
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    letter-spacing: -0.055em;
}

h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.page-intro {
    max-width: 680px;
}

.lead {
    max-width: 620px;
    margin-bottom: 30px;
    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    line-height: 1.75;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 19px;
    border: 0;
    border-radius: 5px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-weight: 650;
    text-decoration: none;
    transition: background-color 160ms ease, transform 160ms ease;
}

.primary-button:hover {
    transform: translateY(-1px);
    background: var(--accent-dark);
}

.primary-button:focus-visible {
    outline: 3px solid #d45b65;
    outline-offset: 3px;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.home-card {
    padding: clamp(22px, 4vw, 30px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.home-card h1,
.home-card h2 {
    margin-bottom: 12px;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    letter-spacing: -0.045em;
}

.home-card h1 {
    max-width: none;
}

.home-card > p:not(.eyebrow) {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.75;
}

.home-card .eyebrow {
    margin-bottom: 12px;
}

.home-card .primary-button {
    margin-top: 22px;
}

.discord-invite-button {
    display: inline-flex;
    margin: 20px 0 0 16px;
}

.server-gallery-section {
    margin-top: 64px;
}

.server-gallery-heading {
    max-width: 680px;
    margin-bottom: 22px;
}

.server-gallery-heading h2 {
    margin-bottom: 10px;
}

.server-gallery-heading > p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.7;
}

.server-gallery-carousel {
    max-width: 900px;
    margin: 0 auto;
    outline: none;
}

.server-gallery-carousel:focus-visible {
    outline: 2px solid #d45b65;
    outline-offset: 6px;
    border-radius: 4px;
}

.server-gallery-slide {
    margin: 0;
}

.server-gallery-slide[hidden] {
    display: none;
}

.server-gallery-frame {
    position: relative;
    display: grid;
    aspect-ratio: 16 / 9;
    min-height: 240px;
    max-height: 506px;
    overflow: hidden;
    place-items: center;
    border: 1px solid #3b3438;
    border-radius: 7px;
    background:
        linear-gradient(135deg, transparent 48%, rgba(189, 41, 53, 0.09) 49%, transparent 50%),
        linear-gradient(45deg, transparent 48%, rgba(189, 41, 53, 0.06) 49%, transparent 50%),
        radial-gradient(ellipse at center, rgba(189, 41, 53, 0.09), transparent 68%),
        #17191b;
}

.server-gallery-frame::before,
.server-gallery-frame::after {
    position: absolute;
    width: 22px;
    height: 22px;
    border-color: rgba(189, 41, 53, 0.55);
    border-style: solid;
    content: "";
}

.server-gallery-frame::before {
    top: 12px;
    left: 12px;
    border-width: 1px 0 0 1px;
}

.server-gallery-frame::after {
    right: 12px;
    bottom: 12px;
    border-width: 0 1px 1px 0;
}

.server-gallery-crosshair {
    position: absolute;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(160, 165, 171, 0.18);
    border-radius: 50%;
}

.server-gallery-crosshair::before,
.server-gallery-crosshair::after {
    position: absolute;
    top: 50%;
    left: 50%;
    background: rgba(160, 165, 171, 0.22);
    content: "";
    transform: translate(-50%, -50%);
}

.server-gallery-crosshair::before {
    width: 62px;
    height: 1px;
}

.server-gallery-crosshair::after {
    width: 1px;
    height: 62px;
}

.server-gallery-index,
.server-gallery-coming {
    position: absolute;
    color: #858b91;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.server-gallery-index {
    top: 18px;
    left: 20px;
}

.server-gallery-coming {
    z-index: 1;
    padding: 7px 10px;
    border: 1px solid rgba(73, 51, 55, 0.8);
    border-radius: 3px;
    background: rgba(17, 19, 21, 0.84);
    color: #d5d8da;
}

.server-gallery-slide figcaption {
    padding: 14px 2px 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.server-gallery-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 18px;
}

.server-gallery-arrow {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    transition: border-color 160ms ease, color 160ms ease;
}

.server-gallery-arrow span {
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(135deg);
}

.server-gallery-arrow[data-gallery-direction="1"] span {
    transform: rotate(-45deg);
}

.server-gallery-arrow:hover,
.server-gallery-arrow:focus-visible {
    border-color: var(--accent);
    color: #f0b5ba;
}

.server-gallery-arrow:focus-visible,
.server-gallery-dot:focus-visible {
    outline: 2px solid #d45b65;
    outline-offset: 3px;
}

.server-gallery-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
}

.server-gallery-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #555a5f;
    cursor: pointer;
    transition: background-color 160ms ease, transform 160ms ease;
}

.server-gallery-dot[aria-current="true"] {
    background: var(--accent);
    transform: scale(1.3);
}

.requirements-section {
    margin-top: 64px;
}

.requirements-heading {
    max-width: 680px;
    margin-bottom: 22px;
}

.requirements-heading h2 {
    margin-bottom: 10px;
}

.requirements-heading > p:last-child,
.requirements-source {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.7;
}

.requirements-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.requirement-card {
    min-width: 0;
    padding: clamp(20px, 3vw, 28px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(189, 41, 53, 0.07), transparent 45%),
        var(--surface);
}

.requirement-card-recommended {
    border-color: #493337;
}

.requirement-card h3 {
    margin-bottom: 18px;
    color: #f0b5ba;
}

.requirements-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.requirements-list > div {
    display: grid;
    grid-template-columns: minmax(100px, 0.7fr) minmax(0, 1.5fr);
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid rgba(48, 52, 56, 0.8);
}

.requirements-list dt {
    color: #d5d8da;
    font-size: 0.78rem;
    font-weight: 700;
}

.requirements-list dd {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.6;
}

.requirements-source {
    margin: 16px 0 0;
    font-size: 0.75rem;
}

.requirements-source a {
    color: #e16a73;
    text-decoration: none;
}

.requirements-source a:hover,
.requirements-source a:focus-visible {
    color: #f0b5ba;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.text-link {
    margin-top: 20px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #e16a73;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: left;
}

.text-link:hover {
    color: #f0b5ba;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.text-link:focus-visible {
    outline: 2px solid #d45b65;
    outline-offset: 4px;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 16px;
    width: fit-content;
    max-width: 100%;
    min-height: 68px;
    margin-bottom: 18px;
    padding: 12px 16px;
    border: 1px solid #493337;
    border-radius: 7px;
    background:
        linear-gradient(115deg, rgba(189, 41, 53, 0.14), transparent 58%),
        var(--surface);
    box-shadow: inset 3px 0 0 var(--accent-dark), 0 8px 24px rgba(0, 0, 0, 0.14);
}

.server-status-server,
.server-status-metric {
    display: flex;
    flex-direction: column;
}

.server-status-server {
    gap: 5px;
}

.server-status-heading {
    display: flex;
    align-items: center;
    gap: 9px;
}

.server-status-caption,
.player-count-label {
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    line-height: 1.2;
    text-transform: uppercase;
}

.server-status-caption {
    padding-left: 17px;
}

.server-status-divider {
    width: 1px;
    height: 34px;
    flex: 0 0 auto;
    background: linear-gradient(180deg, transparent, #493337 20%, #493337 80%, transparent);
}

.server-status-metric {
    gap: 3px;
}

.server-status-indicator {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #73787e;
    box-shadow: 0 0 7px rgba(115, 120, 126, 0.4);
    outline: 3px solid rgba(115, 120, 126, 0.12);
}

.server-status-label {
    color: #d5d8da;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.player-count {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin: 0;
    color: #f1c3c7;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.player-count-separator,
#maximum-player-count {
    color: var(--muted);
    font-size: 0.75em;
    font-weight: 500;
}

.section-heading {
    margin: 64px 0 22px;
}

.content-panel p,
.content-panel li {
    color: var(--muted);
    line-height: 1.7;
}

.content-panel {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
}

.content-panel p:last-child {
    margin-bottom: 0;
}

.page-intro {
    margin-bottom: 32px;
}

.content-panel {
    max-width: 760px;
    padding: clamp(24px, 5vw, 38px);
}

.content-panel ul {
    display: grid;
    gap: 14px;
    margin: 0;
    padding-left: 22px;
}

.rule-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    display: grid;
    width: 100%;
    grid-template-rows: 0fr 18px;
    margin: 0;
    pointer-events: none;
    z-index: 5;
    transition: grid-template-rows 700ms ease-in-out;
}

.rule-dropdown.is-open {
    grid-template-rows: 1fr 18px;
}

.rule-dropdown[hidden] {
    display: none;
}

.rule-dropdown-toggle {
    display: flex;
    width: 64px;
    height: 18px;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border: 0;
    border-radius: 0 0 9px 9px;
    background: #191c1f;
    cursor: pointer;
    list-style: none;
    grid-row: 2;
    pointer-events: auto;
}

.rule-dropdown-toggle:focus-visible {
    outline: 2px solid #d45b65;
    outline-offset: 1px;
}

.rule-dropdown-grip {
    width: 34px;
    height: 4px;
    border-radius: 4px;
    background: #73787e;
    transition: width 500ms ease, background-color 500ms ease, transform 500ms ease;
}

.rule-dropdown-toggle:hover .rule-dropdown-grip,
.rule-dropdown.is-open .rule-dropdown-grip {
    width: 42px;
    background: var(--accent);
}

.rule-dropdown.is-open .rule-dropdown-grip {
    transform: translateY(3px);
}

.rule-dropdown-menu {
    min-height: 0;
    overflow: hidden;
    justify-content: center;
    display: grid;
    grid-row: 1;
    grid-template-rows: minmax(0, 1fr);
    pointer-events: none;
}

.rule-dropdown.is-open .rule-dropdown-menu {
    pointer-events: auto;
}

.rule-dropdown-panel {
    display: flex;
    width: 100vw;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px max(6vw, 24px);
    border-top: 1px solid var(--line);
    background: rgba(25, 28, 31, 0.98);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38);
}

.rule-link {
    display: flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: #111315;
    color: #d5d8da;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: left;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.rule-link[hidden] {
    display: none;
}

.rule-link-copy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.rule-link:hover {
    border-color: #654047;
    background: #201b1d;
    color: #f0b5ba;
}

.rule-link[aria-current="page"] {
    border-color: #654047;
    background: #2c1c1f;
    color: #f0b5ba;
}

.rule-link:focus-visible,
.back-button:focus-visible {
    outline: 2px solid #d45b65;
    outline-offset: 3px;
}

.back-button {
    display: block;
    margin: 0 0 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
}

.back-button:hover {
    color: #f0b5ba;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    padding: 24px max(6vw, 24px);
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.site-footer p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    text-align: center;
}

.footer-link {
    color: var(--muted);
    font-size: 0.78rem;
    text-decoration: none;
    transition: color 160ms ease;
}

.footer-link:hover,
.footer-link:focus-visible {
    color: #f0b5ba;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.footer-link[aria-current="page"] {
    color: #f0b5ba;
}

.footer-separator {
    color: #596067;
    font-size: 0.8rem;
}

.privacy-panel h3:not(:first-child) {
    margin-top: 28px;
}

.privacy-discord-link {
    display: inline-block;
    margin-top: 20px;
}

@media (max-width: 680px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-header {
        gap: 16px;
    }

    .site-nav {
        width: 100%;
        gap: 4px;
        margin-left: 0;
    }

    .site-nav .nav-button {
        padding: 9px 11px;
    }

    .discord-auth-controls {
        width: 100%;
        justify-content: flex-end;
    }

    .discord-auth-status {
        text-align: right;
    }

    .rule-link {
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    .rule-link-copy {
        flex-wrap: wrap;
        gap: 6px 12px;
    }

    .rule-dropdown-panel {
        justify-content: stretch;
        padding: 8px 16px;
    }

    .rule-link {
        flex: 1 1 calc(50% - 4px);
    }

    main {
        width: min(100% - 32px, 1060px);
        padding: 40px 0 56px;
    }

    .home-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .requirements-section {
        margin-top: 48px;
    }

    .server-gallery-section {
        margin-top: 48px;
    }

    .server-gallery-frame {
        min-height: 200px;
    }

    .server-gallery-controls {
        gap: 14px;
    }

    .requirements-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .requirements-list > div {
        grid-template-columns: minmax(88px, 0.65fr) minmax(0, 1.5fr);
        gap: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
