/* --- Estilos Generales y Reseteo --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #2c3e50; /* Fondo oscuro moderno */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

/* --- Contenedor Principal --- */
.game-container {
    background-color: #34495e;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    text-align: center;
    width: 350px;
}

/* --- Cabecera (Puntaje y Tiempo) --- */
.game-header {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
    color: #ecf0f1;
    margin-bottom: 20px;
}

/* --- Cuadrícula de Agujeros --- */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columnas iguales */
    gap: 15px;
    margin-bottom: 20px;
}

/* --- Estética del Agujero --- */
.hole {
    width: 90px;
    height: 90px;
    background-color: #1a252f; /* Simula la profundidad del agujero */
    border-radius: 50%;
    overflow: hidden; /* Oculta al topo cuando está dentro */
    position: relative;
    box-shadow: inset 0 8px 12px rgba(0,0,0,0.6);
}

/* --- Estética Dinámica del Topo --- */
.mole {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom; /* Ancla la base al fondo del agujero */
    
    position: absolute;
    top: 100%; 
    transition: top 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.hole.up .mole {
    top: -10px;
}

.mole:active {
    transform: scale(0.9) rotate(5deg);
}/* Clase que activará JavaScript para mostrar el topo */
.hole.up .mole {
    top: 0; /* Sube y se hace visible */
}


/* --- Contenedor del Cursor --- */
.hammer {
    position: fixed;
    width: 60px;
    height: 60px;
    pointer-events: none; /* Crucial para que los clics atraviesen el martillo */
    z-index: 1000;
    display: block;
    /* Esto alinea la esquina superior izquierda del div EXACTAMENTE con la punta del mouse */
    transform: translate(-50px, -30px); 
}

/* --- La Imagen del Martillo --- */
.hammer-img {
    width: 100%;
    height: 100%;
    background-image: url('martillo.png');
    background-size: contain;
    background-repeat: no-repeat;
    
    /* El mango o la parte inferior se convierte en el eje de rotación */
    transform-origin: bottom left; 
    transform: rotate(35deg); /* Posición inicial levantado */
    transition: transform 0.05s ease-in-out;
}

/* --- Animación de Golpe hacia la Izquierda --- */
.hammer.swing .hammer-img {
    transform: rotate(-25deg); /* Rota hacia la izquierda al golpear */
}

/* --- Botones de Control --- */
#start-btn, #restart-btn {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

#start-btn:hover, #restart-btn:hover {
    background-color: #27ae60;
}

/* --- Ventana Modal (Game Over) --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none; /* Oculta el modal por defecto */
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    width: 280px;
}

.modal-content h2 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.modal-content p {
    margin-bottom: 20px;
    font-size: 1.1k;
    color: #555;
}


/* --- Estilos para la Imagen de Resultado en Game Over --- */
.result-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
}

#result-img {
    width: 120px;
    height: 120px;
    object-fit: contain; /* Evita que la imagen se deforme */
    display: block;      /* Asegura que el navegador la renderice como elemento visible */
}

body {
    /* Reemplazamos el color plano por tu imagen de fondo */
    background-image: url('fondo.png');
    background-size: cover;          /* Estira la imagen para cubrir toda la pantalla sin deformar proporciones */
    background-position: center;     /* Centra la imagen en cualquier tamaño de pantalla */
    background-repeat: no-repeat;    /* Evita que la imagen se repita como mosaico */
    
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

.game-container {
    background-color: rgba(52, 73, 94, 0.85); /* El último número (0.85) le da un 15% de transparencia */
    backdrop-filter: blur(5px);                 /* Opcional: difumina ligeramente lo que está detrás */
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    text-align: center;
    width: 350px;
}
/* --- Estilos para la Cabecera del Juego --- */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

/* Estilo del Logo */
.game-logo {
    width: 50px;  /* Ajusta el tamaño según prefieras (ej. 50px o 60px) */
    height: 50px;
    object-fit: contain; /* Evita que el logo se deforme */
}

/* Estilos previos del marcador y tiempo para mantener la armonía */
.score-board, .timer-board {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}