/* Public pages of the apps: shared questions, fun facts, FAQ, policy pages.
   --c1 / --c2 are set per page (an app's or a production's colors) and tint everything. */

:root {
    --c1: #7c4dff;
    --c2: #00b8d4;
    --ink: #f5f6fb;
    --ink-soft: rgba(245, 246, 251, 0.72);
    --night: #090a13;
    --glass: rgba(255, 255, 255, 0.07);
    --glass-line: rgba(255, 255, 255, 0.16);
    --good: #19d17f;
    --bad: #ff5470;
    --cta: #19d17f;
    --cta-ink: #04130c;
    --radius: 20px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--night);
    color: var(--ink);
    font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
}

/* --- Living background ----------------------------------------------------------- */

.backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: var(--night);
}

.backdrop__image {
    position: absolute;
    inset: -20px;
    background-size: cover;
    background-position: center;
    opacity: 0.22;
    filter: blur(6px) saturate(1.2);
    animation: breathe 24s ease-in-out infinite alternate;
}

.backdrop__blob {
    position: absolute;
    width: 62vmax;
    height: 62vmax;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.95;
    will-change: transform;
}

.backdrop__blob--one {
    top: -16vmax;
    left: -12vmax;
    background: radial-gradient(circle, var(--c1), transparent 65%);
    animation: drift-one 19s ease-in-out infinite alternate;
}

.backdrop__blob--two {
    bottom: -18vmax;
    right: -12vmax;
    background: radial-gradient(circle, var(--c2), transparent 65%);
    animation: drift-two 23s ease-in-out infinite alternate;
}

.backdrop__shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, transparent 35%, rgba(9, 10, 19, 0.55) 100%),
        linear-gradient(rgba(9, 10, 19, 0.1), rgba(9, 10, 19, 0.45));
}

@keyframes drift-one {
    to { transform: translate(26vmax, 12vmax) scale(1.2); }
}

@keyframes drift-two {
    to { transform: translate(-24vmax, -10vmax) scale(0.95); }
}

@keyframes breathe {
    to { transform: scale(1.08); }
}

/* --- Frame ----------------------------------------------------------------------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1080px;
    margin: 0 auto;
    padding: 20px 24px;
}

.topbar__logo img {
    display: block;
    height: 34px;
}

.stage {
    max-width: 880px;
    margin: 0 auto;
    padding: 24px 24px 72px;
}

.stage--hero {
    min-height: calc(100vh - 90px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid var(--glass-line);
    border-radius: 999px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.chip::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c1), var(--c2));
    box-shadow: 0 0 12px var(--c1);
    animation: blink 2.4s ease-in-out infinite;
}

@keyframes blink {
    50% { opacity: 0.35; }
}

.eyebrow {
    margin: 18px 0 6px;
    color: var(--ink-soft);
    font-size: 1.05rem;
    font-weight: 500;
}

.headline {
    margin: 0;
    font-size: clamp(1.7rem, 4.6vw, 2.9rem);
    font-weight: 700;
    line-height: 1.15;
    text-wrap: balance;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.rise {
    animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(var(--i, 0) * 90ms);
}

@keyframes rise {
    from { opacity: 0; transform: translateY(22px); }
}

/* --- Question -------------------------------------------------------------------- */

.timer {
    height: 6px;
    margin: 28px 0 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.timer__bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--c1), var(--c2));
    transform-origin: left;
    animation: countdown var(--seconds, 20s) linear forwards;
}

.is-answered .timer__bar {
    animation-play-state: paused;
}

@keyframes countdown {
    to { transform: scaleX(0); }
}

.answers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.answer {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 84px;
    padding: 16px 18px;
    border: 1px solid var(--glass-line);
    border-radius: var(--radius);
    background: var(--glass);
    backdrop-filter: blur(12px);
    color: inherit;
    font: inherit;
    font-size: 1.08rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease,
        box-shadow 0.18s ease, opacity 0.3s ease;
    animation: pop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
    animation-delay: calc(240ms + var(--i, 0) * 90ms);
}

@keyframes pop {
    from { opacity: 0; transform: translateY(18px) scale(0.96); }
}

.answer__letter {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    font-weight: 700;
    transition: background 0.18s ease, color 0.18s ease;
}

.answer:hover,
.answer:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 36px -14px var(--c1);
    outline: none;
}

.answer:hover .answer__letter,
.answer:focus-visible .answer__letter {
    background: linear-gradient(135deg, var(--c1), var(--c2));
}

.is-answered .answer {
    cursor: default;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.is-answered .answer:not(.is-correct):not(.is-wrong) {
    opacity: 0.42;
}

.answer.is-correct {
    border-color: var(--good);
    background: rgba(25, 209, 127, 0.2);
    animation: celebrate 0.6s ease;
}

.answer.is-correct .answer__letter {
    background: var(--good);
    color: var(--cta-ink);
}

.answer.is-wrong {
    border-color: var(--bad);
    background: rgba(255, 84, 112, 0.2);
    animation: shake 0.45s ease;
}

.answer.is-wrong .answer__letter {
    background: var(--bad);
}

@keyframes celebrate {
    40% { transform: scale(1.05); }
}

@keyframes shake {
    20%, 60% { transform: translateX(-7px); }
    40%, 80% { transform: translateX(7px); }
}

/* --- Result ---------------------------------------------------------------------- */

.result {
    display: none;
    margin-top: 28px;
    padding: 24px;
    border: 1px solid var(--glass-line);
    border-radius: var(--radius);
    background: rgba(9, 10, 19, 0.55);
    backdrop-filter: blur(14px);
    text-align: center;
}

.result[data-state] {
    display: block;
    animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.result__variant {
    display: none;
}

.result[data-state="correct"] .result__variant--correct,
.result[data-state="wrong"] .result__variant--wrong,
.result[data-state="timeout"] .result__variant--timeout {
    display: block;
}

.result__title {
    margin: 0 0 4px;
    font-size: 1.7rem;
    font-weight: 700;
}

.result[data-state="correct"] .result__title {
    color: var(--good);
}

.result__text {
    margin: 0;
    color: var(--ink-soft);
}

.streak {
    display: none;
    margin: 12px auto 0;
    padding: 4px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--c1), var(--c2));
    font-weight: 700;
}

.streak.is-visible {
    display: inline-block;
    animation: pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 20px;
}

/* --- Buttons --------------------------------------------------------------------- */

.cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 26px;
    border-radius: 999px;
    background: var(--cta);
    color: var(--cta-ink);
    font-size: 1.08rem;
    font-weight: 700;
    text-decoration: none;
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.18s ease;
    animation: pulse 2.6s ease-out infinite;
}

.cta::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.65) 50%, transparent 70%);
    transform: translateX(-120%);
    animation: shine 3.2s ease-in-out infinite;
}

.cta:hover,
.cta:focus-visible {
    transform: translateY(-2px) scale(1.03);
    outline: none;
}

.cta svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.cta--small {
    padding: 9px 16px;
    font-size: 0.92rem;
    animation: none;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(25, 209, 127, 0.55); }
    70%, 100% { box-shadow: 0 0 0 18px rgba(25, 209, 127, 0); }
}

@keyframes shine {
    0%, 55% { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}

.ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 22px;
    border: 1px solid var(--glass-line);
    border-radius: 999px;
    background: var(--glass);
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s ease, transform 0.18s ease;
}

.ghost:hover,
.ghost:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
    outline: none;
}

.ghost svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Fun fact -------------------------------------------------------------------- */

.fact {
    position: relative;
    margin: 26px 0 0;
    padding: 30px 30px 30px 34px;
    border: 1px solid var(--glass-line);
    border-radius: var(--radius);
    background: var(--glass);
    backdrop-filter: blur(12px);
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 500;
    line-height: 1.35;
}

.fact::before {
    content: "";
    position: absolute;
    top: 22px;
    bottom: 22px;
    left: 0;
    width: 5px;
    border-radius: 0 5px 5px 0;
    background: linear-gradient(var(--c1), var(--c2));
}

.fact__source {
    display: block;
    margin-top: 16px;
    color: var(--ink-soft);
    font-size: 0.95rem;
    font-weight: 400;
    overflow-wrap: anywhere;
}

/* --- Want more ------------------------------------------------------------------- */

.more {
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px 24px 80px;
    text-align: center;
}

.more__title {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
}

.more__lead {
    margin: 8px 0 34px;
    color: var(--ink-soft);
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 36px;
    text-align: left;
}

.feature {
    padding: 24px;
    border: 1px solid var(--glass-line);
    border-radius: var(--radius);
    background: var(--glass);
    backdrop-filter: blur(12px);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.feature:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.4);
}

.feature__icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--c1), var(--c2));
}

.feature__icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.feature h3 {
    margin: 0 0 6px;
    font-size: 1.15rem;
}

.feature p {
    margin: 0;
    color: var(--ink-soft);
}

/* Revealed on scroll; only hidden once the script has confirmed it can reveal them. */
.js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
    transition-delay: calc(var(--i, 0) * 110ms);
}

.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* --- Text pages ------------------------------------------------------------------ */

.prose {
    margin-top: 26px;
    padding: 30px;
    border: 1px solid var(--glass-line);
    border-radius: var(--radius);
    background: rgba(9, 10, 19, 0.62);
    backdrop-filter: blur(14px);
    color: var(--ink-soft);
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.prose h4 {
    margin: 26px 0 10px;
    color: var(--ink);
    font-size: 1.05rem;
    letter-spacing: 0.04em;
}

.prose strong {
    color: var(--ink);
}

.prose a {
    color: var(--c2);
}

.prose ul {
    padding-left: 22px;
}

.prose li {
    margin-bottom: 8px;
}

/* --- A game's name and icon -------------------------------------------------------- */

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand img {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.brand__name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.brand__tagline {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

.lead {
    margin: 14px 0 0;
    color: var(--ink-soft);
    font-size: 1.1rem;
}

/* --- Result bars ----------------------------------------------------------------- */

.verdict {
    display: none;
}

.result[data-state="same"] .verdict--same,
.result[data-state="other"] .verdict--other,
.result[data-state="tie"] .verdict--tie,
.result[data-state="first"] .verdict--first {
    display: block;
}

.bars {
    margin: 20px 0 6px;
    text-align: left;
}

.bar {
    display: grid;
    grid-template-columns: var(--bar-label, 3.2em) 1fr 3.4em;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-weight: 700;
}

.bar__track {
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.bar__fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--c1), var(--c2));
    transition: width 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bar__percent {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.total {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

/* --- FAQ ------------------------------------------------------------------------- */

.faq {
    margin-top: 26px;
}

.faq details {
    margin-bottom: 12px;
    border: 1px solid var(--glass-line);
    border-radius: var(--radius);
    background: var(--glass);
    backdrop-filter: blur(12px);
    transition: border-color 0.25s ease, background 0.25s ease;
}

.faq details[open] {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
}

.faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    font-size: 1.08rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "+";
    flex: none;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c1), var(--c2));
    font-size: 1.3rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.faq details[open] summary::after {
    transform: rotate(135deg);
}

.faq p {
    margin: 0;
    padding: 0 22px 20px;
    color: var(--ink-soft);
    animation: rise 0.4s ease both;
}

/* --- Footer and sticky bar ------------------------------------------------------- */

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 22px;
    padding: 26px 24px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.footer a {
    text-decoration: none;
}

.footer a:hover {
    color: var(--ink);
    text-decoration: underline;
}

.sticky-cta {
    display: none;
}

.confetti {
    position: fixed;
    inset: 0;
    z-index: 20;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

@media (max-width: 720px) {
    .answers,
    .features {
        grid-template-columns: 1fr;
    }

    .stage--hero {
        justify-content: flex-start;
        padding-top: 12px;
    }

    .answer {
        min-height: 68px;
    }

    .actions .cta,
    .actions .ghost {
        width: 100%;
        justify-content: center;
    }

    .actions .cta {
        padding: 14px 18px;
        text-align: center;
    }

    /* After answering, the store button follows the visitor down the page whenever
       the one in the result box is out of view. */
    .is-answered.is-cta-away .sticky-cta {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 10;
        display: flex;
        justify-content: center;
        animation: rise 0.4s ease both;
    }

    .is-answered .sticky-cta .cta {
        width: 100%;
        justify-content: center;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    }

    .is-answered .footer {
        padding-bottom: 96px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* The countdown is information, not decoration: keep it running. */
    .timer__bar {
        animation-duration: var(--seconds, 20s) !important;
    }
}
