*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}

body{
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  background:#eef1f5;
  color:#1e293b;
  min-height:100dvh;
  -webkit-font-smoothing:antialiased;
  zoom:1.1;
}

.header{
  position:sticky;
  top:0;
  z-index:100;
  background:rgba(238,241,245,.88);
  backdrop-filter:blur(24px);
  -webkit-backdrop-filter:blur(24px);
  border-bottom:1px solid rgba(0,0,0,.08);
  padding:14px 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.header h1{
  font-size:1.15rem;
  font-weight:800;
  background:linear-gradient(135deg,#4f6ef7,#0f9d6e);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  display:flex;
  align-items:center;
  gap:10px;
  letter-spacing:-.02em;
}
.header-icon{-webkit-text-fill-color:initial}

.header-left{display:flex;align-items:center;gap:14px;flex-shrink:0}

.controls{display:flex;align-items:center;gap:12px;flex:1;min-width:0}

.filter-group{display:flex;gap:6px;flex:1;min-width:0;flex-wrap:nowrap}

.filter-btn{
  padding:6px 14px;
  border-radius:8px;
  border:1px solid rgba(0,0,0,.08);
  background:#fff;
  color:#64748b;
  font-size:.8rem;
  font-weight:600;
  cursor:pointer;
  transition:all .2s;
  font-family:inherit;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  flex:1;
  white-space:nowrap;
}
.filter-btn:hover{background:#f6f8fb;color:#5e7088}
.filter-btn.active{color:#1e293b}
.filter-btn[data-mode="live"].active{background:rgba(15,157,110,.1);border-color:#0f9d6e;color:#0f9d6e}
.filter-btn[data-mode="finished"].active{background:rgba(212,163,115,.1);border-color:#d4a373;color:#d4a373}
.filter-btn[data-mode="upcoming"].active{background:rgba(201,122,10,.1);border-color:#c97a0a;color:#c97a0a}

.filter-btn .count{
  background:rgba(0,0,0,.05);
  padding:1px 8px;
  border-radius:5px;
  font-size:.7rem;
  font-weight:700;
  font-variant-numeric:tabular-nums;
}
.filter-btn.active .count{background:rgba(255,255,255,.6)}

.filter-dot{width:6px;height:6px;border-radius:50%;display:inline-block;flex-shrink:0;background:#cbd5e1}
.filter-btn[data-mode="live"] .filter-dot{background:#0f9d6e}
.filter-btn[data-mode="finished"] .filter-dot{background:#d4a373}
.filter-btn[data-mode="upcoming"] .filter-dot{background:#c97a0a}
.filter-btn.active .filter-dot{background:currentColor}

.country-filters{display:flex;gap:4px;flex-wrap:wrap}

.country-btn{
  padding:5px 12px;
  border-radius:8px;
  border:1px solid rgba(0,0,0,.08);
  background:#fff;
  color:#64748b;
  font-size:.75rem;
  font-weight:600;
  cursor:pointer;
  transition:all .2s;
  font-family:inherit;
  display:flex;
  align-items:center;
  gap:5px;
}
.country-btn:hover{background:#f6f8fb;color:#5e7088}
.country-btn.active{background:rgba(79,110,247,.1);border-color:#4f6ef7;color:#4f6ef7}
.country-btn .flag-img{width:14px;height:auto;border-radius:1px}

.status-bar{
  font-size:.76rem;
  color:#3262ad;
  display:flex;
  align-items:center;
  gap:8px;
}

.status-dot{
  width:6px;
  height:6px;
  border-radius:50%;
  background:#0f9d6e;
  animation:pulse 2s infinite;
}

@keyframes pulse{0%,100%{opacity:1}50%{opacity:.25}}

.container{
  max-width:900px;
  margin:0 auto;
  padding:16px 12px 40px;
}

.section-header{
  display:flex;
  align-items:center;
  gap:8px;
  padding:16px 4px 8px;
  border-bottom:1px solid #dce0e8;
  margin-bottom:0;
}

.section-header .flag{font-size:1.1rem;display:inline-flex;align-items:center}
.section-header .flag img{width:18px;height:auto;border-radius:2px}
.section-header .name{font-size:.82rem;font-weight:700;color:#1e293b;text-transform:uppercase;letter-spacing:.03em}
.section-header .count{margin-left:auto;font-size:.7rem;color:#94a3b8;font-weight:600}

.match-row{
  background:#fff;
  border-bottom:1px solid #e8ecf1;
  margin-bottom:4px;
  border-radius:6px;
  transition:background .15s;
}
.match-row:hover{background:#f8fafc}
.match-row.live{background:#fafdff}

.match-row .match-main{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  padding:12px 16px;
  gap:12px;
  cursor:pointer;
  user-select:none;
}

.match-row .team{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1;
  min-width:0;
}

.match-row .team.away{flex-direction:row-reverse}

.match-row .team-logo{
  width:28px;
  height:28px;
  border-radius:50%;
  background:#f1f5f9;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:.7rem;
  font-weight:800;
  color:#4f6ef7;
  flex-shrink:0;
  overflow:hidden;
}
.match-row .team-logo img{width:100%;height:100%;object-fit:contain}

.match-row .team-name{
  font-size:.95rem;
  font-weight:500;
  color:#5076b4;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.match-row .score-col{
  display:flex;
  flex-direction:column;
  align-items:center;
  flex-shrink:0;
  min-width:60px;
}
.match-row .score-col .score{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:0;
}

.match-row .score{
  font-size:1.5rem;
  font-weight:600;
  color:#416f9d;
  font-variant-numeric:tabular-nums;
  letter-spacing:-.02em;
  transition:color .3s;
}
.match-row .score-home,.match-row .score-away{min-width:3ch;text-align:center}
.match-row .score-dash{color:#94a3b8;margin:0 2px;font-weight:600;font-size:1.2rem;line-height:1}
.match-row .score-hourglass{width:24px;height:24px;display:block}
.match-row .score.highlight-home{color:#0f9d6e}
.match-row .score.highlight-away{color:#0f9d6e}

.match-row .match-status{
  font-size:.6rem;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:#94a3b8;
  margin-top:2px;
  display:block;
}
.match-row .status-live{color:#0f9d6e}
.match-row .status-finished{color:#94a3b8}
.match-row .status-scheduled{color:#4f6ef7}

.match-row .match-league{
  font-size:.7rem;
  font-weight:700;
  color:#9a6a18;
  text-align:center;
  width:100%;
  letter-spacing:.02em;
}
.match-row .match-date{
  font-size:.66rem;
  color:#94a3b8;
  text-align:center;
  width:100%;
  font-weight:500;
  letter-spacing:.02em;
  margin-top:-1px;
}

.match-row .live-dot{
  width:6px;
  height:6px;
  border-radius:50%;
  background:#0f9d6e;
  display:inline-block;
  margin-right:3px;
  animation:livePulse 1.5s infinite;
  vertical-align:middle;
}
@keyframes livePulse{0%,100%{opacity:1}50%{opacity:.3}}

.expand-area{overflow:hidden;max-height:0;transition:max-height .35s ease}
.expand-area.open{max-height:2000px}

.expand-body{padding:6px 16px 14px;background:#f8fafc;border-bottom:1px solid rgba(0,0,0,.06);margin-bottom:8px}

.events-section-title{
  font-size:.68rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:#94a3b8;
  margin-bottom:6px;
}

.event-item{
  display:flex;
  align-items:center;
  gap:6px;
  padding:3px 0;
  font-size:.76rem;
  color:#475569;
  border-bottom:1px solid #f1f5f9;
}
.event-item:last-child{border-bottom:none}
.event-icon{width:18px;text-align:center;font-size:.82rem;flex-shrink:0}
.event-minute{font-weight:700;color:#4f6ef7;min-width:24px;font-variant-numeric:tabular-nums;font-size:.7rem}
.event-desc{color:#475569}
.event-desc .assist{color:#94a3b8;font-size:.66rem}

.stat-row{margin-bottom:8px}
.stat-label{display:flex;justify-content:space-between;font-size:.66rem;color:#94a3b8;font-weight:500;margin-bottom:2px;text-transform:uppercase;letter-spacing:.02em}
.stat-bar-bg{height:4px;border-radius:2px;background:#e2e8f0;display:flex;overflow:hidden}
.stat-bar-home,.stat-bar-away{height:100%;transition:width .4s ease;border-radius:2px}
.stat-bar-home{background:#4f6ef7;margin-right:1px}
.stat-bar-away{background:#0f9d6e;margin-left:1px}
.stat-bar-bg .stat-bar-home:only-child,.stat-bar-bg .stat-bar-away:only-child{border-radius:2px;margin:0}

.error-banner{
  background:#fef2f2;
  border:1px solid #fecaca;
  border-radius:8px;
  padding:10px 14px;
  margin-bottom:12px;
  font-size:.8rem;
  color:#dc2626;
  display:none;
}

.loading{
  text-align:center;
  padding:60px 20px;
  color:#94a3b8;
}
.loading .spinner{
  width:28px;
  height:28px;
  border:2px solid #e2e8f0;
  border-top-color:#4f6ef7;
  border-radius:50%;
  animation:spin .8s linear infinite;
  margin:0 auto 12px;
}
@keyframes spin{to{transform:rotate(360deg)}}

.empty{text-align:center;padding:60px 20px;color:#94a3b8}
.empty .icon{font-size:2.6rem;margin-bottom:10px;opacity:.3}

@media(max-width:680px){
  body{zoom:1}
  .header{padding:8px 10px 12px;gap:6px;justify-content:center;flex-wrap:wrap}
  .header h1{font-size:.95rem;gap:6px}
  .header-icon{font-size:1rem}
  .header-left{gap:6px;justify-content:center;width:100%}
  .controls{gap:6px;flex-wrap:wrap}
  .country-filters{display:flex;gap:3px;flex-wrap:wrap;justify-content:center}
  .country-btn{padding:3px 8px;font-size:.7rem;gap:3px}
  .filter-group{gap:3px}
  .filter-btn{padding:4px 8px;font-size:.72rem;gap:4px;flex:1;white-space:nowrap}
  .filter-btn .count{padding:0 5px;font-size:.65rem}
  .filter-dot{width:5px;height:5px}
  .status-bar{font-size:.7rem;gap:5px;width:100%;justify-content:center}
  .status-dot{width:5px;height:5px}
  .container{padding:10px 6px 32px}
  .match-row .match-main{padding:8px 8px;gap:6px}
  .match-row .team{gap:6px}
  .match-row .team-name{font-size:.85rem;white-space:normal;word-break:break-word}
  .match-row .team.away .team-name{text-align:right}
  .match-row .team-logo{width:24px;height:24px;font-size:.6rem}
  .match-row .score{font-size:1.15rem}
  .match-row .score-col{min-width:40px}
  .match-row .score-home,.match-row .score-away{min-width:1.8ch}
  .match-row .score-dash{font-size:1rem}
  .match-row .match-status{font-size:.55rem}
  .match-row .match-league{font-size:.65rem}
  .match-row .match-date{font-size:.58rem}
  .section-header{padding:10px 4px 6px;gap:4px}
  .section-header .name{font-size:.72rem}
  .section-header .flag{font-size:.9rem}
  .section-header .count{font-size:.6rem}
  .expand-area .stats-body{padding:8px 10px}
  .expand-area .event-item{font-size:.7rem;padding:2px 0}
  .expand-area .event-minute{min-width:20px;font-size:.65rem}
  .loading{padding:40px 10px}
  .empty{padding:40px 10px}
}
