@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&display=swap');

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

body {
    font-family: 'Inter', sans-serif;
    background: #0a0e1a;
    color: #e8edf5;
    min-height: 100vh;
    background-image: 
        radial-gradient(ellipse at 10% 20%, rgba(0, 180, 216, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(120, 80, 255, 0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 20, 40, 0.8) 0%, transparent 100%);
    background-attachment: fixed;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #00b4d8, #0077b6); border-radius: 10px; }

/* === HEADER === */
header {
    padding: 20px 40px;
    background: rgba(20, 27, 43, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

header h1 {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, #00b4d8, #90e0ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}
header h1 span { font-size: 28px; }

.stats {
    display: flex;
    gap: 35px;
}
.stat {
    text-align: center;
    background: rgba(255,255,255,0.04);
    padding: 6px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
}
.stat-number {
    font-size: 30px;
    font-weight: 800;
    background: linear-gradient(135deg, #00b4d8, #48cae4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    line-height: 1.2;
}
.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7a8ca8;
    font-weight: 600;
}

.actions {
    display: flex;
    gap: 10px;
}
.btn {
    padding: 10px 22px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    background: rgba(255,255,255,0.06);
    color: #e8edf5;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}
.btn-warning {
    background: linear-gradient(135deg, #f7b731, #f59f00);
    color: #0a0e1a;
    border-color: #f7b731;
}
.btn-warning:hover { background: linear-gradient(135deg, #fcc419, #f59f00); }
.btn-danger {
    background: linear-gradient(135deg, #ff4757, #c0392b);
    color: white;
    border-color: #ff4757;
}
.btn-danger:hover { background: linear-gradient(135deg, #ff6b81, #c0392b); }
.btn-primary {
    background: linear-gradient(135deg, #00b4d8, #0077b6);
    color: white;
    border-color: #00b4d8;
}
.btn-primary:hover { background: linear-gradient(135deg, #48cae4, #0077b6); }

/* === MAIN === */
main {
    padding: 30px 40px;
    display: flex;
    gap: 35px;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* === GAMES LIST === */
.games-list {
    flex: 1;
    min-width: 320px;
    background: rgba(20, 27, 43, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.games-list h2 {
    font-size: 16px;
    font-weight: 600;
    color: #7a8ca8;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
}
#gamesContainer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 6px;
}

.game-card {
    background: rgba(255,255,255,0.04);
    padding: 16px 22px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.game-card:hover {
    background: rgba(0, 180, 216, 0.12);
    border-color: rgba(0, 180, 216, 0.3);
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(0,180,216,0.08);
}
.game-code {
    font-weight: 700;
    font-size: 18px;
    color: #00b4d8;
    letter-spacing: 0.5px;
}
.game-code::before {
    content: '#';
    color: #3a5a7a;
    font-weight: 400;
}
.game-info {
    color: #7a8ca8;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.game-info .badge {
    background: rgba(0,180,216,0.15);
    color: #48cae4;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.game-card-empty {
    text-align: center;
    color: #3a5a7a;
    padding: 40px 20px;
    font-size: 15px;
}

/* === GAME DETAILS === */
.game-details {
    flex: 1.5;
    min-width: 420px;
    background: rgba(20, 27, 43, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    transition: all 0.4s ease;
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.details-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #e8edf5;
    display: flex;
    align-items: center;
    gap: 10px;
}
.details-header h2 span {
    color: #00b4d8;
    background: rgba(0,180,216,0.12);
    padding: 2px 14px;
    border-radius: 8px;
    font-size: 18px;
}
.details-actions {
    display: flex;
    gap: 8px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

/* === PLAYERS LIST === */
.players-list h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7a8ca8;
    margin-bottom: 12px;
    font-weight: 600;
}
.players-list ul {
    list-style: none;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 6px;
}
.players-list li {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    transition: background 0.2s;
    border-radius: 8px;
}
.players-list li:hover {
    background: rgba(255,255,255,0.03);
}
.player-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.player-alive { background: #2ecc71; box-shadow: 0 0 8px rgba(46,204,113,0.4); }
.player-dead { background: #ff4757; box-shadow: 0 0 8px rgba(255,71,87,0.4); }
.player-host { color: #f7b731; font-weight: 700; margin-left: auto; font-size: 12px; }

/* === CHAT LOG === */
.chat-log h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7a8ca8;
    margin-bottom: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
#chatMessages {
    max-height: 320px;
    overflow-y: auto;
    background: rgba(0,0,0,0.3);
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.04);
}
.chat-message {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 13px;
    line-height: 1.5;
    animation: fadeInMsg 0.3s ease;
}
@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-player {
    color: #48cae4;
    font-weight: 600;
}
.chat-time {
    color: #4a6a7a;
    font-size: 10px;
    margin-left: 8px;
}
.chat-message .msg-text {
    color: #c8d8e8;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    header { padding: 16px 20px; flex-direction: column; align-items: stretch; }
    .stats { justify-content: center; }
    .actions { justify-content: center; flex-wrap: wrap; }
    main { padding: 16px 20px; flex-direction: column; }
    .game-details { min-width: auto; }
    .details-grid { grid-template-columns: 1fr; }
    .game-card { flex-wrap: wrap; gap: 8px; }
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #4a6a7a;
}
.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}
.empty-state p {
    font-size: 15px;
}
/* === PLAYER CARD === */
.player-card {
    background: rgba(255,255,255,0.04);
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}
.player-card:hover {
    background: rgba(0, 180, 216, 0.12);
    border-color: rgba(0, 180, 216, 0.3);
    transform: translateX(4px);
}
.player-name {
    font-weight: 600;
    color: #e8edf5;
}
.player-name .host-badge {
    background: rgba(247, 183, 49, 0.2);
    color: #f7b731;
    font-size: 10px;
    padding: 1px 8px;
    border-radius: 10px;
    margin-left: 6px;
}
.player-info {
    color: #7a8ca8;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.player-info .game-code-badge {
    background: rgba(0, 180, 216, 0.15);
    color: #48cae4;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.player-info .time-badge {
    color: #4a6a7a;
    font-size: 12px;
}
.player-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.player-status-dot.online {
    background: #2ecc71;
    box-shadow: 0 0 8px rgba(46,204,113,0.4);
}
.player-status-dot.inactive {
    background: #ff4757;
    box-shadow: 0 0 8px rgba(255,71,87,0.4);
}
