html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed; /* Evita que la página intente desplazarse vertical u horizontalmente */
    touch-action: none; /* Desactiva zoom táctil nativo del celular */
    user-select: none;
    -webkit-user-select: none;
    overscroll-behavior: none; /* Bloquea el efecto rebote por completo */
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Arial', Helvetica, sans-serif;
    background-color: #111;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* HUD */
#hud {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 99;
}

.hud-item {
    background: rgba(0, 0, 0, .8);
    color: white;
    padding: 12px 24px;
    border-radius: 14px;
    font-size: 20px;
    font-weight: bold;
    backdrop-filter: blur(5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
}

/* POPUPS LIMPIOS Y ADAPTABLES */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.popup.active {
    opacity: 1;
    pointer-events: auto;
}

.popup-content {
    background: white;
    padding: 30px;
    border-radius: 24px;
    width: 95%;
    max-width: 520px; 
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scaleUp {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.popup-banner {
    width: 100%;
    max-height: 320px; 
    object-fit: contain;
    border-radius: 12px;
}

/* FORMULARIOS DE REGISTRO */
#sorteo-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

#sorteo-form input {
    width: 100%;
    padding: 14px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

#sorteo-form input:focus {
    border-color: #ff4757;
}

/* BOTONES ARCADE */
.btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
}

.btn:hover {
    background: #ff6b81;
}

.btn:active {
    transform: scale(0.97);
}

.btn-submit {
    background: #2ed573;
    box-shadow: 0 5px 15px rgba(46, 213, 115, 0.4);
}

.btn-submit:hover { 
    background: #52e085; 
}

/* RESPONSIVE Mﾃ天IL */
@media(max-width: 768px){
    #hud { gap: 6px; top: 10px; }
    .hud-item { font-size: 16px; padding: 10px 16px; }
    .popup-content { padding: 20px; width: 92%; gap: 15px; }
    .popup-banner { max-height: 240px; }
    .btn { padding: 14px 20px; font-size: 16px; }
}