/* Overall page background */
body {
    background: #fffacd;
    /* Light pastel background */
    background-size: cover;
    font-family: 'Arial', sans-serif;
    text-align: center;
}

#game-container {
    margin-top: 10px;
}

.word-boxes {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.target-box {
    width: 40px;
    height: 40px;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: bold;
    background-color: white;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.target-box.current-box {
    border-color: #763bcf;
    box-shadow: 0 0 10px #763bcf;
    animation: boxGlow 1.5s infinite alternate;
}

@keyframes boxGlow {
    from {
        box-shadow: 0 0 5px #763bcf;
    }

    to {
        box-shadow: 0 0 15px #763bcf;
    }
}

.letter-boxes {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

/* Letter Box Animation on Click */
.letter-box {
    width: 50px;
    height: 50px;
    background-color: lightblue;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    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;
    /* Prevents accidental text selection */
}

/* Click Effect */
.letter-box:active {
    transform: scale(1.1);
    /* Slightly increase size when clicked */
    background-color: #ffdd57;
    /* Flash effect */
}

/* Animation when moved to target box */
@keyframes bounceIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

.target-box.filled {
    animation: bounceIn 0.3s ease-out;
}

/* Word Image in Game */
#word-image {
    width: 300px;
    /* Fixed width */
    height: 250px;
    /* Fixed height */
    object-fit: contain;
    /* Ensures the entire image fits inside without cropping */
    display: block;
    margin: 20px auto;
    /* Center the image */
    border: 2px solid #333;
    background-color: white;
    padding: 1px;
    border-radius: 10px;
}

/* Style buttons */
.button-container {
    margin-top: 30px;
    text-align: center;
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.button-container button {
    background: #ff7675;
    /* Soft red */
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s;
}

.button-container button:hover {
    background: #d63031;
    /* Darker red on hover */
}

/* Hint and Clear Buttons - Move Slightly Below */
#hint-button,
#clear-word {
    margin-top: 15px;
    /* Moves the buttons slightly down */
    background: linear-gradient(135deg, #ff758c, #eb8cb4);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* Hover Effect */
#hint-button:hover,
#clear-word:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Ripple Effect */
#hint-button::after,
#clear-word::after {
    content: "";
    position: absolute;
    width: 300%;
    height: 300%;
    top: 50%;
    left: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: width 0.4s ease-out, height 0.4s ease-out, opacity 0.4s ease-out;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    opacity: 0;
}

#hint-button:active::after,
#clear-word:active::after {
    width: 0%;
    height: 0%;
    opacity: 1;
    transition: 0s;
}

/* Click Animation */
#hint-button:active,
#clear-word:active {
    transform: scale(0.95);
}

@keyframes popOut {
    0% {
        transform: scale(1);
        background-color: #ffffff;
    }

    50% {
        transform: scale(2.5);
        background-color: #ffdd57;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    }

    100% {
        transform: scale(1);
        background-color: #ffffff;
    }
}

.bounce-animation {
    animation: popOut 0.5s ease-in-out !important;
    position: relative;
    z-index: 1000;
}

.easy-marathon-guide {
    max-width: 900px;
    margin: 30px auto;
    padding: 40px;
    background-color: #fff8e7;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    font-family: "Segoe UI", sans-serif;
    color: #333;
    line-height: 1.7;
}

.easy-marathon-guide h1 {
    text-align: center;
    color: #d17b00;
    margin-bottom: 25px;
}

.easy-marathon-guide ul {
    padding-left: 22px;
    text-align: left;
}

.easy-marathon-guide li {
    margin-bottom: 14px;
}


/* === Start Game Section Styles === */

#start-game-container {
    text-align: center;
    margin-top: 30px;
}

/* 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);
    }
}

/* Selector Styles */
.selector-container {
    margin: 20px auto;
    background: #fffafa;
    border: 3px solid #675def;
    padding: 30px;
    border-radius: 15px;
    max-width: 550px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #3f05d2;
    font-weight: 700;
}

.button-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
}

.select-btn {
    padding: 12px 24px;
    font-size: 1.1em;
    background-color: #ffffff;
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 600;
    color: #555;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.select-btn:hover {
    background-color: #f8f9fa;
    border-color: #675def;
    transform: translateY(-2px);
}

.select-btn.selected {
    background: linear-gradient(135deg, #675def, #5855fa);
    color: white;
    border-color: #3f05d2;
    box-shadow: 0 4px 12px rgba(88, 85, 250, 0.4);
    transform: scale(1.05);
}

.start-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    font-size: 1.4em;
    padding: 15px 50px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.start-btn:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

.start-btn:active {
    transform: scale(0.98);
}

#word-counter {
    background: #675def;
    color: white;
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 1.2em;
    margin-bottom: 10px;
}

/* Mobile Responsive Styles */
@media (max-width: 600px) {
    #word-image {
        width: 100%;
        max-width: 260px;
        height: auto;
        min-height: 180px;
        margin: 10px auto;
    }

    .word-boxes {
        gap: 5px;
    }

    .target-box {
        width: 32px;
        height: 32px;
        font-size: 30px;
    }

    .letter-boxes {
        gap: 6px;
    }

    .letter-box {
        width: 42px;
        height: 42px;
        font-size: 30px;
    }

    .selector-container {
        padding: 15px;
        margin: 10px;
        max-width: 95%;
    }

    .select-btn {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .start-btn {
        padding: 12px 30px;
        font-size: 1.2em;
    }

    .easy-marathon-guide {
        padding: 20px;
        margin: 15px 10px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .back-button {
        margin-top: 30px;
        padding: 10px 20px;
        font-size: 0.9em;
    }

    footer {
        padding: 15px;
    }

    .footer-links a {
        margin: 5px;
        display: inline-block;
    }
}

/* Base Headings */
h1 {
    color: #3f05d2;
}

h2 {
    color: #025e1d;
    margin: 0;
    font-size: 2em;
}

h3 {
    color: #3f05d2;
    margin: 0;
    font-size: 2em;
    text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00, 0 0 30px #00ff00;
}

/* Header Styling */
header h1 {
    margin: 0;
    font-size: 2.5em;
    background-color: rgba(228, 84, 84, 0.2);
    padding: 5px 10px;
    border: 2px solid rgb(29, 3, 227);
    border-radius: 10px;
    display: inline-block;
    text-shadow: -1px -1px 0 #a82323, 1px -1px 0 #211b42, -1px 1px 0 #a6c91b, 1px 1px 0 #11ba0e;
}

/* Back Button */
.back-button {
    display: inline-block;
    margin-top: 90px;
    margin-bottom: 20px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.back-button:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-3px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
}

.back-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* Footer Styling */
footer {
    background: linear-gradient(135deg, #e30f16, #033ca0);
    color: white;
    padding: 20px;
    text-align: center;
    border-top: 2px solid #fff;
    margin-top: 50px;
}

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    color: #a6c1ee;
    text-decoration: none;
    margin: 0 10px;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* --- AdSense Specific Styles (Revised) --- */

/* Wrapper for AdSense units */
.adsense-banner-container {
    width: 100%; /* Take full width of parent */
    max-width: 970px; /* Limit max width for large screens (e.g., typical desktop ad banner size) */
    margin: 20px auto; /* Center the container horizontally and add vertical space */
    min-height: 100px; /* Ensure there's space for the ad, even if blank initially */
    text-align: center; /* Center the ad visually within its container if it's smaller than the container */
    /* Optional: Add a temporary background or border here to visualize the container during testing */
    /* background-color: rgba(0, 255, 0, 0.1); */
    /* border: 1px dashed green; */
}

/* Styles for the AdSense INS tag itself */
ins.adsbygoogle {
    display: block; /* This is crucial and must remain */
    /* AdSense JavaScript will manage its width and height based on the parent container (.adsense-banner-container) */
    /* Any other purely visual styles for the ins tag like border-radius can go here */
    border-radius: 10px; /* Optional: Matches your general design */
    overflow: hidden; /* Important: Prevents content from spilling out */
}

/* This rule is good for hiding completely blank ad slots */
ins.adsbygoogle[data-ad-status="unfilled"] {
    display: none !important;
}
/* Responsive AdSense tweaks for smaller screens - Apply to container! */
@media (max-width: 768px) {
    .adsense-banner-container {
        margin: 15px auto; /* Adjust margin for smaller screens */
    }
    /* No need to adjust ins.adsbygoogle here, as the container manages size */
}