body {
    height: 100dvh;
    margin: 0;
    display: flex;
    flex-direction: column;
    font-family: 'Press+Start+2P', monospace; 
    color: black; 
    background-color: #051926;
    overflow: hidden;
}

header {text-align: center; color: white;}
header h3 {
    font-size: 14px;
    font-weight: normal;
    margin-top: -10px;
    letter-spacing: 1px;
}

#timer {
    font-size: 18px;
    color: #FFD54F;
    margin-top: 3px;
    font-weight: normal;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#game-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0; /* Eliminamos el gap para que no haya grietas en el paisaje */

    margin: 10px;
    
    /* Nueva configuración de fondo */
    background-image: url('../assets/img/river.png'); /* Asegúrate de que la ruta sea correcta */
    background-size: cover;
    background-position: center;
    border-radius: 10px; /* Opcional, para redondear las esquinas del tablero */

}

.shore {
    width: 150px;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    background-color: transparent;
}

#river {
    width: 350px;
    height: 120px;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;  /* ESTA ES LA LÍNEA CLAVE - centra el bote */
    transition: justify-content 0.5s ease-in-out;
}

#boat {
    width: 90px;
    height: 40px;
    background-image: url('../assets/img/boat.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    background-color: transparent;
}

.boat-flipped {
    transform: scaleX(-1);
}

.character-img {
    width: 50px;  /* Ajusta según el tamaño de tu orilla */
    height: 50px;
    object-fit: contain; /* Mantiene la proporción de la imagen */
    image-rendering: pixelated; /* Si tus imágenes son pixel art, esto las mantiene nítidas */
}
.contenedor {
    display: flex;
    justify-content: space-around; 
    width: 100%; 
    max-width: 800px; 
}

button {
    background: linear-gradient(180deg, #8BC34A 0%, #689F38 100%);
    border: 3px solid #558B2F;
    border-radius: 8px;
    padding: 2px 4px;
    font-family: 'Arial Black', sans-serif;
    font-size: 16px;
    color: #FFFFFF;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

#resetBtn{
    background: linear-gradient(180deg, #ff0000 0%, #bd5f01 100%);
    border: 3px solid #8b3a02;
}

button:hover {
    background: linear-gradient(180deg, #9CCC65 0%, #7CB342 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Botón estilo "agua/río" - para acciones secundarias */
.button-water {
    background: linear-gradient(180deg, #4DD0E1 0%, #26C6DA 100%);
    border: 3px solid #0097A7;
}

.button-water:hover {
    background: linear-gradient(180deg, #80DEEA 0%, #4DD0E1 100%);
}

/* Botón estilo "Start" - dorado/destacado */
.button-start {
    background: linear-gradient(180deg, #FFD54F 0%, #FFC107 100%);
    border: 3px solid #FFA000;
    color: #1B3A1F;
    font-size: 20px;
    padding: 16px 40px;
}

.button-start:hover {
    background: linear-gradient(180deg, #FFE082 0%, #FFD54F 100%);
}

/* Botón deshabilitado */
button:disabled {
    background: linear-gradient(180deg, #9E9E9E 0%, #757575 100%);
    border-color: #616161;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Botones de movimiento del juego */
.button-move {
    background: linear-gradient(180deg, #A1887F 0%, #8D6E63 100%);
    border: 3px solid #6D4C41;
    min-width: 120px;
}

.button-move:hover {
    background: linear-gradient(180deg, #BCAAA4 0%, #A1887F 100%);
}

#controls{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    position: relative;
}

/* Botón reiniciar alejado en móvil */
#resetBtn {
    position: fixed;
    bottom: 70px;
    left: 10px;
    z-index: 1000;
}

a {
    text-decoration: none;
    color: inherit;
}

footer {
    text-align: center;
    margin-top: auto;
    padding: 8px;
    font-size: 14px;
    color: #d7d7d7;
}

/* Solo para pantallas mayores a 1024px (Desktop) */
@media screen and (min-width: 1024px) {
    #game-container {
        width: 90%;
        max-width: 1200px;
        height: 500px;
        margin: 30px auto;
        
        background-image: url('../assets/img/riverDesktop.png'); 
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        
        display: flex;
        align-items: center;
        justify-content: space-between;
        border: 4px solid #4a332d;
        border-radius: 12px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.3);
        position: relative;
        overflow: visible; /* Permite que los personajes sobresalgan si es necesario */
    }

    .shore {
        width: 22%;
        height: 90%; /* Reducimos un poco para dar margen arriba y abajo */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 15px; /* Reducimos el gap para que quepan mejor */
        padding: 25px 10px; /* Más padding arriba y abajo */
        background-color: transparent;
        z-index: 2;
    }

    #river {
        width: 56%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: transparent;
        position: relative;
    }

    #boat {
        width: 180px;
        height: 100px;
        background-image: url('../assets/img/boat.png');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Cuando el bote está en la orilla izquierda */
    #river.left {
        justify-content: flex-start;
        padding-left: 5%;
    }

    /* Cuando el bote está en la orilla derecha */
    #river.right {
        justify-content: flex-end;
        padding-right: 5%;
    }

    .character-img {
        width: 75px; /* Reducimos ligeramente el tamaño */
        height: 75px;
        cursor: pointer;
        transition: transform 0.2s ease;
        filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
    }

    .character-img:hover {
        transform: scale(1.1);
    }

    /* Personajes en el bote */
    #boat .character-img {
        width: 50px;
        height: 50px;
    }

    #controls{
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

    /* Restaurar posición normal del botón reiniciar en desktop */
    #resetBtn {
        position: relative;
        bottom: auto;
        left: auto;
    }

header h3{
    font-size: 24px;
}

}