* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Space Grotesk", sans-serif;
    background: rgb(160,0,0);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: white;
    font-size: 3rem;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.back-button {
    display: inline-block;
    margin-bottom: 20px;
    padding: 12px 24px;
    background: white;
    color: rgb(160,0,0);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Grid per anni e flashcards */
.year-grid, .category-grid, .match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.year-card, .category-card, .match-card {
    background: white;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 150px;
}

.year-card:hover, .category-card:hover, .match-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.year-card h2, .category-card h2 {
    font-size: 2.5rem;
    color: rgb(160,0,0);
    margin: 0;
}

.match-card {
    padding: 20px;
    min-height: 200px;
}

.match-card h3 {
    font-size: 1.3rem;
    color: rgb(160,0,0);
    margin-bottom: 10px;
}

.match-card .match-info {
    font-size: 0.95rem;
    color: #666;
    margin: 5px 0;
}

.match-card .match-date {
    font-weight: 600;
    color: #764ba2;
    margin-top: 10px;
}

/* Galleria foto */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.photo-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 10px;
    aspect-ratio: 1;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.photo-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modal per immagine full size */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.close {
    position: absolute;
    top: 30px;
    right: 50px;
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
}

.close:hover {
    color: #667eea;
    transform: scale(1.2);
}

.loading {
    text-align: center;
    color: white;
    font-size: 1.2rem;
    margin-top: 50px;
}

.no-photos {
    text-align: center;
    color: white;
    font-size: 1.5rem;
    margin-top: 50px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .year-grid, .category-grid, .match-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .year-card, .category-card {
        padding: 30px 15px;
        min-height: 120px;
    }

    .year-card h2, .category-card h2 {
        font-size: 2rem;
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .close {
        top: 20px;
        right: 30px;
        font-size: 40px;
    }

    .match-card h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .year-grid, .category-grid, .match-grid {
        grid-template-columns: 1fr;
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
}
