@view-transition {
    navigation: auto;
}

:root {
    --base: #000000;
    --text: #cfded5;
    --muted: #889b90;
    --selection: #2a3138;
    --selection-lime: #2b3b34;
    --lime: #68d08b;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background: var(--base);
    margin: 0;

    font-family: "Outfit", sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
}

::selection {
    background: var(--selection);
}

#navbar {
    view-transition-name: navbar;
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--base) 85%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--selection);
}

.nav-inner {
    padding: 0.75rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "count links copy";
    align-items: center;
    gap: 1rem;
}

.player-count {
    grid-area: count;
    justify-self: start;
}

.copy-ip {
    grid-area: copy;
    justify-self: end;
}

.nav-links {
    grid-area: links;
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    -webkit-tap-highlight-color: transparent;
    padding: 0.5rem 0.9rem;
    color: var(--muted);
    border-radius: 8px;
    font-size: 1rem;
    text-decoration: none;
}
.nav-link:hover {
    color: var(--text);
}
.nav-link[aria-current="page"],
.nav-link[aria-current="page"]:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--selection) 60%, var(--base));
    cursor: default;
}
.nav-link:focus-visible {
    outline: 2px solid var(--muted);
    outline-offset: 2px;
}

.player-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 1rem;
    white-space: nowrap;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
}
.player-count.online .status-dot {
    background: var(--lime);
    box-shadow: 0 0 6px var(--lime);
}
.player-count.offline .status-dot {
    background: #f87171;
}

.copy-ip {
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--selection);
    border-radius: 8px;
    font: inherit;
    font-size: 1rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.copy-ip:hover {
    background: var(--selection);
}
.copy-ip:focus-visible {
    outline: 2px solid var(--muted);
    outline-offset: 2px;
}

.icon {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.icon-check,
.copy-ip.copied .icon-copy {
    display: none;
}
.copy-ip.copied .icon-check {
    display: block;
}
.copy-ip.copied {
    border-color: var(--lime);
    color: var(--lime);
}
.copy-ip.copied:hover {
    background: color-mix(in srgb, var(--lime) 15%, var(--base));
}

main {
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

#page-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    cursor: pointer;
    user-select: none;
}

.title {
    margin: 0;
    color: var(--text);
    font-size: clamp(3rem, 12vw, 6rem);
    font-weight: 500;
    line-height: 1;
}

.logo {
    width: clamp(80px, 20vw, 100px);
    height: auto;
    flex-shrink: 0;
}

#page-description {
    display: flex;
    justify-content: center;
    max-width: 40rem;
}

.description {
    margin: 0;
    font-size: clamp(1.15rem, 4vw, 1.8rem);
    line-height: 1.4;
    color: var(--muted);
    text-align: center;
}

#banner {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 1.5rem;
}

.image-banner {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

#links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
}

.link-button {
    -webkit-tap-highlight-color: transparent;
    padding: 0.7rem 1.4rem;
    color: var(--text);
    border: 1px solid var(--selection);
    border-radius: 8px;
    font-size: 1.1rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}
.link-button:hover {
    background: var(--selection);
}
.link-button:focus-visible {
    outline: 2px solid var(--muted);
    outline-offset: 2px;
}

main.rules {
    align-items: stretch;
    max-width: 760px;
    gap: 2.5rem;
}

.page-heading {
    margin: 0;
    color: var(--text);
    font-size: clamp(2.5rem, 10vw, 4rem);
    font-weight: 500;
    line-height: 1;
    text-align: center;
}

.rule-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rule-section h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.6rem;
    font-weight: 500;
}

.rule {
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
}

.rule h3 {
    margin: 0 0 0.4rem;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 500;
}

.rule p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.rule-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.rule-list h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}
.rule-list.not-allowed h4 {
    color: #f87171;
}
.rule-list.allowed h4 {
    color: #4ade80;
}

.rule-list ul {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--muted);
    line-height: 1.5;
}
.rule-list li + li {
    margin-top: 0.35rem;
}

@media (max-width: 640px) {
    .nav-inner {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "count copy"
            "links links";
        row-gap: 0.5rem;
    }

    .nav-links {
        justify-self: center;
    }
}

@media (max-width: 480px) {
    .nav-inner {
        padding: 0.6rem 1rem;
    }

    .rule {
        padding: 1rem 1.1rem;
    }

    .player-count,
    .copy-ip,
    .nav-link {
        font-size: 0.9rem;
    }

    main {
        padding: 2rem 1rem;
    }

    #banner {
        margin-top: 1rem;
    }

    #page-title {
        flex-direction: column-reverse;
        gap: 1rem;
    }
}
