:root {
    --primary: #ff8fab;
    --secondary: #fb6f92;
    --accent: #ffe5ec;
    --bg-gradient: linear-gradient(to bottom, #a2d2ff, #caf0f8);
    --text: #4a4e69;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    touch-action: none;
}

#game-container {
    position: relative;
    width: 400px;
    height: 600px;
    background: var(--bg-gradient);
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    border-radius: 20px;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    pointer-events: none;
    z-index: 10;
}

#score-display {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    text-shadow: 2px 2px 0px var(--white);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    transition: opacity 0.3s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.content {
    text-align: center;
    padding: 30px;
    width: 100%;
}

h1 {
    font-size: 48px;
    color: var(--secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

h2 {
    font-size: 32px;
    color: var(--text);
    margin-bottom: 20px;
}

p {
    color: var(--text);
    margin-bottom: 20px;
}

.instructions {
    background: var(--accent);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 30px;
    font-size: 14px;
}

.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 15px rgba(255, 143, 171, 0.4);
}

.btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn.secondary {
    background: var(--text);
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(74, 78, 105, 0.3);
}

.final-score {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--secondary);
    font-weight: 700;
}

#score-submission {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

input[type="text"] {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--accent);
    border-radius: 50px;
    outline: none;
    font-size: 16px;
}

input[type="text"]:focus {
    border-color: var(--primary);
}

.leaderboard {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
}

.leaderboard h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#leaderboard-list {
    list-style: none;
}

.score-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

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

.score-item .rank {
    font-weight: 700;
    color: var(--primary);
    width: 25px;
}

.score-item .name {
    flex: 1;
    text-align: left;
    padding-left: 10px;
}

.score-item .val {
    font-weight: 700;
}

/* Mobile Responsive */
@media (max-width: 450px) {
    #game-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}