:root{
  --bg:#070A12;
  --bg2:#0B1020;
  --card:#0C1328;
  --text:#E9EEFF;
  --muted:#9AA6C3;
  --line:rgba(255,255,255,.08);
  --gold1:#F2D48A;
  --gold2:#B48A3A;
  --shadow:0 18px 60px rgba(0,0,0,.55);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  color:var(--text);
  background:radial-gradient(900px 520px at 25% -10%, rgba(242,212,138,.16), transparent 60%),
             radial-gradient(900px 520px at 85% 25%, rgba(80,120,255,.18), transparent 55%),
             linear-gradient(180deg, var(--bg), var(--bg2));
}
a{color:inherit; text-decoration:none}
.container{max-width:1150px; margin:0 auto; padding:0 20px}

.header{
  position:sticky; top:0; z-index:20;
  backdrop-filter: blur(10px);
  background:rgba(7,10,18,.6);
  border-bottom:1px solid var(--line);
}
.header__inner{display:flex; align-items:center; justify-content:space-between; padding:14px 0; gap:16px}
.brand{display:flex; align-items:center; gap:10px}
.brand__logo{width:34px; height:34px; border-radius:10px; object-fit:cover; box-shadow:0 8px 18px rgba(0,0,0,.35)}
.brand__name{font-weight:900}

.nav{display:flex; gap:10px; color:var(--muted); font-weight:700; font-size:13px; flex-wrap:wrap}
.nav a{padding:8px 10px; border-radius:12px}
.nav a:hover{background:rgba(255,255,255,.05); color:var(--text)}

.wallet{display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end}
.wallet__pill{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  font-weight:800;
  max-width:220px;
}
.wallet__addr{display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.hidden{display:none}

.banner{padding:14px 0; background:rgba(242,212,138,.08); border-bottom:1px solid rgba(242,212,138,.18)}
.banner__inner{display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap}
.banner__title{font-weight:900}
.banner__text{color:var(--muted); margin-top:2px}

.section{padding:34px 0}
.section--alt{background:linear-gradient(180deg, rgba(255,255,255,.02), transparent)}

h1{margin:0 0 8px; font-size:34px; letter-spacing:-.4px}
h2{margin:0 0 14px; font-size:24px}
.lead{margin:0; color:var(--muted); line-height:1.7}

.card{
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid var(--line);
  border-radius:18px;
  padding:18px;
  box-shadow:var(--shadow);
}
.card__title{font-weight:900; margin-bottom:10px}

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:12px 16px;
  border-radius:14px;
  font-weight:900;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(242,212,138,.95), rgba(180,138,58,.95));
  color:#1A1204;
  box-shadow:0 16px 40px rgba(180,138,58,.25);
}
.btn--ghost{background:rgba(255,255,255,.04); color:var(--text); box-shadow:none}
.btn:disabled{opacity:.55; cursor:not-allowed}

.grid2{display:grid; grid-template-columns:repeat(2, 1fr); gap:14px}
@media (max-width: 900px){.grid2{grid-template-columns:1fr}}

.countdown{display:grid; grid-template-columns: repeat(4, 1fr); gap:10px; margin:10px 0 8px}
.countdown__item{padding:12px; border-radius:16px; background:rgba(0,0,0,.22); border:1px solid rgba(255,255,255,.07)}
.countdown__num{font-size:24px; font-weight:900}
.countdown__lbl{font-size:12px; color:var(--muted); font-weight:800; margin-top:4px}

.join__row{display:grid; grid-template-columns:repeat(2, 1fr); gap:12px}
@media (max-width: 520px){.join__row{grid-template-columns:1fr}}
.mini-label{font-size:12px; color:var(--muted); font-weight:900; text-transform:uppercase; letter-spacing:.6px}
.mini-value{font-weight:900; margin-top:4px}

.divider{height:1px; background:var(--line); margin:16px 0}
.muted{color:var(--muted)}
.small{font-size:12px}
.mt{margin-top:14px}
.right{text-align:right}

.tabs{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px}
.tab{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--muted);
  font-weight:900;
  cursor:pointer;
}
.tab.active{background:rgba(242,212,138,.14); color:var(--text); border-color:rgba(242,212,138,.22)}

.matchlist{display:grid; gap:10px}
.match{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:12px;
  padding:14px;
  border-radius:18px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
}
.match__top{display:flex; gap:10px; flex-wrap:wrap; align-items:center}
.tag{padding:6px 10px; border-radius:999px; font-weight:900; font-size:12px; border:1px solid var(--line); background:rgba(0,0,0,.18); color:var(--muted)}
.tag--open{border-color:rgba(120,255,190,.25); background:rgba(120,255,190,.08); color:#B9FFE2}
.tag--locked{border-color:rgba(255,190,120,.25); background:rgba(255,190,120,.08); color:#FFE1B9}
.tag--tba{border-color:rgba(255,255,255,.12)}
.match__title{font-weight:900}
.match__meta{color:var(--muted); font-size:13px; margin-top:6px}

.pickbox{display:flex; flex-direction:column; gap:8px; min-width:240px}
.pickrow{display:flex; gap:8px}
.pickbtn{flex:1; padding:10px 10px; border-radius:12px; border:1px solid var(--line); background:rgba(0,0,0,.18); color:var(--text); font-weight:900; cursor:pointer}
.pickbtn.selected{border-color:rgba(242,212,138,.35); background:rgba(242,212,138,.14)}
.picksave{width:100%}

.groups{display:grid; grid-template-columns:repeat(4, 1fr); gap:12px}
@media (max-width: 1050px){.groups{grid-template-columns:repeat(2, 1fr)}}
@media (max-width: 600px){.groups{grid-template-columns:1fr}}
.group-card label{display:block; font-weight:900; margin:8px 0 6px}
.group-card input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.18);
  color:var(--text);
  font-weight:800;
}

.finals-grid{display:grid; grid-template-columns:repeat(2, 1fr); gap:12px}
@media (max-width: 600px){.finals-grid{grid-template-columns:1fr}}
.finals-grid label{display:block; font-weight:900}
.finals-grid input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.18);
  color:var(--text);
  font-weight:900;
  margin-top:6px;
}

.leaderboard__head{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap}
.table-wrap{overflow:auto; margin-top:10px}
.table{width:100%; border-collapse:collapse; min-width:520px}
.table th,.table td{padding:12px 10px; border-bottom:1px solid var(--line); font-weight:800}
.table th{color:var(--muted); text-transform:uppercase; letter-spacing:.6px; font-size:12px}

.footer{border-top:1px solid var(--line); padding:20px 0; background:rgba(0,0,0,.18)}
.footer__inner{display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap}
.footer__links{display:flex; gap:14px; color:var(--muted); font-weight:800}

.toast{position:fixed; left:50%; bottom:18px; transform:translateX(-50%);
  background:rgba(0,0,0,.85); border:1px solid var(--line); padding:10px 12px; border-radius:12px;
  color:var(--text); font-weight:800; box-shadow:var(--shadow); z-index:50}


/* Flag carousel (tiny + elegant) */
.flagbar{
  border-top:1px solid rgba(255,255,255,.06);
  border-bottom:1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.15);
}
.flagbar__track{
  display:flex;
  gap:10px;
  padding:10px 0;
  overflow:auto;
  scrollbar-width: none;
}
.flagbar__track::-webkit-scrollbar{ display:none; }
.flag{
  width:22px;
  height:16px;
  border-radius:4px;
  overflow:hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.10);
  flex: 0 0 auto;
}
.flag img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  filter:saturate(1.05);
}
.flag:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.14);
}

/* Best thirds selector */
.thirds{
  display:grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap:10px;
}
@media (max-width: 980px){
  .thirds{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 620px){
  .thirds{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.third{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  border-radius:12px;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.06);
}
.third__g{
  font-weight:700;
  letter-spacing:.02em;
}
.third__toggle{
  width:42px;
  height:24px;
  border-radius:999px;
  background: rgba(255,255,255,.10);
  position:relative;
  border:1px solid rgba(255,255,255,.12);
}
.third__toggle::after{
  content:'';
  position:absolute;
  top:50%;
  left:3px;
  width:18px;
  height:18px;
  border-radius:50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.65);
  transition: all .15s ease;
}
.third.is-on{
  border-color: rgba(255,215,130,.45);
  background: rgba(255,215,130,.08);
}
.third.is-on .third__toggle{
  background: rgba(255,215,130,.22);
  border-color: rgba(255,215,130,.35);
}
.third.is-on .third__toggle::after{
  left: calc(100% - 21px);
  background: rgba(255,215,130,.95);
}
.thirds__footer{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
}
