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

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

.game-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-align: center;
    max-width: 900px;
    width: 100%;
    margin: 10px;
}

/* Section styles */
.instructions-section, .game-section {
    width: 100%;
}

.game-section {
    display: none;
}

h1 {
    margin-bottom: 20px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.objective {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    font-size: 1.1em;
    line-height: 1.5;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.bubble-legend {
    margin-bottom: 20px;
    flex-direction: column;
}

.bubble-legend h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
    color: #FFD700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: left;
    justify-content: flex-start;
}

.legend-bubble {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.legend-bubble.green {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.legend-bubble.yellow {
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.legend-bubble.blue {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: bold;
    flex-wrap: wrap;
    gap: 15px;
}

.score, .timer {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 15px;
    border: 2px solid #FFD700;
    flex: 1;
    min-width: 150px;
}

.canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto 20px;
}

#gameCanvas {
    border: 3px solid #FFD700;
    border-radius: 15px;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 100%);
    display: block;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    max-width: 100%;
    height: auto;
    cursor: pointer;
}

.controls {
    margin-bottom: 20px;
    font-size: 1.1em;
}

.replay-btn {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    border: none;
    color: white;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
    margin: 5px;
}

.start-btn {
    background: linear-gradient(45deg, #4ECDC4, #44A08D);
    border: none;
    color: white;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
    margin: 20px 5px;
}

.back-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    color: white;
    padding: 10px 20px;
    font-size: 1em;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
    margin: 5px;
}

.hint-btn {
    background: linear-gradient(45deg, #FFA726, #FB8C00);
    border: none;
    color: white;
    padding: 10px 20px;
    font-size: 1em;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
    margin: 5px;
}

/* Color coding reminder styles */
.color-reminder {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    font-size: 0.9em;
    font-weight: bold;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.15);
    padding: 5px 10px;
    border-radius: 15px;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.color-dot.green {
    background-color: #4CAF50;
}

.color-dot.yellow {
    background-color: #FFD700;
}

.color-dot.blue {
    background-color: #2196F3;
}

.game-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.replay-btn:hover, .start-btn:hover, .back-btn:hover, .hint-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.replay-btn:active, .start-btn:active, .back-btn:active, .hint-btn:active {
    transform: translateY(0);
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .game-container {
        padding: 15px;
        margin: 5px;
        border-radius: 15px;
    }
    
    h1 {
        font-size: 2em;
        margin-bottom: 15px;
    }
    
    .bubble-legend {
        align-items: center;
        gap: 10px;
    }
    
    .legend-item {
        width: 100%;
        max-width: 400px;
        justify-content: flex-start;
        text-align: left;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .score, .timer {
        padding: 8px 16px;
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }
    
    .canvas-container {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 100%;
        height: auto;
        border-width: 2px;
    }
    
    .controls {
        font-size: 1em;
        margin-bottom: 15px;
        padding: 0 10px;
    }
    
    .replay-btn, .start-btn {
        padding: 12px 24px;
        font-size: 1.1em;
        width: 100%;
        max-width: 250px;
    }
    
    .back-btn {
        padding: 10px 20px;
        font-size: 1em;
        width: 100%;
        max-width: 200px;
    }
    
    .game-buttons {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .objective {
        font-size: 1em;
        padding: 12px;
        margin-bottom: 15px;
    }
}

@media screen and (max-width: 480px) {
    .game-container {
        padding: 10px;
        margin: 2px;
    }
    
    h1 {
        font-size: 1.8em;
        margin-bottom: 10px;
    }
    
    .game-info {
        font-size: 1.1em;
    }
    
    .score, .timer {
        padding: 6px 12px;
        font-size: 1em;
    }
    
    .controls {
        font-size: 0.9em;
    }
    
    .replay-btn, .start-btn {
        padding: 10px 20px;
        font-size: 1em;
    }
    
    .back-btn {
        padding: 8px 16px;
        font-size: 0.9em;
    }
    
    .objective {
        font-size: 0.9em;
        padding: 10px;
    }
    
    .legend-item {
        font-size: 0.9em;
        padding: 8px 12px;
    }
    
    .legend-bubble {
        width: 25px;
        height: 25px;
        font-size: 0.7em;
    }
}