/* Handkast Tournament Matches – scoped to .hk-matches and .hk-next-matches */
.hk-matches,
.hk-next-matches {
  --hk-bg: #ffffff;
  --hk-muted: #8e929a;
  --hk-text: #25272d;
  --hk-accent: #344cff;
  --hk-accent-light: rgba(52, 76, 255, .08);
  --hk-border: #e1e4eb;
  --hk-border-light: #f0f2f7;
  --hk-radius: 16px;
  --hk-shadow: 0 8px 22px rgba(22, 31, 55, .08);
  --hk-tag-bg: #eef1f8;
  --hk-tag-text: #48526a;

  max-width: 100%;
  margin: 12px auto;
  padding: 16px;
  color: var(--hk-text);
  background: var(--hk-bg);
  border: 1px solid var(--hk-border);
  border-radius: var(--hk-radius);
  box-shadow: var(--hk-shadow);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  box-sizing: border-box;
}

.hk-matches *,
.hk-matches *::before,
.hk-matches *::after,
.hk-next-matches *,
.hk-next-matches *::before,
.hk-next-matches *::after {
  box-sizing: border-box;
}

.hk-matches-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 2px 10px;
  border-bottom: 2px solid #e5e8f0;
}

.hk-matches-title {
  display: flex;
  align-items: center;
  min-height: 32px;
  margin: 0;
  padding: 0;
  color: var(--hk-text);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  line-height: 1.2;
}

.hk-matches-title::before {
  content: '';
  flex: 0 0 4px;
  width: 4px;
  height: 18px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--hk-accent);
}

.hk-matches-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.hk-matches-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hk-matches-picker label {
  margin: 0;
  padding: 0;
  color: var(--hk-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  line-height: 1;
}

.hk-matches-select {
  max-width: 100%;
  min-height: 38px;
  padding: 6px 12px;
  margin: 0;
  color: var(--hk-text);
  background: #f7f8fb;
  border: 1px solid #dfe3ea;
  border-radius: 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.4;
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.hk-matches-select:focus-visible {
  outline: 2px solid var(--hk-accent);
  outline-offset: 2px;
}

.hk-matches-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e3e7ef;
  border-radius: 12px;
  background: #ffffff;
}

.hk-matches-table {
  width: 100% !important;
  min-width: 680px;
  margin: 0 !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  border: none !important;
  background: #ffffff !important;
  font-size: 13.5px;
  line-height: 1.35;
}

.hk-matches-table thead {
  background: #f7f8fb;
  border: none !important;
}

.hk-matches-table th,
.hk-matches-table td {
  padding: 8px 10px !important;
  color: #3b3f48;
  line-height: 1.35 !important;
  text-align: left;
  vertical-align: middle !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
}

.hk-matches-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--hk-muted) !important;
  background: #f7f8fb !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: 2px solid #e3e7ef !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: .04em !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  vertical-align: middle !important;
  height: 38px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.hk-matches-table tbody {
  border: none !important;
}

.hk-matches-table tbody tr {
  background: #ffffff;
  border: none !important;
  transition: background-color .12s ease;
}

.hk-matches-table tbody tr:not(:last-child) td {
  border-bottom: 1px solid #eef1f6 !important;
}

.hk-matches-table tbody tr:last-child td {
  border-bottom: none !important;
}

.hk-matches-table tbody tr:hover td {
  background: #f7f9ff !important;
}

.hk-matches-table tr.is-highlight td {
  background: rgba(52, 76, 255, .06) !important;
}

.hk-matches-table tr.is-highlight:hover td {
  background: rgba(52, 76, 255, .11) !important;
}

.hk-matches-table tr.is-highlight td:first-child {
  box-shadow: inset 3px 0 0 var(--hk-accent);
}

/* Columns */
.hk-matches-table th:first-child,
.hk-matches-table th.hk-matches-th-date,
.hk-matches-table td:first-child,
.hk-matches-table td.hk-matches-col-date {
  width: 58px !important;
  min-width: 58px !important;
  padding-left: 14px !important;
  padding-right: 4px !important;
  text-align: left !important;
}

.hk-matches-col-date {
  white-space: nowrap !important;
  line-height: 1.15 !important;
  vertical-align: middle !important;
}

.hk-matches-col-date .hk-match-weekday {
  display: block !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  color: var(--hk-muted) !important;
  text-transform: uppercase !important;
  line-height: 1.1 !important;
  margin: 0 0 2px 0 !important;
  letter-spacing: .03em !important;
}

.hk-matches-col-date .hk-match-date-num,
.hk-matches-col-date span:not(.hk-match-weekday) {
  display: block !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #2b303b !important;
  line-height: 1.15 !important;
  letter-spacing: -.01em !important;
  margin: 0 !important;
}

.hk-matches-table th:nth-child(2),
.hk-matches-table th.hk-matches-th-time,
.hk-matches-table td:nth-child(2),
.hk-matches-table td.hk-matches-col-time {
  width: 52px !important;
  min-width: 52px !important;
  padding-left: 4px !important;
  padding-right: 12px !important;
}

.hk-matches-col-time {
  white-space: nowrap !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #1a1d24 !important;
  line-height: 1.2 !important;
}

.hk-matches-col-tour {
  min-width: 120px;
}

.hk-matches-tour-badge {
  display: inline-block;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--hk-tag-text);
  background: var(--hk-tag-bg);
  border-radius: 6px;
  white-space: nowrap;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  line-height: 1.3;
}

.hk-matches-round-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: #61697d;
  background: #f1f3f7;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1.3;
}

.hk-matches-col-venue,
.hk-matches-table th.hk-matches-th-venue,
.hk-matches-table th:nth-child(5),
.hk-matches-table td.hk-matches-col-venue,
.hk-matches-table td:nth-child(5) {
  font-size: 12.5px;
  line-height: 1.3;
  color: #555b68;
  max-width: 170px;
  padding-left: 14px !important;
  white-space: normal;
  word-wrap: break-word;
}

.hk-matches-col-teams,
.hk-matches-table th.hk-matches-th-teams,
.hk-matches-table th:nth-child(4),
.hk-matches-table td.hk-matches-col-teams,
.hk-matches-table td:nth-child(4) {
  min-width: 270px;
  padding-right: 6px !important;
}

.hk-matches-table th.hk-matches-th-teams,
.hk-matches-table th:nth-child(4) {
  text-align: center !important;
}

.hk-match-teams-box {
  display: flex !important;
  align-items: center !important;
  gap: 8px;
  width: 100%;
}

.hk-match-team {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px;
  font-weight: 650;
  color: #1f232b;
  flex: 1 1 0;
  min-width: 0;
  width: 50%;
  line-height: 1.2;
}

.hk-match-team.is-home {
  justify-content: flex-end !important;
  text-align: right;
}

.hk-match-team.is-away {
  justify-content: flex-start !important;
  text-align: left;
}

.hk-match-team.is-team-highlight {
  color: var(--hk-accent) !important;
  font-weight: 750;
}

.hk-match-team-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hk-match-team-logo {
  flex: 0 0 24px !important;
  width: 24px !important;
  height: 24px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
}

.hk-match-team-logo img {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.hk-match-vs {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  color: var(--hk-muted);
  text-transform: uppercase;
  padding: 0 2px;
}

.hk-matches-col-score {
  text-align: center !important;
  white-space: nowrap;
  width: 90px;
  min-width: 80px;
}

.hk-matches-table th:last-child,
.hk-matches-table td:last-child {
  text-align: center !important;
  padding-right: 12px !important;
}

.hk-match-score-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  min-width: 58px;
  background: #f4f6fa;
  border: 1px solid #e1e5ee;
  border-radius: 8px;
  font-weight: 800;
  font-size: 13.5px;
  color: #16181f;
  letter-spacing: .02em;
}

.hk-match-score-badge.is-final {
  background: #eef3ff;
  border-color: #d1dcff;
  color: var(--hk-accent);
}

.hk-match-score-halftime {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--hk-muted);
  line-height: 1;
  margin-top: 2px;
}

.hk-match-status-postponed {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #b3261e;
  background: #fdeee9;
  border: 1px solid #f8c9bd;
  border-radius: 6px;
}

.hk-match-status-upcoming {
  font-size: 13px;
  font-weight: 600;
  color: var(--hk-muted);
}

.hk-matches-message {
  padding: 20px 14px;
  color: var(--hk-muted);
  text-align: center;
  font-size: 14px;
}

.hk-matches-message.is-error {
  color: #b3261e;
  background: #fff5f5;
  border-radius: 8px;
}

/* Date separator in table if matches are grouped */
.hk-matches-date-row td {
  background: #f4f6fa !important;
  font-weight: 700;
  font-size: 11.5px;
  color: #525a6b;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 6px 12px !important;
}
  border-bottom: 1px solid #e2e6ef;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .hk-next-matches {
    padding: 12px;
    border-radius: 12px;
  }

  .hk-matches-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .hk-matches-picker {
    width: 100%;
    margin-left: 0;
  }

  .hk-matches-select {
    flex: 1;
  }

  .hk-matches-table th,
  .hk-matches-table td {
    padding: 7px 8px;
  }
}
