/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.screen {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hidden {
    display: none !important;
}

.container {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    width: 100%;
    border: 1px solid #e9ecef;
}

/* 시작 화면 */
h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #495057;
    font-weight: 600;
}

.game-rules {
    text-align: left;
    margin-bottom: 30px;
}

.game-rules h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #495057;
    text-align: center;
    font-weight: 600;
}

.game-rules ul {
    list-style: none;
    padding: 0;
}

.game-rules li {
    margin-bottom: 12px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

.btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-weight: 500;
}

.btn:hover {
    background: #5a6268;
}

.btn:active {
    background: #545b62;
}

/* 게임 화면 */

.level-display {
    text-align: center;
    padding: 15px 0 10px 0;
    font-size: 1.2rem;
    font-weight: bold;
    color: #495057;
}

.timer-display {
    text-align: center;
    padding: 10px 0 20px 0;
    font-size: 1.8rem;
    font-weight: bold;
    color: #495057;
    font-style: italic;
}

.game-container {
    padding: 40px 20px 20px 20px;
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.game-board {
    display: grid;
    gap: 8px;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.color-square {
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.1s ease;
    border: 2px solid transparent;
    position: relative;
    aspect-ratio: 1;
    min-height: 60px;
    min-width: 60px;
}

.color-square:hover {
    border-color: transparent;
}

.color-square.selected {
    border-color: transparent;
    box-shadow: none;
}

/* 결과 화면 */
.result-info {
    margin: 30px 0;
}

.result-info h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #495057;
    font-weight: 600;
}

.score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin: 8px 0;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 1rem;
}

.score-label {
    font-weight: 500;
    color: #495057;
}

.score-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #6c757d;
}

.result-actions {
    margin-top: 30px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 25px 15px;
        margin: 10px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .game-rules li {
        font-size: 0.85rem;
        padding: 6px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    
    .level-display {
        font-size: 1.1rem;
        padding: 12px 0 8px 0;
    }
    
    .timer-display {
        font-size: 1.5rem;
        padding: 8px 0 15px 0;
    }
    
    .game-container {
        padding: 10px;
    }
    
    .game-board {
        padding: 12px;
        min-height: 350px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px 10px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .game-rules h2 {
        font-size: 1.1rem;
    }
    
    .game-rules li {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .level-display {
        font-size: 1rem;
        padding: 10px 0 6px 0;
    }
    
    .timer-display {
        font-size: 1.3rem;
        padding: 6px 0 12px 0;
    }
    
    .game-board {
        gap: 6px;
        padding: 8px;
        min-height: 300px;
    }
    
    .color-square {
        min-height: 50px;
        min-width: 50px;
    }
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen:not(.hidden) {
    animation: fadeIn 0.5s ease-out;
}


.color-square.correct {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3) !important;
}

.color-square.wrong {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3) !important;
}
