[hidden]{display:none!important}

:root{
  --bg:#f6f7fb;
  --surface:#ffffff;
  --surface-soft:#f8fafc;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --brand:#5b4b8a;
  --brand-2:#7a65b5;
  --header:#111827;
  --live:#dc2626;
  --shadow:0 10px 30px rgba(17,24,39,.07);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:"Alexandria",system-ui,sans-serif;
  -webkit-font-smoothing:antialiased;
  padding-bottom:92px;
}
button,input{font:inherit}
button{cursor:pointer}
img{display:block;max-width:100%}

.app-header{
  background:var(--header);
  color:white;
  position:sticky;
  top:0;
  z-index:100;
  box-shadow:0 8px 24px rgba(17,24,39,.18);
}
.header-shell{
  max-width:1180px;
  margin:auto;
  min-height:104px;
  padding:16px 24px;
  display:grid;
  grid-template-columns:56px 1fr 56px;
  align-items:center;
  gap:16px;
}
.header-icon{
  width:48px;height:48px;border:0;border-radius:16px;
  display:grid;place-items:center;background:rgba(255,255,255,.06);color:white;
}
.header-icon svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.brand-lockup{display:flex;align-items:center;justify-content:center;gap:12px;text-align:right}
.brand-lockup strong{display:block;font-size:1.25rem}
.brand-lockup span{display:block;color:#aeb7c5;font-size:.72rem;margin-top:4px}
.football-logo{
  width:56px;height:56px;border-radius:18px;
  display:grid;place-items:center;background:#fff;color:var(--header)
}
.football-logo svg{width:42px;height:42px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linejoin:round}

.page-shell{max-width:1040px;margin:0 auto;padding:24px}

.date-navigation{
  margin-top:-2px;background:#fff;border:2px solid var(--brand);
  border-radius:28px;height:76px;display:grid;grid-template-columns:64px 1fr 64px;
  align-items:center;box-shadow:var(--shadow)
}
.date-arrow{border:0;background:transparent;font-size:2rem;color:#111827;height:100%}
.date-center{border:0;background:transparent;text-align:center}
.date-center small{display:block;color:var(--muted);font-size:.72rem}
.date-center strong{display:block;margin-top:4px;font-size:1.02rem}

.quick-toolbar{
  display:flex;justify-content:space-between;align-items:center;gap:12px;margin:18px 0
}
.date-picker-wrap,.primary-soft-btn{
  border:1px solid var(--line);background:#fff;border-radius:16px;
  padding:11px 14px;min-height:48px
}
.date-picker-wrap{display:flex;align-items:center;gap:10px;color:var(--muted)}
.date-picker-wrap input{border:0;outline:0;background:transparent;color:var(--text)}
.primary-soft-btn{color:var(--brand);font-weight:800}

.filters-panel{
  display:grid;grid-template-columns:1fr 320px;gap:14px;align-items:center;
  margin-bottom:18px
}
.filters-row{display:flex;gap:8px;overflow:auto;padding-bottom:2px}
.filter-pill{
  flex:0 0 auto;border:1px solid var(--line);background:#fff;
  border-radius:999px;padding:10px 14px;color:#4b5563;font-size:.82rem
}
.filter-pill.active{background:var(--header);border-color:var(--header);color:white}
.match-search,.sheet-search{
  display:flex;align-items:center;gap:9px;background:#fff;border:1px solid var(--line);
  border-radius:16px;padding:0 13px;min-height:48px
}
.match-search svg,.sheet-search svg{width:21px;height:21px;fill:none;stroke:#64748b;stroke-width:1.8}
.match-search input,.sheet-search input{
  width:100%;border:0;outline:0;background:transparent;color:var(--text)
}
.match-search button,.sheet-search button{border:0;background:transparent;font-size:1.35rem;color:#64748b}

.selected-teams-panel{
  background:#fff;border:1px solid var(--line);border-radius:20px;padding:17px;
  margin-bottom:22px
}
.panel-heading,.section-heading,.selected-box-head{
  display:flex;align-items:center;justify-content:space-between;gap:12px
}
.panel-heading small,.section-heading small,.selected-box-head small{color:#94a3b8;font-size:.7rem}
.panel-heading h2,.section-heading h1,.selected-box-head h3{margin:4px 0 0}
.panel-heading h2{font-size:1rem}
.section-heading h1{font-size:1.22rem}
.link-btn{border:0;background:transparent;color:var(--brand);font-weight:800}
.favorite-teams-strip{display:flex;gap:8px;overflow:auto;margin-top:13px;padding-bottom:2px}
.favorite-empty-inline{color:#94a3b8;font-size:.82rem;padding:4px}
.favorite-tag,.selected-team-tag{
  flex:0 0 auto;display:inline-flex;align-items:center;gap:8px;
  background:#f5f3ff;color:#4c3f78;border:1px solid #ddd6fe;
  border-radius:999px;padding:8px 10px;font-size:.78rem;font-weight:700
}
.favorite-tag button,.selected-team-tag button{border:0;background:transparent;color:inherit}

.matches-section{margin-top:8px}
.section-heading{margin-bottom:14px}
.count-badge{
  background:#fff;border:1px solid var(--line);border-radius:999px;
  padding:8px 12px;color:var(--muted);font-size:.75rem
}
.count-badge b{color:var(--text)}

.matches-grid{display:flex;flex-direction:column;gap:18px}
.competition-section{
  background:transparent;border-radius:22px
}
.competition-heading{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  margin-bottom:9px;padding:0 4px
}
.competition-title{display:flex;align-items:center;gap:10px}
.competition-mark{
  width:38px;height:38px;border-radius:12px;background:var(--header);color:#fff;
  display:grid;place-items:center
}
.competition-title h3{margin:0;font-size:.98rem}
.competition-title p{margin:4px 0 0;color:#94a3b8;font-size:.68rem}
.competition-count{color:#94a3b8;font-size:.72rem}
.competition-matches{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}

.match-card{
  background:#fff;border:1px solid #e6e7eb;border-radius:20px;
  padding:15px 16px 14px;box-shadow:0 3px 16px rgba(17,24,39,.035)
}
.match-meta{
  display:flex;justify-content:space-between;align-items:center;gap:12px;
  color:#525866;font-size:.72rem;margin-bottom:15px
}
.round-label{font-weight:800;color:#374151}
.match-date-time{display:flex;align-items:center;gap:8px}
.match-date-time i{display:block;width:1px;height:16px;background:#d1d5db}
.match-fixture{
  display:grid;grid-template-columns:1fr 96px 1fr;align-items:center;gap:8px;
  min-height:92px
}
.team-side{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0}
.team-side strong{
  font-size:.88rem;line-height:1.4;text-align:center;overflow:hidden;
  text-overflow:ellipsis
}
.crest-shell{
  width:52px;height:52px;border-radius:16px;background:#f8fafc;
  display:grid;place-items:center;flex:0 0 52px
}
.crest-shell img{width:40px;height:40px;object-fit:contain}
.match-middle{text-align:center;display:flex;flex-direction:column;align-items:center;gap:4px}
.kickoff-time,.scoreline{font-size:1.02rem;color:#111827}
.versus,.match-state{font-size:.72rem;color:#6b7280}
.match-state.is-live{color:var(--live);font-weight:800}
.match-actions{margin-top:13px;padding-top:12px;border-top:1px solid #eef0f3}
.favorite-action{
  width:100%;border:1px solid #d9dce2;background:#fff;border-radius:14px;
  min-height:40px;color:#4b5563;font-size:.78rem;font-weight:700
}
.favorite-action.active{border-color:#c4b5fd;background:#f5f3ff;color:#5b4b8a}

.state-card{
  min-height:180px;border:1px dashed #d7dce3;background:#fff;border-radius:20px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;gap:8px;color:#64748b
}
.state-card strong{color:#111827}
.state-card button{border:0;background:var(--header);color:#fff;border-radius:12px;padding:10px 14px}
.spinner{
  width:28px;height:28px;border:3px solid #e5e7eb;border-top-color:var(--brand);
  border-radius:50%;animation:spin .8s linear infinite
}
@keyframes spin{to{transform:rotate(360deg)}}

.sheet-overlay{
  position:fixed;inset:0;background:rgba(17,24,39,.45);z-index:2000;
  display:flex;justify-content:flex-end;backdrop-filter:blur(5px)
}
.team-sheet{
  width:min(660px,100%);height:100%;background:#fff;display:flex;flex-direction:column;
  box-shadow:-20px 0 60px rgba(17,24,39,.18)
}
.sheet-header{
  padding:22px 24px;border-bottom:1px solid var(--line);
  display:flex;align-items:flex-start;justify-content:space-between
}
.sheet-header small{color:#94a3b8}
.sheet-header h2{margin:5px 0 0}
.sheet-header button{
  width:42px;height:42px;border:1px solid var(--line);border-radius:14px;
  background:#fff;font-size:1.4rem
}
.sheet-body{padding:18px 24px;overflow:auto;flex:1}
.selected-box,.search-results-box{
  border:1px solid var(--line);background:#fbfcfe;border-radius:18px;
  padding:15px;margin-top:14px
}
.selected-box-head h3{font-size:.95rem}
.selected-box-head span{
  min-width:32px;height:32px;border-radius:999px;background:#eff6ff;color:#2563eb;
  display:grid;place-items:center;font-weight:800
}
.selected-teams-list{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.soft-note{color:#94a3b8;font-size:.82rem;padding:8px 2px}
.search-result-item{
  display:grid;grid-template-columns:48px 1fr auto;gap:11px;align-items:center;
  padding:10px 0;border-bottom:1px solid #eef0f3
}
.search-result-item:last-child{border-bottom:0}
.search-result-logo{
  width:44px;height:44px;border-radius:13px;background:#fff;display:grid;place-items:center
}
.search-result-logo img{width:34px;height:34px;object-fit:contain}
.search-result-main h5{margin:0;font-size:.86rem}
.search-result-main p{margin:4px 0 0;color:#94a3b8;font-size:.72rem}
.search-result-action{
  border:1px solid #d7dce3;background:#fff;border-radius:12px;padding:8px 10px;
  color:#4b5563
}
.search-result-action.selected{background:#f5f3ff;border-color:#c4b5fd;color:#5b4b8a}
.sheet-footer{
  border-top:1px solid var(--line);padding:14px 18px;
  display:grid;grid-template-columns:1fr 2fr;gap:10px
}
.ghost-btn,.save-btn{min-height:48px;border-radius:14px;font-weight:800}
.ghost-btn{border:1px solid var(--line);background:#fff;color:#64748b}
.save-btn{border:0;background:var(--header);color:#fff}

.mobile-nav{
  position:fixed;bottom:0;left:0;right:0;z-index:1500;
  height:76px;background:rgba(255,255,255,.96);border-top:1px solid var(--line);
  backdrop-filter:blur(14px);display:none;grid-template-columns:repeat(4,1fr);
  padding-bottom:max(8px,env(safe-area-inset-bottom))
}
.mobile-nav-item{
  border:0;background:transparent;color:#9ca3af;display:flex;
  flex-direction:column;align-items:center;justify-content:center;gap:4px;font-size:.7rem
}
.mobile-nav-item span{font-size:1.15rem}
.mobile-nav-item.active{color:var(--brand)}

@media(max-width:760px){
  body{padding-bottom:88px}
  .header-shell{min-height:88px;padding:12px 16px;grid-template-columns:48px 1fr 48px}
  .header-icon{width:44px;height:44px;border-radius:14px}
  .football-logo{width:50px;height:50px}
  .brand-lockup span{display:none}
  .brand-lockup strong{font-size:1rem}
  .page-shell{padding:14px 12px}
  .date-navigation{height:68px;border-radius:24px}
  .quick-toolbar{align-items:stretch}
  .date-picker-wrap{flex:1}
  .primary-soft-btn{flex:1;font-size:.76rem}
  .filters-panel{grid-template-columns:1fr}
  .match-search{order:-1}
  .selected-teams-panel{padding:14px}
  .competition-matches{grid-template-columns:1fr}
  .match-card{border-radius:18px;padding:14px}
  .match-fixture{grid-template-columns:1fr 74px 1fr}
  .team-side{flex-direction:column;gap:7px}
  .crest-shell{width:50px;height:50px}
  .team-side strong{font-size:.8rem}
  .mobile-nav{display:grid}
  .team-sheet{width:100%}
  .sheet-header{padding:18px}
  .sheet-body{padding:14px}
}


/* ===== v2 compact match-card safeguards ===== */
.matches-grid{width:100%}
.competition-section{width:100%}
.competition-matches{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-items:start!important;
}
.match-card{
  min-height:0!important;
  height:auto!important;
  overflow:hidden!important;
}
.match-fixture{
  min-height:88px!important;
  height:auto!important;
}
.team-side{
  min-width:0!important;
  max-width:100%!important;
}
.team-side strong{
  white-space:normal!important;
  word-break:break-word!important;
}
.crest-shell{
  overflow:hidden!important;
}
@media(max-width:760px){
  .competition-matches{
    grid-template-columns:1fr!important;
  }
}


/* ===== Calendar CTA + agreed football-ball logo ===== */
.brand-ball-logo{
  width:42px;
  height:42px;
  display:block;
  color:#fff;
  flex:0 0 auto;
}
.calendar-action-row{
  width:min(1180px,calc(100% - 28px));
  margin:14px auto 10px;
  display:flex;
  justify-content:flex-start;
}
.calendar-add-btn{
  display:inline-flex;
  align-items:center;
  gap:9px;
  min-height:42px;
  padding:0 16px;
  border-radius:999px;
  text-decoration:none;
  font-weight:800;
  font-size:.92rem;
  background:#202124;
  color:#fff;
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 8px 24px rgba(32,33,36,.12);
  transition:transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.calendar-add-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 26px rgba(32,33,36,.16);
}
.calendar-add-btn:active{
  transform:translateY(0);
}
.calendar-add-btn__icon{
  width:22px;
  height:22px;
  border-radius:7px;
  display:inline-grid;
  place-items:center;
  background:rgba(255,255,255,.12);
  font-size:1rem;
  line-height:1;
}
@media(max-width:760px){
  .brand-ball-logo{width:36px;height:36px}
  .calendar-action-row{
    width:min(100% - 20px,1180px);
    margin-top:10px;
  }
  .calendar-add-btn{
    width:100%;
    justify-content:center;
  }
}


/* ===== PWA / Push actions ===== */
.calendar-action-row{
  gap:10px;
  flex-wrap:wrap;
}
.calendar-add-btn.secondary-action{
  background:#fff;
  color:#202124;
  border:1px solid #dedede;
  box-shadow:none;
}
.calendar-add-btn.push-action{
  background:#6A5AE0;
  color:#fff;
}
.calendar-add-btn.push-action.is-enabled{
  background:#176B51;
}
.calendar-add-btn:disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none!important;
}
.pwa-toast{
  position:fixed;
  z-index:5000;
  left:50%;
  bottom:max(24px, env(safe-area-inset-bottom));
  transform:translateX(-50%);
  width:min(460px,calc(100% - 28px));
  box-sizing:border-box;
  padding:13px 16px;
  border-radius:16px;
  background:#202124;
  color:#fff;
  text-align:center;
  font-size:.88rem;
  font-weight:700;
  line-height:1.6;
  box-shadow:0 18px 50px rgba(0,0,0,.24);
}
.pwa-toast[data-type="success"]{background:#176B51}
.pwa-toast[data-type="error"]{background:#9F2D2D}
@media(max-width:760px){
  .calendar-action-row{
    display:grid;
    grid-template-columns:1fr;
  }
  .calendar-add-btn{
    width:100%;
  }
}
