/* =============================================
   LOTTOMETRO - Public Stylesheet
   ============================================= */

:root {
    --lotto-blue:       #1a3c5e;
    --lotto-blue-mid:   #2e6da4;
    --lotto-blue-light: #ebf5fb;
    --lotto-red:        #e74c3c;
    --lotto-green:      #27ae60;
    --lotto-yellow:     #f39c12;
    --lotto-gray:       #6c757d;
    --lotto-border:     #dee2e6;
    --lotto-radius:     8px;
}

/* ── Wrapper ── */
.lotto-wrap, .lotto-home { max-width: 100%; }

.lotto-section-title {
    font-size: 1.5em;
    color: var(--lotto-blue);
    border-left: 4px solid var(--lotto-blue-mid);
    padding-left: 12px;
    margin: 30px 0 15px;
}

.lotto-intro {
    color: #555;
    font-size: 0.97em;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* ── Countdown ── */
.lotto-countdown-wrap {
    background: linear-gradient(135deg, var(--lotto-blue), var(--lotto-blue-mid));
    color: #fff;
    border-radius: var(--lotto-radius);
    padding: 20px 25px;
    text-align: center;
    margin-bottom: 30px;
}
.lotto-countdown-label { font-size: 0.85em; opacity: 0.85; text-transform: uppercase; letter-spacing: 1px; }
.lotto-countdown-date  { font-size: 1.2em; font-weight: 700; margin: 6px 0 16px; }
.lotto-countdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.lotto-cd-block { text-align: center; }
.lotto-cd-num {
    display: block;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    font-size: 2em;
    font-weight: 900;
    min-width: 54px;
    padding: 4px 8px;
    font-variant-numeric: tabular-nums;
}
.lotto-cd-lbl  { font-size: 0.7em; opacity: 0.8; margin-top: 4px; display: block; }
.lotto-cd-sep  { font-size: 2em; font-weight: 900; opacity: 0.7; margin-bottom: 18px; }

/* ── Tables ── */
.lotto-table-wrap { overflow-x: auto; margin: 16px 0; }

.lotto-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93em;
}
.lotto-table th {
    background: var(--lotto-blue);
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}
.lotto-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--lotto-border);
    white-space: nowrap;
}
.lotto-table tbody tr:nth-child(even) { background: var(--lotto-blue-light); }
.lotto-table tbody tr:hover { background: #d6eaf8; }
.lotto-table .danger  { background: #fdecea !important; }
.lotto-table .warning { background: #fef9e7 !important; }
.lotto-table .lotto-top5 { background: #eaf4ff !important; font-weight: 600; }

/* ── Numbers ── */
.lotto-num {
    font-weight: 700;
    font-size: 1.05em;
    text-align: center;
    color: var(--lotto-blue);
    font-variant-numeric: tabular-nums;
}
.lotto-ruota-name { font-weight: 600; color: var(--lotto-blue); }

/* ── Balls (previsioni) ── */
.lotto-prev-card {
    background: #fff;
    border: 1px solid var(--lotto-border);
    border-radius: var(--lotto-radius);
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.lotto-prev-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.lotto-prev-ruota { font-weight: 700; font-size: 1.1em; color: var(--lotto-blue); }
.lotto-prev-detail-link { font-size: 0.88em; color: var(--lotto-blue-mid); text-decoration: none; }
.lotto-prev-detail-link:hover { text-decoration: underline; }
.lotto-prev-nums { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.lotto-ball {
    width: 46px; height: 46px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 1.1em;
}
.lotto-ball-prev {
    background: linear-gradient(135deg, var(--lotto-blue-mid), var(--lotto-blue));
    color: #fff;
    box-shadow: 0 2px 6px rgba(30,100,200,0.3);
}
.lotto-prev { color: var(--lotto-blue-mid); font-weight: 700; }
.lotto-prev-riserva { font-size: 0.85em; color: var(--lotto-gray); }

/* ── Data label ── */
.lotto-data-label { color: var(--lotto-gray); font-size: 0.92em; margin-bottom: 10px; }

/* ── Estrazione block (details) ── */
.lotto-estrazione-block {
    border: 1px solid var(--lotto-border);
    border-radius: var(--lotto-radius);
    margin-bottom: 10px;
    overflow: hidden;
}
.lotto-est-summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    background: var(--lotto-blue-light);
    color: var(--lotto-blue);
    list-style: none;
}
.lotto-est-summary:hover { background: #d6eaf8; }

/* ── Stats grid (indice) ── */
.lotto-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}
.lotto-stat-card {
    background: #fff;
    border: 1px solid var(--lotto-border);
    border-radius: var(--lotto-radius);
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s;
    display: block;
}
.lotto-stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); transform: translateY(-2px); }
.lotto-stat-card-icon  { font-size: 2em; margin-bottom: 8px; }
.lotto-stat-card-title { font-weight: 700; color: var(--lotto-blue); margin-bottom: 6px; }
.lotto-stat-card-desc  { font-size: 0.85em; color: var(--lotto-gray); }

/* ── Stat mini cards ── */
.lotto-stats-cards {
    display: flex; flex-wrap: wrap; gap: 16px; margin: 20px 0;
}
.lotto-stat-mini {
    background: var(--lotto-blue-light);
    border: 1px solid #c8e0f4;
    border-radius: var(--lotto-radius);
    padding: 16px 24px;
    text-align: center;
    min-width: 140px;
}
.lotto-stat-val { display: block; font-size: 1.6em; font-weight: 900; color: var(--lotto-blue); }
.lotto-stat-lbl { font-size: 0.8em; color: var(--lotto-gray); margin-top: 4px; display: block; }

/* ── Heatmap ── */
.lotto-heatmap {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
    margin: 16px 0 24px;
    max-width: 100%;
}
.lotto-hm-cell {
    aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78em; font-weight: 700;
    border-radius: 4px;
    cursor: default;
    transition: transform 0.1s;
}
.lotto-hm-cell:hover { transform: scale(1.2); z-index: 10; }

/* ── Progress bar ── */
.lotto-progress-bar {
    width: 80px; height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}
.lotto-progress-fill {
    height: 100%; border-radius: 4px;
    background: linear-gradient(to right, var(--lotto-green), var(--lotto-yellow), var(--lotto-red));
}

/* ── Ruota selector ── */
.lotto-ruota-selector {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 24px;
}
.lotto-ruota-btn {
    padding: 6px 14px;
    border: 1px solid var(--lotto-blue-mid);
    border-radius: 20px;
    text-decoration: none;
    color: var(--lotto-blue-mid);
    font-size: 0.88em;
    font-weight: 600;
    transition: all 0.2s;
}
.lotto-ruota-btn:hover, .lotto-ruota-btn.active {
    background: var(--lotto-blue-mid);
    color: #fff;
}

/* ── Month selector ── */
.lotto-month-selector {
    display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px;
}
.lotto-month-btn {
    padding: 5px 12px;
    border: 1px solid var(--lotto-border);
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    font-size: 0.85em;
}
.lotto-month-btn.active { background: var(--lotto-blue-mid); color: #fff; border-color: var(--lotto-blue-mid); }

/* ── Chart wrap ── */
.lotto-chart-wrap {
    background: #fff;
    border: 1px solid var(--lotto-border);
    border-radius: var(--lotto-radius);
    padding: 20px;
    margin: 20px 0;
}

/* ── Two col ── */
.lotto-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 16px 0;
}
@media (max-width: 768px) {
    .lotto-two-col { grid-template-columns: 1fr; }
    .lotto-heatmap { grid-template-columns: repeat(9, 1fr); }
    .lotto-cd-num  { font-size: 1.4em; min-width: 40px; }
}

/* ── Tabellone ── */
.lotto-tabellone-filters {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
}
.lotto-filter-btn, .lotto-tabellone-print {
    padding: 6px 14px;
    border: 1px solid var(--lotto-border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.88em;
    background: #fff;
    transition: all 0.2s;
}
.lotto-filter-btn.active, .lotto-filter-btn:hover { background: var(--lotto-blue-mid); color: #fff; border-color: var(--lotto-blue-mid); }
.lotto-tabellone-print { background: var(--lotto-blue); color: #fff; border-color: var(--lotto-blue); }

.lotto-tabellone-top {
    display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.lotto-ritard-badge {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--lotto-radius);
    padding: 8px 14px;
}
.lotto-ritard-num { font-weight: 900; font-size: 1.3em; color: var(--lotto-blue); margin-right: 8px; }
.lotto-ritard-info { font-size: 0.82em; color: #666; }

/* Old tabellone rules removed */
.lotto-tab-data { font-size: 0.82em; color: #555; white-space: nowrap; }

/* ── Combo ── */
.lotto-combo { font-weight: 700; letter-spacing: 1px; color: var(--lotto-blue); }

/* ── Method box ── */
.lotto-method-box {
    background: var(--lotto-blue-light);
    border-left: 4px solid var(--lotto-blue-mid);
    border-radius: var(--lotto-radius);
    padding: 20px 24px;
    margin: 24px 0;
}
.lotto-method-box h3 { color: var(--lotto-blue); margin-top: 0; }
.lotto-method-box ul { padding-left: 20px; }
.lotto-method-box li { margin-bottom: 6px; }

/* ── Disclaimer ── */
.lotto-disclaimer {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 0.88em;
    color: #856404;
    margin-top: 16px;
}

/* ── Empty ── */
.lotto-empty { color: var(--lotto-gray); font-style: italic; }

/* ── Sortable table ── */
.lotto-table-sortable th { cursor: pointer; user-select: none; }
.lotto-table-sortable th::after { content: ' ↕'; opacity: 0.5; font-size: 0.8em; }
.lotto-table-sortable th.sort-asc::after  { content: ' ↑'; opacity: 1; }
.lotto-table-sortable th.sort-desc::after { content: ' ↓'; opacity: 1; }

@media print {
    .lotto-ruota-selector, .lotto-tabellone-filters, .lotto-countdown-wrap { display: none !important; }
    .lotto-table th { background: #ccc !important; color: #000 !important; }
}

/* ── Window Selector ── */
.lotto-window-selector {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: var(--lotto-blue-light);
    border-radius: var(--lotto-radius);
    border: 1px solid #c8e0f4;
}
.lotto-window-label { font-size: 0.88em; font-weight: 600; color: var(--lotto-blue); margin-right: 4px; }
.lotto-window-btn {
    padding: 4px 12px;
    border: 1px solid var(--lotto-blue-mid);
    border-radius: 20px;
    text-decoration: none;
    color: var(--lotto-blue-mid);
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s;
}
.lotto-window-btn:hover, .lotto-window-btn.active {
    background: var(--lotto-blue-mid);
    color: #fff;
}

/* ── Tipo Ambo Selector ── */
.lotto-tipo-selector {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
}
.lotto-tipo-btn {
    padding: 7px 14px;
    border: 1px solid var(--lotto-border);
    border-radius: var(--lotto-radius);
    text-decoration: none;
    color: inherit;
    font-size: 0.88em;
    transition: all 0.2s;
    background: #fff;
}
.lotto-tipo-btn:hover, .lotto-tipo-btn.active {
    background: var(--lotto-blue);
    color: #fff;
    border-color: var(--lotto-blue);
}
.lotto-tipo-count { font-size: 0.8em; opacity: 0.7; margin-left: 4px; }

/* ── Order Bar ── */
.lotto-order-bar {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 12px;
    font-size: 0.88em; color: var(--lotto-gray);
}
.lotto-order-btn {
    padding: 4px 10px;
    border: 1px solid var(--lotto-border);
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    font-size: 0.9em;
}
.lotto-order-btn.active { background: var(--lotto-blue-mid); color: #fff; border-color: var(--lotto-blue-mid); }

/* ── Spia Grid ── */
.lotto-spia-grid { cursor: pointer; }
.lotto-spia-cell {
    text-decoration: none;
    background: var(--lotto-blue-light) !important;
    color: var(--lotto-blue) !important;
    border: 1px solid #c8e0f4;
    font-weight: 700;
    transition: all 0.15s;
}
.lotto-spia-cell:hover {
    background: var(--lotto-blue-mid) !important;
    color: #fff !important;
    transform: scale(1.15);
    z-index: 10;
}
.lotto-spia-config {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin-bottom: 20px;
    padding: 10px 14px;
    background: var(--lotto-blue-light);
    border-radius: var(--lotto-radius);
    border: 1px solid #c8e0f4;
}
.lotto-spia-form {
    display: flex; gap: 10px; align-items: center; margin-top: 8px;
}
.lotto-input-num {
    width: 90px; padding: 7px 10px;
    border: 1px solid var(--lotto-border);
    border-radius: 4px; font-size: 1em;
}
.lotto-spia-detail { margin-top: 20px; }

/* ── Ciclometrica ── */
.lotto-ciclo-header {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 20px;
    background: var(--lotto-blue-light);
    border-radius: var(--lotto-radius);
    margin-bottom: 20px;
}

/* ── Advanced stat cards ── */
.lotto-stat-card-advanced {
    border-color: #2e6da4;
    background: linear-gradient(135deg, #f0f5fb, #e8f0f8);
}
.lotto-stat-card-advanced .lotto-stat-card-title { color: var(--lotto-blue); }
.lotto-stat-card-advanced:hover { box-shadow: 0 4px 16px rgba(30,100,200,0.2); }

/* ── Indice Homepage ── */
.lotto-indice-sito {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin: 20px 0 40px;
}
.lotto-indice-sezione {
    background: #fff;
    border: 1px solid var(--lotto-border);
    border-radius: var(--lotto-radius);
    padding: 16px 18px;
}
.lotto-indice-titolo {
    font-size: 1em;
    font-weight: 700;
    color: var(--lotto-blue);
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--lotto-blue-light);
}
.lotto-indice-lista {
    list-style: none;
    margin: 0; padding: 0;
}
.lotto-indice-lista li { margin-bottom: 5px; }
.lotto-indice-lista a {
    color: var(--lotto-blue-mid);
    text-decoration: none;
    font-size: 0.88em;
    display: block;
    padding: 2px 0;
    transition: color 0.15s;
}
.lotto-indice-lista a:hover { color: var(--lotto-blue); text-decoration: underline; }

/* ── Generatore ── */
.lotto-generatore { max-width: 900px; }
.lotto-gen-form { margin: 20px 0; }

.lotto-gen-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--lotto-border);
}
.lotto-gen-row:last-child { border-bottom: none; }
.lotto-gen-label {
    min-width: 200px;
    font-weight: 600;
    font-size: 0.9em;
    color: var(--lotto-blue);
    padding-top: 4px;
    flex-shrink: 0;
}
.lotto-gen-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.lotto-gen-chip {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
.lotto-gen-chip input { display: none; }
.lotto-gen-chip span {
    padding: 5px 12px;
    border: 1px solid var(--lotto-border);
    border-radius: 20px;
    font-size: 0.83em;
    background: #fff;
    transition: all 0.15s;
    user-select: none;
    white-space: nowrap;
}
.lotto-gen-chip input:checked + span {
    background: var(--lotto-blue);
    color: #fff;
    border-color: var(--lotto-blue);
}
.lotto-gen-chip:hover span { border-color: var(--lotto-blue-mid); }

.lotto-gen-select {
    padding: 7px 12px;
    border: 1px solid var(--lotto-border);
    border-radius: 4px;
    font-size: 0.9em;
    background: #fff;
    cursor: pointer;
}
.lotto-gen-actions { padding: 20px 0; border-bottom: none; }
.lotto-btn-genera {
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--lotto-blue-mid), var(--lotto-blue));
    color: #fff;
    border: none;
    border-radius: var(--lotto-radius);
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
    box-shadow: 0 2px 8px rgba(30,100,200,0.3);
}
.lotto-btn-genera:hover { opacity: 0.9; }
.lotto-btn-reset {
    padding: 10px 20px;
    background: #fff;
    color: var(--lotto-gray);
    border: 1px solid var(--lotto-border);
    border-radius: var(--lotto-radius);
    font-size: 0.95em;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.15s;
}
.lotto-btn-reset:hover { background: var(--lotto-blue-light); }

.lotto-gen-risultati {
    background: var(--lotto-blue-light);
    border: 1px solid #c8e0f4;
    border-radius: var(--lotto-radius);
    padding: 24px;
    margin-top: 20px;
}
.lotto-gen-output {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0;
}
.lotto-gen-ball {
    width: 56px !important;
    height: 56px !important;
    font-size: 1.2em !important;
    animation: lotto-pop 0.3s ease;
}
@keyframes lotto-pop {
    0%   { transform: scale(0.5); opacity: 0; }
    70%  { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
.lotto-gen-info { font-size: 0.88em; color: var(--lotto-gray); margin-top: 8px; }

.lotto-gen-multi { margin-top: 16px; }
.lotto-gen-multi-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--lotto-border);
    flex-wrap: wrap;
}
.lotto-gen-multi-label {
    min-width: 90px;
    font-weight: 600;
    font-size: 0.88em;
    color: var(--lotto-blue);
}

@media (max-width: 768px) {
    .lotto-gen-row { flex-direction: column; gap: 8px; }
    .lotto-gen-label { min-width: unset; }
    .lotto-gen-ball { width: 44px !important; height: 44px !important; font-size: 1em !important; }
}

/* ── Nav bottom (ruota selector in fondo) ── */
.lotto-nav-bottom {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid var(--lotto-blue-light);
}
.lotto-nav-bottom-label {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--lotto-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.lotto-nav-back {
    margin-top: 12px;
}
.lotto-back-link {
    color: var(--lotto-blue-mid);
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
}
.lotto-back-link:hover { text-decoration: underline; }

/* ── Window compact pills ── */
.lotto-window-compact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--lotto-blue-light);
    border: 1px solid #c8e0f4;
    border-radius: 20px;
    padding: 5px 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.lotto-window-label {
    font-size: 0.82em;
    font-weight: 600;
    color: var(--lotto-blue);
    margin-right: 2px;
    white-space: nowrap;
}
.lotto-win-pill {
    padding: 3px 10px;
    border: 1px solid var(--lotto-blue-mid);
    border-radius: 12px;
    text-decoration: none;
    color: var(--lotto-blue-mid);
    font-size: 0.82em;
    font-weight: 600;
    transition: all 0.15s;
    white-space: nowrap;
}
.lotto-win-pill:hover, .lotto-win-pill.active {
    background: var(--lotto-blue-mid);
    color: #fff;
}

/* ── Ruote grid (panoramica) ── */
.lotto-ruote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin: 16px 0 30px;
}
.lotto-ruota-card {
    display: block;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--lotto-border);
    border-radius: var(--lotto-radius);
    text-decoration: none;
    color: var(--lotto-blue);
    font-weight: 600;
    font-size: 0.9em;
    text-align: center;
    transition: all 0.2s;
    border-left: 3px solid var(--lotto-blue-mid);
}
.lotto-ruota-card:hover {
    background: var(--lotto-blue-light);
    box-shadow: 0 2px 8px rgba(30,100,200,0.15);
    transform: translateY(-1px);
}

/* ── Ruota selector compatto ── */
.lotto-ruota-selector {
    display: flex; flex-wrap: wrap; gap: 5px;
    margin-bottom: 16px;
}
.lotto-ruota-btn {
    padding: 4px 10px;
    border: 1px solid var(--lotto-blue-mid);
    border-radius: 14px;
    text-decoration: none;
    color: var(--lotto-blue-mid);
    font-size: 0.78em;
    font-weight: 600;
    transition: all 0.15s;
    white-space: nowrap;
}
.lotto-ruota-btn:hover, .lotto-ruota-btn.active {
    background: var(--lotto-blue-mid);
    color: #fff;
}

/* ── Site footer nav (compatto) ── */
.lotto-site-footer {
    margin-top: 50px;
    padding-top: 24px;
    border-top: 2px solid var(--lotto-blue-light);
}
.lotto-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}
.lotto-footer-col {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.lotto-footer-title {
    font-weight: 700;
    font-size: 0.82em;
    color: var(--lotto-blue);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--lotto-blue-light);
}
.lotto-footer-col a {
    color: var(--lotto-gray);
    text-decoration: none;
    font-size: 0.82em;
    padding: 1px 0;
    transition: color 0.15s;
}
.lotto-footer-col a:hover { color: var(--lotto-blue-mid); }

@media (max-width: 600px) {
    .lotto-footer-grid { grid-template-columns: 1fr 1fr; }
    .lotto-ruota-btn   { font-size: 0.72em; padding: 3px 8px; }
}

/* ══════════════════════════════════════════════
   OVERRIDE FINALI – Selettori squadrati, tabelle centrate
   ══════════════════════════════════════════════ */

/* ── Tabelle: valori centrati ── */
.lotto-table td {
    text-align: center;
    vertical-align: middle;
}
.lotto-table th {
    text-align: center;
}
/* Solo la colonna ruota rimane allineata a sinistra */
.lotto-table td.lotto-ruota-name,
.lotto-table th:first-child {
    text-align: left;
}
.lotto-table td:first-child {
    text-align: center; /* rank e numeri centrati */
}

/* ── Selettori: meno arrotondati, squadrati ── */
.lotto-ruota-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 16px;
    justify-content: center;
}
.lotto-ruota-btn {
    padding: 5px 11px;
    border: 1px solid var(--lotto-blue-mid);
    border-radius: 4px;       /* squadrato */
    text-decoration: none;
    color: var(--lotto-blue-mid);
    font-size: 0.78em;
    font-weight: 600;
    transition: all 0.15s;
    white-space: nowrap;
}
.lotto-ruota-btn:hover,
.lotto-ruota-btn.active {
    background: var(--lotto-blue-mid);
    color: #fff;
}

/* Finestra temporale: squadrata e centrata */
.lotto-window-compact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    background: var(--lotto-blue-light);
    border: 1px solid #c8e0f4;
    border-radius: 4px;       /* squadrato */
    padding: 6px 12px;
    margin-bottom: 14px;
    justify-content: center;
}
.lotto-win-pill {
    padding: 4px 10px;
    border: 1px solid var(--lotto-blue-mid);
    border-radius: 4px;       /* squadrato */
    text-decoration: none;
    color: var(--lotto-blue-mid);
    font-size: 0.82em;
    font-weight: 600;
    transition: all 0.15s;
}
.lotto-win-pill:hover,
.lotto-win-pill.active {
    background: var(--lotto-blue-mid);
    color: #fff;
}

/* Tipo ambo selector: squadrato e centrato */
.lotto-tipo-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 16px;
    justify-content: center;
}
.lotto-tipo-btn {
    padding: 5px 12px;
    border: 1px solid var(--lotto-border);
    border-radius: 4px;       /* squadrato */
    text-decoration: none;
    color: inherit;
    font-size: 0.83em;
    transition: all 0.15s;
    background: #fff;
}
.lotto-tipo-btn:hover,
.lotto-tipo-btn.active {
    background: var(--lotto-blue);
    color: #fff;
    border-color: var(--lotto-blue);
}

/* Order bar: squadrata */
.lotto-order-btn {
    padding: 4px 10px;
    border: 1px solid var(--lotto-border);
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    font-size: 0.88em;
}

/* Month selector: squadrato */
.lotto-month-btn {
    padding: 5px 11px;
    border: 1px solid var(--lotto-border);
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    font-size: 0.82em;
}
.lotto-month-btn.active {
    background: var(--lotto-blue-mid);
    color: #fff;
    border-color: var(--lotto-blue-mid);
}

/* Window selector a tendenza circolare → 4px */
.lotto-window-btn {
    border-radius: 4px;
}

/* Generatore chip: squadrato */
.lotto-gen-chip span {
    border-radius: 4px;
}
.lotto-btn-genera,
.lotto-btn-reset {
    border-radius: 4px;
}

/* Stat card: arrotondamento ridotto */
.lotto-stat-card,
.lotto-stat-mini,
.lotto-prev-card,
.lotto-chart-wrap,
.lotto-method-box,
.lotto-window-compact,
.lotto-spia-config,
.lotto-countdown-wrap {
    border-radius: 4px;
}

/* ── Site footer nav: ridotto radius ── */
.lotto-site-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid var(--lotto-blue-light);
}
.lotto-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}
.lotto-footer-col a,
.lotto-footer-title {
    font-size: 0.80em;
}
.lotto-footer-col a { color: #555; }
.lotto-footer-col a:hover { color: var(--lotto-blue-mid); }

@media (max-width: 600px) {
    .lotto-ruota-selector  { justify-content: flex-start; }
    .lotto-tipo-selector   { justify-content: flex-start; }
    .lotto-window-compact  { justify-content: flex-start; }
    .lotto-footer-grid     { grid-template-columns: 1fr 1fr; }
    .lotto-ruota-btn       { font-size: 0.72em; padding: 4px 8px; }
}

/* ══════════════════════════════════════════════
   OVERRIDE DEFINITIVI (alta specificità)
   ══════════════════════════════════════════════ */

/* Tabelle: tutto centrato, sovrascrive tema */
.lotto-wrap .lotto-table th,
.lotto-wrap .lotto-table td {
    text-align: center !important;
    vertical-align: middle !important;
}
/* Eccezione: nome ruota allineato a sinistra */
.lotto-wrap .lotto-table td.lotto-ruota-name {
    text-align: left !important;
}
/* Th: testo bianco centrato */
.lotto-wrap .lotto-table th {
    background: var(--lotto-blue) !important;
    color: #fff !important;
}

/* Ruota selector: squadrato, centrato */
.lotto-wrap .lotto-ruota-selector {
    justify-content: center;
}
.lotto-wrap .lotto-ruota-btn {
    border-radius: 4px !important;
    font-size: 0.77em !important;
    padding: 4px 10px !important;
}

/* Finestra temporale: squadrata */
.lotto-window-compact { border-radius: 4px !important; }
.lotto-win-pill       { border-radius: 4px !important; }

/* Tipo ambo: squadrato */
.lotto-tipo-btn { border-radius: 4px !important; }

/* ══════════════════════════════════════════════
   FOOTER INDICE COMPLETO
   ══════════════════════════════════════════════ */
.lotto-site-footer {
    margin-top: 50px;
    padding: 28px 0 10px;
    border-top: 2px solid var(--lotto-blue-light);
}
.lotto-footer-label {
    font-weight: 700;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--lotto-blue);
    margin-bottom: 20px;
}
.lotto-footer-section {
    margin-bottom: 18px;
}
.lotto-footer-section-title {
    font-size: 0.78em;
    font-weight: 700;
    color: var(--lotto-gray);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 7px;
}
.lotto-footer-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.lotto-footer-tab {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid var(--lotto-border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--lotto-blue-mid);
    font-size: 0.77em;
    font-weight: 600;
    background: #fff;
    transition: all 0.15s;
    white-space: nowrap;
}
.lotto-footer-tab:hover {
    background: var(--lotto-blue-mid);
    color: #fff;
    border-color: var(--lotto-blue-mid);
}

/* ══════════════════════════════════════════════
   GENERATORE NUOVO
   ══════════════════════════════════════════════ */
.lotto-gen-step {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--lotto-blue-light);
}
.lotto-gen-step:last-child { border-bottom: none; }
.lotto-gen-step-label {
    font-weight: 700;
    font-size: 0.95em;
    color: var(--lotto-blue);
    margin-bottom: 12px;
}
.lotto-gen-metodi {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
}
.lotto-gen-metodo {
    border: 2px solid var(--lotto-border);
    border-radius: 4px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}
.lotto-gen-metodo:hover {
    border-color: var(--lotto-blue-mid);
    background: var(--lotto-blue-light);
}
.lotto-gen-metodo.active {
    border-color: var(--lotto-blue);
    background: var(--lotto-blue-light);
    box-shadow: 0 0 0 2px var(--lotto-blue-mid);
}
.lotto-gen-metodo-icon { font-size: 1.6em; margin-bottom: 6px; }
.lotto-gen-metodo-nome { font-weight: 700; font-size: 0.9em; color: var(--lotto-blue); margin-bottom: 4px; }
.lotto-gen-metodo-desc { font-size: 0.78em; color: var(--lotto-gray); line-height: 1.4; }

.lotto-gen-actions { border-bottom: none; padding-bottom: 0; }

/* Risultati generatore */
.lotto-gen-risultati {
    background: var(--lotto-blue-light);
    border: 1px solid #c8e0f4;
    border-radius: 4px;
    padding: 20px;
    margin-top: 10px;
}
.lotto-gen-ruota-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #c8e0f4;
    flex-wrap: wrap;
}
.lotto-gen-ruota-result:last-child { border-bottom: none; }
.lotto-gen-ruota-label {
    min-width: 90px;
    font-weight: 700;
    font-size: 0.85em;
    color: var(--lotto-blue);
    flex-shrink: 0;
}
.lotto-gen-balls { display: flex; gap: 8px; flex-wrap: wrap; }
.lotto-gen-ball {
    width: 42px !important;
    height: 42px !important;
    font-size: 0.95em !important;
    animation: lotto-pop 0.4s ease both;
}
.lotto-gen-ball-hot  { background: linear-gradient(135deg, #e74c3c, #c0392b) !important; }
.lotto-gen-ball-warm { background: linear-gradient(135deg, #e67e22, #d35400) !important; }
.lotto-gen-metodo-badge {
    font-size: 0.72em;
    color: var(--lotto-gray);
    margin-left: auto;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .lotto-gen-metodi { grid-template-columns: 1fr 1fr; }
    .lotto-gen-ruota-result { flex-direction: column; align-items: flex-start; gap: 8px; }
    .lotto-gen-metodo-badge { margin-left: 0; }
}

/* ── Generatore: tabella ruote con quantità ── */
.lotto-gen-ruote-table {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
}
.lotto-gen-ruota-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--lotto-blue-light);
}
.lotto-gen-ruota-row:last-child { border-bottom: none; }
.lotto-gen-ruota-nome {
    min-width: 90px;
    font-weight: 600;
    font-size: 0.85em;
    color: var(--lotto-blue);
    flex-shrink: 0;
}
.lotto-gen-quanti-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
/* Bottone 0 = escludi → stile diverso quando attivo */
.lotto-gen-q-btn[data-quanti="0"].active {
    background: #e0e0e0 !important;
    color: #888 !important;
    border-color: #ccc !important;
}
.lotto-gen-presets {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.lotto-gen-hint {
    font-size: 0.78em;
    color: var(--lotto-gray);
    margin-left: 8px;
}
#lotto-gen-summary {
    font-size: 0.82em;
    color: var(--lotto-blue);
    font-weight: 600;
    margin-left: 12px;
}

@media (max-width: 600px) {
    .lotto-gen-ruota-row { flex-direction: column; align-items: flex-start; gap: 6px; }
    .lotto-gen-ruota-nome { min-width: unset; }
}

/* ── Tabellone legenda ── */
.lotto-tabellone-legenda {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: #f8f9fa;
    border: 1px solid var(--lotto-border);
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 0.82em;
}
.lotto-legenda-title {
    font-weight: 700;
    color: var(--lotto-blue);
    margin-right: 4px;
}
.lotto-legenda-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #444;
}
.lotto-legenda-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Heatmap legenda ── */
.lotto-heatmap-legenda {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.78em;
    color: #555;
}
.lotto-heatmap-gradient {
    width: 120px;
    height: 12px;
    border-radius: 2px;
    background: linear-gradient(to right, #0000ff, #00ffff, #00ff00, #ffff00, #ff0000);
    flex-shrink: 0;
}

/* ── Numeri Spia: top 5 cards ── */
.lotto-spia-top5 { margin-bottom: 32px; }
.lotto-spia-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.lotto-spia-card {
    background: #fff;
    border: 1px solid var(--lotto-border);
    border-left: 4px solid var(--lotto-blue-mid);
    border-radius: 4px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.lotto-spia-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.lotto-spia-ball {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.1em !important;
    flex-shrink: 0;
}
.lotto-spia-card-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.lotto-spia-card-label {
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--lotto-gray);
}
.lotto-spia-card-stat {
    font-size: 0.82em;
    color: #444;
}
.lotto-spia-card-simp { display: flex; flex-direction: column; gap: 6px; }
.lotto-spia-simp-balls { display: flex; flex-wrap: wrap; gap: 6px; }
.lotto-spia-simp-ball {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.82em !important;
    background: var(--lotto-blue-light) !important;
    color: var(--lotto-blue) !important;
    border: 1px solid var(--lotto-blue-mid) !important;
}
.lotto-spia-simp-ball.lotto-ball-hot {
    background: var(--lotto-blue-mid) !important;
    color: #fff !important;
    border-color: var(--lotto-blue) !important;
}
.lotto-spia-card-link {
    font-size: 0.82em;
    color: var(--lotto-blue-mid);
    text-decoration: none;
    font-weight: 600;
    align-self: flex-end;
}
.lotto-spia-card-link:hover { text-decoration: underline; }

@media (max-width: 600px) {
    .lotto-spia-cards { grid-template-columns: 1fr; }
}

/* ── Titoli sezioni previsioni ── */
.lotto-prev-tipo-title {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--lotto-blue);
    padding: 10px 16px;
    background: var(--lotto-blue-light);
    border-left: 4px solid var(--lotto-blue-mid);
    border-radius: 4px;
    margin-bottom: 14px;
}

/* ══════════════════════════════════════════════
   CAROSELLO HERO HOMEPAGE
   ══════════════════════════════════════════════ */
.lotto-hero-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;          /* Firefox */
    margin: 0 -4px 28px;
    padding-bottom: 4px;
}
.lotto-hero-scroll::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.lotto-hero-track {
    display: flex;
    gap: 12px;
    padding: 4px 4px 8px;
    /* su desktop: wrap a griglia, su mobile: scroll orizzontale */
    flex-wrap: wrap;
}

.lotto-hero-card {
    flex: 0 0 calc(25% - 9px);   /* 4 per riga su desktop */
    min-width: 180px;
    border-radius: 4px;
    padding: 18px 16px 16px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform 0.18s, box-shadow 0.18s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    color: #fff;
}
.lotto-hero-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    color: #fff;
}

/* Colori per ogni card */
.lotto-hero-blue   { background: linear-gradient(135deg, #1a3c5e, #2e6da4); }
.lotto-hero-red    { background: linear-gradient(135deg, #c0392b, #e74c3c); }
.lotto-hero-orange { background: linear-gradient(135deg, #d35400, #e67e22); }
.lotto-hero-purple { background: linear-gradient(135deg, #7d3c98, #a569bd); }
.lotto-hero-teal   { background: linear-gradient(135deg, #148f77, #1abc9c); }
.lotto-hero-indigo { background: linear-gradient(135deg, #1a5276, #2980b9); }
.lotto-hero-green  { background: linear-gradient(135deg, #1e8449, #27ae60); }

.lotto-hero-icon {
    font-size: 1.8em;
    line-height: 1;
}
.lotto-hero-titolo {
    font-size: 0.95em;
    font-weight: 700;
    line-height: 1.2;
}
.lotto-hero-sub {
    font-size: 0.76em;
    opacity: 0.88;
    line-height: 1.4;
}

/* Mobile: scroll orizzontale, card più strette */
@media (max-width: 768px) {
    .lotto-hero-track {
        flex-wrap: nowrap;  /* non va a capo → scroll orizzontale */
    }
    .lotto-hero-card {
        flex: 0 0 72vw;    /* una card e mezza visibili */
        max-width: 280px;
    }
}
@media (min-width: 769px) and (max-width: 1100px) {
    .lotto-hero-card { flex: 0 0 calc(50% - 6px); } /* 2 per riga */
}



/* GeneratePress sovrascrive display su <a>: usiamo div come container */
.lotto-home .lotto-hero-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 28px;
}
.lotto-home .lotto-hero-scroll::-webkit-scrollbar { display: none; }

.lotto-home .lotto-hero-track {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 4px 4px 8px !important;
}

.lotto-home .lotto-hero-card {
    flex: 0 0 calc(25% - 9px) !important;
    min-width: 180px !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
    transition: transform 0.18s, box-shadow 0.18s !important;
    overflow: hidden !important;
    position: relative !important;
}
.lotto-home .lotto-hero-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2) !important;
}

/* L'<a> copre tutta la card ed è il flex container del contenuto */
.lotto-home .lotto-hero-link {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 18px 16px 16px !important;
    text-decoration: none !important;
    color: #fff !important;
    height: 100% !important;
    box-sizing: border-box !important;
}
.lotto-home .lotto-hero-link:hover,
.lotto-home .lotto-hero-link:visited,
.lotto-home .lotto-hero-link:focus { color: #fff !important; text-decoration: none !important; }

.lotto-home .lotto-hero-icon  { font-size: 1.8em; line-height: 1; display: block; }
.lotto-home .lotto-hero-titolo{ font-size: 0.95em; font-weight: 700; display: block; color: #fff; }
.lotto-home .lotto-hero-sub   { font-size: 0.76em; opacity: 0.88; line-height: 1.4; display: block; color: #fff; }

.lotto-home .lotto-hero-blue   { background: linear-gradient(135deg,#1a3c5e,#2e6da4); }
.lotto-home .lotto-hero-red    { background: linear-gradient(135deg,#c0392b,#e74c3c); }
.lotto-home .lotto-hero-orange { background: linear-gradient(135deg,#d35400,#e67e22); }
.lotto-home .lotto-hero-purple { background: linear-gradient(135deg,#7d3c98,#a569bd); }
.lotto-home .lotto-hero-teal   { background: linear-gradient(135deg,#148f77,#1abc9c); }
.lotto-home .lotto-hero-indigo { background: linear-gradient(135deg,#1a5276,#2980b9); }
.lotto-home .lotto-hero-green  { background: linear-gradient(135deg,#1e8449,#27ae60); }

@media (max-width: 768px) {
    .lotto-home .lotto-hero-track { flex-wrap: nowrap !important; }
    .lotto-home .lotto-hero-card  { flex: 0 0 72vw !important; max-width: 280px !important; }
}
@media (min-width: 769px) and (max-width: 1100px) {
    .lotto-home .lotto-hero-card  { flex: 0 0 calc(50% - 6px) !important; }
}

/* ── Numeri nelle tabelle: stile cerchio ── */
.lotto-wrap .lotto-table td.lotto-num {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.lotto-wrap .lotto-table td.lotto-num span,
.lotto-wrap .lotto-table td.lotto-num {
    /* Wrapper cerchio inline */
}
/* Cella numero come cerchio */
.lotto-table .lotto-num::before { content: none; }
.lotto-table td.lotto-num {
    padding: 6px 4px !important;
}
.lotto-table td.lotto-num {
    text-align: center !important;
}
/* Il numero dentro la cella appare come pallina */
.lotto-wrap .lotto-table tbody td.lotto-num {
    position: relative;
}
.lotto-wrap .lotto-table tbody td.lotto-num > span.lotto-num-inner,
.lotto-wrap .lotto-table tbody td.lotto-num {
    /* Usiamo un wrapper via JS o direttamente col CSS display */
}

/* Approccio diretto: trasformiamo il contenuto testuale in cerchio via CSS */
.lotto-prev-table td.lotto-num {
    padding: 4px 8px !important;
}

/* Stile cerchio tramite classe aggiuntiva sulle tabelle previsioni */
.lotto-table-sortable td.lotto-num {
    padding: 6px 6px !important;
}
.lotto-table-sortable td.lotto-num div.lotto-ball-inline,
.lotto-num-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--lotto-blue-mid);
    color: #fff;
    font-weight: 700;
    font-size: 0.88em;
    font-variant-numeric: tabular-nums;
    margin: 0 auto;
}

/* ══════════════════════════════════════════════
   TABELLONE – 8 CATEGORIE DI COLORE
   ══════════════════════════════════════════════ */

/* Colori cella per categoria (priorità: prima classe vince) */
.lotto-tabellone td.tab-gemello    { background: #f9e547 !important; color: #333 !important; font-weight: 700; }
.lotto-tabellone td.tab-fibonacci  { background: #8bc34a !important; color: #fff !important; font-weight: 700; }
.lotto-tabellone td.tab-frequente  { background: #e53935 !important; color: #fff !important; font-weight: 700; }
.lotto-tabellone td.tab-primo      { background: #9c27b0 !important; color: #fff !important; }
.lotto-tabellone td.tab-simmetrico { background: #90caf9 !important; color: #1a3c5e !important; }
.lotto-tabellone td.tab-vertibile  { background: #ffb74d !important; color: #333 !important; }
.lotto-tabellone td.tab-pari       { background: #e8f4fd !important; color: #1a3c5e !important; }
.lotto-tabellone td.tab-dispari    { background: #fef9e7 !important; color: #7d6608 !important; }

/* Legenda */
.lotto-tab-legenda {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid var(--lotto-border);
    border-radius: 4px;
    margin-bottom: 14px;
    font-size: 0.80em;
}
.lotto-tab-leg-item {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.lotto-tab-leg-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 2px;
    border: 1px solid rgba(0,0,0,0.12);
    flex-shrink: 0;
}
.lotto-tab-leg-swatch.tab-gemello    { background: #f9e547; }
.lotto-tab-leg-swatch.tab-fibonacci  { background: #8bc34a; }
.lotto-tab-leg-swatch.tab-frequente  { background: #e53935; }
.lotto-tab-leg-swatch.tab-primo      { background: #9c27b0; }
.lotto-tab-leg-swatch.tab-simmetrico { background: #90caf9; }
.lotto-tab-leg-swatch.tab-vertibile  { background: #ffb74d; }
.lotto-tab-leg-swatch.tab-pari       { background: #e8f4fd; border: 1px solid #aaa; }
.lotto-tab-leg-swatch.tab-dispari    { background: #fef9e7; border: 1px solid #aaa; }

/* Cella nascosta dal filtro */
.lotto-tabellone td.lotto-tab-hidden { opacity: 0.12; }

@media (max-width: 600px) {
    .lotto-tab-legenda { font-size: 0.72em; gap: 6px; }
    .lotto-tab-leg-swatch { width: 14px; height: 14px; }
}

/* ══════════════════════════════════════════════
   TABELLONE ANALITICO TRADIZIONALE
   ══════════════════════════════════════════════ */
.lotto-tabellone-analitico-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.78em;
}
.lotto-tabellone-analitico {
    border-collapse: collapse;
    white-space: nowrap;
    min-width: 100%;
}
.lotto-tabellone-analitico th,
.lotto-tabellone-analitico td {
    border: 1px solid #d0d8e4;
    padding: 2px 4px;
    text-align: center;
    min-width: 28px;
}
.lotto-tab-rit-header {
    background: var(--lotto-blue) !important;
    color: #fff !important;
    font-weight: 700;
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 36px;
}
.lotto-tab-ruota-header {
    background: var(--lotto-blue) !important;
    color: #fff !important;
    font-weight: 700;
    font-size: 0.9em;
    border-left: 2px solid #fff !important;
}
.lotto-tab-pos-header {
    background: var(--lotto-blue-mid) !important;
    color: #fff !important;
    font-size: 0.82em;
    border-left: 1px solid #aac4e0 !important;
}
.lotto-tab-rit {
    background: #f0f4f8;
    font-weight: 700;
    color: var(--lotto-blue);
    position: sticky;
    left: 0;
    z-index: 1;
    border-right: 2px solid var(--lotto-blue-mid) !important;
}
.lotto-tab-rit-alto  { background: #fde8e8 !important; color: #c0392b !important; }
.lotto-tab-rit-medio { background: #fff8e1 !important; color: #856404 !important; }
.lotto-tab-num {
    font-variant-numeric: tabular-nums;
    font-size: 0.88em;
    color: #1a3c5e;
    padding: 2px 3px;
}
.lotto-tab-num:empty { background: #fafbfc; }
/* Bordo separatore tra ruote */
.lotto-tabellone-analitico td:nth-child(6n+2),
.lotto-tabellone-analitico th:nth-child(6n+2) {
    border-left: 2px solid #aac4e0 !important;
}
