/* timelinequiz.css — "Before or After?" rolling-anchor timeline quiz */

/* ── Feature box (start screen, lives at the top of the quiz hub) ─────────────── */
.feature-box {
    max-width: 1150px;
    margin: 0 auto 50px;
    overflow: hidden;
    text-align: center;
    border-radius: 0;
    background-color: #fff;
    box-shadow: 2px 6px 8px 0 rgba(22, 22, 26, 0.18);
}

.feature-box-body {
    padding: 30px;
}

/* When object-fit: cover has to crop vertically, crop off the top and keep
   the bottom of the image in view, instead of the default center crop. */
.feature-box .image-wrapper img {
    object-position: center bottom;
}

/* Below this, stack the box like a single quiz card (image on top, full
   width) — the side-by-side layout needs more room than that to avoid
   squeezing the title/description/button into a cramped right column. */
@media screen and (max-width: 1049px) {
    .feature-box {
        width: 95%;
    }
}

/* On wide screens the image sits on the left at the same footprint as a
   single quiz card's own image (~29.5vw/14.8vw approximate that card's
   width/height at this breakpoint), flush against the box's left, top and
   bottom edges, with the title/description/Play button filling the rest of
   the (now wider) box on the right. The wrapper keeps its default 2:1
   aspect-ratio so it matches a card's image when the text column is short,
   but has no fixed height, so flex stretch grows it (cropping further via
   object-fit: cover, never distorting) to stay flush if the text is taller. */
@media screen and (min-width: 1050px) {
    .feature-box {
        display: flex;
    }

    .feature-box .image-wrapper {
        flex: 0 0 29.5vw;
        width: 29.5vw;
    }

    .feature-box-body {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}

.feature-box-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.feature-box-description {
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
}

.feature-box-best-score {
    margin-bottom: 1.25rem;
    font-weight: 600;
}


/* ── Game app shell ─────────────────────────────────────────────────────────── */
.tq-app {
    display: none;
    width: 90%;
    max-width: 650px;
    margin: 50px auto 0;
    padding: 30px;
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 2px 6px 8px 0 rgba(22, 22, 26, 0.18);
}

.tq-app.is-visible {
    display: block;
}

.tq-app h2 {
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
    font-size: 25px;
    font-weight: 600;
    text-align: center;
}

.tq-app h2:focus-visible,
.tq-app h3:focus-visible {
    outline: 2px solid #000;
    outline-offset: 4px;
}

.tq-screen {
    padding: 20px 0;
}

/* ── Score ──────────────────────────────────────────────────────────────────── */
.tq-score {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.tq-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
}

.tq-card {
    display: flex;
    flex-direction: column;
    padding: 18px;
    border: 1px solid #222;
    border-radius: 6px;
    text-align: center;
    transition: background-color 0.3s;
}

.tq-card-event {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Pinned to the bottom of the card via margin-top: auto, so the year (and the
   Before/After buttons, which occupy the same row on the new-event card before
   its year is revealed) line up at the same height across both cards regardless
   of how many lines the event text above took up. */
.tq-card-footer {
    margin-top: auto;
}

.tq-card-year {
    font-size: 0.9rem;
    font-weight: 400;
    color: #555;
}

.tq-card-year.is-hidden {
    display: none;
}

.tq-new-card .tq-card-year:not(.is-hidden) {
    animation: tq-reveal 0.4s ease-out;
}

@keyframes tq-reveal {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

.tq-card.tq-correct {
    background-color: #9aeabc;
}

.tq-card.tq-incorrect {
    background-color: #ff9393;
}

.tq-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #888;
}

@media (min-width: 568px) {
    .tq-cards {
        flex-direction: row;
        align-items: stretch;
    }

    .tq-card {
        flex: 1;
    }
}

/* ── Before / After buttons ────────────────────────────────────────────────── */
.tq-buttons {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.tq-answer-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background-color: black;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

/* Scoped to real pointer devices so a tap on a touchscreen doesn't leave the
   button stuck in its hover color until the player taps elsewhere — touch
   has no "leave" event to clear :hover. */
@media (hover: hover) and (pointer: fine) {
    .tq-answer-btn:hover:not(:disabled) {
        background-color: #333;
    }
}

.tq-answer-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ── Game over screen ──────────────────────────────────────────────────────── */
#tq-gameover-heading {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.tq-final-pair {
    margin-bottom: 16px;
}

.tq-final-row {
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #222;
    border-radius: 6px;
}

.tq-final-score {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.tq-best-score {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.tq-recap-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.tq-recap-list {
    max-height: 260px;
    overflow-y: auto;
    padding-left: 1.4rem;
    margin-bottom: 20px;
}

.tq-recap-list li {
    margin-bottom: 6px;
}

.tq-share-title {
    text-align: center;
    margin-top: 20px;
}

.tq-gameover-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.tq-gameover-buttons .btn {
    min-width: 200px;
    padding-top: 10px;
    padding-bottom: 10px;
}

@media (min-width: 568px) {
    .tq-gameover-buttons {
        flex-direction: row;
        justify-content: center;
    }
}

/* "Copied to clipboard" popup — same pattern as the daily games' .copied-modal */
.tq-copied-modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 20, 20, 0.7);
}

.tq-copied-modal.tq-copied-visible {
    display: flex;
}

.tq-copied-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 350px;
    max-width: 90%;
    padding: 15px 10px;
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 0 2px 2px rgb(0, 0, 0);
    text-align: center;
}

.tq-copied-description {
    color: black;
    font-size: 1.5rem;
    font-weight: bold;
}
