/*
Card overview pages: gallery years, tournament, bingo and tournament 2025 (group stage / bracket).
Layout ranges: phone up to 600px, tablet 601-950px, desktop from 951px.
All four pages use exactly the same layout, so the cards sit at the same spot on each.
*/

/* Frame: 32px side margins, at most 1200px wide, cards start 64px below the 80px header (48px on phones) */
.years-page, .tournament-page.tournament-sections {
    box-sizing: border-box;
    width: min(calc(100% - 64px), 1200px);
    min-height: 0;
    margin: calc(5rem + 64px) auto 0;
    text-align: center;
    isolation: isolate;
}

/* 3 columns on desktop, 2 on tablet, 1 on phones (single cards keep the same width) */
.years-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem 2.5rem;
    padding: 0;
}

.year-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    width: calc((100% - 5rem) / 3);
    color: white;
    transform: rotate(-3deg);
    transition: transform .3s;
}

.year-card:nth-child(even) {
    transform: rotate(3deg);
}

.year-image {
    position: relative;
    display: block;
    box-sizing: border-box;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border: 3px solid black;
    border-radius: .4rem;
    background: black;
    box-shadow: 6px 6px 0 black;
}

.year-cover {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.year-number {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-shadow: 2px 2px 4px #0008;
}

.year-lock {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: #0003;
    color: #000b;
}

/* Gallery cards carry their lock in the page; it goes away once the year is unlocked */
.year-card:not(.is-locked) .year-lock {
    display: none;
}

.year-lock svg {
    width: 64px;
    height: auto;
    filter: drop-shadow(0 1px 1px #fff4);
}

.year-card:focus-visible {
    transform: scale(1.05);
}

@media (hover: hover) and (pointer: fine) {
    .year-card:hover {
        transform: scale(1.05);
    }
}

.year-card:focus-visible {
    outline: 2px solid white;
    outline-offset: 12px;
    border-radius: .4rem;
}

/* Tablet */
@media (max-width: 950px) {
    .year-card {
        width: calc((100% - 2.5rem) / 2);
    }

    .year-number {
        font-size: 1.75rem;
    }

    .year-lock svg {
        width: 56px;
    }
}

/* Phone */
@media (max-width: 600px) {
    .years-page, .tournament-page.tournament-sections {
        margin-top: calc(5rem + 48px);
    }

    .years-grid {
        gap: 2.5rem;
    }

    .year-card {
        width: min(100%, 400px);
    }

    .year-number {
        font-size: 1.5rem;
    }

    .year-lock svg {
        width: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .year-card {
        transition: none;
    }

    .year-card:hover, .year-card:focus-visible {
        transform: none;
    }
}
