:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    background-color: #0a0e1a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0a0e1a 0%, #6366f120 100%);
    color: #ffffff;
    min-height: 100vh;
    position: relative;
    transition: background 0.6s ease;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.header {
    background: rgba(20, 24, 38, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 24px 32px;
    margin-bottom: 24px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: rgb(253, 253, 253);
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.game-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.game-btn {
    background: rgba(20, 24, 38, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #a1a1aa;
    font-size: 13px;
    font-weight: 500;
}

.game-btn:hover {
    background: rgba(30, 34, 48, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.game-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.25));
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3), inset 0 0 20px rgba(99, 102, 241, 0.1);
}

.game-icon {
    font-size: 28px;
}

.main-panel {
    background: rgba(20, 24, 38, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 32px;
}

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

#panel-title {
    font-size: 24px;
    font-weight: 600;
}

.btn-add {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.servers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #52525b;
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 4px;
}

.empty-state span {
    font-size: 13px;
    opacity: 0.6;
}

.server-card {
    background: rgba(30, 34, 48, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.server-card:hover {
    background: rgba(40, 44, 58, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
    cursor: pointer;
}

.server-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.server-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.server-icon svg {
    width: 28px;
    height: 28px;
}

.server-details {
    flex: 1;
}

.server-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.server-address {
    font-size: 13px;
    color: #71717a;
    font-family: 'Courier New', monospace;
}

.player-heads {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.player-head {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    object-fit: cover;
    transition: transform 0.2s, border-color 0.2s;
}

.player-head:hover {
    transform: scale(1.2);
    border-color: var(--primary-color);
    z-index: 10;
}

.player-head-more {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: white;
}

.server-stats {
    display: flex;
    align-items: center;
    gap: 24px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-size: 13px;
}

.stat-players {
    cursor: pointer;
    transition: all 0.2s;
}

.stat-players:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: scale(1.05);
}

.stat svg {
    width: 16px;
    height: 16px;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-online {
    color: #22c55e;
}

.status-online .status-dot {
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}

.status-offline {
    color: #ef4444;
}

.status-offline .status-dot {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

.status-checking {
    color: #f59e0b;
}

.status-checking .status-dot {
    background: #f59e0b;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

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

.icon-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.icon-btn.delete:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #14182b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.info-address {
    font-size: 13px;
    color: #71717a;
    margin-top: 4px;
    font-family: 'Courier New', monospace;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: #a1a1aa;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e4e4e7;
}

.modal-body {
    padding: 24px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #a1a1aa;
}

#port-hint {
    color: #71717a;
    font-weight: 400;
}

.input-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    color: #e4e4e7;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.06);
}

.input-group input::placeholder {
    color: #52525b;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: #e4e4e7;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.info-grid > .info-card:nth-child(n+3) {
    /* Allow these cards to take full width if needed */
}

.info-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

.info-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.info-motd {
    grid-column: 1 / -1;
}

#info-motd {
    font-family: 'Courier New', monospace;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.info-card-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: #a1a1aa;
}

.info-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.info-row span:first-child {
    color: #71717a;
}

.info-value {
    font-weight: 600;
}

.info-ip {
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    transition: width 0.3s;
}

.player-gauge-container {
    width: 100%;
}

.gauge-labels {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.gauge-current {
    color: var(--primary-color);
}

.gauge-separator {
    color: #52525b;
}

.gauge-max {
    color: #71717a;
    font-size: 14px;
}

.gauge-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: all 0.5s ease;
    border-radius: 10px;
}

.info-section {
    margin-top: 24px;
}

.info-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #000007;
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .header {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }

    .game-selector {
        grid-template-columns: repeat(3, 1fr);
    }

    .main-panel {
        padding: 20px;
    }

    .server-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .server-stats {
        width: 100%;
        justify-content: space-between;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}
.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.player-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.player-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.player-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: white;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-name {
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    word-break: break-word;
    max-width: 100%;
}

.no-players {
    text-align: center;
    padding: 24px;
    color: #71717a;
    font-size: 14px;
    grid-column: 1 / -1;
}

.no-player-list {
    text-align: center;
    padding: 32px;
    color: #71717a;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    grid-column: 1 / -1;
}

.no-player-list svg {
    opacity: 0.4;
}

.no-player-list p {
    font-size: 16px;
    font-weight: 600;
    color: #e4e4e7;
    margin: 0;
}

.info-status-online {
    color: #22c55e;
    font-weight: 600;
}

.info-status-offline {
    color: #ef4444;
    font-weight: 600;
}

.mode-premium {
    color: #22c55e;
    font-weight: 600;
}

.mode-cracked {
    color: #f59e0b;
    font-weight: 600;
}

.server-status-info {
    font-size: 12px;
    color: #71717a;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .header {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }

    .game-selector {
        grid-template-columns: repeat(3, 1fr);
    }

    .main-panel {
        padding: 20px;
    }

    .server-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .server-stats {
        width: 100%;
        justify-content: space-between;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .modal-large {
        max-width: 95%;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 8px;
    }

    .header {
        padding: 16px;
        border-radius: 12px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .header-content {
        flex-direction: column;
        gap: 16px;
    }

    h1 {
        font-size: 20px;
        text-align: center;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }

    .game-selector {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .game-btn {
        padding: 14px;
        font-size: 12px;
    }

    .game-icon {
        font-size: 24px;
    }

    .main-panel {
        padding: 16px;
        border-radius: 14px;
    }

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

    #panel-title {
        font-size: 20px;
    }

    .btn-add {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }

    .server-card {
        padding: 16px;
        border-radius: 12px;
    }

    .server-info {
        gap: 12px;
    }

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

    .server-addr {
        font-size: 12px;
    }

    .server-stats {
        font-size: 12px;
    }

    .icon-btn {
        padding: 8px;
        min-width: 40px;
        min-height: 40px;
    }

    .player-popup {
        max-width: 90vw;
        max-height: 60vh;
    }

    .modal {
        max-width: 95vw;
        margin: 20px auto;
    }

    .modal-large {
        max-width: 95vw;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gauge-section {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 6px;
    }

    h1 {
        font-size: 18px;
    }

    .game-selector {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .game-btn {
        padding: 12px;
        font-size: 11px;
    }

    .server-card {
        flex-direction: column;
        padding: 12px;
    }

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

    .server-addr {
        font-size: 11px;
    }

    .player-popup {
        max-width: 85vw;
        min-width: 160px;
    }

    #players-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
}

#players-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

#players-container::-webkit-scrollbar {
    width: 4px;
}

#players-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.player-popup {
    position: fixed;
    background: #14182b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    min-width: 200px;
    max-width: 300px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    animation: popupFadeIn 0.2s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.player-popup-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-color);
}

.player-popup-body {
    padding: 8px;
    overflow-y: auto;
    max-height: 350px;
}

.player-popup-body::-webkit-scrollbar {
    width: 4px;
}

.player-popup-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.player-popup-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.player-popup-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.player-popup-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    flex-shrink: 0;
}

.player-popup-avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: white;
}

.player-popup-name {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-players-popup {
    padding: 16px;
    text-align: center;
    color: #71717a;
    font-size: 13px;
}
