body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #111;
    color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.game-container {
    background: #1e1e1e;
    padding: 24px 32px;
    border-radius: 16px;
    box-shadow: 0 0 20px rgba(0,0,0,0.7);
    max-width: 600px;
    width: 100%;
    text-align: center;
}

h1 {
    margin-top: 0;
    margin-bottom: 4px;
}

.subtitle {
    margin-top: 0;
    margin-bottom: 20px;
    color: #aaa;
    font-size: 0.9rem;
}

.play-area {
    border-radius: 12px;
    padding: 16px;
    background: radial-gradient(circle at top, #222, #000);
    position: relative;
    overflow: hidden;
    height: 220px;
}

.van-container {
    position: absolute;
    width: 160px;
    height: auto;
    transform: translate(-50%, -50%); /* centra il van sulle coordinate */
}


.van-container img {
    max-width: 160px;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.8));
}

/* Animazioni "flying" e "crashed" */

#van-img.flying {
    animation: flyingAnim 1s ease-in-out infinite alternate;
}

#van-img.crashed {
    animation: crashedAnim 0.4s ease-in-out 1 forwards;
}

@keyframes flyingAnim {
    from {
        transform: translate(0, 0);
    }
    to {
        transform: translate(0, -18px);
    }
}

@keyframes crashedAnim {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        transform: translate(0, 40px) rotate(35deg);
    }
}


.multiplier {
    position: absolute;
    top: 16px;
    left: 16px;
    font-size: 2rem;
    font-weight: bold;
}

.status {
    position: absolute;
    bottom: 12px;
    left: 16px;
    right: 16px;
    font-size: 0.9rem;
    color: #ddd;
}

.controls {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

button {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    background: #f97316;
    color: #111;
    transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.2s;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

button:disabled {
    opacity: 0.4;
    cursor: default;
}

.scoreboard {
    margin-top: 16px;
    font-size: 0.9rem;
    color: #ccc;
}

#trail-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* così non blocca i click */
}
