@import url('https://fonts.googleapis.com/css2?family=Oooh+Baby&display=swap');

header {
    display: none;
}

#puerta-mansion {
    position: relative;
    text-align: center;
    width: 100%;
    min-height: 400px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover; 
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

#puerta-mansion::before {
    content: '';
    background-image: url('../images/puerta.jpg');
    background-size: cover;
    background-position: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 2s ease-in-out;
}

#puerta-mansion.zoom::before {
    transform: scale(3);
}

#entrada{
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0;
}

.show {
    animation: show 1s ease-in-out forwards;
}

#detector__container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#detector {
    background: none;
    position: absolute;
    left: 5%;
    top: 10%;
    width: 5%;
    min-width: 70px;
    padding: 0;
    cursor: grab;
}

#keyGlow {
    position: absolute;
    top: -10px;
    left: 80%;
    width: 20px;
    filter: drop-shadow(0 0 0.75rem rgb(255, 217, 0));
    animation: keyGlow 10s ease-in-out infinite;
}

#key {
    cursor: pointer;
    position: absolute;
    bottom: 12%;
    left: 35%;
    width: 3%;
    min-width: 70px;
}

#inventory {
    position: absolute;
    right: 5%;
    bottom: 5%;
    width: min-content;
    opacity: 0;
}

#inventory-key {
    width: 3%;
    min-width: 70px;
}

#key_img {
    opacity: 0.1;
    transition: opacity 1s ease-in-out;
}

#key_img:hover {
    animation: showKey 1s ease-in-out forwards;
}

.glow {
    filter: drop-shadow(0 0 0.5rem rgb(255, 217, 0));
}

#pergamino {
    cursor: pointer;
    position: absolute;
    width: 4%;
    min-width: 70px;
    left: 43.5%;
    top: 48%;
    transform: translate(-50%, -50%);
}

#pergamino_img {
    filter: drop-shadow(0 0 0rem rgb(255, 217, 0));
    animation: blink 2s infinite;
}

#pergamino_img:hover {
    filter: drop-shadow(0 0 0.75rem rgb(255, 217, 0));
    animation: none;
}

#texto-instrucciones {
    cursor: pointer;
}

#texto-instrucciones, #codeContainer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    display: flex;
    align-items: center;
    max-height: 90%;
    max-width: 90%;
    aspect-ratio: 1 / 1;
}

.pergamino__text {
    text-align: center;
    position: relative;
    top: 3%;
    width: 36%;
    margin: auto;
    font-size: 1.3vw;
    line-height: 1.5vw;
    max-height: 40%;
    overflow-y: auto;
    text-wrap-style: balance;
}

.pergamino__text * {
    font-family: "Oooh Baby", serif;
    font-weight: bold;
}
.pergamino__text p {
    margin-bottom: 7%;
}



.pergamino__text a {
    display: block;
    margin: auto;
    padding: 5%;
    width: fit-content;
    text-transform: uppercase;
    color: #000;
    text-decoration: none;
    border: #682c0c 1px solid;
}
    
/* Scroll bar stylings */
.pergamino__text::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

/* Track */
.pergamino__text::-webkit-scrollbar-track {
  background: var(--lightestgrey);
}

/* Handle */
.pergamino__text::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 5px;
}

/* Handle on hover */
.pergamino__text::-webkit-scrollbar-thumb:hover {
  background: #555;
}

#tapa-madera {
    cursor: pointer;
    position: absolute;
    width: 3.5%;
    min-width: 50px;
    left: 66%;
    top: 54.5%;
    transform: translate(-50%, -50%);
}

#botonera {
    cursor: pointer;
    position: absolute;
    width: 2%;
    min-width: 40px;
    left: 66%;
    top: 54.5%;
    transform: translate(-50%, -50%);
}

#controles__overlay {
    cursor: pointer;
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: #0000008a;
}

#controles {
    display: flex;
    flex-wrap: wrap;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-image: url(https://brown-dove-410661.hostingersite.com/wp-content/plugins/desafio-mansion-odisea/images/panel_botones.png);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    width: 15vw;
    height: 15vw;
    min-width: 200px;
    min-height: 200px;
}

#controles > .contoles__button {
    background: none;
    width: 50%;
    max-height: 50%;
}

#controles > .contoles__button:nth-child(1) {
    padding: 0.8vw 0.1vw 0.1vw 0.8vw;
}

#controles > .contoles__button:nth-child(2) {
    padding: 0.8vw 0.8vw 0.1vw 0.1vw;
}

#controles > .contoles__button:nth-child(3) {
    padding: 0.1vw 0.1vw 0.8vw 0.8vw;
}

#controles > .contoles__button:nth-child(4) {
    padding: 0.1vw 0.8vw 0.8vw 0.1vw;
}

#controles > .contoles__button > .button_img {
    transition: all 1s;
}

.pressed {
    animation: pressed 1s forwards;
}

#codeContainer {
    display: none;
}

#code {
    font-size: 1.5vw;
    line-height: 1.7vw;
}

#toggle-mute {
    font-size: 1.5em;
    color: #fff;
    position: absolute;
    top: 10%;
    right: 5%;
    transition: transform 1s;
    text-decoration: none;    
    width: 5%;
    min-width: 80px;
}

#toggle-mute:hover {
    transform: scale(1.1);
}

.fadeIn {
    animation: fadeIn 1s ease-in-out forwards;
}

.fadeOut {
    animation: fadeOut 1s ease-in-out forwards;
}

#credits {
    padding: 20px;
    background: black;
    text-align: center;
}

#show-credits {
    color: #fff;
    font-size: 15px;
    text-decoration: none;
}

#cerrar-creditos {
    background: #fff;
    border-radius: 50%;
    padding: 10px;
    height: 40px;
    width: 40px;
    font-size: 20px;
    line-height: 20px;
    position: absolute;
    right: 20px;
    top: 20px;
    color: #000;
}

#credits__container {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #000;
    padding: 66px 20px 20px;
    color: #fff;
    text-align: left;
    border-radius: 20px;
    max-width: 500px;
}

#credits__container a {
    text-decoration: none;
    color: #FDB713;
}

button, div {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

/* Animaciones */
@keyframes keyGlow {
    0%{
        opacity: 0;
    }
    16.67%  {
        opacity: 1;
    }
    33.34% {
        opacity: 0;
    }
    33.35%, 100% {
        opacity: 0;
    }
}

@keyframes showKey {
    0% {
        opacity: 0.1;
    }
    100% {
        opacity: 1
    }
}

@keyframes blink {
    0%, 100% {
        filter: drop-shadow(0 0 0rem rgb(255, 217, 0));
    }
    50% {
        filter: drop-shadow(0 0 0.75rem rgb(255, 217, 0));
    }
}

@keyframes pressed {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    100% {
        transform: scale(0.9);
        filter: brightness(0.5);
    }
}

@keyframes show {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}
@media (max-width: 1300px) {
    #controles > .contoles__button:nth-child(1) {
        padding: 10px 1px 1px 8px;
    }
    
    #controles > .contoles__button:nth-child(2) {
        padding: 10px 8px 1px 1px;
    }
    
    #controles > .contoles__button:nth-child(3) {
        padding: 1px 1px 10px 8px;
    }
    
    #controles > .contoles__button:nth-child(4) {
        padding: 1px 8px 10px 1px;
    }
}

@media (max-width: 900px) {
    #puerta-mansion{
        aspect-ratio: 9 / 16;
    }
    #puerta-mansion::before {
        background-position: 54%;
    }
    
    #pergamino {
        width: 15%;
        left: 21.5%;
        top: 48%;
        min-width: 50px;
    }
    
    #texto-instrucciones, #codeContainer {
        width: 100%;
        max-height: 100%;
        max-width: 100%;
        transform: scale(1.2);
    }
    
    .pergamino__text {
        font-size: 3vw;
        line-height: 3.2vw;
    }
    
    #detector, #toggle-mute {
        top: 5%;
    }
    
    #botonera, #tapa-madera {
        left: 92%;
    }

    #controles {
        width: 30vw;
        height: 30vw;
        bottom: 16.5%;
    }
    
    #controles > .contoles__button > .button_img {
        transition: all 1s;
    }
    
    #codeContainer {
        width: 100%;
    }

    #code {
        font-size: 4vw;
        line-height: 5vw;
    }

    #credits__container {
        width: 90%;
    }
}