:root {
    --primary: #FF3B30;
    --primary-glow: rgba(255, 59, 48, 0.25);
    --bg-page: #0F0F11;
    --bg-card: #1C1C1E;
    --bg-input: #2C2C2E;
    --text-main: #FFFFFF;
    --text-sub: #8E8E93;
    --success: #32D74B;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-page);
    background-image: radial-gradient(circle at 50% 0%, #2a1010 0%, var(--bg-page) 70%);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh; 
    margin: 0;
    overflow: hidden;
    color: var(--text-main);
}

.container {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 20px;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.8;
}

/* Header Row */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background-color: #555;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    transition: all 0.3s;
}
.status-dot.active { background-color: var(--success); box-shadow: 0 0 8px var(--success); }

.stat-display {
    font-size: 0.9rem;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 10px;
}
.live-count { color: white; font-weight: 700; font-size: 1.1rem; color: var(--primary); }

/* Controls Row */
.controls-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr auto auto;
    gap: 10px;
    align-items: center;
}

input[type="text"] {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid transparent;
    padding: 10px 15px;
    border-radius: 10px;
    color: white;
    font-size: 0.85rem;
    transition: all 0.2s;
}
input[type="text"]:focus {
    outline: none;
    background: #3A3A3C;
    border-color: rgba(255, 59, 48, 0.5);
}

.btn-check {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px var(--primary-glow);
    height: 100%;
}
.btn-check:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn-check:disabled { background: #444; cursor: not-allowed; box-shadow: none; }

/* Toggle */
.toggle-wrapper { display: flex; align-items: center; gap: 8px; }
.switch { position: relative; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #3A3A3C; border-radius: 34px; transition: .3s; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 2px; bottom: 2px; background-color: white; border-radius: 50%; transition: .3s; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(16px); }
.toggle-label { font-size: 0.75rem; color: var(--text-sub); white-space: nowrap; }

/* Table Area */
.table-wrapper {
    height: 430px; 
    overflow-y: auto;
    border-radius: 12px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
}

table { width: 100%; border-collapse: collapse; }

thead { position: sticky; top: 0; z-index: 10; background: #252527; }
th { 
    text-align: left; 
    padding: 12px 15px; 
    color: var(--text-sub); 
    font-size: 0.75rem; 
    font-weight: 600; 
    text-transform: uppercase; 
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

td { padding: 10px 15px; font-size: 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.03); }
tr:last-child td { border-bottom: none; }
tr.player-row:hover { background: rgba(255,255,255,0.04); }

.id-cell { font-family: 'JetBrains Mono'; color: var(--text-sub); width: 10%; }
.name-cell { font-weight: 600; color: #fff; width: 40%; }
.ip-cell { font-family: 'JetBrains Mono'; color: var(--text-sub); font-size: 0.75rem; width: 35%; }
.ping-cell { color: var(--primary); font-weight: 600; font-family: 'JetBrains Mono'; text-align: right; width: 15%; }

/* Pagination & Footer */
.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 5px;
}
.last-update { font-size: 0.75rem; color: #555; }

.pagination { display: flex; gap: 10px; align-items: center; }
.btn-page {
    background: transparent;
    color: var(--text-sub);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
}
.btn-page:hover:not(:disabled) { background: #333; color: white; }
.btn-page:disabled { opacity: 0.3; cursor: default; }

.empty-msg { text-align: center; color: var(--text-sub); padding: 40px; font-style: italic; }

.table-wrapper::-webkit-scrollbar { width: 6px; }
.table-wrapper::-webkit-scrollbar-track { background: transparent; }
.table-wrapper::-webkit-scrollbar-thumb { background-color: #444; border-radius: 10px; }

@media (max-width: 700px) {
    .controls-grid { grid-template-columns: 1fr 1fr; }
    .btn-check { grid-column: span 2; }
    .toggle-wrapper { grid-column: span 2; justify-content: center; }
    .container { padding: 1rem; }
}