/* =========================================================
   ShadeServer Main Dashboard
   ========================================================= */

:root {
    --bg-main: #07111f;
    --bg-secondary: #0b1728;
    --panel: #101e31;
    --panel-light: #16273d;

    --border: #29425f;
    --border-soft: rgba(100, 150, 200, 0.18);

    --text: #eef6ff;
    --text-soft: #a6bad1;
    --text-muted: #7189a3;

    --cyan: #20b9ff;
    --cyan-bright: #34c5ff;

    --green: #25e586;
    --green-dark: #0e7e4a;

    --header-height: 72px;
}


/* =========================================================
   Reset
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    background: var(--bg-main);
}

body {
    margin: 0;
    min-height: 100vh;

    background:
        radial-gradient(
            circle at 50% -15%,
            rgba(31, 93, 151, 0.30),
            transparent 38%
        ),
        linear-gradient(
            180deg,
            #0a1729 0%,
            #07111f 55%,
            #050c17 100%
        );

    color: var(--text);

    font-family:
        Inter,
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;
}

a {
    color: inherit;
}


/* =========================================================
   Header
   ========================================================= */

.site-header {
    min-height: var(--header-height);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 7%;

    background: rgba(6, 17, 31, 0.94);

    border-bottom:
        1px solid rgba(50, 153, 220, 0.18);

    backdrop-filter: blur(12px);

    position: sticky;
    top: 0;
    z-index: 100;
}


.brand {
    display: flex;
    align-items: center;
    gap: 13px;

    text-decoration: none;
}


/* CSS server/cube icon */

.brand-icon {
    width: 46px;
    height: 46px;

    object-fit: contain;
    flex: 0 0 auto;

    filter:
        drop-shadow(0 0 5px rgba(0, 190, 255, .35))
        drop-shadow(0 0 10px rgba(0, 190, 255, .12));}


.brand-name {
    font-weight: 800;
    font-size: 1.35rem;
    line-height: 1;
}

.brand-name span,
.footer-brand span,
.hero h1 span {
    color: var(--cyan);
}


.brand-subtitle {
    margin-top: 5px;

    color: var(--text-muted);

    font-size: 0.72rem;

    letter-spacing: 0.04em;
}


.main-nav {
    display: flex;
    align-items: stretch;

    min-height: var(--header-height);
}


.main-nav a {
    display: flex;
    align-items: center;

    padding: 0 24px;

    text-decoration: none;

    color: #b5c7d9;

    border-bottom: 3px solid transparent;

    transition:
        color 0.15s ease,
        background 0.15s ease,
        border-color 0.15s ease;
}


.main-nav a:hover {
    color: white;

    background:
        rgba(32, 185, 255, 0.06);
}


.main-nav a.active {
    color: white;

    border-bottom-color: var(--cyan);

    background:
        linear-gradient(
            180deg,
            rgba(32, 185, 255, 0.10),
            rgba(32, 185, 255, 0.02)
        );
}


/* =========================================================
   Main
   ========================================================= */

main {
    width: min(1500px, 94%);
    margin: 0 auto;
}


/* =========================================================
   Hero
   ========================================================= */

.hero {
    text-align: center;

    padding:
        42px 20px
        34px;

    position: relative;
}


.hero h1 {
    margin: 0;

    font-size: clamp(2.4rem, 5vw, 4rem);

    line-height: 1;

    letter-spacing: -0.04em;
}


.hero-subtitle {
    margin-top: 8px;

    color: #b6c8db;

    font-size: clamp(1rem, 2vw, 1.35rem);

    font-weight: 600;

    letter-spacing: 0.08em;
}


.hero p {
    margin: 17px 0 0;

    color: #84a1be;

    letter-spacing: 0.18em;

    font-size: 0.9rem;
}


/* =========================================================
   Sections
   ========================================================= */

.server-section {
    margin-bottom: 38px;
}


.available-section {
    margin-top: 25px;
}


.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 16px;
}


.section-heading h2 {
    display: flex;
    align-items: center;

    gap: 12px;

    margin: 0;

    font-size: 1.65rem;

    letter-spacing: -0.02em;
}


.section-heading p {
    margin:
        5px 0
        0 41px;

    color: var(--text-muted);

    font-size: 0.9rem;
}


.server-count {
    color: #8fa8c4;

    font-size: 0.9rem;

    white-space: nowrap;
}


.online-dot {
    display: inline-block;

    width: 15px;
    height: 15px;

    border-radius: 50%;

    background: var(--green);

    box-shadow:
        0 0 8px rgba(37, 229, 134, 0.8),
        0 0 24px rgba(37, 229, 134, 0.55);
}


/* =========================================================
   Grid
   ========================================================= */

.server-grid {
    align-items: start;
    display: grid;

    gap: 20px;
}


.online-grid {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
}


.inactive-grid {
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
}


/* =========================================================
   Cards
   ========================================================= */

.server-card {
    align-self: start;
    height: auto;
    overflow: hidden;

    border-radius: 12px;

    border:
        1px solid var(--border);

    background:
        linear-gradient(
            180deg,
            #122238,
            #0b1727
        );

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.25);

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}


.server-card.online {
    border-color:
        rgba(37, 229, 134, 0.70);

    box-shadow:
        0 0 0 1px rgba(37, 229, 134, 0.10),
        0 15px 42px rgba(0, 0, 0, 0.34);
}


.server-card.online:hover {
    transform: translateY(-4px);

    box-shadow:
        0 0 22px rgba(37, 229, 134, 0.14),
        0 20px 50px rgba(0, 0, 0, 0.40);
}


.server-card.inactive {
    opacity: 0.72;

    filter: saturate(0.6);
}


.server-card.inactive:hover {
    opacity: 0.90;

    filter: saturate(0.8);
}


/* =========================================================
   Game artwork area
   ========================================================= */

.server-art {
    min-height: 195px;

    position: relative;

    display: flex;
    align-items: flex-end;

    padding: 20px;

    background-size: cover;
    background-position: center;

    isolation: isolate;
}


.inactive-grid .server-art {
    min-height: 145px;
}


.server-art::before {
    content: "";

    position: absolute;
    inset: 0;

    z-index: -1;

    background:
        linear-gradient(
            180deg,
            rgba(5, 12, 22, 0.10) 10%,
            rgba(5, 12, 22, 0.25) 50%,
            rgba(5, 12, 22, 0.94) 100%
        );
}


/* =========================================================
   Individual game themes
   ========================================================= */


.sdtd .server-art {
    background-image:
        linear-gradient(
            180deg,
            rgba(20, 5, 2, 0.05),
            rgba(15, 5, 5, 0.68)
        ),
        url("/assets/images/games/sdtd.webp");

    background-color: #4e2118;
    background-position: center 52%;
}

.valheim .server-art {
    background-image:
        linear-gradient(
            180deg,
            rgba(4, 15, 18, 0.05),
            rgba(5, 18, 24, 0.78)
        ),
        url("/assets/images/games/valheim.webp");

    background-color: #193943;
    background-position: 55% 50%;
}

.minecraft .server-art {
    background-image:
        linear-gradient(
            180deg,
            rgba(3, 20, 14, 0.05),
            rgba(5, 18, 15, 0.72)
        ),
        url("/assets/images/games/minecraft.webp");

    background-color: #1f4b36;
    background-position: center 58%;
}

.ark .server-art {
    background-image:
        linear-gradient(
            180deg,
            rgba(5, 18, 15, 0.10),
            rgba(5, 14, 20, 0.78)
        ),
        url("/assets/images/games/ark.webp");

    background-color: #23453d;
    background-position: 35% 45%;
}

.eco .server-art {
    background-image:
        linear-gradient(
            180deg,
            rgba(6, 25, 20, 0.10),
            rgba(5, 19, 22, 0.75)
        ),
        url("/assets/images/games/eco.webp");

    background-color: #315944;
    background-position: 52% 52%;
}

.icarus .server-art {
    background-image:
        linear-gradient(
            180deg,
            rgba(15, 20, 35, 0.10),
            rgba(7, 13, 29, 0.80)
        ),
        url("/assets/images/games/icarus.webp");

    background-color: #27334d;
    background-position: 38% 45%;
}

.satisfactory .server-art {
    background-image:
        linear-gradient(
            180deg,
            rgba(38, 18, 4, 0.05),
            rgba(24, 11, 6, 0.78)
        ),
        url("/assets/images/games/satisfactory.webp");

    background-color: #6a321a;
    background-position: 58% 50%;
}

/* =========================================================
   Card contents
   ========================================================= */

.game-title {
    font-size: clamp(1.5rem, 2vw, 2.25rem);

    font-weight: 900;

    letter-spacing: -0.04em;

    text-shadow:
        0 2px 10px rgba(0, 0, 0, 0.9);

    max-width: 75%;
}


.inactive-grid .game-title {
    font-size: 1.55rem;
}


.server-status {
    position: absolute;

    top: 15px;
    right: 15px;

    display: flex;
    align-items: center;

    gap: 7px;

    padding:
        7px 12px;

    border-radius: 999px;

    background:
        rgba(8, 19, 31, 0.82);

    border:
        1px solid rgba(168, 192, 216, 0.30);

    font-size: 0.7rem;

    font-weight: 800;

    letter-spacing: 0.05em;

    backdrop-filter: blur(8px);
}


.server-status span {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: #8a9daf;
}


.online .server-status {
    color: #4dff9d;

    border-color:
        rgba(37, 229, 134, 0.55);

    background:
        rgba(5, 57, 36, 0.85);
}


.online .server-status span {
    background: var(--green);

    box-shadow:
        0 0 8px rgba(37, 229, 134, 0.85);
}


/* =========================================================
   Stats
   ========================================================= */

.server-info {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 10px;

    padding:
        16px 18px;

    background:
        rgba(6, 16, 29, 0.72);
}


.server-stat {
    min-width: 0;

    padding-right: 10px;

    border-right:
        1px solid rgba(124, 160, 195, 0.18);
}


.server-stat:last-child {
    border-right: none;
}


.server-stat strong {
    display: block;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    font-size: 0.92rem;
}


.server-stat span {
    display: block;

    margin-top: 4px;

    color: var(--text-muted);

    font-size: 0.69rem;

    text-transform: uppercase;

    letter-spacing: 0.06em;
}


/* =========================================================
   Connection button
   ========================================================= */

.connection-button {
    display: block;

    margin:
        0 16px
        16px;

    padding:
        11px 16px;

    border-radius: 7px;

    text-align: center;

    text-decoration: none;

    font-weight: 700;

    font-size: 0.9rem;

    background:
        linear-gradient(
            90deg,
            #079ddf,
            #20b9ff
        );

    box-shadow:
        0 5px 15px rgba(0, 144, 215, 0.18);

    transition:
        filter 0.15s ease,
        transform 0.15s ease;
}


.connection-button:hover {
    filter: brightness(1.12);

    transform: translateY(-1px);
}


/* =========================================================
   Footer
   ========================================================= */

footer {
    min-height: 70px;

    display: flex;
    align-items: center;

    gap: 18px;

    padding:
        0 7%;

    margin-top: 48px;

    border-top:
        1px solid rgba(90, 140, 190, 0.20);

    color: #6f87a1;

    font-size: 0.78rem;
}


.footer-brand {
    color: white;

    font-weight: 800;

    font-size: 0.85rem;

    padding-right: 18px;

    border-right:
        1px solid rgba(100, 150, 195, 0.22);
}


/* =========================================================
   Responsive layout
   ========================================================= */

@media (max-width: 1150px) {

    .online-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .inactive-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 760px) {

    .site-header {
        padding:
            12px 5%;

        flex-direction: column;

        gap: 12px;
    }


    .main-nav {
        width: 100%;

        min-height: auto;

        justify-content: center;
    }


    .main-nav a {
        padding:
            12px 15px;
    }


    main {
        width: 92%;
    }


    .hero {
        padding-top: 32px;
    }


    .section-heading {
        align-items: flex-start;

        flex-direction: column;
    }


    .section-heading p {
        margin-left: 0;
    }


    .online-grid,
    .inactive-grid {
        grid-template-columns: 1fr;
    }


    .server-art,
    .inactive-grid .server-art {
        min-height: 180px;
    }


    footer {
        flex-direction: column;

        align-items: flex-start;

        justify-content: center;

        padding-top: 20px;
        padding-bottom: 20px;
    }
}
/* =========================================================
   UI interaction
   ========================================================= */

/*
   Make the dashboard behave more like an application UI
   than a document.
*/
body {
    user-select: none;
    -webkit-user-select: none;
    overflow-x: hidden;
}

/*
   Keep normal browser behavior available wherever we
   explicitly decide text should be selectable later.
*/
.selectable {
    user-select: text;
    -webkit-user-select: text;
}


/* Remove mobile tap flash */
a,
button,
.server-card {
    -webkit-tap-highlight-color: transparent;
}


/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 1050px) {

    main {
        width: 92%;
    }

    .site-header {
        padding-left: 4%;
        padding-right: 4%;
    }

    .online-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .inactive-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    /*
       If there are three online servers,
       let the third one use the available width
       instead of becoming awkwardly narrow.
    */
    .online-grid .server-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .online-grid
    .server-card:last-child:nth-child(odd)
    .server-art {
        min-height: 220px;
    }
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 700px) {

    :root {
        --header-height: auto;
    }

    body {
        min-width: 0;
    }


    /* ---------- Header ---------- */

    .site-header {
        position: sticky;

        top: 0;

        flex-direction: column;

        padding:
            12px 14px 0;

        gap: 10px;
    }


    .brand {
        width: 100%;

        justify-content: center;
    }


    .brand-icon {
        width: 30px;
        height: 30px;
    }


    .brand-name {
        font-size: 1.15rem;
    }


    .brand-subtitle {
        font-size: 0.65rem;
    }


    .main-nav {
        width: 100%;

        min-height: auto;

        display: grid;

        grid-template-columns:
            repeat(3, 1fr);
    }


    .main-nav a {
        min-height: 48px;

        justify-content: center;

        padding:
            12px 6px;

        font-size: 0.87rem;

        white-space: nowrap;
    }


    /* ---------- Main ---------- */

    main {
        width: calc(100% - 28px);
    }


    /* ---------- Hero ---------- */

    .hero {
        padding:
            28px 8px
            30px;
    }


    .hero h1 {
        font-size: clamp(
            2.3rem,
            13vw,
            3.3rem
        );
    }


    .hero-subtitle {
        margin-top: 6px;

        font-size: 1rem;

        letter-spacing: 0.05em;
    }


    .hero p {
        margin-top: 14px;

        font-size: 0.68rem;

        letter-spacing: 0.14em;
    }


    /* ---------- Section headings ---------- */

    .section-heading {
        display: grid;

        grid-template-columns:
            1fr auto;

        align-items: end;

        gap:
            4px 10px;
    }


    .section-heading h2 {
        font-size: 1.35rem;
    }


    .section-heading p {
        grid-column: 1 / -1;

        margin:
            4px 0
            0;

        font-size: 0.78rem;

        line-height: 1.4;
    }


    .server-count {
        align-self: center;

        font-size: 0.72rem;
    }


    .online-dot {
        width: 11px;
        height: 11px;
    }


    /* ---------- Cards ---------- */

    .online-grid,
    .inactive-grid {
        grid-template-columns: 1fr;
    }


    /*
       Undo tablet rule when only one column is used.
    */
    .online-grid .server-card:last-child:nth-child(odd) {
        grid-column: auto;
    }


    .server-card {
        width: 100%;

        border-radius: 10px;
    }


    .server-art,
    .inactive-grid .server-art,
    .online-grid
    .server-card:last-child:nth-child(odd)
    .server-art {
        min-height: 185px;

        padding: 17px;
    }


    .game-title {
        max-width: 70%;

        font-size: 1.75rem;
    }


    .inactive-grid .game-title {
        font-size: 1.55rem;
    }


    .server-status {
        top: 12px;
        right: 12px;

        padding:
            6px 10px;

        font-size: 0.64rem;
    }


    /* ---------- Stats ---------- */

    .server-info {
        padding:
            14px 15px;

        gap: 7px;
    }


    .server-stat {
        padding-right: 7px;
    }


    .server-stat strong {
        font-size: 0.84rem;
    }


    .server-stat span {
        font-size: 0.58rem;
    }


    /* ---------- Buttons ---------- */

    .connection-button {
        min-height: 46px;

        display: flex;

        align-items: center;
        justify-content: center;

        margin:
            0 14px
            14px;

        font-size: 0.88rem;
    }


    /* ---------- Footer ---------- */

    footer {
        min-height: auto;

        margin-top: 35px;

        padding:
            20px 7%;

        flex-direction: column;

        align-items: flex-start;

        gap: 8px;
    }


    .footer-brand {
        border-right: none;

        padding-right: 0;
    }
}


/* =========================================================
   Very small phones
   ========================================================= */

@media (max-width: 390px) {

    .main-nav a {
        font-size: 0.78rem;
    }


    .hero h1 {
        font-size: 2.2rem;
    }


    .section-heading {
        grid-template-columns: 1fr;
    }


    .server-count {
        margin-top: 3px;
    }


    .server-info {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }


    .server-stat strong {
        font-size: 0.75rem;
    }
} /* end @media (max-width: 390px) */

.server-card-summary {
    cursor: pointer;
}

.server-card-summary:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: -2px;
}


.server-expanded {
    padding: .9rem 1rem 1rem;

    border-top: 1px solid rgba(255,255,255,.08);

    background: rgba(4, 12, 22, .55);
}

.server-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.server-action-button {
    flex: 1;

    min-width: 140px;

    padding: .65rem .9rem;

    border-radius: 6px;

    background: #20afe8;

    color: white;

    text-align: center;
    text-decoration: none;

    font-size: .82rem;
    font-weight: 700;
}

.server-action-button:hover {
    filter: brightness(1.08);
}

.server-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;

    margin-bottom: .75rem;
}

.server-badge {
    padding: .3rem .55rem;

    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;

    background: rgba(255,255,255,.06);

    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .06em;
}

.server-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;

    margin-top: .8rem;

    color: #6f89a2;

    font-size: .68rem;
}

.collector-warning {
    color: #ffb85c;
}

.collector-error {
    border-color: rgba(255,184,92,.75);
}
.server-card-summary {
    position: relative;
    cursor: pointer;
}

/* Small corner chevron */
.server-card-summary::after {
    content: "";
    position: absolute;

    right: 14px;
    bottom: 11px;

    width: 8px;
    height: 8px;

    border-right: 2px solid #66829b;
    border-bottom: 2px solid #66829b;

    transform: rotate(45deg);

    transition:
        transform .2s ease,
        border-color .2s ease;
}

.server-card:hover .server-card-summary::after {
    border-color: #a0bdd4;
}

.server-card.expanded .server-card-summary::after {
    transform: rotate(225deg);
}

.server-card {
    transition:
        transform .18s ease,
        border-color .18s ease,
        box-shadow .18s ease;
}

.server-card:hover {
    transform: translateY(-2px);
}

.server-card.online:hover {
    box-shadow:
        0 8px 24px rgba(0, 255, 160, .08);
}

.server-expanded {
    padding: 12px 15px 11px;

    border-top: 1px solid rgba(255,255,255,.08);

    background:
        linear-gradient(
            180deg,
            rgba(7,18,31,.92),
            rgba(5,14,25,.98)
        );
}

.server-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.server-actions .connection-button {
    flex: 1;
    min-width: 140px;

    margin: 0;
}

.server-card-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;

    margin-top: 9px;

    color: #627d96;

    font-size: .65rem;
    letter-spacing: .02em;
}

.collector-warning {
    margin-left: auto;
    color: #ffb85c;
}
.collector-error {
    border-color:
        rgba(255,184,92,.75);
}