:root{
  --bg:#0b1020;
  --card:#111a33;
  --card2:#0f1730;
  --text:rgba(234,240,255,.92);
  --muted:rgba(234,240,255,.70);
  --stroke:rgba(255,255,255,.14);
  --accent:#6fb1ff;
  --good:#53d38b;
  --bad:#ff6b6b;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background:radial-gradient(1200px 650px at 50% -200px, rgba(111,177,255,.25), transparent 55%), var(--bg);
  color:var(--text);
}

.top{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:14px;
  padding:18px 18px 8px;
}
.title{font-weight:900;letter-spacing:.3px;font-size:22px}
.subtitle{color:var(--muted);font-size:13px;max-width:720px;margin-top:4px}
.controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.label{font-size:12px;color:var(--muted)}
.select,.btn{
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.04);
  color:var(--text);
  border-radius:10px;
  padding:9px 10px;
  font-size:12px;
}

select option{
  background:#0f1730;
  color:rgba(234,240,255,.92);
}
.btn{cursor:pointer}
.btn:hover{border-color:rgba(255,255,255,.24)}
.btn:active{transform:translateY(1px)}

.wrap{padding:0 18px 18px}
.card{
  border:1px solid var(--stroke);
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border-radius:16px;
  padding:14px;
}

.hud{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:10px}
.match{font-size:12px;color:rgba(234,240,255,.82);font-weight:900;margin-bottom:2px}
.status{font-size:13px;color:var(--muted)}
.score{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.pill{
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.18);
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  color:rgba(234,240,255,.86);
  font-weight:800;
}

canvas{
  display:block;
  width:100%;
  height:auto;
  border-radius:14px;
  background:linear-gradient(180deg, rgba(10,16,34,1), rgba(8,12,26,1));
}

.gameLayout{
  display:grid;
  grid-template-columns: minmax(520px, 1fr) 320px;
  gap:14px;
  align-items:start;
}

.teamsPanel{
  border:1px solid rgba(255,255,255,.14);
  border-radius:14px;
  background:rgba(0,0,0,.18);
  padding:12px;
  max-height:620px;
  overflow:auto;
}

.teamsTitle{
  font-weight:900;
  font-size:13px;
  margin-bottom:8px;
  color:rgba(234,240,255,.90);
}

.panelTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.panelTabs{
  display:flex;
  gap:8px;
}

.tabBtn{
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.04);
  color:rgba(234,240,255,.86);
  border-radius:999px;
  padding:6px 10px;
  font-size:11px;
  font-weight:900;
  cursor:pointer;
}

.tabBtn.active{
  border-color:rgba(111,177,255,.55);
  background:rgba(111,177,255,.16);
  color:rgba(234,240,255,.95);
}

.matchesList{display:flex;flex-direction:column;gap:8px}
.matchDay{font-size:11px;color:rgba(234,240,255,.60);font-weight:900;margin-top:4px}
.matchRow{border:1px solid rgba(255,255,255,.12);border-radius:12px;background:rgba(255,255,255,.03);padding:10px}
.matchRow.clickable{cursor:pointer}
.matchRow.clickable:hover{border-color:rgba(255,255,255,.24);background:rgba(255,255,255,.05)}
.matchMain{font-size:12px;font-weight:950;letter-spacing:.1px}
.matchMeta{font-size:11px;color:rgba(234,240,255,.66);margin-top:2px}

.groupsGrid{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
}

.group{
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  background:rgba(255,255,255,.03);
  padding:10px;
}

.groupHead{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  margin-bottom:8px;
}

.groupName{
  font-weight:950;
  font-size:12px;
  letter-spacing:.3px;
}

.groupMeta{
  font-size:11px;
  color:rgba(234,240,255,.60);
}

.teamList{display:flex;flex-direction:column;gap:6px}
.teamRow{display:flex;align-items:center;justify-content:space-between;gap:10px}
.teamLeft{display:flex;align-items:center;gap:8px;min-width:0}
.flag{width:20px;height:14px;display:flex;align-items:center;justify-content:center;font-size:14px}
.teamName{font-size:12px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.teamBtn{
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  color:rgba(234,240,255,.86);
  border-radius:10px;
  padding:6px 8px;
  font-size:11px;
  cursor:pointer;
}
.teamBtn:hover{border-color:rgba(255,255,255,.24)}
.teamBtn:disabled{opacity:.45;cursor:not-allowed}

@media (max-width: 980px){
  .gameLayout{grid-template-columns: 1fr}
  .teamsPanel{max-height:none}
}
