:root {
    --bg: #050816;
    --bg-elevated: #080e1f29;
    --bg-elevated-soft: #0c1326;
    --accent: #39ff88;
    --accent-soft: rgba(57, 255, 136, 0.12);
    --text: #e5ebff;
    --text-muted: #7d88a6;
    --border-soft: rgba(255, 255, 255, 0.13);
    --danger: #ff5573;
    --radius-card: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "BPG Nino Mtavruli Bold", "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(circle at top, #111827 0, var(--bg) 55%);
    color: var(--text);
}

.bg-gradient {
    position: fixed; inset: 0; z-index: -3;
    background:
        radial-gradient(60vw 60vw at 80% -10%, rgba(6,182,212,0.25), transparent 60%),
        radial-gradient(50vw 50vw at -10% 10%, rgba(139,92,246,0.25), transparent 60%),
        radial-gradient(40vw 40vw at 100% 100%, rgba(139,92,246,0.18), transparent 60%);
    filter: saturate(120%);
}

.bg-grid {
    position: fixed; inset: 0; z-index: -2;
    background-image: linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(1200px 1200px at 50% 10%, #000 60%, transparent);
    opacity: .2;
}

.bg-glows {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(200px 200px at 20% 85%, rgba(6,182,212,.25), transparent 60%),
        radial-gradient(250px 250px at 80% 20%, rgba(139,92,246,.25), transparent 60%);
    filter: blur(40px) saturate(140%);
}

/* Buttons */
a.btn-primary,
a.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: inherit;
}

.page {
    max-width: 1200px;
    margin: 32px auto 48px;
    padding: 0 16px;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.title-block {
    display: flex;
    gap: 10px;
}

.title-img {
    width: auto;
    height: 50px;
}

.title-text {
    display: flex;
    flex-direction: column;
}

.title-text h1 {
    margin: 0 0 6px;
    font-size: 28px;
    letter-spacing: 0.03em;
}

.title-block p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.btn-primary {
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 8px;
    background: linear-gradient(135deg, #22c55e40, #4ade8000);
    color: #020617;
    font-weight: 600;
    text-shadow: #00000096 5px 0 13px;
    border: 1px #1cde88 solid;
    font-size: 14px;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-0.5px);
    box-shadow: 0 0px 30px rgba(34, 197, 94, .4);
    background: linear-gradient(135deg, #22c55e, #4ade80);
    filter: brightness(1.06);
}

.btn-danger {
    border-radius: 8px;
    border: 1px solid rgba(248, 113, 113, 0.4);
    padding: 8px 16px;
    font-size: 13px;
    background: rgba(248, 113, 113, 0.08);
    color: #fecaca;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(248, 113, 113, 0.35);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.online-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 999px;
    border: 2px solid #19C37D;
    background: radial-gradient(circle at center, rgba(0, 255, 150, 0.15), rgba(0,0,0,0.4));
    font-family: "BPG Nino Mtavruli", "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
}

.online-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #19C37D;
    box-shadow: 0 0 10px rgba(25, 195, 125, 0.8);
}

/* ციფრის „დაწევა“ ოდნავ ქვემოთ */
#online-visitors {
    display: block;
    line-height: 1;
    position: relative;
    top: 1px;           /* თუ ისევ მაღლა ჩანს, დაუსვი 2px */
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-soft);
    padding: 14px 16px 18px;
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    box-shadow: #00000057 1px 1px 8px;
}

.stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.stat-value {
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "inter";
}

.stat-footer {
    font-size: 11px;
    color: var(--text-muted);
}
.pill-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-family: "inter";
    font-weight: 500;
}

.pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 8px;
    background: var(--accent);
}

.top-server-card {
    background: radial-gradient(circle at top left, rgba(59, 130, 246, .2), transparent 50%),
                linear-gradient(135deg, #02061775, #02061700);
    backdrop-filter: blur(18px);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-soft);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-badge {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.top-meta h2 {
    margin: 0;
    font-size: 16px;
    font-family: "inter";
}

.top-meta small {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-muted);
}

.top-right {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
}

.search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    position: relative;
}

.search-input input {
    width: 100%;
    padding: 10px 11px 10px 32px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 13px;
    font-family: "BPG Nino Mtavruli Bold", sans-serif;
    outline: none;
}

.search-input input::placeholder {
    color: var(--text-muted);
}

.search-input span {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-muted);
}

.filters {
    display: flex;
    gap: 8px;
}

.chip {
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}

.chip:hover {
    background: rgba(148, 163, 184, 0.08);
}

.chip.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(57, 255, 136, 0.4);
}

.table-wrapper {
    background: var(--bg-elevated-soft);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-soft);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead {
    background: rgba(15, 23, 42, .95);
}

thead th {
    text-align: left;
    font-weight: 500;
    padding: 10px 14px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

tbody tr {
    border-bottom: 1px solid rgba(15, 23, 42, 0.9);
}

tbody tr:hover {
    background: rgba(15, 23, 42, 0.85);
}

tbody td {
    padding: 8px 14px;
    white-space: nowrap;
    font-family: "inter";
}

tbody td.name {
    white-space: normal;
    font-weight: 500;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
}

.status-online {
    background: var(--accent-soft);
    color: var(--accent);
    font-family: "BPG Nino Mtavruli", sans-serif;
}

.status-offline {
    background: rgba(248, 113, 113, .12);
    color: var(--danger);
}

.map-tag {
    font-size: 12px;
    color: var(--text-muted);
    font-family: "inter";
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid rgba(15, 23, 42, 0.9);
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-buttons button {
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    padding: 5px 10px;
    font-size: 12px;
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-muted);
    cursor: pointer;
    font-family: "BPG Nino Mtavruli Bold", sans-serif;
}

.pagination-buttons button[disabled] {
    opacity: 0.4;
    cursor: default;
}

.pagination-buttons button.page-active {
    background: var(--accent);
    color: #020617;
    border-color: var(--accent);
}
/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-overlay.flex {
    display: flex;
}

.modal {
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    background: #020617;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.8);
}

.modal-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.modal-header h2 {
    margin: 0;
    font-size: 16px;
}

.modal-header p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

.modal-close {
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    padding: 4px 10px;
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 10px 16px 14px;
    font-size: 13px;
}

.modal-table-wrapper {
    max-height: 65vh;
    overflow-y: auto;
    margin-top: 6px;
}

.modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.modal-table thead {
    position: sticky;
    top: 0;
    background: #020617;
}

.modal-table th,
.modal-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(15, 23, 42, 0.9);
}

.text-danger {
    color: var(--danger);
}

.hidden {
    display: none !important;
}

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

/* Footer */
.site-footer {
    margin-top: 32px;
    padding: 14px 0 22px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid rgba(15, 23, 42, 0.9);
    opacity: 0.85;
}

.site-footer .footer-brand {
    font-weight: 500;
    color: #9ca3ff;
}

/* Clickable IP */
.ip-click {
    font-family: ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
}

.ip-click.copied {
    color: var(--accent);
}

/* Responsive — 900px */
@media (max-width: 900px) {
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Responsive — 720px */
@media (max-width: 720px) {
    .page {
        max-width: 100%;
        margin: 16px auto 32px;
        padding: 0 12px;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
    }

    .header-actions a {
        flex: 1 1 auto;
        text-align: center;
    }

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

    .top-server-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filters {
        flex-wrap: wrap;
    }

    .table-wrapper {
        border-radius: 16px;
    }

    table,
    thead,
    tbody,
    th,
    tr {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    tbody tr {
        background: var(--bg-elevated);
        border-radius: 16px;
        margin: 0 0 10px;
        padding: 8px 10px;
        border: 1px solid rgba(15, 23, 42, 0.9);
    }

    tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
        white-space: normal;
    }

    tbody td::before {
        content: attr(data-label);
        font-size: 11px;
        color: var(--text-muted);
        margin-right: 8px;
    }

    .table-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .rank-badge {
        font-weight: 600;
        font-size: 14px;
        color: #4ade80; /* მწვანე */
    }

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

    .pagination-buttons {
        flex-wrap: wrap;
    }

    .modal {
        max-width: 100%;
        height: auto;
        border-radius: 0;
    }
}
