@supports selector(:has(*)) {
  html:has(body.leagues-page) {
    min-height: 100%;
    height: auto;
  }
}

body.leagues-page {
  --league-orange: #f25802;
  --league-orange-dark: #cc4d12;
  --league-ink: #24212d;
  min-height: 100vh;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
}

.leagues-shell {
  --leagues-shell-gutter: clamp(24px, 4vw, 64px);
  --leagues-flat-gutter: clamp(20px, 3.35vw, 58px);
  min-height: 100vh;
  height: auto;
  display: block;
}

.leagues-main {
  position: relative;
  z-index: 1;
  width: auto;
  max-width: none;
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 0;
  margin: clamp(18px, 2vw, 28px) calc(0px - var(--leagues-shell-gutter)) 0;
  padding-bottom: 0;
  background: #fff;
}

.leagues-intro,
.leagues-workspace {
  position: relative;
  z-index: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.leagues-intro {
  min-height: 204px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(36px, 5vw, 88px);
  overflow: visible;
  padding: 38px var(--leagues-flat-gutter);
  border-bottom: 1px solid rgb(54 46 38 / 0.14);
}

.leagues-intro::after {
  content: none;
}

.leagues-intro-copy,
.leagues-intro-actions {
  position: relative;
  z-index: 1;
}

.leagues-intro-copy {
  min-width: 0;
}

.leagues-intro h1 {
  margin: 0;
  color: #211f2a;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(3.25rem, 3.8vw, 4.15rem);
  font-style: normal;
  font-weight: 900;
  letter-spacing: -0.052em;
  line-height: 0.98;
  text-transform: none;
  transform: none;
}

.leagues-intro-copy p {
  max-width: 760px;
  margin: 16px 0 0;
  color: #625b55;
  font-size: clamp(1rem, 1.08vw, 1.24rem);
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

.leagues-intro-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 24px;
}

.league-primary-action,
.league-row-action,
.league-tabs button,
.league-join-prompt button,
.league-dialog-close,
.league-dialog-confirm {
  border: 0;
  cursor: pointer;
}

.league-primary-action {
  min-height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 2px solid var(--league-orange);
  border-radius: 7px;
  padding: 0 24px;
  font-size: clamp(1.1875rem, 1.06vw, 1.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.league-primary-action svg {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  stroke-width: 1.9;
}

.league-primary-action.is-create {
  width: 250px;
  color: #fff;
  background: var(--league-orange);
  box-shadow: none;
}

.league-primary-action.is-join {
  width: 245px;
  color: var(--league-orange-dark);
  background: transparent;
}

.league-primary-action.is-create:hover,
.league-primary-action.is-create:focus-visible {
  background: #a93a0a;
  box-shadow: none;
}

.league-primary-action.is-join:hover,
.league-primary-action.is-join:focus-visible {
  background: var(--orange-soft);
}

.leagues-workspace {
  overflow: visible;
  padding-bottom: 32px;
}

.leagues-workspace-header {
  min-height: 94px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin: 0 var(--leagues-flat-gutter);
  border-bottom: 1px solid rgb(54 46 38 / 0.17);
}

.leagues-workspace-header h2 {
  display: flex;
  align-items: baseline;
  gap: 0.3em;
  margin: 0;
  padding-bottom: 20px;
  color: var(--league-ink);
  font-size: clamp(1.55rem, 1.68vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
}

.leagues-workspace-header h2 strong {
  color: var(--league-orange);
  font-weight: 900;
}

.league-tabs {
  height: 63px;
  display: grid;
  grid-template-columns: 130px 163px;
  align-self: flex-end;
}

.league-tabs button {
  position: relative;
  display: grid;
  place-items: center;
  padding: 10px 16px 15px;
  color: #756e78;
  background: transparent;
  font-size: clamp(0.94rem, 0.95vw, 1.08rem);
  font-weight: 600;
  transition: color 180ms ease;
}

.league-tabs button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--league-orange);
  content: "";
  opacity: 0;
  transform: scaleX(0.68);
  transition: opacity 180ms ease, transform 180ms ease;
}

.league-tabs button[aria-selected="true"] {
  color: var(--league-orange-dark);
  font-weight: 800;
}

.league-tabs button[aria-selected="true"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.league-panel[hidden] {
  display: none;
}

.league-panel:focus-visible {
  outline: 3px solid rgb(204 77 18 / 0.44);
  outline-offset: -5px;
}

.league-columns,
.league-row {
  display: grid;
  grid-template-columns: 427px minmax(0, 1fr) 151px 143px 156px;
  column-gap: 30px;
  align-items: center;
}

.league-columns,
.league-rows {
  margin-inline: var(--leagues-flat-gutter);
}

.league-columns {
  min-height: 56px;
  padding: 0 30px 0 42px;
  color: #77717a;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.league-columns span:nth-child(2) {
  padding-left: 223px;
}

.league-columns span:last-child {
  text-align: center;
}

.league-rows {
  margin: 0 var(--leagues-flat-gutter);
  padding: 0;
  list-style: none;
}

.league-rows > li {
  margin: 0;
  padding: 0;
}

.league-row {
  position: relative;
  min-height: 115px;
  padding: 14px 30px 14px 42px;
  border-top: 1px solid rgb(54 46 38 / 0.14);
  background: transparent;
  transition: background-color 180ms ease;
}

.league-rows > li:last-child .league-row {
  border-bottom: 1px solid rgb(54 46 38 / 0.14);
}

.league-row::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 7px;
  border-radius: 0 4px 4px 0;
  background: var(--league-accent);
  content: "";
}

.league-row:hover {
  background: rgb(255 249 244 / 0.48);
  box-shadow: none;
}

.league-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 43px;
}

.league-emblem {
  width: 78px;
  height: 84px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--league-accent);
  filter: none;
}

.league-emblem svg {
  width: 100%;
  height: 100%;
  fill: rgb(255 255 255 / 0.86);
  stroke: currentColor;
  stroke-width: 2.1;
}

.league-identity-copy {
  min-width: 0;
}

.league-identity h3 {
  margin: 0;
  overflow: hidden;
  color: var(--league-ink);
  font-size: clamp(1.18rem, 1.35vw, 1.46rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-identity p {
  margin: 8px 0 0;
  overflow: hidden;
  color: #6f6871;
  font-size: clamp(0.94rem, 1.03vw, 1.12rem);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-members {
  min-width: 0;
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  align-items: center;
  column-gap: 27px;
}

.league-roster {
  display: flex;
  align-items: center;
  padding-left: 2px;
}

.league-team-avatar,
.league-team-more {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgb(54 46 38 / 0.16);
  border-radius: 50%;
  background: #f3f1ef;
  box-shadow: none;
}

.league-team-avatar + .league-team-avatar,
.league-team-more {
  margin-left: -2px;
}

.league-team-avatar img {
  width: 86%;
  height: 86%;
  object-fit: contain;
}

.league-team-more {
  color: #625c64;
  background: #eeecea;
  font-size: 0.72rem;
  font-weight: 800;
}

.league-member-count {
  color: #413d46;
  font-size: clamp(1rem, 1.07vw, 1.18rem);
  font-weight: 500;
  white-space: nowrap;
}

.league-member-count strong {
  color: var(--league-ink);
  font-weight: 700;
}

.league-detail {
  min-width: 0;
  margin: 0;
}

.league-detail dt,
.league-mobile-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

.league-detail dd {
  margin: 0;
  color: #34303a;
  font-size: clamp(1rem, 1.07vw, 1.18rem);
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
}

.league-detail dd strong {
  color: #201e27;
  font-weight: 900;
}

.league-row-action {
  width: 100%;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 2px solid transparent;
  border-radius: 7px;
  color: var(--league-orange-dark);
  background: transparent;
  font-size: clamp(1.1875rem, 1.06vw, 1.25rem);
  font-weight: 800;
  white-space: nowrap;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.league-row-action.is-filled {
  color: #fff;
  background: var(--league-orange);
  box-shadow: none;
}

.league-row-action.is-outlined {
  border-color: var(--league-orange);
  background: transparent;
}

.league-row-action.is-outlined:hover,
.league-row-action.is-outlined:focus-visible,
.league-row-action.is-quiet:hover,
.league-row-action.is-quiet:focus-visible {
  background: var(--orange-soft);
}

.league-join-prompt {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  margin: 36px var(--leagues-flat-gutter) 0;
  padding: 14px 24px;
  border: 1px dashed rgb(204 77 18 / 0.4);
  border-radius: 7px;
  background: rgb(255 247 241 / 0.34);
  color: #403b43;
}

.league-join-prompt > span {
  width: 40px;
  height: 40px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: rgb(204 77 18 / 0.48);
}

.league-join-prompt > span svg {
  width: 100%;
  height: 100%;
  stroke-width: 1.65;
}

.league-join-prompt p {
  margin: 0;
  font-size: clamp(0.98rem, 1.08vw, 1.18rem);
  font-weight: 500;
  line-height: 1.55;
  text-align: center;
}

.league-join-prompt button {
  display: inline;
  padding: 0;
  color: var(--league-orange-dark);
  background: transparent;
  font-weight: 800;
}

.league-join-prompt button:hover,
.league-join-prompt button:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.league-completed-empty {
  min-height: 300px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 42px 24px 20px;
  color: var(--league-ink);
  text-align: center;
}

.league-completed-icon {
  width: 76px;
  height: 88px;
  color: #9b948e;
}

.league-completed-icon svg {
  width: 100%;
  height: 100%;
  fill: rgb(255 255 255 / 0.72);
  stroke-width: 1.8;
}

.league-completed-empty h3 {
  margin: 18px 0 0;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.league-completed-empty p {
  margin: 10px 0 0;
  color: #6f6871;
  font-weight: 500;
}

.league-primary-action:focus-visible,
.league-row-action:focus-visible,
.league-tabs button:focus-visible,
.league-join-prompt button:focus-visible,
.league-dialog-close:focus-visible,
.league-dialog-confirm:focus-visible {
  outline: 3px solid #cc4d12;
  outline-offset: 3px;
}

.league-prototype-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 34px;
  border: 1px solid rgb(54 46 38 / 0.12);
  border-radius: 20px;
  color: var(--league-ink);
  background: #fffaf6;
  box-shadow: 0 30px 80px rgb(55 28 13 / 0.28);
  text-align: center;
}

.league-prototype-dialog[open] {
  animation: league-dialog-in 180ms ease-out both;
}

.league-prototype-dialog::backdrop {
  background: rgb(35 29 27 / 0.46);
  backdrop-filter: blur(5px);
}

.league-dialog-close {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #655e58;
  background: transparent;
}

.league-dialog-close:hover {
  background: var(--orange-soft);
}

.league-dialog-close svg {
  width: 22px;
  height: 22px;
}

.league-dialog-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 4px auto 18px;
  border-radius: 18px;
  color: var(--league-orange-dark);
  background: var(--orange-soft);
}

.league-dialog-icon svg {
  width: 32px;
  height: 32px;
}

.league-dialog-kicker {
  margin: 0 0 8px;
  color: var(--league-orange-dark);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.league-prototype-dialog h2 {
  margin: 0;
  font-size: 1.42rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.league-prototype-dialog > p:not(.league-dialog-kicker) {
  margin: 13px auto 24px;
  color: #665f59;
  font-size: 0.96rem;
  font-weight: 500;
  line-height: 1.55;
}

.league-dialog-confirm {
  min-width: 130px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #cc4d12, #a93a0a);
  font-weight: 800;
}

@keyframes league-dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1570px) {
  .league-columns,
  .league-row {
    grid-template-columns: minmax(300px, 1.16fr) minmax(270px, 1fr) minmax(105px, 0.42fr) minmax(112px, 0.45fr) minmax(136px, 0.5fr);
    column-gap: 18px;
  }

  .league-columns {
    padding-right: 24px;
    padding-left: 32px;
  }

  .league-columns span:nth-child(2) {
    padding-left: 0;
  }

  .league-row {
    padding-right: 24px;
    padding-left: 32px;
  }

  .league-identity {
    gap: clamp(22px, 2vw, 34px);
  }

  .league-members {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }
}

@media (max-width: 1220px) {
  .leagues-intro {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 28px;
  }

  .leagues-intro-copy p {
    white-space: normal;
  }

  .leagues-intro-actions {
    justify-content: flex-start;
  }

  .league-primary-action {
    width: auto;
    flex: 1 1 230px;
  }

  .league-columns {
    display: none;
  }

  .league-rows {
    display: block;
    padding: 0;
  }

  .league-row {
    min-height: 0;
    grid-template-columns: minmax(250px, 1fr) minmax(210px, 0.78fr) minmax(112px, 0.42fr) minmax(130px, 0.48fr);
    grid-template-areas:
      "identity members standing action"
      "identity members status action";
    gap: 12px 22px;
    padding: 24px 20px 24px 30px;
    border: 0;
    border-top: 1px solid rgb(54 46 38 / 0.14);
    border-radius: 0;
    background: transparent;
  }

  .league-rows > li:last-child .league-row {
    border-bottom: 1px solid rgb(54 46 38 / 0.14);
  }

  .league-row::before {
    top: 0;
    bottom: 0;
    left: 0;
    border-radius: 0 4px 4px 0;
  }

  .league-identity {
    grid-area: identity;
  }

  .league-members {
    grid-area: members;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .league-standing {
    grid-area: standing;
  }

  .league-status {
    grid-area: status;
  }

  .league-row-action {
    grid-area: action;
  }

  .league-detail dt,
  .league-mobile-label {
    position: static;
    width: auto;
    height: auto;
    display: block;
    overflow: visible;
    clip: auto;
    clip-path: none;
    margin: 0 0 5px;
    color: #8a8289;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: normal;
  }
}

@media (max-width: 960px) {
  .leagues-intro {
    padding: 30px var(--leagues-flat-gutter);
  }

  .leagues-workspace {
    padding-bottom: 26px;
  }

  .leagues-workspace-header {
    min-height: 132px;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    margin: 0 var(--leagues-flat-gutter);
  }

  .leagues-workspace-header h2 {
    padding: 30px 0 4px;
  }

  .league-tabs {
    width: 100%;
    height: 56px;
    grid-template-columns: repeat(2, 1fr);
  }

  .league-tabs button {
    min-height: 48px;
    padding-bottom: 13px;
  }

  .league-rows {
    padding: 0;
  }

  .league-row {
    grid-template-columns: minmax(0, 1fr) minmax(130px, 0.38fr);
    grid-template-areas:
      "identity action"
      "members members"
      "standing status";
    gap: 18px 20px;
  }

  .league-members {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 18px;
  }

  .league-mobile-label {
    grid-column: 1 / -1;
  }

  .league-join-prompt {
    margin: 28px var(--leagues-flat-gutter) 0;
  }
}

@media (max-width: 820px) {
  .leagues-shell {
    --leagues-shell-gutter: 20px;
  }

  .leagues-intro {
    padding: 28px var(--leagues-flat-gutter);
  }

  .leagues-intro h1 {
    font-size: clamp(2.75rem, 8vw, 3.6rem);
  }

  .leagues-intro-copy p {
    font-size: 1rem;
  }

  .leagues-intro-actions {
    gap: 14px;
  }

  .league-primary-action {
    min-height: 60px;
    font-size: 1.1875rem;
  }
}

@media (max-width: 620px) {
  .leagues-main {
    gap: 0;
  }

  .leagues-intro {
    padding: 26px var(--leagues-flat-gutter);
  }

  .leagues-intro h1 {
    font-size: clamp(2.45rem, 12vw, 3.2rem);
  }

  .leagues-intro-copy p {
    margin-top: 13px;
    line-height: 1.45;
  }

  .leagues-intro-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .league-primary-action {
    width: 100%;
    min-width: 0;
    min-height: 54px;
  }

  .leagues-workspace {
    padding-bottom: 20px;
  }

  .leagues-workspace-header {
    margin: 0 var(--leagues-flat-gutter);
  }

  .leagues-workspace-header h2 {
    font-size: 1.35rem;
  }

  .league-rows {
    padding: 0;
  }

  .league-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "identity identity"
      "members members"
      "standing status"
      "action action";
    gap: 19px 16px;
    padding: 22px 18px 20px 24px;
  }

  .league-emblem {
    width: 54px;
    height: 61px;
  }

  .league-identity {
    gap: 15px;
  }

  .league-identity h3 {
    font-size: 1.05rem;
    white-space: normal;
  }

  .league-identity p {
    margin-top: 5px;
    font-size: 0.82rem;
    white-space: normal;
  }

  .league-members {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .league-team-avatar,
  .league-team-more {
    width: 36px;
    height: 36px;
  }

  .league-row-action {
    min-height: 48px;
  }

  .league-join-prompt {
    align-items: flex-start;
    gap: 12px;
    margin: 24px var(--leagues-flat-gutter) 0;
    padding: 17px;
  }

  .league-join-prompt > span {
    width: 28px;
    height: 28px;
  }

  .league-join-prompt p {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .leagues-shell {
    --leagues-shell-gutter: 16px;
  }
}

@media (max-width: 390px) {
  .leagues-intro {
    padding-right: var(--leagues-flat-gutter);
    padding-left: var(--leagues-flat-gutter);
  }

  .league-row {
    padding-right: 14px;
    padding-left: 20px;
  }

  .league-identity {
    align-items: flex-start;
  }

  .league-detail dd {
    font-size: 0.84rem;
    white-space: normal;
  }

  .league-team-avatar,
  .league-team-more {
    width: 34px;
    height: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .league-primary-action,
  .league-row,
  .league-row-action,
  .league-tabs button,
  .league-tabs button::after {
    transition: none;
  }

  .league-prototype-dialog[open] {
    animation: none;
  }
}
