/* Table tennis draw table — extras on theme.css */

.tt-body .brand-logo--svg {
  font-size: 1.6rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

.tt-format-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.85rem 0 0.35rem;
}

.tt-format-row .select {
  min-width: 14rem;
}

.tt-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.5rem 0 0.75rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: #fff;
}

.tt-draw-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.tt-draw-table th,
.tt-draw-table td {
  border: 1px solid var(--border, #e2e8f0);
  padding: 0.2rem;
  text-align: center;
  vertical-align: middle;
}

.tt-draw-table thead th {
  background: #ecfdf5;
  font-size: 0.75rem;
  font-weight: 700;
  color: #166534;
  padding: 0.45rem 0.35rem;
}

.tt-th-name,
.tt-name {
  text-align: left !important;
  min-width: 8.5rem;
  max-width: 12rem;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
  background: #fff1f2;
  color: #9f1239;
  font-weight: 700;
}

.tt-th-num,
.tt-num {
  width: 2.2rem;
  background: #fff1f2;
  color: #9f1239;
  font-weight: 700;
}

.tt-th-opp {
  min-width: 3.4rem;
  width: 3.4rem;
}

.tt-th-sum {
  min-width: 2.6rem;
  background: #fef3c7 !important;
  color: #92400e !important;
}

.tt-dash {
  background:
    repeating-linear-gradient(
      -45deg,
      #cbd5e1,
      #cbd5e1 2px,
      #94a3b8 2px,
      #94a3b8 4px
    );
  min-width: 3.4rem;
}

.tt-cell {
  position: relative;
  min-width: 3.4rem;
  height: 3.1rem;
  padding: 0 !important;
  background: #fff;
}

.tt-cell__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  width: 100%;
  height: 100%;
  min-height: 3.1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.2rem 0.15rem;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.tt-cell__score {
  font-weight: 700;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  min-height: 1em;
}

.tt-cell__mp {
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

body.tt-picker-open {
  overflow: hidden;
}

.poule-picker-btn--clear {
  width: 100%;
  margin-top: 0.35rem;
  background: #fff1f2;
  color: #9f1239;
  border-color: #fecdd3;
}

.tt-cell--win {
  background: #f0fdf4;
  color: #166534;
}

.tt-cell--loss {
  background: #fff1f2;
  color: #b91c1c;
}

.tt-cell--loss .tt-cell__mp,
.tt-cell--loss input.cell {
  color: #b91c1c;
}

.tt-cell--empty {
  background: #fff;
}

.tt-sum {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  background: #fffbeb;
  min-width: 2.6rem;
  padding: 0.35rem !important;
}

.tt-sum--pts {
  font-weight: 800;
}

.tt-sum--place {
  background: #fee2e2;
  font-weight: 800;
}

.standings-lot-note {
  color: #b45309;
}

.standings-lot-note.hidden {
  display: none;
}

.tt-cell--focus {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  z-index: 1;
}

.tt-order-block {
  margin: 1rem 0 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: #f8fafc;
}

.tt-order-block__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
}

.tt-order {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.tt-order__round {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.tt-order__label {
  flex: 0 0 auto;
  min-width: 3.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
}

.tt-order__pairs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tt-order__pair {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  line-height: 1.2;
}

.tt-order__pair:hover,
.tt-order__pair:focus-visible {
  border-color: #2563eb;
  color: #1d4ed8;
  outline: none;
}

.tt-order__pair--done {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

@media (max-width: 720px) {
  .tt-draw-table {
    font-size: 0.8rem;
  }
  .tt-th-name,
  .tt-name {
    min-width: 6.5rem;
    max-width: 8.5rem;
  }
  .tt-cell {
    min-width: 3rem;
    height: 2.85rem;
  }
}
