@import url('https://fonts.googleapis.com/css2?family=Supermercado+One&display=swap');

* {
    color: white;
    user-select: none;
    font-family: "Supermercado One", sans-serif;
    font-weight: 400;
    font-style: normal;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: rgb(0, 0, 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 16px;
}

h1 {
    color: white;
    text-align: center;
    font-size: 2rem;
    margin-bottom: 12px;
    letter-spacing: 2px;
    text-shadow: 0 0 12px rgba(255,100,100,0.6);
}

/* ── Contenedor principal tipo dispositivo ── */
.pantalla {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 420px;
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid rgb(184, 28, 61);
    border-radius: 24px;
    padding: 16px;
    gap: 14px;
    box-shadow: 0 0 30px rgba(184, 28, 61, 0.4), inset 0 0 20px rgba(0,0,0,0.5);
}

/* ── Canvas / Pantalla del tamagotchi ── */
#teto {
    background-color: #d4e8c2;
    border-radius: 12px;
    border: 4px solid #333;
    width: 100%;
    max-width: 360px;
    display: block;
    box-shadow: inset 0 0 12px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.6);
}

/* ── Stats ── */
.stats {
    display: flex;
    justify-content: space-around;
    width: 100%;
    font-size: 0.85rem;
    padding: 0 4px;
}

.stats span { color: #ddd; }

/* ── Fila de 2 botones ── */
.buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.buttons2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

/* ── Botón central largo ── */
.btn-center-wrap {
    width: 55%;
    display: flex;
    justify-content: center;
}

#btnDormir {
    width: 100%;
    background: linear-gradient(135deg, rgb(120, 15, 45), rgb(184, 28, 61));
    border: 2px solid rgba(255,100,100,0.3);
    border-radius: 30px;
    padding: 10px 0;
    font-size: 1rem;
    cursor: pointer;
    letter-spacing: 1px;
    box-shadow: 0 4px 14px rgba(184, 28, 61, 0.6);
    transition: transform 0.1s, box-shadow 0.1s;
}

#btnDormir:active {
    transform: scale(0.96);
    box-shadow: 0 2px 6px rgba(184, 28, 61, 0.3);
}

/* ── Botones de acción ── */
.one, .two, .three, .four,
.one1, .two2, .three3, .four4 {
    background: linear-gradient(135deg, rgb(140, 20, 50), rgb(184, 28, 61));
    border-radius: 16px;
    border: 2px solid rgba(255,100,100,0.2);
    padding: 12px 8px;
    text-align: center;
    font-size: 0.9rem;
    cursor: pointer;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(184, 28, 61, 0.4);
    transition: transform 0.1s, box-shadow 0.1s;
    width: 100%;
}

.one:hover, .two:hover, .three:hover, .four:hover,
.one1:hover, .two2:hover, .three3:hover, .four4:hover,
#btnDormir:hover {
    box-shadow: 0 6px 18px rgba(184, 28, 61, 0.7);
    border-color: rgba(255,120,120,0.5);
}

.one:active, .two:active, .three:active, .four:active,
.one1:active, .two2:active, .three3:active, .four4:active {
    transform: scale(0.95);
}



#btnReiniciar {
    margin-top: 16px;
    padding: 10px 20px;
    font-size: 1rem;
    background: linear-gradient(135deg, rgb(120, 15, 45), rgb(184, 28, 61));
    border: 2px solid rgba(255,100,100,0.3);
    border-radius: 30px;
    color: white;
    cursor: pointer;
    letter-spacing: 1px;
    box-shadow: 0 4px 14px rgba(184, 28, 61, 0.6);
    transition: transform 0.1s, box-shadow 0.1s;

}

.contenedor {
    width: 920px;
    height: 280px;
    margin: 0 auto;
    
    position: relative;

    background: linear-gradient(#b7d6c7, transparent) #ffe2d1;/*linear-gradient(#90ebff, white);*/
    transition: background-color 1s linear;
    overflow: hidden;
}

.mediodia {
    background-color: #ffdcf3;
}

.tarde {
    background-color: #ffadad;
}

.noche {
    background-color: #aca8c7;
}

.dino {
    width: 84px;
    height: 84px;

    position: absolute;
    bottom: 22px;
    left: 42px;
    z-index: 2;

    background: url("./tetoplush.png") repeat-x 0px 0px;
    background-size: 336px 84px;
    background-position-x: 0px;

}

.dino-corriendo {
    animation: animarDino 0.25s steps(2) infinite;
}
.dino-estrellado {
    background-position-x: -252px;
}

.suelo {
    width: 200%;
    height: 42px;

    position: absolute;
    bottom: 0;
    left: 0;

    background: url("./suelo.png") repeat-x 0px 0px;
    background-size: 50% 42px;

}

.cactus{
    width: 46px;
    height: 96px;

    position: absolute;
    bottom: 16px;
    left: 600px;
    z-index: 1;

    background: url("./cactus1.png") no-repeat;
}
.cactus2{
    width: 98px;
    height: 66px;

    background: url("./cactus2.png") no-repeat;
}

.nube{
    width: 92px;
    height: 26px;

    position: absolute;
    z-index: 0;

    background: url("./nube.png") no-repeat;
    background-size: 92px 26px;
}

.score{
    width: 100px;
    height: 30px;

    position: absolute;
    top: 5px;
    right: 15px;
    z-index: 10;

    color: #d48871;
    font-family: Verdana;
    font-size: 30px;
    font-weight: bold;
    text-align: right;
}

.game-over{
    display: none;

    position: absolute;
    width: 100%;


    text-align: center;
    color: #7e928b;
    font-size: 30px;
    font-family: Verdana;
    font-weight: 700;
}

@keyframes animarDino{
    from{
        background-position-x: -84px;
    }
    to{
        background-position-x: -252px;
    }
}

@media screen and (max-width: 700px) {
    .contenedor {
    width: 400px;
    height: 280px;
    margin: 0 auto;
    
    position: relative;

    background: linear-gradient(#b7d6c7, transparent) #ffe2d1;/*linear-gradient(#90ebff, white);*/
    transition: background-color 1s linear;
    overflow: hidden;
}
}

.fotocontenedor{
    display: grid;
    place-items: center;
    margin-top: 8rem;
    position: relative;
}

.contenedorlogo{
  

    
}

#img1{
    --size:290px;

        width: var(--size);
        height: 360px;
        transform: translateY(1%) rotate(-5deg);
}

.loading{
    background-color: rgb(43, 43, 43);
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    mix-blend-mode: hard-light;
    animation: loading 9s linear 1 forwards;
}


@keyframes loading {
    0%{
        height: 100%;
    }

    100%{
        height: 0%;
    }
}

#apagado{
    display: none;
    text-align: center;
}