/* ======== ESTILOS GENERALES ======== */

body {
    font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    text-align: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #ffffff 0%, #8b8b8b 100%);
    background-attachment: fixed;
    margin: 0;
    padding: 10px 10px 70px;

}

button {
    font-family: inherit;
}

/* ======== PANTALLA DE BIENVENIDA ======== */

#welcome-screen {
    min-height: calc(100vh - 20px);
    width: min(100%, 900px);
    box-sizing: border-box;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(12px, 2vh, 24px);
    text-align: center;
}

.welcome-copy {
    width: 100%;
}

.welcome-logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 16px;
    color:rgb(113, 151, 1);
    font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
}


#welcome-screen h1 {
    margin: 0;
    color:rgb(1, 190, 42);
    text-shadow: 10px 10px 10px -7px #121212;
    font-size: clamp(60px, 5vw, 40px);
    line-height: 0.98;
    letter-spacing: -1px;
}

#welcome-screen .Subtitle {
    display: block;
    font-size: clamp(24px, 4vw, 40px);
    line-height: 1.1;
}

.welcome-text {
    max-width: 650px;
    margin: 0 auto;
    color:rgb(88, 87, 87);
    font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    letter-spacing: 2px;
    font-size: 20px;
    line-height: 1.6;
}

#startBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 34px;
    border: none;
    border-radius: 22px;
    box-shadow: 0px 5px 5px -7px #f4982c;
    background: linear-gradient(to bottom, rgba(237, 237, 237, 0.8), rgba(186, 177, 186, 0.85));
    background-color: rgba(237, 237, 237, 0.82);
    cursor: pointer;
    font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    font-size: 18px;
    font-weight: 700;
    transition: background 0.2s ease, transform 0.2s ease;
    color: #2e2e2e;
}

#startBtn span {
    margin-left: 12px;
    font-size: 15px;
    vertical-align: -1px;
}

#startBtn:hover {
    background:linear-gradient(to bottom, #bab1ba 5%, #ededed 100%);
	background-color:#bab1ba;
    transform: translateY(-2px);
}

.welcome-image {
    width: min(100%, 900px);
    aspect-ratio: 1.38;
    min-height: 0;
    margin: 0 auto;
    border-radius: 48% 52% 49% 51% / 60% 60% 40% 40%;
    background: url("fotos/Welcomeimage.png") center / contain no-repeat;
    box-shadow: none;
    overflow: hidden;
}

.game-eyebrow {
    margin-top: 22px;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:url("fotos/PagBackground.jpg") center / cover no-repeat;
    display: blur(5px);
    opacity: 10%;
    transform: scale(1.01);
    z-index: -1;
}

h1 {
    margin-bottom: 0px;
    font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    letter-spacing: 0px;
    font-size: 40px;
    line-height: 1;
    font-weight: Bold;
    color:rgb(233, 78, 27);

}

.Subtitle {
    font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    letter-spacing: 0px;
    font-size: 40px;
    line-height: 1;
    font-weight: Bold;
    color:rgb(228, 133, 24);

}

/* ======== PREGUNTA ======== */

h2 {
    margin-bottom: 0px;
    font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    font-size: 30px;
    line-height: 1;
    color: rgb(88, 87, 87);
    font-weight: Bold;
}

/* ======== BARRA DE PROGRESO ======== */

#progress-container {
    padding: 6px;
    width: 30%;
    height: 25px;
    background: rgba(255, 255, 255, 0.5);
    margin: 20px auto;
    overflow: visible;
    border: 1px solid rgba(244, 152, 44, 0.75);
    border-radius: 15px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
    
}

#progress-bar {
    position: relative;
    height: 100%;
    width: 100%;
    border-radius: 15px;
    background: linear-gradient(to right, #f4982c, #e94e1b);
    box-shadow: 0 0 8px 1px rgb(255, 255, 255) inset;
    transition: width 0.3s ease;
    z-index: 1;

}

#progress-bar::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -12px;
    width: 25px;
    height: 25px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: linear-gradient(to right, #f4982c, #e94e1b);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.35);
    transform: translateY(-50%);
    z-index: 2;
    

}

/* ======== SILUETA ======== */

#silhouette-card {
    width: 550px;
    height: 5%;
    margin: 40px auto;
    background-image: url("fotos/Background.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;    
    box-shadow: 0px 5px 10px 0px rgba(100, 178, 134, 0.9);
    justify-content: center;
    align-items: center;

}

#silhouette {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.8;
}

/* ======== OPCIONES ======== */

.options {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 40px;

}

.option {
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    overflow: hidden;
    background: #f3f3f3;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.option img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.option:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(244, 152, 44, 0.9);
}

/* ======== MENSAJE ======== */

#message {
    font-size: 50px;
    margin-top: 20px;
    font-weight: bold;
}

.feedback-incorrect {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 5;
    margin: 0;
    transform: translate(-50%, -50%);
    font-size: clamp(42px, 8vw, 76px);
    white-space: nowrap;
}

/* ======== BOTÓN SIGUIENTE ======== */

#nextBtn {
    margin-top: 5px;
    padding: 10px 30px;
    font-size: 15px;
    border: none;
    box-shadow: 5px 5px 5px 0px rgba(100, 178, 134, 0.2);
	background:linear-gradient(to bottom, #ededed 5%, #bab1ba 100%);
	background-color:#ededed;
    border-radius: 25px;
    cursor: pointer;
    display: none;
}

#nextBtn:hover {
    background:linear-gradient(to bottom, #bab1ba 5%, #ededed 100%);
	background-color:#bab1ba;
}

/* ======== PANTALLA FINAL ======== */

#final-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-size: 35px;
    font-weight: bold;
    color: rgb(0,0,0);
    z-index: 10;
    overflow: hidden;
}

#final-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("fotos/Welcomeimage.png") center / cover no-repeat;
    filter: blur(5px);
    opacity: 0.1;
    z-index: -1;
}

#final-score {
    white-space: pre-line;
}

/* CLAVE: esto permite ocultar la pantalla final */
.hidden {
    display: none !important;
}

@media (max-width: 760px) {
   body {
        padding: 8px 18px;
    }

    #welcome-screen {
        position: relative;
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 34px 0 42px;
    }

    .welcome-copy {
        padding: 0;
    }

    .welcome-logo {
        position: absolute;
        top: 42px;
        left: 12px;
        width: 64px;
        height: 64px;
        z-index: 1;
    }

    .welcome-image {
        width: 100%;
        aspect-ratio: 1 / 1;
        min-height: 0;
        order: -1;
    }

    #welcome-screen h1 {
        font-size: 40px;
    }
}

/* ======== BOTÓN REINICIAR ======== */

#restartBtn {
    padding: 12px 24px;
    font-size: 20px;
    border: none;
    box-shadow: 5px 5px 5px 0px rgba(100, 178, 134, 0.2);
	background:linear-gradient(to bottom, #ededed 5%, #bab1ba 100%);
	background-color:#ededed;
    border-radius: 25px;
    cursor: pointer;
}

#restartBtn:hover {
    background:linear-gradient(to bottom, #bab1ba 5%, #ededed 100%);
	background-color:#bab1ba;
}

/* ======== CONFETI ======== */

#confetti-canvas {
    display: none;
    position: fixed;     /* ← IMPORTANTE */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;       /* ← PARA QUE SE VEA */
    }

/* ======== Correct Animal ======== */

#correct-animal {
    margin-top: 0px;
}

#correct-img {
    width:550px;
    height: 550px;
    object-fit: contain;
    margin-bottom: -100px;
}

#correct-photo-btn {
    display: block;
    margin: 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

#correct-photo-btn:focus-visible,
#close-photo-btn:focus-visible {
    outline: 4px solid chocolate;
    outline-offset: 4px;
}

#photo-zoom-hint {
    margin: 0 0 24px;
    color: #000000;
    font-size: 12px;
    font-style: italic;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#photo-zoom-hint img {
    width: 20px;
    height: 20px;
    margin-right: 4px;
    vertical-align: -5px;
    object-fit: contain;
}

/* ======== Zoom de la foto correcta ======== */

#photo-modal {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 44vw) minmax(220px, 360px);
    grid-template-rows: 1fr auto;
    justify-content: center;
    align-items: center;
    column-gap: 20px;
    row-gap: 0;
    padding: 30px;
    background: linear-gradient(rgba(0, 0, 0, 0.95), rgba(8, 8, 8, 0.95));
    z-index: 10000;
}

#photo-viewport {
    grid-column: 1;
    grid-row: 1;
    width: min(44vw, 650px);
    height: min(70vh, 720px);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: default;
}

#photo-viewport:active {
    cursor: grabbing;
}

#photo-viewport.is-zoomed {
    cursor: grab;
}

#photo-viewport.is-zoomed:active {
    cursor: grabbing;
}

#zoomed-photo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center;
    user-select: none;
    touch-action: none;
    cursor: zoom-in;
}

#photo-viewport.is-zoomed #zoomed-photo {
    cursor: grab;
}

#photo-viewport.is-zoomed:active #zoomed-photo {
    cursor: grabbing;
}

#close-photo-btn {
    position: absolute;
    top: 75px;
    right: 75px;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgb(100, 178, 134);
    color: rgb(255, 255, 255);
    cursor: pointer;
    font-size: 34px;
    font-weight: bold;
    line-height: 1;
}

#photo-controls {
    grid-column: 1;
    grid-row: 2;
    position: static;
    justify-self: center;
    transform: translateY(-10px);
    display: flex;
    align-items: center;
    gap: 20px;
}

#photo-help {
    grid-column: 2;
    grid-row: 1;
    position: static;
    pointer-events: none;
    width: min(28vw, 360px);
    max-height: none;
    margin: 0;
    overflow: visible;
    box-sizing: border-box;
    font-size: clamp(14px, 1.3vw, 24px);
    font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    letter-spacing: 0;
    line-height: 1.25;
    font-weight: light;
    color:rgb(255, 255, 255);
    text-align: left;
    white-space: pre-line;
    transform: translateX(-min(30vw, 400px));
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#photo-help .photo-name,
#photo-help .photo-scientific,
#photo-help .photo-description {
    display: block;
}

#photo-help .photo-name {
    color: rgb(100, 178, 134);
    font-size: 1.15em;
    font-weight: bold;
}

#photo-help .photo-scientific {
    margin-top: 4px;
    font-size: 0.7em;
    color: rgb(100, 178, 134);
}

#photo-help .photo-description {
    margin-top: 18px;
}
#photo-controls button {
    min-width: 44px;
    height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: 20px;
    background: rgb(100, 178, 134);
    color: rgb(255, 255, 255);
    cursor: pointer;
    font: inherit;
    font-weight: bold;
}

#photo-controls button:hover {
    color: rgb(0, 0, 0);
    background: rgb(244, 152, 44);
}

#correct-name {
    font-size: 35px;
    font-weight: bold;
    margin-top: 100px;
    color:rgb(0, 0, 0);
}

#correct-scientific {
    font-size: 20px;
    font-style: italic;
    font-weight: light;
    margin-top: -40px;
    color:rgb(0, 0, 0);
}

/* ======== Animation Animal ======== */

.correct-zoom {
    animation: zoomIn 0.4s ease forwards;
}

@keyframes zoomIn {
    from {
        transform: scale(0.25);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ======== Animation Animal ======== */

.correct-zoom {
    animation: zoomIn 0.4s ease forwards;
}

@keyframes zoomIn {
    from {
        transform: scale(0.25);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 760px) {
    #photo-modal {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        row-gap: 4px;
    }

    #correct-img {
        width: 90vw;
        height: 60vh;
    }

    #correct-animal {
        margin-top: 40px;
    }

    #photo-viewport {
        grid-column: 1;
        grid-row: 1;
        width: 94vw;
        height: 62vh;
    }

    #close-photo-btn {
        top: 16px;
        right: 16px;
        z-index: 2;
    }

    #photo-controls {
        grid-column: 1;
        grid-row: 3;
        position: static;
        justify-self: center;
        transform: translateY(-4px);
        gap: 10px;
        z-index: 2;
    }

    #photo-help {
        grid-column: 1;
        grid-row: 2;
        position: static;
        width: calc(100% - 32px);
        max-height: none;
        margin-top: 4px;
        font-size: clamp(12px, 3.2vw, 17px);
        letter-spacing: 0;
        text-align: left;
    }

    #photo-zoom-hint {
        width: calc(100% - 32px);
        margin: 28px auto 24px;
        font-size: 10px;
        text-align: center;
    }

}
/*
#site-footer {
    position: absolute;
    bottom: -350px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 8px 20px;
    box-sizing: border-box;
    background: rgba(42, 67, 20, 0.5);
    z-index: 0;
}
*/
#site-footer-logo {
    width: 60px;
    height: auto;
    object-fit: contain;
}

@media (max-width: 760px) {
    #site-footer {
        position: static;
        width: 100%;
        margin-top: 28px;
    }

    #close-photo-btn {
        position: absolute;
        inset: 16px 16px auto auto;
        z-index: 10001;
    }
}

@media (max-width: 760px) {
    #game-screen {
        width: 100%;
        overflow-x: hidden;
    }

    #game-screen h1,
    #final-screen h1 {
        font-size: clamp(20px, 6vw, 32px);
        letter-spacing: 0;
    }

    #game-screen .Subtitle {
        font-size: inherit;
    }

    #game-screen h2 {
        font-size: clamp(16px, 4vw, 20px);
        line-height: 1.2;
    }

    #progress-container {
        width: min(72%, 280px);
        height: 18px;
        margin: 12px auto 18px;
    }

    #progress-bar::after {
        right: -9px;
        width: 15px;
        height: 15px;
        border-width: 2px;
    }

    #silhouette-card {
        width: min(100%, 360px);
        height: auto;
        aspect-ratio: 1;
        margin: 14px auto;
    }

    .options {
        width: min(100%, 320px);
        margin-left: auto;
        margin-right: auto;
        gap: 8px;
        margin-top: 14px;
        display: flex;
        flex-wrap: nowrap;
    }

    .option {
        width: auto;
        flex: 1 1 0;
        min-width: 0;
        height: auto;
        aspect-ratio: 1;
    }

    #message {
        margin: 14px 0;
        font-size: clamp(28px, 9vw, 42px);
    }

    .feedback-incorrect {
        margin: 0;
        font-size: clamp(36px, 12vw, 58px);
    }

    #correct-animal {
        margin-top: -20px;
    }

    #correct-img {
        width: min(90vw, 550px);
        height: auto;
        max-height: 55vh;
        margin-bottom: 0px;
    }

    #correct-name {
        margin: -10px 0 0;
        font-size: clamp(24px, 7vw, 35px);
        line-height: 1.1;
    }

    #correct-scientific {
        margin: -5px 0 0;
        font-size: clamp(16px, 4vw, 20px);
    }

    #nextBtn {
        margin: 12px auto 0;
    }

    #final-screen {
        padding: 24px;
        box-sizing: border-box;
        font-size: 24px;
    }

    #photo-modal {
        padding: 16px;
    }

    #photo-viewport {
        width: 100%;
        height: 62vh;
    }

    #photo-help {
        width: 100%;
        transform: none;
    }
}