/* Leaderboard and Chat Styles */
.chat-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    height: calc(100vh - 200px);
}

.chat-main {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

/* Nickname Selection */
.nickname-selection {
    text-align: center;
    padding: 3rem;
}

.nickname-selection h2 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.nickname-selection p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.nickname-selection form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 300px;
    margin: 0 auto;
}

.nickname-selection input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

/* Chat Box */
.chat-box {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;}

.message {
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.message.own {
    background: #e3f2fd;
    margin-left: 20%;
}

.message .nickname {
    font-weight: bold;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.3rem;
}

.message .text {
    display: block;
    margin-bottom: 0.3rem;
    word-wrap: break-word;
}

.message .time {
    font-size: 0.75rem;
    color: var(--text-light);
    display: block;}

/* Chat Input Form */
.chat-input-form {
    display: flex;
    gap: 0.5rem;
}

.chat-input-form input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.chat-input-form button {
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-input-form button:hover {
    background: #3a7bc8;
}

/* Chat Sidebar */
.chat-sidebar {    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Online Users */
.online-users {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.online-users h3 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.online-users h3 i {
    color: #4caf50;
    font-size: 0.8rem;
}

.online-users ul {
    list-style: none;
}

.online-users li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: #e3f2fd;
    transform: translateX(5px);
}

.leaderboard-item .rank {
    width: 30px;
    font-weight: bold;
    color: var(--text-dark);
}

.leaderboard-item .nickname {
    flex: 1;
    font-weight: 500;
    color: var(--text-dark);
}

.leaderboard-item .stats {    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.85rem;
    color: var(--text-light);
}

.leaderboard-item .stats span {
    display: block;
}

/* Responsive */
@media (max-width: 1024px) {
    .chat-container {
        grid-template-columns: 1fr;
    }
    
    .chat-sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .chat-sidebar {
        grid-template-columns: 1fr;
    }
}