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

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #e0f7fa;
    font-family: 'Outfit', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #b2ebf2 0%, #e0f7fa 100%);
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #2c3e50;
}

#score-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#distance {
    font-size: 2.5rem;
    font-weight: 600;
    opacity: 0.8;
}

#prompt {
    width: 100%;
    text-align: center;
    font-size: 1.2rem;
    letter-spacing: 0.2rem;
    font-weight: 300;
    opacity: 0.6;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.7;
    }
}

/* Transitions */
.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 1s ease-in-out;
}

/* Loading Screen */
#loading-screen,
#start-screen,
#game-over-screen {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #b2ebf2 0%, #e0f7fa 100%);
    transition: opacity 0.8s ease-in-out;
}

.loader-content,
.start-content {
    text-align: center;
    width: 350px;
}

/* Input Styles */
.input-group {
    margin-bottom: 1.5rem;
}

#username {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(44, 62, 80, 0.1);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1.2rem;
    text-align: center;
    color: #2c3e50;
    letter-spacing: 0.2rem;
    outline: none;
    transition: all 0.3s ease;
}

#username:focus {
    border-color: #2c3e50;
    background: white;
}

/* Leaderboard Styles */
#leaderboard-preview {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(44, 62, 80, 0.1);
}

#leaderboard-preview h3 {
    font-size: 0.8rem;
    letter-spacing: 0.3rem;
    opacity: 0.5;
    margin-bottom: 1rem;
    font-weight: 600;
}

.score-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.score-rank {
    font-weight: 600;
    opacity: 0.5;
}

.score-name {
    flex-grow: 1;
    text-align: left;
    padding-left: 1rem;
}

.score-val {
    font-weight: 600;
}

#final-stats {
    font-size: 4rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.game-title {
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    font-weight: 300;
    color: #2c3e50;
    margin-bottom: 2rem;
}

.game-title-large {
    font-size: 3rem;
    letter-spacing: 0.8rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2rem;
}

.progress-container {
    width: 100%;
    height: 4px;
    background: rgba(44, 62, 80, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background: #2c3e50;
    transition: width 0.3s ease;
}

#loading-status {
    font-size: 0.8rem;
    letter-spacing: 0.2rem;
    opacity: 0.5;
}

/* Start Button */
#start-button {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    font-family: inherit;
    font-size: 1rem;
    letter-spacing: 0.2rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(44, 62, 80, 0.2);
}

#start-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(44, 62, 80, 0.3);
    background: #34495e;
}

#instructions {
    margin-top: 2rem;
    font-size: 0.9rem;
    letter-spacing: 0.1rem;
    opacity: 0.4;
}