

.qrae-progress {
    width: 100%;
    height: 14px;
    margin: 14px 0 8px;
    overflow: hidden;
    background: #e4e7eb;
    border-radius: var(--qrae-radius-pill);
}

.qrae-progress-bar {
    height: 100%;
    background: var(--qrae-color-primary);
    border-radius: inherit;
    transition: width 0.3s ease;
}

.qrae-progress-text,
.qrae-progress-percentage {
    color: var(--qrae-color-text-muted);
    font-weight: 700;
}

.qrae-progress-percentage {
    margin: 0;
    text-align: right;
}

.qrae-map-placeholder {
    padding: var(--qrae-space-5);
    margin-bottom: var(--qrae-space-5);
    background: var(--qrae-color-surface);
    border: 1px solid var(--qrae-color-border);
    border-radius: var(--qrae-radius-medium);
    box-shadow: var(--qrae-shadow-small);
}

.qrae-map-placeholder > p {
    margin: 0 0 var(--qrae-space-4);
    font-weight: 800;
}

.qrae-map-dots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
    gap: 10px;
}

.qrae-map-dot {
    display: grid;
    aspect-ratio: 1;
    place-items: center;
    min-width: 38px;
    border-radius: 50%;
    background: var(--qrae-color-locked);
    color: #64717d;
    font-weight: 900;
}

.qrae-map-dot.is-active {
    color: #111827;
    background: var(--qrae-color-primary);
    box-shadow: 0 0 0 5px rgba(255, 212, 0, 0.22);
}

.qrae-map-dot.is-completed {
    color: #ffffff;
    background: var(--qrae-color-success);
}

.qrae-next-card,
.qrae-question-box {
    padding: var(--qrae-space-5);
    margin-bottom: var(--qrae-space-5);
    background: var(--qrae-color-surface);
    border-radius: var(--qrae-radius-medium);
    box-shadow: var(--qrae-shadow-medium);
}

.qrae-next-label {
    margin: 0 0 var(--qrae-space-2);
    color: var(--qrae-color-text-muted);
    font-size: 0.88rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.qrae-next-card h2,
.qrae-question-box h2 {
    margin: 0 0 var(--qrae-space-3);
    font-size: 1.65rem;
}

.qrae-next-card p:last-child,
.qrae-question-box p:last-child {
    margin-bottom: 0;
}

.qrae-answer-list {
    display: grid;
    gap: var(--qrae-space-3);
}

.qrae-answer-button {
    width: 100%;
    color: var(--qrae-color-text);
    background: var(--qrae-color-surface);
    border: 2px solid transparent;
    box-shadow: var(--qrae-shadow-small);
    min-height: 82px;
}

.qrae-answer-button:hover {
    border-color: var(--qrae-color-primary);
}

.qrae-result-icon {
    margin-bottom: var(--qrae-space-4);
    font-size: 4rem;
    text-align: center;
}

.qrae-screen-result .qrae-screen-content {
    padding: var(--qrae-space-6);
    text-align: center;
    background: var(--qrae-color-surface);
    border-radius: var(--qrae-radius-large);
    box-shadow: var(--qrae-shadow-medium);
}

.qrae-screen-result h1 {
    margin: 0 0 var(--qrae-space-3);
    font-size: 2.2rem;
}

.qrae-result-message {
    margin-bottom: var(--qrae-space-6);
    color: var(--qrae-color-text-muted);
    line-height: 1.55;
}

.qrae-bottom-nav {
    position: fixed;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    max-width: 520px;
    margin: 0 auto;
    padding: 8px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--qrae-color-border);
    border-radius: var(--qrae-radius-medium);
    box-shadow: var(--qrae-shadow-medium);
    backdrop-filter: blur(12px);
}

.qrae-bottom-nav button {
    display: grid;
    gap: 4px;
    place-items: center;
    min-height: 54px;
    padding: 6px;
    color: var(--qrae-color-text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--qrae-radius-small);
    font-size: 1rem;
}

.qrae-bottom-nav button span {
    font-size: 0.72rem;
    font-weight: 800;
}

.qrae-bottom-nav button.is-active {
    color: var(--qrae-color-text);
    background: #fff6b3;
}

.qrae-qr-reader {
    width: 100%;
    min-height: 280px;
    overflow: hidden;
    margin-bottom: var(--qrae-space-4);
    background: #111827;
    border-radius: var(--qrae-radius-medium);
    box-shadow: var(--qrae-shadow-medium);
}

.qrae-qr-reader video {
    object-fit: cover;
}

.qrae-qr-status {
    margin: 0 0 var(--qrae-space-5);
    color: var(--qrae-color-text-muted);
    text-align: center;
}

/* ==========================================================
   Generic Card
========================================================== */

.qrae-card{

    background:#fff;

    border-radius:20px;

    padding:24px;

    margin-bottom:24px;

    box-shadow:var(--qrae-shadow-medium);

}

.qrae-card-icon{

    font-size:42px;

    margin-bottom:12px;

}

.qrae-card-subtitle{

    margin:0;

    color:var(--qrae-color-text-muted);

    font-size:.85rem;

    font-weight:700;

    text-transform:uppercase;

    letter-spacing:.05em;

}

.qrae-card-title{

    margin:6px 0 16px;

    font-size:1.8rem;

}

.qrae-card-body{

    line-height:1.6;

}

.qrae-card-footer{

    margin-top:24px;

}

/* ==========================================================
   Video Player
   - Desktop: simulació de mòbil vertical
   - Mòbil: pantalla completa
========================================================== */

/*
 * La pantalla que conté un vídeo elimina els espais
 * generals de .qrae-screen i centra el reproductor.
 */
.qrae-screen:has(.qrae-video-player) {
    display: grid;
    min-height: 100dvh;
    padding: 0;
    place-items: center;
    overflow: hidden;
    background: #101820;
}

.qrae-screen:has(.qrae-video-player) .qrae-screen-content {
    display: grid;
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    margin: 0;
    place-items: center;
}

/*
 * En ordinador, el reproductor conserva proporció 9:16
 * i simula una pantalla de mòbil.
 */
.qrae-video-player {
    position: relative;
    width: min(
        430px,
        100vw,
        calc(100dvh * 9 / 16)
    );
    aspect-ratio: 9 / 16;
    max-height: 100dvh;
    overflow: hidden;
    background: #000000;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.38);
}

/*
 * Les pantalles de vídeo no mostren títol,
 * descripció ni missatges d'estat.
 */
.qrae-video-header,
.qrae-video-status {
    display: none;
}

/*
 * El vídeo ocupa completament el contenidor vertical.
 */
.qrae-video-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #000000;
    border-radius: 0;
    box-shadow: none;
}

.qrae-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000000;
}

/*
 * Controls superposats a la part inferior del vídeo.
 */
.qrae-video-actions {
    position: absolute;
    right: 22px;
    bottom: max(24px, calc(16px + env(safe-area-inset-bottom)));
    left: 22px;
    z-index: 20;
    display: grid;
    gap: 12px;

    opacity: 0;
    transform: translateY(18px);
    pointer-events: none;

    transition:
        opacity 280ms ease,
        transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.qrae-video-actions.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.qrae-video-actions[hidden] {
    display: grid;
}

/*
 * Botó inicial per als vídeos sense autoplay.
 */
[data-video-play] {
    position: absolute;
    right: 22px;
    bottom: max(24px, calc(16px + env(safe-area-inset-bottom)));
    left: 22px;
    z-index: 20;
    width: auto;
}

[data-video-play][hidden] {
    display: none;
}

/* ==========================================================
   BOTONS GLOBALS — ESTIL DEFINITIU
========================================================== */

.qrae-button {
    position: relative;

    display: inline-flex;
    width: 100%;
    min-height: 46px;

    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 9px 18px;

    overflow: hidden;

    color: #062745;

    font-family: var(--qrae-font-family);
    font-size: clamp(0.84rem, 3.4vw, 0.95rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.025em;
    text-align: center;
    text-transform: uppercase;

    background: transparent;

    border: 2px solid #0b2f63;
    border-radius: 14px;

    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;

    transition:
        transform 120ms ease,
        box-shadow 120ms ease,
        filter 120ms ease,
        background-color 160ms ease;
}

/* ==========================================================
   BOTÓ PRINCIPAL
========================================================== */

.qrae-button-primary {
    color: #062745;
    background:
        linear-gradient(
            180deg,
            #f8c44a 0%,
            #f5b21a 100%
        );

    border-color: #0b2f63;

    box-shadow:
        0 4px 0 #0b2f63,
        0 8px 16px rgba(6, 39, 69, 0.2);
}

/* ==========================================================
   BOTÓ SECUNDARI
========================================================== */

.qrae-button-secondary {
    color: #ffffff;
    background:
        linear-gradient(
            180deg,
            #0b2f63 0%,
            #062745 100%
        );

    border-color: #ffffff;

    box-shadow:
        0 4px 0 #031a33,
        0 8px 16px rgba(0, 0, 0, 0.24);
}

/* ==========================================================
   HOVER
========================================================== */

.qrae-button:hover {
    filter: brightness(1.045);

    transform: translateY(-1px);
}

.qrae-button-primary:hover {
    background:
        linear-gradient(
            180deg,
            #f9ca5d 0%,
            #f5b21a 100%
        );

    box-shadow:
        0 5px 0 #0b2f63,
        0 10px 18px rgba(6, 39, 69, 0.23);
}

.qrae-button-secondary:hover {
    color: #ffffff;
    background:
        linear-gradient(
            180deg,
            #103d76 0%,
            #062745 100%
        );

    box-shadow:
        0 5px 0 #031a33,
        0 10px 18px rgba(0, 0, 0, 0.27);
}

/* ==========================================================
   PULSACIÓ
========================================================== */

.qrae-button:active {
    transform: translateY(3px);

    filter: none;
}

.qrae-button-primary:active {
    box-shadow:
        0 1px 0 #0b2f63,
        0 3px 7px rgba(6, 39, 69, 0.17);
}

.qrae-button-secondary:active {
    box-shadow:
        0 1px 0 #031a33,
        0 3px 7px rgba(0, 0, 0, 0.2);
}

/* ==========================================================
   FOCUS
========================================================== */

.qrae-button:focus-visible {
    outline: 3px solid rgba(245, 178, 26, 0.72);
    outline-offset: 3px;
}

/* ==========================================================
   ICONA
========================================================== */

.qrae-button-icon {

    display:flex;

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

    flex:0 0 28px;

    width:28px;
    height:28px;

    color:inherit;
}

.qrae-button-icon svg,
.qrae-button-icon img {

    display:block;

    width:18px;
    height:18px;
}

.qrae-button-icon svg {

    fill:none;

    stroke:currentColor;
    stroke-width:2.2;

    stroke-linecap:round;
    stroke-linejoin:round;
}

/* ==========================================================
   SEPARADOR ICONA / TEXT
========================================================== */

.qrae-button.has-icon .qrae-button-icon {

    padding-right:14px;
    margin-right:14px;

    border-right:1px solid rgba(255,255,255,.28);
}

.qrae-button-primary.has-icon .qrae-button-icon {

    border-right-color:rgba(6,39,69,.28);
}

/* ==========================================================
   TEXT
========================================================== */

.qrae-button-label {

    flex:1;

    display:flex;

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

    min-width:0;

    line-height:1.1;
}

/* ==========================================================
   BOTÓ DEV
========================================================== */

.qrae-button-dev {
    display: block;

    width: 100%;
    min-height: 42px;

    margin-top: var(--qrae-space-6);
    padding: 9px 14px;

    color: var(--qrae-color-text-muted);
    background: transparent;

    border:
        1px dashed
        var(--qrae-color-border);

    border-radius: 12px;

    font-family: var(--qrae-font-family);
    font-size: 0.82rem;
    font-weight: 700;

    cursor: pointer;
}

/* ==========================================================
   DESACTIVAT
========================================================== */

.qrae-button:disabled {
    cursor: not-allowed;

    opacity: 0.68;

    transform: none;

    filter: grayscale(0.15);
}

/* ==========================================================
   PANTALLES PETITES
========================================================== */

@media (max-width:380px){

    .qrae-button{

        min-height:44px;

        padding:8px 15px;

        font-size:.82rem;
    }

    .qrae-button-icon{

        flex:0 0 26px;

        width:26px;
        height:26px;
    }

    .qrae-button-icon svg,
    .qrae-button-icon img{

        width:17px;
        height:17px;
    }

    .qrae-button.has-icon .qrae-button-icon{

        padding-right:12px;
        margin-right:12px;
    }

}

/* ==========================================================
   Vídeo en mòbil real
========================================================== */

@media (max-width: 600px) {

    .qrae-screen:has(.qrae-video-player) {
        width: 100vw;
        min-height: 100dvh;
        background: #000000;
    }

    .qrae-screen:has(.qrae-video-player) .qrae-screen-content {
        width: 100vw;
        min-height: 100dvh;
    }

    .qrae-video-player {
        width: 100vw;
        height: 100dvh;
        max-height: none;
        aspect-ratio: auto;
        box-shadow: none;
    }
}
/* ==========================================================
   S12 — FORMULARI DE PARTICIPACIÓ
========================================================== */

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

    display: block;

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

    padding: 0;
    margin: 0;

    overflow: hidden;

    background: #062745;
}

/* ==========================================================
   FONS DEL MAPA
========================================================== */

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

    background-image:
        url('../../adventures/la-gran-expedicio/assets/images/ui/question/background.jpg');

    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;

    filter:
        blur(3px)
        brightness(0.9)
        saturate(0.9);

    transform: scale(1.035);

    pointer-events: none;
}

/* ==========================================================
   CAPA GENERAL
========================================================== */

.qrae-form-overlay {
    position: relative;
    z-index: 2;

    display: grid;

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

    place-items: center;

    padding:
        max(12px, env(safe-area-inset-top))
        14px
        max(
            14px,
            calc(
                10px +
                env(safe-area-inset-bottom)
            )
        );

    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(6, 39, 69, 0.18) 34%,
            rgba(6, 39, 69, 0.58) 100%
        );
}

/* ==========================================================
   TARGETA
========================================================== */

.qrae-form-panel {
    width: min(100%, 410px);

    margin: 0 auto;

    padding:
        17px
        18px
        19px;

    color: #ffffff;

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

    border: 3px solid rgba(255, 255, 255, 0.92);
    border-radius: 24px;

    box-shadow:
        0 0 0 3px rgba(245, 178, 26, 0.17),
        0 20px 40px rgba(0, 0, 0, 0.31);

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

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

/* ==========================================================
   CAPÇALERA
========================================================== */

.qrae-form-header {
    margin-bottom: 13px;

    text-align: center;
}

.qrae-form-kicker {
    margin: 0 0 3px;

    color: #f5b21a;

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

.qrae-form-header h1 {
    margin: 0;

    color: #ffffff;

    font-size: clamp(1.45rem, 6vw, 2rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.035em;
}

.qrae-form-header p:not(.qrae-form-kicker) {
    margin: 6px 0 0;

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

    font-size: 0.78rem;
    line-height: 1.25;
}

/* ==========================================================
   FORMULARI
========================================================== */

.qrae-form {
    display: grid;

    gap: 9px;
}

.qrae-form-field {
    display: grid;

    gap: 4px;
}

.qrae-form-field label {
    color: #ffffff;

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

.qrae-form-field input {
    width: 100%;
    min-height: 41px;

    padding: 9px 12px;

    color: #062745;
    background: #ffffff;

    border: 2px solid rgba(255, 255, 255, 0.88);
    border-radius: 10px;

    box-shadow:
        inset 0 1px 2px rgba(6, 39, 69, 0.08);

    font-family: var(--qrae-font-family);
    font-size: 0.9rem;

    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        transform 150ms ease;
}

.qrae-form-field input::placeholder {
    color: #7c8995;
}

.qrae-form-field input:focus {
    border-color: #f5b21a;
    outline: none;

    box-shadow:
        0 0 0 4px rgba(245, 178, 26, 0.23),
        inset 0 1px 2px rgba(6, 39, 69, 0.08);

    transform: translateY(-1px);
}

.qrae-form-field input:user-invalid {
    border-color: #e94a22;
}

/* ==========================================================
   CONSENTIMENT
========================================================== */

.qrae-form-consent {
    display: flex;

    align-items: flex-start;
    gap: 9px;

    padding: 8px 10px;

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

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

    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.22;
}

.qrae-form-consent input {
    flex: 0 0 auto;

    width: 18px;
    height: 18px;

    margin: 0;

    accent-color: #f5b21a;
}

.qrae-form-consent a {
    color: #F5B21A;

    font-weight: 700;
    text-decoration: underline;
}

.qrae-form-consent a:hover {
    color: #FFD45C;
}

/* ==========================================================
   ERROR
========================================================== */

.qrae-form-error {
    margin: 0;

    padding: 9px 11px;

    color: #ffffff;
    background: rgba(233, 74, 34, 0.94);

    border-radius: 9px;

    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.3;
}

.qrae-form-error[hidden] {
    display: none;
}

/* ==========================================================
   BOTÓ
========================================================== */

.qrae-form-submit {
    margin-top: 1px;
}

.qrae-form-submit .qrae-button-primary {
    width: 100%;
    min-height: 47px;

    color: #062745;
    background: #f5b21a;

    border-radius: 14px;

    box-shadow:
        0 5px 0 #c97d00,
        0 10px 18px rgba(0, 0, 0, 0.23);

    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.015em;
    text-transform: uppercase;
}

.qrae-form-submit .qrae-button-primary:hover {
    filter: brightness(1.04);
}

.qrae-form-submit .qrae-button-primary:active {
    transform: translateY(4px);

    box-shadow:
        0 2px 0 #c97d00,
        0 6px 12px rgba(0, 0, 0, 0.2);
}

/* ==========================================================
   ANIMACIÓ
========================================================== */

@keyframes qrae-form-panel-enter {
    from {
        opacity: 0;

        transform:
            translateY(24px)
            scale(0.97);
    }

    to {
        opacity: 1;

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

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

body:has(.qrae-screen-form) {
    overflow: hidden;

    background: #101820;
}

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

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

    place-items: center;

    background: #101820;
}

@media (min-width: 601px) {

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

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

        aspect-ratio: 9 / 16;

        margin: 0;

        overflow: hidden;

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

    .qrae-screen-form
    .qrae-form-background {
        position: absolute;

        inset: 0;
    }

    .qrae-screen-form
    .qrae-form-overlay {
        width: 100%;
        height: 100%;
        min-height: 100%;

        overflow: hidden;
    }

    .qrae-screen-form
    .qrae-form-panel {
        max-height: calc(100% - 20px);
    }
}

/* ==========================================================
   MÒBIL REAL
========================================================== */

@media (max-width: 600px) {

    .qrae-screen.qrae-screen-form {
        width: 100vw;
        height: 100dvh;
        min-height: 100dvh;
        max-height: none;

        aspect-ratio: auto;

        margin: 0;

        box-shadow: none;
    }

    .qrae-screen-form
    .qrae-form-overlay {
        height: 100dvh;
        min-height: 100dvh;
    }
}

/* ==========================================================
   MÒBILS BAIXOS O TECLAT OBERT
========================================================== */

@media (max-height: 680px) {

    .qrae-form-overlay {
        place-items: start center;

        overflow-y: auto;
    }

    .qrae-form-panel {
        margin: 8px auto;
    }
}

/* ==========================================================
   PANTALLES ESTRETES
========================================================== */

@media (max-width: 380px) {

    .qrae-form-overlay {
        padding-right: 11px;
        padding-left: 11px;
    }

    .qrae-form-panel {
        padding:
            15px
            14px
            18px;

        border-radius: 21px;
    }

    .qrae-form-header {
        margin-bottom: 11px;
    }

    .qrae-form {
        gap: 8px;
    }

    .qrae-form-field input {
        min-height: 39px;

        padding:
            8px
            11px;
    }

    .qrae-form-submit
    .qrae-button-primary {
        min-height: 45px;
    }
}

/* ==========================================================
   ACCESSIBILITAT
========================================================== */

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

    .qrae-form-panel {
        animation: none;
    }
}



/* ==========================================================
   BOTONS SUPERPOSATS ALS VÍDEOS
========================================================== */

.qrae-video-actions .qrae-button,
[data-video-play] {
    width: 100%;
    min-height: 58px;
}

.qrae-video-actions .qrae-button-primary,
[data-video-play].qrae-button-primary {
    color: var(--qrae-color-navy);
    background: var(--qrae-color-yellow);
}

.qrae-video-actions .qrae-button-secondary {
    color: #ffffff;
    background: rgba(6, 39, 69, 0.92);
    border-color: rgba(255, 255, 255, 0.9);
}

/* ==========================================================
   AJUSTOS PER A PANTALLES PETITES
========================================================== */

@media (max-width: 380px) {
    .qrae-button {
        min-height: 54px;
        padding: 13px 18px;
        font-size: 0.9rem;
    }
}

/* ==========================================================
   S00 — PANTALLA INICIAL
========================================================== */

.qrae-screen-start {
    position: relative;
    display: block;
    width: 100%;
    min-height: 100dvh;
    padding: 0;
    overflow: hidden;
    background: var(--theme-navy);
}

.qrae-start-background {
    position: absolute;
    inset: 0;

    background-image:
        url('../../adventures/la-gran-expedicio/assets/images/ui/home-background.jpg');

    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.qrae-start-actions {
    position: absolute;
    right: 24px;
    bottom: max(
        34px,
        calc(24px + env(safe-area-inset-bottom))
    );
    left: 24px;

    z-index: 10;
}

.qrae-start-button {
    width: 100%;
    min-height: 68px;

    font-size: clamp(1.25rem, 5vw, 1.7rem);
    letter-spacing: 0.02em;

    border-radius: var(--theme-button-radius);

    animation:
        qrae-button-breathe 2.4s ease-in-out infinite;
}

@keyframes qrae-button-breathe {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.025);
    }
}

/* Ordinador: simulació de mòbil vertical */

@media (min-width: 601px) {

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

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

        min-height: 0;
        margin: 0 auto;

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

@media (min-width: 601px) {

    .qrae-screen-start .qrae-start-background {
        background-size: cover;
        background-position: center;
    }
}

/* ==========================================================
   S00 — CORRECCIÓ DEFINITIVA DEL SIMULADOR 9:16
========================================================== */

/* Centra la portada dins de la finestra de l’ordinador */
body:has(.qrae-screen-start) {
    overflow: hidden;
    background: #101820;
}

#app:has(.qrae-screen-start),
.qrae-app:has(.qrae-screen-start) {
    display: grid;
    width: 100%;
    min-height: 100dvh;
    place-items: center;
}

/* Ordinador: mateixa proporció i mida que els vídeos */
@media (min-width: 601px) {

    .qrae-screen.qrae-screen-start {
        display: block;
        flex: none;

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

        height: auto;
        min-height: 0;
        max-height: 100dvh;
        aspect-ratio: 9 / 16;

        margin: 0;
        padding: 0;

        overflow: hidden;
        background: var(--theme-navy);

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

/* Mòbil real: ocupa tota la pantalla */
@media (max-width: 600px) {

    .qrae-screen.qrae-screen-start {
        width: 100vw;
        height: 100dvh;
        min-height: 100dvh;
        max-height: none;
        aspect-ratio: auto;

        margin: 0;
        padding: 0;

        box-shadow: none;
    }
}

/* ==========================================================
   S05 — PANTALLA DE PREGUNTES
========================================================== */

.qrae-screen-question {
    position: relative;

    display: grid;

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

    padding: 0;

    place-items: center;

    overflow: hidden;

    background: var(--theme-navy);
}

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

    background-image:
        url('../../adventures/la-gran-expedicio/assets/images/ui/question/background.jpg');

    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.qrae-screen-question::after {
    position: absolute;
    inset: 0;
    z-index: 1;

    content: "";

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.03) 0%,
            rgba(255, 255, 255, 0.08) 52%,
            rgba(255, 255, 255, 0.4) 100%
        );

    pointer-events: none;
}

.qrae-screen-question .qrae-screen-content {
    position: relative;
    z-index: 2;

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

    margin: 0;
}

.qrae-question-layout {
    position: relative;

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

    padding:
        max(12px, env(safe-area-inset-top))
        16px
        0;

    overflow: hidden;
}

/* ==========================================================
   TARGETA DE PREGUNTA
========================================================== */

.qrae-question-panel {
    position: relative;
    z-index: 5;

    width: 100%;

    margin-top: 0;

    padding:
        16px
        16px
        18px;

    color: #ffffff;

    background:
        rgba(6, 39, 69, 0.97);

    border-radius: 21px;

    box-shadow:
        0 14px 34px
        rgba(6, 39, 69, 0.3);

    animation:
        qrae-question-panel-enter
        480ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-question-shop {
    margin: 0 0 5px;

    color: var(--theme-yellow);

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

.qrae-question-title {
    margin: 0 0 16px;

    color: #ffffff;

    font-size:
        clamp(
            1.12rem,
            4.5vw,
            1.5rem
        );

    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.018em;
}

.qrae-question-answers {
    display: grid;

    gap: 10px;
}

/* ==========================================================
   RESPOSTES
========================================================== */

.qrae-question-answer {
    display: grid;

    grid-template-columns:
        38px
        minmax(0, 1fr);

    gap: 10px;

    width: 100%;
    min-height: 52px;

    align-items: center;

    padding:
        8px
        12px
        8px
        8px;

    color: var(--theme-navy);

    background:
        var(--theme-yellow);

    border: 0;
    border-radius: 15px;

    box-shadow:
        0 5px 0 var(--theme-yellow-dark),
        0 9px 15px rgba(0, 0, 0, 0.17);

    font-family:
        var(--qrae-font-family);

    font-size:
        clamp(
            0.76rem,
            2.95vw,
            0.94rem
        );

    font-weight: 700;
    text-align: left;

    cursor: pointer;

    -webkit-tap-highlight-color:
        transparent;

    transition:
        transform 140ms ease,
        box-shadow 140ms ease,
        filter 140ms ease;

    animation:
        qrae-question-answer-enter
        420ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-question-answer:nth-child(1) {
    animation-delay: 120ms;
}

.qrae-question-answer:nth-child(2) {
    animation-delay: 200ms;
}

.qrae-question-answer:nth-child(3) {
    animation-delay: 280ms;
}

.qrae-question-answer:hover {
    filter: brightness(1.04);

    transform:
        translateY(-2px);
}

.qrae-question-answer:active {
    transform:
        translateY(3px);

    box-shadow:
        0 1px 0 var(--theme-yellow-dark),
        0 4px 9px rgba(0, 0, 0, 0.14);
}

.qrae-question-answer:focus-visible {
    outline:
        4px solid
        rgba(255, 255, 255, 0.92);

    outline-offset: 4px;
}

.qrae-question-answer-letter {
    display: grid;

    width: 38px;
    height: 38px;

    place-items: center;

    color: #ffffff;
    background: var(--theme-navy);

    border-radius: 50%;

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

.qrae-question-answer-text {
    min-width: 0;

    line-height: 1.18;

    overflow-wrap: anywhere;
}

/* ==========================================================
   PERSONATGES
========================================================== */

.qrae-question-character {
    position: absolute;

    right: auto;
    bottom: -8px;
    left: -4%;

    z-index: 6;

    width: 49%;
    max-height: 38%;

    pointer-events: none;

    animation:
        qrae-character-enter
        650ms
        180ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-question-character img {
    display: block;

    width: 100%;
    height: auto;
    max-height: 100%;

    object-fit: contain;
    object-position: left bottom;

    filter:
        drop-shadow(
            0 10px 16px
            rgba(6, 39, 69, 0.2)
        );

    animation:
        qrae-character-breathe
        4.5s
        900ms
        ease-in-out
        infinite;
}

/* Clara i Martí comparteixen la mateixa posició */

.qrae-question-speaker-clara
.qrae-question-character,
.qrae-question-speaker-marti
.qrae-question-character {
    right: auto;
    bottom: -8px;
    left: -4%;
}

.qrae-question-speaker-clara
.qrae-question-character img,
.qrae-question-speaker-marti
.qrae-question-character img {
    object-position: left bottom;
}

/* ==========================================================
   ESTAT D’ERROR
========================================================== */

.qrae-question-panel-error {
    margin-top: 16vh;
}

/* ==========================================================
   ACCESSIBILITAT
========================================================== */

.sr-only {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;

    white-space: nowrap;

    border: 0;

    clip:
        rect(0, 0, 0, 0);
}

/* ==========================================================
   ANIMACIONS
========================================================== */

@keyframes qrae-question-panel-enter {
    from {
        opacity: 0;

        transform:
            translateY(-18px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }
}

@keyframes qrae-question-answer-enter {
    from {
        opacity: 0;

        transform:
            translateY(14px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }
}

@keyframes qrae-character-enter {
    from {
        opacity: 0;

        transform:
            translateY(35px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }
}

@keyframes qrae-character-breathe {
    0%,
    100% {
        transform:
            translateY(0)
            scale(1);
    }

    50% {
        transform:
            translateY(-3px)
            scale(1.01);
    }
}

/* ==========================================================
   S05 EN ORDINADOR — SIMULACIÓ 9:16
========================================================== */

body:has(.qrae-screen-question) {
    overflow: hidden;

    background: #101820;
}

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

    min-height: 100dvh;

    place-items: center;
}

@media (min-width: 601px) {

    .qrae-screen.qrae-screen-question {
        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);
    }

    .qrae-screen-question
    .qrae-screen-content,
    .qrae-question-layout {
        min-height: 100%;
        height: 100%;
    }
}

/* ==========================================================
   S05 EN MÒBIL
========================================================== */

@media (max-width: 600px) {

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

        aspect-ratio: auto;
    }

    .qrae-question-layout {
        min-height: 100dvh;
    }
}

/* ==========================================================
   PANTALLES BAIXES
========================================================== */

@media (max-height: 700px) {

    .qrae-question-layout {
        padding-top:
            max(
                8px,
                env(safe-area-inset-top)
            );
    }

    .qrae-question-panel {
        padding:
            14px
            14px
            16px;

        border-radius: 19px;
    }

    .qrae-question-shop {
        margin-bottom: 4px;

        font-size: 0.64rem;
    }

    .qrae-question-title {
        margin-bottom: 12px;

        font-size:
            clamp(
                1rem,
                4vw,
                1.25rem
            );

        line-height: 1.25;
    }

    .qrae-question-answers {
        gap: 8px;
    }

    .qrae-question-answer {
        grid-template-columns:
            34px
            minmax(0, 1fr);

        gap: 8px;

        min-height: 46px;

        padding:
            6px
            10px
            6px
            6px;

        font-size: 0.72rem;
    }

    .qrae-question-answer-letter {
        width: 34px;
        height: 34px;

        font-size: 0.84rem;
    }

    .qrae-question-character,
    .qrae-question-speaker-clara
    .qrae-question-character,
    .qrae-question-speaker-marti
    .qrae-question-character {
        bottom: -8px;
        left: -5%;

        width: 44%;
        max-height: 33%;
    }
}

/* ==========================================================
   PANTALLES MOLT PETITES
========================================================== */

@media (max-width: 380px) {

    .qrae-question-layout {
        padding-right: 12px;
        padding-left: 12px;
    }

    .qrae-question-panel {
        padding:
            14px
            13px
            16px;

        border-radius: 19px;
    }

    .qrae-question-title {
        margin-bottom: 12px;

        font-size: 1.02rem;
        line-height: 1.25;
    }

    .qrae-question-answer {
        grid-template-columns:
            33px
            minmax(0, 1fr);

        min-height: 45px;

        padding-right: 9px;

        font-size: 0.7rem;
    }

    .qrae-question-answer-letter {
        width: 33px;
        height: 33px;

        font-size: 0.8rem;
    }

    .qrae-question-character,
    .qrae-question-speaker-clara
    .qrae-question-character,
    .qrae-question-speaker-marti
    .qrae-question-character {
        bottom: -8px;
        left: -6%;

        width: 43%;
        max-height: 31%;
    }
}

/* ==========================================================
   ADVENTURE MAP — DISSENY COMPLET
========================================================== */

.qrae-control-map {
    width: 100%;
    margin: 18px 0 24px;
}

.qrae-control-map .qrae-adventure-map {
    position: relative;

    width: min(100%, 420px);
    height: min(74dvh, 790px);

    margin: 0 auto;

    overflow: hidden;

    background: #f4efe5;

    border: 5px solid #0b2f63;
    border-radius: 24px;

    box-shadow:
        0 16px 34px rgba(11, 47, 99, 0.22);
}

.qrae-control-map
.qrae-adventure-map-background {
    position: absolute;
    inset: 0;
    z-index: 0;

    background-image:
        url('../../adventures/la-gran-expedicio/assets/images/ui/map/map-background.jpg');

    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.qrae-control-map
.qrae-adventure-map-cards {
    position: absolute;
    inset: 0;
    z-index: 2;
}

/* ==========================================================
   FITXA DE COMERÇ
========================================================== */

.qrae-control-map
.qrae-adventure-map-card {
    position: absolute;

    display: flex;
    width: clamp(50px, 15.8%, 68px);
    min-height: clamp(52px, 8.2dvh, 70px);

    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 5px 4px 6px;

    color: #ffffff;
    background: #0b2f63;

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

    outline: 2px solid #d7d7d7;

    transform: translate(-50%, -50%);

    box-shadow:
        0 6px 12px rgba(11, 47, 99, 0.25);

    font-family: var(--qrae-font-family);
    text-align: center;

    transition:
        opacity 220ms ease,
        transform 220ms ease,
        filter 220ms ease,
        box-shadow 220ms ease;
}

/* ==========================================================
   NÚMERO I NOM
========================================================== */

.qrae-control-map
.qrae-map-card-number {
    display: block;

    color: #ffffff;

    font-size: clamp(1.08rem, 3.5vw, 1.6rem);
    font-weight: 800;
    line-height: 0.95;

    text-shadow:
        0 2px 2px rgba(0, 0, 0, 0.24);
}

.qrae-control-map
.qrae-map-card-name {
    display: -webkit-box;

    width: 100%;
    margin-top: 3px;

    overflow: hidden;

    color: #ffffff;

    font-size: clamp(0.38rem, 1.25vw, 0.56rem);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: 0;
    text-transform: uppercase;

    line-clamp: 3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* ==========================================================
   ESTAT BLOQUEJAT
========================================================== */

.qrae-control-map
.qrae-adventure-map-card.is-locked {
    color: #ffffff;
    background: #0b2f63;

    opacity: 1;
    filter: none;
}

/* ==========================================================
   ESTAT COMPLETAT
========================================================== */

.qrae-control-map
.qrae-adventure-map-card.is-completed {
    color: #ffffff;
    background: #0e8a8d;

    opacity: 1;
}

.qrae-control-map
.qrae-map-card-check {
    position: absolute;
    top: -8px;
    right: -8px;

    display: grid;
    width: 23px;
    height: 23px;

    place-items: center;

    color: #ffffff;
    background: #7d9a1d;

    border: 2px solid #ffffff;
    border-radius: 50%;

    font-size: 0.72rem;
    font-weight: 800;

    box-shadow:
        0 4px 8px rgba(11, 47, 99, 0.24);
}

/* ==========================================================
   ESTAT ACTUAL
========================================================== */

.qrae-control-map
.qrae-adventure-map-card.is-current {
    z-index: 5;

    color: #0b2f63;
    background: #f5b21a;

    opacity: 1;

    box-shadow:
        0 0 0 4px rgba(245, 178, 26, 0.24),
        0 9px 18px rgba(11, 47, 99, 0.30);

    animation:
        qrae-map-card-current
        1.8s
        ease-in-out
        infinite;
}

.qrae-control-map
.qrae-adventure-map-card.is-current
.qrae-map-card-number,
.qrae-control-map
.qrae-adventure-map-card.is-current
.qrae-map-card-name {
    color: #0b2f63;
    text-shadow: none;
}

/* ==========================================================
   ANIMACIÓ DEL COMERÇ ACTUAL
========================================================== */

@keyframes qrae-map-card-current {
    0%,
    100% {
        transform:
            translate(-50%, -50%)
            scale(1);
    }

    50% {
        transform:
            translate(-50%, -50%)
            scale(1.045);
    }
}

/* ==========================================================
   MAPA NO DISPONIBLE
========================================================== */

.qrae-control-map
.qrae-adventure-map.is-empty {
    display: grid;

    min-height: 320px;
    place-items: center;

    padding: 24px;

    text-align: center;
}

/* ==========================================================
   ORDINADOR
========================================================== */

@media (min-width: 700px) {

    .qrae-control-map
    .qrae-adventure-map {
        width: 420px;
    }
}

/* ==========================================================
   PANTALLES PETITES
========================================================== */

@media (max-width: 380px) {

    .qrae-control-map
    .qrae-adventure-map {
        width: 100%;
        height: min(71dvh, 710px);

        border-width: 4px;
        border-radius: 20px;
    }

    .qrae-control-map
    .qrae-adventure-map-card {
        width: 15.5%;
        min-height: 48px;

        padding: 4px 3px;

        border-width: 2px;
        border-radius: 10px;
    }

    .qrae-control-map
    .qrae-map-card-number {
        font-size: 1rem;
    }

    .qrae-control-map
    .qrae-map-card-name {
        font-size: 0.36rem;
    }
}

/* ==========================================================
   ADVENTURE MAP — ANIMACIÓ DE COMERÇ COMPLETAT
========================================================== */

.qrae-control-map
.qrae-adventure-map-card.is-completed {
    animation:
        qrae-map-card-completed
        520ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

@keyframes qrae-map-card-completed {
    0% {
        opacity: 0;
        transform:
            translate(-50%, -50%)
            scale(0.72)
            rotate(-5deg);
    }

    65% {
        opacity: 1;
        transform:
            translate(-50%, -50%)
            scale(1.1)
            rotate(2deg);
    }

    100% {
        opacity: 1;
        transform:
            translate(-50%, -50%)
            scale(1)
            rotate(0);
    }
}

.qrae-control-map
.qrae-map-card-check {
    animation:
        qrae-map-check-enter
        420ms
        260ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

@keyframes qrae-map-check-enter {
    from {
        opacity: 0;
        transform: scale(0) rotate(-25deg);
    }

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

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

    .qrae-control-map
    .qrae-adventure-map-card.is-completed,
    .qrae-control-map
    .qrae-map-card-check {
        animation: none;
    }
}

/* ==========================================================
   ADVENTURE MAP — JERARQUIA VISUAL DELS ESTATS
========================================================== */

/* Comerços bloquejats: visibles però secundaris */

.qrae-control-map
.qrae-adventure-map-card.is-locked {
    opacity: 0.82;
    filter:
        saturate(0.72)
        brightness(0.92);
}

/* Comerç actual: més gran i molt més evident */

.qrae-control-map
.qrae-adventure-map-card.is-current {
    z-index: 6;

    border-color: #ffffff;
    outline-color: rgba(245, 178, 26, 0.58);

    box-shadow:
        0 0 0 5px #ffffff,
        0 0 0 8px rgba(245, 178, 26, 0.34),
        0 14px 26px rgba(11, 47, 99, 0.34);

    animation:
        qrae-map-card-current
        2s
        ease-in-out
        infinite;
}

@keyframes qrae-map-card-current {
    0%,
    100% {
        transform:
            translate(-50%, -50%)
            scale(1.03);
    }

    50% {
        transform:
            translate(-50%, -50%)
            scale(1.085);
    }
}

/* El completat conserva el color sòlid */

.qrae-control-map
.qrae-adventure-map-card.is-completed {
    opacity: 1;
    filter: none;
}

/* Evita animacions si el dispositiu ho demana */

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

    .qrae-control-map
    .qrae-adventure-map-card.is-current {
        animation: none;

        transform:
            translate(-50%, -50%)
            scale(1.04);
    }
}

/* ==========================================================
   S09 — CELEBRACIÓ FINAL
========================================================== */

.qrae-screen-adventure-completed {
    position: relative;
    isolation: isolate;

    display: grid;

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

    place-items: center;

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

    overflow: hidden;

    color: #ffffff;

    background:
        linear-gradient(
            180deg,
            rgba(6, 39, 69, 0.38) 0%,
            rgba(6, 39, 69, 0.56) 48%,
            rgba(6, 39, 69, 0.84) 100%
        ),
        url('../../adventures/la-gran-expedicio/assets/images/ui/question/background.jpg')
        center / cover
        no-repeat;
}

/* ==========================================================
   CONTINGUT CENTRAL
========================================================== */

.qrae-celebration-content {
    position: relative;
    z-index: 5;

    width: min(100%, 350px);

    margin-bottom: 22%;

    padding:
        clamp(24px, 6vw, 34px)
        clamp(18px, 5vw, 26px);

    text-align: center;

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

    border:
        3px solid
        rgba(255, 255, 255, 0.94);

    border-radius: 25px;

    box-shadow:
        0 0 0 3px rgba(245, 178, 26, 0.2),
        0 22px 45px rgba(0, 0, 0, 0.34);

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    animation:
        qrae-celebration-content-enter
        680ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-celebration-trophy {
    margin-bottom: 11px;

    font-size:
        clamp(
            4rem,
            18vw,
            6.4rem
        );

    line-height: 1;

    filter:
        drop-shadow(
            0 13px 20px
            rgba(0, 0, 0, 0.28)
        );

    animation:
        qrae-celebration-trophy-pop
        780ms
        120ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-celebration-kicker {
    margin: 0 0 6px;

    color: #f5b21a;

    font-size:
        clamp(
            0.8rem,
            3.4vw,
            1rem
        );

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

.qrae-celebration-title {
    margin: 0;

    color: #ffffff;

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

    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.05em;
    text-transform: uppercase;

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

.qrae-celebration-message {
    margin: 15px 0 0;

    color: #ffffff;

    font-size:
        clamp(
            1rem,
            4.2vw,
            1.28rem
        );

    font-weight: 700;
    line-height: 1.2;
}

/* ==========================================================
   PERSONATGES
========================================================== */

.qrae-celebration-character {
    position: absolute;
    bottom: -2%;

    z-index: 4;

    width: 52%;
    max-width: 240px;
    max-height: 42%;

    pointer-events: none;

    animation:
        qrae-celebration-character-enter
        720ms
        300ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-celebration-character-marti {
    left: -4%;

    transform-origin: left bottom;
}

.qrae-celebration-character-clara {
    right: -4%;

    transform-origin: right bottom;
}

.qrae-celebration-character img {
    display: block;

    width: 100%;
    height: auto;
    max-height: 100%;

    object-fit: contain;
    object-position: center bottom;

    filter:
        drop-shadow(
            0 13px 18px
            rgba(6, 39, 69, 0.28)
        );

    animation:
        qrae-celebration-character-breathe
        4s
        1.2s
        ease-in-out
        infinite;
}

.qrae-celebration-character[hidden] {
    display: none;
}

/* ==========================================================
   CONFETI
========================================================== */

.qrae-celebration-confetti {
    position: absolute;
    inset: 0;
    z-index: 10;

    overflow: hidden;

    pointer-events: none;
}

.qrae-celebration-confetti span {
    position: absolute;
    top: -14%;

    width: 9px;
    height: 20px;

    border-radius: 3px;

    animation:
        qrae-confetti-fall
        2.7s
        linear
        infinite;
}

.qrae-celebration-confetti span:nth-child(5n + 1) {
    background: #f5b21a;
}

.qrae-celebration-confetti span:nth-child(5n + 2) {
    background: #e94a22;
}

.qrae-celebration-confetti span:nth-child(5n + 3) {
    background: #ffffff;
}

.qrae-celebration-confetti span:nth-child(5n + 4) {
    background: #0e8a8d;
}

.qrae-celebration-confetti span:nth-child(5n) {
    background: #7d9a1d;
}

.qrae-celebration-confetti span:nth-child(1) {
    left: 3%;
    animation-delay: 0s;
}

.qrae-celebration-confetti span:nth-child(2) {
    left: 7%;
    animation-delay: 0.8s;
}

.qrae-celebration-confetti span:nth-child(3) {
    left: 11%;
    animation-delay: 0.25s;
}

.qrae-celebration-confetti span:nth-child(4) {
    left: 15%;
    animation-delay: 1.1s;
}

.qrae-celebration-confetti span:nth-child(5) {
    left: 19%;
    animation-delay: 0.45s;
}

.qrae-celebration-confetti span:nth-child(6) {
    left: 23%;
    animation-delay: 1.35s;
}

.qrae-celebration-confetti span:nth-child(7) {
    left: 27%;
    animation-delay: 0.15s;
}

.qrae-celebration-confetti span:nth-child(8) {
    left: 31%;
    animation-delay: 0.95s;
}

.qrae-celebration-confetti span:nth-child(9) {
    left: 35%;
    animation-delay: 0.55s;
}

.qrae-celebration-confetti span:nth-child(10) {
    left: 39%;
    animation-delay: 1.45s;
}

.qrae-celebration-confetti span:nth-child(11) {
    left: 43%;
    animation-delay: 0.35s;
}

.qrae-celebration-confetti span:nth-child(12) {
    left: 47%;
    animation-delay: 1.15s;
}

.qrae-celebration-confetti span:nth-child(13) {
    left: 51%;
    animation-delay: 0.05s;
}

.qrae-celebration-confetti span:nth-child(14) {
    left: 55%;
    animation-delay: 0.75s;
}

.qrae-celebration-confetti span:nth-child(15) {
    left: 59%;
    animation-delay: 0.4s;
}

.qrae-celebration-confetti span:nth-child(16) {
    left: 63%;
    animation-delay: 1.25s;
}

.qrae-celebration-confetti span:nth-child(17) {
    left: 67%;
    animation-delay: 0.2s;
}

.qrae-celebration-confetti span:nth-child(18) {
    left: 71%;
    animation-delay: 1.55s;
}

.qrae-celebration-confetti span:nth-child(19) {
    left: 75%;
    animation-delay: 0.65s;
}

.qrae-celebration-confetti span:nth-child(20) {
    left: 79%;
    animation-delay: 1.05s;
}

.qrae-celebration-confetti span:nth-child(21) {
    left: 83%;
    animation-delay: 0.3s;
}

.qrae-celebration-confetti span:nth-child(22) {
    left: 87%;
    animation-delay: 1.4s;
}

.qrae-celebration-confetti span:nth-child(23) {
    left: 91%;
    animation-delay: 0.5s;
}

.qrae-celebration-confetti span:nth-child(24) {
    left: 95%;
    animation-delay: 1.2s;
}

.qrae-celebration-confetti span:nth-child(25) {
    left: 13%;
    width: 7px;
    height: 15px;
    animation-delay: 1.65s;
}

.qrae-celebration-confetti span:nth-child(26) {
    left: 37%;
    width: 12px;
    height: 12px;
    animation-delay: 1.75s;
}

.qrae-celebration-confetti span:nth-child(27) {
    left: 61%;
    width: 7px;
    height: 17px;
    animation-delay: 1.85s;
}

.qrae-celebration-confetti span:nth-child(28) {
    left: 89%;
    width: 11px;
    height: 14px;
    animation-delay: 1.95s;
}

/* ==========================================================
   ANIMACIONS
========================================================== */

@keyframes qrae-celebration-content-enter {
    from {
        opacity: 0;

        transform:
            translateY(24px)
            scale(0.94);
    }

    to {
        opacity: 1;

        transform:
            translateY(-8%)
            scale(1);
    }
}

@keyframes qrae-celebration-trophy-pop {
    0% {
        opacity: 0;

        transform:
            scale(0.4)
            rotate(-12deg);
    }

    70% {
        opacity: 1;

        transform:
            scale(1.14)
            rotate(4deg);
    }

    100% {
        opacity: 1;

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

@keyframes qrae-celebration-character-enter {
    from {
        opacity: 0;

        transform:
            translateY(45px)
            scale(0.92);
    }

    to {
        opacity: 1;

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

@keyframes qrae-celebration-character-breathe {
    0%,
    100% {
        transform:
            translateY(0)
            scale(1);
    }

    50% {
        transform:
            translateY(-4px)
            scale(1.015);
    }
}

@keyframes qrae-confetti-fall {
    0% {
        opacity: 0;

        transform:
            translateY(-12vh)
            rotate(0deg);
    }

    10% {
        opacity: 1;
    }

    100% {
        opacity: 0.95;

        transform:
            translateY(115vh)
            rotate(660deg);
    }
}

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

body:has(.qrae-screen-adventure-completed) {
    overflow: hidden;

    background: #101820;
}

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

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

    place-items: center;
}

@media (min-width: 601px) {

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

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

        aspect-ratio: 9 / 16;

        margin: 0;

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

/* ==========================================================
   MÒBIL REAL
========================================================== */

@media (max-width: 600px) {

    .qrae-screen.qrae-screen-adventure-completed {
        width: 100vw;
        height: 100dvh;
        min-height: 100dvh;
        max-height: none;

        aspect-ratio: auto;

        margin: 0;

        box-shadow: none;
    }
}

/* ==========================================================
   PANTALLES BAIXES
========================================================== */

@media (max-height: 700px) {

    .qrae-celebration-content {
        width: min(100%, 330px);

        margin-bottom: 21%;

        padding:
            20px
            18px;
    }

    .qrae-celebration-trophy {
        margin-bottom: 7px;

        font-size: 3.6rem;
    }

    .qrae-celebration-title {
        font-size: 2.45rem;
    }

    .qrae-celebration-message {
        margin-top: 11px;

        font-size: 0.96rem;
    }

    .qrae-celebration-character {
        width: 41%;
        max-height: 34%;
    }
}

/* ==========================================================
   PANTALLES PETITES
========================================================== */

@media (max-width: 380px) {

    .qrae-celebration-content {
        width: 100%;

        margin-bottom: 24%;

        padding:
            21px
            16px;

        border-radius: 21px;
    }

    .qrae-celebration-character {
        width: 43%;
    }

    .qrae-celebration-character-marti {
        left: -7%;
    }

    .qrae-celebration-character-clara {
        right: -7%;
    }
}

/* ==========================================================
   ACCESSIBILITAT
========================================================== */

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

    .qrae-celebration-content,
    .qrae-celebration-trophy,
    .qrae-celebration-character,
    .qrae-celebration-character img,
    .qrae-celebration-confetti span {
        animation: none;
    }
}

/* ==========================================================
   S14 — PANTALLA FINAL
========================================================== */

.qrae-screen-final {
    position: relative;

    display: block;

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

    padding: 0;

    overflow: hidden;

    background: #d9b77d;
}

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

    background-image:
        url('../../adventures/la-gran-expedicio/assets/images/ui/final/final-background.jpg');

    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;

    animation:
        qrae-final-background-enter
        900ms
        ease-out
        both;
}

.qrae-final-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;

    display: flex;
    align-items: flex-end;
    justify-content: center;

    padding: 0;

    background:
        linear-gradient(
            180deg,
            transparent 58%,
            rgba(6, 39, 69, 0.08) 72%,
            rgba(6, 39, 69, 0.72) 100%
        );
}

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

    width: min(calc(100% - 40px), 390px);

    margin: 0 auto;
    padding-bottom: max(24px, env(safe-area-inset-bottom));

    text-align: center;

    animation:
        qrae-final-actions-enter
        650ms
        350ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-final-confirmation {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    left: 50%;
    z-index: 6;

    width: min(calc(100% - 32px), 420px);

    margin: 0;
    padding: 10px 14px;

    color: #ffffff;

    font-size: clamp(
        0.82rem,
        3.4vw,
        0.95rem
    );

    font-weight: 700;
    line-height: 1.2;

    background: rgba(6, 39, 69, 0.88);

    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;

    box-shadow:
        0 8px 22px
        rgba(0, 0, 0, 0.2);

    text-shadow:
        0 2px 7px
        rgba(0, 0, 0, 0.55);

    transform: translateX(-50%);
}

.qrae-final-restart-button {
    width: 100%;
    min-height: 58px;

    padding: 12px 18px;

    color: #062745;
    background: #f5b21a;

    border-radius: 18px;

    box-shadow:
        0 6px 0 #c97d00,
        0 12px 24px
        rgba(0, 0, 0, 0.28);

    font-weight: 800;
    font-size: clamp(0.92rem, 4vw, 1.08rem);
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-transform: uppercase;

    animation:
        qrae-final-button-breathe
        2.4s
        1.1s
        ease-in-out
        infinite;
}

.qrae-button-secondary.qrae-final-restart-button {
    color: #ffffff;
    background:
        linear-gradient(
            180deg,
            #0b2f63 0%,
            #062745 100%
        );

    border-color: #ffffff;

    box-shadow:
        0 4px 0 #031a33,
        0 8px 16px rgba(0, 0, 0, 0.24);

    animation: none;
}

.qrae-final-restart-button:hover {
    filter: brightness(1.04);
}

.qrae-final-restart-button:active {
    transform: translateY(4px);

    box-shadow:
        0 2px 0 #c97d00,
        0 7px 14px
        rgba(0, 0, 0, 0.24);
}

.qrae-button-secondary.qrae-final-restart-button:active {
    box-shadow:
        0 1px 0 #031a33,
        0 3px 7px rgba(0, 0, 0, 0.2);
}

@media (max-height: 760px) {

    .qrae-final-actions {
        gap: 10px;

        padding-bottom:
            max(18px, env(safe-area-inset-bottom));
    }

    .qrae-final-confirmation {
        top: max(10px, env(safe-area-inset-top));

        padding: 8px 12px;

        font-size: 0.82rem;
    }

    .qrae-final-restart-button {
        min-height: 52px;

        padding: 10px 16px;

        font-size: 0.9rem;
    }
}

/* ==========================================================
   ANIMACIONS
========================================================== */

@keyframes qrae-final-background-enter {
    from {
        opacity: 0;
        transform: scale(1.025);
    }

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

@keyframes qrae-final-actions-enter {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes qrae-final-button-breathe {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.025);
    }
}

/* ==========================================================
   SIMULACIÓ 9:16 EN ORDINADOR
========================================================== */

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

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

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

    place-items: center;
}

@media (min-width: 601px) {

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

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

        aspect-ratio: 9 / 16;

        margin: 0;

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

/* ==========================================================
   MÒBIL REAL
========================================================== */

@media (max-width: 600px) {

    .qrae-screen.qrae-screen-final {
        width: 100vw;
        height: 100dvh;
        min-height: 100dvh;
        max-height: none;

        aspect-ratio: auto;

        margin: 0;

        box-shadow: none;
    }
}

/* ==========================================================
   ACCESSIBILITAT
========================================================== */

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

    .qrae-final-background,
    .qrae-final-actions,
    .qrae-final-restart-button {
        animation: none;
    }
}

/* ==========================================================
   S03 — CONTROL CENTER DEFINITIU
========================================================== */

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

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

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

    place-items: center;

    overflow: hidden;

    background: #101820;
}

/* ==========================================================
   PANTALLA 9:16
========================================================== */

.qrae-screen.qrae-screen-control-center {
    position: relative;

    display: block;

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

    padding: 0;
    margin: 0;

    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            #f8f4eb 0%,
            #eef3f5 100%
        );
}

.qrae-screen-control-center .qrae-screen-content {
    display: grid;

    width: 100%;
    height: 100%;

    grid-template-rows:
        auto
        minmax(0, 1fr)
        auto
        auto
        auto;

    gap: 9px;

    padding:
        max(12px, env(safe-area-inset-top))
        14px
        max(10px, env(safe-area-inset-bottom));

    margin: 0;

    overflow: hidden;
}

/* ==========================================================
   CAPÇALERA
========================================================== */

.qrae-screen-control-center .qrae-header {
    min-width: 0;
    margin: 0;

    animation:
        qrae-s03-enter
        380ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-screen-control-center .qrae-header h1 {
    margin: 0 0 5px;

    color: #0b2f63;

    font-size: clamp(1.35rem, 5.4vw, 1.75rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
}

/* ==========================================================
   PROGRÉS
========================================================== */

.qrae-screen-control-center .qrae-progress-summary {
    display: grid;

    grid-template-columns:
        1fr
        auto;

    column-gap: 8px;

    align-items: center;
}

.qrae-screen-control-center .qrae-progress-text {
    grid-column: 1;

    margin: 0 0 3px;

    color: #526474;

    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.1;
}

.qrae-screen-control-center .qrae-progress-percentage {
    grid-column: 2;
    grid-row: 1;

    margin: 0 0 3px;

    color: #0b2f63;

    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.1;
}

.qrae-screen-control-center .qrae-progress {
    grid-column: 1 / -1;

    width: 100%;
    height: 9px;

    margin: 0;

    overflow: hidden;

    background: rgba(11, 47, 99, 0.13);

    border: 0;
    border-radius: 999px;

    box-shadow:
        inset 0 1px 2px
        rgba(11, 47, 99, 0.1);
}

.qrae-screen-control-center .qrae-progress-bar {
    height: 100%;

    background:
        linear-gradient(
            90deg,
            #0e8a8d 0%,
            #7d9a1d 70%,
            #f5b21a 100%
        );

    border-radius: inherit;

    transition:
        width
        420ms
        cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================
   MAPA
========================================================== */

.qrae-screen-control-center .qrae-control-map {
    display: grid;

    min-width: 0;
    min-height: 0;

    place-items: center;

    margin: 0;

    overflow: hidden;

    animation:
        qrae-s03-enter
        420ms
        70ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-screen-control-center
.qrae-control-map
.qrae-adventure-map {
    position: relative;

    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: 100%;

    aspect-ratio: 9 / 16;

    margin: 0 auto;

    overflow: hidden;

    background: #f4efe5;

    border: 3px solid #0b2f63;
    border-radius: 18px;

    box-shadow:
        0 10px 22px rgba(11, 47, 99, 0.18);
}

.qrae-screen-control-center
.qrae-adventure-map-card.is-locked {
    opacity: 0.78;

    filter:
        saturate(0.7)
        brightness(0.94);
}

.qrae-screen-control-center
.qrae-adventure-map-card.is-current {
    z-index: 10;

    color: #0b2f63;
    background: #f5b21a;

    border-color: #ffffff;
    outline-color: rgba(245, 178, 26, 0.64);

    box-shadow:
        0 0 0 4px #ffffff,
        0 0 0 7px rgba(245, 178, 26, 0.3),
        0 12px 22px rgba(11, 47, 99, 0.3);
}

/* ==========================================================
   PROPER DESTÍ
========================================================== */

.qrae-screen-control-center .qrae-destination-wrapper {
    min-width: 0;

    animation:
        qrae-s03-enter
        420ms
        140ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-screen-control-center
.qrae-destination-card {
    position: relative;

    display: grid;

    grid-template-columns:
        auto
        minmax(0, 1fr);

    column-gap: 10px;

    padding: 10px 13px;
    margin: 0;

    overflow: hidden;

    color: #ffffff;

    background:
        linear-gradient(
            145deg,
            #0b2f63 0%,
            #062745 100%
        );

    border: 2px solid #ffffff;
    border-radius: 16px;

    box-shadow:
        0 8px 18px rgba(11, 47, 99, 0.18);
}

.qrae-screen-control-center
.qrae-destination-card::before {
    position: absolute;

    top: -28px;
    right: -20px;

    width: 68px;
    height: 68px;

    content: "";

    background:
        rgba(245, 178, 26, 0.13);

    border-radius: 50%;

    pointer-events: none;
}

.qrae-screen-control-center
.qrae-destination-card
.qrae-card-icon {
    grid-column: 1;
    grid-row: 1 / 4;

    align-self: center;

    margin: 0;

    font-size: 1.55rem;
    line-height: 1;
}

.qrae-screen-control-center
.qrae-destination-card
.qrae-card-subtitle {
    grid-column: 2;

    margin: 0 0 2px;

    color: #f5b21a;

    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.08em;
}

.qrae-screen-control-center
.qrae-destination-card
.qrae-card-title {
    grid-column: 2;

    margin: 0 0 2px;

    color: #ffffff;

    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.05;
}

.qrae-screen-control-center
.qrae-destination-card
.qrae-card-body {
    grid-column: 2;

    min-width: 0;

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

    font-size: 0.65rem;
    line-height: 1.2;
}

.qrae-screen-control-center
.qrae-destination-card
.qrae-card-body p {
    margin: 0;
}

/* ==========================================================
   BOTÓ ESCANEJAR
========================================================== */

.qrae-screen-control-center .qrae-scan-wrapper {
    min-width: 0;

    animation:
        qrae-s03-enter
        420ms
        210ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-screen-control-center
.qrae-scan-wrapper
.qrae-button {
    width: 100%;
    min-height: 46px;

    padding: 9px 14px;

    color: #062745;
    background: #f5b21a;

    border-radius: 14px;

    box-shadow:
        0 5px 0 #c97d00,
        0 9px 16px rgba(11, 47, 99, 0.18);

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

/* ==========================================================
   MENÚ INFERIOR
========================================================== */

.qrae-screen-control-center .qrae-bottom-wrapper {
    min-width: 0;

    animation:
        qrae-s03-enter
        420ms
        280ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-screen-control-center .qrae-bottom-nav {
    position: static;

    display: grid;

    width: 100%;
    max-width: none;

    grid-template-columns:
        repeat(3, 1fr);

    margin: 0;
    padding: 5px;

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

    border: 1px solid rgba(11, 47, 99, 0.12);
    border-radius: 16px;

    box-shadow:
        0 8px 18px rgba(11, 47, 99, 0.16);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.qrae-screen-control-center
.qrae-bottom-nav button {
    display: grid;

    min-height: 44px;

    gap: 2px;
    place-items: center;

    padding: 4px;

    color: #617080;
    background: transparent;

    border: 0;
    border-radius: 11px;

    font-size: 0.92rem;
    line-height: 1;
}

.qrae-screen-control-center
.qrae-bottom-nav button span {
    color: inherit;

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

.qrae-screen-control-center
.qrae-bottom-nav button.is-active {
    color: #0b2f63;
    background: #f5b21a;

    box-shadow:
        inset 0 -3px 0 rgba(201, 125, 0, 0.3);
}

/* ==========================================================
   SIMULACIÓ EN ORDINADOR
========================================================== */

@media (min-width: 601px) {

    .qrae-screen.qrae-screen-control-center {
        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);
    }
}

/* ==========================================================
   MÒBIL REAL
========================================================== */

@media (max-width: 600px) {

    .qrae-screen.qrae-screen-control-center {
        width: 100vw;
        height: 100dvh;
        min-height: 100dvh;
        max-height: none;

        aspect-ratio: auto;

        box-shadow: none;
    }
}

/* ==========================================================
   PANTALLES BAIXES
========================================================== */

@media (max-height: 700px) {

    .qrae-screen-control-center .qrae-screen-content {
        gap: 6px;

        padding-top:
            max(
                8px,
                env(safe-area-inset-top)
            );
    }

    .qrae-screen-control-center .qrae-header h1 {
        font-size: 1.2rem;
    }

    .qrae-screen-control-center
    .qrae-destination-card {
        padding: 7px 10px;
    }

    .qrae-screen-control-center
    .qrae-destination-card
    .qrae-card-icon {
        font-size: 1.25rem;
    }

    .qrae-screen-control-center
    .qrae-destination-card
    .qrae-card-body {
        display: none;
    }

    .qrae-screen-control-center
    .qrae-scan-wrapper
    .qrae-button {
        min-height: 42px;
        padding: 7px 12px;
    }

    .qrae-screen-control-center
    .qrae-bottom-nav button {
        min-height: 40px;
    }
}

/* ==========================================================
   ANIMACIÓ
========================================================== */

@keyframes qrae-s03-enter {
    from {
        opacity: 0;

        transform:
            translateY(12px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }
}

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

    .qrae-screen-control-center .qrae-header,
    .qrae-screen-control-center .qrae-control-map,
    .qrae-screen-control-center .qrae-destination-wrapper,
    .qrae-screen-control-center .qrae-scan-wrapper,
    .qrae-screen-control-center .qrae-bottom-wrapper {
        animation: none;
    }
}

/* ==========================================================
   S03 — MICRO-POLIMENT
========================================================== */

/* Més espai visual per al mapa */

.qrae-screen-control-center .qrae-screen-content {
    gap: 6px;
}

.qrae-screen-control-center .qrae-header {
    margin-bottom: 1px;
}

.qrae-screen-control-center .qrae-header h1 {
    margin-bottom: 5px;
}

/* Progrés més net */

.qrae-screen-control-center .qrae-progress-summary {
    grid-template-columns:
        minmax(0, 1fr)
        auto;

    column-gap: 10px;
}

.qrae-screen-control-center .qrae-progress-text,
.qrae-screen-control-center .qrae-progress-percentage {
    margin-bottom: 4px;

    font-size: 0.66rem;
}

.qrae-screen-control-center .qrae-progress {
    height: 8px;
}

/* Targeta de destí més compacta */

.qrae-screen-control-center
.qrae-destination-card {
    grid-template-columns:
        32px
        minmax(0, 1fr);

    column-gap: 9px;

    padding: 8px 11px;

    border-radius: 14px;
}

.qrae-screen-control-center
.qrae-destination-card
.qrae-card-icon {
    font-size: 1.35rem;
}

.qrae-screen-control-center
.qrae-destination-card
.qrae-card-subtitle {
    margin-bottom: 1px;

    font-size: 0.55rem;
}

.qrae-screen-control-center
.qrae-destination-card
.qrae-card-title {
    margin-bottom: 2px;

    font-size: 0.96rem;
}

.qrae-screen-control-center
.qrae-destination-card
.qrae-card-body {
    font-size: 0.61rem;
    line-height: 1.15;
}

/* Botó una mica més compacte */

.qrae-screen-control-center
.qrae-scan-wrapper
.qrae-button {
    min-height: 44px;

    padding: 8px 13px;

    font-size: 0.75rem;
}

/* Menú inferior més semblant a una app */

.qrae-screen-control-center .qrae-bottom-nav {
    padding: 4px;

    border-radius: 15px;
}

.qrae-screen-control-center
.qrae-bottom-nav button {
    min-height: 42px;

    gap: 1px;

    font-size: 1.08rem;
}

.qrae-screen-control-center
.qrae-bottom-nav button span {
    font-size: 0.54rem;
}

.qrae-screen-control-center
.qrae-bottom-nav button.is-active {
    box-shadow:
        inset 0 -3px 0 rgba(201, 125, 0, 0.34),
        0 3px 7px rgba(245, 178, 26, 0.22);
}

/* Mapa lleugerament més protagonista */

.qrae-screen-control-center
.qrae-control-map
.qrae-adventure-map {
    border-radius: 17px;

    box-shadow:
        0 12px 25px rgba(11, 47, 99, 0.2);
}

/* Pantalles baixes */

@media (max-height: 700px) {

    .qrae-screen-control-center
    .qrae-destination-card
    .qrae-card-body {
        display: block;
    }

    .qrae-screen-control-center
    .qrae-destination-card {
        padding: 6px 10px;
    }

    .qrae-screen-control-center
    .qrae-bottom-nav button {
        min-height: 38px;
    }
}

/* ==========================================================
   S03 — LLEGIBILITAT MAPA I PROPER DESTÍ
========================================================== */

/* Targetes del mapa completament opaques */

.qrae-screen-control-center
.qrae-adventure-map-card {
    opacity: 1;

    background-color: #0b2f63;

    border-color: #ffffff;

    box-shadow:
        0 5px 0 rgba(4, 25, 55, 0.38),
        0 8px 14px rgba(11, 47, 99, 0.28);

    filter: none;
}

/* Els bloquejats continuen sent secundaris,
   però sense transparència */

.qrae-screen-control-center
.qrae-adventure-map-card.is-locked {
    opacity: 1;

    color: #ffffff;
    background: #0b2f63;

    filter:
        saturate(0.82)
        brightness(0.88);
}

/* Número més visible */

.qrae-screen-control-center
.qrae-map-card-number {
    color: #ffffff;

    font-size: clamp(1.05rem, 3.8vw, 1.45rem);
    font-weight: 800;
    line-height: 0.92;

    text-shadow:
        0 2px 2px rgba(0, 0, 0, 0.36);
}

/* Nom del comerç més gran i nítid */

.qrae-screen-control-center
.qrae-map-card-name {
    margin-top: 4px;

    color: #ffffff;

    font-size: clamp(0.42rem, 1.42vw, 0.57rem);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.01em;

    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.38);
}

/* Comerç actual */

.qrae-screen-control-center
.qrae-adventure-map-card.is-current {
    color: #0b2f63;
    background: #f5b21a;

    filter: none;
}

.qrae-screen-control-center
.qrae-adventure-map-card.is-current
.qrae-map-card-number,
.qrae-screen-control-center
.qrae-adventure-map-card.is-current
.qrae-map-card-name {
    color: #0b2f63;
    text-shadow: none;
}

/* Comerç completat */

.qrae-screen-control-center
.qrae-adventure-map-card.is-completed {
    opacity: 1;

    color: #ffffff;
    background: #0e8a8d;

    filter: none;
}

/* Text de la targeta Proper destí */

.qrae-screen-control-center
.qrae-destination-card
.qrae-card-subtitle {
    color: #f5b21a;

    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.1;

    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.2);
}

.qrae-screen-control-center
.qrae-destination-card
.qrae-card-title {
    color: #ffffff;

    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.05;

    text-shadow:
        0 2px 3px rgba(0, 0, 0, 0.24);
}

.qrae-screen-control-center
.qrae-destination-card
.qrae-card-body {
    color: rgba(255, 255, 255, 0.94);

    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.25;
}

/* ==========================================================
   S15 / S16 — PANTALLES INFORMATIVES
========================================================== */

body:has(.qrae-screen-info) {
    overflow: hidden;

    background: #101820;
}

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

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

    place-items: center;

    overflow: hidden;

    background: #101820;
}

.qrae-screen.qrae-screen-info {
    position: relative;

    display: block;

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

    padding: 0;
    margin: 0;

    overflow: hidden;

    background: #f5f0e7;
}

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

    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Imatge dels premis */

.qrae-screen-prizes .qrae-info-background {
    background-image:
        url('../../adventures/la-gran-expedicio/assets/images/ui/prizes/prizes-background.jpg');
}

/* Imatge de les normes */

.qrae-screen-help .qrae-info-background {
    background-image:
        url('../../adventures/la-gran-expedicio/assets/images/ui/help/help-background.jpg');
}

/* Navegació inferior */

.qrae-screen-info .qrae-info-navigation {
    position: absolute;

    right: 14px;
    bottom:
        max(
            12px,
            env(safe-area-inset-bottom)
        );
    left: 14px;

    z-index: 10;
}

.qrae-screen-info .qrae-bottom-nav {
    position: static;

    width: 100%;
    max-width: none;

    margin: 0;

    background:
        rgba(6, 39, 69, 0.97);

    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 20px;

    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.28);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.qrae-screen-info
.qrae-bottom-nav button {
    min-height: 58px;

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

    border-radius: 14px;
}

.qrae-screen-info
.qrae-bottom-nav button.is-active {
    color: #062745;
    background: #f5b21a;
}

.qrae-screen-info
.qrae-bottom-nav-icon {
    display: block;

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

.qrae-screen-info
.qrae-bottom-nav-label {
    display: block;

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

/* ==========================================================
   SIMULACIÓ 9:16 EN ORDINADOR
========================================================== */

@media (min-width: 601px) {

    .qrae-screen.qrae-screen-info {
        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);
    }
}

/* ==========================================================
   MÒBIL REAL
========================================================== */

@media (max-width: 600px) {

    .qrae-screen.qrae-screen-info {
        width: 100vw;
        height: 100dvh;
        min-height: 100dvh;
        max-height: none;

        aspect-ratio: auto;

        box-shadow: none;
    }
}

/* ==========================================================
   S04 — ESCÀNER QR
========================================================== */

body:has(.qrae-screen-scanner) {
    overflow: hidden;

    background: #101820;
}

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

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

    place-items: center;

    overflow: hidden;

    background: #101820;
}

/* ==========================================================
   PANTALLA
========================================================== */

.qrae-screen.qrae-screen-scanner {
    position: relative;

    display: block;

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

    padding: 0;
    margin: 0;

    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            #f8f4eb 0%,
            #eef3f5 100%
        );
}

.qrae-scanner-layout {
    display: grid;

    width: 100%;
    height: 100%;

    grid-template-rows:
        auto
        minmax(0, 1fr)
        auto
        auto;

    gap: 12px;

    padding:
        max(20px, env(safe-area-inset-top))
        18px
        max(
            18px,
            calc(
                12px +
                env(safe-area-inset-bottom)
            )
        );

    overflow: hidden;
}

/* ==========================================================
   CAPÇALERA
========================================================== */

.qrae-scanner-header {
    margin: 0;

    text-align: left;

    animation:
        qrae-scanner-enter
        380ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-scanner-kicker {
    margin: 0 0 4px;

    color: #0e8a8d;

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

.qrae-scanner-header h1 {
    margin: 0;

    color: #0b2f63;

    font-size: clamp(1.8rem, 7vw, 2.3rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
}

.qrae-scanner-header p:not(.qrae-scanner-kicker) {
    margin: 7px 0 0;

    color: #5d6b78;

    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
}

/* ==========================================================
   CÀMERA
========================================================== */

.qrae-scanner-camera {
    display: grid;

    min-width: 0;
    min-height: 0;

    place-items: center;

    overflow: hidden;

    animation:
        qrae-scanner-enter
        430ms
        80ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-screen-scanner .qrae-qr-reader {
    position: relative;

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

    margin: 0;

    overflow: hidden;

    background: #071a2d;

    border: 4px solid #0b2f63;
    border-radius: 22px;

    box-shadow:
        0 16px 34px rgba(11, 47, 99, 0.22);
}

/* Contenidors generats per html5-qrcode */

.qrae-screen-scanner
.qrae-qr-reader > div {
    width: 100% !important;
    height: 100% !important;
}

.qrae-screen-scanner
.qrae-qr-reader video {
    display: block;

    width: 100% !important;
    height: 100% !important;

    object-fit: cover !important;
}

/* Amaga elements visuals interns no necessaris */

.qrae-screen-scanner
.qrae-qr-reader img {
    display: none !important;
}

.qrae-screen-scanner
.qrae-qr-reader__dashboard,
.qrae-screen-scanner
#qr-reader__dashboard {
    display: none !important;
}

.qrae-screen-scanner
#qr-reader__scan_region {
    width: 100% !important;
    height: 100% !important;

    min-height: 0 !important;

    background: transparent !important;
}

/* ==========================================================
   ESTAT
========================================================== */

.qrae-screen-scanner .qrae-qr-status {
    min-height: 18px;

    margin: 0;

    color: #526474;

    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;

    animation:
        qrae-scanner-enter
        430ms
        150ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

/* ==========================================================
   BOTÓ TORNAR
========================================================== */

.qrae-screen-scanner .qrae-scanner-back {
    width: 100%;
    min-height: 50px;

    padding: 10px 16px;

    color: #ffffff;
    background: #0b2f63;

    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 16px;

    box-shadow:
        0 6px 0 #031a33,
        0 12px 22px rgba(0, 0, 0, 0.24);

    font-size: 0.84rem;

    animation:
        qrae-scanner-enter
        430ms
        210ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

/* ==========================================================
   SIMULACIÓ 9:16 EN ORDINADOR
========================================================== */

@media (min-width: 601px) {

    .qrae-screen.qrae-screen-scanner {
        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);
    }
}

/* ==========================================================
   MÒBIL REAL
========================================================== */

@media (max-width: 600px) {

    .qrae-screen.qrae-screen-scanner {
        width: 100vw;
        height: 100dvh;
        min-height: 100dvh;
        max-height: none;

        aspect-ratio: auto;

        box-shadow: none;
    }
}

/* ==========================================================
   PANTALLES BAIXES
========================================================== */

@media (max-height: 700px) {

    .qrae-scanner-layout {
        gap: 8px;

        padding-top:
            max(
                12px,
                env(safe-area-inset-top)
            );
    }

    .qrae-scanner-header h1 {
        font-size: 1.55rem;
    }

    .qrae-scanner-header
    p:not(.qrae-scanner-kicker) {
        margin-top: 4px;

        font-size: 0.74rem;
    }

    .qrae-screen-scanner
    .qrae-scanner-back {
        min-height: 46px;

        padding: 8px 14px;
    }
}

/* ==========================================================
   ANIMACIÓ
========================================================== */

@keyframes qrae-scanner-enter {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

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

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

    .qrae-scanner-header,
    .qrae-scanner-camera,
    .qrae-screen-scanner .qrae-qr-status,
    .qrae-screen-scanner .qrae-scanner-back {
        animation: none;
    }
}

/* ==========================================================
   S04 — CORRECCIÓ LECTURA QR
   No deformar el vídeo intern d'html5-qrcode
========================================================== */

.qrae-screen-scanner
.qrae-qr-reader {
    display: block;

    height: auto;
    min-height: 300px;

    overflow: hidden;
}

.qrae-screen-scanner
.qrae-qr-reader > div {
    height: auto !important;
}

.qrae-screen-scanner
#qr-reader__scan_region {
    width: 100% !important;
    height: auto !important;
    min-height: 300px !important;

    overflow: hidden !important;
}

.qrae-screen-scanner
#qr-reader__scan_region video {
    display: block !important;

    width: 100% !important;
    height: auto !important;
    min-height: 300px !important;

    object-fit: contain !important;
}

.qrae-screen-scanner
#qr-reader__dashboard {
    display: none !important;
}

/* ==========================================================
   MODAL — QR INCORRECTE
========================================================== */

.qrae-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: grid;
    place-items: center;

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

    background:
        rgba(3, 18, 35, 0.78);

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);

    animation:
        qrae-modal-overlay-enter
        220ms
        ease
        both;
}

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

    padding:
        27px
        22px
        23px;

    color: #ffffff;

    text-align: center;

    background:
        linear-gradient(
            180deg,
            #0b2f63 0%,
            #062745 100%
        );

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

    box-shadow:
        0 0 0 4px rgba(245, 178, 26, 0.2),
        0 22px 46px rgba(0, 0, 0, 0.38);

    animation:
        qrae-modal-enter
        360ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-modal-icon {
    margin-bottom: 10px;

    font-size: 3.2rem;
    line-height: 1;

    filter:
        drop-shadow(
            0 7px 10px
            rgba(0, 0, 0, 0.22)
        );
}

.qrae-modal-kicker {
    margin: 0 0 6px;

    color: #f5b21a;

    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.qrae-modal-title {
    margin: 0;

    color: #ffffff;

    font-size: clamp(1.45rem, 6vw, 1.9rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.qrae-modal-message {
    margin: 14px 0 21px;

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

    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
}

.qrae-modal-button {
    min-height: 52px;

    font-size: 0.84rem;
}

@keyframes qrae-modal-overlay-enter {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes qrae-modal-enter {
    from {
        opacity: 0;

        transform:
            translateY(20px)
            scale(0.94);
    }

    to {
        opacity: 1;

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

@media (max-width: 380px) {

    .qrae-modal {
        padding:
            23px
            17px
            19px;

        border-radius: 20px;
    }

    .qrae-modal-icon {
        font-size: 2.8rem;
    }

    .qrae-modal-message {
        font-size: 0.82rem;
    }
}

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

    .qrae-modal-overlay,
    .qrae-modal {
        animation: none;
    }
}

/* ==========================================================
   S03 — DESTINATION BOTTOM SHEET
========================================================== */

/*
 * En retirar la targeta i el botó fixos,
 * el grid només necessita capçalera, mapa i navegació.
 */

.qrae-control-center-with-sheet
.qrae-screen-content {
    grid-template-rows:
        auto
        minmax(0, 1fr)
        auto;
}

/* El mapa aprofita tot l’espai central disponible */

.qrae-control-center-with-sheet
.qrae-control-map {
    min-height: 0;
    margin: 0;
}

.qrae-control-center-with-sheet
.qrae-control-map
.qrae-adventure-map {
    width: 100%;
    height: 100%;

    max-width: none;
    max-height: 100%;

    aspect-ratio: auto;

    margin: 0;
}

/* El comerç actual és un botó */

.qrae-control-center-with-sheet
button.qrae-adventure-map-card {
    appearance: none;
    -webkit-appearance: none;

    margin: 0;

    font: inherit;

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

.qrae-control-center-with-sheet
button.qrae-adventure-map-card:focus-visible {
    outline: 4px solid #ffffff;
    outline-offset: 4px;
}

/* ==========================================================
   OVERLAY
========================================================== */

.qrae-sheet-overlay {
    position: absolute;
    inset: 0;
    z-index: 100;

    display: flex;

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

    padding:
        16px
        14px
        max(
            14px,
            env(safe-area-inset-bottom)
        );

    background:
        rgba(3, 18, 35, 0);

    pointer-events: none;

    transition:
        background-color 260ms ease;
}

.qrae-sheet-overlay[hidden] {
    display: none;
}

.qrae-sheet-overlay.is-visible {
    background:
        rgba(3, 18, 35, 0.66);

    pointer-events: auto;

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ==========================================================
   PANELL
========================================================== */

.qrae-destination-sheet {
    position: relative;

    width: min(100%, 410px);

    padding:
        24px
        19px
        19px;

    color: #ffffff;

    background:
        linear-gradient(
            180deg,
            #0b2f63 0%,
            #062745 100%
        );

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

    box-shadow:
        0 0 0 3px rgba(245, 178, 26, 0.18),
        0 22px 45px rgba(0, 0, 0, 0.36);

    transform:
        translateY(
            calc(
                100% +
                40px
            )
        );

    transition:
        transform
        320ms
        cubic-bezier(0.22, 1, 0.36, 1);
}

.qrae-sheet-overlay.is-visible
.qrae-destination-sheet {
    transform: translateY(0);
}

/* ==========================================================
   HANDLE I TANCAMENT
========================================================== */

.qrae-sheet-handle {
    position: absolute;

    top: 9px;
    left: 50%;

    width: 42px;
    height: 5px;

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

    border-radius: 999px;

    transform: translateX(-50%);
}

.qrae-sheet-close {
    position: absolute;

    top: 14px;
    right: 14px;

    display: grid;

    width: 34px;
    height: 34px;

    place-items: center;

    padding: 0;

    color: #ffffff;
    background:
        rgba(255, 255, 255, 0.1);

    border: 1px solid
        rgba(255, 255, 255, 0.24);
    border-radius: 50%;

    font-family: inherit;
    font-size: 1.45rem;
    line-height: 1;

    cursor: pointer;
}

/* ==========================================================
   CONTINGUT
========================================================== */

.qrae-destination-sheet-kicker {
    margin: 7px 42px 5px 0;

    color: #f5b21a;

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

.qrae-destination-sheet-title {
    margin: 0 42px 10px 0;

    color: #ffffff;

    font-size:
        clamp(
            1.45rem,
            6vw,
            1.95rem
        );

    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.qrae-destination-sheet-address {
    display: flex;

    align-items: flex-start;
    gap: 7px;

    margin: 0 0 10px;

    color: #ffffff;

    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.3;
}

.qrae-destination-sheet-description {
    margin: 0 0 18px;

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

    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.4;
}

/* ==========================================================
   BOTÓ ESCANEJAR
========================================================== */

.qrae-destination-sheet-scan {
    width: 100%;
    min-height: 54px;

    color: #062745;
    background: #f5b21a;

    border-radius: 16px;

    box-shadow:
        0 6px 0 #c97d00,
        0 12px 22px rgba(0, 0, 0, 0.24);

    font-size: 0.84rem;
}

/* ==========================================================
   PANTALLES BAIXES
========================================================== */

@media (max-height: 700px) {

    .qrae-destination-sheet {
        padding:
            21px
            16px
            16px;

        border-radius: 20px;
    }

    .qrae-destination-sheet-title {
        margin-bottom: 7px;

        font-size: 1.35rem;
    }

    .qrae-destination-sheet-description {
        margin-bottom: 13px;

        font-size: 0.78rem;
    }

    .qrae-destination-sheet-scan {
        min-height: 48px;
    }
}

/* ==========================================================
   ACCESSIBILITAT
========================================================== */

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

    .qrae-sheet-overlay,
    .qrae-destination-sheet {
        transition: none;
    }
}

/* ==========================================================
   BOTTOM NAVIGATION — ESTIL GLOBAL UNIFICAT
   S03, S15 i S16
========================================================== */

.qrae-bottom-wrapper,
.qrae-info-navigation {
    position: relative;
    z-index: 20;

    width: 100%;
}

/* ==========================================================
   CONTENIDOR
========================================================== */

.qrae-bottom-nav {
    position: static;

    display: grid;

    width: 100%;
    max-width: none;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 5px;

    margin: 0;
    padding: 6px;

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

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

    border-radius: 20px;

    box-shadow:
        0 0 0 3px rgba(245, 178, 26, 0.1),
        0 12px 26px rgba(0, 0, 0, 0.24);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* ==========================================================
   BOTÓ
========================================================== */

.qrae-bottom-nav-item,
.qrae-bottom-nav button {
    position: relative;

    display: grid;

    min-width: 0;
    min-height: 54px;

    grid-template-rows:
        25px
        auto;

    gap: 3px;
    place-items: center;

    padding: 6px 5px;

    overflow: hidden;

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

    background: transparent;

    border: 0;
    border-radius: 14px;

    font-family: var(--qrae-font-family);

    cursor: pointer;
    user-select: none;

    -webkit-tap-highlight-color: transparent;

    transition:
        color 150ms ease,
        background-color 150ms ease,
        transform 150ms ease,
        box-shadow 150ms ease;
}

.qrae-bottom-nav-item::before,
.qrae-bottom-nav button::before {
    position: absolute;
    inset: 0;

    content: "";

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.09),
            rgba(255, 255, 255, 0)
        );

    opacity: 0;

    pointer-events: none;

    transition:
        opacity 150ms ease;
}

/* ==========================================================
   ICONA
========================================================== */

.qrae-bottom-nav-icon {
    position: relative;
    z-index: 2;

    display: grid;

    width: 27px;
    height: 27px;

    place-items: center;

    font-size: 1.22rem;
    line-height: 1;

    transform: translateY(0);

    transition:
        transform 150ms ease;
}

/* Preparat per als SVG futurs */

.qrae-bottom-nav-icon svg {
    display: block;

    width: 23px;
    height: 23px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==========================================================
   TEXT
========================================================== */

.qrae-bottom-nav-label {
    position: relative;
    z-index: 2;

    display: block;

    min-width: 0;

    overflow: hidden;

    color: inherit;

    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================
   HOVER
========================================================== */

.qrae-bottom-nav-item:hover,
.qrae-bottom-nav button:hover {
    color: #ffffff;

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

    transform:
        translateY(-1px);
}

.qrae-bottom-nav-item:hover::before,
.qrae-bottom-nav button:hover::before {
    opacity: 1;
}

.qrae-bottom-nav-item:hover
.qrae-bottom-nav-icon,
.qrae-bottom-nav button:hover
.qrae-bottom-nav-icon {
    transform:
        translateY(-1px)
        scale(1.04);
}

/* ==========================================================
   ACTIU
========================================================== */

.qrae-bottom-nav-item.is-active,
.qrae-bottom-nav button.is-active {
    color: #062745;

    background:
        linear-gradient(
            180deg,
            #f8c54e 0%,
            #f5b21a 100%
        );

    box-shadow:
        inset 0 -4px 0 rgba(201, 125, 0, 0.42),
        0 6px 12px rgba(245, 178, 26, 0.22);

    transform:
        translateY(-1px);
}

.qrae-bottom-nav-item.is-active::before,
.qrae-bottom-nav button.is-active::before {
    opacity: 1;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.3),
            transparent
        );
}

.qrae-bottom-nav-item.is-active
.qrae-bottom-nav-icon,
.qrae-bottom-nav button.is-active
.qrae-bottom-nav-icon {
    transform:
        translateY(-1px)
        scale(1.06);
}

/* ==========================================================
   PULSACIÓ
========================================================== */

.qrae-bottom-nav-item:active,
.qrae-bottom-nav button:active {
    transform:
        translateY(2px)
        scale(0.98);
}

.qrae-bottom-nav-item.is-active:active,
.qrae-bottom-nav button.is-active:active {
    box-shadow:
        inset 0 -2px 0 rgba(201, 125, 0, 0.42),
        0 3px 7px rgba(245, 178, 26, 0.17);

    transform:
        translateY(1px)
        scale(0.98);
}

/* ==========================================================
   FOCUS
========================================================== */

.qrae-bottom-nav-item:focus-visible,
.qrae-bottom-nav button:focus-visible {
    outline:
        3px solid
        #f5b21a;

    outline-offset: 3px;
}

/* ==========================================================
   POSICIÓ A S03
========================================================== */

.qrae-screen-control-center
.qrae-bottom-wrapper {
    align-self: end;

    padding-top: 4px;
}

/* ==========================================================
   POSICIÓ A S15 I S16
========================================================== */

.qrae-screen-info
.qrae-info-navigation {
    position: absolute;

    right: 14px;
    bottom:
        max(
            14px,
            env(safe-area-inset-bottom)
        );
    left: 14px;

    width: auto;
}

/* Elimina possibles estils específics antics */

.qrae-screen-control-center
.qrae-bottom-nav,
.qrae-screen-info
.qrae-bottom-nav {
    position: static;

    right: auto;
    bottom: auto;
    left: auto;

    width: 100%;
    max-width: none;

    margin: 0;
}

/* ==========================================================
   PANTALLES BAIXES
========================================================== */

@media (max-height: 700px) {

    .qrae-bottom-nav {
        gap: 4px;

        padding: 5px;

        border-radius: 17px;
    }

    .qrae-bottom-nav-item,
    .qrae-bottom-nav button {
        min-height: 47px;

        grid-template-rows:
            22px
            auto;

        padding: 4px;

        border-radius: 12px;
    }

    .qrae-bottom-nav-icon {
        width: 24px;
        height: 24px;

        font-size: 1.08rem;
    }

    .qrae-bottom-nav-label {
        font-size: 0.57rem;
    }
}

/* ==========================================================
   PANTALLES ESTRETES
========================================================== */

@media (max-width: 380px) {

    .qrae-bottom-nav {
        gap: 3px;

        padding: 4px;

        border-radius: 16px;
    }

    .qrae-bottom-nav-item,
    .qrae-bottom-nav button {
        min-height: 48px;
    }

    .qrae-bottom-nav-label {
        font-size: 0.56rem;
    }

    .qrae-screen-info
    .qrae-info-navigation {
        right: 10px;
        left: 10px;
    }
}

/* ==========================================================
   ACCESSIBILITAT
========================================================== */

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

    .qrae-bottom-nav-item,
    .qrae-bottom-nav button,
    .qrae-bottom-nav-icon,
    .qrae-bottom-nav-item::before,
    .qrae-bottom-nav button::before {
        transition: none;
    }
}

/* ==========================================================
   S03 — FORÇAR BOTTOM NAVIGATION GLOBAL
========================================================== */

.qrae-screen-control-center
.qrae-bottom-wrapper {
    width: 100% !important;
    padding-top: 4px !important;
}

.qrae-screen-control-center
.qrae-bottom-nav {
    position: static !important;

    display: grid !important;

    width: 100% !important;
    max-width: none !important;

    grid-template-columns:
        repeat(3, minmax(0, 1fr)) !important;

    gap: 5px !important;

    margin: 0 !important;
    padding: 6px !important;

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

    border:
        2px solid
        rgba(255, 255, 255, 0.92) !important;

    border-radius: 20px !important;

    box-shadow:
        0 0 0 3px rgba(245, 178, 26, 0.1),
        0 12px 26px rgba(0, 0, 0, 0.24) !important;

    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
}

.qrae-screen-control-center
.qrae-bottom-nav
.qrae-bottom-nav-item,
.qrae-screen-control-center
.qrae-bottom-nav
button {
    position: relative !important;

    display: grid !important;

    min-width: 0 !important;
    min-height: 54px !important;

    grid-template-rows:
        25px
        auto !important;

    gap: 3px !important;
    place-items: center !important;

    padding: 6px 5px !important;

    overflow: hidden !important;

    color:
        rgba(
            255,
            255,
            255,
            0.78
        ) !important;

    background: transparent !important;

    border: 0 !important;
    border-radius: 14px !important;

    box-shadow: none !important;

    font-family: var(--qrae-font-family) !important;

    cursor: pointer !important;

    transform: none !important;
}

.qrae-screen-control-center
.qrae-bottom-nav
.qrae-bottom-nav-icon {
    display: grid !important;

    width: 27px !important;
    height: 27px !important;

    place-items: center !important;

    color: inherit !important;

    font-size: 1.22rem !important;
    line-height: 1 !important;
}

.qrae-screen-control-center
.qrae-bottom-nav
.qrae-bottom-nav-label {
    display: block !important;

    color: inherit !important;

    font-size: 0.62rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}

.qrae-screen-control-center
.qrae-bottom-nav
.qrae-bottom-nav-item.is-active,
.qrae-screen-control-center
.qrae-bottom-nav
button.is-active {
    color: #062745 !important;

    background:
        linear-gradient(
            180deg,
            #f8c54e 0%,
            #f5b21a 100%
        ) !important;

    box-shadow:
        inset 0 -4px 0 rgba(201, 125, 0, 0.42),
        0 6px 12px rgba(245, 178, 26, 0.22) !important;

    transform: translateY(-1px) !important;
}

.qrae-screen-control-center
.qrae-bottom-nav
.qrae-bottom-nav-item:active,
.qrae-screen-control-center
.qrae-bottom-nav
button:active {
    transform:
        translateY(2px)
        scale(0.98) !important;
}

@media (max-height: 700px) {

    .qrae-screen-control-center
    .qrae-bottom-nav {
        padding: 5px !important;
        border-radius: 17px !important;
    }

    .qrae-screen-control-center
    .qrae-bottom-nav
    .qrae-bottom-nav-item,
    .qrae-screen-control-center
    .qrae-bottom-nav
    button {
        min-height: 47px !important;

        grid-template-rows:
            22px
            auto !important;

        padding: 4px !important;

        border-radius: 12px !important;
    }

    .qrae-screen-control-center
    .qrae-bottom-nav
    .qrae-bottom-nav-icon {
        width: 24px !important;
        height: 24px !important;

        font-size: 1.08rem !important;
    }

    .qrae-screen-control-center
    .qrae-bottom-nav
    .qrae-bottom-nav-label {
        font-size: 0.57rem !important;
    }
}

/* ==========================================================
   SCREEN TRANSITIONS
========================================================== */

#app {
    position: relative;
}

/* Fade OUT */

#app.qrae-screen-changing {
    transition:
        opacity 120ms ease;

    opacity: 0;
}

/* Estat inicial */

.qrae-app.qrae-screen-enter {

    opacity: 0;

    transform:
        translateY(18px)
        scale(0.992);

    will-change:
        opacity,
        transform;
}

/* Entrada */

.qrae-app.qrae-screen-enter.qrae-screen-enter-active {

    opacity: 1;

    transform:
        translateY(0)
        scale(1);

    transition:
        opacity 260ms ease,
        transform 320ms cubic-bezier(.22,1,.36,1);
}

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

    #app,
    .qrae-app {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }

}

/* ==========================================================
   S12 — VALIDACIÓ DEL FORMULARI
========================================================== */

.qrae-field-error {
    margin: 1px 0 0;

    color: #ffd4ca;

    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.2;
}

.qrae-field-error[hidden] {
    display: none;
}

.qrae-form-field.has-error input {
    border-color: #e94a22;

    box-shadow:
        0 0 0 3px rgba(233, 74, 34, 0.24),
        inset 0 1px 2px rgba(6, 39, 69, 0.08);
}

.qrae-form-consent-wrapper.has-error
.qrae-form-consent {
    border-color: #e94a22;

    box-shadow:
        0 0 0 3px rgba(233, 74, 34, 0.2);
}

.qrae-form-submit
.qrae-button:disabled {
    cursor: wait;

    opacity: 0.72;

    transform: none;

    box-shadow:
        0 3px 0 #c97d00,
        0 7px 13px rgba(0, 0, 0, 0.18);
}

.qrae-form-submit
.qrae-button.is-loading
.qrae-button-icon {
    animation:
        qrae-form-loading
        800ms
        linear
        infinite;
}

@keyframes qrae-form-loading {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================
   S03 — COLORS DEFINITIUS DEL MAPA
========================================================== */

/* Base comuna */

.qrae-screen-control-center
.qrae-adventure-map-card {
    opacity: 1 !important;
    filter: none !important;

    border: 3px solid #ffffff !important;
    outline: 2px solid rgba(11, 47, 99, 0.24) !important;
    border-radius: 13px !important;

    box-shadow:
        0 5px 0 rgba(5, 28, 58, 0.48),
        0 9px 16px rgba(11, 47, 99, 0.28) !important;
}

/* ==========================================================
   PENDENTS — ALTERNANÇA REAL BLAU / GROC
========================================================== */

/* Posicions senars: blau viu */

.qrae-screen-control-center
.qrae-adventure-map-card.is-locked:nth-child(odd) {
    color: #ffffff !important;

    background:
        linear-gradient(
            180deg,
            #245b96 0%,
            #0b2f63 100%
        ) !important;
}

/* Posicions parelles: groc viu */

.qrae-screen-control-center
.qrae-adventure-map-card.is-locked:nth-child(even) {
    color: #ffffff !important;

    background:
        linear-gradient(
            180deg,
            #ff9a1a 0%,
            #d86f00 100%
        ) !important;

    box-shadow:
        0 5px 0 #a96e00,
        0 9px 16px rgba(11, 47, 99, 0.25) !important;
}

/* Text dels pendents */

.qrae-screen-control-center
.qrae-adventure-map-card.is-locked
.qrae-map-card-number,
.qrae-screen-control-center
.qrae-adventure-map-card.is-locked
.qrae-map-card-name {
    color: #ffffff !important;

    text-shadow:
        0 2px 3px rgba(0, 0, 0, 0.46) !important;
}

/* ==========================================================
   ACTUAL — VERMELL INTENS
========================================================== */

.qrae-screen-control-center
.qrae-adventure-map-card.is-current {
    z-index: 20 !important;

    color: #ffffff !important;

    background:
        linear-gradient(
            180deg,
            #f0442f 0%,
            #d92112 100%
        ) !important;

    border-color: #ffffff !important;
    outline-color: rgba(217, 33, 18, 0.52) !important;

    box-shadow:
        0 0 0 4px #ffffff,
        0 0 0 7px rgba(233, 74, 34, 0.34),
        0 6px 0 #97180d,
        0 14px 24px rgba(11, 47, 99, 0.35) !important;

    filter: none !important;
}

.qrae-screen-control-center
.qrae-adventure-map-card.is-current
.qrae-map-card-number,
.qrae-screen-control-center
.qrae-adventure-map-card.is-current
.qrae-map-card-name {
    color: #ffffff !important;

    text-shadow:
        0 2px 3px rgba(80, 8, 4, 0.48) !important;
}

/* ==========================================================
   COMPLETATS — VERD ESMERALDA INTENS
========================================================== */

.qrae-screen-control-center
.qrae-adventure-map-card.is-completed {
    color: #ffffff !important;

    background:
        linear-gradient(
            180deg,
            #19a98f 0%,
            #087b70 100%
        ) !important;

    border-color: #ffffff !important;
    outline-color: rgba(8, 123, 112, 0.38) !important;

    box-shadow:
        0 5px 0 #05594f,
        0 9px 16px rgba(11, 47, 99, 0.27) !important;

    filter: none !important;
}

.qrae-screen-control-center
.qrae-adventure-map-card.is-completed
.qrae-map-card-number,
.qrae-screen-control-center
.qrae-adventure-map-card.is-completed
.qrae-map-card-name {
    color: #ffffff !important;

    text-shadow:
        0 2px 3px rgba(0, 55, 49, 0.46) !important;
}

/* Check completat */

.qrae-screen-control-center
.qrae-map-card-check {
    color: #ffffff !important;
    background: #7fae16 !important;

    border: 2px solid #ffffff !important;

    box-shadow:
        0 3px 0 #4f7207,
        0 6px 10px rgba(11, 47, 99, 0.26) !important;
}

/* ==========================================================
   S03 — LLEGIBILITAT DELS COMERÇOS
   Tipografia condensada + pastilla semitransparent
========================================================== */

.qrae-screen-control-center
.qrae-adventure-map-card {
    width: clamp(56px, 16.8%, 74px);
    min-height: 62px;

    padding: 6px 5px;
}

/* ==========================================================
   NÚMERO
========================================================== */

.qrae-screen-control-center
.qrae-map-card-number {
    position: relative;
    z-index: 2;

    color: inherit;

    font-size: clamp(1.02rem, 3.6vw, 1.35rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: 0;

    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.9),
        0 2px 4px rgba(0, 0, 0, 0.75);

    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

/* ==========================================================
   NOM DEL COMERÇ
========================================================== */

.qrae-screen-control-center
.qrae-map-card-name {
    position: relative;
    z-index: 2;

    display: -webkit-box;

    width: 100%;
    max-width: 100%;

    margin-top: 4px;
    padding: 3px 4px;

    overflow: hidden;

    color: inherit;

    font-family:
    "Roboto Condensed",
    var(--qrae-font-family);

    font-size: clamp(0.42rem, 1.38vw, 0.59rem);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: 0.005em;

    text-align: center;
    text-transform: uppercase;

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

    border-radius: 6px;

    overflow-wrap: anywhere;
    word-break: normal;

    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.92),
        0 2px 3px rgba(0, 0, 0, 0.72);

    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;

    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* ==========================================================
   PASTILLA — PENDENTS BLAUS
========================================================== */

.qrae-screen-control-center
.qrae-adventure-map-card.is-locked:nth-child(odd)
.qrae-map-card-name {
    color: #000000!important;
    background:
        rgba(255, 255, 255, 0.72);
}

/* ==========================================================
   PASTILLA — PENDENTS TARONJA / GROC
========================================================== */

.qrae-screen-control-center
.qrae-adventure-map-card.is-locked:nth-child(even)
.qrae-map-card-name {
    color: #ffffff;

    background:
        rgba(87, 45, 0, 0.24);

    text-shadow:
        0 1px 0 rgba(73, 34, 0, 0.95),
        0 2px 3px rgba(73, 34, 0, 0.72);
}

/* ==========================================================
   PASTILLA — COMERÇ ACTUAL
========================================================== */

.qrae-screen-control-center
.qrae-adventure-map-card.is-current
.qrae-map-card-name {
    color: #ffffff;

    background:
        rgba(92, 9, 4, 0.24);

    text-shadow:
        0 1px 0 rgba(74, 6, 3, 0.95),
        0 2px 3px rgba(74, 6, 3, 0.72);
}

/* ==========================================================
   PASTILLA — COMERÇOS COMPLETATS
========================================================== */

.qrae-screen-control-center
.qrae-adventure-map-card.is-completed
.qrae-map-card-name {
    color: #ffffff;

    background:
        rgba(0, 70, 62, 0.24);

    text-shadow:
        0 1px 0 rgba(0, 55, 49, 0.95),
        0 2px 3px rgba(0, 55, 49, 0.72);
}

/* ==========================================================
   PANTALLES PETITES
========================================================== */

@media (max-width: 380px) {

    .qrae-screen-control-center
    .qrae-adventure-map-card {
        width: 16.5%;
        min-height: 58px;
    }

    .qrae-screen-control-center
    .qrae-map-card-number {
        font-size: 0.98rem;
    }

    .qrae-screen-control-center
    .qrae-map-card-name {
        padding: 2px 3px;

        font-size: 0.39rem;
        line-height: 1.04;

        border-radius: 5px;
    }
}

/* ==========================================================
   DESTINATION SHEET — ICONA ADREÇA
========================================================== */

.qrae-destination-sheet-address{

    display:flex;
    align-items:center;
    gap:8px;

    margin:8px 0 12px;

    color:#fefefe;

    font-size:.92rem;
    font-weight:600;
}

.qrae-destination-sheet-address-icon{

    flex:0 0 18px;

    width:18px;
    height:18px;

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

    color:#d92112;
}

.qrae-destination-sheet-address-icon svg{

    width:18px;
    height:18px;

    fill:none;

    stroke:currentColor;
    stroke-width:2.8;

    stroke-linecap:round;
    stroke-linejoin:round;
}

/* ==========================================================
   S03 — ANIMACIONS DELS COMERÇOS DEL MAPA
========================================================== */

/* Base */

.qrae-screen-control-center
.qrae-adventure-map-card {
    transform-origin: center;

    will-change:
        transform,
        box-shadow,
        filter;
}

/* ==========================================================
   COMERÇ ACTUAL — POLS SUAU
========================================================== */

.qrae-screen-control-center
.qrae-adventure-map-card.is-current {
    animation:
        qrae-map-current-pulse
        2.5s
        ease-in-out
        infinite;
}

@keyframes qrae-map-current-pulse {

    0%,
    72%,
    100% {
        transform:
            translate(-50%, -50%)
            scale(1);

        filter:
            brightness(1);
    }

    82% {
        transform:
            translate(-50%, -50%)
            scale(1.03);

        filter:
            brightness(1.2);
    }

    90% {
        transform:
            translate(-50%, -50%)
            scale(1.018);

        filter:
            brightness(1.04);
    }
}

/* ==========================================================
   COMERÇ COMPLETAT — ENTRADA AMB CHECK
========================================================== */

.qrae-screen-control-center
.qrae-adventure-map-card.is-completed {
    animation:
        qrae-map-completed-enter
        520ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

@keyframes qrae-map-completed-enter {

    0% {
        opacity: 0.55;

        transform:
            translate(-50%, -50%)
            scale(0.86)
            rotate(-3deg);

        filter:
            brightness(1.35);
    }

    55% {
        opacity: 1;

        transform:
            translate(-50%, -50%)
            scale(1.08)
            rotate(1deg);

        filter:
            brightness(1.18);
    }

    100% {
        opacity: 1;

        transform:
            translate(-50%, -50%)
            scale(1)
            rotate(0);

        filter:
            brightness(1);
    }
}

/* Check */

.qrae-screen-control-center
.qrae-map-card-check {
    transform-origin: center;

    animation:
        qrae-map-check-enter
        460ms
        180ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

@keyframes qrae-map-check-enter {

    0% {
        opacity: 0;

        transform:
            scale(0)
            rotate(-25deg);
    }

    65% {
        opacity: 1;

        transform:
            scale(1.2)
            rotate(5deg);
    }

    100% {
        opacity: 1;

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

/* ==========================================================
   NOU COMERÇ DESBLOQUEJAT — POP INICIAL
========================================================== */

.qrae-screen-control-center
.qrae-adventure-map-card.is-current {
    animation:
        qrae-map-current-unlock
        560ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both,
        qrae-map-current-pulse
        2.5s
        700ms
        ease-in-out
        infinite;
}

@keyframes qrae-map-current-unlock {

    0% {
        opacity: 0.65;

        transform:
            translate(-50%, -50%)
            scale(0.82);

        filter:
            brightness(1.4);
    }

    60% {
        opacity: 1;

        transform:
            translate(-50%, -50%)
            scale(1.1);

        filter:
            brightness(1.2);
    }

    100% {
        opacity: 1;

        transform:
            translate(-50%, -50%)
            scale(1);

        filter:
            brightness(1);
    }
}

/* ==========================================================
   PRESS DEL COMERÇ ACTUAL
========================================================== */

.qrae-screen-control-center
button.qrae-adventure-map-card.is-current:active {
    animation-play-state: paused;

    transform:
        translate(-50%, -50%)
        scale(0.94);

    filter:
        brightness(0.95);
}

/* ==========================================================
   ACCESSIBILITAT
========================================================== */

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

    .qrae-screen-control-center
    .qrae-adventure-map-card.is-current,

    .qrae-screen-control-center
    .qrae-adventure-map-card.is-completed,

    .qrae-screen-control-center
    .qrae-map-card-check {
        animation: none !important;
    }
}

/* ==========================================================
   VÍDEOS — CÀRREGA SENSE PANTALLA NEGRA
========================================================== */

.qrae-video-frame {
    position: relative;

    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            #123f70 0%,
            #062745 100%
        );
}

/*
 * El vídeo no es mostra fins que el navegador
 * disposa almenys del primer fotograma.
 */

.qrae-video-frame
.qrae-video {
    opacity: 0;

    transition:
        opacity 240ms ease;
}

.qrae-video-frame
.qrae-video.is-ready,
.qrae-video-frame.is-video-ready
.qrae-video {
    opacity: 1;
}

/* Indicador discret de càrrega */

.qrae-video-frame::after {
    position: absolute;

    top: 50%;
    left: 50%;

    z-index: 3;

    width: 30px;
    height: 30px;

    content: "";

    opacity: 0;

    border:
        3px solid
        rgba(255, 255, 255, 0.28);

    border-top-color: #f5b21a;
    border-radius: 50%;

    pointer-events: none;

    transform:
        translate(-50%, -50%);

    transition:
        opacity 160ms ease;
}

.qrae-video-frame.is-video-loading::after {
    opacity: 1;

    animation:
        qrae-video-loading-spin
        760ms
        linear
        infinite;
}

.qrae-video-frame.is-video-ready::after {
    opacity: 0;
}

@keyframes qrae-video-loading-spin {
    to {
        transform:
            translate(-50%, -50%)
            rotate(360deg);
    }
}

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

    .qrae-video-frame
    .qrae-video {
        transition: none;
    }

    .qrae-video-frame::after {
        animation: none !important;
    }
}

/* ==========================================================
   S03 — TUTORIAL DEL PRIMER COMERÇ
========================================================== */

.qrae-map-tutorial-overlay {
    position: absolute;
    inset: 0;
    z-index: 80;

    overflow: hidden;

    background:
        rgba(3, 22, 45, 0.62);

    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);

    animation:
        qrae-map-tutorial-overlay-enter
        260ms
        ease
        both;
}

/* Permet que el comerç actual quedi visualment destacat */

.qrae-map-tutorial-highlight {
    position: absolute;
    top: 22%;
    left: 20%;

    width: 94px;
    height: 94px;

    border:
        4px solid
        rgba(255, 255, 255, 0.98);

    border-radius: 22px;

    box-shadow:
        0 0 0 999px rgba(3, 22, 45, 0.24),
        0 0 0 8px rgba(233, 74, 34, 0.38),
        0 0 28px rgba(245, 178, 26, 0.72);

    transform:
        translate(-50%, -50%);

    pointer-events: none;

    animation:
        qrae-map-tutorial-highlight-pulse
        1.5s
        ease-in-out
        infinite;
}


/* Globus */

.qrae-map-tutorial-bubble {

    position: absolute;

    left: 18px;
    right: 18px;

    bottom: 138px;

    z-index: 3;

    padding:
        20px
        18px
        18px;

    color: #ffffff;
    text-align: center;

    background:
        linear-gradient(
            180deg,
            #123f70 0%,
            #062745 100%
        );

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

    box-shadow:
        0 0 0 4px rgba(245,178,26,.24),
        0 16px 34px rgba(0,0,0,.34);

    animation:
        qrae-map-tutorial-bubble-enter
        480ms
        120ms
        cubic-bezier(0.22,1,0.36,1)
        both;
}
    /* Punta del globus */

    .qrae-map-tutorial-bubble::before {

    content: "";

    position: absolute;

    top: -18px;

    left: 68px;

    width: 0;
    height: 0;

    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-bottom: 18px solid #123f70;

    filter:
        drop-shadow(
            0 -1px 1px rgba(255,255,255,.35)
        );
    }

.qrae-map-tutorial-kicker {
    margin:
        0
        0
        5px;

    color: #f5b21a;

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

.qrae-map-tutorial-bubble h2 {
    margin:
        0
        0
        9px;

    color: #ffffff;

    font-size:
        clamp(
            1.3rem,
            5.2vw,
            1.65rem
        );

    font-weight: 800;
    line-height: 1.05;
}

.qrae-map-tutorial-bubble p:not(
    .qrae-map-tutorial-kicker
) {
    margin:
        0
        0
        16px;

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

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

.qrae-map-tutorial-button {
    min-height: 44px;

    padding:
        8px
        18px;
}

/* Sortida */

.qrae-map-tutorial-overlay.is-closing {
    animation:
        qrae-map-tutorial-overlay-exit
        220ms
        ease
        both;
}

/* ==========================================================
   ANIMACIONS
========================================================== */

@keyframes qrae-map-tutorial-overlay-enter {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes qrae-map-tutorial-overlay-exit {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes qrae-map-tutorial-bubble-enter {
    from {
        opacity: 0;

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

    to {
        opacity: 1;

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



@keyframes qrae-map-tutorial-highlight-pulse {
    0%,
    100% {
        transform:
            translate(-50%, -50%)
            scale(1);
    }

    50% {
        transform:
            translate(-50%, -50%)
            scale(1.07);
    }
}

/* ==========================================================
   PANTALLES BAIXES
========================================================== */

@media (max-height: 700px) {

    .qrae-map-tutorial-highlight {
        top: 21%;

        width: 82px;
        height: 82px;
    }

    
    .qrae-map-tutorial-bubble {
        right: 13px;
        bottom: 72px;
        left: 13px;

        padding:
            15px
            15px
            14px;
    }

    .qrae-map-tutorial-bubble h2 {
        margin-bottom: 6px;

        font-size: 1.2rem;
    }

    .qrae-map-tutorial-bubble p:not(
        .qrae-map-tutorial-kicker
    ) {
        margin-bottom: 11px;

        font-size: 0.78rem;
        line-height: 1.25;
    }
}

/* ==========================================================
   ACCESSIBILITAT
========================================================== */

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

    .qrae-map-tutorial-overlay,
    .qrae-map-tutorial-highlight,
    .qrae-map-tutorial-bubble {
        animation: none !important;
    }
}

.qrae-completed-adventure-card {
    position: relative;
    z-index: 5;

    display: grid;
    gap: 15px;

    width: calc(100% - 32px);
    max-width: 420px;

    margin:
        4px
        auto
        104px;

    padding:
        22px
        19px
        20px;

    color: #ffffff;
    text-align: center;

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

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

    box-shadow:
        0 0 0 4px rgba(245, 178, 26, 0.22),
        0 15px 32px rgba(6, 39, 69, 0.28);

    animation:
        qrae-completed-adventure-enter
        480ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-completed-adventure-icon {
    font-size: 3.4rem;
    line-height: 1;

    filter:
        drop-shadow(
            0 8px 10px
            rgba(0, 0, 0, 0.24)
        );
}

.qrae-completed-adventure-content {
    display: grid;
    gap: 7px;
}

.qrae-completed-adventure-kicker {
    margin: 0;

    color: #f5b21a;

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

.qrae-completed-adventure-content h2 {
    margin: 0;

    color: #ffffff;

    font-size:
        clamp(
            1.6rem,
            7vw,
            2.15rem
        );

    font-weight: 800;
    line-height: 1;
}

.qrae-completed-adventure-content p:last-child {
    margin: 0;

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

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

.qrae-completed-adventure-button {
    margin-top: 0;
}

.qrae-completed-adventure-actions {
    display: grid;
    gap: 9px;
}

.qrae-completed-adventure-actions
.qrae-button-secondary {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.88);
    box-shadow: none;
}

@keyframes qrae-completed-adventure-enter {
    from {
        opacity: 0;

        transform:
            translateY(22px)
            scale(0.96);
    }

    to {
        opacity: 1;

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

@media (max-height: 700px) {

    .qrae-completed-adventure-card {
        gap: 11px;

        margin-bottom: 90px;

        padding:
            17px
            15px;
    }

    .qrae-completed-adventure-icon {
        font-size: 2.8rem;
    }

    .qrae-completed-adventure-content h2 {
        font-size: 1.5rem;
    }
}

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

    .qrae-completed-adventure-card {
        animation: none;
    }
}

.qrae-form-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ==========================================================
   S03 COMPLETAT — MÉS ESPAI AL MAPA I TARGETA MÉS AVALL
========================================================== */

/*
 * Dona més alçada al mapa només quan apareix
 * la targeta d'aventura completada.
 */
.qrae-screen-control-center:
has(.qrae-completed-adventure-card)
.qrae-control-map {
    min-height: 55dvh;
}

/*
 * El mapa aprofita tota l'alçada disponible.
 */
.qrae-screen-control-center:
has(.qrae-completed-adventure-card)
.qrae-adventure-map {
    min-height: 55dvh;
}

/*
 * Baixa la targeta i crea més separació visual
 * respecte del mapa.
 */
.qrae-completed-adventure-card {
    margin:
        30px
        auto
        104px;
}


/* ==========================================================
   MÒBILS
========================================================== */

@media (max-width: 600px) {

    .qrae-screen-control-center:
    has(.qrae-completed-adventure-card)
    .qrae-control-map {
        min-height: 57dvh;
    }

    .qrae-screen-control-center:
    has(.qrae-completed-adventure-card)
    .qrae-adventure-map {
        min-height: 57dvh;
    }

    .qrae-completed-adventure-card {
        margin-top: 34px;
    }
}


/* ==========================================================
   PANTALLES BAIXES
========================================================== */

@media (max-height: 750px) {

    .qrae-screen-control-center:
    has(.qrae-completed-adventure-card)
    .qrae-control-map {
        min-height: 52dvh;
    }

    .qrae-screen-control-center:
    has(.qrae-completed-adventure-card)
    .qrae-adventure-map {
        min-height: 52dvh;
    }

    .qrae-completed-adventure-card {
        margin-top: 24px;
        margin-bottom: 92px;
    }
}
/* ==========================================================
   S05 — PREGUNTA: TARGETA I PERSONATGES MÉS GRANS
========================================================== */

/* Targeta principal de la pregunta */
.qrae-question-card {
    min-height: clamp(520px, 47dvh, 650px);

    padding:
        clamp(26px, 6vw, 38px)
        clamp(20px, 5vw, 30px);

    display: flex;
    flex-direction: column;
}

/* Les respostes ocupen millor l'espai disponible */
.qrae-question-answers {
    display: grid;
    gap: clamp(13px, 2dvh, 20px);

    margin-top: auto;
    padding-top: 22px;
}

/* Contenidor del personatge */
.qrae-question-character {
    position: absolute;

    bottom: 0;

    width: 56%;
    max-width: 295px;
    max-height: 49dvh;

    pointer-events: none;
}

/* Clara a l'esquerra */
.qrae-question-character-clara {
    left: -1%;
}

/* Martí a l'esquerra */
.qrae-question-character-marti {
    left: 1%;
}

/* Imatge interior */
.qrae-question-character img {
    display: block;

    width: 100%;
    height: auto;
    max-height: 46dvh;

    object-fit: contain;
    object-position: left bottom;
}
@media (max-height: 760px) {

    .qrae-question-card {
        min-height: auto;

        padding:
            22px
            18px;
    }

    .qrae-question-character {
        width: 46%;
        max-width: 230px;
        max-height: 39dvh;
    }

    .qrae-question-character img {
        max-height: 39dvh;
    }
}

/* ==========================================================
   PAUSA I DESAT DE PARTIDA
========================================================== */

.qrae-bottom-nav.has-pause-action {
    grid-template-columns:
        repeat(4, minmax(0, 1fr)) !important;
    gap: 4px !important;
    padding: 5px !important;
}

.qrae-bottom-nav.has-pause-action
.qrae-bottom-nav-item {
    min-width: 0;
    padding-right: 3px !important;
    padding-left: 3px !important;
}

.qrae-bottom-nav.has-pause-action
.qrae-bottom-nav-icon {
    width: 24px !important;
    height: 24px !important;
}

.qrae-bottom-nav.has-pause-action
.qrae-bottom-nav-label {
    font-size: 0.56rem !important;
    line-height: 1.05 !important;
    text-wrap: balance;
}

.qrae-pause-modal-open {
    overflow: hidden;
}

.qrae-pause-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;

    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.86);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    animation:
        qrae-pause-overlay-enter
        220ms
        ease-out
        both;
}

.qrae-pause-modal {
    width: min(100%, 390px);

    padding:
        24px
        20px
        20px;

    color: #ffffff;
    text-align: center;

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

    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.36);

    animation:
        qrae-pause-modal-enter
        420ms
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}

.qrae-pause-modal-icon {
    margin-bottom: 10px;

    color: #f5b21a;

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

.qrae-pause-modal h2 {
    margin: 0;

    color: #ffffff;

    font-size:
        clamp(
            1.55rem,
            7vw,
            2rem
        );

    font-weight: 800;
    line-height: 1.05;
}

.qrae-pause-modal-message {
    display: grid;
    gap: 10px;

    margin: 14px 0 19px;

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

    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.42;
}

.qrae-pause-modal-message p {
    margin: 0;
}

.qrae-pause-modal-close-message {
    color: #f5b21a;
    font-weight: 800;
}

.qrae-pause-modal-actions {
    display: grid;
    gap: 10px;
}

.qrae-pause-modal-actions .qrae-button {
    width: 100%;
}

@keyframes qrae-pause-overlay-enter {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes qrae-pause-modal-enter {
    from {
        opacity: 0;

        transform:
            translateY(22px)
            scale(0.97);
    }

    to {
        opacity: 1;

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

@media (max-width: 380px) {

    .qrae-bottom-nav.has-pause-action {
        gap: 2px !important;
        padding: 4px !important;
    }

    .qrae-bottom-nav.has-pause-action
    .qrae-bottom-nav-item {
        min-height: 48px !important;
        padding: 3px 1px !important;
    }

    .qrae-bottom-nav.has-pause-action
    .qrae-bottom-nav-icon {
        width: 22px !important;
        height: 22px !important;
    }

    .qrae-bottom-nav.has-pause-action
    .qrae-bottom-nav-label {
        font-size: 0.51rem !important;
    }

    .qrae-pause-modal {
        padding:
            20px
            16px
            17px;
    }
}

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

    .qrae-pause-modal-overlay,
    .qrae-pause-modal {
        animation: none;
    }
}

/* ==========================================================
   S03 COMPLETAT — MAPA MÉS ALT I TARGETA MÉS AVALL
========================================================== */

.qrae-screen-control-center:
has(.qrae-completed-adventure-card)
.qrae-control-map {
    min-height: 43dvh;
}

.qrae-screen-control-center:
has(.qrae-completed-adventure-card)
.qrae-adventure-map {
    min-height: 43dvh;
}

.qrae-screen-control-center:
has(.qrae-completed-adventure-card)
.qrae-completed-adventure-card {
    margin-top: 54px;
}

@media (max-height: 760px) {

    .qrae-screen-control-center:
    has(.qrae-completed-adventure-card)
    .qrae-control-map,
    .qrae-screen-control-center:
    has(.qrae-completed-adventure-card)
    .qrae-adventure-map {
        min-height: 40dvh;
    }

    .qrae-screen-control-center:
    has(.qrae-completed-adventure-card)
    .qrae-completed-adventure-card {
        margin-top: 38px;
    }
}

