/* ========================================================================
   AFW BASE — global safety / shared UI
   ======================================================================== */

/* ========================================================================
   0) GLOBAL SAFETY / WIDTH FIXES
   ======================================================================== */

.afw-wrap,
.afw-wrap *{
  box-sizing:border-box;
}

.afw-wrap{
  width:100%;
  max-width:100%;
  min-width:0;
}

.afw-matchesLayout,
.afw-matchesLayout__main,
.afw-matchesSidebar,
.afw-dates,
.afw-dates__top,
.afw-dates__row,
.afw-dates__list,
.afw-tabs,
.afw-league,
.afw-league__header,
.afw-league__left,
.afw-league__title,
.afw-h2h-list,
.afw-h2h-card,
.afw-h2h-card__row,
.afw-h2h-team,
.afw-h2h-team__text,
.afw-match,
.afw-match__row,
.afw-teams,
.afw-team,
.afw-team__text{
  min-width:0;
  max-width:100%;
}

.afw-wrap img{
  max-width:100%;
  height:auto;
}

@media (max-width:1024px){
  .afw-wrap{
    overflow-x:hidden;
  }
}

/* ========================================================================
   GLOBAL / SHARED — PAGE HEADER
   ======================================================================== */

.afw-page-head{
  display:flex;
  align-items:center;
  gap:14px;
  margin:0 0 8px 0;
  min-width:0;
  max-width:100%;
}

.afw-page-head--country{
  padding-top:1.5rem;
}

.afw-page-head__media{
  display:flex;
  align-items:center;
  flex:0 0 auto;
  min-width:0;
}

.afw-page-head__media picture{
  display:block;
  flex:0 0 auto;
}

.afw-page-head__body{
  display:flex;
  align-items:center;
  min-width:0;
  max-width:100%;
}

.afw-page-head .afw-page-title{
  margin:0;
}

.afw-page-head__flag{
  display:block;
  flex:0 0 auto;
  max-width:30px;
  max-height:20px;
  object-fit:contain;
}

.afw-page-title{
  color:var(--color-content-heading);
  font-size:21px;
  line-height:1.2;
  font-family:var(--h1-font-family);
  font-weight:600 !important;
  margin:0 0 8px 0;
  max-width:100%;
  overflow-wrap:anywhere;
}

.afw-page-subtitle{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  font-family:var(--h5-font-family);
  font-size:18px;
  line-height:var(--h5-line-height);
  font-weight:500;
  color:rgba(255,255,255,.50);
  margin:0 0 18px 0;
  min-width:0;
  max-width:100%;
}

.afw-page-subtitle h2{
  display:inline-flex !important;
  align-items:center;
  margin:0 !important;
  padding:0 !important;
  font:inherit !important;
  color:inherit !important;
  line-height:inherit !important;
  flex:0 0 auto;
}

.afw-dot{
  display:inline-block;
  width:4px;
  height:4px;
  border-radius:50%;
  background: #999c9f;
  flex:0 0 auto;
}

.afw-meta-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:12px 0 18px;
  min-width:0;
}

.afw-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-family:var(--h5-font-family, var(--h1-font-family));
  font-size:16px;
  line-height:var(--h5-line-height, 1.2);
  font-weight:500;
  color:var(--color-content-heading);
  background:none;
  border:0;
  padding:0;
  box-shadow:none;
  min-width:0;
  max-width:100%;
}

.afw-pill strong{
  font-weight:600;
  font-size: 12px;
  color:var(--color-content-heading);
}

.afw-empty-text{
  margin-top:16px;
}

.afw-empty-text--compact{
  margin-top:12px;
}

.afw-empty-note{
  opacity:.7;
}

.afw-stackTop{
  margin-top:16px;
}

.afw-stackTop--sm{
  margin-top:10px;
}

.afw-stackTop--md{
  margin-top:12px;
}

.afw-debugBox{
  margin-top:12px;
  padding:10px;
  border:1px dashed rgba(0,0,0,.2);
  border-radius:8px;
}

.afw-debugBox__title{
  font-weight:700;
  margin-bottom:6px;
}

.afw-debugBox__body{
  margin:0;
  white-space:pre-wrap;
  font-size:12px;
  line-height:1.35;
  opacity:.85;
}

/* ========================================================================
   GLOBAL / SHARED — TABS
   ======================================================================== */

.afw-tabs{
  display:flex;
  align-items:center;
  gap:5px;
  flex-wrap:wrap;
  min-width:0;
  max-width:100%;
}

.afw-tabs > a{
  margin:0 !important;
  max-width:100%;
}

.afw-tab-text{
  display:inline-block;
  white-space:normal;
  text-align:center;
}

/* ========================================================================
   GLOBAL / SHARED — DATES STRIP
   ======================================================================== */

.afw-dates{
  width:100%;
  max-width:100%;
  min-width:0;
}

.afw-dates__top{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  font-family:var(--h5-font-family);
  font-size:14px;
  line-height:var(--h5-line-height);
  font-weight:500;
  margin:10px 0 5px 0;
  color:rgba(255,255,255,.50);
  width:100%;
}

.afw-dates__month{
  min-width:0;
}

.afw-dates__month strong{
  color:var(--color-content-heading);
  font-weight:600;
}

.afw-dates__right{
  min-width:0;
}

.afw-dates__right .afw-link{
  padding:0;
  border:0;
  background:transparent;
  color:var(--color-content-primary);
  font:inherit;
  text-decoration:none;
  white-space:normal;
}

.no-touch .afw-dates__right .afw-link:hover{
  text-decoration:underline;
}

.afw-dates__row{
  display:flex;
  align-items:stretch;
  gap:5px;
  width:100%;
  max-width:100%;
  min-width:0;
}

.afw-dates__nav{
  flex:0 0 auto;
  display:flex;
  align-items:stretch;
  min-width:44px;
}

.afw-dates__list{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  align-items:stretch;
  gap:5px;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  white-space:nowrap;
  scroll-snap-type:x mandatory;
  padding-bottom:2px;
  max-width:100%;
}

.afw-date-pill.w-btn.us-btn-style_3,
.afw-dates__nav .w-btn.us-btn-style_3{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  height:44px;
  min-height:44px;
  line-height:1 !important;
  box-sizing:border-box;
  max-width:100%;
}

.afw-dates__nav .w-btn.us-btn-style_3{
  width:44px;
  min-width:44px;
  padding:0 !important;
}

.afw-date-pill.w-btn.us-btn-style_3{
  padding:0 12px !important;
  flex:0 0 auto;
  scroll-snap-align:start;
}

.afw-date-pill time{
  display:block;
  line-height:1 !important;
  white-space:nowrap;
}

.afw-dates__navbtn:disabled,
.afw-dates__navbtn.is-disabled{
  opacity:.35;
  cursor:not-allowed;
  pointer-events:none;
}

.afw-dates__list::-webkit-scrollbar{
  height:6px;
}

.afw-dates__list::-webkit-scrollbar-thumb{
  border-radius:999px;
}

/* ========================================================================
   SHARED — FORM BADGES
   ======================================================================== */

.afw-pill.afw-pill--form{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
}

.afw-pill__label{
  font-size:14px;
  letter-spacing:.08em;
  color:rgba(255,255,255,.65);
  white-space:nowrap;
}

.afw-form-badges{
  display:flex;
  gap:6px;
  align-items:center;
  max-width:520px;
  overflow:hidden;
}

.afw-form-badge{
  font-style:normal;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:30px;
  height:22px;
  font-size:14px;
  font-weight:600;
  line-height:1;
  color:#fff;
}

.afw-form-badge--win{ background:#16a34a; }
.afw-form-badge--loss{ background:#dc2626; }
.afw-form-badge--draw{ background:rgba(255,255,255,.22); }
.afw-form-badge--unk{ background:rgba(255,255,255,.18); }

/* ========================================================================
   MATCH SUMMARY — Teams Statistics (shared block)
   ======================================================================== */

.afw-ms__card{ padding:12px; }

.afw-ms__row{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  gap:12px;
  align-items:center;
  padding:10px 0;
}

.afw-ms__row + .afw-ms__row{
  background:rgba(255,255,255,.08);
  padding:8px 8px 8px 8px;
  margin-top:12px;
}

.afw-ms__label{
  font-size:12px;
  text-align:center;
  font-weight:600;
  color:#fff;
  margin-bottom:4px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.afw-ms__cell{ min-width:0; }
.afw-ms__cell--left,
.afw-ms__cell--right{
  font-size:15px;
  font-weight:700;
  color:#fff;
  line-height:1;
}

.afw-ms__cell--left{ text-align:left; }
.afw-ms__cell--right{ text-align:right; }

.afw-ms__cell .afw-form-badges{ max-width:240px; }
.afw-ms__cell--right .afw-form-badges{ margin-left:auto; }



/* ========================================================================
   AFW BREADCRUMBS
   ======================================================================== */

.afw-breadcrumbs{
  margin:0 0 14px;
}

.afw-breadcrumbs__list{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  margin:0;
  padding:0;
  list-style:none;
}

.afw-breadcrumbs__item{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:0;
  padding:0;
  list-style:none;
}

.afw-breadcrumbs__item:not(:last-child)::after{
  content:"/";
  color:rgba(255,255,255,.34);
  font-size:12px;
  line-height:1;
  font-weight:600;
}

.afw-breadcrumbs__link,
.afw-breadcrumbs__current{
  font-size:13px;
  line-height:1.35;
  font-weight:600;
  text-decoration:none;
}

.afw-breadcrumbs__link{
  color:rgba(255,255,255,.62);
}

.afw-breadcrumbs__link:hover{
  color:var(--color-content-heading);
}

.afw-breadcrumbs__current{
  color:var(--color-content-heading);
}

@media (max-width: 767px){
  .afw-breadcrumbs{
    margin:0 0 12px;
  }

  .afw-breadcrumbs__list{
    gap:6px;
  }

  .afw-breadcrumbs__item{
    gap:6px;
  }

  .afw-breadcrumbs__link,
  .afw-breadcrumbs__current{
    font-size:12px;
  }
}
