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

body {
    font-family: 'Arial', sans-serif;
    background: radial-gradient(ellipse at center, #2c1810 0%, #1a0f08 50%, #0d0704 100%);
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(ellipse at center, #3d2817 0%, #2c1810 40%, #1a0f08 70%, #0d0704 100%);
}

.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 30px;
    border-radius: 15px;
    pointer-events: all;
}

.screen h1 {
    font-size: 3em;
    margin-bottom: 20px;
    color: #ff6b6b;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.screen h2 {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #ff4757;
}

.screen p {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #ddd;
}

button {
    background: linear-gradient(45deg, #ff6b6b, #ff4757);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

button:active {
    transform: translateY(0);
}

.hidden {
    display: none !important;
}

#gameUI {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 1.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    pointer-events: none;
}

#score {
    margin-bottom: 10px;
    font-weight: bold;
}

#instructions {
    font-size: 0.8em;
    opacity: 0.8;
}

#onlinePlayers {
    font-size: 0.9em;
    opacity: 0.9;
    margin-top: 10px;
}

input[type="text"], input[type="password"] {
    background: rgba(20, 20, 20, 0.9);
    border: 3px solid #ff6b6b;
    border-radius: 30px;
    padding: 18px 30px;
    font-size: 1.3em;
    font-weight: 500;
    margin: 25px 0;
    width: 350px;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    color: #fff;
    letter-spacing: 1px;
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.2);
}

input[type="text"]:focus, input[type="password"]:focus {
    border-color: #ff4757;
    box-shadow: 0 0 25px rgba(255, 107, 107, 0.5);
    transform: scale(1.05);
    background: rgba(30, 30, 30, 0.95);
}

input[type="text"]::placeholder, input[type="password"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

.connection-status {
    margin-top: 20px;
    font-size: 0.9em;
    color: #888;
    min-height: 20px;
}

.connection-status.connecting {
    color: #ffa502;
}

.connection-status.connected {
    color: #2ed573;
}

.connection-status.error {
    color: #ff4757;
}

.control-hint {
    font-size: 14px;
    color: #ccc;
    font-style: italic;
    margin: 10px 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.auth-status {
    font-size: 14px;
    margin: 10px 0;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    min-height: 20px;
}

.auth-status.success {
    background: rgba(46, 213, 115, 0.1);
    color: #2ed573;
    border: 1px solid #2ed573;
}

.auth-status.error {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    border: 1px solid #ff4757;
}

.button-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.button-group button {
    flex: 1;
    min-width: 120px;
}

.online-indicator {
    font-size: 0.8em;
    margin-right: 5px;
    vertical-align: middle;
    animation: pulse 2s infinite;
}

.online-indicator.offline {
    color: #888;
    animation: none;
}

.online-indicator.online {
    color: #2ed573;
}

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

#leaderboardList {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.leaderboard-entry:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    font-weight: bold;
    color: #ff6b6b;
}

.ghost-player {
    opacity: 0.4;
    filter: hue-rotate(120deg);
}

@keyframes melt {
    0% { transform: scaleY(1); }
    100% { transform: scaleY(0.1) scaleX(1.5); }
}

.melting {
    animation: melt 1s ease-in-out;
}

/* Main menu styling */
.main-title {
    font-size: 3.5em;
    font-weight: bold;
    color: #ff6b35;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* Music Display */
.music-display {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: all;
}

.music-display.show {
    opacity: 0.9;
}

.music-display:hover {
    opacity: 1;
}

.music-icon {
    font-size: 20px;
    color: #ff6b6b;
    animation: musicPulse 2s ease-in-out infinite;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

@keyframes musicPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.music-info {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.music-label {
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.music-title {
    font-size: 0.9em;
    color: #fff;
    font-weight: 500;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}