/* ======== 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, #d7d7d7 0%, #d8d7d7 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 {
    padding: 16px 23px;
    border: none;
    border-radius: 25px;
    box-shadow: 0px 5px 5px -7px #f4982c;
    background:linear-gradient(to bottom, #ededed 5%, #bab1ba 100%);
	background-color:#ededed;
    cursor: pointer;
    font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    font-size: 15px;
    font-weight: bold;
    transition: background 0.2s ease, transform 0.2s ease;
}

#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%, 750px);
    aspect-ratio: 1 / 1;
    min-height: 0;
    background: url("fotos/Welcomeimage.png") center / contain no-repeat;
}

.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 {
    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(244, 152, 44);
}


#game-screen #Title {
    color:rgb(1, 190, 42); !important;
}

#game-screen .Subtitle {
    font-size: 40px;
}


.question-box {
    box-sizing: border-box;
    width: min(100%, 900px);
    margin: 50px auto 0;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    background: #ededed;
    background: linear-gradient(180deg, rgba(223, 245, 235, 0.99), rgba(181, 191, 187, 0.75));
    border-radius: 14px;
    border: 4px solid rgba(100, 178, 134, 0.9);
    padding: 10px 10px;
}

h2 {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    text-align: center;
    font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    font-size: 22px;
    line-height: 1.25;
    color: rgb(255, 255, 255);
    font-weight: Bold;
}

#SubtitleAnimals {
    
    font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    letter-spacing: 0px;
    font-size: 30px;
    line-height: 1;
    font-weight: Bold;
    color:rgb(100, 178, 134);
}


#question {
    font-size: 20px;
    color: rgb(0, 0, 0);
    font-weight: lighter;
    padding: 10px;

}
    

/* ======== 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 rgb(100, 178, 134);
    border-radius: 15px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25),
    0 1px rgba(255, 255, 255, 0.08);
    
}

#progress-bar {
    position: relative;
    height: 100%;
    width: 100%;
    border-radius: 15px;
    background: linear-gradient(to right, #52f401, #40ad01);
    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, #52f401, #40ad01);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.35);
    transform: translateY(-50%);
    z-index: 2;
    

}

/* ======== OPCIONES ======== */

.options {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: nowrap;
    margin: 0 auto;
    max-width: 1300px;
}

.option {
    width: calc(25% - 15px);
    min-width: 0;
    height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    padding: 5px;
    border: 4px solid rgba(100, 178, 134, 0.9);
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(9, 34, 22, 0.82), rgba(20, 65, 48, 0.75));
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
}

.option::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 10px;
    background: var(--option-bg, rgba(255, 255, 255, 0.15));
    background-size: cover;
    background-position: center;
    filter: blur(1px) saturate(0.9);
    opacity: 0.3;
    z-index: 0;
}

.option img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 430px;
    min-height: 430px;
    max-height: 430px;
    aspect-ratio: 3 / 5;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
    box-shadow: 0 12px 22px rgba(0, 30, 5, 0.75);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: block;
    flex-shrink: 0;
}

.option span {
    position: relative;
    z-index: 1;
}

.option input {
    position: relative;
    z-index: 1;
}

.option-text {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    min-height: 72px;
    margin-top: auto;
    margin-bottom: 25px;
    text-align: center;
    padding: 0 8px;
    box-sizing: border-box;
}

.option span {
    display: block;
    width: 100%;
    min-height: 1.1em;
    color: #fbfbfb;
    font-size: 22px;
    font-weight: bold;
    line-height: 1.2;
    text-align: center;
}

.option-scientific {
    color: rgb(255, 255, 255);
    font-size: 15px;
    font-style: italic;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.option input {
    appearance: none;
    display: block;
    width: 40px;
    height: 40px;
    min-width: 35px;
    min-height: 35px;
    margin: 0 auto;
    flex-shrink: 0;
    align-self: center;
    transform: translateY(-30px);
    border: 3px solid rgb(100, 178, 134);
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
}

.option input:checked {
    background: rgb(146, 178, 100);
    box-shadow: inset 0 0 0 6px #ffffff;
}

.option:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 14px 32px rgba(132, 255, 0, 0.5), 0 0 0 1px rgba(231, 244, 44, 0.95);
    border-color: rgba(132, 255, 0, 0.5);
}

/* ======== MENSAJE ======== */

#message {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    margin: 20px auto 10px;
    font-size: 50px;
    font-weight: bold;
    line-height: 1.2;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
}

#message.status-correct {
    color: #096c00;
}

#message.status-incorrect {
    color: #d32f2f;
}

/* ======== 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);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    z-index: 10;
    overflow: hidden;
}

#final-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("fotos/Welcomeimage.jpg") center / cover no-repeat;
    filter: blur(4px);
    opacity: 0.15;
    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 {
        min-height: auto;
        gap: clamp(12px, 4vw, 16px);
        padding: 24px 0;
    }

    #welcome-screen .eyebrow {
        margin-bottom: 12px;
        font-size: clamp(15px, 4vw, 20px);
        letter-spacing: clamp(1px, 0.5vw, 2px);
    }

    .welcome-logo {
        position: absolute;
        top: 42px;
        left: 12px;
        width: 64px;
        height: 64px;
        z-index: 1;
    }

    .welcome-image {
        width: min(100%, 480px);
    }

    #welcome-screen h1 {
        font-size: clamp(28px, 8.5vw, 40px);
    }

    #welcome-screen .Subtitle {
        font-size: clamp(22px, 6vw, 32px);
    }

    #welcome-screen .welcome-text {
        padding: 0 8px;
        font-size: clamp(16px, 4.5vw, 19px);
        letter-spacing: 1px;
    }
}

/* ======== 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;
    }
}

@media (max-width: 760px) {

    #photo-modal {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        row-gap: 4px;
    }

     #game-screen .Subtitle {
        font-size: 18px;
    }
    
    #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);
        margin-top: 4px;
        font-size: clamp(12px, 3.2vw, 17px);
        letter-spacing: 0;
        text-align: left;
        transform: none;
    }

    #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(25px, 7vw, 40px);
        letter-spacing: -1px;
    }

    #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;
    }

    .options {
        width: min(100%, 700px);
        margin-left: auto;
        margin-right: auto;
        gap: 12px;
        margin-top: 0px;
        display: flex;
        flex-wrap: wrap;
    }

    .option {
        width: 100%;
        flex: 0 1 100%;
        min-width: 0;
        height: auto;
        min-height: 0;
        aspect-ratio: 1 / 1;
        display:grid;   
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto 28px;
        justify-items: center;
        gap: 10px;
        padding: 15px;
        box-sizing: border-box;
    }

    .option::before {
        inset: 8px;
    }

    .option img {
        width: 100%;
        max-width: 320px;
        height: 100%;
        min-height: 0;
        max-height: none;
        justify-self: center;
        object-fit: cover;
        object-position: center;
        box-shadow: 0 8px 18px rgba(0, 30, 5, 0.6);

    }

    .option-text {
        gap: 1px;
        min-height: 0;
        justify-self: center;
        margin: 0;
        padding: 0 2px;
    }

    .option span {
        min-height: 1em;
        font-size: clamp(12px, 3.8vw, 15px);
        line-height: 1.15;
    }

    .option-scientific {
        font-size: 11px;
    }

    .option input {
        width: 10px;
        height: 10px;
        margin: 0 auto;
        justify-self: center;
        border-width: 2px;
        transform: none;
    }

    #message {
        margin: 14px 0;
        font-size: clamp(28px, 9vw, 42px);
    }

    #correct-animal {
        margin-top: -20px;
    }

    #correct-img {
        display: block;
        box-sizing: border-box;
        width: min(90vw, 550px);
        height: auto;
        max-height: 55vh;
        object-fit: contain;
        margin: 0 auto;
        padding: 20px;
    }

    #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: 94vw;
        height: 62vh;
    }

    #photo-help {
        position: static;
    }
}

.option:has(input:checked) {
    border-color: #e94e1b;
    box-shadow: 0 4px 12px rgb(244, 152, 44);
}