/**
 * BMX Dirt Jumps 3D
 */
.bmx-app [hidden] { display: none !important; }

.bmx-app {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    color: #f1f5f9;
    background: #0c0d12;
    overflow-x: hidden;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.bmx-stage {
    position: relative;
    width: 100vw;
    height: calc(100vh - 72px);
    min-height: 520px;
    overflow: hidden;
    background: #0c0d12;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.bmx-stage:fullscreen { height: 100vh; }
#bmxCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bmx-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.bmx-flash { position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: 0; background: #fff; mix-blend-mode: screen; }

/* --- HUD ------------------------------------------------------------------ */
.bmx-hud-top {
    position: absolute; top: 12px; left: 12px; right: 12px;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    pointer-events: none; z-index: 5;
}
.bmx-chip {
    background: rgba(10, 10, 14, 0.72);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
    padding: 7px 14px;
    font-weight: 800; font-size: 15px;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    white-space: nowrap; font-variant-numeric: tabular-nums;
}
.bmx-brand span { color: #fb923c; }
.bmx-score { color: #fde047; }
.bmx-hud-btns { margin-left: auto; display: flex; gap: 6px; pointer-events: auto; flex-wrap: wrap; justify-content: flex-end; }
.bmx-btn {
    width: 44px; height: 44px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(10, 10, 14, 0.72); color: #fff;
    font-size: 19px; cursor: pointer; display: grid; place-items: center;
}
.bmx-btn:hover { background: rgba(120, 50, 10, 0.85); }
.bmx-btn.is-off { opacity: 0.45; }

.bmx-progress {
    position: absolute; left: 12px; right: 12px; top: 64px; height: 4px;
    background: rgba(255,255,255,0.18); border-radius: 4px; z-index: 4; overflow: hidden;
}
.bmx-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, #f97316, #facc15); }

.bmx-hint {
    position: absolute; top: 80px; left: 50%; transform: translateX(-50%);
    padding: 10px 18px; border-radius: 14px; text-align: center;
    background: rgba(10, 10, 14, 0.78); border: 2px solid #22c55e;
    z-index: 4; pointer-events: none; min-width: 260px;
    box-shadow: 0 8px 26px rgba(0,0,0,0.35);
}
.bmx-hint.is-slow { border-color: #ef4444; animation: bmx-blink 0.6s infinite; }
.bmx-hint.is-mega .bmx-hint-title { color: #fb923c; }
.bmx-hint-title { font-weight: 900; font-size: 18px; letter-spacing: 0.04em; }
.bmx-hint-sub { font-size: 14px; font-weight: 600; opacity: 0.9; margin-top: 2px; }
@keyframes bmx-blink { 50% { border-color: rgba(239,68,68,0.3); } }

.bmx-air {
    position: absolute; top: 80px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 18px; align-items: flex-end;
    padding: 8px 18px; border-radius: 14px;
    background: rgba(10, 10, 14, 0.62); z-index: 4; pointer-events: none;
    font-variant-numeric: tabular-nums;
}
.bmx-air div { text-align: center; }
.bmx-air small { display: block; font-size: 11px; text-transform: uppercase; opacity: 0.75; letter-spacing: 0.08em; }
.bmx-air b { font-size: 24px; font-weight: 900; color: #fde047; }
.bmx-air-rot { font-size: 22px; font-weight: 900; color: #67e8f9; min-width: 0; }

.bmx-jumpres {
    position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%);
    text-align: center; pointer-events: none; z-index: 4; opacity: 0;
    text-shadow: 0 4px 18px rgba(0,0,0,0.6);
}
.bmx-jumpres b { display: block; font-size: clamp(48px, 9vw, 96px); font-weight: 900; color: #fff; line-height: 1; letter-spacing: -0.02em; }
.bmx-jumpres span { font-size: 20px; font-weight: 800; color: #fde047; }
.bmx-jumpres.is-on { animation: bmx-jr 2.4s ease-out forwards; }
@keyframes bmx-jr {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
    12% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
    22% { transform: translate(-50%, -50%) scale(1); }
    75% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -62%) scale(1); }
}

.bmx-pops {
    position: absolute; top: 48%; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    pointer-events: none; z-index: 4; width: min(92vw, 640px);
}
.bmx-pop {
    font-weight: 900; font-size: 22px; letter-spacing: 0.03em; text-align: center;
    padding: 6px 16px; border-radius: 12px;
    background: rgba(10,10,14,0.55);
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    animation: bmx-pop 2.3s ease-out forwards;
}
.bmx-pop-trick { color: #67e8f9; }
.bmx-pop-flip { color: #f0abfc; font-size: 30px; }
.bmx-pop-perfect { color: #86efac; font-size: 26px; }
.bmx-pop-clean { color: #fde047; }
.bmx-pop-sketchy { color: #fdba74; }
.bmx-pop-crash { color: #fca5a5; font-size: 26px; }
.bmx-pop-ring { color: #fcd34d; }
.bmx-pop-boost { color: #fde047; font-size: 30px; font-style: italic; }
.bmx-pop-info { color: #e2e8f0; font-size: 17px; font-weight: 700; }
@keyframes bmx-pop {
    0% { opacity: 0; transform: scale(0.7); }
    10% { opacity: 1; transform: scale(1.1); }
    18% { transform: scale(1); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-14px); }
}

.bmx-count {
    position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%);
    font-size: clamp(90px, 16vw, 180px); font-weight: 900; color: #fff;
    text-shadow: 0 6px 30px rgba(0,0,0,0.6); z-index: 6; pointer-events: none;
}
.bmx-count.is-on { animation: bmx-count 0.9s ease-out; }
@keyframes bmx-count { 0% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } 30% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

.bmx-dash {
    position: absolute; right: 16px; bottom: 16px; z-index: 4;
    display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none;
}
.bmx-speedo {
    background: rgba(10,10,14,0.72); border: 1px solid rgba(255,255,255,0.14);
    border-radius: 16px; padding: 6px 16px; font-variant-numeric: tabular-nums;
}
.bmx-speedo span { font-size: 44px; font-weight: 900; line-height: 1; }
.bmx-speedo small { font-size: 14px; font-weight: 700; margin-left: 4px; opacity: 0.8; }
.bmx-nitro { display: flex; align-items: center; gap: 6px; background: rgba(10,10,14,0.72); padding: 6px 10px; border-radius: 12px; }
.bmx-nitro-bar { width: 130px; height: 10px; border-radius: 6px; background: rgba(255,255,255,0.16); overflow: hidden; }
.bmx-nitro-fill { height: 100%; width: 40%; background: linear-gradient(90deg, #38bdf8, #a855f7); transition: width 0.15s; }

.bmx-profile {
    position: absolute; left: 16px; bottom: 16px; z-index: 4;
    width: 320px; height: 64px; border-radius: 12px;
    background: rgba(10,10,14,0.6); pointer-events: none;
}

/* --- Touch ---------------------------------------------------------------- */
.bmx-touch { display: none; }
.bmx-app.is-touch .bmx-touch { display: block; }
.bmx-app.is-touch .bmx-dash { bottom: 236px; top: auto; right: 12px; }
.bmx-app.is-touch .bmx-speedo span { font-size: 30px; }
.bmx-app.is-touch .bmx-profile { left: 50%; transform: translateX(-50%); bottom: auto; top: 76px; width: 220px; height: 44px; }
.bmx-app.is-touch .bmx-hint, .bmx-app.is-touch .bmx-air { top: 128px; }
.bmx-tleft, .bmx-tright {
    position: absolute; bottom: 14px; z-index: 5;
    display: flex; flex-direction: column; gap: 10px;
}
.bmx-tleft { left: 14px; align-items: flex-start; }
.bmx-tright { right: 14px; align-items: flex-end; }
.bmx-trow { display: flex; gap: 10px; align-items: flex-end; }
.bmx-tbtn {
    border-radius: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(10,10,14,0.5); color: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 900; line-height: 1;
    touch-action: none; -webkit-tap-highlight-color: transparent;
}
.bmx-tbtn small { font-size: 11px; font-weight: 700; opacity: 0.9; margin-top: 3px; }
.bmx-tbtn.is-down { background: rgba(249, 115, 22, 0.55); border-color: #fb923c; transform: scale(0.97); }
.bmx-tbtn-steer { width: 88px; height: 88px; font-size: 34px; }
.bmx-tbtn-lean { width: 88px; height: 64px; font-size: 30px; border-color: rgba(103, 232, 249, 0.6); }
.bmx-tbtn-trick { width: 60px; height: 56px; font-size: 22px; border-color: rgba(240, 171, 252, 0.6); }
.bmx-tbtn-trick small { font-size: 9px; }
.bmx-tbtn-boost { width: 72px; height: 72px; border-color: rgba(56, 189, 248, 0.7); }
.bmx-tbtn-brake { width: 76px; height: 88px; border-color: rgba(239, 68, 68, 0.7); }
.bmx-tbtn-gas { width: 96px; height: 124px; font-size: 34px; border-color: rgba(34, 197, 94, 0.8); }

/* --- Overlay -------------------------------------------------------------- */
.bmx-overlay {
    position: absolute; inset: 0; z-index: 10;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    background: radial-gradient(ellipse at center, rgba(10,10,14,0.35), rgba(10,10,14,0.78));
    overflow-y: auto;
}
.bmx-card {
    width: min(720px, 100%);
    max-height: calc(100% - 8px); overflow-y: auto;
    background: rgba(18, 18, 24, 0.92);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 22px; padding: 24px 26px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    text-align: center;
}
.bmx-card-small { width: min(460px, 100%); }
.bmx-card h2 { margin: 0 0 14px; font-size: 26px; color: #fb923c; }
.bmx-kicker { font-size: 13px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #fdba74; }
.bmx-title {
    margin: 4px 0 8px; font-size: clamp(40px, 7vw, 64px); font-weight: 900; letter-spacing: -0.02em;
    background: linear-gradient(90deg, #fb923c, #facc15, #f97316); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bmx-lead { margin: 0 auto 16px; max-width: 580px; font-size: 16px; line-height: 1.5; color: #cbd5e1; }
.bmx-picks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.bmx-track-pick {
    min-height: 64px; padding: 10px 12px; border-radius: 14px; cursor: pointer;
    border: 2px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.05); color: #f1f5f9;
    font-size: 17px; text-align: left; display: flex; flex-direction: column; gap: 2px;
}
.bmx-track-pick small { font-size: 12.5px; opacity: 0.75; }
.bmx-track-pick .bmx-best { font-size: 12px; color: #fde047; font-weight: 700; }
.bmx-track-pick.is-sel { border-color: #fb923c; background: rgba(249, 115, 22, 0.16); }
.bmx-colors { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; font-weight: 700; }
.bmx-color-pick {
    width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
    background: var(--c); border: 3px solid rgba(255,255,255,0.2);
}
.bmx-color-pick.is-sel { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,0.25); }
.bmx-keys { display: grid; gap: 6px; margin: 0 auto 16px; max-width: 580px; text-align: left; }
.bmx-keys div { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.bmx-k { min-width: 150px; display: inline-flex; gap: 3px; flex-wrap: wrap; align-items: center; font-weight: 700; }
kbd {
    display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 12px; font-family: inherit;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22); border-bottom-width: 2px; color: #fff;
}
.bmx-play {
    min-height: 52px; padding: 12px 34px; border: 0; border-radius: 14px; cursor: pointer;
    font-size: 20px; font-weight: 900; color: #1c1105;
    background: linear-gradient(135deg, #fb923c, #facc15);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4);
}
.bmx-play:hover { filter: brightness(1.08); }
.bmx-link {
    display: block; margin: 10px auto 0; min-height: 44px; padding: 8px 16px;
    background: none; border: 0; color: #fdba74; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: underline;
}
.bmx-note { margin: 12px 0 0; font-size: 13px; opacity: 0.7; }
.bmx-medal { font-size: 64px; line-height: 1; }
.bmx-record { color: #fde047; font-weight: 900; margin-bottom: 6px; }
.bmx-end-score { font-size: 48px; font-weight: 900; color: #fde047; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.bmx-end-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
.bmx-end-grid div { background: rgba(255,255,255,0.06); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; }
.bmx-end-grid span { font-size: 12px; opacity: 0.7; }
.bmx-end-grid b { font-size: 19px; font-variant-numeric: tabular-nums; }
.bmx-help-text { font-size: 14.5px; line-height: 1.55; color: #cbd5e1; text-align: left; }
.bmx-help-actions { margin-top: 10px; }
.bmx-spin {
    width: 46px; height: 46px; margin: 4px auto 12px; border-radius: 50%;
    border: 5px solid rgba(255,255,255,0.15); border-top-color: #fb923c; animation: bmx-spin 0.8s linear infinite;
}
@keyframes bmx-spin { to { transform: rotate(360deg); } }

/* --- Testo SEO -------------------------------------------------------------- */
.bmx-info { max-width: 1100px; margin: 0 auto; padding: 40px 20px 60px; color: #e2e8f0; }
.bmx-info h2 { font-size: 28px; margin: 0 0 12px; color: #fb923c; }
.bmx-info p { line-height: 1.65; color: #cbd5e1; }
.bmx-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 22px; }
.bmx-info-grid div { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 16px 18px; }
.bmx-info h3 { margin: 0 0 6px; font-size: 18px; color: #fde047; }

@media (max-width: 700px) {
    .bmx-brand { display: none; }
    .bmx-picks { grid-template-columns: 1fr; }
    .bmx-card { padding: 18px 16px; }
    .bmx-keys { display: none; }
    .bmx-profile { width: 200px; height: 44px; }
    .bmx-air { gap: 10px; padding: 6px 12px; }
    .bmx-air b { font-size: 19px; }
    .bmx-pop { font-size: 18px; }
    .bmx-pop-flip { font-size: 22px; }
}
@media (orientation: portrait) and (pointer: coarse) {
    .bmx-tbtn-steer { width: 76px; height: 76px; }
    .bmx-tbtn-lean { width: 76px; }
    .bmx-tbtn-trick { width: 52px; height: 52px; }
}

/* --- Specifici BMX -------------------------------------------------------- */
.bmx-app { background: #0b1016; }
.bmx-brand span { color: #22d3ee; }
.bmx-chain { color: #f0abfc; }
.bmx-hint { border-color: #22d3ee; }
.bmx-hint.is-slow { border-color: #ef4444; }
.bmx-hint.is-mega .bmx-hint-title { color: #fb923c; }

.bmx-pops { top: 30%; }
.bmx-popmsg {
    font-weight: 900; font-size: 22px; letter-spacing: 0.02em; text-align: center;
    padding: 7px 18px; border-radius: 14px; color: #fff;
    background: rgba(10,10,14,0.6);
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    animation: bmx-pop 2.3s ease-out forwards;
    transition: opacity 0.4s;
}
.bmx-popmsg b { color: #fde047; margin-left: 6px; }
.bmx-popmsg.is-trick { color: #67e8f9; font-size: 27px; }
.bmx-popmsg.is-pop { color: #86efac; font-size: 24px; font-style: italic; }
.bmx-popmsg.is-crash { color: #fca5a5; font-size: 25px; }
.bmx-popmsg.is-out { opacity: 0; }

.bmx-pop { display: flex; align-items: center; gap: 8px; background: rgba(10,10,14,0.72); padding: 6px 10px; border-radius: 12px; font-weight: 900; font-size: 13px; letter-spacing: 0.08em; }
.bmx-pop-bar { width: 130px; height: 12px; border-radius: 6px; background: rgba(255,255,255,0.16); overflow: hidden; }
.bmx-pop-fill { height: 100%; width: 0; background: linear-gradient(90deg, #22d3ee, #a3e635); }
.bmx-pop.is-full .bmx-pop-fill { background: linear-gradient(90deg, #a3e635, #facc15); box-shadow: 0 0 12px #facc15; }

.bmx-assist { display: flex; gap: 10px; align-items: center; justify-content: center; min-height: 44px; margin: -4px 0 12px; font-size: 14px; color: #cbd5e1; cursor: pointer; }
.bmx-assist input { width: 22px; height: 22px; accent-color: #22d3ee; }

.bmx-title { background: linear-gradient(90deg, #22d3ee, #a3e635, #facc15); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bmx-card h2, .bmx-info h2 { color: #22d3ee; }
.bmx-kicker { color: #67e8f9; }
.bmx-track-pick.is-sel { border-color: #22d3ee; background: rgba(34, 211, 238, 0.14); }
.bmx-play { background: linear-gradient(135deg, #22d3ee, #a3e635); box-shadow: 0 8px 24px rgba(34, 211, 238, 0.35); color: #06121a; }
.bmx-link { color: #67e8f9; }

/* touch: pulsanti grandi, mai sotto i 56 px */
.bmx-tbtn { width: 84px; height: 76px; }
.bmx-tbtn-steer { width: 88px; height: 88px; }
.bmx-tbtn-trick { width: 64px; height: 60px; font-size: 22px; border-color: rgba(240, 171, 252, 0.6); }
.bmx-tbtn-trick small { font-size: 9px; }
.bmx-tbtn-brake { width: 72px; height: 88px; border-color: rgba(239, 68, 68, 0.7); }
.bmx-tbtn-pop { width: 132px; height: 120px; font-size: 40px; border-color: rgba(163, 230, 53, 0.9); background: rgba(40, 60, 10, 0.45); }
.bmx-tbtn-pop small { font-size: 11px; }
.bmx-tbtn.is-down { background: rgba(34, 211, 238, 0.5); border-color: #67e8f9; }
.bmx-app.is-touch .bmx-hint, .bmx-app.is-touch .bmx-air { top: 128px; }
@media (orientation: portrait) and (pointer: coarse) {
    .bmx-tbtn-steer { width: 80px; height: 80px; }
    .bmx-tbtn-trick { width: 58px; height: 58px; }
    .bmx-tbtn-pop { width: 116px; height: 112px; }
    .bmx-trow { gap: 8px; }
}
