﻿* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; -webkit-user-select: none; }

body { 
    background-color: #1b263b; 
    color: #fff; 
    font-family: sans-serif; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    height: 100vh; 
    height: 100dvh; 
    overflow: hidden; 
    touch-action: none; 
}

#game-container { 
    position: relative; 
    width: 100%; 
    max-width: 420px; 
    height: 92vh; 
    height: 92dvh; 
    border: 4px solid #415a77; 
    border-radius: 16px; 
    overflow: hidden; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); 
    touch-action: none; 
}

canvas {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain; /* Esto evita que la imagen se estire o deforme, adaptándose al espacio */
    display: block;
    margin: 0 auto;
    image-rendering: pixelated;
    touch-action: none;
}
/* 1. El contenedor general de la interfaz o menús */
#ui-overlay, .menu-overlay {
    pointer-events: auto;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.404); /* Tu fondo semitransparente */
    backdrop-filter: blur(4px); /* Difumina la laguna */
    z-index: 10;
    padding: 20px;
}

/* 2. Los botones individuales (¡Tamaño normal y clickeables!) */
button {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 999 !important;
    position: relative;
    padding: 12px 24px; /* Tamaño natural de un botón */
    border-radius: 8px;
    font-weight: bold;
    border: none;
    background: #ffb703; /* Color propio del botón */
    color: #1d3557;
    /* QUITAMOS el width: 100%, height: 100% y el display flex de aquí para que no se deformen */
}

h1 { 
    font-size: 2rem; 
    margin-bottom: 8px; 
    color: rgb(238, 167, 13); 
    text-align: center; 
    text-shadow: 2px 2px rgba(7, 7, 7, 0.986);
}

.user-tag { 
    font-size: 0.95rem; 
    color: #ffffff; 
    margin-bottom: 12px; 
}

.user-tag span { 
     color: rgb(238, 167, 13); 
    font-weight: bold; 
    cursor: pointer; 
    text-decoration: underline; 
}

#leaderboard { 
    width: 100%; 
    max-width: 300px; 
    background: rgba(27, 38, 59, 0.9); 
    border: 2px solid #ffb703; 
    border-radius: 12px; 
    padding: 12px; 
    margin-bottom: 16px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#leaderboard h3 { 
    font-size: 1rem; 
    color: #ffb703; 
    text-align: center; 
    margin-bottom: 8px; 
}

#leaderboard ol { 
    padding-left: 20px; 
    font-size: 0.9rem; 
    color: #e0e1dd; 
}

#leaderboard li { 
    margin-bottom: 4px; 
}

#start-btn { 
    padding: 14px 36px; 
    font-size: 1.1rem; 
    font-weight: bold; 
    background: linear-gradient(135deg, #f0c140, #ffb703); 
    color: white; 
    border: none; 
    border-radius: 30px; 
    cursor: pointer; 
    box-shadow: 0 6px 12px rgba(0,0,0,0.3); 
    z-index: 11; 
}

/* 🟡 Modal de inicio de sesión con la misma sintonía visual */
#login-modal { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(40, 30, 5, 0.88); 
    backdrop-filter: blur(4px);
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    z-index: 20; 
    padding: 20px; 
}

#login-modal h2 { 
    color: #76c893; 
    margin-bottom: 12px; 
    text-shadow: 2px 2px rgba(0,0,0,0.6);
}

#username-input { 
    padding: 12px 16px; 
    font-size: 1rem; 
    border-radius: 20px; 
    border: 2px solid #ffb703; 
    outline: none; 
    background: #1b263b; 
    color: #fff; 
    text-align: center; 
    margin-bottom: 16px; 
    width: 80%; 
    z-index: 21; 
}

#save-user-btn { 
    padding: 12px 28px; 
    font-size: 1rem; 
    font-weight: bold; 
    background: #ffb703; 
    color: #0d1b2a; 
    border: none; 
    border-radius: 20px; 
    cursor: pointer; 
    z-index: 21; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}