/* Overall page background */
body {
    background: #f3e5f5;
    background-size: cover;
    font-family: 'Arial', sans-serif;
    text-align: center;
}

/* Grid Layout for Categories */

/* Game Container */
#game-container {
    margin-top: 10px;
}

.game-container {
    background: linear-gradient(135deg, #ff9a9e, #fad0c4);
    padding: 10px;
    background-image: url('game-background.png');
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    margin: auto;
    text-align: center;
}

/* Word & Letter Boxes */
.word-boxes,
.letter-boxes {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.letter-box {
    width: 50px;
    height: 50px;
    background-color: lightblue;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.2s ease, background-color 0.3s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    user-select: none;
}

.letter-box:active {
    transform: scale(1.1);
    background-color: #ffdd57;
}

@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); }
}

.letter-container {
    background: rgba(0, 0, 0, 0.1);
    padding: 10px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 20px;
}

/* Word Image */
#word-image {
    width: 300px;
    height: 250px;
    object-fit: contain;
    margin: 20px auto;
    border: 2px solid #333;
    background-color: white;
    padding: 1px;
    border-radius: 10px;
}

/* Displayed Word */
#word-display {
    font-size: 48px;
    font-weight: bold;
    color: #ff6f61; /* Friendly coral color */
    margin: 10px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
    background-color: #fff5e6;
    padding: 5px 10px;
    border-radius: 10px;
    display: block;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    font-family: 'Comic Sans MS', 'Baloo 2', cursive;
    margin-top: 10px;
    margin-bottom: 5px;
    align-items: center;
}

/* Image Option Grid */
#image-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    padding: 1px;
    justify-items: center;
    align-items: center;
}

/* Option Image */
.option-image {
    width: 230px;
    height: 200px;
    object-fit: contain;
    border: 4px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.option-image:hover {
    transform: scale(1.05);
    border-color: #74b9ff;
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
}

.option-image.correct {
    border-color: #55efc4;
    animation: popCorrect 0.4s ease;
}

.option-image.wrong {
    border-color: #fab1a0;
    animation: shakeWrong 0.4s ease;
}

@keyframes popCorrect {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes shakeWrong {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    #word-display {
        font-size: 28px;
    }

    .option-image {
        width: 120px;
        height: 120px;
    }

    .category {
        width: 140px;
        height: 140px;
    }
}

/* Letter Animation */
#word-display span {
    display: inline-block;
    opacity: 1;
    transform: scale(1);
    transition: transform 0.5s ease;
}

#word-display span.pop {
    animation: popIn 0.5s ease forwards;
}

@keyframes popIn {
    0% {
        transform: scale(1);
    }
    10% {
        transform: scale(1.5)
    }
    20% {
        transform: scale(2)
    }
    30% {
        transform: scale(2.5)
    }
    40% {
        transform: scale(3)
    }
    50% {
        transform: scale(3.5);
    }
    60% {
        transform: scale(3);
    }
    70% {
        transform: scale(2.5);
    }
    80% {
        transform: scale(2)
    }
    90% {
        transform: scale(1.5)
    }
    100% {
        transform: scale(1)
    }
}
/* Instruction Text */
.instruction-text {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    background-color: #ecf0f1;
    padding: 6px 10px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 5px;
    margin-top: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.marathon-guide-container {
    max-width: 900px;
    margin: 30px auto;
    padding: 40px;
    background-color: #f0fff5;
    border-radius: 15px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    font-family: "Verdana", sans-serif;
    line-height: 1.7;
}
.marathon-guide-container h1 {
    text-align: center;
    color: #007a5e;
    margin-bottom: 25px;
}
.marathon-guide-container ul {
    padding-left: 22px;
    text-align: left;
}
.marathon-guide-container li {
    margin-bottom: 14px;
}

/* === Start Game Section Styles === */

#start-game-container {
    text-align: center;
    margin-top: 30px;
}

#start-game-container .start-box {
    border: 2px dashed #4CAF50;
    background: #f0fff4;
    padding: 25px;
    border-radius: 12px;
    max-width: 600px;
    margin: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Start Game heading and message */
#start-game-container h2 {
    color: #332e7d;
    font-size: 1.8em;
    margin-bottom: 10px;
}

#start-game-container p {
    font-size: 1.1em;
    color: #444;
    margin-bottom: 20px;
}

/* Animated Start Game Button */
#startGameBtn {
    padding: 14px 30px;
    font-size: 1.2em;
    font-weight: bold;
    background: linear-gradient(45deg, #5855fa, #675def);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    animation: pulseBtn 2s infinite;
    transition: transform 0.2s ease;
}

#startGameBtn:hover {
    animation: none;
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* === Animations === */
@keyframes pulseBtn {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(76, 175, 80, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}
