.league-lobby-identity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.league-lobby-roster-emblem {
  display: inline-grid;
  width: 2.15rem;
  height: 2.15rem;
  flex: 0 0 2.15rem;
  place-items: center;
}

.league-lobby-roster-emblem svg,
.league-identity-crest svg,
.live-league-ribbon-emblem svg {
  display: block;
  width: 100%;
  height: 100%;
}

.public-lobby-roster > li:has(.league-lobby-roster-emblem) {
  grid-template-columns: 2.15rem minmax(0, 1fr) auto;
  align-items: center;
}

.league-identity-backdrop {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgb(23 18 13 / 72%);
  backdrop-filter: blur(2px);
}

.league-identity-sheet {
  width: min(31rem, 100%);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 1.35rem;
  color: #2e261d;
  border: 3px double #80533c;
  outline: 1px solid #d7bd91;
  background:
    repeating-linear-gradient(0deg, transparent 0 24px, rgb(117 84 51 / 7%) 25px),
    #f8f0dc;
  box-shadow: 0 14px 45px rgb(0 0 0 / 42%);
}

.league-identity-sheet header {
  padding-bottom: 0.8rem;
  border-bottom: 3px double #8b6547;
  text-align: center;
}

.league-identity-sheet h3 {
  margin: 0.18rem 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 7vw, 2.35rem);
}

.league-identity-crest {
  display: block;
  width: 7.5rem;
  height: 7.5rem;
  margin: 1rem auto;
  filter: drop-shadow(0 4px 4px rgb(54 37 22 / 20%));
}

.league-identity-name,
.league-identity-name > span,
.league-identity-option > span,
.league-identity-colors label > span {
  display: block;
}

.league-identity-name > span,
.league-identity-option > span,
.league-identity-colors label > span {
  margin-bottom: 0.3rem;
  color: #7b4734;
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.league-identity-name input {
  width: 100%;
}

.league-identity-design {
  margin-top: 1rem;
  border-top: 1px solid #cdbb98;
}

.league-identity-option {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #d9c7a8;
}

.league-identity-option > div {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr) 2.35rem;
  align-items: center;
  gap: 0.35rem;
}

.league-identity-option button {
  min-height: 2.2rem;
  color: #70412f;
  border: 1px solid #b99d77;
  background: #fff8e8;
  font-family: Georgia, serif;
  font-size: 1.5rem;
}

.league-identity-option strong {
  overflow: hidden;
  font-family: Georgia, serif;
  font-size: 0.9rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-identity-colors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
}

.league-identity-colors input[type="color"] {
  width: 100%;
  height: 2.5rem;
  padding: 0.16rem;
  border: 1px solid #b99d77;
  background: #fff8e8;
}

.league-identity-sheet footer {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 0.65rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 3px double #8b6547;
}

.league-identity-sheet footer button {
  width: 100%;
}

.live-league-ribbon-emblem:has(svg) {
  overflow: visible;
  border: 0;
  background: transparent;
}

/* The shared Coach's Challenge deadline is display-only. It is deliberately
   styled as a time card, rather than as an action a single GM can press. */
.league-review-countdown {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 2px;
  width: 100%;
  box-sizing: border-box;
  place-items: center;
  color: #514a3f;
  cursor: default;
  pointer-events: none;
  text-align: center;
  border: 1px solid #9a907c;
  background:
    repeating-linear-gradient(0deg, transparent 0 10px, #786a5010 10px 11px),
    #eee9dc;
  box-shadow: none;
}

.league-review-countdown strong {
  color: inherit;
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 1.375rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0.06em;
}

.league-review-countdown small {
  color: inherit;
  font-family: "Courier New", monospace;
  font-size: 0.5rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  opacity: 0.82;
  text-transform: uppercase;
}

/* The Solo run-action group normally enlarges its launch buttons. A shared
   clock instead matches the adjacent Coach's Challenge control exactly. */
.final-lineup-actions .lineup-run-actions > .league-review-countdown {
  min-height: 42px;
  padding: 4px 10px;
  gap: 2px;
  transform: none;
  box-shadow: none;
}

.final-lineup-actions .lineup-run-actions > .league-review-countdown small {
  width: auto;
  padding: 0;
  border: 0;
  color: inherit;
  font-size: 0.5rem;
  line-height: 1;
}

/* This is a short viewing window, not a second empty screen. The room's
   lineups start immediately beneath it so a GM can scan the field. */
.league-post-draft-brief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.28rem 0.8rem;
  margin: 0.75rem 0;
  padding: 0.85rem 0.95rem;
  color: #4f3524;
  border: 1px solid #a98162;
  background:
    linear-gradient(90deg, rgb(130 77 47 / 12%), transparent 42%),
    repeating-linear-gradient(0deg, transparent 0 17px, rgb(117 84 51 / 7%) 17px 18px),
    #fff8e8;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 54%);
}

.league-post-draft-brief strong {
  color: #342419;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
}

.league-post-draft-brief > .live-kicker,
.league-post-draft-brief > strong,
.league-post-draft-brief > p {
  grid-column: 1;
}

.league-field-countdown {
  grid-column: 2;
  grid-row: 1 / 4;
  display: grid;
  align-content: center;
  text-align: center;
  min-width: 4.5rem;
  padding-left: 0.8rem;
  border-left: 3px double #a98162;
}

.league-field-countdown b {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.league-field-countdown small { font-size: 0.42em; }
.league-field-countdown span {
  font: 700 0.55rem/1.4 "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.live-league-room-panel .live-team-card li {
  align-items: start;
  padding-block: 0.35rem;
  border-bottom: 1px dotted #a9816259;
}

.live-league-room-panel .live-team-card li:last-child { border-bottom: 0; }

.live-league-room-panel .live-team-player {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.live-league-room-panel .live-team-player em {
  display: block;
  font: normal 0.63rem/1.4 "Courier New", monospace;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.league-post-draft-brief p {
  margin: 0;
  color: #674a36;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.4;
}

.league-post-draft-brief b {
  color: #4d2b18;
}

/* The regular-season result is a shared, passive intermission. It deliberately
   reads as a filed notice rather than another page or player-controlled dialog. */
.league-postseason-verdict {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgb(32 24 17 / 58%);
  backdrop-filter: blur(2px);
}

.league-postseason-verdict-card {
  width: min(100%, 33rem);
  display: grid;
  gap: 0.55rem;
  padding: 1.35rem;
  color: #302119;
  background:
    repeating-linear-gradient(0deg, rgb(131 92 58 / 7%) 0 1px, transparent 1px 5px),
    #fff9e8;
  border: 1px solid #6b4832;
  box-shadow: inset 0 0 0 3px rgb(255 255 255 / 62%), 0 0.65rem 1.7rem rgb(0 0 0 / 34%);
}

.league-postseason-verdict-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 3px double rgb(107 72 50 / 58%);
}

.league-postseason-verdict-card .live-kicker {
  color: #8a4d2c;
}

.league-postseason-verdict-card h2 {
  margin: 0.35rem 0 0;
  color: #302119;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 9vw, 3rem);
  line-height: 0.98;
}

.league-postseason-verdict-stamp {
  padding: 0.35rem 0.48rem 0.28rem;
  color: #873d24;
  border: 2px solid currentColor;
  font: 800 0.62rem/1 "Courier New", monospace;
  letter-spacing: 0.13em;
  transform: rotate(-2deg);
}

.league-postseason-verdict.is-qualified .league-postseason-verdict-stamp,
.league-postseason-verdict.is-playin .league-postseason-verdict-stamp {
  color: #15766e;
}

.league-postseason-verdict.is-eliminated .league-postseason-verdict-stamp {
  color: #a23928;
  transform: rotate(2deg);
}

.league-postseason-verdict-ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.35rem;
  border: 3px double rgb(107 72 50 / 55%);
  background: rgb(255 253 244 / 62%);
}

.league-postseason-verdict-ledger > div {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem;
  text-align: center;
}

.league-postseason-verdict-ledger > div + div {
  border-left: 1px solid rgb(107 72 50 / 42%);
}

.league-postseason-verdict-ledger strong {
  color: #39251a;
  font: 700 1.45rem/1 Georgia, "Times New Roman", serif;
}

.league-postseason-verdict-ledger span {
  color: #6d4e39;
  font-family: "Courier New", monospace;
  font-size: 0.61rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.league-postseason-verdict-copy {
  margin: 0.15rem 0 0;
  color: #4e3728;
  font-size: 1rem;
  line-height: 1.45;
}

.league-postseason-verdict-countdown {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.4rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgb(107 72 50 / 42%);
  color: #67422d;
  font-family: "Courier New", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.league-postseason-verdict-countdown strong {
  color: #4d2b18;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  line-height: 1;
}

.league-postseason-verdict-countdown span,
.league-postseason-verdict-countdown b {
  display: block;
}

.league-postseason-verdict-countdown b {
  margin-bottom: 0.14rem;
  color: #493020;
  font-size: 0.69rem;
}

.league-season-milestones {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  margin-top: 0.85rem;
  padding: 0.8rem;
  color: #4d3728;
  border: 3px double rgb(116 84 56 / 48%);
  background: repeating-linear-gradient(0deg, rgb(128 90 48 / 5%) 0 1px, transparent 1px 5px), rgb(255 249 232 / 78%);
}

.league-season-milestones-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.league-season-milestones-copy span,
.league-season-milestones-copy small {
  font: 700 0.58rem/1.3 "Courier New", monospace;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.league-season-milestones-copy span { color: #9a4c2a; }
.league-season-milestones-copy strong { font: 700 1rem/1.1 Georgia, "Times New Roman", serif; }
.league-season-milestones-copy small { color: #81664e; }

.league-season-milestones-track {
  display: flex;
  gap: 0.28rem;
}

.league-season-milestones-track span {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  color: #816b58;
  border: 1px solid rgb(116 84 56 / 38%);
  border-radius: 50%;
  background: #fffaf0;
}

.league-season-milestones-track b { font: 700 0.65rem/1 Georgia, serif; }
.league-season-milestones-track small { font: 700 0.42rem/1 "Courier New", monospace; }
.league-season-milestones-track .is-filed { color: #fff8e9; border-color: #267f76; background: #267f76; }
.league-season-milestones-track .is-next { color: #9a4926; border: 2px solid #b65c32; }

.league-final-banner-shell.bl-loading-backdrop { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; margin: 0; width: 100%; max-width: none; border: 0; padding: 20px; background: rgb(32 24 17 / 58%); backdrop-filter: blur(3px); }
.league-final-edition.bl-live-panel { max-height: calc(100dvh - 40px); overflow-y: auto; border-radius: 8px; width: min(100%, 34rem); }
.league-postseason-verdict-card.bl-live-panel { max-height: calc(100dvh - 40px); overflow-y: auto; border-radius: 8px; }
.league-final-edition > header .league-final-edition-number { display: none; }
.league-final-edition.bl-live-panel > header { grid-template-columns: minmax(0, 1fr); }
.league-final-edition-actions .primary-action { width: 100%; }
.league-postseason-verdict-ledger strong,.league-postseason-verdict-ledger span { display: block; }
.league-final-edition-user span { text-transform: none; }
.league-postseason-verdict-card h2 { font-size: clamp(2rem, 8vw, 2.8rem); }

.league-final-edition {
  width: min(100%, 43rem);
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 1.7rem);
  color: #332218;
  border: 4px double #68452f;
  background: repeating-linear-gradient(0deg, rgb(124 87 49 / 6%) 0 1px, transparent 1px 6px), #fff8e7;
  box-shadow: 5px 6px 0 rgb(45 29 18 / 22%), inset 0 0 0 2px #fffdf5;
}

.league-final-edition > header {
  display: grid;
  grid-template-columns: 3.2rem 1fr 3.2rem;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.8rem;
  border-bottom: 4px double #67442e;
  text-align: center;
}

.league-final-edition > header div { display: grid; gap: 0.2rem; }
.league-final-edition > header small { font: 700 0.63rem/1.2 "Courier New", monospace; letter-spacing: 0.14em; text-transform: uppercase; }
.league-final-edition > header strong { font: 700 clamp(1rem, 4vw, 1.35rem)/1.05 Georgia, serif; }
.league-final-edition-number { display: grid; place-items: center; aspect-ratio: 1; border: 2px solid #9b4e2b; border-radius: 50%; color: #9b4e2b; font: 800 0.62rem/1 "Courier New", monospace; }
.league-final-edition-kicker { margin: 1rem 0 0.25rem; color: #a1512c; font: 700 0.68rem/1.2 "Courier New", monospace; letter-spacing: 0.15em; text-align: center; text-transform: uppercase; }
.league-final-edition h2 { margin: 0; font: 700 clamp(2.15rem, 10vw, 4.15rem)/0.92 Georgia, "Times New Roman", serif; letter-spacing: -0.045em; text-align: center; }
.league-final-edition-champion { display: grid; gap: 0.25rem; margin: 1.25rem 0 0.8rem; padding: 1.1rem; border-block: 4px double #b38631; color: #49300f; background: linear-gradient(90deg, transparent, rgb(211 166 69 / 24%), transparent); text-align: center; }
.league-final-edition-champion small,.league-final-edition-user small { font: 700 0.62rem/1.2 "Courier New", monospace; letter-spacing: 0.14em; text-transform: uppercase; }
.league-final-edition-champion strong { font: 700 clamp(1.7rem, 7vw, 2.7rem)/1 Georgia, serif; }
.league-final-edition-champion span,.league-final-edition-user span { color: #735b45; font: 700 0.72rem/1.35 "Courier New", monospace; text-transform: uppercase; }
.league-final-edition-user { display: grid; grid-template-columns: 3.3rem 1fr; gap: 0.8rem; align-items: center; padding: 0.85rem 0; border-bottom: 1px solid rgb(104 69 47 / 42%); }
.league-final-edition-user > div:last-child { display: grid; gap: 0.18rem; min-width: 0; }
.league-final-edition-user strong { font: 700 1.2rem/1.15 Georgia, serif; overflow-wrap: anywhere; }
.league-final-edition-monogram { display: grid; place-items: center; aspect-ratio: 1; border: 3px double #8f4a2a; border-radius: 50%; color: #8f4a2a; font: 800 0.85rem/1 "Courier New", monospace; }
.league-final-edition-deck { margin: 0.9rem auto 1rem; max-width: 42ch; color: #5c4636; font: 400 0.82rem/1.5 "Courier New", monospace; text-align: center; }
.league-final-edition-actions { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 0.65rem; }
.league-final-edition-actions button { min-width: 0; }

.league-review-masthead { display: grid; gap: 0.25rem; margin-bottom: 1rem; padding: 0.9rem; border-block: 4px double #765139; text-align: center; }
.league-review-masthead span { color: #9b4e2b; font: 700 0.66rem/1 "Courier New", monospace; letter-spacing: 0.16em; text-transform: uppercase; }
.league-review-masthead strong { font: 700 clamp(1.5rem, 6vw, 2.4rem)/1 Georgia, serif; }
.league-season-review .post-season { border-radius: 0; border: 3px double rgb(104 70 47 / 58%); background: repeating-linear-gradient(0deg, rgb(124 87 49 / 5%) 0 1px, transparent 1px 6px), #fff9eb; }
.league-lineup-archive { margin-top: 1rem; border: 3px double rgb(104 70 47 / 58%); background: #fff9eb; }
.league-lineup-archive summary { padding: 1rem; color: #713d26; cursor: pointer; font: 700 0.78rem/1 "Courier New", monospace; letter-spacing: 0.13em; text-align: center; text-transform: uppercase; }
.league-lineup-archive[open] summary { border-bottom: 1px solid rgb(104 70 47 / 38%); }
.league-review-exit { width: 100%; margin-top: 1rem; }

/* Small, engraved identity marks for the shared public-league desk. They
   inherit the file's ink, so night mode and the user-team highlight need no
   second visual language. */
.d5-team-type-mark {
  display: inline-block;
  width: 0.82em;
  height: 0.82em;
  margin-right: 0.3em;
  vertical-align: -0.08em;
  opacity: 0.8;
  stroke: currentColor;
}

.bl-live-standings-table .d5-team-type-mark {
  width: 0.68em;
  height: 0.68em;
  margin-right: 0.22em;
}

@media (max-width: 520px) {
  .league-identity-sheet {
    padding: 1rem;
  }

  .league-identity-colors .live-small-button {
    min-height: 2.45rem;
  }

  .league-season-milestones { grid-template-columns: 1fr; }
  .league-season-milestones-track { justify-content: space-between; }
  .league-final-edition-actions { grid-template-columns: 1fr; }

  .league-season-review .post-season-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .league-season-review .post-season-back {
    position: static;
    width: 100%;
  }

  .league-season-review .post-season-table {
    display: grid;
    gap: 0.35rem;
    overflow: visible;
  }

  .league-season-review .post-season-row.header { display: none; }

  .league-season-review .post-season-row:not(.header) {
    display: grid;
    grid-template-columns: 1.35rem minmax(0, 1fr) auto;
    grid-template-rows: repeat(2, auto);
    gap: 0.12rem 0.5rem;
    min-width: 0;
    padding: 0.52rem 0.45rem;
    border: 1px solid rgb(104 70 47 / 24%);
  }

  .league-season-review .post-season-row:not(.header) > strong:first-child {
    grid-area: 1 / 1 / span 2 / 2;
    align-self: center;
  }

  .league-season-review .post-season-row:not(.header) > span:nth-child(2) {
    grid-area: 1 / 2;
    min-width: 0;
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .league-season-review .post-season-row:not(.header) > span:nth-child(3) {
    grid-area: 2 / 2;
    color: #876c54;
    font-size: 0.58rem;
    text-transform: uppercase;
  }

  .league-season-review .post-season-row:not(.header) > span:nth-child(4) { grid-area: 1 / 3; font-weight: 700; }
  .league-season-review .post-season-row:not(.header) > span:nth-child(5) { grid-area: 2 / 3; color: #876c54; font-size: 0.62rem; }
  .league-season-review .post-season-row:not(.header) > span:nth-child(6) { grid-area: 1 / 3; transform: translateY(-0.05rem); }
  .league-season-review .post-season-row:not(.header):has(> span:nth-child(6)) > span:nth-child(4) { grid-area: 2 / 2; justify-self: end; }
  .league-season-review .post-season-row:not(.header):has(> span:nth-child(6)) > span:nth-child(5) { display: none; }
}
