:root {
    --primary:    rgb(11, 19, 43);
    --secondary:  rgb(18, 31, 61);
    --success:    rgb(34, 197, 94);
    --highlight:  rgb(163, 255, 0);
    --gold:       rgb(255, 215, 0);
    --text-light: rgb(230, 232, 236);
    --panel:      rgb(31, 41, 55);
    --toto-accent:       #A3FF00;
    --toto-accent-dark:  #7acc00;
}

/**
 * Reserved-area card overrides — toto palette.
 * The generic ra-card tokens are defined in reserved-area.css;
 * only colour customisation lives here.
 */
.ra-card--toto {
    --ra-accent:       var(--toto-accent,      #A3FF00);
    --ra-accent-dark:  var(--toto-accent-dark, #7acc00);
    --ra-accent-rgb:   163, 255, 0;
    --ra-card-bg:      #0B132B;
    --ra-enter-color:  #0B132B;
}

.toto-card {
    background: #0B132B;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.toto-card-title {
    color: #A3FF00;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.toto-stats {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.toto-stat {
    flex: 1;
    background: #121F3D;
    border: 1px solid #1F2937;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    text-align: center;
}

.toto-stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: #E6E8EC;
    line-height: 1;
}

.toto-stat-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #E6E8EC;
    opacity: 0.55;
    margin-top: 4px;
}

.toto-stat--done .toto-stat-value { color: #22C55E; }
.toto-stat--todo .toto-stat-value { color: #FFD700; }

.toto-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.toto-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
}

.toto-filter-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #E6E8EC;
    opacity: 0.55;
}

.toto-filter-input,
.toto-filter-select {
    background: #121F3D;
    border: 1px solid #1F2937;
    border-radius: 6px;
    color: #E6E8EC;
    padding: 6px 10px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.toto-filter-input:focus,
.toto-filter-select:focus {
    border-color: #A3FF00;
}

.toto-filter-select option {
    background: #121F3D;
}

.toto-row-hidden {
    display: none;
}

/* ── toto-join-alert ───────────────────────────────────── */

.toto-join-alert {
    background: rgba(18, 31, 61, 0.85);
    border: 1px solid var(--gold);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.toto-join-alert i {
    color: var(--gold);
}

.toto-join-alert a {
    color: var(--highlight);
    text-decoration: underline;
}

.toto-join-alert a:hover {
    color: var(--gold);
}

/* ── toto-join page ─────────────────────────────────────── */

.toto-join-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.5rem;
}

.toto-join-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toto-join-info-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-light);
    opacity: 0.45;
    font-weight: 600;
}

.toto-join-info-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-light);
}

.toto-join-section-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--highlight);
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: block;
}

.toto-join-rules-list {
    margin: 0;
    padding-left: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.toto-join-rules-list li {
    font-size: 0.875rem;
    color: var(--text-light);
    opacity: 0.85;
}

/* ── toto-card-ribbon ───────────────────────────────────── */

.toto-card-ribbon-wrap {
    overflow: hidden;
}

.toto-card-ribbon {
    position: absolute;
    top: 18px;
    right: -28px;
    width: 110px;
    padding: 5px 0;
    text-align: center;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transform: rotate(45deg);
    transform-origin: center center;
    z-index: 1;
    pointer-events: none;
    line-height: 1;
}

.toto-card-ribbon--official {
    background: var(--highlight);
    color: var(--primary);
}

.toto-card-ribbon--unofficial {
    background: #582cb1;
    color: #fff;
    opacity: 0.9;
}

.toto-card-ribbon--inline {
    position: static;
    transform: none;
    width: auto;
    border-radius: 4px;
    padding: 2px 10px;
    font-size: 0.62rem;
    line-height: 1.6;
}

/* ── toto-status-badge ──────────────────────────────────── */

.toto-status-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 4px;
    padding: 2px 8px;
    border: 1px solid;
}

.toto-status-badge--open {
    background: rgba(163, 255, 0, 0.12);
    border-color: var(--highlight);
    color: var(--highlight);
}

.toto-status-badge--draft {
    background: rgba(255, 215, 0, 0.12);
    border-color: var(--gold);
    color: var(--gold);
}

.toto-status-badge--closed {
    background: rgba(31, 41, 55, 0.5);
    border-color: var(--panel);
    color: var(--text-light);
    opacity: 0.6;
}

/* ── toto-visibility-badge ──────────────────────────────── */

.toto-visibility-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 4px;
    padding: 2px 10px;
    line-height: 1.6;
}

.toto-visibility-badge--public {
    background: rgba(56, 189, 248, 0.18);
    color: #38BDF8;
    outline: 1px solid rgba(56, 189, 248, 0.35);
}

.toto-visibility-badge--private {
    background: rgba(168, 85, 247, 0.15);
    color: #C084FC;
    outline: 1px solid rgba(168, 85, 247, 0.3);
}

/* ── toto-selection-legend ──────────────────────────────── */

.toto-selection-legend {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid var(--toto-primary-accent, #A3FF00);
    border-radius: 0 6px 6px 0;
}

.toto-selection-legend__item {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.82rem;
    color: #CBD5E1;
    line-height: 1.4;
}

.toto-selection-legend__item svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #94A3B8;
}

.toto-selection-legend__item--locked svg {
    color: #6B7280;
}

.toto-selection-legend__item strong {
    color: #E6E8EC;
}

/* ── toto-selection-match-counters ──────────────────────── */

.toto-selection-match-counters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.toto-match-counter {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.6rem 0.5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.toto-match-counter__value {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
}

.toto-match-counter__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94A3B8;
}

.toto-match-counter--total .toto-match-counter__value  { color: #E6E8EC; }
.toto-match-counter--open .toto-match-counter__value   { color: #A3FF00; }
.toto-match-counter--closed .toto-match-counter__value { color: #6B7280; }

/* ── toto-selection-context ─────────────────────────────── */

.toto-selection-context {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: -0.35rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.toto-selection-context-tournament {
    color: #A3FF00;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.toto-selection-context-separator {
    color: #E6E8EC;
    opacity: 0.3;
}

.toto-selection-context-matchday {
    color: #E6E8EC;
    opacity: 0.7;
}

.toto-selection-context-matchday strong {
    color: #FFD700;
    opacity: 1;
    font-weight: 800;
}

/* ── Selection form ─────────────────────────────────────── */

.toto-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.toto-match-card {
    background: #121F3D;
    border: 1px solid #1F2937;
    border-radius: 8px;
    padding: 0.9rem 0.9rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    transition: border-color 0.2s;
    position: relative;
}

.toto-match-number {
    position: absolute;
    top: 8px;
    left: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #0B132B;
    background: #A3FF00;
    border-radius: 4px;
    padding: 1px 6px;
    line-height: 1.4;
    letter-spacing: 0.03em;
}

.toto-match-card.is-selected {
    border-color: #A3FF00;
}

.toto-match-card.is-invalid {
    border-color: #EF4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.toto-match-card.is-locked {
    border-color: #374151;
    opacity: 0.6;
    pointer-events: none;
}

.toto-match-card.is-finished {
    border-color: #22C55E;
    opacity: 0.55;
    pointer-events: none;
}

.toto-match-risultato-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #22C55E;
    letter-spacing: 0.03em;
}

.toto-match-risultato-badge strong {
    font-size: 1rem;
    font-weight: 800;
    color: #22C55E;
}

.toto-match-locked-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #F87171;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toto-match-countdown {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    color: #FFD700;
    font-weight: 600;
    letter-spacing: 0.03em;
    min-height: 1em;
}

.toto-esito-group--locked .toto-esito-btn {
    background: #111827;
    border-color: #1F2937;
    color: #374151;
    cursor: not-allowed;
}

.toto-match-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    padding-top: 1.1rem;
}

.toto-match-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
    width: 100%;
}

.toto-match-home {
    font-weight: 700;
    font-size: 1.1rem;
    color: #A3FF00;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toto-match-vs {
    font-size: 0.8rem;
    opacity: 0.45;
    line-height: 1;
    flex-shrink: 0;
}

.toto-match-away {
    font-weight: 600;
    font-size: 1.1rem;
    color: #E6E8EC;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toto-match-date {
    font-size: 0.8rem;
    color: #FFD700;
    margin-top: 4px;
    opacity: 0.9;
}

.toto-esito-group {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.toto-esito-label {
    flex: 1;
    cursor: pointer;
}

.toto-esito-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.toto-esito-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    border-radius: 6px;
    background: #1F2937;
    border: 1px solid #374151;
    color: #E6E8EC;
    font-weight: 700;
    font-size: 1.1rem;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    user-select: none;
}

.toto-esito-label:hover .toto-esito-btn {
    border-color: #A3FF00;
    color: #A3FF00;
}

.toto-esito-radio:checked + .toto-esito-btn {
    background: #A3FF00;
    border-color: #A3FF00;
    color: #0B132B;
}

.toto-selection-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 0.75rem;
    border-top: 1px solid #1F2937;
}

.toto-selection-counter {
    font-size: 0.85rem;
    color: #E6E8EC;
    opacity: 0.65;
}

.toto-selection-counter span {
    font-weight: 800;
    color: #A3FF00;
    opacity: 1;
}

.toto-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #A3FF00;
    border: none;
    border-radius: 6px;
    color: #0B132B;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.toto-btn-submit:disabled {
    background: #1F2937;
    color: #374151;
    cursor: not-allowed;
}

.toto-btn-submit:not(:disabled):hover {
    background: #FFD700;
}

.toto-filter-group--action {
    justify-content: flex-end;
}

.toto-btn-me {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #121F3D;
    border: 1px solid #A3FF00;
    border-radius: 6px;
    color: #A3FF00;
    padding: 6px 12px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.toto-btn-me:hover {
    background: #A3FF00;
    color: #0B132B;
}

@keyframes toto-highlight-pulse {
    0%   { background-color: #A3FF00 !important; color: #0B132B !important; }
    60%  { background-color: #A3FF00 !important; color: #0B132B !important; }
    100% { background-color: unset; color: unset; }
}

@keyframes toto-row-glow {
    0%   { box-shadow: inset 0 0 0 2px #A3FF00, 0 0 12px rgba(163,255,0,0.5); }
    60%  { box-shadow: inset 0 0 0 2px #A3FF00, 0 0 12px rgba(163,255,0,0.5); }
    100% { box-shadow: none; }
}

.toto-row-highlight td {
    animation: toto-highlight-pulse 2.2s ease forwards;
}

.toto-row-highlight td:nth-child(1),
.toto-row-highlight td:nth-child(2) {
    animation: toto-highlight-pulse 2.2s ease forwards, toto-row-glow 2.2s ease forwards;
}

.risultato-badge {
    display: inline-block;
    background: #22C55E;
    color: #0B132B;
    font-weight: 800;
    font-size: 0.8em;
    border-radius: 4px;
    padding: 1px 6px;
    letter-spacing: 0.05em;
}

.risultato-pending {
    color: #E6E8EC;
    opacity: 0.3;
}

.esito {
    display: inline-block;
    font-weight: 700;
    font-size: 0.85em;
    border-radius: 4px;
    padding: 1px 6px;
}

.esito--ok {
    background: rgba(34, 197, 94, 0.2);
    color: #22C55E;
}

.esito--ko {
    background: rgba(239, 68, 68, 0.2);
    color: #F87171;
}

.toto-wrapper {
    overflow: auto;
    max-height: 70vh;
    max-width: 100%;
    border: 1px solid #1F2937;
    border-radius: 8px;
    scrollbar-width: thin;
    scrollbar-color: #A3FF00 #0B132B;
}

.toto-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.toto-wrapper::-webkit-scrollbar-track {
    background: #0B132B;
    border-radius: 4px;
}

.toto-wrapper::-webkit-scrollbar-thumb {
    background: #A3FF00;
    border-radius: 4px;
    border: 2px solid #0B132B;
}

.toto-wrapper::-webkit-scrollbar-thumb:hover {
    background: #FFD700;
}

.toto-wrapper::-webkit-scrollbar-corner {
    background: #0B132B;
}

.toto-wrapper table {
    border-collapse: separate;
    border-spacing: 0;
    white-space: nowrap;
    table-layout: fixed;
}

/* Larghezze fisse uguali per tutte le colonne */
.toto-wrapper col.col-match {
    width: 120px;
}

.toto-wrapper col.col-player {
    width: 120px;
}

.toto-wrapper col.col-points {
    width: 50px;
}

.toto-wrapper th,
.toto-wrapper td {
    border-right: 1px solid #1F2937;
    border-bottom: 1px solid #1F2937;
    padding: 6px 10px;
    text-align: center;
    background: #121F3D;
    color: #E6E8EC;
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toto-wrapper th small,
.toto-wrapper td small {
    display: block;
    font-size: 0.72em;
    opacity: 0.75;
    font-weight: 400;
}

.toto-wrapper th .match-home {
    display: block;
    font-weight: 700;
    font-size: 0.85em;
    color: #A3FF00;
}

.toto-wrapper th .match-vs {
    display: block;
    font-size: 0.65em;
    opacity: 0.5;
    line-height: 1;
    margin: 1px 0;
}

.toto-wrapper th .match-away {
    display: block;
    font-weight: 600;
    font-size: 0.85em;
    color: #E6E8EC;
}

.toto-wrapper th .match-date {
    display: block;
    font-size: 0.65em;
    color: #FFD700;
    margin-top: 3px;
    opacity: 0.9;
}

.toto-wrapper th:first-child,
.toto-wrapper td:first-child {
    border-left: 1px solid #1F2937;
}

.toto-wrapper thead tr:first-child th {
    border-top: 1px solid #1F2937;
}

/* Freeze righe di intestazione (riga 1 e riga 2) */
.toto-wrapper thead tr:nth-child(1) th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #0B132B;
    color: #A3FF00;
}

.toto-wrapper thead tr:nth-child(2) th {
    position: sticky;
    top: 0; /* calcolato via JS */
    z-index: 3;
    background: #1F2937;
    color: #E6E8EC;
}

/* Freeze colonna 1 e colonna 2 */
.toto-wrapper th:nth-child(1),
.toto-wrapper td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #1F2937;
    color: #E6E8EC;
    font-weight: 600;
    border-bottom: 1px solid #374151;
}

.toto-wrapper th:nth-child(2),
.toto-wrapper td:nth-child(2) {
    position: sticky;
    left: 120px;
    z-index: 2;
    background: #1F2937;
    color: #FFD700;
    font-weight: 600;
    border-bottom: 1px solid #374151;
    box-shadow: 4px 0 8px -2px rgba(0,0,0,0.8);
    width: 50px;
    min-width: 50px;
    max-width: 50px;
}

/* Angoli: intersezione header rows + sticky cols → z-index massimo */
.toto-wrapper thead tr:nth-child(1) th:nth-child(1),
.toto-wrapper thead tr:nth-child(1) th:nth-child(2) {
    z-index: 5;
    background: #0B132B;
    color: #A3FF00;
}

.toto-wrapper thead tr:nth-child(1) th:nth-child(2) {
    box-shadow: 4px 0 8px -2px rgba(0,0,0,0.8);
}

.toto-wrapper thead tr:nth-child(2) th:nth-child(1),
.toto-wrapper thead tr:nth-child(2) th:nth-child(2) {
    z-index: 5;
    background: #1F2937;
    color: #E6E8EC;
}

.toto-wrapper thead tr:nth-child(2) th:nth-child(2) {
    box-shadow: 4px 0 8px -2px rgba(0,0,0,0.8);
}

/* ── leaderboard-table (toto) ── */

.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
}

.leaderboard-table thead th {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 0.65rem 1rem;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #0d1117;
}

.leaderboard-table td {
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 0.75rem 1rem;
}

.leaderboard-table tbody tr:hover {
    background: rgba(255,255,255,0.06);
}

.leaderboard-table--neo tbody tr:nth-child(odd) {
    background: rgba(255,255,255,0.015);
}

.leaderboard-table--neo tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.04);
}

.leaderboard-table--neo tbody tr:hover {
    background: rgba(255,255,255,0.1);
}

/* ── fanta-calendar-card (toto) ── */

#totoCalendarCardsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.fanta-calendar-card {
    background: #0B132B;
    border: 2px solid;
    border-radius: 10px;
    padding: 16px;
    padding-top: 32px;
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    color: #E6E8EC;
}

.fanta-calendar-card:hover {
    box-shadow: 0 4px 14px rgba(163, 255, 0, 0.15);
}

.fanta-calendar-card-matchday {
    position: absolute;
    top: -8px;
    left: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: "Barlow Condensed", sans-serif;
    padding: 6px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(163, 255, 0, 0.25);
    color: #0B132B;
    background: #A3FF00;
}

.fanta-calendar-card-status {
    position: absolute;
    top: 12px;
    right: 12px;
}

.fanta-calendar-card-status .match-status {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.fanta-calendar-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.fanta-calendar-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.fanta-calendar-card-label {
    color: #A3FF00;
    font-weight: 600;
}

.fanta-calendar-card-value {
    color: #E6E8EC;
}

.fanta-calendar-card-actions {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #1F2937;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 767px) {
    #totoCalendarCardsContainer {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .fanta-calendar-card {
        padding: 12px;
        padding-top: 28px;
    }

    .fanta-calendar-card-matchday {
        top: -6px;
        left: 6px;
        font-size: 1rem;
        padding: 5px 10px;
    }
}

/* ── toto-exact-score-select ────────────────────────────────── */

.toto-exact-score-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toto-exact-score-group::before {
    content: 'Risultato esatto';
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #E6E8EC;
    opacity: 0.45;
    font-weight: 600;
}

.toto-exact-score-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 40px;
    background: #1F2937;
    border: 1px solid #374151;
    border-radius: 6px;
    color: #E6E8EC;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    padding: 0 2rem 0 0.5rem;
    cursor: pointer;
    outline: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A3FF00' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.toto-exact-score-select:hover {
    border-color: #A3FF00;
    color: #A3FF00;
}

.toto-exact-score-select:focus {
    border-color: #A3FF00;
    color: #A3FF00;
    box-shadow: 0 0 0 2px rgba(163, 255, 0, 0.15);
}

.toto-exact-score-select option {
    background: #121F3D;
    color: #E6E8EC;
    font-weight: 600;
}

.toto-exact-score-select.is-filled {
    background-color: #A3FF00;
    border-color: #A3FF00;
    color: #0B132B;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230B132B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.toto-exact-score-select.is-filled option {
    background: #121F3D;
    color: #E6E8EC;
}

.toto-exact-score-select:disabled {
    background: #111827;
    border-color: #1F2937;
    color: #374151;
    cursor: not-allowed;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

/* ── toto-theme: replica di football-theme con palette TotoAmici ── */

body.toto-theme {
    --toto-primary:       #A3FF00;
    --toto-primary-dark:  #6db300;
    --toto-primary-accent:#C6FF4D;
}

body.toto-theme .box-loader {
    color: var(--toto-primary-accent);
}

body.toto-theme .box-loader-overlay {
    background: rgba(11, 19, 43, 0.82);
    backdrop-filter: blur(2px);
}

body.toto-theme .box-loader-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(163, 255, 0, 0.18);
    border-top-color: var(--toto-primary-accent);
    border-right-color: var(--toto-primary);
    border-radius: 50%;
    box-shadow: 0 0 18px rgba(163, 255, 0, 0.22);
    animation: box-loader-spin 0.8s linear infinite;
}

body.toto-theme .box-loader-text {
    color: #d4ff80;
    opacity: 0.9;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.05rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

body.toto-theme .hero-section {
    border-bottom: 1px solid #0B132B;
    min-height: 360px;
    display: flex;
    align-items: center;
}

@media (max-width: 767px) {
    body.toto-theme .hero-section {
        min-height: 110px;
    }
}

body.toto-theme .brand-shield {
    background: linear-gradient(145deg, var(--toto-primary), var(--toto-primary-dark));
}

body.toto-theme .btn-danger {
    background-color: var(--toto-primary);
    border-color: var(--toto-primary);
}

body.toto-theme .btn-outline-danger {
    color: var(--toto-primary);
    border-color: var(--toto-primary);
}

body.toto-theme .btn-outline-danger:hover {
    color: #0B132B;
    background-color: var(--toto-primary);
    border-color: var(--toto-primary);
}

body.toto-theme .nav-links .nav-link.active,
body.toto-theme .nav-links .nav-link:hover {
    color: var(--toto-primary);
}

body.toto-theme .site-footer {
    border-top-color: var(--toto-primary);
}

body.toto-theme main a:not(.btn):not(.nav-link):not(.dropdown-item) {
    color: var(--toto-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

body.toto-theme main a:not(.btn):not(.nav-link):not(.dropdown-item):hover {
    color: var(--toto-primary-accent);
}

body.toto-theme .football-toolbar {
    margin-top: -22px;
    position: relative;
    z-index: 10;
    background: linear-gradient(180deg, #0B132B, #121F3D);
    border: 1px solid #1F2937;
    border-radius: 14px;
    padding: 16px;
}

body.toto-theme .football-toolbar .dropdown-menu {
    z-index: 2000;
}

body.toto-theme .football-toolbar .toolbar-title {
    color: var(--toto-primary);
}

body.toto-theme .football-toolbar .toolbar-subtitle {
    color: #E6E8EC;
}

body.toto-theme .football-toolbar .btn-toolbar-link {
    font-family: "Barlow Condensed", sans-serif;
    text-transform: uppercase;
    font-size: 1.05rem;
    letter-spacing: 0.4px;
    line-height: 1;
    padding: 8px 12px;
    border-color: #1F2937;
    color: #E6E8EC;
    background: #0B132B;
}

body.toto-theme .football-toolbar .btn-toolbar-link .bi {
    margin-right: 6px;
}

body.toto-theme .football-toolbar .btn-toolbar-link:hover {
    border-color: var(--toto-primary-accent);
    color: #E6E8EC;
}

body.toto-theme .football-toolbar .btn-toolbar-link.is-active {
    border-color: var(--toto-primary-accent);
    color: #0B132B;
    background: var(--toto-primary-accent);
    box-shadow: 0 0 0 2px rgba(163, 255, 0, 0.18), 0 10px 22px rgba(0, 0, 0, 0.35);
}

body.toto-theme .football-toolbar .nav-tabs {
    border-bottom-color: #1F2937;
}

body.toto-theme .football-toolbar .nav-tabs .nav-link {
    border-color: #1F2937;
    color: #E6E8EC;
    background: #0B132B;
}

body.toto-theme .football-toolbar .nav-tabs .nav-link.active {
    color: #0B132B;
    background: var(--toto-primary-accent);
    border-color: var(--toto-primary-accent);
    box-shadow: 0 0 0 2px rgba(163, 255, 0, 0.18);
}

body.toto-theme .matchday-nav--compact .matchday-nav-item:hover {
    border-color: var(--toto-primary-accent);
    background: rgba(163, 255, 0, 0.08);
}

body.toto-theme .matchday-nav--compact .matchday-nav-item.is-current {
    border-color: var(--toto-primary-accent);
    background: var(--toto-primary-accent);
    color: #0B132B;
    box-shadow: 0 0 0 2px rgba(163, 255, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* ── toto-user-card ─────────────────────────────────────────── */

.toto-user-card {
    background: var(--panel);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.75rem 0.5rem;
    aspect-ratio: 1 / 1;
    transition: background 0.2s, box-shadow 0.2s;
}

.toto-user-card:hover {
    background: #1F2937;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.toto-user-card__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(163, 255, 0, 0.3);
    background: rgba(255, 255, 255, 0.06);
    margin-bottom: 0.5rem;
}

.toto-user-card__name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* ── toto-spinner-overlay (global full-page loading) ────────── */

.toto-spinner-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(11, 19, 43, 0.78);
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.toto-spinner-overlay.is-visible {
    opacity: 1;
    pointer-events: all;
}

.toto-spinner-overlay__spinner {
    width: 46px;
    height: 46px;
    border: 4px solid rgba(163, 255, 0, 0.18);
    border-top-color: #C6FF4D;
    border-right-color: #A3FF00;
    border-radius: 50%;
    animation: toto-spin 0.75s linear infinite;
}

.toto-spinner-overlay__text {
    color: #d4ff80;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.05rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    opacity: 0.9;
}

@keyframes toto-spin {
    to { transform: rotate(360deg); }
}

/* ── toto-feedback-modal ────────────────────────────────────── */

.toto-feedback-modal .modal-content {
    background: #0B132B;
    border: 1px solid #1F2937;
    border-radius: 12px;
    color: var(--text-light);
}

.toto-feedback-modal .modal-header {
    border-bottom: 1px solid #1F2937;
    padding: 1rem 1.25rem 0.75rem;
}

.toto-feedback-modal .modal-header .btn-close {
    filter: invert(1) brightness(0.6);
}

.toto-feedback-modal .modal-body {
    padding: 1.25rem;
}

.toto-feedback-modal .modal-footer {
    border-top: 1px solid #1F2937;
    padding: 0.75rem 1.25rem;
}

.toto-feedback-modal__icon {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 0.5rem;
    display: block;
    text-align: center;
}

.toto-feedback-modal__title {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 0.5rem;
}

.toto-feedback-modal__title--success {
    color: #A3FF00;
}

.toto-feedback-modal__title--error {
    color: #F87171;
}

.toto-feedback-modal__message {
    font-size: 0.9rem;
    text-align: center;
    opacity: 0.85;
    line-height: 1.5;
}

.toto-feedback-modal .btn-toto-ok {
    background: #A3FF00;
    border: none;
    color: #0B132B;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 6px;
    padding: 7px 24px;
    width: 100%;
    transition: background 0.2s;
}

.toto-feedback-modal .btn-toto-ok:hover {
    background: #C6FF4D;
}

/* ── toto-results-panel ─────────────────────────────────────── */

.toto-results-panel {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 767px) {
    .toto-results-panel {
        grid-template-columns: 1fr;
    }
}

.toto-results-panel__left {
    position: sticky;
    top: 80px;
}

/* ── results list ───────────────────────────────────────────── */

.toto-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toto-results-list-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.toto-results-list-item:hover {
    background: rgba(163, 255, 0, 0.07);
    border-color: rgba(163, 255, 0, 0.2);
}

.toto-results-list-item.is-active {
    background: rgba(163, 255, 0, 0.12);
    border-color: #A3FF00;
}

.toto-results-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.07);
    color: #94A3B8;
}

.toto-results-rank--gold   { background: rgba(255, 215, 0, 0.2);  color: #FFD700; }
.toto-results-rank--silver { background: rgba(192, 192, 192, 0.2); color: #C0C0C0; }
.toto-results-rank--bronze { background: rgba(205, 127, 50, 0.2);  color: #CD7F32; }

.toto-results-name {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 600;
    color: #E6E8EC;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toto-results-list-item.is-active .toto-results-name {
    color: #A3FF00;
}

.toto-results-pts {
    font-size: 0.9rem;
    font-weight: 800;
    color: #A3FF00;
    white-space: nowrap;
    flex-shrink: 0;
}

.toto-results-pts small {
    font-size: 0.65rem;
    font-weight: 400;
    color: #94A3B8;
    margin-left: 1px;
}

/* ── results detail ─────────────────────────────────────────── */

.toto-results-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.toto-results-detail-avatar {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid rgba(163, 255, 0, 0.35);
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.toto-results-detail-summary {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.toto-results-detail-pts-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #94A3B8;
}

.toto-results-detail-pts-value {
    font-size: 2rem;
    font-weight: 900;
    color: #A3FF00;
    line-height: 1;
}

.toto-results-no-predictions {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #94A3B8;
    font-style: italic;
}

.toto-results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    color: #374151;
    text-align: center;
}

.toto-results-placeholder p {
    margin: 0;
    font-size: 0.875rem;
    color: #6B7280;
}

/* ── toto-selections-grid ───────────────────────────────────── */

.toto-selections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 575px) {
    .toto-selections-grid {
        grid-template-columns: 1fr;
    }
}

/* ── toto-sel-card ──────────────────────────────────────────── */

.toto-sel-card {
    background: #0B132B;
    border: 1px solid #1F2937;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.toto-sel-card:hover {
    border-color: rgba(163, 255, 0, 0.35);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.toto-sel-card--complete {
    border-color: rgba(163, 255, 0, 0.25);
}

.toto-sel-card--partial {
    border-color: rgba(255, 215, 0, 0.2);
}

.toto-sel-card__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid #1F2937;
}

.toto-sel-card__avatar {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid rgba(163, 255, 0, 0.3);
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.toto-sel-card__info {
    flex: 1;
    min-width: 0;
}

.toto-sel-card__name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #A3FF00;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toto-sel-card__meta {
    font-size: 0.72rem;
    color: #94A3B8;
    margin-top: 2px;
}

.toto-sel-card__filled {
    font-weight: 700;
    color: #E6E8EC;
}

.toto-sel-card__points {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 1rem;
    font-weight: 900;
    color: #A3FF00;
    line-height: 1;
    white-space: nowrap;
}

.toto-sel-card__points small {
    font-size: 0.6rem;
    font-weight: 400;
    color: #94A3B8;
    margin-left: 1px;
}

.toto-sel-card__body {
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ── toto-sel-row ───────────────────────────────────────────── */

.toto-sel-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
}

.toto-sel-row:last-child {
    border-bottom: none;
}

.toto-sel-match {
    flex: 1;
    color: #E6E8EC;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toto-sel-result {
    flex-shrink: 0;
    min-width: 28px;
    text-align: center;
}

.toto-sel-sign {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 800;
    flex-shrink: 0;
}

.toto-sel-sign--set {
    background: rgba(163, 255, 0, 0.15);
    color: #A3FF00;
    border: 1px solid rgba(163, 255, 0, 0.3);
}

.toto-sel-sign--empty {
    background: rgba(255, 255, 255, 0.04);
    color: #4B5563;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── toto-rules ─────────────────────────────────────────────── */

.toto-rules-header {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.toto-rules-subtitle {
    font-size: 0.875rem;
    color: #94A3B8;
    margin: 0;
}

.toto-rule-card {
    background: #0B132B;
    border: 1px solid #1F2937;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.toto-rule-card:hover {
    border-color: rgba(163, 255, 0, 0.3);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.toto-rule-card--wide {
    border-color: rgba(163, 255, 0, 0.2);
    background: linear-gradient(135deg, #0B132B 60%, rgba(163, 255, 0, 0.04));
}

.toto-rule-card__icon-wrap {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: rgba(163, 255, 0, 0.07);
    border: 1px solid rgba(163, 255, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    overflow: hidden;
}

.toto-rule-card--wide .toto-rule-card__icon-wrap {
    width: 96px;
    height: 96px;
    padding: 6px;
}

.toto-rule-card__icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.toto-rule-card__body {
    flex: 1;
    min-width: 0;
}

.toto-rule-card__title {
    font-size: 1rem;
    font-weight: 800;
    color: #A3FF00;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.toto-rule-card--wide .toto-rule-card__title {
    font-size: 1.1rem;
}

.toto-rule-card__text {
    font-size: 0.875rem;
    color: #CBD5E1;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.toto-rule-card__text strong {
    color: #E6E8EC;
}

.toto-rule-card__link {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #A3FF00;
    text-decoration: none;
    letter-spacing: 0.03em;
}

.toto-rule-card__link:hover {
    color: #C6FF4D;
    text-decoration: underline;
}

@media (max-width: 575px) {
    .toto-rule-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
        padding: 1rem;
    }
}
