/* ==========================================================
   S00B — CONTINUAR PARTIDA
========================================================== */

.qrae-screen-resume {
    position: relative;
    isolation: isolate;

    display: grid;

    width: 100%;
    min-height: 100dvh;

    place-items: center;

    padding:
        max(24px, env(safe-area-inset-top))
        20px
        max(24px, env(safe-area-inset-bottom));

    overflow: hidden;

    background: #062745;
}

.qrae-resume-background {
    position: absolute;
    inset: 0;
    z-index: 0;

    background:
        url(
            '../../adventures/la-gran-expedicio/assets/images/ui/question/background.jpg'
        )
        center / cover
        no-repeat;

    transform: scale(1.03);
}

.qrae-resume-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;

    display: grid;

    padding:
        max(24px, env(safe-area-inset-top))
        20px
        max(24px, env(safe-area-inset-bottom));

    place-items: center;

    background:
        linear-gradient(
            180deg,
            rgba(6, 39, 69, 0.35) 0%,
            rgba(6, 39, 69, 0.58) 50%,
            rgba(6, 39, 69, 0.88) 100%
        );
}

.qrae-resume-card {
    width: min(100%, 360px);

    padding:
        clamp(25px, 7vw, 38px)
        clamp(19px, 6vw, 28px);

    color: #ffffff;
    text-align: center;

    background:
        linear-gradient(
            180deg,
            rgba(11, 47, 99, 0.96) 0%,
            rgba(6, 39, 69, 0.98) 100%
        );

    border: 3px solid #ffffff;
    border-radius: 26px;

    box-shadow:
        0 0 0 4px rgba(245, 178, 26, 0.22),
        0 20px 46px rgba(0, 0, 0, 0.36);

    animation:
        qrae-resume-card-enter
        520ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-resume-kicker {
    margin: 0 0 7px;

    color: #f5b21a;

    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.qrae-resume-card h1 {
    margin: 0;

    color: #ffffff;

    font-size:
        clamp(
            2.6rem,
            12vw,
            4rem
        );

    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.045em;
    text-transform: uppercase;

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

.qrae-resume-message {
    margin: 17px 0 21px;

    color:
        rgba(
            255,
            255,
            255,
            0.9
        );

    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
}

.qrae-resume-progress {
    padding: 16px;

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

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

    border-radius: 18px;
}

.qrae-resume-progress strong {
    display: block;

    color: #f5b21a;

    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1;
}

.qrae-resume-progress > span {
    display: block;

    margin-top: 5px;

    color: #ffffff;

    font-size: 0.85rem;
    font-weight: 700;
}

.qrae-resume-progress-track {
    width: 100%;
    height: 9px;

    margin-top: 13px;

    overflow: hidden;

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

    border-radius: 999px;
}

.qrae-resume-progress-track span {
    display: block;

    height: 100%;

    background:
        linear-gradient(
            90deg,
            #f5b21a 0%,
            #f8ca59 100%
        );

    border-radius: inherit;

    transition:
        width 420ms ease;
}

.qrae-resume-destination {
    display: grid;
    gap: 4px;

    margin-top: 15px;
    padding: 13px 15px;

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

    border-radius: 15px;
}

.qrae-resume-destination span {
    color: #f5b21a;

    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.qrae-resume-destination strong {
    color: #ffffff;

    font-size: 1rem;
    font-weight: 800;
}

.qrae-resume-actions {
    display: grid;
    gap: 14px;

    margin-top: 22px;
}

@keyframes qrae-resume-card-enter {
    from {
        opacity: 0;

        transform:
            translateY(28px)
            scale(0.95);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}

/* ==========================================================
   SIMULACIÓ MÒBIL EN ORDINADOR
========================================================== */

body:has(.qrae-screen-resume) {
    overflow: hidden;
    background: #101820;
}

#app:has(.qrae-screen-resume),
.qrae-app:has(.qrae-screen-resume) {
    display: grid;

    min-height: 100dvh;

    place-items: center;
}

@media (min-width: 601px) {

    .qrae-screen.qrae-screen-resume {
        width:
            min(
                430px,
                calc(100dvh * 9 / 16)
            );

        height: auto;
        min-height: 0;
        max-height: 100dvh;

        aspect-ratio: 9 / 16;

        box-shadow:
            0 18px 55px
            rgba(0, 0, 0, 0.38);
    }
}

@media (max-width: 600px) {

    .qrae-screen.qrae-screen-resume {
        width: 100vw;
        height: 100dvh;
        min-height: 100dvh;

        aspect-ratio: auto;
    }
}

@media (max-height: 700px) {

    .qrae-resume-card {
        padding:
            20px
            17px;
    }

    .qrae-resume-card h1 {
        font-size: 2.35rem;
    }

    .qrae-resume-message {
        margin:
            12px
            0
            15px;

        font-size: 0.88rem;
    }

    .qrae-resume-progress {
        padding: 12px;
    }

    .qrae-resume-actions {
        margin-top: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .qrae-resume-card {
        animation: none;
    }

    .qrae-resume-progress-track span {
        transition: none;
    }
}

.qrae-resume-video-stage {
    position: absolute;
    inset: 0;
    z-index: 2;

    display: grid;

    width: 100%;
    min-height: 100dvh;

    place-items: center;
    overflow: hidden;

    background: #000000;
}

.qrae-resume-video-stage[hidden] {
    display: none;
}

.qrae-resume-video {
    display: block;

    width: min(
        430px,
        100vw,
        calc(100dvh * 9 / 16)
    );

    height: min(
        100dvh,
        calc(100vw * 16 / 9)
    );

    aspect-ratio: 9 / 16;
    object-fit: cover;

    background: #000000;
}

.qrae-resume-card[hidden] {
    display: none;
}

.qrae-resume-card.is-visible {
    display: block;

    animation:
        qrae-resume-card-reveal
        460ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

@keyframes qrae-resume-card-reveal {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {

    .qrae-resume-video {
        width: 100vw;
        height: 100dvh;
        aspect-ratio: auto;
    }
}

@media (prefers-reduced-motion: reduce) {

    .qrae-resume-card.is-visible {
        animation: none;
    }
}

/* ==========================================================
   PWA — INSTAL·LACIÓ
========================================================== */

.qrae-start-actions:has(.qrae-install-app-button) {
    display: grid;
    gap: 12px;
}

.qrae-install-app-button {
    width: 100%;
    min-height: 52px;
}

.qrae-screen-install-app {
    position: relative;
    isolation: isolate;
    display: grid;
    width: 100%;
    min-height: 100dvh;
    padding: 0;
    place-items: center;
    overflow: hidden;
    background: #062745;
}

.qrae-install-app-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        url(
            '../../adventures/la-gran-expedicio/assets/images/ui/question/background.jpg'
        )
        center / cover
        no-repeat;
}

.qrae-install-app-overlay {
    position: relative;
    z-index: 1;
    display: grid;
    width: 100%;
    min-height: 100dvh;
    padding:
        max(22px, env(safe-area-inset-top))
        18px
        max(22px, env(safe-area-inset-bottom));
    place-items: center;
    overflow-y: auto;
    background: rgba(6, 39, 69, 0.72);
}

.qrae-install-app-card,
.qrae-install-tutorial-card {
    width: min(100%, 400px);
    padding: 24px 20px;
    color: #ffffff;
    text-align: center;
    background:
        linear-gradient(
            180deg,
            rgba(11, 47, 99, 0.98),
            rgba(6, 39, 69, 0.99)
        );
    border: 3px solid #ffffff;
    border-radius: 23px;
    box-shadow:
        0 0 0 4px rgba(245, 178, 26, 0.2),
        0 18px 44px rgba(0, 0, 0, 0.34);
    animation:
        qrae-install-card-enter
        460ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-install-app-icon,
.qrae-install-tutorial-icon {
    margin-bottom: 10px;
    font-size: 3rem;
    line-height: 1;
}

.qrae-install-app-header h1,
.qrae-install-tutorial-card h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.55rem, 7vw, 2rem);
    line-height: 1.05;
}

.qrae-install-app-header p,
.qrae-install-tutorial-card > p {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.9rem;
    line-height: 1.4;
}

.qrae-install-benefits {
    display: grid;
    gap: 7px;
    margin: 18px 0;
    padding: 0;
    color: #ffffff;
    text-align: left;
    list-style: none;
}

.qrae-install-instructions {
    margin-bottom: 16px;
    padding: 15px;
    color: #062745;
    text-align: left;
    background: #ffffff;
    border-radius: 15px;
}

.qrae-install-instructions p {
    margin: 0;
    line-height: 1.45;
}

.qrae-install-instructions ol {
    display: grid;
    gap: 9px;
    margin: 0;
    padding-left: 22px;
}

.qrae-install-app-card > .qrae-button,
.qrae-install-instructions .qrae-button,
.qrae-install-tutorial-actions .qrae-button {
    width: 100%;
}

.qrae-install-tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    padding:
        max(20px, env(safe-area-inset-top))
        18px
        max(20px, env(safe-area-inset-bottom));
    place-items: center;
    overflow-y: auto;
    background: rgba(2, 20, 36, 0.84);
    backdrop-filter: blur(5px);
}

.qrae-install-tutorial-actions {
    display: grid;
    gap: 10px;
}

@keyframes qrae-install-card-enter {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (min-width: 601px) {

    .qrae-screen-install-app {
        width: min(430px, calc(100dvh * 9 / 16));
        min-height: 0;
        max-height: 100dvh;
        aspect-ratio: 9 / 16;
        margin: 0 auto;
    }
}

@media (max-height: 700px) {

    .qrae-install-app-card,
    .qrae-install-tutorial-card {
        padding: 18px 16px;
    }

    .qrae-install-benefits {
        margin: 12px 0;
    }
}

@media (prefers-reduced-motion: reduce) {

    .qrae-install-app-card,
    .qrae-install-tutorial-card {
        animation: none;
    }
}
