* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    margin: 0;
    padding: 0;
}
body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #14111a;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #1a1625;
}
canvas {
    display: block;
    width: 100%;
    height: 100%;
}
/* HUD Superior */
.hud {
    position: absolute;
    top: 15px;
    left: 15px;
    color: #ffffff;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    pointer-events: none;
    z-index: 10;
    background: rgba(20, 16, 30, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255, 51, 102, 0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.hud-item {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}
.hud-label {
    color: #aa8899;
}
.hud-val {
    color: #ff3366;
    font-weight: bold;
}

/* Botón Pausa */
#btn-pause-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 15;
    background: rgba(20, 16, 30, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}
#btn-pause-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Menús Superpuestos (Inicio, Pausa) */
.screen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 30;
    background: rgba(15, 12, 22, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: opacity 0.3s ease;
}
.screen-overlay.hidden {
    display: none;
    pointer-events: none;
}
.menu-card {
    background: rgba(30, 25, 45, 0.9);
    border: 2px solid #ff3366;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(255, 51, 102, 0.15);
}
.menu-title {
    font-size: 36px;
    margin-bottom: 10px;
    color: #ff3366;
    text-shadow: 0 0 10px rgba(255, 51, 102, 0.5);
    font-weight: 800;
    letter-spacing: 1px;
}
.menu-subtitle {
    font-size: 14px;
    color: #aa8899;
    margin-bottom: 30px;
}
.menu-btn {
    background: #ff3366;
    color: #ffffff;
    border: none;
    padding: 14px 32px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 5px 15px rgba(255, 51, 102, 0.4);
    width: 100%;
    margin-bottom: 15px;
}
.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 51, 102, 0.6);
}
.menu-btn.secundario {
    background: transparent;
    color: #ff3366;
    border: 2px solid #ff3366;
    box-shadow: none;
}
.menu-btn.secundario:hover {
    background: rgba(255, 51, 102, 0.1);
}
.controls-info {
    margin-top: 20px;
    font-size: 13px;
    color: #666688;
    line-height: 1.5;
    text-align: left;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.version-tag {
    position: absolute;
    bottom: 12px;
    right: 15px;
    color: rgba(255, 255, 255, 0.25);
    font-family: monospace;
    font-size: 11px;
    z-index: 10;
    pointer-events: none;
}

/* Controles Móviles */
.touch-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
    display: none;
}
@media (pointer: coarse) {
    .touch-overlay {
        display: block;
    }
}
.btn {
    position: absolute;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: bold;
    font-size: 26px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    touch-action: none;
}
.btn:active {
    background: rgba(255, 51, 102, 0.2);
    border-color: #ff3366;
}
#btn-left { bottom: 40px; left: 30px; width: 85px; height: 85px; }
#btn-right { bottom: 40px; left: 130px; width: 85px; height: 85px; }
#btn-brake { bottom: 45px; right: 140px; width: 80px; height: 80px; border-color: rgba(255, 255, 255, 0.2); color: #ff3366; }
#btn-brake:active { background: rgba(255, 51, 102, 0.3); border-color: #ff3366; }
#btn-gas { bottom: 35px; right: 25px; width: 95px; height: 95px; border-color: rgba(0, 255, 204, 0.4); color: #00ffcc; }
#btn-gas:active { background: rgba(0, 255, 204, 0.2); border-color: #00ffcc; }
