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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #1a1a2e;
    color: #fff;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* Join Screen */
.join-container {
    text-align: center;
    padding: 20px;
}

.join-container h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.join-container .subtitle {
    font-size: 1em;
    color: #aaa;
    margin-bottom: 30px;
}

.join-container input {
    width: 100%;
    max-width: 300px;
    padding: 15px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    background: #2a2a4e;
    color: #fff;
    text-align: center;
    margin-bottom: 15px;
}

.join-container input::placeholder {
    color: #666;
}

.join-container input:focus {
    outline: 2px solid #ffd700;
}

.join-container button {
    width: 100%;
    max-width: 300px;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #1a1a2e;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.join-container button:active {
    transform: scale(0.98);
}

.error {
    color: #ff4444;
    margin-top: 15px;
    font-size: 0.9em;
}

/* Lobby Screen - Overlay style */
#lobby-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lobby-container {
    text-align: center;
    padding: 40px;
    background: rgba(26, 26, 46, 0.95);
    border-radius: 15px;
    border: 2px solid #ffd700;
}

.lobby-container h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #ffd700;
}

#lobby-player-count {
    font-size: 2.5em;
    color: #ffd700;
    margin-bottom: 20px;
}

.lobby-info {
    color: #aaa;
    font-size: 1em;
}

/* Game Over Screen */
.gameover-container {
    text-align: center;
    padding: 20px;
}

.gameover-container h2 {
    font-size: 2em;
    margin-bottom: 15px;
}

.gameover-container p {
    margin-bottom: 10px;
    font-size: 1.1em;
}

#gameover-title.winner {
    color: #ffd700;
}

#final-score {
    color: #ffd700;
    font-size: 1.3em;
}

#play-again-btn {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #1a1a2e;
    cursor: pointer;
}

/* Player Popup */
#player-popup {
    position: fixed;
    background: rgba(0, 0, 0, 0.85);
    padding: 8px 15px;
    border-radius: 6px;
    pointer-events: none;
    z-index: 1000;
    font-size: 0.9em;
}

#player-popup #popup-name {
    font-weight: bold;
    color: #fff;
}

#player-popup #popup-score {
    color: #ffd700;
    margin-left: 10px;
}
