:root {
    --bg: #0b090b;
    --surface: rgba(34, 20, 22, 0.9);
    --surface-alt: rgba(50, 28, 31, 0.92);
    --line: #6d4a3a;
    --text: #f7ead2;
    --muted: #c5ab95;
    --brand: #b1231e;
    --brand-2: #c49a52;
    --shadow: rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        linear-gradient(rgba(7, 6, 8, 0.84), rgba(7, 6, 8, 0.9)),
        radial-gradient(circle at 18% 18%, rgba(160, 35, 30, 0.22), transparent 38%),
        radial-gradient(circle at 82% 22%, rgba(214, 154, 70, 0.18), transparent 36%),
        radial-gradient(circle at 50% 78%, rgba(45, 60, 94, 0.2), transparent 52%),
        var(--bg);
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    min-height: 100vh;
}

.container {
    width: min(1100px, 92vw);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 9;
    backdrop-filter: blur(8px);
    background: rgba(17, 10, 11, 0.88);
    border-bottom: 1px solid rgba(188, 144, 78, 0.4);
    box-shadow: 0 8px 28px var(--shadow);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 76px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.logo-mark {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    border-radius: 12px;
    box-shadow: 0 0 0 1px rgba(236, 184, 97, 0.42);
}

.logo-text {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.08em;
    color: #f8dfb8;
}

.main-nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.lang-switcher {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(196, 154, 82, 0.35);
    text-decoration: none;
    color: var(--muted);
    background: rgba(35, 18, 20, 0.8);
    font-weight: 700;
    font-size: 0.9rem;
}

.lang-btn .flag img {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: block;
}

.lang-btn.active,
.lang-btn:hover {
    color: #ffe7be;
    border-color: rgba(223, 176, 99, 0.65);
    background: rgba(64, 32, 30, 0.82);
}

.main-nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 6px 12px;
}

.main-nav a:hover {
    color: var(--text);
    border-color: rgba(196, 154, 82, 0.42);
    background: rgba(56, 29, 28, 0.44);
}

.hero {
    padding: 78px 0 32px;
}

.eyebrow {
    display: inline-block;
    margin: 0 0 10px;
    color: var(--brand-2);
    font-weight: 700;
    letter-spacing: 0.12em;
}

h1, h2 {
    margin: 0 0 12px;
    font-family: 'Cinzel', serif;
    line-height: 1.14;
    letter-spacing: 0.02em;
}

h1 {
    font-size: clamp(2rem, 4vw, 3rem);
}

p {
    margin: 0;
    color: var(--muted);
}

.hero-text {
    max-width: 65ch;
    margin-top: 14px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin: 24px 0 60px;
}

.game-card {
    background:
        linear-gradient(rgba(13, 8, 10, 0.43), rgba(13, 8, 10, 0.53)),
        linear-gradient(165deg, color-mix(in srgb, var(--accent) 20%, var(--surface)) 0%, rgba(27, 16, 18, 0.78) 62%),
        var(--game-bg);
    background-size: cover;
    background-position: center;
    background-blend-mode: normal, normal, normal;
    border: 1px solid color-mix(in srgb, var(--accent) 58%, var(--line));
    border-radius: 16px;
    padding: 20px;
    display: flex;
    min-height: 280px;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
}

.meta, .top-server {
    margin-top: 10px;
}

.top-server-name {
    color: #e9be66;
}

.panel {
    margin: 32px 0;
    padding: 22px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(58, 31, 31, 0.66), rgba(27, 17, 18, 0.88));
    box-shadow: 0 22px 42px var(--shadow);
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.category-panel {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 10px;
}

.category-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--game-category-bg);
    background-size: cover;
    background-position: center;
    opacity: 0.42;
    pointer-events: none;
}

.category-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(37, 20, 21, 0.56), rgba(21, 14, 15, 0.64));
    pointer-events: none;
}

.category-panel > * {
    position: relative;
    z-index: 1;
}

.category-head {
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
}

.category-head h1 {
    margin: 0;
}

.category-desc {
    margin: 0;
}

.category-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-form label {
    color: #f0d0a7;
    font-weight: 700;
}

.filter-form select {
    min-width: 190px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(31, 19, 21, 0.95);
    color: #f7e3c5;
    padding: 10px 11px;
    font-family: inherit;
    font-size: 1rem;
}

.result-count {
    margin-top: 10px;
    color: #e3bc8d;
    font-weight: 700;
}

.voting-off-note {
    margin-top: 10px;
    color: #ffb2b2;
    font-weight: 700;
}

.auth-panel {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.auth-form {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.auth-form label {
    color: #f0d0a7;
    font-weight: 700;
}

.auth-form input,
.auth-form select,
.auth-form textarea {
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(31, 19, 21, 0.95);
    color: #f7e3c5;
    padding: 11px 12px;
    font-family: inherit;
    font-size: 1rem;
}

.auth-form textarea {
    resize: vertical;
}

.auth-help {
    margin-top: 12px;
}

.field-help {
    font-size: 0.9rem;
    color: #d0b18a;
}

.auth-help a {
    color: #ffd9a3;
    text-decoration: none;
    font-weight: 700;
}

.captcha-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.captcha-row img {
    width: 180px;
    height: 56px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #241618;
}

.btn-inline {
    width: auto;
}

.admin-form {
    grid-template-columns: 1fr;
}

.hidden-fields {
    display: none !important;
}

.rates-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr 1fr;
    align-items: center;
}

.single-line-form .my-server-fields-stack {
    display: grid;
    gap: 10px;
}

.single-line-form .rates-grid-single {
    grid-template-columns: 1fr;
    gap: 10px;
}

.single-line-form label,
.single-line-form input,
.single-line-form select,
.single-line-form textarea {
    width: 100%;
    display: block;
}

.embed-builder {
    margin-top: 18px;
    border: 1px dashed rgba(196, 154, 82, 0.55);
    border-radius: 12px;
    padding: 14px;
    background: rgba(27, 16, 18, 0.72);
    display: grid;
    gap: 10px;
}

.embed-builder h3 {
    margin: 0;
    font-size: 1.15rem;
}

.embed-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 8px 10px;
}

.embed-builder textarea {
    min-height: 220px;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.88rem;
    line-height: 1.4;
    resize: vertical;
}

.embed-preview-wrap {
    margin-top: 4px;
}

.embed-preview-frame {
    width: 100%;
    min-height: 240px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #0f0b0d;
}

@media (max-width: 820px) {
    .embed-grid {
        grid-template-columns: 1fr;
    }
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.admin-table th,
.admin-table td {
    border: 1px solid var(--line);
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
}

.admin-subnav {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-subnav a {
    text-decoration: none;
    border: 1px solid rgba(198, 153, 85, 0.5);
    border-radius: 999px;
    padding: 6px 12px;
    color: #f0d3aa;
    background: rgba(61, 34, 33, 0.7);
    font-weight: 700;
    font-size: 0.92rem;
}

.admin-subnav a:hover {
    background: rgba(86, 48, 41, 0.82);
}

.admin-tab {
    border: 1px solid rgba(198, 153, 85, 0.5);
    border-radius: 999px;
    padding: 6px 12px;
    color: #f0d3aa;
    background: rgba(61, 34, 33, 0.7);
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
}

.admin-tab:hover {
    background: rgba(86, 48, 41, 0.82);
}

.admin-tab.active {
    border-color: rgba(236, 184, 97, 0.82);
    box-shadow: 0 0 0 1px rgba(236, 184, 97, 0.25) inset;
}

.admin-section {
    display: none;
}

.admin-section.admin-section-active {
    display: block;
}

.inline-form {
    display: contents;
}

.inline-form input,
.inline-form select {
    width: 100%;
}

.inline-edit-game {
    display: contents;
}

.inline-edit-game input,
.inline-edit-game select,
.inline-edit-game textarea {
    width: 100%;
}

.action-stack {
    display: grid;
    gap: 6px;
}

.btn-small {
    padding: 7px 10px;
    font-size: 0.88rem;
}

.mail-config {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mail-config span {
    border: 1px solid var(--line);
    background: rgba(38, 22, 23, 0.8);
    border-radius: 10px;
    padding: 6px 10px;
}

.admin-table th {
    color: #ffd8ab;
    background: rgba(56, 32, 30, 0.82);
    white-space: nowrap;
}

.btn-danger {
    background: linear-gradient(135deg, #8f1c1c, #c62b2b);
}

.status-on,
.status-off {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 700;
    font-size: 0.9rem;
}

.status-on {
    background: rgba(39, 110, 66, 0.3);
    border: 1px solid #3f9460;
    color: #a9f3c6;
}

.status-off {
    background: rgba(125, 32, 32, 0.3);
    border: 1px solid #c44a4a;
    color: #ffb5b5;
}

.server-list {
    display: grid;
    gap: 18px;
    margin-bottom: 70px;
}

.server-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(64, 36, 37, 0.68), rgba(23, 16, 17, 0.94));
    box-shadow: 0 18px 34px var(--shadow);
}

.server-banner-wrap {
    position: relative;
    overflow: hidden;
}

.server-card.rank-gold {
    border: 1px solid #d8b25e;
    box-shadow: 0 0 0 1px rgba(216, 178, 94, 0.35), 0 22px 36px rgba(216, 178, 94, 0.14);
}

.server-card.rank-silver {
    border: 1px solid #b9bec7;
    box-shadow: 0 0 0 1px rgba(185, 190, 199, 0.28), 0 18px 30px rgba(185, 190, 199, 0.12);
}

.server-card.rank-bronze {
    border: 1px solid #be7d4b;
    box-shadow: 0 0 0 1px rgba(190, 125, 75, 0.28), 0 18px 30px rgba(190, 125, 75, 0.12);
}

.rank-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(8, 6, 6, 0.88);
    color: #ffe6c2;
    font-weight: 700;
    border-radius: 999px;
    padding: 5px 11px;
    z-index: 1;
    border: 1px solid rgba(196, 154, 82, 0.54);
}

.vote-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, rgba(172, 35, 31, 0.88), rgba(196, 154, 82, 0.92));
    color: #fff8ec;
    font-weight: 800;
    border-radius: 999px;
    padding: 6px 12px;
    z-index: 1;
    border: 1px solid rgba(255, 220, 157, 0.52);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.server-status-badge {
    position: absolute;
    top: 12px;
    left: 130px;
    z-index: 2;
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 800;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.server-status-badge.status-online {
    background: rgba(29, 112, 66, 0.92);
    border-color: rgba(134, 235, 171, 0.6);
    color: #e6ffef;
}

.server-status-badge.status-offline {
    background: rgba(133, 25, 33, 0.9);
    border-color: rgba(255, 155, 155, 0.52);
    color: #ffe6e6;
}

.server-status-badge.status-unknown {
    background: rgba(90, 77, 41, 0.9);
    border-color: rgba(236, 205, 145, 0.46);
    color: #fff0cf;
}

.server-card img, .detail-banner {
    width: 100%;
    height: clamp(150px, 28vw, 240px);
    object-fit: cover;
    display: block;
}

.server-banner-wrap img,
.server-banner-wrap .detail-banner {
    filter: saturate(1.06) contrast(1.03) brightness(1.02);
}

.server-body, .detail-content {
    padding: 18px;
}

.server-meta {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.server-meta span {
    border: 1px solid var(--line);
    background: var(--surface-alt);
    padding: 7px 10px;
    border-radius: 10px;
    color: #f3ddc4;
    font-weight: 600;
}

.actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    background: linear-gradient(135deg, var(--brand), #da6f2b);
    border: 0;
    color: #fff;
    text-decoration: none;
    padding: 11px 16px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.btn:hover {
    filter: brightness(1.07);
}

.btn:disabled {
    cursor: not-allowed;
    filter: grayscale(0.6);
}

.btn-ghost {
    border: 1px solid var(--line);
    background: rgba(36, 21, 23, 0.86);
    color: #f5d5af;
}

.server-detail {
    margin: 36px 0 60px;
    border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 24%, var(--surface)) 0%, rgba(21, 14, 15, 0.95) 62%);
}

.flash {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 9px;
    font-weight: 700;
}

.flash-ok {
    background: #1f4e2f;
    border: 1px solid #2f7a49;
}

.flash-error {
    background: #5f1f28;
    border: 1px solid #9f3b4d;
}

.cooldown {
    margin-top: 12px;
    border: 1px dashed #cfa861;
    color: #ffdca8;
    padding: 10px 12px;
    border-radius: 10px;
}

.launch-countdown {
    margin-top: 12px;
    border: 1px solid rgba(255, 111, 97, 0.65);
    color: #ffe8e4;
    padding: 12px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(142, 24, 24, 0.88), rgba(177, 38, 38, 0.9));
    box-shadow: 0 0 0 1px rgba(255, 132, 120, 0.2) inset;
    animation: pulse-red 1.8s ease-in-out infinite;
    font-weight: 700;
}

.start-ribbon.launch-countdown {
    position: absolute;
    top: 38px;
    right: -82px;
    margin-top: 0;
    z-index: 3;
    transform: rotate(45deg);
    border-radius: 0;
    min-width: 300px;
    text-align: center;
    padding: 8px 16px;
    border: 1px solid rgba(255, 194, 194, 0.36);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.4);
}

.start-ribbon .countdown-time {
    display: none;
}

.required-fields-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 14px;
    margin-bottom: 8px;
}

.required-fields-grid-table {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 280px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.93rem;
}

.field-pair {
    display: block;
}

.launch-countdown .countdown-date {
    opacity: 0.95;
}

.launch-countdown .countdown-time {
    color: #fff6f4;
}

.launch-countdown.launch-live {
    background: linear-gradient(135deg, rgba(34, 120, 63, 0.9), rgba(45, 149, 82, 0.9));
    border-color: rgba(111, 223, 151, 0.66);
    animation: none;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(195, 36, 36, 0.42);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(195, 36, 36, 0.06);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(195, 36, 36, 0);
    }
}

.site-footer {
    border-top: 1px solid rgba(196, 154, 82, 0.34);
    padding: 20px 0;
    background: rgba(14, 9, 10, 0.7);
}

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.bg-orb {
    position: fixed;
    width: 330px;
    height: 330px;
    border-radius: 999px;
    filter: blur(80px);
    opacity: 0.18;
    pointer-events: none;
    z-index: -1;
}

.bg-orb-red {
    background: #8f1d23;
    top: -110px;
    left: -110px;
}

.bg-orb-gold {
    background: #b8893e;
    bottom: -130px;
    right: -100px;
}

@media (max-width: 760px) {
    .nav-wrap {
        min-height: auto;
        padding: 14px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .lang-switcher {
        width: 100%;
    }

    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-form select {
        width: 100%;
    }

    .category-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .category-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .result-count {
        order: 2;
    }

    .actions {
        flex-direction: column;
    }

    .footer-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .admin-table th,
    .admin-table td {
        white-space: nowrap;
    }

    .required-fields-grid,
    .required-fields-grid-table {
        grid-template-columns: 1fr;
    }

    .footer-row {
        flex-wrap: wrap;
    }

    .start-ribbon.launch-countdown {
        top: 34px;
        right: -94px;
        min-width: 300px;
        font-size: 0.84rem;
    }
}
