/* Rainbow Pattern Maker Styles */

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

body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Arial Rounded MT Bold', sans-serif;
    background-color: #f0f9ff;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
}

/* Streak Counter */
.streak-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    font-size: 1.2rem;
    font-weight: bold;
}

.streak-count {
    background-color: #7e57c2;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, background-color 0.3s;
}

.streak-count.increment {
    animation: pulse 0.5s ease;
    background-color: #4caf50;
}

.streak-count.reset {
    animation: shake 0.5s ease;
    background-color: #f44336;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: linear-gradient(to right, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.level-selector {
    margin: 15px 0;
}

.level-selector select {
    padding: 8px 15px;
    font-size: 1rem;
    border: 2px solid #7e57c2;
    border-radius: 10px;
    background-color: #fff;
    cursor: pointer;
    font-family: inherit;
}

/* Main Game Area Styles */
.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.pattern-display {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    min-height: 100px;
}

.color-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #ddd;
    transition: transform 0.2s;
}

.color-circle:hover {
    transform: scale(1.05);
}

.color-circle.missed-answer {
    animation: pulse-border 1.5s infinite;
    border: 3px dashed #f44336;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(244, 67, 54, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0); }
}

.question-mark {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    background-color: #f0f0f0;
    border: 3px dashed #7e57c2;
    border-radius: 50%;
    margin: 10px 0 40px;
    position: relative;
}

#question-mark {
    font-size: 3rem;
    font-weight: bold;
    color: #7e57c2;
    line-height: 1;
}

.remaining-guesses {
    position: absolute;
    bottom: -25px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #7e57c2;
    padding: 3px 8px;
    background-color: #f0f0f0;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.color-palette {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.color-option {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid #ddd;
    cursor: pointer;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Feedback Area */
.feedback {
    text-align: center;
    min-height: 100px;
    padding: 15px;
}

.feedback-message {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.feedback-correct {
    color: #4caf50;
}

.feedback-incorrect {
    color: #f44336;
}

/* Decoration Elements */
.decoration {
    position: absolute;
    opacity: 0.7;
    transition: all 0.5s;
    pointer-events: none;
}

.rainbow {
    width: 200px;
    height: 100px;
    background: linear-gradient(to bottom, 
        #ff0000, #ff0000 14.2%, 
        #ff7f00 14.2%, #ff7f00 28.4%, 
        #ffff00 28.4%, #ffff00 42.6%, 
        #00ff00 42.6%, #00ff00 56.8%, 
        #0000ff 56.8%, #0000ff 71%, 
        #4b0082 71%, #4b0082 85.2%, 
        #8b00ff 85.2%);
    border-radius: 100px 100px 0 0;
    top: 20px;
    right: 30px;
    transform: scale(0.8);
}

.unicorn, .giraffe {
    display: none;
    bottom: 10px;
}

.unicorn.show, .giraffe.show {
    display: block;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Footer Styles */
footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

button {
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 10px;
    background-color: #7e57c2;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

button:hover {
    background-color: #6a41b4;
    transform: translateY(-2px);
}

/* Instructions Modal */
.instructions-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.instructions-content {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.instructions-content h2 {
    margin-bottom: 15px;
    color: #7e57c2;
}

.instructions-content p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.instructions-modal.show {
    display: flex;
}

/* Rainbow Colors */
.red { background-color: #ff0000; }
.orange { background-color: #ff7f00; }
.yellow { background-color: #ffff00; }
.green { background-color: #00ff00; }
.blue { background-color: #0000ff; }
.indigo { background-color: #4b0082; }
.violet { background-color: #8b00ff; }

/* Confetti Container */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1500;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f44336;
    opacity: 0.7;
    animation: fall linear forwards;
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .streak-container {
        font-size: 1rem;
    }
    
    .streak-count {
        width: 35px;
        height: 35px;
    }
    
    .color-circle {
        width: 50px;
        height: 50px;
    }
    
    .color-option {
        width: 60px;
        height: 60px;
    }
    
    .question-mark {
        width: 70px;
        height: 70px;
    }
    
    .rainbow {
        width: 150px;
        height: 75px;
        top: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.7rem;
    }
    
    .color-circle {
        width: 40px;
        height: 40px;
    }
    
    .color-option {
        width: 50px;
        height: 50px;
    }
    
    .pattern-display {
        gap: 10px;
    }
    
    .color-palette {
        gap: 10px;
    }
    
    footer {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    button {
        width: 100%;
        max-width: 200px;
    }
}
