/* General Styles */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

h1 {
    color: #212529;
    font-weight: 600;
}

/* Dropdown Styles */
#edizioneSelect {
    font-size: 1rem;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    padding: 10px;
    transition: all 0.3s ease;
}

#edizioneSelect:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Tabs Styles */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    color: #6c757d;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: #0d6efd;
    background-color: transparent;
    border-bottom-color: #0d6efd;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    background-color: transparent;
    border-bottom-color: #0d6efd;
}

/* Nascondi i tab fino alla selezione di un'edizione */
.tab-nascosto {
    display: none;
}

/* Tab Content */
.tab-content {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 30px;
    min-height: 400px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.content-placeholder {
    padding: 60px 20px;
}

.content-placeholder p {
    font-size: 1.2rem;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 992px) {
    .gare-girone-container {
        padding: 15px;
    }

    .classifica-girone-container {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }

    .nav-tabs {
        flex-wrap: wrap;
    }

    .nav-tabs .nav-link {
        font-size: 0.9rem;
        padding: 10px 15px;
    }

    .tab-content {
        padding: 20px 15px;
        min-height: 300px;
    }

    #edizioneSelect {
        font-size: 0.9rem;
    }

    .gare-girone-container {
        padding: 10px;
    }

    .classifica-girone-container {
        padding: 10px;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.5rem;
    }

    .nav-tabs .nav-link {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .tab-content {
        padding: 15px 10px;
    }

    .content-placeholder {
        padding: 40px 10px;
    }

    .content-placeholder p {
        font-size: 1rem;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
}

.loading::after {
    content: "Caricamento...";
    font-size: 1.1rem;
    color: #6c757d;
}

/* Edizioni Cards - Flip Effect */
.edizione-card-wrapper {
    perspective: 1000px;
    margin-bottom: 30px;
}

.edizione-card {
    position: relative;
    width: 100%;
    height: 350px;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.edizione-card-wrapper:hover .edizione-card {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.card-front {
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.card-front::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.7) 100%);
}

.card-title {
    position: relative;
    z-index: 1;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    padding: 20px;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.card-back {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.card-back-text {
    color: white;
    font-size: 1.4rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.card-back-btn {
    background-color: white;
    color: #667eea;
    border: none;
    padding: 12px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.card-back-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Responsive Cards */
@media (max-width: 768px) {
    .edizione-card {
        height: 300px;
    }

    .card-title {
        font-size: 1.3rem;
        padding: 15px;
    }

    .card-back-text {
        font-size: 1.2rem;
    }

    .card-back-btn {
        padding: 10px 30px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .edizione-card {
        height: 250px;
    }

    .card-title {
        font-size: 1.1rem;
        padding: 12px;
    }

    .card-back-text {
        font-size: 1rem;
        margin-bottom: 15px;
    }

    .card-back-btn {
        padding: 8px 25px;
        font-size: 0.9rem;
    }
}

/* Fasi del Torneo Styles */
.fasi-container {
    padding: 20px;
}

.fasi-title {
    color: #212529;
    font-weight: 600;
    font-size: 2rem;
    margin-bottom: 30px;
}

#fasiButtonsContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 15px;
}

.fase-button-wrapper {
    flex: 1 1 auto;
    min-width: 200px;
    max-width: 300px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.fase-button-wrapper:nth-child(1) {
    animation-delay: 0.1s;
}

.fase-button-wrapper:nth-child(2) {
    animation-delay: 0.2s;
}

.fase-button-wrapper:nth-child(3) {
    animation-delay: 0.3s;
}

.fase-button-wrapper:nth-child(4) {
    animation-delay: 0.4s;
}

.fase-button-wrapper:nth-child(5) {
    animation-delay: 0.5s;
}

.fase-button-wrapper:nth-child(6) {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fase-button {
    width: 100%;
    padding: 20px 30px;
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.fase-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    transition: left 0.5s ease;
}

.fase-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.fase-button:hover::before {
    left: 100%;
}

.fase-button:active {
    transform: translateY(-2px);
}

.fase-button.selected {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

/* Responsive Fasi Buttons */
@media (max-width: 768px) {
    .fasi-title {
        font-size: 1.6rem;
    }

    .fase-button {
        padding: 18px 25px;
        font-size: 1.2rem;
    }

    .fase-button-wrapper {
        min-width: 180px;
    }
}

@media (max-width: 576px) {
    .fasi-title {
        font-size: 1.4rem;
    }

    .fase-button {
        padding: 15px 20px;
        font-size: 1.1rem;
    }

    #fasiButtonsContainer {
        flex-direction: column;
    }

    .fase-button-wrapper {
        max-width: 100%;
        min-width: 100%;
    }
}

/* Gironi Styles */
.gironi-container {
    margin-top: 20px;
    padding-top: 20px;
}

.girone-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.girone-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.girone-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.squadra-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.squadra-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.squadra-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 15px;
    border-radius: 4px;
}

.squadra-nome {
    font-size: 1.1rem;
    font-weight: 500;
    color: #212529;
}

.vedi-gare-btn {
    width: 100%;
    margin-top: 20px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.vedi-gare-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.vedi-gare-btn:active {
    transform: translateY(0);
}

/* Tabellone Stile Tennistico */
.tabellone-container {
    padding: 10px 20px 40px 20px;
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
    background: white;
    min-height: 100vh;
    width: 100%;
}

.bracket-wrapper {
    display: flex;
    gap: 80px;
    min-width: 1400px;
    justify-content: flex-start;
    position: relative;
    padding: 40px;
    margin: 0 auto;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 320px;
    position: relative;
}

.round-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.bracket-matches {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    position: relative;
    flex: 1;
}

/* Distanza i box delle gare del primo turno (Ottavi) */
.bracket-round:nth-child(1) .bracket-matches {
    gap: 20px;
}

/* Distanza i box dei quarti */
.bracket-round:nth-child(2) .bracket-matches {
    gap: 40px;
}

/* Semifinali - distribuisci uniformemente */
.bracket-round:nth-child(3) .bracket-matches {
    gap: 60px;
}

/* Finale - centra verticalmente */
.bracket-round:nth-child(4) .bracket-matches {
    justify-content: center;
    gap: 20px;
}

.semi-spacer {
    display: none;
}

.finale-spacer {
    display: none;
}

.bracket-match {
    position: relative;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0;
    z-index: 2;
}

/* Container per le finali - non più necessario con la griglia */
.finali-container {
    display: contents;
}

/* Finale 3°/4° Posto - stile diverso */
.bracket-match-terzo-quarto {
    opacity: 0.95;
}

.finale-primo-secondo {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    font-weight: 700;
    font-size: 1rem;
}

.finale-terzo-quarto {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

.match-header {
    background: #667eea;
    color: white;
    padding: 8px 12px;
    border-radius: 6px 6px 0 0;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0;
    text-align: center;
}

/* Override specifico per l'header della finale 1°/2° posto */
.match-header.finale-primo-secondo {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
    color: #333 !important;
}

/* Override specifico per l'header della finale 3°/4° posto */
.match-header.finale-terzo-quarto {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%) !important;
}

.match-teams {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 12px;
}

.team-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    flex: 1;
}

.team-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
}

.team-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #212529;
    flex: 1;
}

.score-input {
    width: 60px;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Rimuove le freccine dai campi numerici */
.score-input::-webkit-inner-spin-button,
.score-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.score-input[type=number] {
    -moz-appearance: textfield;
}

.score-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.winner-placeholder {
    flex: 1;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 6px;
    color: #999;
    font-style: italic;
    text-align: center;
}

/* Linee di collegamento tra i match */
.line-horizontal {
    position: absolute;
    height: 0;
    border-top: 3px solid rgba(100, 120, 180, 0.6);
    z-index: 1;
    pointer-events: none;
}

.line-vertical {
    position: absolute;
    width: 0;
    border-left: 3px solid rgba(100, 120, 180, 0.6);
    z-index: 1;
    pointer-events: none;
}

/* Classifica Marcatori Styles */
.marcatori-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.marcatori-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
}

.marcatori-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.marcatore-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #dee2e6;
}

.marcatore-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.marcatore-item.gold {
    border-left-color: #FFD700;
    background: linear-gradient(to right, #FFF9E6 0%, white 100%);
}

.marcatore-item.silver {
    border-left-color: #C0C0C0;
    background: linear-gradient(to right, #F5F5F5 0%, white 100%);
}

.marcatore-item.bronze {
    border-left-color: #CD7F32;
    background: linear-gradient(to right, #FFF0E6 0%, white 100%);
}

.marcatore-posizione {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    min-width: 50px;
    text-align: center;
}

.marcatore-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #dee2e6;
    margin-right: 15px;
}

.marcatore-item.gold .marcatore-avatar {
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.marcatore-item.silver .marcatore-avatar {
    border-color: #C0C0C0;
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.5);
}

.marcatore-item.bronze .marcatore-avatar {
    border-color: #CD7F32;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.5);
}

.marcatore-item.gold .marcatore-posizione {
    color: #FFD700;
}

.marcatore-item.silver .marcatore-posizione {
    color: #C0C0C0;
}

.marcatore-item.bronze .marcatore-posizione {
    color: #CD7F32;
}

.marcatore-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.marcatore-nome {
    font-size: 1.2rem;
    font-weight: 600;
    color: #212529;
}

.marcatore-squadra {
    display: flex;
    align-items: center;
    gap: 10px;
}

.marcatore-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 4px;
}

.marcatore-squadra-nome {
    font-size: 0.95rem;
    color: #6c757d;
}

.marcatore-gol {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    min-width: 60px;
    text-align: center;
}

.marcatore-item.gold .marcatore-gol {
    color: #FFD700;
}

.marcatore-item.silver .marcatore-gol {
    color: #C0C0C0;
}

.marcatore-item.bronze .marcatore-gol {
    color: #CD7F32;
}

/* Responsive Classifica Marcatori */
@media (max-width: 768px) {
    .marcatori-title {
        font-size: 1.6rem;
    }

    .marcatore-item {
        padding: 12px 15px;
    }

    .marcatore-posizione {
        font-size: 1.3rem;
        min-width: 40px;
    }

    .marcatore-avatar {
        width: 50px;
        height: 50px;
        margin-right: 12px;
    }

    .marcatore-nome {
        font-size: 1.1rem;
    }

    .marcatore-gol {
        font-size: 1.6rem;
        min-width: 50px;
    }

    .marcatore-logo {
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 576px) {
    .marcatori-title {
        font-size: 1.4rem;
    }

    .marcatore-item {
        padding: 10px 12px;
    }

    .marcatore-avatar {
        width: 45px;
        height: 45px;
        margin-right: 10px;
    }

    .marcatore-nome {
        font-size: 1rem;
    }

    .marcatore-squadra-nome {
        font-size: 0.85rem;
    }

    .marcatore-gol {
        font-size: 1.4rem;
    }
}

/* Squadre Styles */
.squadre-container {
    padding: 20px;
}

.squadre-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 40px;
}

.squadre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.squadra-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.squadra-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.squadra-photo {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.squadra-photo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 100%);
}

.squadra-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.squadra-card-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: white;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.squadra-card-body {
    padding: 20px;
}

.squadra-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 15px;
    min-height: 50px;
}

.squadra-card-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.squadra-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.info-label {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9rem;
}

.info-value {
    color: #495057;
    font-weight: 500;
}

.squadra-dettagli-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.squadra-dettagli-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.5);
}

.squadra-dettagli-btn:active {
    transform: translateY(0);
}

/* Responsive Squadre */
@media (max-width: 768px) {
    .squadre-title {
        font-size: 1.6rem;
        margin-bottom: 30px;
    }

    .squadre-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .squadra-card-title {
        font-size: 1.1rem;
        min-height: auto;
    }

    .squadra-card-logo {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 576px) {
    .squadre-title {
        font-size: 1.4rem;
    }

    .squadre-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .squadra-photo {
        height: 150px;
    }

    .squadra-card-body {
        padding: 15px;
    }
}

/* Gare Girone Styles */
.gare-girone-container {
    padding: 20px;
    width: 100%;
}

.gare-header {
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.gare-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    justify-content: center;
    margin-bottom: 15px;
}

.gare-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-indietro {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-indietro:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-classifica {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-classifica:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    transform: translateY(-2px);
}

.btn-classifica svg {
    width: 16px;
    height: 16px;
}

.gare-title {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    width: 100%;
    margin-top: 10px;
}

.gare-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gara-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #dee2e6;
    min-width: 280px;
}

.gara-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.gara-item.gara-giocata {
    border-left-color: #28a745;
}

.gara-item.gara-da-giocare {
    border-left-color: #ffc107;
}

.gara-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.gara-numero {
    font-size: 0.9rem;
    font-weight: 600;
    color: #667eea;
}

.gara-datetime {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.gara-data {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
}

.gara-ora {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6c757d;
}

.gara-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.gara-squadra {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.gara-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
}

.gara-nome-squadra {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    text-align: center;
}

/* View Toggle Buttons */
.view-toggle {
    display: flex;
    gap: 10px;
    background: #f1f3f5;
    padding: 4px;
    border-radius: 8px;
}

.btn-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-toggle:hover {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.btn-toggle.active {
    background: white;
    color: #0d6efd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-toggle svg {
    width: 16px;
    height: 16px;
}

/* Visualizzazione Compatta */
.gare-list-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 900px;
    margin: 0 auto;
}

/* Logo mobile compact - stile globale */
.logo-mobile-compact {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    object-fit: contain !important;
}

/* Layout compatto su singola riga */
.gara-row-compact {
    display: grid;
    grid-template-columns: 80px 100px 60px 35px 1fr 50px 50px 35px 1fr 50px 120px;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    border-left: 4px solid #dee2e6;
    margin-bottom: 8px;
}

.gara-row-compact:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: translateX(3px);
}

.gara-row-compact.gara-giocata {
    border-left-color: #28a745;
}

.gara-row-compact.gara-da-giocare {
    border-left-color: #ffc107;
}

.compact-numero {
    font-weight: 700;
    color: #667eea;
    font-size: 0.95rem;
}

.compact-data {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
}

.compact-ora {
    font-size: 0.9rem;
    color: #6c757d;
}

.compact-logo {
    width: 35px !important;
    height: 35px !important;
    max-width: 35px !important;
    max-height: 35px !important;
    object-fit: contain !important;
}

.compact-squadra-nome {
    font-size: 0.95rem;
    font-weight: 600;
    color: #212529;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Punteggi individuali - nascosti su desktop */
.compact-punteggio-casa,
.compact-punteggio-ospite {
    display: none;
}

.compact-vs {
    font-weight: 700;
    color: #adb5bd;
    font-size: 0.9rem;
    text-align: center;
}

.compact-risultato {
    font-size: 1.1rem;
    font-weight: 700;
    color: #28a745;
    text-align: center;
}

.compact-da-giocare {
    font-size: 0.85rem;
    font-weight: 600;
    color: #856404;
    background: #fff3cd;
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
}

.gara-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    border-left: 4px solid #dee2e6;
    overflow: hidden;
}

.gara-row:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: translateX(3px);
}

.gara-row.gara-giocata {
    border-left-color: #28a745;
}

.gara-row.gara-da-giocare {
    border-left-color: #ffc107;
}

.gara-col {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gara-col-numero {
    flex-shrink: 0;
    width: 60px;
    font-weight: 700;
    color: #495057;
    font-size: 0.95rem;
}

.gara-col-datetime {
    flex-shrink: 0;
    width: 100px;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-size: 0.9rem;
    color: #6c757d;
}

.gara-time {
    font-size: 0.85rem;
    color: #868e96;
}

.gara-col-squadra {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: #212529;
}

.gara-logo-compact {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
}

.gara-col-vs {
    flex-shrink: 0;
    width: 35px;
    justify-content: center;
    font-weight: 700;
    color: #adb5bd;
    font-size: 0.9rem;
}

.gara-col-risultato {
    flex-shrink: 0;
    width: 100px;
    justify-content: center;
}

.gara-score-compact {
    font-size: 1.1rem;
    font-weight: 700;
    color: #28a745;
}

.gara-status-compact {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    background: #fff3cd;
    color: #856404;
}

.gara-risultato {
    flex: 0 0 auto;
    text-align: center;
}

.gara-score {
    font-size: 1.8rem;
    font-weight: 700;
    color: #28a745;
}

.gara-vs {
    font-size: 1.2rem;
    font-weight: 600;
    color: #6c757d;
}

.gara-status {
    text-align: center;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-giocata {
    background: #d4edda;
    color: #155724;
}

.status-da-giocare {
    background: #fff3cd;
    color: #856404;
}

/* Classifica Girone Styles */
.classifica-girone-container {
    padding: 20px;
    width: 100%;
}

.classifica-header {
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.classifica-title {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.classifica-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.classifica-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.classifica-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.classifica-table th {
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.classifica-table .col-pos {
    width: 60px;
}

.classifica-table .col-squadra {
    text-align: left;
    min-width: 200px;
}

.classifica-table .col-stat {
    width: 50px;
}

.classifica-table .col-punti {
    width: 80px;
    background: rgba(255, 255, 255, 0.1);
}

.classifica-row {
    border-bottom: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.classifica-row:hover {
    background: #f8f9fa;
}

.classifica-row.first-place {
    background: linear-gradient(to right, #fff9e6 0%, white 100%);
    border-left: 4px solid #FFD700;
}

.classifica-row.second-place {
    background: linear-gradient(to right, #f0f0f0 0%, white 100%);
    border-left: 4px solid #C0C0C0;
}

.classifica-table td {
    padding: 12px 10px;
    text-align: center;
    font-size: 0.95rem;
}

.classifica-table .col-squadra {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 15px;
}

.classifica-logo {
    width: 35px;
    height: 35px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

.squadra-nome-classifica {
    font-weight: 600;
    color: #212529;
}

.col-punti {
    font-size: 1.1rem;
    color: #0d6efd;
}

.positive-dr {
    color: #28a745;
    font-weight: 600;
}

.negative-dr {
    color: #dc3545;
    font-weight: 600;
}

.classifica-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-label {
    font-weight: 700;
    color: #495057;
}

/* Responsive Classifica Girone */
@media (max-width: 768px) {
    .classifica-header {
        gap: 10px;
    }

    .classifica-title {
        font-size: 1.5rem;
    }

    .classifica-header .btn-indietro {
        width: 100%;
        max-width: 400px;
    }

    .classifica-table {
        font-size: 0.85rem;
    }

    .classifica-table th,
    .classifica-table td {
        padding: 8px 5px;
    }

    .classifica-logo {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 576px) {
    .classifica-title {
        font-size: 1.3rem;
    }

    .classifica-girone-container {
        padding: 10px;
    }

    /* Mantieni la tabella ma semplificala */
    .classifica-table-container {
        overflow-x: visible;
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        margin-bottom: 20px;
    }

    .classifica-table {
        min-width: auto;
        width: 100%;
    }

    /* Header semplificato - solo 3 colonne */
    .classifica-table thead {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    }

    .classifica-table thead th {
        padding: 12px 8px;
        font-size: 0.85rem;
    }

    /* Nascondi tutte le colonne tranne Pos, Squadra e Punti */
    .classifica-table th:nth-child(n+3):nth-child(-n+9),
    .classifica-table td:nth-child(n+3):nth-child(-n+9) {
        display: none;
    }

    /* Colonna posizione */
    .classifica-table .col-pos {
        width: 50px;
        text-align: center;
    }

    /* Colonna squadra - nascondi logo */
    .classifica-table .col-squadra {
        text-align: left;
        padding-left: 12px;
        min-width: auto;
    }

    .classifica-logo {
        display: none;
    }

    .squadra-nome-classifica {
        font-size: 0.95rem;
        font-weight: 600;
    }

    /* Colonna punti */
    .classifica-table .col-punti {
        width: 70px;
        text-align: center;
        background: rgba(102, 126, 234, 0.1);
    }

    .classifica-table td {
        padding: 12px 8px;
        font-size: 0.9rem;
    }

    /* Righe */
    .classifica-row {
        border-bottom: 1px solid #e9ecef;
    }

    .classifica-row:last-child {
        border-bottom: none;
    }

    .classifica-row.first-place {
        background: linear-gradient(to right, #FFF9E6 0%, white 100%);
        border-left: 4px solid #FFD700;
    }

    .classifica-row.second-place {
        background: linear-gradient(to right, #F5F5F5 0%, white 100%);
        border-left: 4px solid #C0C0C0;
    }

    /* Punti - semplici senza badge */
    .classifica-table .col-punti strong {
        font-size: 1.1rem;
        font-weight: 700;
        color: #212529;
    }

    /* Nascondi la legenda su mobile */
    .classifica-legend {
        display: none;
    }
}

/* Responsive Gare */
@media (max-width: 1200px) {
    .gare-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 900px) {
    .gare-list {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .gara-item {
        min-width: 300px;
    }
}

@media (max-width: 600px) {
    .gare-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .gara-item {
        min-width: auto;
        width: 100%;
    }
}

/* Compact view - schermi medi e grandi */
@media (min-width: 901px) {
    .gara-row-compact {
        grid-template-columns: 80px 100px 60px 35px 1fr 50px 35px 1fr 120px;
    }
}

@media (max-width: 900px) {
    .gare-list-compact {
        max-width: 100%;
        padding: 0 15px;
    }

    .gara-row-compact {
        grid-template-columns: 70px 90px 55px 32px minmax(120px, 1fr) 45px 32px minmax(120px, 1fr) 100px;
        gap: 8px;
        padding: 10px 15px;
    }

    .compact-numero {
        font-size: 0.85rem;
    }

    .compact-data,
    .compact-ora {
        font-size: 0.8rem;
    }

    .compact-logo {
        width: 32px !important;
        height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
    }

    .compact-squadra-nome {
        font-size: 0.85rem;
    }

    .compact-risultato {
        font-size: 1rem;
    }
}

    .gara-row {
        gap: 8px;
        padding: 10px 12px;
    }

    .gara-col-numero {
        width: 50px;
        font-size: 0.85rem;
    }

    .gara-col-datetime {
        width: 85px;
        font-size: 0.8rem;
    }

    .gara-time {
        font-size: 0.75rem;
    }

    .gara-col-squadra {
        font-size: 0.85rem;
    }

    .gara-logo-compact {
        width: 28px;
        height: 28px;
    }

    .gara-col-vs {
        width: 30px;
        font-size: 0.8rem;
    }

    .gara-col-risultato {
        width: 85px;
    }

    .gara-score-compact {
        font-size: 0.95rem;
    }

    .gara-status-compact {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
}

@media (max-width: 992px) {
    .gare-header {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .gare-header-left {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .gare-actions {
        width: 100%;
        flex-direction: column;
    }

    .btn-indietro,
    .btn-classifica {
        width: 100%;
        max-width: 400px;
    }

    .gare-title {
        font-size: 1.6rem;
        order: -1;
        margin-bottom: 15px;
    }
}

@media (max-width: 768px) {
    .gares-title {
        font-size: 1.5rem;
        margin-top: 50px;
    }

    .gare-header {
        flex-direction: column;
        gap: 15px;
    }

    .gare-header-left {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .btn-indietro {
        width: 100%;
    }

    .btn-classifica {
        width: 100%;
    }

    .gare-title {
        font-size: 1.4rem;
    }

    /* Layout compatto su mobile - forza tutto su blocchi separati */
    .gara-row-compact {
        display: block !important;
        padding: 15px !important;
    }

    /* Riga 1: Header - tutti inline sulla stessa riga */
    .compact-numero,
    .compact-data,
    .compact-ora {
        display: inline !important;
        line-height: 1.5 !important;
    }

    .compact-numero {
        font-weight: 700 !important;
        color: #667eea !important;
        font-size: 1rem !important;
    }

    .compact-numero::after {
        content: " • " !important;
        color: #adb5bd !important;
        margin: 0 6px !important;
    }

    .compact-data {
        font-size: 0.9rem !important;
        font-weight: 600 !important;
    }

    .compact-data::after {
        content: " • " !important;
        color: #adb5bd !important;
        margin: 0 6px !important;
    }

    .compact-ora {
        font-size: 0.9rem !important;
        color: #6c757d !important;
    }

    .compact-ora::after {
        content: "" !important;
        display: block !important;
        margin-bottom: 12px !important;
    }

    /* Riga 2 e 3: Squadre con loghi, nomi e punteggi */
    .compact-logo {
        display: block !important;
        width: 45px !important;
        height: 45px !important;
        max-width: 45px !important;
        max-height: 45px !important;
        float: left !important;
        margin: 8px 12px 8px 0 !important;
    }

    .compact-squadra-nome {
        display: block !important;
        font-size: 0.95rem !important;
        font-weight: 600 !important;
        white-space: normal !important;
        line-height: 1.4 !important;
        padding-top: 12px !important;
        overflow: hidden !important;
    }

    .compact-punteggio-casa,
    .compact-punteggio-ospite {
        display: block !important;
        font-size: 1.3rem !important;
        font-weight: 700 !important;
        color: #28a745 !important;
        text-align: right !important;
        float: right !important;
        margin-top: 8px !important;
        min-width: 40px !important;
    }

    /* VS - nascosto su mobile */
    .compact-vs {
        display: none !important;
    }

    /* Risultato combinato - nascosto su mobile */
    .compact-risultato {
        display: none !important;
    }

    /* Clearfix dopo ogni squadra */
    .compact-squadra-nome::after {
        content: "" !important;
        display: block !important;
        clear: both !important;
    }

    /* Cards su mobile: 1 per riga */
    .gare-list {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .gara-content {
        flex-direction: row;
        gap: 10px;
        align-items: stretch;
    }

    .gara-squadra {
        flex: 1;
        min-width: 0;
        justify-content: flex-start;
    }

    .gara-risultato {
        flex: 0 0 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .gara-score {
        font-size: 1.8rem;
        writing-mode: horizontal-tb;
    }

    .gara-vs {
        font-size: 1.2rem;
    }

    .gara-logo {
        width: 40px;
        height: 40px;
    }

    .gara-nome-squadra {
        font-size: 0.85rem;
        text-align: center;
    }

    /* Compact view responsive - tablet */
    .gara-row {
        flex-wrap: wrap;
    }

    .gara-col-squadra span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 120px;
        display: inline-block;
    }
}

/* Tablet landscape e schermi medi - mantiene layout orizzontale */
@media (max-width: 900px) and (min-width: 577px) {
    .gara-item {
        padding: 15px;
    }

    .gara-content {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        margin-bottom: 15px;
    }

    .gara-squadra {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .gara-risultato {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 70px;
        padding: 0 10px;
    }

    .gara-score {
        font-size: 1.6rem;
        font-weight: 700;
        color: #28a745;
        white-space: nowrap;
    }

    .gara-vs {
        font-size: 1.1rem;
        font-weight: 600;
        color: #6c757d;
        white-space: nowrap;
    }

    .gara-logo {
        width: 42px;
        height: 42px;
    }

    .gara-nome-squadra {
        font-size: 0.85rem;
        text-align: center;
        line-height: 1.2;
        word-wrap: break-word;
        max-width: 150px;
    }
}

@media (max-width: 576px) {
    .gare-title {
        font-size: 1.3rem;
    }

    .gara-item {
        padding: 15px;
    }

    /* Header info: numero gara a sinistra, data/ora a destra */
    .gara-header-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
    }

    .gara-numero {
        font-size: 0.9rem;
        font-weight: 600;
        color: #667eea;
    }

    .gara-datetime {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
    }

    .gara-data {
        font-size: 0.85rem;
        font-weight: 600;
        color: #495057;
    }

    .gara-ora {
        font-size: 0.8rem;
        font-weight: 500;
        color: #6c757d;
    }

    /* Layout mobile: squadre affiancate orizzontalmente con risultato al centro */
    .gara-content {
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        margin-bottom: 0;
    }

    .gara-squadra {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        min-width: 0;
    }

    .gara-risultato {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 8px;
    }

    .gara-logo {
        width: 45px;
        height: 45px;
    }

    .gara-nome-squadra {
        font-size: 0.75rem;
        text-align: center;
        word-wrap: break-word;
        line-height: 1.2;
    }

    .gara-score {
        font-size: 1.4rem !important;
        font-weight: 700;
        color: #28a745;
        white-space: nowrap;
    }

    .gara-vs {
        font-size: 1rem;
        font-weight: 600;
        color: #6c757d;
    }

    /* Status deve andare sotto */
    .gara-status {
        margin-top: 10px;
    }

    /* Compact view su mobile - layout a righe orizzontali */
    .gare-list-compact {
        padding: 0 5px;
    }

    .gara-row {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    /* Header: numero a sinistra, data e ora a destra */
    .gara-col-numero {
        font-size: 1.1rem;
        font-weight: 700;
        color: #667eea;
    }

    .gara-col-datetime {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        font-size: 0.85rem;
        color: #6c757d;
        font-weight: 600;
    }

    .gara-col-datetime > div {
        display: inline;
    }

    .gara-time {
        font-weight: 500;
    }

    /* Wrapper per header */
    .gara-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 12px;
        border-bottom: 1px solid #e9ecef;
    }

    .gara-mobile-header .gara-col-numero {
        font-size: 1.1rem;
        font-weight: 700;
        color: #667eea;
    }

    .gara-mobile-header .gara-col-datetime {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        font-size: 0.85rem;
        color: #6c757d;
        font-weight: 600;
    }

    /* Wrapper per ogni squadra */
    .gara-mobile-squadra {
        display: grid;
        grid-template-columns: 40px 1fr auto;
        align-items: center;
        gap: 10px;
        padding: 8px 0;
    }

    /* Logo della squadra */
    .gara-mobile-squadra img,
    .logo-mobile-compact {
        width: 40px !important;
        height: 40px !important;
        object-fit: contain !important;
        justify-self: center;
        max-width: 40px !important;
        max-height: 40px !important;
    }

    /* Nome della squadra */
    .gara-mobile-squadra-nome {
        text-align: left;
        font-size: 1rem;
        font-weight: 600;
        color: #212529;
        line-height: 1.3;
    }

    /* Gol della squadra */
    .gara-mobile-gol {
        font-size: 2.2rem;
        font-weight: 700;
        color: #28a745;
        text-align: right;
        min-width: 60px;
    }

    .gara-logo-compact {
        width: 40px;
        height: 40px;
        object-fit: contain;
    }

    /* Status */
    .gara-status-compact {
        text-align: center;
        font-size: 0.85rem;
        margin-top: 8px;
        padding: 8px 16px;
        border-radius: 20px;
        font-weight: 600;
    }

    .gara-status-compact.status-giocata {
        background: #d4edda;
        color: #155724;
    }

    .gara-status-compact.status-da-giocare {
        background: #fff3cd;
        color: #856404;
    }
}

/* Responsive Gironi */
@media (max-width: 768px) {
    .girone-title {
        font-size: 1.3rem;
    }

    .squadra-nome {
        font-size: 1rem;
    }

    .squadra-logo {
        width: 35px;
        height: 35px;
    }

    .bracket-wrapper {
        min-width: auto;
        flex-direction: column;
        gap: 30px;
    }

    .round-title {
        font-size: 1.3rem;
    }

    .bracket-match::after {
        display: none;
    }
}

@media (max-width: 576px) {
    .girone-card {
        padding: 15px;
    }

    .girone-title {
        font-size: 1.2rem;
    }

    .squadra-item {
        padding: 10px;
    }

    .squadra-nome {
        font-size: 0.95rem;
    }

    .squadra-logo {
        width: 30px;
        height: 30px;
        margin-right: 10px;
    }
}

/* Dettaglio Squadra Styles */
.btn-indietro-squadre {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-indietro-squadre:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.squadra-dettaglio-container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.squadra-foto-wrapper {
    position: relative;
    width: 100%;
}

.squadra-foto-grande {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    display: block;
}

.squadra-logo-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    max-width: 120px;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.squadra-info {
    padding: 20px;
}

.squadra-nome-grande {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Cards Giocatori */
.giocatore-card {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 12px;
    height: 100%;
}

.giocatore-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.giocatore-foto-container {
    position: relative;
    width: 100%;
    padding-top: 102%;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.giocatore-foto {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.giocatore-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.giocatore-placeholder svg {
    width: 60%;
    height: 60%;
    opacity: 0.3;
    fill: white;
}

.giocatore-numero-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 700;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.giocatore-info {
    padding: 8px;
}

.giocatore-nome {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
    line-height: 1.2;
}

.giocatore-ruolo {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Dettaglio Squadra */
@media (max-width: 768px) {
    .squadra-foto-grande {
        height: 300px;
        margin-bottom: 20px;
    }

    .squadra-nome-grande {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .squadra-dettaglio-container {
        padding: 20px;
    }

    .squadra-nome-grande {
        font-size: 1.5rem;
    }
}

/* Stili Gare Squadra */
.gare-squadra-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.gara-squadra-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.gara-squadra-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.gara-squadra-item.gara-giocata {
    border-left: 4px solid #48bb78;
}

.gara-squadra-item.gara-da-giocare {
    border-left: 4px solid #667eea;
}

.gara-squadra-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.gara-fase-info {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9rem;
}

.gara-squadra-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.gara-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.gara-team-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.gara-team-nome {
    font-weight: 600;
    color: #2d3748;
    text-align: center;
    font-size: 0.95rem;
}

.gara-squadra-risultato {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
}

.gara-score-large {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
}

.gara-vs-large {
    font-size: 1.5rem;
    font-weight: 700;
    color: #cbd5e0;
}

@media (max-width: 768px) {
    .gara-squadra-content {
        flex-direction: column;
        gap: 15px;
    }

    .gara-team {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
    }

    .gara-team-logo {
        width: 40px;
        height: 40px;
    }

    .gara-team-nome {
        text-align: left;
    }

    .gara-squadra-risultato {
        width: 100%;
        padding: 10px 0;
    }
}

/* Stili Gare Squadra - Versione Compatta */
.gare-squadra-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gara-squadra-item {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.gara-squadra-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.gara-squadra-item.gara-giocata {
    border-left: 3px solid #48bb78;
}

.gara-squadra-item.gara-da-giocare {
    border-left: 3px solid #667eea;
}

.gara-squadra-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.gara-info-left {
    min-width: 200px;
}

.gara-fase-info {
    font-weight: 600;
    color: #667eea;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.gara-datetime {
    font-size: 0.75rem;
    color: #718096;
}

.gara-teams {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: flex-end;
}

.gara-team {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
}

.gara-team-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.gara-team-nome {
    font-weight: 500;
    color: #2d3748;
    font-size: 0.85rem;
}

.gara-squadra-risultato {
    min-width: 60px;
    text-align: center;
}

.gara-score-compact {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d3748;
}

.gara-vs-compact {
    font-size: 1rem;
    font-weight: 600;
    color: #cbd5e0;
}

@media (max-width: 992px) {
    .gara-squadra-content {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .gara-info-left {
        width: 100%;
        min-width: auto;
    }

    .gara-teams {
        width: 100%;
        justify-content: space-between;
    }

    .gara-team {
        min-width: auto;
        flex: 1;
    }

    .gara-team-nome {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .gara-teams {
        flex-direction: column;
        gap: 8px;
    }

    .gara-team {
        width: 100%;
    }

    .gara-squadra-risultato {
        width: 100%;
    }
}

/* Stili Gare Squadra - Layout Inline Unica Riga */
.gare-squadra-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gara-squadra-item {
    background: white;
    border-radius: 6px;
    padding: 10px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.gara-squadra-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.gara-squadra-item.gara-giocata {
    border-left: 3px solid #48bb78;
}

.gara-squadra-item.gara-da-giocare {
    border-left: 3px solid #667eea;
}

.gara-squadra-content-inline {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap;
}

.gara-fase-info-inline {
    font-weight: 600;
    color: #667eea;
    font-size: 0.8rem;
    min-width: 150px;
    flex-shrink: 0;
}

.gara-datetime-inline {
    font-size: 0.75rem;
    color: #718096;
    min-width: 120px;
    flex-shrink: 0;
}

.gara-team-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    flex: 1;
}

.gara-team-logo-inline {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.gara-team-nome-inline {
    font-weight: 500;
    color: #2d3748;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gara-risultato-inline {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    min-width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.gara-squadra-item.gara-da-giocare .gara-risultato-inline {
    color: #cbd5e0;
    font-weight: 600;
}

@media (max-width: 1200px) {
    .gara-fase-info-inline {
        min-width: 120px;
        font-size: 0.75rem;
    }

    .gara-team-inline {
        min-width: 150px;
    }

    .gara-team-nome-inline {
        font-size: 0.8rem;
    }
}

@media (max-width: 992px) {
    .gara-squadra-content-inline {
        flex-wrap: wrap;
        gap: 10px;
    }

    .gara-fase-info-inline,
    .gara-datetime-inline {
        min-width: auto;
    }

    .gara-team-inline {
        min-width: 45%;
    }
}

@media (max-width: 576px) {
    .gara-squadra-content-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .gara-team-inline {
        width: 100%;
        min-width: auto;
    }

    .gara-risultato-inline {
        width: 100%;
    }
}
