/* ============================================================
   JAECOO "Dejando Huella" - Faunia WebApp
   Estilos principales
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: alibaba-sans, sans-serif;
    font-weight: 300;
    font-style: normal;
    color: #FFFFFF;
    background-color: #00677B;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

}

/* ── Background layers ────────────────────────────────────── */
body::before,
body::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: auto;
    pointer-events: none;
    z-index: -1;
    background-repeat: no-repeat;
    background-size: 100% auto;
}

body::before {
    top: 0;
    background-image: url('../assets/img/bg_top.png');
    background-position: top center;
    height: 120px;
}

body::after {
    bottom: 0;
    background-image: url('../assets/img/bg_bottom.png');
    background-position: bottom center;
    height: 120px;
}

/* ── Lock orientation to portrait ─────────────────────────── */
@media screen and (orientation: landscape) and (max-height: 600px) {
    body::before {
        content: '';
    }

    .rotate-warning {
        display: flex !important;
    }

    .app-container {
        display: none !important;
    }
}

.rotate-warning {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #00677B;
    color: #fff;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
}

.rotate-warning .rotate-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: rotatePhone 2s ease-in-out infinite;
}

@keyframes rotatePhone {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-90deg);
    }

    75% {
        transform: rotate(-90deg);
    }
}

/* ── App Container ────────────────────────────────────────── */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 480px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ── Typography ───────────────────────────────────────────── */
.text-light {
    font-weight: 300;
    font-style: normal;
}

.text-heavy {
    font-weight: 800;
    font-style: normal;
}

.text-light-italic {
    font-weight: 300;
    font-style: italic;
}

.text-heavy-italic {
    font-weight: 800;
    font-style: italic;
}

h1,
h2,
h3 {
    font-weight: 800;
    line-height: 1.15;
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.4rem;
}

h3 {
    font-size: 1.15rem;
}

p {
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

/* ── Logo ─────────────────────────────────────────────────── */
.logo-container {
    padding-top: 4rem;
    width: 100%;
    text-align: center;
    z-index: 10;
}

.logo-container img {
    max-width: 55%;
    height: auto;
}

/* ── Screens (pantallas) ──────────────────────────────────── */
.screen {
    display: none;
    flex-direction: column;
    flex: 1;
    flex-grow: 0;
    justify-content: space-between;
    animation: fadeInUp 0.4s ease-out;
    padding-top: 2rem;
    padding-bottom: 0.5rem;
}

.screen>* {
    margin-top: 0;
    margin-bottom: 0;
}

.screen.active {
    display: flex;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* ── Buttons ──────────────────────────────────────────────── */
.btn-jaecoo {
    display: inline-block;
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: #FFFFFF;
    color: #00677B;
    border: none;
    border-radius: 14px;
    font-family: alibaba-sans, sans-serif;
    font-weight: 800;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    /* box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);*/
    position: relative;
    z-index: 1;
    overflow: hidden;
    touch-action: manipulation;
}

.btn-jaecoo:hover,
.btn-jaecoo:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    color: #00677B;
}

.btn-jaecoo:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.btn-jaecoo.btn-cta {
    animation: pulse 2s ease-in-out infinite;
}

.btn-jaecoo.btn-outline {
    background: transparent;
    color: #FFFFFF;
    /*border: 1px solid #FFFFFF;*/
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-jaecoo.btn-outline:hover,
.btn-jaecoo.btn-outline:focus {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

.btn-jaecoo.btn-sm {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
}

.btn-jaecoo:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    animation: none;
}

/* ── Vehicle image ────────────────────────────────────────── */
.vehicle-image {
    width: 90%;
    max-width: 360px;
    margin: 0.5rem auto;
    display: block;
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 800;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: #FFFFFF;
    font-family: alibaba-sans, sans-serif;
    font-weight: 300;
    font-size: 1rem;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #FFFFFF;
    background: rgba(255, 255, 255, 0.25);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-control.is-invalid {
    border-color: yellow;
}

.invalid-feedback {
    color: yellow;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
    animation: slideDown 0.3s ease;
}

.form-control.is-invalid~.invalid-feedback,
.form-check-input.is-invalid~.invalid-feedback,
.was-validated .form-control:invalid~.invalid-feedback {
    display: block;
}

.form-check-input.is-invalid {
    outline: 1px solid yellow;
}

/* ── Checkboxes ───────────────────────────────────────────── */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    position: relative;
    z-index: 1;
    cursor: pointer;
}

.form-check-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    margin: 0;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    outline: none;
    touch-action: manipulation;
}

.form-check-input:hover,
.form-check-input:focus {
    border-color: #FFFFFF;
    background: rgba(255, 255, 255, 0.25);
}

.form-check-input:checked {
    background: #FFFFFF;
    border-color: #FFFFFF;
}

.form-check-input:checked::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid #00677B;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.form-check-label {
    font-size: 0.85rem;
    line-height: 1.4;
    cursor: pointer;
    padding-top: 2px;
}

.form-check-label a {
    color: #FFFFFF;
    text-decoration: underline;
    font-weight: 800;
}

/* ── Map ──────────────────────────────────────────────────── */
.map-container {
    width: 100%;
    margin: 1rem 0;
    position: relative;
}

.map-expand-icon {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    /* Deja pasar el click al contenedor */
    animation: expand-pulse 2s infinite;
}

@keyframes expand-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }
}

#screen-map h2>img,
.map-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Animal list ──────────────────────────────────────────── */
.animal-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin: 1rem 0;
    list-style: none;
}

.animal-list-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: background 0.3s ease;
}

.animal-list-item.completed {
    background: rgba(255, 255, 255, 0.25);
}

.animal-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    font-weight: 800;
    font-size: 0.8rem;
    transition: background 0.3s ease;
}

.animal-list-item.completed .animal-number {
    background: #4CAF50;
}

.animal-name {
    font-weight: 800;
    font-size: 0.85rem;
    flex: 1;
}

.animal-status-icon {
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.animal-list-item.completed .animal-status-icon {
    opacity: 1;
}

/* ── QR Scanner ───────────────────────────────────────────── */
#screen-scanner {
    background-color: #00677B;
    border-radius: 20px;
    position: relative;
    z-index: 2;
}

.scanner-container {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    min-height: 280px;
    margin: 1.5rem auto;
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    background: #003843;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: #003843;
    color: #ffffff;
    z-index: 5;
    transition: opacity 0.3s ease;
    padding: 1rem;
    text-align: center;
}

.scanner-placeholder.hidden {
    opacity: 0;
    pointer-events: none;
}

.scanner-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: scannerSpinner 0.8s linear infinite;
}

@keyframes scannerSpinner {
    to {
        transform: rotate(360deg);
    }
}

.scanner-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#qr-reader {
    width: 100%;
    height: 100%;
}

#qr-reader video {
    border-radius: 12px;
    object-fit: contain;
    /* iOS Safari necesita estos atributos en el video - los pone html5-qrcode */
    /* pero aseguramos que el video sea visible */
    width: 100% !important;
    height: 100% !important;
}

.scanner-overlay {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    pointer-events: none;
}

.scanner-corners {
    position: absolute;
    inset: 15px;
    pointer-events: none;
}

.scanner-corners::before,
.scanner-corners::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: #FFFFFF;
    border-style: solid;
}

.scanner-corners::before {
    top: 0;
    left: 0;
    border-width: 3px 0 0 3px;
}

.scanner-corners::after {
    top: 0;
    right: 0;
    border-width: 3px 3px 0 0;
}

.scanner-hint {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0;
}

.scanner-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-switch-camera {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background 0.2s ease;
}

.btn-switch-camera:active {
    background: rgba(0, 0, 0, 0.75);
}

/* ── Quiz ─────────────────────────────────────────────────── */

.pre-quiz-animal-container {
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 14px;
    max-width: 90%;
    margin: 2rem auto;
}

.quiz-animal-container {
    max-width: 90%;
    margin: 1rem auto;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    padding: 1rem;
}

.quiz-animal-container.completed-animal {
    background-color: #b3d5e0;
    max-width: 100%;
    border-radius: 10px;
    margin: 0.5rem;
}


.quiz-animal-image {
    width: 100%;
    height: 200px;
    margin-bottom: 1.5rem;
    display: block;
    border-radius: 16px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
    /*box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);*/

}

.quiz-question {
    font-weight: 800;
    font-size: 1.325rem;
    text-align: center;
    margin: 1rem 0;
    line-height: 1.4;
    padding: 0.5rem 2rem;
}

.quiz-options {
    display: flex;
    flex-direction: row;
    gap: 0.6rem;
    margin: 1rem 0 2rem;
    width: 100%;
}

.quiz-option {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 0.75rem;
    padding: 0.85rem 0.2rem;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 300;
    text-align: center;
    text-wrap: balance;
}

.quiz-option:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateX(4px);
}

.quiz-option .option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    transition: background 0.3s ease;
}

.quiz-option.correct {
    background: rgba(76, 175, 80, 0.3);
    border-color: #4CAF50;
    pointer-events: none;
}

.quiz-option.correct .option-letter {
    background: #4CAF50;
}

.quiz-option.incorrect {
    background: rgba(255, 107, 107, 0.2);
    border-color: #ff6b6b;
    opacity: 0.5;
    pointer-events: none;
}

.quiz-option.incorrect .option-letter {
    background: #ff6b6b;
}

.quiz-option.disabled {
    pointer-events: none;
    opacity: 0.4;
}

.quiz-hint-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: rgba(255, 193, 7, 0.2);
    border: 2px solid rgba(255, 193, 7, 0.4);
    border-radius: 14px;
    color: #FFC107;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: alibaba-sans, sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
}

.quiz-hint-btn:hover {
    background: rgba(255, 193, 7, 0.35);
    border-color: #FFC107;
}

.quiz-feedback {
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.9rem;
    margin: 0.75rem 0;
    animation: slideDown 0.3s ease;
}

.quiz-feedback.correct {
    background: rgba(76, 175, 80, 0.25);
    color: #a5d6a7;
}

.quiz-feedback.incorrect {
    background: rgba(255, 107, 107, 0.2);
    color: #ff8a8a;
}

/* ── Completion screen ────────────────────────────────────── */
.completion-icon {
    font-size: 4rem;
    text-align: center;
    margin: 1rem 0;
    animation: pulse 1.5s ease-in-out infinite;
}

.completion-counter {
    text-align: center;
    margin: 1rem 0;
}

.counter-number {
    font-size: 3rem;
    font-weight: 800;
    display: block;
    line-height: 1;
}

.counter-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

#progress-container {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}


/* ── Progress bar ─────────────────────────────────────────── */
.progress-bar-container {
    width: 100px;
    width: 25vw;
    height: 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    overflow: hidden;
    margin: 0.75rem 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #81C784);
    border-radius: 6px;
    transition: width 0.6s ease;
    min-width: 0%;
}

.progress-text {
    text-align: center;
    font-weight: 800;
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 0;
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #00677B;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 1.75rem;
    max-width: 380px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.3s ease;
}

.modal-content h3 {
    margin-bottom: 1rem;
    text-align: center;
}

.modal-content p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.modal-close {
    display: block;
    width: 100%;
    margin-top: 1.25rem;
}

/* ── Install prompt (PWA-like) ────────────────────────────── */
.install-prompt {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 50, 60, 0.95);
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 1.25rem;
    z-index: 500;
    animation: slideUp 0.4s ease;
    backdrop-filter: blur(10px);
}

.install-prompt.active {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

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

.install-prompt-inner {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.install-prompt-text {
    flex: 1;
    font-size: 0.85rem;
}

.install-prompt-actions {
    display: flex;
    gap: 0.5rem;
}

.install-dismiss {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* ── Welcome back banner ──────────────────────────────────── */
.welcome-back {

    padding: 1.25rem;
    margin: 1rem 0;
    text-align: center;
}

.welcome-back h3 {
    margin-bottom: 0.5rem;
}

.welcome-back p {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-bottom: 1rem;
}

.welcome-back .btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.welcome-back+img.vehicle-image {
    margin: 2rem auto;
}

/* ── Confetti animation (Pantalla 7) ──────────────────────── */
.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    opacity: 0;
    animation: confettiFall 4s ease-in-out forwards;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotateZ(0deg);
    }

    100% {
        opacity: 0;
        transform: translateY(100vh) rotateZ(720deg);
    }
}

/* ── Misc utilities ───────────────────────────────────────── */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.spacer {
    flex: 1;
}

.divider {
    width: 60px;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 1rem auto;
}

.fade-text {
    opacity: 0.7;
    font-size: 0.85rem;
}

.error-message {
    background: rgba(255, 255, 0, 0.2);
    border: 1px solid rgba(255, 255, 0, 0.4);
    color: yellow;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    margin: 0.75rem 0;
    display: none;
    animation: slideDown 0.3s ease;
}

.error-message.active {
    display: block;
}

.success-message {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.4);
    color: #a5d6a7;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    text-align: center;
    margin: 0.75rem 0;
}

/* ── Responsive tweaks ────────────────────────────────────── */
@media (min-width: 481px) and (max-width: 768px) {

    /* Tablet adjustments */
    .app-container {
        max-width: 540px;
        padding: 2rem 2rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    .quiz-animal-image {
        max-width: 340px;
        height: 240px;
    }
}

@media (min-width: 769px) {

    /* Large tablet */
    .app-container {
        max-width: 600px;
        padding: 2.5rem 2.5rem;
    }

    h1 {
        font-size: 2.2rem;
    }
}

/* ── Smooth scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

/* ── Instructions list ────────────────────────────────────── */
.instructions-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.instructions-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.instructions-list .step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    font-weight: 800;
    font-size: 0.8rem;
}

/* ── Final screen ─────────────────────────────────────────── */
.final-trophy {
    font-size: 5rem;
    text-align: center;
    margin: 1.5rem 0;
    animation: pulse 2s ease-in-out infinite;
}

.final-note {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 1rem;
}

/* ── Loading spinner ──────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 103, 123, 0.3);
    border-top-color: #00677B;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Already completed badge ──────────────────────────────── */
.already-completed-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(76, 175, 80, 0.2);
    border: 2px solid rgba(76, 175, 80, 0.4);
    border-radius: 14px;
    padding: 1rem;
    margin: 1.5rem 0;
    font-weight: 800;
    font-size: 1rem;
    text-align: center;
}

/* ── Stand marker on list ─────────────────────────────────── */
.stand-item {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.stand-item .animal-number {
    background: rgba(255, 255, 255, 0.3);
    font-size: 0.7rem;
    font-weight: 800;
}

/* ── Desktop Visualization (Mobile Emulator via User Agent) ──────────────── */
body.desktop-view {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #111;
    /* Dark desktop background */
    min-height: auto;
    margin: 0;
    padding: 2rem 0;
}

body.desktop-view::before,
body.desktop-view::after {
    display: none;
}

body.desktop-view .rotate-warning {
    display: none !important;
}

body.desktop-view .app-container {
    width: 390px;
    height: 844px;
    /* Typical phone ratio */
    max-height: 90vh;
    min-height: auto;
    background-color: #00677B;
    border-radius: 40px;
    border: 12px solid #222;
    /* Phone bezel */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding: 1.5rem 1.25rem;
    display: flex !important;
    transform: scale(1);
    /* Create containing block for fixed descendants */
    max-width: none;
    /* override previous max-width */
    margin: 0;
}

/* Move background graphics to the container */
body.desktop-view .app-container::before,
body.desktop-view .app-container::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 120px;
    pointer-events: none;
    z-index: 0;
    background-repeat: no-repeat;
    background-size: 100% auto;
}

body.desktop-view .app-container::before {
    top: 0;
    background-image: url('../assets/img/bg_top.png');
    background-position: top center;
}

body.desktop-view .app-container::after {
    bottom: 0;
    background-image: url('../assets/img/bg_bottom.png');
    background-position: bottom center;
}

/* Adjust screen z-index so content is above pseudo background */
body.desktop-view .screen {
    position: relative;
    z-index: 1;
}

/* Adjust install prompt radius to match container bottom */
body.desktop-view .install-prompt {
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
}

#landing-new {
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    gap: 0.5rem;
}

#landing-new .screen>* {
    margin-top: 0;
    margin-bottom: 0;
}

@media (max-width: 480px) {
    .screen#screen-landing {
        min-height: calc(100vh - 9rem);
        min-height: calc(100dvh - 9rem);
    }
}

#screen-register {
    padding-top: 0px
}

#registerForm {
    margin: 1rem 1rem 0rem;
}

#register-success {
    flex-direction: column;
    min-height: 400px;
    justify-content: space-evenly;
}

#hint-text {
    text-align: center;
    font-size: 1rem;
}

h2#quiz-animal-name {
    font-size: 1.625rem;
}

#quiz-active .quiz-option .option-letter {
    display: none;
}

#has-encontrado {
    text-transform: uppercase;
}

#quiz-congrats {
    font-size: 2rem;
}

/* ── Map Viewer Modal ─────────────────────────────────────── */
.mapviewer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #00677B;
    /* Color de fondo corporativo / de la app */
    z-index: 2000;
    flex-direction: column;
}

.mapviewer-overlay.active {
    display: flex;
}

.mapviewer-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2010;
    cursor: pointer;
}

.mapviewer-status {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 0.9rem;
    z-index: 2010;
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 20px;
    white-space: nowrap;
}

.mapviewer-viewport {
    flex: 1;
    width: 100%;
    overflow: hidden;
    position: relative;
    touch-action: none;
    /* Previene el scroll nativo */
}

.mapviewer-canvas {
    width: 100%;
    height: 100%;
    /* transform-origin por defecto al centro */
    display: flex;
    align-items: center;
    justify-content: center;
}

.mapviewer-image-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

#mapviewer-img {
    max-width: none;
    /* Ajusta según si quieres que la imagen ocupe todo el ancho o alto inicial */
    width: 100%;
    height: auto;
    display: block;
}

.mapviewer-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    transform: translate(-50%, -50%);
    /* Centro exacto */
    z-index: 10;
}

.mapviewer-marker-face {
    width: 32px;
    height: 32px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.mapviewer-marker-pulse {
    width: 40px;
    height: 40px;
    background: rgba(66, 133, 244, 0.4);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: mapviewer-pulsate 1.5s ease-out infinite;
}

@keyframes mapviewer-pulsate {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }

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

.mapviewer-offscreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 10;
    pointer-events: none;
}

.mapviewer-arrow {
    width: 50px;
    height: 50px;
    /* Se rotará por JS */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    overflow: visible;
}

.mapviewer-arrow-inner {
    animation: mapviewer-levitate 1.5s ease-in-out infinite;
    transform-origin: center;
}

@keyframes mapviewer-levitate {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.mapviewer-distance {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1rem;
    white-space: nowrap;
}

/* ── Cookie Banner ────────────────────────────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(17, 17, 17, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    z-index: 10000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.cookie-banner p {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.cookie-banner a {
    color: #fff;
    text-decoration: underline;
}

#screen-final.screen {
    gap: 1rem;
}