/* TCMH Sofascore — nút lịch + khung lịch thả xuống, và sidebar giải chia nhóm.
   Tách file riêng để không phải sửa tcmh-sofascore.css; biến màu kế thừa từ
   .tcmh-sofa nên tự khớp cả theme sáng lẫn tối. */

/* ---------- hàng dải ngày + nút lịch ---------- */

.tcmh-daybar {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.tcmh-daybar .tcmh-dates {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.tcmh-calbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: var(--tc-r-md);
  background: var(--tc-surface);
  color: var(--tc-ink-2);
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--tc-shadow-sm);
}

.tcmh-calbtn:hover { color: var(--tc-ink); }
.tcmh-calbtn.is-on { background: var(--tc-brand); color: #fff; }
.tcmh-calbtn svg { width: 17px; height: 17px; flex: 0 0 auto; }

@media (max-width: 560px) {
  .tcmh-calbtn span { display: none; }
  .tcmh-calbtn { padding: 9px 10px; }
}

/* ---------- lịch thả xuống ---------- */

/* Ô ngày là <button> nên hay dính padding/line-height của theme; không reset thì
   ô phình cao và lưới 7 cột tràn ra ngoài khung. */
.tcmh-cal,
.tcmh-cal * { box-sizing: border-box; }

.tcmh-cal button {
  margin: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font: inherit;
  line-height: 1;
  text-transform: none;
  color: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.tcmh-cal {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 50;
  width: 300px;
  margin-top: 6px;
  padding: 12px;
  border-radius: var(--tc-r-md);
  background: var(--tc-surface);
  box-shadow: var(--tc-shadow);
}

.tcmh-cal[hidden] { display: none; }

/* Màn hẹp: trải hết chiều ngang khối cho dễ bấm */
@media (max-width: 560px) {
  .tcmh-cal {
    left: 0;
    right: 0;
    width: auto;
  }
}

.tcmh-cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.tcmh-cal__month {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--tc-ink);
}

.tcmh-cal__arrow {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--tc-surface-2);
  color: var(--tc-ink-2);
  font-size: 16px;
}

.tcmh-cal__arrow:disabled { opacity: .3; cursor: default; }

.tcmh-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.tcmh-cal__dow {
  padding: 3px 0;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--tc-muted);
}

/* Chiều cao cố định thay cho aspect-ratio — aspect-ratio ăn theo chiều cao thật
   của button nên theme thêm padding là vỡ lưới. */
.tcmh-cal__day {
  position: relative;
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--tc-surface-2);
  font-size: 12px;
  font-weight: 700;
  color: var(--tc-ink);
}

.tcmh-cal__day--empty { background: none; }

/* Ngày không có dữ liệu: mờ, không bấm được */
.tcmh-cal__day:disabled {
  background: none;
  color: var(--tc-muted);
  opacity: .4;
  cursor: default;
}

.tcmh-cal__day:not(:disabled):hover { background: var(--tc-brand-soft); }
.tcmh-cal__day.is-today { box-shadow: inset 0 0 0 1.5px var(--tc-brand); }
.tcmh-cal__day.is-active { background: var(--tc-brand); color: #fff; }

.tcmh-cal__dot {
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--tc-brand-2);
}

.tcmh-cal__day.is-active .tcmh-cal__dot { background: #fff; }
.tcmh-cal__day.has-live .tcmh-cal__dot { background: var(--tc-live); }
.tcmh-cal__day.is-vn .tcmh-cal__dot { background: var(--tc-win); }

.tcmh-cal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--tc-line);
  font-size: 11px;
  color: var(--tc-muted);
}

.tcmh-cal__today {
  flex: 0 0 auto;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--tc-brand-soft);
  color: var(--tc-ink);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- sidebar giải đấu chia nhóm ---------- */

.tcmh-lgsec { margin-bottom: 14px; }
.tcmh-lgsec:last-child { margin-bottom: 0; }

.tcmh-lgsec__head,
.tcmh-lgsec__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 8px;
  text-align: left;
}

.tcmh-lgsec__title {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--tc-ink-2);
}

.tcmh-lgsec__count {
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--tc-brand-soft);
  color: var(--tc-ink-2);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.tcmh-lgsec--vn .tcmh-lgsec__title { color: var(--tc-live); }
.tcmh-lgsec--vn .tcmh-lgsec__count { background: var(--tc-live); color: #fff; }

.tcmh-lgsec__caret {
  margin-left: auto;
  width: 14px;
  height: 14px;
  color: var(--tc-muted);
  transition: transform .18s ease;
}

.tcmh-lgsec.is-collapsed .tcmh-lgsec__caret { transform: rotate(-90deg); }
.tcmh-lgsec.is-collapsed .tcmh-lglist { display: none; }

/* Giải có trong danh mục nhưng kỳ này chưa có trận — vẫn hiện để giữ link SEO */
.tcmh-lg.is-empty { opacity: .62; }
.tcmh-lg.is-empty .tcmh-lg__count { background: none; color: var(--tc-muted); }