* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Trebuchet MS', 'Segoe UI', Impact, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #030106;
    color: #ffffff;
    touch-action: none;
}

#game-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Pantallas Emergentes */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background: rgba(10, 5, 15, 0.94);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    transition: opacity 0.3s ease;
}

.screen.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.title {
    font-size: 2.8rem;
    font-weight: 900;
    color: #ffaa00;
    text-shadow: 0 0 25px rgba(255, 170, 0, 0.8);
    margin-bottom: 10px;
    line-height: 1.1;
    letter-spacing: 2px;
}

.title .highlight {
    color: #00f0ff;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.8);
}

.title.danger {
    color: #ff0055;
    text-shadow: 0 0 30px rgba(255, 0, 85, 0.9);
}

.subtitle {
    font-size: 1rem;
    max-width: 520px;
    color: #ffeeb3;
    margin-bottom: 20px;
}

.instructions {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 170, 0, 0.3);
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 0.9rem;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.stats-card {
    background: rgba(20, 10, 30, 0.8);
    padding: 20px 30px;
    border-radius: 18px;
    border: 1px solid rgba(255, 170, 0, 0.4);
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: left;
    max-width: 450px;
}

.credits-card p {
    margin-bottom: 6px;
}

.project-desc {
    font-size: 0.85rem;
    color: #ccc;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 8px;
}

.highlight-text {
    color: #ffcc00;
    font-weight: bold;
}

.score-total {
    color: #00f0ff;
    font-weight: bold;
    font-size: 1.5rem;
    margin-top: 8px;
}

.btn {
    background: linear-gradient(45deg, #ffaa00, #ff4400);
    border: none;
    color: white;
    padding: 14px 35px;
    font-size: 1.1rem;
    font-weight: 900;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.5);
}

.secondary-btn {
    background: linear-gradient(45deg, #0088ff, #00f0ff);
}

.btn.pulse {
    animation: pulseGlow 1.5s infinite alternate;
}

.btn.danger-btn {
    background: linear-gradient(45deg, #ff0000, #9900aa);
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 15px rgba(255, 170, 0, 0.6); }
    100% { box-shadow: 0 0 35px rgba(0, 240, 255, 0.9); }
}

/* Interfaz (HUD) */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    background: none !important;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.stat-box {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 15px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
}

.stage-box {
    border-color: #ffaa00;
}

.stat-box .label {
    font-size: 0.6rem;
    color: #ffcc00;
    letter-spacing: 1px;
}

.stat-box .value {
    font-size: 1.2rem;
    font-weight: 900;
    color: #fff;
}

.stage-val {
    color: #ffaa00;
}

.hud-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 95px;
}

.speedometer {
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 18px;
    border-radius: 14px;
    border: 2px solid #ffaa00;
    display: flex;
    align-items: baseline;
    gap: 5px;
}

#speed-text {
    font-size: 2rem;
    font-weight: 900;
    color: #ffaa00;
}

.speedometer .unit {
    font-size: 0.75rem;
    color: #aaa;
}

/* Distribución de botones táctiles para móviles */
.steering-buttons {
    pointer-events: auto;
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 12px;
}

.steer-btn {
    background: rgba(0, 204, 255, 0.2);
    border: 2px solid rgba(0, 204, 255, 0.6);
    color: #fff;
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.steer-btn:active {
    background: rgba(0, 204, 255, 0.6);
    transform: scale(0.92);
}

.action-buttons {
    pointer-events: auto;
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
}

.action-btn {
    border: none;
    color: #fff;
    padding: 16px 28px;
    font-weight: 900;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.jump-style {
    background: linear-gradient(45deg, #00ccff, #0055ff);
}

.action-btn:active {
    transform: scale(0.92);
}