body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Arial', sans-serif;
    color: #fff;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 1000px;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #f9ca24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.score, .high-score {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

main {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
}

.game-area {
    position: relative;
    flex: 1;
    max-width: 400px;
}

#game-canvas {
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: block;
    margin: 0 auto;
    cursor: pointer;
}

.controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.start-screen, .game-over {
    background: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: auto;
}

.start-screen h2, .game-over h2 {
    margin-bottom: 15px;
    color: #fff;
}

.start-screen p {
    margin: 5px 0;
    color: #ccc;
}

#restart-btn {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
}

#restart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.hidden {
    display: none !important;
}

.sidebar {
    width: 250px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.instructions h3, .color-legend h3 {
    color: #fff;
    margin-bottom: 15px;
    text-align: center;
}

.instructions ul {
    padding-left: 20px;
    color: #eee;
}

.instructions li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.color-legend {
    margin-top: 30px;
}

.color-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.color-box {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.color-box.red { background: #ff6b6b; }
.color-box.blue { background: #4ecdc4; }
.color-box.green { background: #45b7d1; }
.color-box.yellow { background: #f9ca24; }

footer {
    text-align: center;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

/* Responsive design */
@media (max-width: 768px) {
    main {
        flex-direction: column;
        align-items: center;
    }

    .sidebar {
        width: 100%;
        max-width: 400px;
    }

    #game-canvas {
        width: 100%;
        max-width: 400px;
        height: 500px;
    }

    .stats {
        flex-direction: column;
        gap: 10px;
    }

    h1 {
        font-size: 2em;
    }

    .container {
        padding: 10px;
    }
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.platform-rotating {
    animation: rotate 3s linear infinite;
}

.ball-glow {
    box-shadow: 0 0 20px currentColor;
}

.score-flash {
    animation: pulse 0.5s ease;
}

/* Mobile touch improvements */
@media (hover: none) and (pointer: coarse) {
    #game-canvas {
        height: 70vh;
        max-height: 600px;
    }

    .start-screen, .game-over {
        padding: 20px;
    }

    .start-screen h2, .game-over h2 {
        font-size: 1.5em;
    }
}