body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background: linear-gradient(135deg, #181824 0%, #212837 100%);
    color: #fff;
    font-family: 'Segoe UI', Verdana, Geneva, Tahoma, sans-serif;
    transition: background 0.3s, color 0.3s;
}

.light-theme {
    background: linear-gradient(135deg, #f3f6fa 0%, #e3e8ee 100%);
    color: #222;
}

#top-bar {
    width: 400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    margin-bottom: 8px;
    font-size: 1.1rem;
    letter-spacing: 1px;
}
#clock {
    font-weight: bold;
}
#theme-toggle {
    cursor: pointer;
    font-size: 1.3rem;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    transition: background 0.2s;
    outline: none;
}
#theme-toggle:focus {
    background: rgba(255,255,255,0.18);
}

#score-bar {
    width: 400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 1px;
}

canvas {
    box-shadow: 0 8px 32px rgba(52, 87, 220, 0.18);
    border-radius: 16px;
    background: #181824;
    margin-bottom: 32px;
    transition: background 0.3s;
}
.light-theme canvas {
    background: #f3f6fa;
}

h1 {
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
    color: #60cbff;
    text-shadow: 0 2px 8px #21283788;
}
.light-theme h1 {
    color: #1e90ff;
    text-shadow: 0 2px 8px #e3e8ee88;
}

#game {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: fadeIn 1.5s ease-in;
    max-width: 100%;
    height: auto;
}

#start-screen, #game-over-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: fadeIn 1s ease-in;
    max-width: 90%;
    z-index: 10;
}

#start-screen h2, #game-over-screen h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

#start-screen p {
    margin-bottom: 20px;
    font-size: 0.8rem;
    line-height: 1.6;
}

button {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border: none;
    color: white;
    padding: 15px 30px;
    font-size: 1rem;
    font-family: 'Press Start 2P', cursive;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin: 10px;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    #top-bar, #score-bar {
        width: 95vw;
        font-size: 1rem;
    }
    h1 {
        font-size: 1.3rem;
        margin-top: 4px;
        margin-bottom: 4px;
    }
    #game {
        width: 95vw !important;
        height: 95vw !important;
        min-width: 200px;
        min-height: 200px;
        max-width: 100vw;
        max-height: 100vw;
    }
    #start-screen, #game-over-screen {
        padding: 12px;
        font-size: 0.9rem;
        max-width: 98vw;
    }
    button {
        padding: 10px 18px;
        font-size: 0.8rem;
    }
}

/* Hide game over screen initially */
#game-over-screen {
    display: none;
}
