/* Main Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4a8b2c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

body {
    background-color: #f0f8e8;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
    background-size: 20px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.game-container {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 800px;
    padding: 20px;
    text-align: center;
}

.game-header {
    margin-bottom: 30px;
}

.game-header h1 {
    color: #4a8b2c;
    margin-bottom: 10px;
}

.instruction {
    font-size: 18px;
    color: #555;
    margin-bottom: 20px;
}

/* Progress Steps */
.progress-container {
    margin: 30px 0;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 600px;
    position: relative;
}

.progress-steps::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #ddd;
    transform: translateY(-50%);
    z-index: 0;
}

.step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.step span {
    color: #777;
    font-weight: bold;
}

.step.active {
    background-color: #4a8b2c;
}

.step.active span {
    color: white;
}

.step.completed {
    background-color: #4a8b2c;
    border: 2px solid #4a8b2c;
    position: relative;
}

.step.completed::after {
    content: "✓";
    position: absolute;
    font-size: 20px;
    color: white;
}

.step.completed span {
    color: white;
}

/* Choice Cards */
.choices-container {
    margin: 20px 0;
}

.choice-prompt {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    font-weight: bold;
}

.choices {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.choice-card {
    width: 200px;
    min-height: 150px;
    padding: 10px;
    border: 3px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.choice-card:hover {
    transform: translateY(-5px);
    border-color: #4a8b2c;
}

.choice-card img {
    max-width: 100%;
    height: auto;
    max-height: 130px;
    object-fit: contain;
    margin-bottom: 10px;
}

.choice-card .step-name {
    font-weight: bold;
    color: #333;
    margin-top: 10px;
}

/* Feedback */
.feedback-container {
    height: 50px;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.feedback-message {
    font-size: 20px;
    font-weight: bold;
}

.feedback-correct {
    color: #4a8b2c;
}

.feedback-incorrect {
    color: #d9534f;
}

/* Game Complete */
.game-complete {
    padding: 20px;
    background-color: #e8f5e9;
    border-radius: 10px;
    border: 2px solid #4a8b2c;
    margin-top: 20px;
}

.game-complete h2 {
    color: #4a8b2c;
    margin-bottom: 10px;
}

#restart-btn {
    background-color: #4a8b2c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 15px;
    transition: background-color 0.3s;
}

#restart-btn:hover {
    background-color: #3a7922;
}

.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 600px) {
    .choices {
        flex-direction: column;
        align-items: center;
    }
    
    .choice-card {
        width: 80%;
    }
}
