
:root{
  --bg1:#0b4f2e;
  --bg2:#083a22;
  --card:#0f6a3c;
  --card2:#0d5c35;
  --line:rgba(255,255,255,.15);
  --text:#f5fff7;
  --muted:rgba(245,255,247,.78);
  --gold:#d7b65a;
  --gold2:#b8942a;
  --black:#0b0b0b;
  --shadow: 0 8px 30px rgba(0,0,0,.22);
  --radius: 16px;
  --max: 1120px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(255,255,255,.06), transparent 60%),
    radial-gradient(700px 500px at 80% 30%, rgba(255,255,255,.04), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
}

.container{ max-width: var(--max); margin:0 auto; padding: 14px; }

.site-header{
  position: sticky; top:0; z-index:30;
  background: rgba(10,10,10,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.header-inner{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.brand{ display:flex; align-items:center; gap:10px; min-width: 220px; }
.brand-mark{
  width:38px; height:38px; border-radius: 12px;
  display:grid; place-items:center;
  background: linear-gradient(180deg, #111, #000);
  border:1px solid rgba(255,255,255,.16);
  color: var(--gold);
  font-weight: 900;
}
.brand-name{ font-weight: 900; }
.brand-sub{ font-size: 12px; color: rgba(255,255,255,.72); }

.top-nav{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:center; }
.navbtn,.navlink{
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 13px;
  cursor:pointer;
  text-decoration:none;
}
.navbtn:hover,.navlink:hover{ border-color: rgba(255,255,255,.28); }
.header-actions{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.flagbtn{
  width:36px; height:34px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  cursor:pointer;
  font-size: 18px;
}
.btn{
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 13px;
  cursor:pointer;
}
.btn:hover{ border-color: rgba(255,255,255,.28); }
.btn:active{ transform: translateY(1px); }
.btn-primary{
  background: linear-gradient(180deg, rgba(215,182,90,.25), rgba(215,182,90,.12));
  border-color: rgba(215,182,90,.55);
  font-weight: 800;
}
.btn-cta{
  background: linear-gradient(180deg, rgba(215,182,90,.95), rgba(184,148,42,.95));
  border-color: rgba(0,0,0,.25);
  color: #0b0b0b;
  font-weight: 900;
}

.hero{ padding: 10px 0 0; }
.hero h1{ margin: 10px 0 6px; font-size: 22px; }
.hero p{ margin:0; color: var(--muted); line-height:1.35; }
.statusbar{
  margin-top: 12px;
  display:flex; gap:10px; align-items:center; flex-wrap:wrap;
}
.pill{
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  border-radius:999px;
  padding: 8px 10px;
  font-size: 13px;
}
.pill-muted{ color: rgba(255,255,255,.75); }
.status-actions{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-left:auto; }
.note{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,.18);
  background: rgba(0,0,0,.14);
  color: rgba(255,255,255,.82);
  font-size: 13px;
}

.section{ margin-top: 18px; }
.section-head{ display:flex; align-items:end; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.section-head h2{ margin:0; font-size: 16px; }
.hint{ color: rgba(255,255,255,.72); font-size: 13px; }

/* carousel */
.carousel{
  margin-top: 10px;
  display:flex; gap: 12px;
  overflow:auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 10px;
}
.carousel::-webkit-scrollbar{ height: 10px; }
.carousel::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.22); border-radius: 999px; }
.group-card{
  flex: 0 0 330px;
  background: linear-gradient(180deg, rgba(15,106,60,.65), rgba(13,92,53,.65));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  scroll-snap-align: center;
}
.group-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom: 8px; }
.group-title{ font-weight: 900; letter-spacing: .2px; }
.cols{ display:grid; grid-template-columns: repeat(3, 30px); gap:8px; color: rgba(255,255,255,.75); font-size: 12px; text-align:center; }
.group-grid{ display:grid; grid-template-columns: 1fr auto; gap: 10px; }
.team-list{ display:flex; flex-direction:column; gap: 10px; }
.team-row{ display:flex; align-items:center; gap:10px; min-width:0; }
.flag{
  width:22px; height:16px; border-radius:4px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.16);
  object-fit:cover;
}
.team-name{ flex:1; min-width:0; display:flex; align-items:center; }
.team-text{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pick-grid{ display:grid; grid-template-columns: repeat(3, 30px); gap: 8px; align-content:start; }
.cell{
  width:30px; height:30px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.18);
  display:grid; place-items:center;
  cursor:pointer;
  user-select:none;
  font-size: 12px;
  font-weight: 900;
  color: var(--gold);
}
.cell.on{
  background: rgba(215,182,90,.22);
  border-color: rgba(215,182,90,.65);
  color: #111;
}

/* bracket */
.round-tabs{ display:flex; gap:8px; flex-wrap:wrap; margin-top: 10px; }
.rtab{
  border:1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.18);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  cursor:pointer;
}
.rtab.is-active{ background: rgba(215,182,90,.22); border-color: rgba(215,182,90,.65); color: #111; font-weight: 900; }

.bracket-wrap{
  margin-top: 10px;
  overflow:auto;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.14);
}
.bracket{
  display:grid;
  grid-template-columns: repeat(5, 280px);
  gap: 12px;
  padding: 12px;
  min-width: calc(5 * 280px + 4 * 12px + 24px);
}
.col{
  display:flex; flex-direction:column; gap: 10px;
}
.col-title{
  font-weight: 900;
  color: rgba(255,255,255,.88);
  display:flex; justify-content:space-between; align-items:center;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
}
.match{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(15,106,60,.55), rgba(13,92,53,.55));
  padding: 10px;
}
.match-id{ font-size: 12px; color: rgba(255,255,255,.72); font-weight: 800; margin-bottom: 6px; }
.slot{
  display:flex; gap:10px; align-items:center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.16);
  padding: 8px;
  cursor:pointer;
  margin-top: 8px;
}
.slot.disabled{ opacity:.45; cursor:not-allowed; }
.slot.win{ outline: 2px solid rgba(215,182,90,.7); }
.seed{ width: 72px; font-size: 12px; color: rgba(255,255,255,.75); font-variant-numeric: tabular-nums; }
.label{ font-size: 13px; }

/* share */
.share-row{ display:flex; gap:8px; flex-wrap:wrap; margin-top: 10px; }

/* footer */
.site-footer{
  margin: 20px 0 14px;
  padding: 12px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.16);
  display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap;
}
.footer-title{ font-weight: 900; }
.footer-sub{ font-size: 13px; color: rgba(255,255,255,.75); }
.footer-right{ display:flex; gap:10px; align-items:center; }
.social{ text-decoration:none; font-size: 18px; }

/* toast */
.toast{
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  background: rgba(0,0,0,.85);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
  max-width: min(720px, calc(100vw - 24px));
  text-align:center;
  z-index: 80;
}
.toast.show{ opacity: 1; }

/* modal */
.modal{ position: fixed; inset:0; display:none; z-index: 90; }
.modal.show{ display:block; }
.modal-backdrop{ position:absolute; inset:0; background: rgba(0,0,0,.55); }
.modal-card{
  position: relative;
  width: min(720px, calc(100vw - 24px));
  margin: 10vh auto 0;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(10,10,10,.96);
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  overflow:hidden;
}
.modal-head{ display:flex; justify-content:space-between; align-items:center; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.12); }
.modal-title{ font-weight: 900; }
.iconbtn{ border:1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color:#fff; border-radius: 10px; padding: 6px 8px; cursor:pointer; }
.modal-body{ padding: 14px; color: rgba(255,255,255,.88); line-height:1.4; }
.modal-foot{ padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.12); display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; }

@media (max-width: 420px){
  .group-card{ flex-basis: 86vw; }
  .top-nav{ display:none; }
  .brand-sub{ display:none; }
  .bracket{ grid-template-columns: repeat(5, 250px); min-width: calc(5 * 250px + 4 * 12px + 24px); }
}


.flag-emoji{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:22px;
  height:22px;
  font-size:18px;
  line-height:1;
}
.cell.on{
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.45);
  font-weight:700;
}
.celebrate{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
  backdrop-filter: blur(1px);
}
.celebrate.show{ display:flex; }
.celebrate .box{
  background: rgba(0,0,0,.75);
  color:#fff;
  padding:18px 22px;
  border-radius:16px;
  text-align:center;
  min-width:260px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.fireworks{
  position:absolute;
  inset:0;
  pointer-events:none;
  overflow:hidden;
}
.fireworks span{
  position:absolute;
  top:50%;
  left:50%;
  width:6px;
  height:6px;
  border-radius:50%;
  background:#fff;
  transform: translate(-50%,-50%);
  animation: pop 900ms ease-out forwards;
}
@keyframes pop{
  from{ opacity:1; transform:translate(-50%,-50%) scale(1); }
  to{ opacity:0; transform:translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.6); }
}


.flag-img{width:20px;height:14px;object-fit:cover;border-radius:3px;box-shadow:0 0 0 1px rgba(0,0,0,.25) inset;}
