body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #222222;
    text-align: center;
    margin: 0;
    padding: 0;
    position: relative;
}

header {
    position: relative;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(4px);
    color: #008751;
    padding: 1.5rem 1rem;
    overflow: hidden;
    /* needed so watermark stays inside header ONLY */
}

header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../assets/childflag.jpeg") center/420px no-repeat;
    opacity: 0.17;
    /* adjust if Caleb wants darker/lighter */
    pointer-events: none;
    z-index: -1;
    background-size: cover;
}

.logo {
    width: 100px;
    height: auto;
    border-radius: 10px;
    display: block;
    margin: 0 auto 0.5rem auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2.2rem;
    margin: 0.2rem 0 0.4rem 0;
}

header p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
}

main {
    max-width: 760px;
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.55);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(1px);
}

.levels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
    max-width: 420px;
    margin: 1rem auto 0 auto;
}

.levelBtn {
    background-color: #008751;
    color: #FFFFFF;
    border: none;
    padding: 0.9rem 1.2rem;
    border-radius: 0.6rem;
    cursor: pointer;
    font-size: 1rem;
    transition: transform .05s ease, background .2s ease;
}

.levelBtn:hover {
    background-color: #009f60;
}

.levelBtn:active {
    transform: translateY(1px);
}

.locked {
    background-color: #e1e1e1;
    color: #777;
    border: 1px solid #ccc;
    cursor: not-allowed;
}

.hint {
    color: #555;
    font-size: 0.9rem;
    margin-top: 0.6rem;
}

.quizHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

#levelBadge {
    background: #E8FAEF;
    color: #006444;
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    font-weight: 600;
}

#scoreDisplay {
    background: #E8FAEF;
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    color: #006444;
    font-weight: 600;
}

.progressWrap {
    width: 100%;
    height: 10px;
    background: #f0f0f0;
    border-radius: 999px;
    overflow: hidden;
    margin: 0.4rem 0 0.6rem 0;
}

#progressFill {
    height: 100%;
    width: 0%;
    background: #008751;
    transition: width .25s ease;
}

#progressLabel {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

#questionText {
    margin: 0.4rem 0 0.6rem 0;
}

.fade-in {
    opacity: 0;
    transform: translateY(0);
    animation: fadeIn 250ms ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#optionsContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    margin: 1.2rem 0;
}

.optionBtn {
    background-color: #F0FFF4;
    border: 2px solid #008751;
    width: 96%;
    padding: 0.9rem;
    border-radius: 0.6rem;
    cursor: pointer;
    font-size: 1rem;
    color: #003b28;
    font-weight: 800;
    transition: background .2s ease, transform .05s ease, border .2s ease, color .2s ease;
}

.optionBtn:hover {
    background-color: #E4F9ED;
}

.optionBtn:active {
    transform: translateY(1px);
}

.optionBtn.selected {
    background-color: #008751;
    color: #ffffff;
    border-color: #004d33;
}

.optionBtn.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.actionRow {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
}

.quizActions {
    margin-top: 1.2rem;
}

/* Extra spacing + visual separation to prevent accidental taps */
.restartRow {
    margin-top: 2.4rem;
    padding-top: 1.4rem;
    border-top: 1px solid #e3e3e3;
}

button {
    background-color: #008751;
    color: #FFFFFF;
    border: none;
    padding: 0.9rem 1.6rem;
    border-radius: 0.6rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s ease;
}

button:hover {
    background-color: #009f60;
}

button.secondary {
    background: #e9e9e9;
    color: #222;
}

button.ghost {
    background: #ffffff;
    color: #008751;
    border: 2px solid #008751;
}

button.success {
    background: #19a974;
    color: #fff;
}

#leaderboard {
    background: #F9F9F9;
    padding: 1rem;
    border-radius: 0.6rem;
    margin-top: 1.2rem;
    text-align: left;
}

.endActions {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}

footer {
    text-align: center;
    background: #FFFFFF;
    padding: 1.4rem 1rem;
    margin-top: 2rem;
    color: #555555;
    font-size: 0.95rem;
}

footer p {
    margin: 0.25rem 0;
}

footer a {
    color: #008751;
    text-decoration: none;
    font-weight: 700;
}

@media (max-width: 480px) {
    main {
        margin: 1rem;
        padding: 1.2rem;
    }

    .optionBtn {
        width: 100%;
    }

    .levels {
        max-width: 100%;
    }
}

/* Music toggle button */
.musicBtn {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #008751;
    color: #fff;
    font-size: 22px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.musicBtn:hover {
    background: #009f60;
}

.musicBtn.muted {
    background: #e9e9e9;
    color: #222;
}

.featured-img {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

/* Repositioned timer – stays hidden until JS shows it */
#timerBox {
    position: fixed;
    top: 140px;
    /* more down */
    left: 22px;
    /* on the left side */
    z-index: 9999;
    /* DO NOT force display here */
}

/* Timer circle style */
#timerCircle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #00923f;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 22px;
    color: #00923f;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.25);
}

#timerBox {
    display: none;
}

.correctHighlight {
    background: #a0ffbf !important;
    border-color: #00a54f !important;
    color: #004d28 !important;
    font-weight: 900;
}

/* Highlight for correct answer after confirm/timeup */
.optionBtn.correctHighlight {
    border-color: #1a7f37;
    background: #e6f4ea;
    color: #0b4d2b;
}

.hidden {
    display: none !important;
}

/* Clear red for incorrect answer */
.incorrectHighlight {
    background: #ffe0e0 !important;
    border-color: #d00000 !important;
    color: #8b0000 !important;
    font-weight: 700;
}

/* More readable explanation text */
.explanation {
    font-size: 1.05rem;
    line-height: 1.4;
}