/* ============================================
   MAINDASHBOARD V2 - MODERNIZED
   Miglioramenti SOLO estetici - Layout identico
   ============================================ */

/* Definizione dei colori principali utilizzati nella dashboard */
:root {
    --primary: #fd9002;
    --success: #16a34a;
    --danger: #dc2626;
    --neutral: #4b5563;
    --bg: #1e293b;
    --purple: #6a0dad;
    --blue: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.9)), url('images/sfondo.jpg');
    background-size: cover;
    font-family: 'Poppins', sans-serif;
    color: #fff;
    min-height: 100vh;
}

/* ============================================
   ANIMAZIONI - NUOVE
   ============================================ */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.9;
    }
}

@keyframes glow {
    0%, 100% {
        text-shadow:
            0 0 10px currentColor,
            0 0 20px currentColor,
            0 0 30px currentColor;
    }
    50% {
        text-shadow:
            0 0 20px currentColor,
            0 0 40px currentColor,
            0 0 60px currentColor;
    }
}

/* ============================================
   HEADER E LAYOUT PRINCIPALE
   ============================================ */

.container {
    max-width: 576px;
    margin: 0 auto;
    padding: 0.72rem;
}

.header {
    text-align: center;
    margin-bottom: 0.72rem;
}

h1 {
    /* Layout */
    margin: 0 0 1.5rem 0;
    padding: 1.2rem 1.5rem;
    width: 100%;
    max-width: 1200px;
    text-align: center;
    position: relative; /* ✅ IMPORTANTE per pseudo-elemento */

    /* Typography */
    font-size: clamp(1.4rem, 5vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
    text-transform: none;

    /* Colore testo arancione */
    color: #ffa600;

    /* Background glassmorphism */
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.6), rgba(26, 32, 44, 0.8));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 1rem; /* ✅ ANGOLI ARROTONDATI */

    /* Rimuovo border-image (non funziona con border-radius) */
    border: none;

    /* 💙 GLOW AZZURRO + TRIDIMENSIONALITÀ */
    box-shadow:
        /* Glow azzurro esterno */
        0 0 30px rgba(0, 150, 255, 0.5),
        0 0 60px rgba(0, 150, 255, 0.3),
        0 0 90px rgba(0, 150, 255, 0.15),
        /* Shadow profondità (3D) */
        0 8px 16px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3),
        /* Luce interna (3D) */
        inset 0 2px 0 rgba(255, 255, 255, 0.1),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);

    /* Text shadow per tridimensionalità */
    text-shadow:
        /* Profondità testo */
        0 2px 4px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.2),
        /* Glow azzurro sul testo */
        0 0 20px rgba(0, 150, 255, 0.4);

    /* Smooth transitions */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Prevent text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;

    /* Cursor */
    cursor: default;

    /* Z-index per contenuto */
    z-index: 1;
}

/* 🇮🇹 BORDO TRICOLORE CON ANGOLI ARROTONDATI usando ::before */
h1::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 1rem; /* ✅ ANGOLI ARROTONDATI */
    padding: 1px; /* Spessore bordo */
    z-index: -1; /* Dietro al testo */

    /* Gradient tricolore: Verde | Bianco | Rosso */
    background: linear-gradient(
        90deg,
        #009246 0%, #009246 33%,    /* Verde */
        #F1F2F1 33%, #F1F2F1 66%,   /* Bianco */
        #CE2B37 66%, #CE2B37 100%   /* Rosso */
    );

    /* Maschera per creare effetto bordo */
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;

    /* Non blocca click sul testo */
    pointer-events: none;
}

/* Hover effect - solleva + intensifica glow */
h1:hover {
    transform: translateY(-3px);
    box-shadow:
        /* Glow azzurro più intenso */
        0 0 40px rgba(0, 150, 255, 0.7),
        0 0 80px rgba(0, 150, 255, 0.5),
        0 0 120px rgba(0, 150, 255, 0.3),
        /* Shadow più profondo (più 3D) */
        0 12px 24px rgba(0, 0, 0, 0.5),
        0 6px 12px rgba(0, 0, 0, 0.3),
        /* Luce interna */
        inset 0 2px 0 rgba(255, 255, 255, 0.15),
        inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}

/* Active state */
h1:active {
    transform: translateY(-1px);
}

.header h2 {
    font-size: 0.75rem;
    color: #ffffff;
}

.dashboard {
    background: var(--bg);
    border-radius: 0.36rem;
    padding: 0.72rem;
    gap: 0.54rem;
    display: flex;
    flex-direction: column;
}

/* ============================================
   SELETTORI ANNO E GIORNI GRAFICO
   ============================================ */
.year-display {
    margin-bottom: 0.54rem;
    text-align: center;
}

.year-display select {
    background: #2d3748;
    color: white;
    padding: 0.18rem 0.75rem;
    border: 1px solid #4a5568;
    border-radius: 0.18rem;
    font-size: 0.75rem;
}

/* ============================================
   SISTEMA GRIGLIA - ROWS
   ============================================ */

.row {
    display: grid;
    gap: 0.36rem;
    margin-bottom: 0.36rem;
}

.row-4-cols {
    grid-template-columns: repeat(4, 1fr);
}

.row-2-cols {
    grid-template-columns: repeat(2, 1fr);
}

/* ============================================
   GRID CON CARD CIRCOLARE CENTRALE
   ============================================ */
.top-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 0.54rem;
    margin-bottom: 0.54rem;
    position: relative;
}

/* ============================================
   CARD ANGOLARI - MODERNIZZATE ✨
   ============================================ */
.corner-card {
    background: #2d3748;
    border-radius: 0.5rem;
    padding: 0.64rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* ✅ MIGLIORATO: cubic-bezier */
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    /* ✅ NUOVO: Animazione ingresso */
    animation: slideInUp 0.6s ease-out backwards;
}

/* ✅ NUOVO: Stagger delay per effetto onda */
.corner-card:nth-child(1) { animation-delay: 0.1s; }
.corner-card:nth-child(2) { animation-delay: 0.2s; }
.corner-card:nth-child(3) { animation-delay: 0.3s; }
.corner-card:nth-child(4) { animation-delay: 0.4s; }

.corner-card:hover {
    transform: translateY(-5px); /* ✅ AUMENTATO: da -3px a -5px */
    border-color: var(--primary);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.4),  /* ✅ AUMENTATO: più profonda */
        0 4px 15px rgba(253, 144, 2, 0.3); /* ✅ AGGIUNTO: glow arancione */
}

.corner-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 64px;
    height: 64px;
    background: radial-gradient(circle, rgba(253, 144, 2, 0.15) 0%, transparent 70%); /* ✅ AUMENTATO: da 0.1 a 0.15 */
    pointer-events: none;
}

.corner-card.align-right .card-header {
    flex-direction: row-reverse;
}

.corner-card.align-right .card-info {
    text-align: right;
}

.corner-card.align-right .card-footer {
    flex-direction: row-reverse;
}

/* ============================================
   COMPONENTI INTERNI CARD ANGOLARI
   ============================================ */

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.48rem;
}

.card-info {
    flex: 1;
}

.card-label {
    font-size: 0.52rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.16rem;
}

/* ✅ CARD VALUE - MODERNIZZATO CON GLOW */
.card-value {
    font-size: 1.44rem;
    font-weight: 800; /* ✅ AUMENTATO: da 700 a 800 */
    line-height: 1;
    letter-spacing: -0.02em; /* ✅ AGGIUNTO: più compatto */
    text-shadow:
        0 0 20px currentColor,
        0 0 40px currentColor,
        0 2px 4px rgba(0, 0, 0, 0.3); /* ✅ AGGIUNTO: glow + shadow */
}

.card-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.16rem;
    font-size: 0.56rem;
    padding: 0.16rem 0.4rem;
    border-radius: 0.2rem;
    font-weight: 600;
    transition: all 0.3s ease; /* ✅ AGGIUNTO: transizione smooth */
}

/* ✅ TREND BADGE - PIÙ VIVACI */
.trend-positive {
    background: rgba(22, 163, 74, 0.3); /* ✅ AUMENTATO: da 0.2 a 0.3 */
    color: #86efac;
    box-shadow: 0 0 10px rgba(22, 163, 74, 0.4); /* ✅ AGGIUNTO: glow */
}

.trend-negative {
    background: rgba(220, 38, 38, 0.3); /* ✅ AUMENTATO: da 0.2 a 0.3 */
    color: #fca5a5;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.4); /* ✅ AGGIUNTO: glow */
}

.trend-neutral {
    background: rgba(148, 163, 184, 0.3); /* ✅ AUMENTATO: da 0.2 a 0.3 */
    color: #cbd5e1;
}

/* ✅ NUOVO: Pulse per grandi variazioni */
.trend-positive.trend-large,
.trend-negative.trend-large {
    animation: pulse 2s ease-in-out infinite;
}

.card-chart {
    height: 32px;
    margin-top: 0.32rem;
}

.card-chart canvas {
    width: 100% !important;
    height: 32px !important;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.48rem;
    padding-top: 0.48rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    font-size: 0.6rem;
    color: #ffffff;
}

/* ============================================
   CARD COLORS - GRADIENTI MODERNIZZATI ✨
   ============================================ */

/* ✅ HIT CARD - Verde più ricco */
.hit-card {
    background: linear-gradient(135deg,
        #047857 0%,    /* verde scuro */
        #10b981 50%,   /* verde medio */
        #34d399 100%   /* verde chiaro */
    );
}

/* ✅ MISS CARD - Rosso più intenso */
.miss-card {
    background: linear-gradient(135deg,
        #991b1b 0%,    /* rosso scuro */
        #dc2626 50%,   /* rosso medio */
        #ef4444 100%   /* rosso chiaro */
    );
}

/* ✅ TARGET CARD - Arancione più vibrante */
.target-card {
    background: linear-gradient(135deg,
        #ff8c00 0%,    /* arancione scuro */
        #ff6b00 50%,   /* arancione medio */
        #e65c00 100%   /* arancione profondo */
    );
}

/* ✅ PERCENT CARD - Blu più profondo */
.percent-card {
    background: linear-gradient(135deg,
        #1e40af 0%,    /* blu scuro */
        #3b82f6 50%,   /* blu medio */
        #60a5fa 100%   /* blu chiaro */
    );
}

/* ============================================
   CARD CIRCOLARE CENTRALE - MINI SOLO ICONA ✨
   ============================================ */
.central-circle-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    /* ✅ RIDOTTA: da 120px a 80px */
    width: 80px;
    height: 80px;

    border-radius: 50%;
    background: linear-gradient(145deg, #2f4058, #2d3748);
    border: 2px solid transparent;

    /* ✅ BREATHE + GLOW ANIMATO */
    box-shadow:
        0 0 20px rgba(255, 166, 0, 0.5),
        0 0 40px rgba(255, 166, 0, 0.3),
        0 8px 20px rgba(0, 0, 0, 0.4);

    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    background-clip: padding-box;

    /* ✅ BREATHE CONTINUO */
    animation: breathe 3s ease-in-out infinite;
}

/* ✅ BREATHE ANIMATION */
@keyframes breathe {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow:
            0 0 20px rgba(255, 166, 0, 0.5),
            0 0 40px rgba(255, 166, 0, 0.3),
            0 8px 20px rgba(0, 0, 0, 0.4);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.08);
        box-shadow:
            0 0 30px rgba(255, 166, 0, 0.8),
            0 0 60px rgba(255, 166, 0, 0.5),
            0 12px 30px rgba(0, 0, 0, 0.5);
    }
}

/* Bordo tricolore (sempre presente ma sottile) */
.central-circle-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(90deg,
        #009246 0%,
        #ffffff 50%,
        #ce2b37 100%);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
    opacity: 0.6; /* ✅ Sempre visibile ma leggero */
    transition: opacity 0.3s ease;
}

/* ✅ GLOW BLUR LAYER */
.central-circle-card::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255, 166, 0, 0.4),
        transparent 70%);
    filter: blur(12px);
    z-index: -2;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* HOVER: Più intenso */
.central-circle-card:hover {
    transform: translate(-50%, -50%) scale(1.15);
    background: linear-gradient(145deg, #007acc, #0066cc);
    box-shadow:
        0 0 40px rgba(0, 146, 70, 1),
        0 0 80px rgba(206, 43, 55, 1),
        0 15px 35px rgba(0, 102, 204, 0.7);
    animation: none; /* Stop breathe al hover */
}

.central-circle-card:hover::before {
    opacity: 1; /* Tricolore al massimo */
}

/* ACTIVE: Ripple effect */
.central-circle-card:active {
    transform: translate(-50%, -50%) scale(1.05);
}

.central-circle-card:active::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    from {
        transform: scale(1);
        opacity: 0.8;
    }
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ✅ ICONA SOLO - PIÙ GRANDE */
.central-circle-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
    animation: float 3s ease-in-out infinite;
}

/* ✅ FLOATING ICON */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
}

/* ✅ NASCONDI TESTO (mantieni solo icona) */
.central-circle-label,
.central-circle-sublabel {
    display: none !important;
}

/* ============================================
   BARREL STATS - MODERNIZZATE ✨
   ============================================ */
.circle-smaller {
    background: linear-gradient(135deg,
        #1e40af 0%,    /* blu scuro */
        #3b82f6 50%,   /* blu medio */
        #60a5fa 100%   /* blu chiaro */
    );
    padding: 0.36rem;
    min-height: 28px;
    min-width: 28px;
    font-size: 0.65rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 0.27rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;

    /* ✅ NUOVO: Animazione ingresso */
    animation: slideInUp 0.5s ease-out backwards;
}

/* ✅ NUOVO: Stagger per barrel stats */
.circle-smaller:nth-child(1) { animation-delay: 0.5s; }
.circle-smaller:nth-child(2) { animation-delay: 0.6s; }
.circle-smaller:nth-child(3) { animation-delay: 0.7s; }
.circle-smaller:nth-child(4) { animation-delay: 0.8s; }

.circle-smaller:hover {
    transform: translateY(-3px); /* ✅ AUMENTATO: da -2px a -3px */
    border-color: #60a5fa;
    box-shadow:
        0 8px 20px rgba(59, 130, 246, 0.5), /* ✅ AUMENTATO: più profondo */
        0 0 25px rgba(59, 130, 246, 0.3);   /* ✅ AGGIUNTO: glow */
}

.label {
    font-size: 0.65rem;
    margin-bottom: 0.18rem;
    white-space: nowrap;
    color: #bfdbfe;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.value {
    font-size: 0.72rem;
    font-weight: 700;
}

#rt-first-canna,
#rt-second-canna {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
}

#rt-first-canna:hover,
#rt-second-canna:hover {
    transform: translateY(-3px);
    border-color: #60a5fa;
    box-shadow:
        0 8px 20px rgba(59, 130, 246, 0.5),
        0 0 25px rgba(59, 130, 246, 0.3);
}

/* ============================================
   MINI STATS - MODERNIZZATE ✨
   ============================================ */
.mini-stat-card {
    background: linear-gradient(135deg,
        #1e40af 0%,
        #3b82f6 50%,
        #60a5fa 100%
    );
    border-radius: 0.5rem;
    padding: 0.56rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;

    /* ✅ NUOVO: Animazione ingresso */
    animation: slideInUp 0.5s ease-out backwards;
}

/* ✅ NUOVO: Stagger per mini stats */
.mini-stat-card:nth-child(1) { animation-delay: 0.9s; }
.mini-stat-card:nth-child(2) { animation-delay: 1.0s; }
.mini-stat-card:nth-child(3) { animation-delay: 1.1s; }
.mini-stat-card:nth-child(4) { animation-delay: 1.2s; }

.mini-stat-card:hover {
    transform: translateY(-3px);
    border-color: #60a5fa;
    box-shadow:
        0 8px 20px rgba(59, 130, 246, 0.5),
        0 0 25px rgba(59, 130, 246, 0.3);
}

.mini-stat-label {
    font-size: 0.52rem;
    color: #bfdbfe;
    margin-bottom: 0.24rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ✅ MINI STAT VALUE - CON GLOW */
.mini-stat-value {
    font-size: 1.12rem;
    font-weight: 800; /* ✅ AUMENTATO: da 700 a 800 */
    text-shadow:
        0 0 15px rgba(96, 165, 250, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.3); /* ✅ AGGIUNTO: glow blu */
}

/* ============================================
   PULSANTI RETTANGOLARI - MODERNIZZATI ✨
   ============================================ */
.rectangle {
    padding: 0.36rem;
    background: linear-gradient(145deg, #3a4556, #2d3748);
    color: white;
    text-decoration: none;
    border-radius: 0.18rem;
    text-align: center;
    font-size: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    display: block;

    /* ✅ NUOVO: Animazione ingresso */
    animation: slideInUp 0.5s ease-out backwards;
}

/* ✅ NUOVO: Stagger per rectangle buttons */
.rectangle:nth-child(1) { animation-delay: 1.3s; }
.rectangle:nth-child(2) { animation-delay: 1.4s; }
.rectangle:nth-child(3) { animation-delay: 1.5s; }
.rectangle:nth-child(4) { animation-delay: 1.6s; }

.rectangle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent); /* ✅ AUMENTATO: da 0.1 a 0.15 */
    transition: left 0.5s;
}

.rectangle:hover::before {
    left: 100%;
}

.rectangle:hover:not(.leaderboard-btn) {
    transform: translateY(-3px);
    background: linear-gradient(145deg, #fd9002, #e68002);
    box-shadow:
        0 10px 20px rgba(253, 144, 2, 0.5), /* ✅ AUMENTATO: più profondo */
        0 4px 8px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(253, 144, 2, 0.3), /* ✅ AGGIUNTO: glow */
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.rectangle:active:not(.leaderboard-btn) {
    transform: translateY(-1px);
    box-shadow:
        0 4px 8px rgba(253, 144, 2, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ============================================
   LEADERBOARDS - STILE SPECIALE
   ============================================ */
.rectangle.leaderboard-btn {
    position: relative;
    background: linear-gradient(145deg, #2f4058, #2d3748);
    border: 2px solid transparent;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    background-clip: padding-box;
}

.rectangle.leaderboard-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0.18rem;
    padding: 2px;
    background: linear-gradient(90deg,
        #009246 0%,
        #ffffff 50%,
        #ce2b37 100%);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.rectangle.leaderboard-btn:hover {
    background: linear-gradient(145deg, #007acc, #0066cc);
    transform: translateY(-5px);
    box-shadow:
        0 0 30px rgba(0, 146, 70, 1),
        0 0 60px rgba(206, 43, 55, 1),
        0 10px 20px rgba(0, 102, 204, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.rectangle.leaderboard-btn:hover::before {
    opacity: 1;
}

.rectangle.leaderboard-btn:active {
    transform: translateY(-2px);
    box-shadow:
        0 0 15px rgba(0, 146, 70, 0.8),
        0 0 30px rgba(206, 43, 55, 0.8),
        0 4px 8px rgba(0, 102, 204, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ============================================
   GRAFICO PRINCIPALE
   ============================================ */
#target-hit-chart {
    background: #2d3748;
    border-radius: 0.27rem;
    padding: 0.36rem;
    max-height: 144px;
    margin: 0.36rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* ✅ AGGIUNTO: shadow */
}

/* ============================================
   MODAL & POPUP (Unchanged)
   ============================================ */
.modal,
.detail-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
}

.modal.active,
.detail-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: #444;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
}

.detail-popup {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: #444;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
}

.popup-content {
    max-height: 85vh;
}

.popup-title {
    font-size: 1.5rem;
    color: #f4f4f4;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #555;
}

.session-header {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
    background: #333;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.header-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-item .label {
    color: #ccc;
}

.table-responsive {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #555;
    margin-bottom: 1rem;
}

.session-table {
    width: 100%;
    border-collapse: collapse;
}

.session-table th {
    background-color: #1a2fb4;
    color: white;
    padding: 10px;
    text-align: center;
    border: 1px solid #888;
    white-space: nowrap;
}

.session-table td {
    padding: 8px;
    text-align: center;
    border: 1px solid #888;
    background-color: #555;
}

.session-table tr:nth-child(even) td {
    background-color: #4a4a4a;
}

.session-table tbody tr.detail-row {
    cursor: pointer;
}

.session-table tbody tr.detail-row:hover td {
    background-color: #666;
}

.progress-bar {
    background: #555;
    border-radius: 4px;
    height: 20px;
    width: 80px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.sequence-box {
    background-color: #222;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    width: 100%;
    overflow: hidden;
}

.sequence-container {
    display: grid;
    grid-template-columns: repeat(25, 15px);
    column-gap: 2.25px;
    row-gap: 0px;
    margin: 10px 0;
    min-width: min-content;
    overflow-x: auto;
    padding-bottom: 10px;
}

.sequence-number {
    display: flex;
    flex-direction: column;
    height: 120px;
    width: 100%;
}

.number-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    background-color: inherit;
    color: inherit;
}

.direction-container {
    height: 25px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    background-color: #ffffff;
    color: rgb(0, 68, 255);
}

.sequence-number.hit-no {
    background-color: #ff0000;
    color: #fff;
}
.sequence-number.hit-c2 {
    background-color: #4CAF50;
    color: #fff;
}
.sequence-number.hit-c1 {
    background-color: #2E7D32;
    color: #fff;
}

.clickable-shot {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.clickable-shot:hover {
    transform: scale(1.15);
    z-index: 10;
    box-shadow: 0 0 20px rgba(253, 144, 2, 0.9);
}

.clickable-shot:active {
    transform: scale(1.05);
}

.clickable-shot::after {
    content: '🎯';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.clickable-shot:hover::after {
    opacity: 1;
}

.sequence-number:not(.clickable-shot) {
    cursor: default;
    opacity: 0.5;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    padding: 0 5px;
}

.close:hover {
    color: #fff;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .container {
        padding: 0.36rem;
    }

    .dashboard {
        padding: 0.54rem;
    }

    .central-circle-card {
        width: 75px;
        height: 75px;
    }

    .central-circle-icon {
        font-size: 2.2rem;
    }

    .session-header {
        flex-direction: column;
        gap: 1rem;
    }

    .modal-content,
    .detail-popup {
        overflow: auto;
    }

    .popup-content {
        overflow: auto;
    }

    .table-responsive {
        overflow: auto;
    }

    .sequence-box {
        overflow: auto;
    }

    .sequence-container {
        grid-template-columns: repeat(25, 12px);
    }

    .sequence-number {
        height: 120px;
        font-size: 10px;
    }

    .session-table th,
    .session-table td {
        padding: 6px;
        font-size: 14px;
    }

    .progress-bar {
        width: 60px;
        height: 18px;
    }

    .progress-bar span {
        font-size: 0.7rem;
        line-height: 18px;
    }

    .clickable-shot::after {
        font-size: 10px;
        top: -5px;
        right: -5px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.36rem;
    }

    .dashboard {
        padding: 0.54rem;
    }

    .central-circle-card {
        width: 70px;
        height: 70px;
    }

    .central-circle-icon {
        font-size: 2rem;
    }

    .row-2-cols {
        grid-template-columns: repeat(2, 1fr);
    }

    .row-4-cols {
        grid-template-columns: repeat(4, 1fr);
    }

    .label {
        font-size: 0.54rem;
    }

    .value {
        font-size: 0.66rem;
    }

    .rectangle {
        padding: 0.3rem;
        font-size: 0.66rem;
    }

    .sequence-number {
        height: 100px;
        font-size: 9px;
    }

    .sequence-number.direction {
        height: 20px;
    }

    .session-table th,
    .session-table td {
        padding: 4px;
        font-size: 12px;
    }

    .popup-title {
        font-size: 1.2rem;
    }

    .card-value {
        font-size: 1.5rem;
    }

    .clickable-shot::after {
        font-size: 8px;
        top: -3px;
        right: -3px;
    }
}