/* ---------- MREJATA HOMEPAGE THEME ---------- */
:root {
    --bg: #070a12;
    --bg-soft: #0d1324;
    --card: rgba(15, 23, 42, .82);
    --card-strong: rgba(17, 24, 39, .96);
    --line: rgba(148, 163, 184, .18);
    --text: #eef2ff;
    --muted: #9ca3af;
    --accent: #38bdf8;
    --accent-2: #a78bfa;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 24px 80px rgba(0,0,0,.42);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
}

body {
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, .20), transparent 34rem),
        radial-gradient(circle at 82% 12%, rgba(167, 139, 250, .18), transparent 30rem),
        radial-gradient(circle at 50% 100%, rgba(34, 197, 94, .08), transparent 28rem),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 76%);
    z-index: -1;
}

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

a:hover {
    color: #bae6fd;
}

/* ---------- HEADER ---------- */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    backdrop-filter: blur(16px);
    background: linear-gradient(180deg, rgba(7,10,18,.76), rgba(7,10,18,.34));
    border-bottom: 1px solid rgba(148, 163, 184, .10);
}

.logo-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px;
}

.logo {
    display: grid;
    place-items: center;
}

.logo img {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    box-shadow: 0 12px 38px rgba(56,189,248,.20);
}

.nav-links {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-links:last-child {
    justify-content: flex-end;
}

.nav-links a,
.social-icons a {
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, .62);
    color: #dbeafe;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}

.nav-links a:hover,
.social-icons a:hover {
    transform: translateY(-1px);
    border-color: rgba(56, 189, 248, .55);
    background: rgba(56, 189, 248, .12);
    color: #fff;
}

/* ---------- ADS ---------- */
.ads-inline,
.banner-ad {
    width: min(1180px, calc(100% - 32px));
    display: flex !important;
    justify-content: center;
    align-items: center;
    margin: 24px auto;
    text-align: center;
}

.ads-inline iframe,
.banner-ad iframe,
.ad-section iframe {
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

/* ---------- GAME SECTIONS ---------- */
#games-wrapper {
    width: 100%;
}

.game-section {
    width: min(1180px, calc(100% - 32px));
    margin: 42px auto;
}

.game-section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.game-section-header h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 48px);
    line-height: .98;
    color: var(--text);
    letter-spacing: -.05em;
}

.game-section-header span {
    color: var(--muted);
    font-weight: 800;
}

/* ---------- GAME GRID ---------- */
.game-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

/* ---------- SERVER CARD ---------- */
.server-card {
    position: relative;
    overflow: hidden;
    min-height: 260px;
    border-radius: 28px;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.server-card:hover {
    transform: translateY(-5px);
    border-color: rgba(56,189,248,.45);
    box-shadow:
        0 30px 90px rgba(0,0,0,.52),
        0 0 42px rgba(56,189,248,.16);
}

.server-card-overlay {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    background:
        linear-gradient(180deg, rgba(2,6,23,.12), rgba(2,6,23,.96)),
        radial-gradient(circle at top right, rgba(56,189,248,.16), transparent 260px),
        radial-gradient(circle at bottom left, rgba(167,139,250,.13), transparent 240px);
}

.server-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.server-top img {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    object-fit: cover;
    background: rgba(2,6,23,.74);
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.server-name {
    font-size: 21px;
    font-weight: 900;
    letter-spacing: -.035em;
    color: #f8fafc;
    line-height: 1.08;
}

.server-game {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.server-meta {
    margin-top: 14px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.7;
}

.server-links {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.server-links a {
    border: 1px solid var(--line);
    background: rgba(15,23,42,.72);
    color: #dbeafe;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 800;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}

.server-links a:hover {
    transform: translateY(-1px);
    border-color: rgba(56,189,248,.5);
    background: rgba(56,189,248,.12);
    color: #fff;
}

/* ---------- HOSTING SECTION ---------- */
.image-links {
    width: min(1180px, calc(100% - 32px));
    margin: 18px auto 28px;
    text-align: center;
}

.image-links center {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.image-links a {
    display: grid;
    place-items: center;
    min-width: 140px;
    min-height: 72px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255,255,255,.06);
    padding: 12px;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.image-links a:hover {
    transform: translateY(-2px);
    border-color: rgba(56,189,248,.45);
    background: rgba(56,189,248,.08);
}

.image-links img {
    width: auto !important;
    max-width: 120px;
    max-height: 42px;
    object-fit: contain;
}

/* Text line before hosting logos */
.banner-ad + text,
body > br {
    color: var(--muted);
}

/* ---------- FOOTER ---------- */
.footer {
    width: min(1180px, calc(100% - 32px));
    margin: 36px auto 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 22px 0 34px;
    color: var(--muted);
    font-size: 14px;
}

.footer .copyright {
    color: var(--muted);
    font-size: 14px;
}

.footer .copyright a,
.footer .copyright a:visited,
.footer .copyright a:hover,
.footer .copyright a:active,
.footer .copyright a:focus {
    color: #dbeafe;
    text-decoration: none;
    font-size: 14px;
}

.footer .social-icons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.footer .social-icons a {
    width: 42px;
    height: 42px;
    padding: 0;
    display: grid;
    place-items: center;
    font-size: 18px;
}

.footer .social-icons a:hover {
    color: #bae6fd;
}

/* ---------- PAGE LOADER ---------- */
:root {
    --loader-size: 64px;
}

.o-page-loader {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(56,189,248,.20), transparent 30rem),
        radial-gradient(circle at 80% 20%, rgba(167,139,250,.20), transparent 28rem),
        var(--bg);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 1;
    pointer-events: all;
    transition: opacity .5s ease, visibility .5s ease;
}

.o-page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.o-page-loader--spinner {
    width: var(--loader-size);
    height: var(--loader-size);
    margin-bottom: 16px;
    animation: rotate-plane 1.2s infinite ease-in-out;
    transform-style: preserve-3d;
    object-fit: contain;
}

.o-page-loader--message {
    color: #fff;
    font-weight: 900;
    font-size: 1rem;
    text-align: center;
}

@keyframes rotate-plane {
    0% { transform: perspective(120px) rotateX(0deg) rotateY(0deg); }
    50% { transform: perspective(120px) rotateX(-180deg) rotateY(0deg); }
    100% { transform: perspective(120px) rotateX(-180deg) rotateY(-180deg); }
}

/* ---------- LEGACY / OPTIONAL ---------- */
.ad-container {
    border: 1px solid var(--line);
    padding: 12px;
    text-align: center;
    margin: 24px auto;
    max-width: 728px;
    border-radius: 18px;
    background: rgba(15,23,42,.62);
}

.ad-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.ad-container a.ad-link {
    margin-top: 6px;
    font-size: .9rem;
    color: #bae6fd;
    text-decoration: none;
    display: inline-block;
}

.ad-container a.ad-link:hover {
    text-decoration: underline;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
    .game-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .logo-nav {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 12px;
    }

    .nav-links,
    .nav-links:last-child {
        justify-content: center;
        flex-wrap: wrap;
    }

    .game-section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .logo img {
        width: 52px;
        height: 52px;
        border-radius: 16px;
    }

    .nav-links {
        gap: 6px;
    }

    .nav-links a {
        font-size: 12px;
        padding: 8px 9px;
    }

    .game-grid {
        grid-template-columns: 1fr;
    }

    .server-card,
    .server-card-overlay {
        min-height: 230px;
    }

    .server-top img {
        width: 50px;
        height: 50px;
        border-radius: 16px;
    }

    .server-name {
        font-size: 18px;
    }

    .ads-inline iframe,
    .banner-ad iframe {
        max-width: 100%;
    }

    .image-links a {
        min-width: 130px;
    }
}
