/* Tournament Info block (blocks/tournament-info) - "Tournament Dates"
   milestone timeline + "Prize Table" ranked payout list, sharing one
   section-level background image. */

.tournament-info {
    position: relative;
    padding: 3rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}
/* The background image lives on a ::before behind the content (z-index:-1,
   contained by .tournament-info's own position:relative) rather than
   directly on .tournament-info, so the vertical fade mask only affects the
   decorative image - it doesn't fade the actual card/text content sitting
   on top of it. */
.tournament-info::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: var(--tournament-info-bg-desktop);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 80%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 80%, transparent 100%);
    width:100%;
    height:100%;
}
@media (max-width: 576px) {
    .tournament-info::before {
        background-image: var(--tournament-info-bg-mobile, var(--tournament-info-bg-desktop));
    }
}

/* Tournament Dates card - bordered container wrapping the heading + the
   milestone timeline. max-width:100% + margin-inline:auto keep the fixed
   1079px design width from overflowing on narrower viewports. */
.tournament-info-dates {
    border-radius: 12px;
    border: 1px solid var(--GOLD-FINAL, #E2C562);
    background: #0F1115;
    display: flex;
    width: 1079px;
    max-width: 100%;
    margin-inline: auto;
    padding: 20px 20px 40px 20px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    position: relative;
    z-index:1;
}

/* ---------------------------------------------------------------------
   Shared heading (used above both the Tournament Dates timeline and the
   Prize Table) - same gradient-line treatment as blocks/how-to-qualify,
   duplicated here (each block owns its own CSS, nothing is shared).
   Scoped as ".tournament-info .tournament-info-title" (not just
   ".tournament-info-title") so this reliably beats the theme's
   ".post-content h2, .post-content h3" rule in style.css / responsive.css.
--------------------------------------------------------------------- */
.tournament-info-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}
.tournament-info-heading-line {
    display: block;
    flex: 0 0 auto;
    inline-size: 100px;
    /* 2px, not a literal 1px - a true 1px decorative gradient line inside a
       flex layout rounds to a sub-pixel width and disappears at several
       viewport widths (confirmed empirically in blocks/how-to-qualify). */
    block-size: 2px;
    background: linear-gradient(to right, rgba(124, 108, 54, 0) 0%, rgba(215, 188, 93, .894224) 90.865%, #F5DF94 100%);
}
.tournament-info-heading-line:last-child {
    background: linear-gradient(to left, rgba(124, 108, 54, 0) 0%, rgba(215, 188, 93, .894224) 90.865%, #F5DF94 100%);
}
.tournament-info .tournament-info-title {
    flex: 0 0 auto;
    margin: 0;
    color: #EAECF0;
    font-weight: 700;
    font-size: 30px;
    text-transform: uppercase;
    letter-spacing: .02em;
    text-align: center;
}

/* ---------------------------------------------------------------------
   Tournament Dates - horizontal milestone timeline
--------------------------------------------------------------------- */
/* Dotted connector line running through the middle of the badges -
   images/hr-line.svg, referenced directly via a relative url() since it's a
   fixed theme asset (unlike the section's own background image, which is
   user-uploaded and has to come from PHP) - drawn as a background-image on
   the row itself rather than a separate element, so it naturally sits
   behind the badges without needing its own z-index/positioning context.
   Kept at its own native size (879x5, the asset's own viewBox) via an exact
   background-size rather than resized to fill the row - only its horizontal
   position is dynamic, via --tournament-info-milestone-count (set inline
   per-block in tournament-info.php) so it still lines up with the first
   badge's center regardless of how many milestones there are. */
.tournament-info-milestones {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
    max-width: 1160px;
    /* .tournament-info-dates (the new bordered card) is a column flexbox
       with align-items:center, which would otherwise shrink this row to fit
       its content instead of the full card width - align-self:stretch keeps
       it filling the available width so justify-content:space-between still
       spreads the milestones out correctly. */
    align-self: stretch;
    margin-inline: auto;
    background-image: url('../../images/hr-line.svg');
    background-repeat: no-repeat;
    background-position: calc(50% / var(--tournament-info-milestone-count, 5)) 21.5px;
}
.tournament-info-milestones:before {
    background:#0F1115;
    position:absolute;
    content:"";
    top:0;
    left:0;
    width:10%;
    height:100%;
}
.tournament-info-milestones:after {
    background:#0F1115;
    position:absolute;
    content:"";
    top:0;
    right:0;
    width:10%;
    height:100%;
}

.tournament-info-milestone {
    position: relative;
    z-index: 1;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .5rem;
    padding-inline: .25rem;
}
.tournament-info-milestone-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    inline-size: 48px;
    block-size: 48px;
    border-radius: 50%;
    background: #0B0B0C;
    border: 2px solid #E2C562;
}
.tournament-info-milestone-icon {
    display: block;
    inline-size: 40px;
    block-size: 40px;
    object-fit: contain;
}
/* Wraps the title + date/time block so they can sit flush against each
   other (gap:0) while .tournament-info-milestone's own gap still keeps its
   wider spacing between the badge and this text block. */
.tournament-info-milestone-text {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.tournament-info .tournament-info-milestone-title {
    margin: 0;
    color: #E2C562;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    line-height: normal;
}
/* Wraps the date + time lines so they can sit closer together than the
   badge/title/datetime spacing above them (see .tournament-info-milestone's
   own gap for that wider spacing). */
.tournament-info-milestone-datetime {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.tournament-info .tournament-info-milestone-date,
.tournament-info .tournament-info-milestone-time {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
}

/* ---------------------------------------------------------------------
   Prize Table - RANK / PRIZE list, ranks 1-3 highlighted with the
   theme-shipped gold/silver/bronze icons and a progressively lighter gold
   row background.
--------------------------------------------------------------------- */
/* Unlike the Tournament Dates heading, the Prize Table title has no
   flanking .tournament-info-heading-line elements (removed in
   tournament-info.php) - just a gradient-filled title text via
   background-clip, overriding the shared .tournament-info-title's solid
   color for this heading only. */
.tournament-info-prizes {
    position: relative;
    z-index:1;
}

.tournament-info-prizes .tournament-info-title {
    background: var(--Linear, linear-gradient(180deg, #F7DE7C 12.81%, #FFF3A5 49.05%, #B27F2B 82.19%));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.tournament-info-prize-table {
    max-width: 800px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    /* border: 1px solid #E2C562; */
    gap:1.1px;
    background: var(--Linear, linear-gradient(180deg, #F7DE7C 12.81%, #FFF3A5 49.05%, #B27F2B 82.19%));
    padding:1.1px;

}
.tournament-info-prize-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: #0F1115;
}
.tournament-info-prize-row:last-child {
    border-block-end: none;
}
.tournament-info-prize-row-header {
    /* No longer nested inside .tournament-info-prize-table (which owns the
       bordered/rounded card), so it needs its own matching width/centering
       to line up with the table below it. */
    max-width: 800px;
    margin-inline: auto;
    background: #0B0B0C;
}
.tournament-info .tournament-info-prize-row-header .tournament-info-prize-rank,
.tournament-info .tournament-info-prize-row-header .tournament-info-prize-value {
    color: #E2C562;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.tournament-info-prize-row-rank-1 { 
    background: #584812;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}
.tournament-info-prize-row-rank-2 { background: #4B4325;}
.tournament-info-prize-row-rank-3 { background: #211F17;}

.tournament-info-prize-row:last-child {
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
}

.tournament-info-prize-row-rank-1 span,
.tournament-info-prize-row-rank-2 span,
.tournament-info-prize-row-rank-3 span { 
    color:#E2C562!important;
}
.tournament-info .tournament-info-prize-rank {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.tournament-info .tournament-info-prize-value {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}
.tournament-info-prize-icon {
    display: block;
    flex: 0 0 auto;
    inline-size: 28px;
    block-size: 28px;
    object-fit: contain;
}

/* Tablet/mobile: stack milestones in a single column instead of a row.
   Each individual milestone also switches from a centered column (badge on
   top, text below) to a left-aligned row (badge on the left, text to its
   right) per the reference design. The horizontal hr-line.svg connector
   doesn't make sense once stacked, so it's swapped for images/v-line.svg (a
   vertical dashed line, same style) running down through the badges
   instead - kept at its own native size (5x327, its own viewBox) same as
   hr-line.svg on desktop, positioned to start at the first badge's center. */
@media (max-width: 900px) {
    .tournament-info-milestones {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .tournament-info-milestones {
        background-image: url('../../images/v-line.svg');
        background-position: 24px 24px;
    }
    .tournament-info-milestones:before {
        top: 0;
        left: 0;
        width: 100%;
        height: 10%;
    }    
    .tournament-info-milestones:after {
        top:auto;
        bottom: 0;
        left: 0;
        right:auto;
        width: 100%;
        height: 10%;
    }   

    .tournament-info-milestone-text {
        text-align: center;
        flex:1;
    }

    .tournament-info-milestone {
        flex: 0 0 auto;
        width: 100%;
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 1rem;
    }
}

/* Mobile (matches the theme's established ≤576px breakpoint) */
@media (max-width: 576px) {
    .tournament-info-dates {
        gap:20px;
        padding: 20px;        
    }
    .tournament-info {
        padding: 2rem 1rem;
        gap: 2.5rem;
    }
    .tournament-info-heading {
        gap: .75rem;
    }
    .tournament-info-heading-line {
        inline-size: 50px;
    }
    .tournament-info .tournament-info-title {
        font-size: 20px;
    }
    .tournament-info-milestone {
        flex: 0 0 100%;
    }
    .tournament-info-milestone-icon {
        inline-size: 32px;
        block-size: 32px;
    }
    .tournament-info .tournament-info-milestone-title {
        font-size: 16px;
    }
    .tournament-info .tournament-info-milestone-date,
    .tournament-info .tournament-info-milestone-time {
        font-size: 14px;
    }
    .tournament-info-prize-row {
        padding: 12px 16px;
    }
    .tournament-info .tournament-info-prize-rank,
    .tournament-info .tournament-info-prize-value {
        font-size: 16px;
    }
}
