/* Project Dynasty Home overhaul (2026-09-25, home2).
   Loaded after every other public stylesheet so it can:
   - lift the Home page one step lighter than the sitewide neutral base,
   - frame the 12 owner franchises and fold the CPU teams away,
   - render the visual verified league leaders module,
   - densify and bound the League Pulse feed,
   - keep the score ribbon and league ticker clean at 390 and 1440.
   It only adds or tightens Home/ticker surfaces; no other route is touched. */

/* ---------- 1. Home sits one step lighter than the sitewide base ---------- */

body[data-view="overview"] {
  background-color: #fbfbfc;
  background-image: linear-gradient(180deg, #ffffff 0, #fbfbfc 420px);
  background-repeat: no-repeat;
}

html[data-theme="dark"] body[data-view="overview"] {
  background-color: #131317;
  background-image: linear-gradient(180deg, #191920 0, #131317 460px);
  background-repeat: no-repeat;
}

body[data-view="overview"] .m27-home .m27-band {
  border-color: #e8e8eb;
  box-shadow: 0 16px 40px rgba(9, 9, 11, 0.07);
}

html[data-theme="dark"] body[data-view="overview"] .m27-home .m27-band {
  background: #1c1c21;
  border-color: #303038;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

/* ---------- 2. Owner franchises frame ---------- */

.m27-home .m27-clubs {
  overflow: hidden;
}

.m27-home .m27-clubs-count,
.m27-home .m27-clubs-sub {
  color: #71717a;
  font-family: var(--pd-font-mono, monospace);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.m27-home .m27-clubs-sub {
  margin: -4px 0 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.m27-home .m27-owner-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.m27-home .m27-owner-card {
  position: relative;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px 12px 11px 15px;
  border: 1px solid #e4e4e7;
  border-radius: 15px;
  background: linear-gradient(150deg, #ffffff, #f6f6f8);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.m27-home .m27-owner-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--team-primary, #c8202f), var(--team-secondary, #71717a));
}

.m27-home .m27-owner-card:hover {
  transform: translateY(-2px);
  border-color: #a1a1aa;
}

.m27-home .m27-owner-card-art {
  display: grid;
  place-items: center;
}

.m27-home .m27-owner-card-art .team-mark.mark-hero {
  width: 52px;
  height: 52px;
}

.m27-home .m27-owner-card-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.m27-home .m27-owner-card-copy small {
  color: #71717a;
  font-family: var(--pd-font-mono, monospace);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.m27-home .m27-owner-card-copy strong {
  overflow: hidden;
  color: #18181b;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m27-home .m27-owner-card-copy em {
  color: #52525b;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.m27-home .m27-owner-card > b {
  color: #a1a1aa;
  font-size: 15px;
}

.m27-home .m27-cpu-fold {
  margin-top: 13px;
  border-top: 1px dashed #e4e4e7;
  padding-top: 10px;
}

.m27-home .m27-cpu-fold > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: #71717a;
  font-family: var(--pd-font-mono, monospace);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.m27-home .m27-cpu-fold > summary span {
  padding: 2px 7px;
  border-radius: 999px;
  background: #f0f0f1;
  color: #52525b;
  font-size: 9px;
}

.m27-home .m27-cpu-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
  margin-top: 11px;
}

.m27-home .m27-cpu-grid a {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  padding: 8px 4px;
  border: 1px solid #ececee;
  border-radius: 11px;
  color: #52525b;
  text-decoration: none;
  font-family: var(--pd-font-mono, monospace);
  font-size: 9.5px;
  font-weight: 900;
}

.m27-home .m27-cpu-grid a:hover {
  border-color: #a1a1aa;
  color: #18181b;
}

.m27-home .m27-cpu-grid .team-mark {
  width: 26px;
  height: 26px;
}

html[data-theme="dark"] .m27-home .m27-clubs-count,
html[data-theme="dark"] .m27-home .m27-clubs-sub,
html[data-theme="dark"] .m27-home .m27-cpu-fold > summary {
  color: #a1a1aa;
}

html[data-theme="dark"] .m27-home .m27-owner-card {
  border-color: #2e2e33;
  background: linear-gradient(150deg, #232327, #1a1a1e);
}

html[data-theme="dark"] .m27-home .m27-owner-card-copy strong {
  color: #f4f4f5;
}

html[data-theme="dark"] .m27-home .m27-owner-card-copy small {
  color: #8a8a91;
}

html[data-theme="dark"] .m27-home .m27-owner-card-copy em {
  color: #a1a1aa;
}

html[data-theme="dark"] .m27-home .m27-cpu-fold {
  border-color: #2e2e33;
}

html[data-theme="dark"] .m27-home .m27-cpu-fold > summary span {
  background: #27272a;
  color: #a1a1aa;
}

html[data-theme="dark"] .m27-home .m27-cpu-grid a {
  border-color: #2e2e33;
  color: #a1a1aa;
}

html[data-theme="dark"] .m27-home .m27-cpu-grid a:hover {
  border-color: #63636b;
  color: #f4f4f5;
}

/* ---------- 3. Visual verified league leaders ---------- */

.m27-home .m27-leader-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.m27-home .m27-leader-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 12px 12px 9px;
  border: 1px solid #e8e8eb;
  border-radius: 16px;
  background: linear-gradient(165deg, #ffffff, #fafafb);
}

.m27-home .m27-leader-card > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.m27-home .m27-leader-card > header strong {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.m27-home .m27-leader-card > header small {
  overflow: hidden;
  color: #71717a;
  font-family: var(--pd-font-mono, monospace);
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: right;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.m27-home .m27-leader-top {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.m27-home .m27-leader-portrait {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--team-primary, #3f3f46) 30%, #f4f4f5), #e9e9ec);
}

.m27-home .m27-leader-portrait.is-hero {
  width: 72px;
  height: 84px;
}

.m27-home .m27-leader-portrait.is-sm {
  width: 26px;
  height: 30px;
  border-radius: 7px;
}

.m27-home .m27-leader-portrait > span {
  position: absolute;
  inset: auto 0 0;
  height: 72%;
  background: color-mix(in srgb, var(--team-primary, #52525b) 42%, #c7c7cd);
  clip-path: polygon(50% 0, 74% 13%, 86% 52%, 100% 100%, 0 100%, 14% 52%, 26% 13%);
  opacity: 0.5;
}

.m27-home .m27-leader-portrait img {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.m27-home .m27-leader-portrait img.is-hidden {
  display: none;
}

.m27-home .m27-leader-top-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.m27-home .m27-leader-top-copy strong {
  overflow: hidden;
  color: #18181b;
  font-size: 13.5px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m27-home .m27-leader-top-copy small {
  overflow: hidden;
  color: #71717a;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m27-home .m27-leader-top > b {
  color: #18181b;
  font-family: var(--pd-font-mono, monospace);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.m27-home .m27-leader-rest {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 6px 0 0;
  border-top: 1px solid #f0f0f1;
  list-style: none;
}

.m27-home .m27-leader-rest a {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 3px 2px;
  border-radius: 9px;
  color: inherit;
  text-decoration: none;
}

.m27-home .m27-leader-rest a:hover {
  background: #f5f5f6;
}

.m27-home .m27-leader-rest-copy {
  min-width: 0;
  display: grid;
}

.m27-home .m27-leader-rest-copy strong {
  overflow: hidden;
  color: #3f3f46;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m27-home .m27-leader-rest-copy small {
  color: #8a8a91;
  font-size: 9.5px;
  font-weight: 700;
}

.m27-home .m27-leader-rest b {
  color: #3f3f46;
  font-family: var(--pd-font-mono, monospace);
  font-size: 12.5px;
  font-weight: 900;
}

html[data-theme="dark"] .m27-home .m27-leader-card {
  border-color: #2e2e33;
  background: linear-gradient(165deg, #232327, #1b1b20);
}

html[data-theme="dark"] .m27-home .m27-leader-card > header strong,
html[data-theme="dark"] .m27-home .m27-leader-top-copy strong,
html[data-theme="dark"] .m27-home .m27-leader-top > b,
html[data-theme="dark"] .m27-home .m27-leader-rest-copy strong,
html[data-theme="dark"] .m27-home .m27-leader-rest b {
  color: #f4f4f5;
}

html[data-theme="dark"] .m27-home .m27-leader-card > header small,
html[data-theme="dark"] .m27-home .m27-leader-top-copy small {
  color: #8a8a91;
}

html[data-theme="dark"] .m27-home .m27-leader-rest {
  border-color: #2b2b30;
}

html[data-theme="dark"] .m27-home .m27-leader-rest a:hover {
  background: #26262b;
}

html[data-theme="dark"] .m27-home .m27-leader-portrait {
  background: linear-gradient(165deg, color-mix(in srgb, var(--team-primary, #3f3f46) 38%, #27272a), #1d1d22);
}

/* ---------- 4. Compact Icons hub nod ---------- */

.m27-home .m27-icons-nod {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 16px;
  border: 1px solid #e8e8eb;
  border-radius: 15px;
  background: linear-gradient(120deg, #ffffff, #f5f5f7);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.m27-home .m27-icons-nod:hover {
  transform: translateY(-1px);
  border-color: #a1a1aa;
}

.m27-home .m27-icons-nod-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(150deg, #f1c95b, #c8202f);
  color: #fff;
  font-size: 15px;
}

.m27-home .m27-icons-nod > span:not(.m27-icons-nod-mark) {
  display: grid;
  gap: 1px;
}

.m27-home .m27-icons-nod small {
  color: #9a6a1c;
  font-family: var(--pd-font-mono, monospace);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.m27-home .m27-icons-nod strong {
  color: #18181b;
  font-size: 13.5px;
}

.m27-home .m27-icons-nod > b {
  margin-left: auto;
  color: #a1a1aa;
  font-size: 15px;
}

html[data-theme="dark"] .m27-home .m27-icons-nod {
  border-color: #2e2e33;
  background: linear-gradient(120deg, #232327, #1b1b20);
}

html[data-theme="dark"] .m27-home .m27-icons-nod strong {
  color: #f4f4f5;
}

html[data-theme="dark"] .m27-home .m27-icons-nod small {
  color: #ffd97a;
}

/* ---------- 5. League Pulse: dense, bounded, scannable ---------- */

.m27-home .pd-hp-feed-wrap {
  max-height: 520px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #ececee;
  border-radius: 13px;
  padding-right: 2px;
  scrollbar-width: thin;
}

.m27-home .pd-hp-feed-wrap:focus-visible {
  outline: 3px solid #efc45e;
  outline-offset: 2px;
}

.m27-home .pd-hp-feed {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.m27-home .pd-hp-item {
  border: 0;
  border-bottom: 1px solid #f0f0f1;
  border-radius: 0;
  padding: 9px 12px;
  background: transparent;
  box-shadow: inset 3px 0 0 #d4d4d8;
}

.m27-home .pd-hp-item:last-child {
  border-bottom: 0;
}

.m27-home .pd-hp-item:hover {
  transform: none;
  background: #f7f7f8;
}

.m27-home .pd-hp-item.is-clip { box-shadow: inset 3px 0 0 #c8202f; }
.m27-home .pd-hp-item.is-final { box-shadow: inset 3px 0 0 #2b5fa8; }
.m27-home .pd-hp-item.is-trade { box-shadow: inset 3px 0 0 #5b3fb8; }
.m27-home .pd-hp-item.is-signing { box-shadow: inset 3px 0 0 #1f7a4d; }
.m27-home .pd-hp-item.is-re_signing { box-shadow: inset 3px 0 0 #b8862f; }
.m27-home .pd-hp-item.is-release { box-shadow: inset 3px 0 0 #8a8a91; }

.m27-home .pd-hp-item-title {
  font-size: 13px;
}

.m27-home .pd-hp-item-detail {
  font-size: 10.5px;
}

.m27-home .pd-hp-feed-note {
  margin: 9px 0 0;
  color: #8a8a91;
  font-family: var(--pd-font-mono, monospace);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html[data-theme="dark"] .m27-home .pd-hp-feed-wrap {
  border-color: #2b2b30;
}

html[data-theme="dark"] .m27-home .pd-hp-item {
  border-color: #26262b;
  box-shadow: inset 3px 0 0 #3f3f46;
}

html[data-theme="dark"] .m27-home .pd-hp-item:hover {
  background: #232327;
}

html[data-theme="dark"] .m27-home .pd-hp-feed-note {
  color: #71717a;
}

/* ---------- 6. Score ribbon + league ticker: no clipped text, no overflow ---------- */

.score-ribbon {
  grid-template-columns: 122px minmax(0, 1fr);
}

.score-ribbon-track {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.score-bug {
  flex: 0 0 148px;
  min-width: 0;
  scroll-snap-align: start;
}

.score-bug .score-state {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-team {
  grid-template-columns: 22px minmax(0, 1fr) auto;
  min-width: 0;
}

.score-team strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-team b {
  white-space: nowrap;
}

.league-ticker {
  grid-template-columns: 200px minmax(0, 1fr);
}

.league-ticker .ticker-label {
  min-width: 0;
  overflow: hidden;
}

.league-ticker .ticker-label strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-ticker .ticker-label .ticker-live,
.league-ticker .ticker-label .ticker-position {
  flex: 0 0 auto;
}

.league-ticker .ticker-frame {
  overflow: hidden;
}

.league-ticker .ticker-frame > * {
  min-width: 0;
}

.league-ticker .ticker-frame > strong {
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-ticker .ticker-frame > span:not(.team-mark),
.league-ticker .ticker-frame > em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-ticker .ticker-frame > b {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  padding: 0 2px;
  line-height: 1;
}

.league-ticker .ticker-game-score {
  flex: 0 0 auto;
  max-width: 100%;
}

.league-ticker .ticker-frame-copy {
  min-width: 0;
  overflow: hidden;
}

.league-ticker .ticker-frame-copy > strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.league-ticker .ticker-player-note {
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--pd-font-mono, monospace);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.league-ticker .ticker-leader-team > b > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .m27-home .m27-owner-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .m27-home .m27-leader-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .m27-home .m27-cpu-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .score-ribbon {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .score-bug {
    flex-basis: 132px;
  }

  .league-ticker {
    grid-template-columns: 130px minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .league-ticker {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .league-ticker .ticker-label .ticker-live {
    display: none !important;
  }

  .m27-home .m27-owner-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .m27-home .m27-owner-card {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 9px 10px 9px 13px;
  }

  .m27-home .m27-owner-card-art .team-mark.mark-hero {
    width: 38px;
    height: 38px;
  }

  .m27-home .m27-owner-card > b {
    display: none;
  }

  .m27-home .m27-leader-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .m27-home .m27-leader-top {
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .m27-home .m27-leader-portrait.is-hero {
    width: 54px;
    height: 64px;
  }

  .m27-home .m27-leader-top > b {
    font-size: 21px;
  }

  .m27-home .m27-cpu-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .m27-home .pd-hp-feed-wrap {
    max-height: 430px;
  }

  .league-ticker .ticker-frame > em {
    display: none;
  }
}

@media (max-width: 430px) {
  .m27-home .m27-leader-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .m27-home .m27-owner-card-copy small {
    font-size: 8px;
  }

  .m27-home .m27-owner-card-copy strong {
    font-size: 12.5px;
  }

  .m27-home .m27-owner-card-copy em {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .m27-home .m27-owner-card,
  .m27-home .m27-icons-nod {
    transition: none;
  }
}
