/* ═══════════════════════════════════════
   RESET & VARIABLES
═══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:       #111827;
    --surface:  #1c2535;
    --surface2: #243044;
    --border:   #2e3f5c;
    --gold:     #f0b72f;
    --gold-dim: rgba(240,183,47,.11);
    --text:     #dce6f5;
    --muted:    #8090b0;
    --r:        10px;
    --rs:       6px;
}

html { font-size: 16px; }
body {
    font-family: 'Barlow Condensed', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════
   HEADER
═══════════════════════════════════════ */
.header {
    background: linear-gradient(160deg, #0c1220 0%, #152035 60%, #0e1828 100%);
    border-bottom: 2px solid var(--gold);
    padding: 24px 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.header::before {
    content: '';
    position: absolute; inset: 0;
    background:
        repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(255,255,255,.016) 40px, rgba(255,255,255,.016) 41px),
        repeating-linear-gradient(0deg,  transparent, transparent 40px, rgba(255,255,255,.016) 40px, rgba(255,255,255,.016) 41px);
    pointer-events: none;
}
.header-inner { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; }

.trophy { font-size: 44px; display: block; margin-bottom: 6px; filter: drop-shadow(0 0 18px rgba(240,183,47,.55)); }
.title-main {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(1.5rem, 6vw, 2.4rem);
    font-weight: 700; color: var(--gold);
    letter-spacing: 3px; text-transform: uppercase; line-height: 1;
}
.title-sub {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(.7rem, 2.5vw, .9rem);
    font-weight: 300; color: var(--muted);
    letter-spacing: 4px; text-transform: uppercase; margin-top: 5px;
}
.t-info {
    display: flex; justify-content: center;
    gap: clamp(14px, 4vw, 36px); margin-top: 16px; flex-wrap: wrap;
}
.t-inf .lbl { font-size: .58rem; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; }
.t-inf .val { font-family: 'Oswald', sans-serif; font-size: 1.1rem; font-weight: 600; }
.cdown {
    background: var(--gold-dim);
    border: 1px solid rgba(240,183,47,.28);
    border-radius: var(--r);
    padding: 10px clamp(14px, 4vw, 22px);
    display: inline-flex; gap: clamp(12px, 4vw, 24px);
    margin-top: 16px;
}
.cd { text-align: center; }
.cd-n {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 700; color: var(--gold); line-height: 1;
}
.cd-l { font-size: .54rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; margin-top: 2px; }

/* ═══════════════════════════════════════
   STICKY SHELL (view nav + filters)
═══════════════════════════════════════ */
.sticky-shell {
    position: sticky; top: 0; z-index: 100;
    background: #0e1620;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,.45);
}

/* View nav */
.view-nav {
    display: flex; justify-content: center;
    border-bottom: 1px solid var(--border);
}
.vnav-btn {
    font-family: 'Oswald', sans-serif;
    font-size: .82rem; font-weight: 500;
    letter-spacing: 1.5px; text-transform: uppercase;
    padding: 11px 22px;
    border: none; background: none; color: var(--muted); cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .15s, border-color .15s;
}
.vnav-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.vnav-btn:hover:not(.active) { color: var(--text); }

/* Filters */
.filters {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.stage-tabs {
    display: flex; gap: 4px;
    overflow-x: auto; scrollbar-width: none;
    padding-bottom: 2px;
    justify-content: safe center;
    width: 100%;
}
.stage-tabs::-webkit-scrollbar { display: none; }
.stab {
    font-family: 'Oswald', sans-serif;
    font-size: .68rem; font-weight: 500;
    padding: 5px 12px;
    border-radius: var(--rs); border: 1px solid var(--border);
    background: transparent; color: var(--muted);
    cursor: pointer; white-space: nowrap;
    letter-spacing: .8px; text-transform: uppercase;
    transition: all .15s;
}
.stab:hover { border-color: var(--gold); color: var(--gold); }
.stab.active { background: var(--gold); border-color: var(--gold); color: #000; font-weight: 600; }

.frow {
    display: flex; flex-direction: column;
    align-items: center; gap: 8px; width: 100%;
}
@media (min-width: 600px) {
    .frow { flex-direction: row; flex-wrap: wrap; justify-content: center; }
}

.grp-btns { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.gbtn {
    font-family: 'Oswald', sans-serif;
    font-size: .64rem; font-weight: 600;
    width: 30px; height: 30px;
    border-radius: var(--rs); border: 1px solid var(--border);
    background: transparent; color: var(--muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .14s;
}
.gbtn:hover { border-color: #fff; color: #fff; }
.gbtn.act { border-color: transparent !important; color: #fff !important; }
.gbtn.act[data-g="all"] { background: var(--gold); color: #000 !important; }
.gbtn.act[data-g="A"]  { background: #d94f4f; }
.gbtn.act[data-g="B"]  { background: #3f7acc; }
.gbtn.act[data-g="C"]  { background: #1f9e4e; color: #000 !important; }
.gbtn.act[data-g="D"]  { background: #de711a; }
.gbtn.act[data-g="E"]  { background: #8848c6; }
.gbtn.act[data-g="F"]  { background: #c44078; }
.gbtn.act[data-g="G"]  { background: #049ab0; color: #000 !important; }
.gbtn.act[data-g="H"]  { background: #cca016; color: #000 !important; }
.gbtn.act[data-g="I"]  { background: #4e52c8; }
.gbtn.act[data-g="J"]  { background: #6ab010; color: #000 !important; }
.gbtn.act[data-g="K"]  { background: #0ea088; color: #000 !important; }
.gbtn.act[data-g="L"]  { background: #cc2c4a; }

.fsel, .finp {
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    padding: 7px 12px; border-radius: var(--rs);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: .9rem; outline: none; cursor: pointer;
    transition: border-color .14s;
    width: 100%;
}
@media (min-width: 600px) { .fsel { width: auto; } .finp { width: 210px; } }
.finp::placeholder { color: var(--muted); }
.fsel:focus, .finp:focus { border-color: var(--gold); }
.rcnt { font-size: .7rem; color: var(--muted); font-family: 'Oswald', sans-serif; }

/* ═══════════════════════════════════════
   BADGE COLORS
═══════════════════════════════════════ */
.bg-A  { background: #d94f4f; color: #fff; }
.bg-B  { background: #3f7acc; color: #fff; }
.bg-C  { background: #1f9e4e; color: #000; }
.bg-D  { background: #de711a; color: #fff; }
.bg-E  { background: #8848c6; color: #fff; }
.bg-F  { background: #c44078; color: #fff; }
.bg-G  { background: #049ab0; color: #000; }
.bg-H  { background: #cca016; color: #000; }
.bg-I  { background: #4e52c8; color: #fff; }
.bg-J  { background: #6ab010; color: #000; }
.bg-K  { background: #0ea088; color: #000; }
.bg-L  { background: #cc2c4a; color: #fff; }
.bg-KO { background: var(--gold); color: #000; }

/* ═══════════════════════════════════════
   MAIN — MATCHES VIEW
═══════════════════════════════════════ */
.main  { max-width: 1400px; margin: 0 auto; padding: 14px 14px 32px; }

.day-grp { margin-bottom: 22px; }
.day-hdr {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px; padding-bottom: 7px;
    border-bottom: 1px solid var(--border);
}
.day-d { font-family: 'Oswald', sans-serif; font-size: 1rem; font-weight: 600; color: var(--gold); }
.day-c { margin-left: auto; font-size: .63rem; color: var(--muted); background: var(--surface); padding: 2px 9px; border-radius: 20px; }

/* mobile-first grid */
.mgrid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 500px)  { .mgrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .mgrid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); } }

/* Match Card */
.mcard {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r); overflow: hidden; transition: all .18s;
}
.mcard:hover { border-color: rgba(240,183,47,.38); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.4); }
.mcard.is-final { border-color: var(--gold); box-shadow: 0 0 22px rgba(240,183,47,.15); }
.mcard.is-sf    { border-color: rgba(240,183,47,.3); }

.ctop {
    padding: 7px 12px;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(255,255,255,.022); border-bottom: 1px solid var(--border);
}
.badge {
    font-family: 'Oswald', sans-serif;
    font-size: .58rem; font-weight: 600;
    padding: 2px 8px; border-radius: 3px;
    letter-spacing: .8px; text-transform: uppercase;
}
.cmeta { font-size: .68rem; color: var(--muted); }

.cteams {
    padding: 14px 12px 10px;
    display: flex; align-items: center; justify-content: space-between; gap: 4px;
}
.team { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; min-width: 0; }
.tflag {
    font-size: 28px; line-height: 1;
    display: flex; justify-content: center; align-items: center;
}
.tflag .fi { display: block; }
.tname {
    font-family: 'Oswald', sans-serif;
    font-size: .78rem; font-weight: 500;
    text-align: center; line-height: 1.2; letter-spacing: .3px;
}
.vs { font-family: 'Oswald', sans-serif; font-size: .68rem; color: var(--muted); font-weight: 300; padding: 0 4px; }

.cbot {
    padding: 7px 12px;
    background: rgba(0,0,0,.18); border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
}
.ctime   { flex: 0 0 auto; display: flex; flex-direction: column; gap: 1px; }
.cstadm  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ilbl    { font-size: .5rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; }
.ival    { font-size: .76rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ival.tval { font-family: 'Oswald', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--gold); }
.ival.est  { font-family: 'Oswald', sans-serif; font-size: 1rem; font-weight: 600; color: #c8a030; }
.ival.tba  { color: var(--muted); font-style: italic; font-size: .7rem; }

/* Note */
.note {
    background: rgba(240,183,47,.07); border: 1px solid rgba(240,183,47,.2);
    border-radius: var(--rs); padding: 7px 12px; margin-bottom: 12px;
    font-size: .7rem; color: var(--muted);
}
.note strong { color: var(--gold); }

/* Empty */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-ico { font-size: 46px; margin-bottom: 12px; }

/* ═══════════════════════════════════════
   GROUPS VIEW
═══════════════════════════════════════ */
.gview { max-width: 1200px; margin: 0 auto; padding: 14px 14px 32px; }

.ggrid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
@media (min-width: 600px)  { .ggrid { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (min-width: 900px)  { .ggrid { grid-template-columns: repeat(4, 1fr); } }

.gcard {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r); overflow: hidden;
    cursor: pointer; transition: all .18s;
}
.gcard:hover { transform: translateY(-2px); box-shadow: 0 7px 22px rgba(0,0,0,.38); }

.gcard-head {
    padding: 10px 14px;
    display: flex; align-items: center; justify-content: flex-start; gap: 8px;
}
.gcard-letter {
    font-family: 'Oswald', sans-serif;
    font-size: 1.6rem; font-weight: 700; line-height: 1;
}
.gcard-teams { padding: 6px 14px 10px; }
.gteam {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 0; border-bottom: 1px solid var(--border);
    font-size: .88rem; font-weight: 500;
}
.gteam:last-child { border-bottom: none; }
.gteam-flag { font-size: 18px; flex-shrink: 0; }
.gcard-footer {
    padding: 7px 14px;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,.2);
    font-family: 'Oswald', sans-serif;
    font-size: .62rem; font-weight: 500;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--muted); text-align: center;
    transition: color .15s;
}
.gcard:hover .gcard-footer { color: var(--gold); }

/* ═══════════════════════════════════════
   YOL (BRACKET) VIEW
═══════════════════════════════════════ */
.yview { padding: 14px 0 32px; }

.y-scroll-hint {
    font-size: .7rem; color: var(--muted); text-align: center;
    padding: 0 14px 10px;
    font-family: 'Oswald', sans-serif; letter-spacing: 1px;
}

.b-wrap {
    overflow-x: auto;
    overflow-y: visible;
    padding: 0 14px 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.b-wrap::-webkit-scrollbar { height: 5px; }
.b-wrap::-webkit-scrollbar-track { background: transparent; }
.b-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.b-inner {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-width: min-content;
}

.b-col {
    display: flex;
    flex-direction: column;
    width: 182px;
    flex-shrink: 0;
}

.b-col-hdr {
    font-family: 'Oswald', sans-serif;
    font-size: .7rem; font-weight: 600;
    letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--gold);
    text-align: center;
    padding: 8px 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    background: rgba(240,183,47,.05);
    white-space: nowrap;
}

.b-col-matches {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-around;
    padding: 8px 6px;
    gap: 4px;
}

/* Connector between columns */
.b-conn {
    width: 28px; flex-shrink: 0;
    display: flex; flex-direction: column;
    align-items: center;
}
.b-conn-top {
    /* fills header height */
    height: 34px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    background: rgba(240,183,47,.05);
    width: 100%;
}
.b-conn-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 8px 0;
    gap: 4px;
}
.b-conn-line {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--border);
    font-size: 18px;
    flex: 1;
}

/* Match card inside bracket */
.b-match {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--rs);
    padding: 6px 8px;
    transition: border-color .15s;
    cursor: default;
}
.b-match:hover { border-color: rgba(240,183,47,.35); }
.b-match.bm-final {
    border-color: var(--gold);
    box-shadow: 0 0 14px rgba(240,183,47,.15);
}
.b-match.bm-sf { border-color: rgba(240,183,47,.35); }
.b-match.bm-qf { border-color: rgba(240,183,47,.2); }

.b-team {
    display: flex; align-items: center; gap: 5px;
    overflow: hidden;
    padding: 2px 0;
}
.bf { font-size: 14px; flex-shrink: 0; line-height: 1; }
.fi-placeholder { font-size: .65rem; color: var(--muted); }
.bn {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: .72rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: var(--text);
}
.b-sep {
    height: 1px; background: var(--border);
    margin: 2px 0;
}
.b-minfo {
    font-size: .56rem; color: var(--muted);
    margin-top: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Third place special */
.b-tp-wrap {
    padding: 20px 14px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.b-tp-hdr {
    font-family: 'Oswald', sans-serif;
    font-size: .72rem; font-weight: 600;
    letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--muted);
}
.b-tp-card {
    width: 182px;
}

/* ═══════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
