.active-ticket-field {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
    padding: 0 1rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

.active-ticket-field-col {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.active-ticket-field .match-box-section-header {
    width: 100%;
    margin-bottom: 0.75rem;
}

.active-ticket-field .active-field {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 2 / 1;
    padding: 0.75rem;
    box-sizing: border-box;
}

.active-ticket-field .active-field-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.45s ease;
    z-index: 0;
}

.active-ticket-field .active-field.active-field--match::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        165deg,
        rgba(0, 0, 0, 0.72) 0%,
        rgba(0, 0, 0, 0.42) 42%,
        rgba(0, 0, 0, 0.55) 68%,
        rgba(0, 0, 0, 0.78) 100%
    );
}

.active-ticket-field .active-field-content {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

/* Match box panel */
.match-box-panel {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr var(--match-box-footer-height, 5.5rem);
    height: 100%;
    min-height: 0;
    gap: 0.3rem;
    --match-box-footer-height: 5.5rem;
    --match-box-logo-size: 100px;
    --match-box-scoreboard-width: 5.1rem;
    --match-box-score-digit-w: 1.98rem;
    --match-box-score-digit-h: 3.3rem;
}

.match-box-meta {
    grid-row: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
    min-height: 50px;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
}

.match-box-meta-left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    flex: 1 1 auto;
}

.match-box-league-logo {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-box-league-logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.match-box-league-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.match-box-league-name {
    font-family: "Saira Condensed", sans-serif;
    font-size: clamp(0.72rem, 1.2vw, 0.88rem);
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-box-round {
    font-family: "Kumbh Sans", sans-serif;
    font-size: clamp(0.55rem, 0.95vw, 0.68rem);
    font-weight: 600;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-box-meta-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    flex-shrink: 0;
    text-align: right;
}

.match-box-datetime {
    font-family: "Saira Condensed", sans-serif;
    font-size: clamp(0.7rem, 1.1vw, 0.85rem);
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #fff;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.match-box-venue {
    font-family: "Kumbh Sans", sans-serif;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    line-height: 1.2;
}

.match-box-venue--home {
    background: #e40001;
    color: #fff;
    box-shadow: 0 2px 8px rgba(228, 0, 1, 0.35);
}

.match-box-venue--away {
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.match-box-body {
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
}

.match-box-teams {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--match-box-scoreboard-width) minmax(0, 1fr);
    align-items: start;
    gap: 0.35rem 0.5rem;
    padding: 0.1rem 0;
}

.match-box-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem;
    width: 100%;
    min-width: 0;
    justify-self: stretch;
}

.match-box-team--1,
.match-box-team--2 {
    justify-self: stretch;
}

.match-box-team-logo {
    width: var(--match-box-logo-size);
    height: var(--match-box-logo-size);
    max-width: var(--match-box-logo-size);
    max-height: var(--match-box-logo-size);
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.match-box-team-name {
    font-family: "Saira Condensed", sans-serif;
    font-size: clamp(0.68rem, 1.05vw, 0.82rem);
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
    color: #fff;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.match-box-team-name strong {
    color: #fff;
}

.match-box-vs,
.match-box-score {
    align-self: start;
    justify-self: center;
    width: 100%;
    max-width: var(--match-box-scoreboard-width);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-family: "Saira Condensed", sans-serif;
    font-weight: 700;
    color: #fff;
    text-align: center;
    flex-shrink: 0;
    letter-spacing: 0.04em;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    margin-top: calc(var(--match-box-logo-size) / 2 - (var(--match-box-score-digit-h) / 2));
    line-height: 1;
    box-sizing: border-box;
    min-height: var(--match-box-score-digit-h);
}

.match-box-vs {
    font-size: 2.1rem;
    opacity: 1;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
    height: var(--match-box-score-digit-h);
    align-items: center;
}

.match-box-score {
    font-size: 2.1rem;
}

.match-box-score-digit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 var(--match-box-score-digit-w);
    width: var(--match-box-score-digit-w);
    min-width: var(--match-box-score-digit-w);
    height: var(--match-box-score-digit-h);
    box-sizing: border-box;
    border-radius: 0;
    background: #e40001;
    border: none;
    box-shadow: none;
    color: #fff;
    font-family: "Saira Condensed", sans-serif;
    font-size: 2.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.match-box-score-sep {
    opacity: 1;
    font-weight: 700;
    min-width: 0.65rem;
    text-align: center;
    color: #fff;
    font-size: 1.6rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

/* Delikatny tint overlay wg wyniku (gdy jest tło ze zdjęcia) */
.active-ticket-field .active-field.active-field--result-win::before {
    background: linear-gradient(
        165deg,
        rgba(10, 60, 25, 0.55) 0%,
        rgba(0, 0, 0, 0.4) 45%,
        rgba(0, 0, 0, 0.55) 68%,
        rgba(20, 50, 30, 0.72) 100%
    );
}

.active-ticket-field .active-field.active-field--result-draw::before {
    background: linear-gradient(
        165deg,
        rgba(40, 40, 40, 0.62) 0%,
        rgba(0, 0, 0, 0.42) 45%,
        rgba(0, 0, 0, 0.55) 68%,
        rgba(30, 30, 30, 0.75) 100%
    );
}

.active-ticket-field .active-field.active-field--result-loss::before {
    background: linear-gradient(
        165deg,
        rgba(70, 10, 10, 0.58) 0%,
        rgba(0, 0, 0, 0.42) 45%,
        rgba(0, 0, 0, 0.55) 68%,
        rgba(60, 8, 8, 0.75) 100%
    );
}

.match-box-footer-next {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    justify-content: flex-end;
}

.match-box-tickets {
    display: flex;
    justify-content: center;
}

.match-box-tickets .cwks-match-cta-btn.match-box-tickets-btn {
    width: 100%;
    max-width: 100%;
    height: 2rem;
    max-height: 2rem;
    font-size: 0.62rem;
    padding: 0 0.75rem;
}

/* Animacje wejścia drużyn */
@keyframes match-box-rise-in {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes match-box-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes countdown-digit-tick {
    0% {
        transform: scale(1);
        color: #fff;
    }
    45% {
        transform: scale(1.14);
        color: #ffcccc;
    }
    100% {
        transform: scale(1);
        color: #fff;
    }
}

.match-box-teams .match-box-team--1 {
    animation: match-box-rise-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

.match-box-teams .match-box-vs,
.match-box-teams .match-box-score {
    animation: match-box-rise-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.match-box-teams .match-box-team--2 {
    animation: match-box-rise-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.31s both;
}

.match-box-meta {
    animation: match-box-fade-in 0.5s ease 0.02s both;
}

.match-box-footer,
.match-box-footer-next {
    animation: match-box-fade-in 0.55s ease 0.38s both;
}

.match-box-countdown .countdown-number.is-ticking,
.active-ticket-field .countdown-number.is-ticking {
    animation: countdown-digit-tick 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
    .match-box-teams .match-box-team--1,
    .match-box-teams .match-box-team--2,
    .match-box-teams .match-box-vs,
    .match-box-teams .match-box-score,
    .match-box-meta,
    .match-box-footer,
    .match-box-footer-next,
    .match-box-countdown .countdown-number.is-ticking,
    .active-ticket-field .countdown-number.is-ticking {
        animation: none !important;
    }
}

.match-box-footer {
    grid-row: 3;
    height: var(--match-box-footer-height);
    min-height: var(--match-box-footer-height);
    max-height: var(--match-box-footer-height);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

.match-box-footer > .match-box-footer-next {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.35rem;
}

.match-box-footer > .match-box-buttons {
    width: 100%;
    align-self: flex-end;
    flex-shrink: 0;
}

.match-box-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
}

.match-box-button {
    font-family: "Saira Condensed", sans-serif;
    font-size: clamp(0.5rem, 0.85vw, 0.62rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    color: #e40001;
    background: #fff;
    border: 1px solid #fff;
    border-radius: 0;
    padding: 0 0.2rem;
    height: 1.45rem;
    line-height: 1.45rem;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

a.match-box-button:hover {
    background: #e40001;
    border-color: #e40001;
    color: #fff;
}

.match-box-button--inactive {
    background: rgba(0, 0, 0, 0.28);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(4px);
    opacity: 1;
    pointer-events: none;
    cursor: default;
}

.match-box-countdown,
.active-ticket-field .next-match-countdown {
    text-align: center;
    padding: 0;
}

.match-box-countdown .countdown-label,
.active-ticket-field .next-match-countdown .countdown-label {
    display: block;
    font-family: "Kumbh Sans", sans-serif;
    font-size: 0.56rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 0.25rem;
}

.match-box-countdown .countdown-time,
.active-ticket-field .next-match-countdown .countdown-time {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.match-box-countdown .countdown-unit,
.active-ticket-field .next-match-countdown .countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 3.35rem;
    width: 3.35rem;
    min-width: 3.35rem;
    max-width: 3.35rem;
    padding: 0.2rem 0.15rem 0.15rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}

.match-box-countdown .countdown-number,
.active-ticket-field .next-match-countdown .countdown-number {
    font-family: "Saira Condensed", sans-serif;
    font-size: clamp(1rem, 1.7vw, 1.25rem);
    font-weight: 700;
    line-height: 1;
    color: #fff;
    font-variant-numeric: tabular-nums;
    width: 2ch;
    text-align: center;
    display: inline-block;
}

.match-box-countdown .countdown-text,
.active-ticket-field .next-match-countdown .countdown-text {
    font-family: "Kumbh Sans", sans-serif;
    font-size: 0.48rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.2;
    margin-top: 0.1rem;
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: visible;
}

.match-box-empty {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    gap: 0.35rem;
}

.match-box-empty-text {
    font-family: "Kumbh Sans", sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (max-width: 1000px) {
    .active-ticket-field {
        gap: 1rem;
        padding: 0 1rem;
        margin-bottom: 1rem;
    }

    .active-ticket-field-col {
        flex: 0 0 100%;
        width: 100%;
    }

    .active-ticket-field .active-field {
        width: 100%;
        aspect-ratio: auto;
        min-height: 13.5rem;
        height: auto;
        padding: 0.55rem;
    }

    .match-box-panel {
        --match-box-logo-size: 50px;
        --match-box-footer-height: 4.75rem;
        grid-template-rows: auto minmax(0, 1fr) var(--match-box-footer-height);
        gap: 0.25rem;
    }

    .match-box-panel--previous {
        --match-box-footer-height: 2rem;
    }

    .match-box-meta {
        flex-wrap: nowrap;
        align-items: center;
        min-height: 0;
        padding: 0.2rem 0.35rem;
        gap: 0.4rem;
    }

    .match-box-meta-left {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
    }

    .match-box-meta-right {
        flex: 0 0 auto;
        align-items: flex-end;
        text-align: right;
        flex-direction: column;
        flex-wrap: nowrap;
    }

    .match-box-teams {
        gap: 0.25rem 0.4rem;
    }

    .match-box-button {
        font-size: 0.5rem;
        letter-spacing: 0.03em;
        height: 1.35rem;
        line-height: 1.35rem;
        padding: 0 0.1rem;
    }

    .match-box-countdown .countdown-unit,
    .active-ticket-field .next-match-countdown .countdown-unit {
        flex: 0 0 3.15rem;
        width: 3.15rem;
        min-width: 3.15rem;
        max-width: 3.15rem;
    }
}

@media (min-width: 1001px) {
    .active-ticket-field .active-field:hover .active-field-background img.background-image {
        transform: scale(1.06);
    }
}

@media (max-width: 640px) {
    .match-box-vs,
    .match-box-score {
        padding: 0.28rem 0.4rem;
    }
}

@media (max-width: 480px) {
    .match-box-team-name {
        font-size: 0.58rem;
        -webkit-line-clamp: 1;
    }

    .match-box-datetime {
        font-size: 0.65rem;
    }

    .match-box-buttons {
        gap: 0.25rem;
    }
}
