/* Shared site header: every game, guide and information page uses this markup. */
.afs-header {
  --afs-accent: #70e5df;
  position: relative;
  z-index: 30;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(110, 156, 204, 0.22);
  background: linear-gradient(180deg, rgba(11, 23, 38, 0.97), rgba(7, 15, 25, 0.97));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  color: #eef6ff;
  font: 500 14px/1.4 Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}
.afs-header[data-sport="baseball"] { --afs-accent: #f1cc82; }
.afs-header[data-sport="basketball"] { --afs-accent: #ffa878; }
.afs-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--afs-accent) 22%, var(--afs-accent) 78%, transparent);
  opacity: 0.55;
  pointer-events: none;
}
.afs-header *,
.afs-header *::before,
.afs-header *::after { box-sizing: border-box; }
.afs-header .afs-header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  width: min(1440px, 100%);
  min-height: 76px;
  margin: 0 auto;
  padding: 12px max(20px, env(safe-area-inset-left)) 12px max(20px, env(safe-area-inset-right));
}

/* Brand */
.afs-header a.afs-header-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 44px;
  color: #fff !important;
  text-decoration: none !important;
  justify-self: start;
}
.afs-header .afs-header-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--afs-accent) 50%, transparent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--afs-accent) 12%, #0b1828);
  color: var(--afs-accent);
}
.afs-header .afs-header-mark svg { width: 24px; height: 24px; display: block; }
.afs-header .afs-header-text { display: grid; gap: 3px; min-width: 0; }
.afs-header .afs-header-eyebrow {
  display: block;
  color: #8fb0cf;
  font: 800 10.5px/1.2 Inter, system-ui, Arial, sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.afs-header .afs-header-title {
  display: block;
  margin: 0;
  color: #fff;
  font: 900 27px/1 "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  white-space: nowrap;
}
.afs-header .afs-header-title-short { display: none; }
.afs-header a.afs-header-brand:hover .afs-header-title { color: color-mix(in srgb, var(--afs-accent) 35%, #fff); }

/* Sport switcher */
.afs-header nav.afs-header-sports {
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin: 0;
  padding: 4px;
  border: 1px solid #1f3650;
  border-radius: 13px;
  background: rgba(5, 12, 21, 0.75);
  justify-self: center;
}
.afs-header nav.afs-header-sports a {
  --tab-accent: #70e5df;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #a8bed0 !important;
  font: 700 13px/1 Inter, system-ui, Arial, sans-serif;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.afs-header nav.afs-header-sports a[data-sport="baseball"] { --tab-accent: #f1cc82; }
.afs-header nav.afs-header-sports a[data-sport="basketball"] { --tab-accent: #ffa878; }
.afs-header nav.afs-header-sports a svg { width: 18px; height: 18px; flex: 0 0 auto; color: #6f8ca6; transition: color 0.15s ease; }
.afs-header nav.afs-header-sports a:hover { background: #12253a; color: #fff !important; }
.afs-header nav.afs-header-sports a:hover svg { color: var(--tab-accent); }
.afs-header nav.afs-header-sports a[aria-current] {
  background: #13293e;
  color: #fff !important;
  box-shadow: inset 0 -2px var(--tab-accent), 0 0 0 1px color-mix(in srgb, var(--tab-accent) 30%, transparent);
}
.afs-header nav.afs-header-sports a[aria-current] svg { color: var(--tab-accent); }
.afs-header .afs-tab-short { display: none; }

/* Actions */
.afs-header .afs-header-actions { display: flex; justify-content: flex-end; gap: 8px; justify-self: end; }
.afs-header a.afs-header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #2c455e;
  border-radius: 10px;
  background: rgba(13, 29, 47, 0.8);
  color: #dbe9f7 !important;
  font: 700 13px/1 Inter, system-ui, Arial, sans-serif;
  text-decoration: none !important;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.afs-header a.afs-header-action:hover { border-color: var(--afs-accent); background: #12253a; }
.afs-header a.afs-header-action-primary {
  border-color: var(--afs-accent);
  background: var(--afs-accent);
  color: #06101b !important;
  font-weight: 800;
}
.afs-header a.afs-header-action-primary:hover { background: color-mix(in srgb, var(--afs-accent) 80%, #fff); }
.afs-header a:focus-visible { outline: 2px solid var(--afs-accent); outline-offset: 3px; }

/* Tablet: sport switcher gets its own full-width row. */
@media (max-width: 980px) {
  .afs-header .afs-header-inner { grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; padding-top: 10px; padding-bottom: 12px; }
  .afs-header nav.afs-header-sports { grid-column: 1 / -1; grid-row: 2; width: 100%; justify-self: stretch; }
  .afs-header nav.afs-header-sports a { flex: 1 1 0; }
  .afs-header .afs-header-actions { grid-column: 2; grid-row: 1; }
}

/* Phone: short titles, compact tabs, every target still 44px. */
@media (max-width: 560px) {
  .afs-header .afs-header-inner { gap: 10px 12px; min-height: 0; padding: 10px max(14px, env(safe-area-inset-left)) 12px max(14px, env(safe-area-inset-right)); }
  .afs-header .afs-header-mark { width: 36px; height: 36px; border-radius: 10px; }
  .afs-header .afs-header-mark svg { width: 21px; height: 21px; }
  .afs-header .afs-header-eyebrow { display: none; }
  .afs-header .afs-header-title { font-size: clamp(17px, 5.4vw, 22px); }
  .afs-header a.afs-header-brand { gap: 10px; }
  .afs-header .afs-header-title-full,
  .afs-header .afs-tab-full {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .afs-header .afs-header-title-short,
  .afs-header .afs-tab-short { display: inline; }
  .afs-header nav.afs-header-sports a { gap: 6px; padding: 0 8px; font-size: 13px; }
  .afs-header nav.afs-header-sports a svg { width: 16px; height: 16px; }
  .afs-header a.afs-header-action { padding: 0 14px; font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .afs-header *, .afs-header *::before, .afs-header *::after { transition: none !important; }
}

/* Shared in-game toolbar (career history, trophy cabinet, help) under the header. */
html body .afs-game-toolbar {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin: 14px 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
}
html body .afs-game-toolbar > span { display: none !important; }
html body .afs-game-toolbar > div { display: flex !important; flex-wrap: wrap; justify-content: flex-end; gap: 8px !important; width: auto !important; margin: 0 !important; }
html body .afs-game-toolbar :is(button, a) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 16px !important;
  border: 1px solid #2c455e !important;
  border-radius: 10px !important;
  background: rgba(13, 29, 47, 0.85) !important;
  box-shadow: none !important;
  color: #dbe9f7 !important;
  font: 700 13px/1 Inter, system-ui, Arial, sans-serif !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
}
html body .afs-game-toolbar :is(button, a):hover { border-color: #54d6e8 !important; background: #12253a !important; color: #fff !important; }
html body .afs-game-toolbar :is(button, a):focus-visible { outline: 2px solid #54d6e8 !important; outline-offset: 3px; }
html body .afs-game-toolbar svg { width: 17px; height: 17px; }
html body .afs-game-toolbar .afs-toolbar-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #f5c85b;
  color: #1a1203;
  font: 800 12px/1 Inter, system-ui, Arial, sans-serif;
}
html body .basketball-app:not(:has([data-badge-status=unavailable])) .afs-game-toolbar .bk-badge-retry { display: none !important; }
@media (max-width: 560px) {
  html body .afs-game-toolbar { margin: 10px 0 !important; }
  html body .afs-game-toolbar > div { width: 100% !important; }
  html body .afs-game-toolbar :is(button, a) { flex: 1 1 0; padding: 0 10px !important; font-size: 12.5px !important; }
}

.afs-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

@media (max-width: 380px) {
  .afs-header .afs-header-mark { display: none; }
  .afs-header .afs-header-text, .afs-header .afs-header-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}
