* {
    -webkit-tap-highlight-color: transparent;
}

:root {
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.5);
    --elite-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    /* Multi-layer elevation */
    --accent-primary: #6366f1;
    /* Indigo vibrant */
    --accent-secondary: #3b82f6;
    --text-main: #1e1b4b;
    /* Deep Indigo - NOT BLACK */
    --steel-bg: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    /* Technical Off-White Neutral */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--steel-bg);
    min-height: 100vh;
    color: var(--text-main);
}

/* Page Navigation System */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Original Base Styles */
.stat-card {
    background: white;
    border: 1px solid var(--glass-border);
    box-shadow: var(--elite-shadow);
    backdrop-filter: blur(8px);
}

.strategy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.strategy-btn:active {
    transform: scale(0.95);
}

.match-card {
    background: white;
    border: 1px solid var(--glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-main);
    box-shadow: var(--elite-shadow);
    border-radius: 20px;
}

/* Glassmorphism Components */
.glass-card-premium {
    background: white;
    border: 2px solid rgba(26, 86, 219, 0.25) !important;
    box-shadow: var(--elite-shadow), 0 0 0 1px rgba(26, 86, 219, 0.08);
    border-radius: 24px;
    margin-bottom: 16px;
}

/* Magia AI Scanner Card */
.magia-scanner-card {
    background: white;
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.1);
    color: #1e293b;
    margin-bottom: 12px;
}

.magia-glow-text {
    text-shadow: 0 0 10px rgba(103, 232, 249, 0.5);
}

.prob-bar-container {
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    display: flex;
    overflow: hidden;
}

.prob-segment-home {
    background: var(--accent-secondary);
}

.prob-segment-draw {
    background: #94a3b8;
}

.prob-segment-away {
    background: #a855f7;
}

/* Multi-step animations */
@keyframes scanning-neon {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.animate-scan {
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.2), transparent);
    background-size: 200% 100%;
    animation: scanning-neon 3s linear infinite;
}

/* Navigation & Utility */
.nav-btn.active {
    color: white !important;
    position: relative;
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    width: 20px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 99px;
    box-shadow: 0 0 10px var(--accent-primary);
}

.eugenio-why-box {
    background: rgba(139, 92, 246, 0.1);
    border-left: 3px solid var(--accent-primary);
    padding: 8px 12px;
    border-radius: 0 8px 8px 0;
    font-size: 12px;
    font-style: italic;
    color: #1e293b;
}

/* --- VALUE EDGE & euGENIO PREMIUM STYLES --- */
.value-edge-badge {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.eugenio-premium-card {
    background: linear-gradient(145deg, #ffffff 0%, #f5f3ff 100%);
    border: 1px solid #ddd6fe;
    border-radius: 28px;
    box-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.15);
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    transition: transform 0.3s ease;
}

.eugenio-premium-card:hover {
    transform: translateY(-2px);
}

.eugenio-premium-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    padding: 16px 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eugenio-magic-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.animate-pulse-slow {
    animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* --- I CONSIGLI: PREMIUM LIGHT & VIBRANT DESIGN --- */
.glass-parlay-card {
    background: white !important;
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    box-shadow: var(--elite-shadow);
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    padding: 0;
    /* Clear padding for header and content separation */
}

.glass-parlay-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    pointer-events: none;
}

.glass-item-premium {
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 20px;
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.glass-item-premium:last-child {
    margin-bottom: 0;
}

.glass-item-premium:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.team-vertical-box {
    flex: 1;
    min-width: 0;
}

.team-name-row {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 2px;
}

.tip-label-badge {
    display: inline-block;
    background: rgba(251, 146, 60, 0.2);
    color: #fb923c;
    /* Orange-400 */
    font-size: 11px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    margin-right: 8px;
}

.confidence-label {
    font-size: 10px;
    color: #64748b;
    font-weight: 700;
}

.odd-highlight-v5 {
    background: #fbbf24;
    color: #1e293b;
    padding: 8px 12px;
    border-radius: 14px;
    font-weight: 950;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
    min-width: 65px;
    text-align: center;
}

.tip-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.roi-badge {
    background: #16a34a;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

/* --- SURGICAL FILTERS NAVIGATION --- */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.filter-chip {
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.filter-chip.active {
    background: white;
    color: #1e293b;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
    border-color: white;
}

/* ==================== MATCH POPUP DESIGN SYSTEM ==================== */

/* Popup Glass Effect */
.match-popup-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Modal states */
#match-popup-overlay.active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

#match-popup-overlay.active #match-popup-modal {
    transform: translateY(0) scale(1) !important;
    opacity: 1 !important;
}

/* Pressure Gauge Colors */
.pressure-yellow { color: #facc15; }
.pressure-orange { color: #fb923c; }
.pressure-red { color: #ef4444; }

.pressure-bg-yellow { background: rgba(250, 204, 21, 0.1); }
.pressure-bg-orange { background: rgba(251, 146, 60, 0.1); }
.pressure-bg-red { background: rgba(239, 68, 68, 0.1); }

/* Live Stat Progress Bars */
.live-stat-container {
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 99px;
    overflow: hidden;
}

.live-stat-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Operational Timeline */
.timeline-event {
    border-left: 2px solid #e2e8f0;
    padding-left: 16px;
    position: relative;
    padding-bottom: 16px;
}

.timeline-event::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    border: 2px solid white;
}

.timeline-event.urgent {
    border-left-color: #ef4444;
}

.timeline-event.urgent::before {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    animation: pulse 2s infinite;
}

/* Trading Card Neon Borders */
.trading-card-neon {
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.15), 0 0 3px rgba(99, 102, 241, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
}

/* Section Header */
.popup-section-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    margin-bottom: 8px;
}

/* Animations pulse for alerts */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* ==================== TRADING COCKPIT PRO (ITALIAN BALANCED) ==================== */

.trading-cockpit-dark {
    background: #0a0f1e;
    /* Teniamo i bordi solo sopra e sotto */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-left: none;
    border-right: none;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);

    /* Raggiungiamo il bordo senza arrotondamenti */
    border-radius: 0;

    /* Padding coordinato */
    padding: 12px 0;
}

/* Variante CHIARA (azzurrino) — Socio 18/06/2026 */
.trading-cockpit-light {
    background: #d4e6f8;
    border-top: 1px solid rgba(19, 50, 122, 0.08);
    border-bottom: 1px solid rgba(19, 50, 122, 0.08);
    border-left: none;
    border-right: none;
    box-shadow: 0 30px 60px -12px rgba(19, 50, 122, 0.15);
    border-radius: 0;
    padding: 12px 0;
}

.strategy-badge {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.28);
    color: #4338ca;
    letter-spacing: 0.1em;
}

.hero-score {
    font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
    font-size: 2.25rem; /* 36px - La via di mezzo */
    font-weight: 800;
    color: #dc2626;
    line-height: 1;
}

.hero-minute {
    font-size: 1.5rem; /* 24px - Bilanciato */
    font-weight: 700;
    color: #34d399; /* Emerald 400 */
}

.stats-box-pro {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.stats-label-pro {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #64748b;
}

.pressure-progress-container {
    height: 8px;
    background: #1e293b;
    border-radius: 99px;
    overflow: hidden;
}

.pressure-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #fbbf24 50%, #ef4444 100%);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.eugenio-insight-premium::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 3px; height: 100%;
    background: linear-gradient(to bottom, #6366f1, #a855f7);
}

/* Stat Chips for Goal Probabilities */
.stat-chip-trading {
    background: white;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 6px -2px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.stat-chip-trading:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
    border-color: #e2e8f0;
}

/* --- V4+ SCIENTIFIC FILTERS & ACCORDION ANIMATIONS --- */
.comp-type-btn {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-color: rgba(99, 102, 241, 0.2) !important;
    background: rgba(99, 102, 241, 0.05) !important;
    color: #4f46e5 !important;
}
.comp-type-btn.active {
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.dark .comp-type-btn {
    border-color: rgba(129, 140, 248, 0.2) !important;
    background: rgba(129, 140, 248, 0.05) !important;
    color: #818cf8 !important;
}
.dark .comp-type-btn.active {
    background: #6366f1 !important;
    border-color: #6366f1 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    /* 🔧 Fix Socio 05/07: il cap a 500px tagliava l'accordion filtri (9 card in colonna
       singola su mobile superano abbondantemente i 1000px), l'ultima card "Tipo di esito"
       finiva nella zona tagliata → sembrava che lo scroll si bloccasse lì. Alzato a 2000px:
       serve solo per l'animazione di apertura, non deve mai limitare l'altezza reale. */
    from { max-height: 0; opacity: 0; overflow: hidden; }
    to { max-height: 2000px; opacity: 1; }
}

.animate-fade-in {
    animation: fadeIn 0.2s ease-out forwards;
}
.animate-slide-down {
    animation: slideDown 0.3s ease-out forwards;
}

/* Custom Range Slider Styling for Modern Premium Look */
input[type="range"]::-webkit-slider-thumb {
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    border: 2px solid #ffffff;
    transition: transform 0.1s ease;
}
input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.2);
}

/* Odds Movement Badge */
.odds-movement-badge {
    font-size: 10px;
    font-weight: 850;
    padding: 2px 6px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
.odds-up {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #22c55e !important;
    border: 1px solid rgba(34, 197, 94, 0.25) !important;
}
.odds-down {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
}

/* ═══════════════════════════════════════════════════════════════ */
/* GRID 6 COLONNE — tutti i chip su una riga (no scroll laterale)  */
/* Responsive: 6col su desktop, 3col su tablet, 2col su mobile     */
/* ═══════════════════════════════════════════════════════════════ */
.chips-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 8px;
}
@media (max-width: 720px) {
    .chips-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}
@media (max-width: 420px) {
    .chips-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* ═══════════════════════════════════════════════════════════════ */
/* SMART PRESET BAR — Hero chips                                   */
/* ═══════════════════════════════════════════════════════════════ */
.smart-preset {
    position: relative; /* per ancorare l'icona info ⓘ */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 14px 12px 12px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(248,250,252,0.85));
    border: 1.5px solid rgba(226,232,240,0.8);
    box-shadow:
        0 1px 2px rgba(15,23,42,0.04),
        0 4px 12px rgba(15,23,42,0.06);
    transition: transform 200ms cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 200ms ease,
                border-color 200ms ease;
    text-align: left;
    cursor: pointer;
    min-height: 100px;
    user-select: none;
}

/* ═══════════════════════════════════════════════════════════════ */
/* INFO ICON ⓘ — in alto a destra di ogni chip e filtro tecnico   */
/* ═══════════════════════════════════════════════════════════════ */
.info-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(100,116,139,0.12);
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: help;
    border: none;
    transition: all 150ms ease;
    z-index: 2;
}
.info-icon:hover {
    background: rgba(79,70,229,0.18);
    color: #4f46e5;
    transform: scale(1.15);
}
.smart-preset.active .info-icon {
    background: rgba(255,255,255,0.28);
    color: white;
}
.smart-preset.active .info-icon:hover {
    background: rgba(255,255,255,0.45);
}
/* Versione inline (usata accanto alle label dei filtri tecnici) */
.info-icon-inline {
    position: static;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: inline-flex;
    margin-left: 4px;
    vertical-align: middle;
}

.smart-preset:hover {
    transform: translateY(-2px);
    box-shadow:
        0 4px 8px rgba(15,23,42,0.06),
        0 12px 24px rgba(15,23,42,0.10);
}

.smart-preset:active {
    transform: translateY(0) scale(0.97);
}

.smart-preset .preset-icon {
    font-size: 24px;
    line-height: 1;
    margin-bottom: 6px;
    filter: drop-shadow(0 2px 4px rgba(15,23,42,0.12));
}

.smart-preset .preset-label {
    font-size: 13px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
}

.smart-preset .preset-tagline {
    font-size: 10.5px;
    font-weight: 600;
    color: #64748b;
    margin-top: 2px;
    letter-spacing: 0.01em;
}

/* Stato attivo per ciascun colore */
.smart-preset.active[data-color="emerald"] {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #047857;
    box-shadow: 0 8px 24px rgba(16,185,129,0.35);
}
.smart-preset.active[data-color="orange"] {
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-color: #c2410c;
    box-shadow: 0 8px 24px rgba(249,115,22,0.35);
}
.smart-preset.active[data-color="purple"] {
    background: linear-gradient(135deg, #a855f7, #9333ea);
    border-color: #7e22ce;
    box-shadow: 0 8px 24px rgba(168,85,247,0.35);
}
.smart-preset.active[data-color="indigo"] {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-color: #4338ca;
    box-shadow: 0 8px 24px rgba(99,102,241,0.35);
}
.smart-preset.active[data-color="blue"] {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #1d4ed8;
    box-shadow: 0 8px 24px rgba(59,130,246,0.35);
}
.smart-preset.active[data-color="amber"] {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #b45309;
    box-shadow: 0 8px 24px rgba(245,158,11,0.35);
}

.smart-preset.active .preset-label,
.smart-preset.active .preset-tagline {
    color: white;
}

.smart-preset.active .preset-tagline {
    color: rgba(255,255,255,0.85);
}

/* Pulse animation sul chip appena attivato */
@keyframes pulse-once {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}
.smart-preset.just-activated {
    animation: pulse-once 360ms cubic-bezier(0.34,1.56,0.64,1);
}

/* Counter animato */
#visible-count-hero {
    transition: color 200ms ease;
}
#visible-count-hero.bump {
    animation: count-bump 280ms ease-out;
}
@keyframes count-bump {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.15); color: #10b981; }
    100% { transform: scale(1); }
}

/* Dark mode: SOLO class-based (.dark), mai automatico via sistema — PWA sempre light */
.dark .smart-preset {
    background: linear-gradient(135deg, rgba(30,41,59,0.85), rgba(15,23,42,0.85));
    border-color: rgba(51,65,85,0.6);
}
.dark .smart-preset .preset-label { color: #f1f5f9; }
.dark .smart-preset .preset-tagline { color: #94a3b8; }

/* ⓘ INFO POP-UP Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999; /* ensure it's on top of everything */
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
    padding: 20px;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal-card {
    background: white;
    border-radius: 24px;
    max-width: 460px;
    width: 100%;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.92) translateY(20px);
    transition: transform 280ms cubic-bezier(0.34,1.56,0.64,1);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-overlay.open .modal-card { transform: scale(1) translateY(0); }

.modal-card .modal-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; position: relative; }
.modal-card .modal-icon { font-size: 38px; line-height: 1; flex-shrink: 0; }
.modal-card .modal-title-block { flex: 1; }
.modal-card .modal-eyebrow { font-size: 10px; font-weight: 800; color: #6366f1; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.modal-card .modal-title { font-size: 20px; font-weight: 900; color: #1e293b; line-height: 1.2; }

.modal-card .modal-close {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #64748b;
    background: rgba(100,116,139,0.08);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 150ms;
}
.modal-card .modal-close:hover {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}

.modal-card .modal-body { font-size: 14px; color: #475569; line-height: 1.55; text-align: left; }
.modal-card .modal-body p { margin-bottom: 12px; }
.modal-card .modal-body strong { color: #1e293b; font-weight: 800; }
.modal-card .modal-body .example {
    background: #f8fafc;
    border-left: 3px solid #4f46e5;
    padding: 10px 14px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 13px;
    color: #334155;
}
.modal-card .modal-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
}
.modal-card .modal-footer .btn-primary {
    background: #4f46e5;
    color: white;
    padding: 10px 18px;
    border-radius: 12px;
    border: none;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all 150ms;
}
.modal-card .modal-footer .btn-primary:hover { background: #4338ca; }

.dark .modal-card {
    background: #1e293b;
    color: #f1f5f9;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.dark .modal-card .modal-title { color: #ffffff; }
.dark .modal-card .modal-body { color: #cbd5e1; }
.dark .modal-card .modal-body strong { color: #ffffff; }
.dark .modal-card .modal-body .example {
    background: rgba(15,23,42,0.3);
    border-left-color: #6366f1;
    color: #94a3b8;
}
.dark .modal-card .modal-footer { border-top-color: rgba(51,65,85,0.5); }

/* ═══════════════════════════════════════════════════════════════ */
/* PREMIUM RANGE SLIDERS FOR BIG FINGERS 🖐️                      */
/* ═══════════════════════════════════════════════════════════════ */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px !important; /* Premium 10px track height */
    background: #e2e8f0;
    border-radius: 99px;
    outline: none;
    transition: background 150ms ease;
    margin: 14px 0 10px !important; /* Extra spacing to prevent vertical collision */
}

.dark input[type="range"] {
    background: #334155;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 10px;
    cursor: pointer;
    border-radius: 99px;
    background: transparent;
}

/* Chrome/Safari: Large thumb for easy grab on mobile */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px !important; /* 28px diameter makes it extremely grab-friendly */
    height: 28px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 4px solid currentColor !important; /* Premium accent color border */
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25) !important;
    cursor: pointer !important;
    transition: transform 120ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 120ms ease !important;
    margin-top: -9px !important; /* Centered perfectly: (10px / 2) - (28px / 2) = -9px */
}

input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.25) !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.35) !important;
}

/* Firefox: Large thumb support */
input[type="range"]::-moz-range-track {
    width: 100%;
    height: 10px;
    cursor: pointer;
    border-radius: 99px;
    background: transparent;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 4px solid currentColor !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25) !important;
    cursor: pointer !important;
    transition: transform 120ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 120ms ease !important;
    box-sizing: border-box;
}

input[type="range"]::-moz-range-thumb:active {
    transform: scale(1.25) !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.35) !important;
}

/* Color accents mapping to sliders */
#filter-trust { color: #6366f1 !important; }       /* Indigo */
#filter-winrate { color: #10b981 !important; }     /* Emerald */
#filter-sample { color: #f43f5e !important; }      /* Rose */
#filter-smart { color: #a855f7 !important; }       /* Purple */
#filter-power-gap { color: #f59e0b !important; }   /* Amber */

/* ═══════════════════════════════════════════════════════════════ */
/* PRESET PERSONALI (Full/Founder) — chip "TUO" in cima alla griglia */
/* Distinti dai preset di sistema: accento indaco + badge 👤 + × elimina */
/* ═══════════════════════════════════════════════════════════════ */
.smart-preset-custom {
    background: linear-gradient(135deg, rgba(238,242,255,0.95), rgba(224,231,255,0.9));
    border: 1.5px solid rgba(129,140,248,0.55);
}
.smart-preset-custom .preset-label { color: #3730a3; }
.smart-preset-custom .preset-tagline { color: #6366f1; }
/* Badge "TUO" in alto a sinistra per riconoscere i preset personali a colpo d'occhio */
.smart-preset-custom .custom-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.06em;
    color: #4f46e5;
    background: rgba(79,70,229,0.12);
    padding: 2px 6px;
    border-radius: 6px;
    text-transform: uppercase;
    z-index: 2;
}
/* × elimina — in basso a destra, non collide con l'area di tap principale */
.smart-preset-custom .custom-delete {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(244,63,94,0.1);
    color: #f43f5e;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    border: none;
    cursor: pointer;
    transition: all 150ms ease;
    z-index: 3;
}
.smart-preset-custom .custom-delete:hover {
    background: rgba(244,63,94,0.9);
    color: #fff;
    transform: scale(1.15);
}
.smart-preset-custom.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-color: #4338ca;
    box-shadow: 0 8px 24px rgba(99,102,241,0.35);
}
.smart-preset-custom.active .preset-label,
.smart-preset-custom.active .preset-tagline { color: #fff; }
.smart-preset-custom.active .custom-badge {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* Bottone "💾 Salva selezione" nel banner filtri attivi (solo Full/Founder) */
#btn-save-preset {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 900;
    color: #4f46e5;
    background: rgba(79,70,229,0.1);
    border: 1px solid rgba(79,70,229,0.25);
    padding: 4px 10px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
}
#btn-save-preset:hover { background: rgba(79,70,229,0.9); color: #fff; }
#btn-save-preset:active { transform: scale(0.95); }

/* Sfondo intestazione card blindato in blu reale brillante (Socio) */
.header-container {
    background-color: #1a56db !important;
}

/* 🖥️ RESPONSIVE DESKTOP LAYOUT (SOCIO OPTION B) */
@media (min-width: 1024px) {
    body {
        background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%) !important;
        background-attachment: fixed !important;
    }
    
    #app-container {
        width: 100%;
        max-width: 1024px;
        margin: 0 auto;
        min-height: 100vh;
        background: var(--steel-bg);
        box-shadow: 0 0 100px rgba(0,0,0,0.5);
        border-left: 1px solid rgba(255,255,255,0.06);
        border-right: 1px solid rgba(255,255,255,0.06);
        position: relative;
    }
    
    #bottom-nav-bar {
        max-width: 1024px;
        margin: 0 auto;
        left: 0;
        right: 0;
    }
    
    /* Layout a griglia per le card nelle pagine */
    #matches-container,
    #my-matches-container,
    #trading-favorites-container {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 20px !important;
        margin-bottom: 24px !important;
        space-y: 0 !important;
    }
    
    /* Elimina le margin standard verticali delle card quando inserite nella griglia */
    #matches-container > *,
    #my-matches-container > *,
    #trading-favorites-container > * {
        margin-bottom: 0 !important;
        margin-top: 0 !important;
    }
}