/*
|--------------------------------------------------------------------------
| METEORO
|--------------------------------------------------------------------------
*/

:root {
    --meteor-primary: #c125fa;
    --meteor-primary-dark: #9715c7;
    --meteor-primary-soft: #f4ddff;
    --meteor-danger: #e55353;
    --meteor-success: #4cb86a;
    --meteor-surface: rgba(255, 255, 255, 0.96);
    --meteor-text: #372d3a;
}


/*
|--------------------------------------------------------------------------
| Reset
|--------------------------------------------------------------------------
*/

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

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
    overscroll-behavior: none;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #080610;
}

button,
input {
    font: inherit;
}


/*
|--------------------------------------------------------------------------
| Jogo
|--------------------------------------------------------------------------
*/

.meteor-game {
    position: relative;

    width: 100%;
    height: 100dvh;

    overflow: hidden;

    background:
        linear-gradient(
            rgba(6, 2, 14, 0.08),
            rgba(6, 2, 14, 0.16)
        ),
        url("../images/meteoro/background.webp")
        center / cover
        no-repeat;

    isolation: isolate;
}

#meteorCanvas {
    position: absolute;

    inset: 0;

    z-index: 1;

    display: block;

    width: 100%;
    height: 100%;
}


/*
|--------------------------------------------------------------------------
| Vidas
|--------------------------------------------------------------------------
*/

.meteor-lives {
    position: fixed;

    top:
        calc(
            env(safe-area-inset-top, 0px)
            + 14px
        );

    left:
        calc(
            env(safe-area-inset-left, 0px)
            + 14px
        );

    z-index: 50;

    display: flex;

    align-items: center;

    gap: 6px;

    min-height: 38px;

    padding:
        5px
        9px;

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            0.22
        );

    border-radius: 999px;

    background:
        rgba(
            10,
            5,
            20,
            0.50
        );

    backdrop-filter:
        blur(7px);

    box-shadow:
        0 5px 18px
        rgba(
            0,
            0,
            0,
            0.18
        );
}

.meteor-life {
    width: 27px;
    height: 27px;

    display: block;

    object-fit: contain;

    filter:
        drop-shadow(
            0 2px 4px
            rgba(
                0,
                0,
                0,
                0.28
            )
        );
}


/*
|--------------------------------------------------------------------------
| Contador + texto completo
|--------------------------------------------------------------------------
*/

.meteor-info {
    position: fixed;

    top:
        calc(
            env(safe-area-inset-top, 0px)
            + 14px
        );

    left: 50%;

    z-index: 50;

    transform:
        translateX(-50%);

    display: flex;

    align-items: center;

    gap: 8px;

    max-width:
        min(
            620px,
            calc(100vw - 180px)
        );

    padding:
        7px
        9px;

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            0.22
        );

    border-radius: 999px;

    background:
        rgba(
            10,
            5,
            20,
            0.54
        );

    backdrop-filter:
        blur(8px);

    box-shadow:
        0 5px 18px
        rgba(
            0,
            0,
            0,
            0.18
        );
}

.meteor-counter {
    color: #ffffff;

    font-size: 12px;

    font-weight: 800;

    white-space: nowrap;
}

.meteor-read-more {
    min-height: 30px;

    padding:
        0
        12px;

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            0.40
        );

    border-radius: 999px;

    background:
        rgba(
            193,
            37,
            250,
            0.82
        );

    color: #ffffff;

    font-size: 11px;

    font-weight: 800;

    cursor: pointer;

    transition:
        transform 0.18s ease,
        background 0.18s ease;
}

.meteor-read-more:hover {
    transform:
        translateY(-1px);

    background:
        var(--meteor-primary);
}


/*
|--------------------------------------------------------------------------
| Campo de resposta
|--------------------------------------------------------------------------
*/

.meteor-answer-form {
    position: fixed;

    left: 50%;

    bottom:
        calc(
            env(safe-area-inset-bottom, 0px)
            + 22px
        );

    z-index: 60;

    transform:
        translateX(-50%);

    width:
        min(
            620px,
            90vw
        );

    display: flex;

    align-items: center;

    gap: 8px;
}

.meteor-answer {
    min-width: 0;

    flex: 1;

    height: 52px;

    padding:
        0
        21px;

    border:
        2px solid
        rgba(
            211,
            110,
            255,
            0.96
        );

    border-radius: 999px;

    outline: none;

    background:
        rgba(
            7,
            4,
            13,
            0.72
        );

    color: #ffffff;

    text-align: center;

    font-size: 17px;

    font-weight: 700;

    box-shadow:
        0 8px 24px
        rgba(
            0,
            0,
            0,
            0.22
        );

    backdrop-filter:
        blur(8px);

    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        transform 0.18s ease;
}

.meteor-answer::placeholder {
    color:
        rgba(
            255,
            255,
            255,
            0.66
        );
}

.meteor-answer:focus {
    border-color:
        #ffffff;

    background:
        rgba(
            17,
            7,
            27,
            0.84
        );
}

.meteor-answer.is-correct {
    border-color:
        var(--meteor-success);

    background:
        rgba(
            39,
            125,
            65,
            0.82
        );
}

.meteor-answer.is-wrong {
    border-color:
        var(--meteor-danger);

    background:
        rgba(
            145,
            42,
            42,
            0.84
        );

    animation:
        meteorWrongInput
        0.28s ease;
}

.meteor-answer-submit {
    width: 52px;
    height: 52px;

    flex:
        0
        0
        52px;

    display: flex;

    align-items: center;
    justify-content: center;

    border:
        2px solid
        rgba(
            255,
            255,
            255,
            0.62
        );

    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            var(--meteor-primary),
            var(--meteor-primary-dark)
        );

    color: #ffffff;

    font-size: 22px;

    font-weight: 900;

    cursor: pointer;

    box-shadow:
        0 8px 22px
        rgba(
            193,
            37,
            250,
            0.28
        );

    transition:
        transform 0.18s ease;
}

.meteor-answer-submit:hover {
    transform:
        translateY(-2px);
}

.meteor-answer-submit:disabled,
.meteor-answer:disabled {
    opacity: 0.65;

    cursor: default;
}


/*
|--------------------------------------------------------------------------
| Teclado mobile
|--------------------------------------------------------------------------
*/

.meteor-keyboard {
    position: fixed;

    left: 0;
    bottom: 0;

    z-index: 70;

    width: 100%;

    display: none;

    padding:
        6px
        7px
        calc(
            env(
                safe-area-inset-bottom,
                0px
            )
            + 7px
        );

    border-top:
        1px solid
        rgba(
            213,
            102,
            255,
            0.42
        );

    background:
        rgba(
            20,
            6,
            30,
            0.93
        );

    backdrop-filter:
        blur(10px);
}

.meteor-keyboard-row {
    display: flex;

    gap: 5px;

    margin-bottom: 5px;
}

.meteor-keyboard-row:last-child {
    margin-bottom: 0;
}

.meteor-keyboard button {
    min-width: 0;

    flex: 1;

    min-height: 43px;

    padding:
        5px
        3px;

    border:
        1px solid
        rgba(
            194,
            89,
            239,
            0.64
        );

    border-radius: 9px;

    background:
        rgba(
            255,
            255,
            255,
            0.08
        );

    color: #ffffff;

    font-size: 16px;

    font-weight: 700;

    cursor: pointer;

    -webkit-tap-highlight-color:
        transparent;
}

.meteor-keyboard button:active {
    transform:
        scale(0.96);

    background:
        var(--meteor-primary);
}

.meteor-keyboard
.meteor-key-special {
    border-color:
        rgba(
            229,
            161,
            255,
            0.88
        );

    background:
        rgba(
            193,
            37,
            250,
            0.20
        );
}


/*
|--------------------------------------------------------------------------
| Tela inicial
|--------------------------------------------------------------------------
*/

.meteor-start-overlay {
    position: fixed;

    inset: 0;

    z-index: 5000;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 22px;

    background:
        rgba(
            3,
            1,
            8,
            0.74
        );

    backdrop-filter:
        blur(6px);

    transition:
        opacity 0.28s ease;
}

.meteor-start-overlay.is-hidden {
    opacity: 0;

    pointer-events: none;
}

.meteor-start-card {
    width:
        min(
            520px,
            94vw
        );

    padding:
        32px;

    border:
        2px solid
        rgba(
            207,
            94,
            255,
            0.86
        );

    border-radius: 20px;

    background:
        rgba(
            255,
            255,
            255,
            0.97
        );

    color:
        var(--meteor-text);

    text-align: center;

    box-shadow:
        0 24px 70px
        rgba(
            0,
            0,
            0,
            0.34
        );
}

.meteor-start-kicker,
.meteor-end-kicker,
.meteor-text-kicker {
    color:
        var(--meteor-primary);

    font-size: 11px;

    font-weight: 900;

    letter-spacing: 1px;

    text-transform: uppercase;
}

.meteor-start-card h1 {
    margin:
        8px
        0
        10px;

    color: #352839;

    font-size:
        clamp(
            28px,
            5vw,
            42px
        );
}

.meteor-start-card p {
    margin:
        0
        auto
        24px;

    max-width: 420px;

    color: #6d6071;

    font-size: 15px;

    line-height: 1.55;
}

.meteor-start-card button,
.meteor-end-card button,
.meteor-text-card button {
    min-height: 46px;

    padding:
        0
        25px;

    border: 0;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            var(--meteor-primary),
            var(--meteor-primary-dark)
        );

    color: #ffffff;

    font-weight: 900;

    cursor: pointer;

    box-shadow:
        0 7px 20px
        rgba(
            193,
            37,
            250,
            0.26
        );

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.meteor-start-card button:hover,
.meteor-end-card button:hover,
.meteor-text-card button:hover {
    transform:
        translateY(-2px);

    box-shadow:
        0 9px 24px
        rgba(
            193,
            37,
            250,
            0.32
        );
}


/*
|--------------------------------------------------------------------------
| Tela final
|--------------------------------------------------------------------------
*/

.meteor-end-overlay {
    position: fixed;

    inset: 0;

    z-index: 5200;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 22px;

    background:
        rgba(
            3,
            1,
            8,
            0.72
        );

    backdrop-filter:
        blur(6px);
}

.meteor-end-overlay.is-visible {
    display: flex;
}

.meteor-end-card {
    width:
        min(
            500px,
            94vw
        );

    padding:
        30px;

    border:
        2px solid
        var(--meteor-primary);

    border-radius: 19px;

    background:
        rgba(
            255,
            255,
            255,
            0.98
        );

    color:
        var(--meteor-text);

    text-align: center;

    box-shadow:
        0 22px 65px
        rgba(
            0,
            0,
            0,
            0.32
        );
}

.meteor-end-card h2 {
    margin:
        8px
        0
        10px;

    color: #352839;

    font-size:
        clamp(
            25px,
            4vw,
            35px
        );
}

.meteor-end-card p {
    margin:
        0
        0
        23px;

    color: #6e6172;

    line-height: 1.5;
}


/*
|--------------------------------------------------------------------------
| Modal de texto completo
|--------------------------------------------------------------------------
*/

.meteor-text-modal {
    position: fixed;

    inset: 0;

    z-index: 6000;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 22px;

    background:
        rgba(
            0,
            0,
            0,
            0.68
        );

    backdrop-filter:
        blur(6px);
}

.meteor-text-modal.is-visible {
    display: flex;
}

.meteor-text-card {
    width:
        min(
            720px,
            94vw
        );

    max-height:
        min(
            78vh,
            720px
        );

    display: flex;

    flex-direction: column;

    padding:
        28px;

    border:
        2px solid
        var(--meteor-primary);

    border-radius: 19px;

    background:
        #ffffff;

    color:
        var(--meteor-text);

    box-shadow:
        0 24px 75px
        rgba(
            0,
            0,
            0,
            0.34
        );
}

.meteor-text-card h2 {
    margin:
        7px
        0
        12px;

    color: #352839;

    font-size:
        clamp(
            23px,
            4vw,
            31px
        );
}

.meteor-text-card p {
    margin:
        0
        0
        20px;

    padding-right: 5px;

    overflow-y: auto;

    color: #5f5363;

    font-size: 16px;

    line-height: 1.65;

    white-space: pre-wrap;

    overflow-wrap: anywhere;
}

.meteor-text-card button {
    align-self: flex-end;
}


/*
|--------------------------------------------------------------------------
| Animações
|--------------------------------------------------------------------------
*/

@keyframes meteorWrongInput {
    0%,
    100% {
        transform:
            translateX(0);
    }

    25% {
        transform:
            translateX(-6px);
    }

    50% {
        transform:
            translateX(5px);
    }

    75% {
        transform:
            translateX(-3px);
    }
}


/*
|--------------------------------------------------------------------------
| Mobile
|--------------------------------------------------------------------------
*/

@media (max-width: 768px) {

    .meteor-life {
        width: 23px;
        height: 23px;
    }

    .meteor-lives {
        top:
            calc(
                env(
                    safe-area-inset-top,
                    0px
                )
                + 8px
            );

        left:
            calc(
                env(
                    safe-area-inset-left,
                    0px
                )
                + 8px
            );

        gap: 4px;

        min-height: 34px;

        padding:
            4px
            7px;
    }

    .meteor-info {
        top:
            calc(
                env(
                    safe-area-inset-top,
                    0px
                )
                + 8px
            );

        max-width:
            calc(
                100vw
                - 150px
            );

        gap: 5px;

        padding:
            5px
            7px;
    }

    .meteor-counter {
        font-size: 10px;
    }

    .meteor-read-more {
        min-height: 26px;

        padding:
            0
            8px;

        font-size: 9px;
    }

    .meteor-answer-form {
        bottom:
            calc(
                env(
                    safe-area-inset-bottom,
                    0px
                )
                + 196px
            );

        width:
            min(
                94vw,
                560px
            );

        gap: 6px;
    }

    .meteor-answer {
        height: 46px;

        padding:
            0
            15px;

        font-size: 15px;
    }

    .meteor-answer-submit {
        display: none;
    }

    .meteor-keyboard {
        display: block;
    }

    .meteor-start-card,
    .meteor-end-card,
    .meteor-text-card {
        padding:
            24px
            20px;
    }
}


/*
|--------------------------------------------------------------------------
| Mobile muito baixo / horizontal
|--------------------------------------------------------------------------
*/

@media
(max-height: 590px)
and
(max-width: 900px) {

    .meteor-answer-form {
        bottom:
            calc(
                env(
                    safe-area-inset-bottom,
                    0px
                )
                + 165px
            );
    }

    .meteor-keyboard {
        padding-top: 4px;
    }

    .meteor-keyboard-row {
        gap: 4px;

        margin-bottom: 4px;
    }

    .meteor-keyboard button {
        min-height: 35px;

        font-size: 14px;
    }
}