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

body {
    font-family: Arial, sans-serif;
    background-color: #1a1a2e;
    color: #fff;
    overflow: hidden;
}

.screen {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

h1 {
    font-size: 48px;
    margin-bottom: 40px;
    color: #f39c12;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

h2 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #e74c3c;
}

#lobbyList {
    background-color: rgba(44, 62, 80, 0.8);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

#lobbies {
    min-width: 400px;
    margin-bottom: 20px;
}

.lobby-item {
    background-color: rgba(52, 73, 94, 0.8);
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lobby-item:hover {
    background-color: rgba(41, 128, 185, 0.8);
}

.lobby-item.full {
    background-color: rgba(231, 76, 60, 0.5);
    cursor: not-allowed;
}

.lobby-item.in-game {
    background-color: rgba(149, 165, 166, 0.5);
    cursor: not-allowed;
}

.btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

#lobbyScreen {
    text-align: center;
}

#playerList {
    background-color: rgba(44, 62, 80, 0.8);
    padding: 20px;
    border-radius: 10px;
    min-width: 300px;
    margin: 20px 0;
}

#players {
    list-style: none;
    margin-top: 10px;
}

#players li {
    padding: 5px 0;
    color: #3498db;
}

#waitingMessage {
    font-size: 20px;
    color: #f39c12;
    margin: 20px 0;
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#gameUI {
    position: absolute;
    top: 10px;
    left: 10px;
    pointer-events: none;
}

.health-bar-container {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.health-bar {
    width: 200px;
    height: 20px;
    background-color: #e74c3c;
    border: 2px solid #c0392b;
    border-radius: 3px;
    transition: width 0.3s;
}

#healthText {
    display: inline-block;
    margin-left: 10px;
    font-weight: bold;
}

.team-info {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
}

.team-info span {
    display: block;
    margin: 5px 0;
    font-weight: bold;
}

#teamCount {
    color: #f39c12;
}

#enemyCount {
    color: #e74c3c;
}

#winScreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(44, 62, 80, 0.95);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    pointer-events: all;
}

#winMessage {
    margin-bottom: 20px;
}

.spell-list {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
    min-width: 250px;
}

.spell-list h3 {
    margin: 0 0 10px 0;
    color: #ecf0f1;
    font-size: 14px;
    text-align: center;
    border-bottom: 1px solid #34495e;
    padding-bottom: 5px;
}

.spell-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #34495e;
}

.spell-item:last-child {
    border-bottom: none;
}

.spell-name {
    font-weight: bold;
    font-size: 12px;
}

.spell-key {
    font-size: 10px;
    opacity: 0.7;
}

.spell-item.basic .spell-name {
    color: #3498db;
}

.spell-item.pickup .spell-name {
    color: #e67e22;
}

.spell-item.pickup {
    background-color: rgba(230, 126, 34, 0.1);
    padding: 8px;
    border-radius: 3px;
    border: 1px solid #e67e22;
}

.lobby-content {
    display: flex;
    gap: 30px;
    margin: 20px 0;
    justify-content: center;
}

#playerList {
    flex: 1;
    max-width: 300px;
}

#chatContainer {
    flex: 1;
    max-width: 400px;
    background-color: rgba(52, 73, 94, 0.8);
    border-radius: 8px;
    padding: 15px;
}

#chatContainer h3 {
    margin: 0 0 10px 0;
    color: #ecf0f1;
    border-bottom: 1px solid #34495e;
    padding-bottom: 5px;
}

#chatMessages {
    height: 200px;
    overflow-y: auto;
    background-color: rgba(44, 62, 80, 0.5);
    border: 1px solid #34495e;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 14px;
}

.chat-message {
    margin-bottom: 8px;
    word-wrap: break-word;
}

.chat-message .username {
    font-weight: bold;
    color: #3498db;
}

.chat-message .timestamp {
    font-size: 11px;
    color: #95a5a6;
    margin-left: 5px;
}

.chat-message .text {
    color: #ecf0f1;
    margin-left: 5px;
}

#chatInput {
    display: flex;
    gap: 10px;
}

#messageInput {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #34495e;
    border-radius: 4px;
    background-color: rgba(44, 62, 80, 0.7);
    color: #ecf0f1;
    font-size: 14px;
}

#messageInput:focus {
    outline: none;
    border-color: #3498db;
}

#sendMessage {
    padding: 8px 16px;
    min-width: 60px;
}