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

body {
    font-family: 'Noto Sans', sans-serif;
    background: #f8f9fa;
    color: #2c3e50;
    padding: 20px;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 30px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: 600;
}

h2 {
    color: #34495e;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: left;
}

h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.problem-section {
    margin-bottom: 40px;
}

.examples {
    display: flex;
    gap: 40px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.example {
    text-align: center;
}

.question {
    text-align: center;
    margin-bottom: 30px;
}

.grid {
    display: inline-grid;
    gap: 2px;
    background: #ecf0f1;
    padding: 10px;
    border-radius: 8px;
    margin: 0 auto;
}

.cell {
    width: 30px;
    height: 30px;
    border: 1px solid #bdc3c7;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 3px;
}

.cell:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.answer-section {
    text-align: center;
    margin-bottom: 30px;
}

.controls {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.color-palette {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.color-option {
    width: 40px;
    height: 40px;
    border: 3px solid #bdc3c7;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.color-option.selected {
    border-color: #2c3e50;
    box-shadow: 0 0 0 2px #3498db;
}

button {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin: 0 10px;
}

button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.feedback {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: 500;
    min-height: 20px;
}

.feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.feedback.hint {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.timer {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e74c3c;
    padding: 8px 16px;
    background: #fee;
    border-radius: 6px;
    border: 2px solid #e74c3c;
}

.timer.warning {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.problem-counter {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    padding: 8px 16px;
    background: #ecf0f1;
    border-radius: 6px;
}

.difficulty-note {
    text-align: left;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-style: italic;
}

.pattern-sequence {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.pattern-item {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    background: #f8f9fa;
}

.answer-item {
    background: #e8f4fd;
    border: 2px dashed #3498db;
    animation: highlight 2s ease-in-out infinite;
}

@keyframes highlight {
    0%, 100% { 
        background: #e8f4fd;
        border-color: #3498db;
    }
    50% { 
        background: #d1ecf1;
        border-color: #2980b9;
    }
}

.example-item {
    background: #e8f5e8;
    border: 2px solid #27ae60;
}

.example-item h3 {
    color: #27ae60;
}

.pattern-item h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: #2c3e50;
}

.button-group {
    display: flex;
    gap: 15px;
}

#nextProblem {
    background: #27ae60;
}

#nextProblem:hover {
    background: #229954;
}

.game-guide {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
}

.game-guide h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.game-guide ul {
    text-align: left;
    max-width: 600px;
    margin: 0 auto 25px;
    padding-left: 20px;
}

.game-guide li {
    margin-bottom: 8px;
    color: #34495e;
    line-height: 1.5;
}

.start-button {
    background: #27ae60;
    font-size: 1.1rem;
    padding: 15px 30px;
}

.start-button:hover {
    background: #229954;
}

.button-group-header {
    display: flex;
    gap: 10px;
}

.give-up-button {
    background: #e74c3c;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.give-up-button:hover {
    background: #c0392b;
}

.hint-button {
    background: #f39c12;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.hint-button:hover {
    background: #e67e22;
}

.final-score {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-top: 20px;
}

.final-score h2 {
    color: #27ae60;
    font-size: 2rem;
    margin-bottom: 30px;
}

.score-display {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.score-display h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.score {
    font-size: 2.5rem;
    font-weight: 600;
    color: #3498db;
    margin-bottom: 10px;
}

.percentage {
    font-size: 1.5rem;
    color: #7f8c8d;
}

.restart-button {
    background: #27ae60;
    font-size: 1.1rem;
    padding: 15px 30px;
}

.restart-button:hover {
    background: #229954;
}

.score-comment {
    font-size: 1.2rem;
    color: #27ae60;
    font-weight: 600;
    margin-top: 15px;
}

.advice-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    text-align: left;
}

.advice-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
}

.advice {
    color: #34495e;
    line-height: 1.6;
    font-size: 1rem;
}

.disclaimer {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #95a5a6;
    margin-bottom: 25px;
}

.disclaimer p {
    color: #7f8c8d;
    font-size: 0.9rem;
    font-style: italic;
    margin: 0;
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    h1 {
        font-size: 2rem;
        margin-bottom: 0;
    }
    
    .progress-info {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }
    
    .button-group-header {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .hint-button, .give-up-button {
        padding: 10px 16px;
        font-size: 0.85rem;
        width: 100%;
        max-width: 200px;
    }
    
    .timer, .problem-counter {
        font-size: 1rem;
        padding: 6px 12px;
        text-align: center;
    }
    
    .examples {
        flex-direction: column;
        gap: 20px;
    }
    
    .color-palette {
        max-width: 300px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    button {
        margin: 5px 0;
        width: 200px;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .pattern-sequence {
        gap: 15px;
    }
    
    .grid {
        padding: 8px;
    }
    
    .cell {
        width: 25px;
        height: 25px;
    }
    
    .color-option {
        width: 35px;
        height: 35px;
    }
}