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

.cd-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;
}

.cd-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;
}
.cd-stage:fullscreen { height: 100vh; }
#cdCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cd-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.cd-flash { position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: 0; background: #fff; mix-blend-mode: screen; }

/* --- HUD ------------------------------------------------------------------ */
.cd-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;
}
.cd-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;
}
.cd-brand span { color: #fb923c; }
.cd-score { color: #fde047; }
.cd-hud-btns { margin-left: auto; display: flex; gap: 6px; pointer-events: auto; flex-wrap: wrap; justify-content: flex-end; }
.cd-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;
}
.cd-btn:hover { background: rgba(120, 50, 10, 0.85); }
.cd-btn.is-off { opacity: 0.45; }

.cd-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;
}
.cd-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, #f97316, #facc15); }

.cd-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);
}
.cd-hint.is-slow { border-color: #ef4444; animation: cd-blink 0.6s infinite; }
.cd-hint.is-mega .cd-hint-title { color: #fb923c; }
.cd-hint-title { font-weight: 900; font-size: 18px; letter-spacing: 0.04em; }
.cd-hint-sub { font-size: 14px; font-weight: 600; opacity: 0.9; margin-top: 2px; }
@keyframes cd-blink { 50% { border-color: rgba(239,68,68,0.3); } }

.cd-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;
}
.cd-air div { text-align: center; }
.cd-air small { display: block; font-size: 11px; text-transform: uppercase; opacity: 0.75; letter-spacing: 0.08em; }
.cd-air b { font-size: 24px; font-weight: 900; color: #fde047; }
.cd-air-rot { font-size: 22px; font-weight: 900; color: #67e8f9; min-width: 0; }

.cd-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);
}
.cd-jumpres b { display: block; font-size: clamp(48px, 9vw, 96px); font-weight: 900; color: #fff; line-height: 1; letter-spacing: -0.02em; }
.cd-jumpres span { font-size: 20px; font-weight: 800; color: #fde047; }
.cd-jumpres.is-on { animation: cd-jr 2.4s ease-out forwards; }
@keyframes cd-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); }
}

.cd-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);
}
.cd-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: cd-pop 2.3s ease-out forwards;
}
.cd-pop-trick { color: #67e8f9; }
.cd-pop-flip { color: #f0abfc; font-size: 30px; }
.cd-pop-perfect { color: #86efac; font-size: 26px; }
.cd-pop-clean { color: #fde047; }
.cd-pop-sketchy { color: #fdba74; }
.cd-pop-crash { color: #fca5a5; font-size: 26px; }
.cd-pop-ring { color: #fcd34d; }
.cd-pop-boost { color: #fde047; font-size: 30px; font-style: italic; }
.cd-pop-info { color: #e2e8f0; font-size: 17px; font-weight: 700; }
@keyframes cd-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); }
}

.cd-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;
}
.cd-count.is-on { animation: cd-count 0.9s ease-out; }
@keyframes cd-count { 0% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } 30% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

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

.cd-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 ---------------------------------------------------------------- */
.cd-touch { display: none; }
.cd-app.is-touch .cd-touch { display: block; }
.cd-app.is-touch .cd-dash { bottom: 236px; top: auto; right: 12px; }
.cd-app.is-touch .cd-speedo span { font-size: 30px; }
.cd-app.is-touch .cd-profile { left: 50%; transform: translateX(-50%); bottom: auto; top: 76px; width: 220px; height: 44px; }
.cd-app.is-touch .cd-hint, .cd-app.is-touch .cd-air { top: 128px; }
.cd-tleft, .cd-tright {
    position: absolute; bottom: 14px; z-index: 5;
    display: flex; flex-direction: column; gap: 10px;
}
.cd-tleft { left: 14px; align-items: flex-start; }
.cd-tright { right: 14px; align-items: flex-end; }
.cd-trow { display: flex; gap: 10px; align-items: flex-end; }
.cd-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;
}
.cd-tbtn small { font-size: 11px; font-weight: 700; opacity: 0.9; margin-top: 3px; }
.cd-tbtn.is-down { background: rgba(249, 115, 22, 0.55); border-color: #fb923c; transform: scale(0.97); }
.cd-tbtn-steer { width: 88px; height: 88px; font-size: 34px; }
.cd-tbtn-lean { width: 88px; height: 64px; font-size: 30px; border-color: rgba(103, 232, 249, 0.6); }
.cd-tbtn-trick { width: 60px; height: 56px; font-size: 22px; border-color: rgba(240, 171, 252, 0.6); }
.cd-tbtn-trick small { font-size: 9px; }
.cd-tbtn-boost { width: 72px; height: 72px; border-color: rgba(56, 189, 248, 0.7); }
.cd-tbtn-brake { width: 76px; height: 88px; border-color: rgba(239, 68, 68, 0.7); }
.cd-tbtn-gas { width: 96px; height: 124px; font-size: 34px; border-color: rgba(34, 197, 94, 0.8); }

/* --- Overlay -------------------------------------------------------------- */
.cd-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;
}
.cd-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;
}
.cd-card-small { width: min(460px, 100%); }
.cd-card h2 { margin: 0 0 14px; font-size: 26px; color: #fb923c; }
.cd-kicker { font-size: 13px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #fdba74; }
.cd-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;
}
.cd-lead { margin: 0 auto 16px; max-width: 580px; font-size: 16px; line-height: 1.5; color: #cbd5e1; }
.cd-picks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.cd-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;
}
.cd-track-pick small { font-size: 12.5px; opacity: 0.75; }
.cd-track-pick .cd-best { font-size: 12px; color: #fde047; font-weight: 700; }
.cd-track-pick.is-sel { border-color: #fb923c; background: rgba(249, 115, 22, 0.16); }
.cd-colors { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; font-weight: 700; }
.cd-color-pick {
    width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
    background: var(--c); border: 3px solid rgba(255,255,255,0.2);
}
.cd-color-pick.is-sel { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,0.25); }
.cd-keys { display: grid; gap: 6px; margin: 0 auto 16px; max-width: 580px; text-align: left; }
.cd-keys div { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.cd-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;
}
.cd-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);
}
.cd-play:hover { filter: brightness(1.08); }
.cd-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;
}
.cd-note { margin: 12px 0 0; font-size: 13px; opacity: 0.7; }
.cd-medal { font-size: 64px; line-height: 1; }
.cd-record { color: #fde047; font-weight: 900; margin-bottom: 6px; }
.cd-end-score { font-size: 48px; font-weight: 900; color: #fde047; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.cd-end-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
.cd-end-grid div { background: rgba(255,255,255,0.06); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; }
.cd-end-grid span { font-size: 12px; opacity: 0.7; }
.cd-end-grid b { font-size: 19px; font-variant-numeric: tabular-nums; }
.cd-help-text { font-size: 14.5px; line-height: 1.55; color: #cbd5e1; text-align: left; }
.cd-help-actions { margin-top: 10px; }
.cd-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: cd-spin 0.8s linear infinite;
}
@keyframes cd-spin { to { transform: rotate(360deg); } }

/* --- Testo SEO -------------------------------------------------------------- */
.cd-info { max-width: 1100px; margin: 0 auto; padding: 40px 20px 60px; color: #e2e8f0; }
.cd-info h2 { font-size: 28px; margin: 0 0 12px; color: #fb923c; }
.cd-info p { line-height: 1.65; color: #cbd5e1; }
.cd-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 22px; }
.cd-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; }
.cd-info h3 { margin: 0 0 6px; font-size: 18px; color: #fde047; }

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

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

.cd-pops { top: 30%; }
.cd-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: cd-pop 2.3s ease-out forwards;
    transition: opacity 0.4s;
}
.cd-popmsg b { color: #fde047; margin-left: 6px; }
.cd-popmsg.is-trick { color: #67e8f9; font-size: 27px; }
.cd-popmsg.is-pop { color: #86efac; font-size: 24px; font-style: italic; }
.cd-popmsg.is-crash { color: #fca5a5; font-size: 25px; }
.cd-popmsg.is-out { opacity: 0; }

.cd-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; }
.cd-pop-bar { width: 130px; height: 12px; border-radius: 6px; background: rgba(255,255,255,0.16); overflow: hidden; }
.cd-pop-fill { height: 100%; width: 0; background: linear-gradient(90deg, #22d3ee, #a3e635); }
.cd-pop.is-full .cd-pop-fill { background: linear-gradient(90deg, #a3e635, #facc15); box-shadow: 0 0 12px #facc15; }

.cd-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; }
.cd-assist input { width: 22px; height: 22px; accent-color: #22d3ee; }

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

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

/* ===================== Cliff Diving ===================== */
.cd-app { background: #06141f; }
.cd-brand span { color: #38bdf8; }
.cd-best { color: #fde047; }
.cd-btn-wide { width: auto; padding: 0 12px; font-size: 14px; font-weight: 800; gap: 6px; display: inline-flex; align-items: center; }
.cd-title { background: linear-gradient(90deg, #38bdf8, #a5f3fc, #fbbf24); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cd-card h2, .cd-info h2 { color: #38bdf8; }
.cd-kicker { color: #7dd3fc; }
.cd-play { background: linear-gradient(135deg, #38bdf8, #22d3ee); color: #04212e; box-shadow: 0 8px 24px rgba(56, 189, 248, 0.35); }
.cd-play-alt { background: linear-gradient(135deg, #fbbf24, #f97316); color: #2a1300; }
.cd-link { color: #7dd3fc; }

.cd-speedlines {
    position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: 0;
    background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,.28) 0deg .4deg, rgba(255,255,255,0) .4deg 3.4deg);
    -webkit-mask-image: radial-gradient(circle, transparent 30%, #000 85%); mask-image: radial-gradient(circle, transparent 30%, #000 85%);
}
.cd-under { position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: 0; transition: opacity .25s;
    background: radial-gradient(ellipse at 50% 30%, rgba(80,200,230,.15), rgba(3,40,70,.65)); }
.cd-under.is-deep { opacity: 1; }
.cd-hurt { position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: 0;
    background: radial-gradient(ellipse, transparent 35%, rgba(255,50,50,.6)); }
.cd-hurt.is-on { animation: cd-hurt 1.2s ease-out; }
@keyframes cd-hurt { 0% { opacity: 1; } 100% { opacity: 0; } }

.cd-alt { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); z-index: 4; pointer-events: none;
    display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cd-alt-bar { width: 12px; height: 200px; border-radius: 8px; background: rgba(255,255,255,.18); position: relative; overflow: hidden; }
.cd-alt-fill { position: absolute; bottom: 0; left: 0; right: 0; height: 100%; background: linear-gradient(0deg, #22d3ee, #fbbf24); }
.cd-alt-txt { background: rgba(10,10,14,.7); border-radius: 12px; padding: 4px 10px; text-align: center; min-width: 74px; font-variant-numeric: tabular-nums; }
.cd-alt-txt b { font-size: 26px; font-weight: 900; }
.cd-alt-txt small { font-size: 12px; margin-left: 3px; opacity: .8; }
.cd-spd b.is-fast, #cdSpeed.is-fast { color: #fca5a5; }

.cd-charge { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 4; pointer-events: none;
    display: flex; align-items: center; gap: 10px; background: rgba(10,10,14,.75); padding: 10px 16px; border-radius: 14px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }
.cd-charge-bar { width: 260px; height: 16px; border-radius: 8px; background: rgba(255,255,255,.15); position: relative; overflow: hidden; }
.cd-charge-zone { position: absolute; top: 0; bottom: 0; left: 86%; right: 0; background: rgba(34,197,94,.55); }
.cd-charge-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: linear-gradient(90deg, #38bdf8, #fbbf24); }
.cd-charge.is-good .cd-charge-fill { background: linear-gradient(90deg, #22c55e, #86efac); box-shadow: 0 0 14px #22c55e; }
.cd-tip { position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%); z-index: 4; pointer-events: none;
    background: rgba(10,10,14,.6); padding: 6px 14px; border-radius: 10px; font-size: 14px; font-weight: 700; white-space: nowrap; max-width: 94vw; overflow: hidden; text-overflow: ellipsis; }
.cd-tip:empty { display: none; }
.cd-pops { top: 22%; }
.cd-popmsg { font-weight: 900; font-size: 24px; text-align: center; padding: 7px 18px; border-radius: 14px; color: #fff;
    background: rgba(10,10,14,.6); text-shadow: 0 2px 8px rgba(0,0,0,.5); animation: cd-pop 2.5s ease-out forwards; }
.cd-popmsg.is-good { color: #86efac; }
.cd-popmsg.is-bad { color: #fca5a5; font-size: 28px; }
.cd-popmsg.is-info { color: #e2e8f0; font-size: 18px; }

.cd-result { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 8; width: min(560px, calc(100% - 32px));
    background: rgba(10, 18, 28, .9); border: 1px solid rgba(255,255,255,.14); border-radius: 22px; padding: 20px 22px; text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: cd-in 0.4s ease-out; max-height: calc(100% - 24px); overflow-y: auto; }
.cd-result[hidden] { display: none; }
.cd-res-grade { font-size: 52px; line-height: 1; }
.cd-res-name { font-size: 22px; font-weight: 900; color: #7dd3fc; margin: 6px 0 2px; }
.cd-res-meta { font-size: 14px; opacity: .75; margin-bottom: 14px; }
.cd-votes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.cd-vote { background: rgba(255,255,255,.08); border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; opacity: 0; animation: cd-vote .35s ease-out forwards; }
.cd-vote small { font-size: 11px; opacity: .7; }
.cd-vote b { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.cd-vote.is-drop { text-decoration: line-through; opacity: .45 !important; }
@keyframes cd-vote { from { opacity: 0; transform: translateY(10px) scale(.8); } to { opacity: 1; transform: none; } }
.cd-vote.is-drop { animation-name: cd-vote-drop; }
@keyframes cd-vote-drop { from { opacity: 0; } to { opacity: .45; } }
.cd-res-total { font-size: 18px; margin-bottom: 8px; }
.cd-res-total b { font-size: 40px; color: #fde047; font-weight: 900; }
.cd-res-record { color: #fde047; font-weight: 900; }
.cd-res-unlock { color: #86efac; font-weight: 900; font-size: 18px; margin-top: 4px; }
.cd-res-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.cd-res-btns .cd-link { flex-basis: 100%; margin-top: 0; }
.cd-res-btns [hidden] { display: none; }

.cd-picks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.cd-pick { min-height: 72px; padding: 8px; border-radius: 14px; cursor: pointer; border: 2px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.05); color: #f1f5f9; display: flex; flex-direction: column; gap: 2px; align-items: center; justify-content: center; }
.cd-pick b { font-size: 22px; font-weight: 900; }
.cd-pick span { font-size: 12.5px; opacity: .85; }
.cd-pick small { font-size: 11px; color: #fde047; }
.cd-pick.is-sel { border-color: #38bdf8; background: rgba(56,189,248,.16); }
.cd-pick.is-locked { opacity: .45; cursor: not-allowed; }
.cd-pick.is-locked small { color: #cbd5e1; }
.cd-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; }
.cd-assist input { width: 22px; height: 22px; accent-color: #38bdf8; }

/* touch */
.cd-tbtn { width: 84px; height: 78px; }
.cd-tbtn-pos { border-color: rgba(251, 191, 36, .7); }
.cd-tbtn-jump { width: 178px; height: 110px; font-size: 40px; border-color: rgba(56, 189, 248, .9); background: rgba(8, 60, 90, .5); }
.cd-tbtn.is-down { background: rgba(56, 189, 248, .5); border-color: #7dd3fc; }
.cd-app.is-touch .cd-alt { top: 130px; transform: none; }
.cd-app.is-touch .cd-alt-bar { height: 110px; }
.cd-app.is-touch .cd-charge { bottom: auto; top: 130px; left: 12px; transform: none; }
.cd-app.is-touch .cd-charge-bar { width: 150px; }
.cd-app.is-touch .cd-tip { bottom: auto; top: 186px; font-size: 12px; }
@media (max-width: 700px) {
    .cd-picks { grid-template-columns: repeat(2, 1fr); }
    .cd-vote b { font-size: 20px; }
    .cd-btn-wide span { display: none; }
}

@keyframes cd-in { from { opacity: 0; transform: translate(-50%, -46%) scale(.94); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* --- tuffi automatici e tasti a schermo --- */
.cd-btn-auto { border-color: rgba(251,191,36,.5); }
.cd-btn-auto.is-active { background: linear-gradient(135deg, #fbbf24, #f97316); color: #2a1300; border-color: #fde68a; animation: cd-glow 1.6s ease-in-out infinite; }
@keyframes cd-glow { 50% { box-shadow: 0 0 18px rgba(251,191,36,.8); } }
.cd-popmsg.is-auto { color: #fde68a; font-size: 21px; }
.cd-start-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.cd-res-auto { margin-top: 6px; font-size: 14px; color: #fde68a; font-weight: 700; }
.cd-keys-panel { position: absolute; left: 16px; top: 180px; z-index: 4; pointer-events: none;
    background: rgba(10,10,14,.62); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 8px 10px; }
.cd-kp-title { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .75; margin-bottom: 6px; }
.cd-keys-panel:not(.is-auto) .cd-kp-title { visibility: hidden; height: 0; margin: 0; }
.cd-kp-grid { display: grid; grid-template-columns: repeat(3, 58px); gap: 6px; }
.cd-kc { height: 50px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); border-bottom-width: 3px;
    font-weight: 900; font-size: 20px; color: #e2e8f0; transition: background .08s, transform .08s; }
.cd-kc small { font-size: 9px; font-weight: 700; opacity: .75; margin-top: 1px; }
.cd-kc-wide { grid-column: span 2; font-size: 15px; }
.cd-kc.is-on { background: #fbbf24; color: #1c1105; border-color: #fde68a; transform: translateY(2px); box-shadow: 0 0 16px rgba(251,191,36,.7); }
.cd-app.is-touch .cd-keys-panel { display: none; }
.cd-app.is-touch .cd-keys-panel.is-auto { display: block; bottom: auto; top: 250px; transform: scale(.8); transform-origin: top left; }
.cd-app.is-touch.cd-auto-on .cd-touch { display: none; }
