/* lan_tournament: participant views of the group phase, the playoff wait state and the playoffs */

/* Only --lt-* tokens: a site that re-points them (and its dark edition)
   re-skins everything here. The few draft colours without a --lt-* twin
   (soft ink, green, the hard shadow) read the site token and fall back to
   a --lt-* one, so a site without them keeps a plain look. */

.lt-phase {
  display: inline-flex;
  margin: 0 0 24px;
  line-height: normal;
  border: 1.5px solid var(--lt-text);
  border-radius: var(--lt-radius-sm);
  overflow: hidden;
}

.lt-phase__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  background: var(--lt-card);
  color: var(--lt-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.lt-phase__link.is-on {
  background: var(--lt-text);
  color: var(--lt-card);
}

.lt-phase__link:focus-visible,
.lt-gcard__scroll:focus-visible,
.lt-ml a:focus-visible {
  outline: 2px solid var(--lt-brand-blue);
  outline-offset: 2px;
}

.lt-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem 14px;
  margin: 0 0 28px;
  font-size: 19px;
  font-weight: 400;
  line-height: normal;
}

.lt-chain__label {
  color: var(--inkSoft, var(--lt-muted));
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.lt-gcards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 28px;
  margin-bottom: 1.5rem;
}

.lt-gcard {
  min-width: 0;
  border: 1.5px solid var(--lt-text);
  background: var(--lt-card);
  box-shadow: 4px 4px 0 var(--ink, transparent);
  line-height: normal;
}

.lt-gcard__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem 12px;
  padding: 14px 18px;
  border-bottom: 1.5px solid var(--lt-text);
  background: var(--lt-bg);
}

.lt-gcard.is-tie .lt-gcard__head {
  border-bottom-color: var(--lt-brand-warning);
}

.lt-gcard__head b {
  margin-right: auto;
  font-size: 28px;
  line-height: 1;
}

.lt-gcard__scroll.table-scroll-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

.lt-tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--lt-line-strong);
  border-radius: var(--lt-radius-sm);
  color: var(--lt-text);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.lt-gcard__head .lt-tag {
  padding: 5px 10px;
  border-width: 1.5px;
  font-size: 11px;
  letter-spacing: .2em;
}

.lt-tag--ok {
  border-color: currentcolor;
  color: var(--green, var(--lt-brand-success));
}

.lt-tag--warn {
  border-color: var(--lt-brand-warning);
}

.lt-tag--orga {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 4px;
  border-color: var(--lt-text);
  background: var(--lt-text);
  color: var(--lt-bg);
  white-space: normal;
}

.lt-st {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: lining-nums tabular-nums;
}

/* Fixed columns keep the numbers on one grid across the group cards. */
.lt-st:not(.lt-st--board) {
  min-width: 560px;
  table-layout: fixed;
}

.lt-st col.lt-col-rk {
  width: 40px;
}

.lt-st col.lt-col-s {
  width: 36px;
}

.lt-st col.lt-col-d {
  width: 52px;
}

.lt-st col.lt-col-p {
  width: 44px;
}

.lt-st col.lt-col-st {
  width: 118px;
}

.lt-st th,
.lt-st td {
  padding: 14px 4px;
  border-bottom: 1px dotted var(--inkMute, var(--lt-muted));
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.lt-st th:first-child,
.lt-st td:first-child {
  padding-left: 18px;
  text-align: left;
}

.lt-st th:last-child,
.lt-st td:last-child {
  padding-right: 18px;
}

.lt-st .c-nm,
.lt-st .c-st {
  text-align: left;
}

/* The tie label is longer than the draft's 118 px column. */
.lt-st td.c-st {
  white-space: normal;
}

.lt-st tbody .c-st {
  font-size: 10.5px;
}

.lt-st tbody tr:last-child th,
.lt-st tbody tr:last-child td {
  border-bottom: 0;
}

.lt-st thead th {
  padding-top: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--lt-text);
  color: var(--inkSoft, var(--lt-muted));
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.lt-st tbody th,
.lt-st tbody td {
  font-size: 21px;
  font-weight: 400;
}

.lt-st tbody .c-nm {
  overflow: hidden;
  font-size: 22px;
  text-overflow: ellipsis;
}

.lt-st tbody .c-pk {
  font-size: 22px;
  font-weight: 900;
}

.lt-st .c-pk b {
  font-size: inherit;
  font-weight: inherit;
}

.lt-st .c-rk {
  width: 40px;
}

.lt-st tbody .c-rk {
  font-size: 13px;
  font-weight: 700;
}

.lt-st--board .c-n,
.lt-st--board .c-pk {
  text-align: right;
}

.lt-st tr.is-tie td,
.lt-st tr.is-tie th {
  background: color-mix(in srgb, var(--lt-brand-warning) 12%, transparent);
}

/* The line is the top rule of its label row, which sits beneath it. */
.lt-st tr.lt-cut td {
  padding: 4px 18px 2px;
  border-top: 2.5px solid var(--lt-text);
  border-bottom: 0;
  color: var(--inkSoft, var(--lt-muted));
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-align: left;
  text-transform: uppercase;
}

.lt-st tr.lt-cut span {
  position: sticky;
  left: 18px;
  display: inline-block;
}

.lt-stw {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.lt-stw.is-qualified {
  color: var(--green, var(--lt-brand-success));
}

.lt-stw.is-out {
  color: var(--inkMute, var(--lt-muted));
}

.lt-stw.is-tie {
  color: color-mix(in srgb, var(--lt-brand-warning) 60%, var(--lt-text));
}

.lt-stw.is-tie::before {
  content: "= ";
}

.lt-stw.is-open {
  color: var(--lt-brand-blue);
}

.lt-by {
  display: block;
  margin-top: 2px;
  color: var(--lt-muted);
  font-size: .85rem;
  font-style: italic;
}

.lt-wait {
  margin: 0 0 1.25rem;
  padding: 1.1rem 1.25rem 1.25rem;
  border: 1.5px solid var(--lt-line-strong);
  border-radius: var(--lt-radius-sm);
  background: var(--lt-card);
}

.lt-wait__label {
  margin: 0 0 .25rem;
  color: var(--lt-muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.lt-wait h3 {
  margin: 0 0 .4rem;
  font-size: 1.6rem;
  line-height: 1.1;
}

.lt-wait__reason {
  margin: 0;
  color: var(--lt-muted);
  font-size: 1.1rem;
  font-style: italic;
}

.lt-sh {
  margin: 1.75rem 0 .75rem;
}

.lt-lobbies {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.lt-lobby {
  min-width: 0;
}

.lt-lobby__head {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .6rem;
  align-items: baseline;
  margin-bottom: .6rem;
  padding-bottom: .4rem;
  border-bottom: 1.5px solid var(--lt-line-strong);
  color: var(--lt-muted);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.lt-lobby__head b {
  color: var(--lt-text);
  font-size: 1.2rem;
  letter-spacing: 0;
  text-transform: none;
}

.lt-lobby__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lt-lobby__list li {
  padding: .45rem 0;
  border-bottom: 1px dotted var(--lt-line);
  overflow-wrap: anywhere;
}

.lt-ml {
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.lt-ml li {
  border-bottom: 1px dotted var(--lt-line);
}

.lt-ml a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .15rem .75rem;
  padding: .65rem 0;
  color: var(--lt-text);
  text-decoration: none;
}

.lt-ml__label {
  grid-column: 1 / -1;
  color: var(--lt-muted);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.lt-ml__status {
  color: var(--lt-muted);
}

/* Where the playoff bracket came from: drawn from the bracket JSON `origin`. */
.lt-team-text[data-origin]::before {
  content: attr(data-origin);
  display: inline-block;
  margin-right: .35em;
  padding: 0 4px;
  border: 1px solid var(--lt-text);
  background: var(--lt-text);
  color: var(--lt-bg);
  font-size: .75em;
  font-weight: 700;
  line-height: 1.4;
}

.lt-origin-legend {
  margin: 0 0 .75rem;
  font-size: .85rem;
}

@media (max-width: 900px) {
  .lt-gcards {
    grid-template-columns: minmax(0, 1fr);
  }

  .lt-lobbies {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .lt-lobbies {
    grid-template-columns: minmax(0, 1fr);
  }

  .lt-st:not(.lt-st--board) .c-rk {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 40px;
    min-width: 40px;
    background: var(--lt-card);
  }

  .lt-st:not(.lt-st--board) .c-nm {
    position: sticky;
    left: 40px;
    z-index: 2;
    max-width: 118px;
    overflow: hidden;
    background: var(--lt-card);
    text-overflow: ellipsis;
  }

  .lt-st:not(.lt-st--board) .c-pk {
    position: sticky;
    right: 118px;
    z-index: 2;
    min-width: 40px;
    background: var(--lt-card);
  }

  .lt-st .c-st {
    position: sticky;
    right: 0;
    z-index: 2;
    width: 118px;
    min-width: 118px;
    max-width: 118px;
    background: var(--lt-card);
    white-space: normal;
  }

  .lt-st tr.is-tie td,
  .lt-st tr.is-tie th,
  .lt-st:not(.lt-st--board) tr.is-tie .c-rk,
  .lt-st:not(.lt-st--board) tr.is-tie .c-nm,
  .lt-st:not(.lt-st--board) tr.is-tie .c-pk {
    background: color-mix(in srgb, var(--lt-brand-warning) 12%, var(--lt-card));
  }
}

@media (prefers-reduced-motion: reduce) {
  .lt-phase__link {
    transition: none;
  }
}
