/* ==========================================================================
   Kegeln Standings Table
   ========================================================================== */

.kegeln-tabelle-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
}

.kegeln-tabelle {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--body-font);
  font-size: 0.95rem;
  line-height: 1.4;
}

/* ---- Header ---- */

.kegeln-tabelle thead th {
  background-color: var(--primary-color);
  color: #fff;
  font-family: var(--heading-font);
  font-weight: 500;
  padding: 0.65rem 0.8rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 3px solid var(--secondary-color);
}

.kegeln-tabelle thead th.kegeln-col-num {
  text-align: right;
}

.kegeln-tabelle thead th.kegeln-col-platz {
  text-align: center;
  width: 2.5rem;
}

/* ---- Body ---- */

.kegeln-tabelle tbody td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid #e8e8e8;
  vertical-align: middle;
}

.kegeln-tabelle tbody tr:nth-child(even) {
  background-color: var(--light-bg);
}

.kegeln-tabelle tbody tr:hover {
  background-color: #e3ecf5;
}

.kegeln-col-platz {
  text-align: center;
  font-weight: 600;
  color: var(--primary-color);
}

.kegeln-col-team {
  font-weight: 500;
  white-space: nowrap;
}

.kegeln-col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---- Highlight row ---- */

.kegeln-highlight {
  background-color: var(--secondary-color) !important;
  font-weight: 700;
}

.kegeln-highlight .kegeln-col-platz {
  color: var(--dark-bg);
}

.kegeln-highlight:hover {
  background-color: #e6be00 !important;
}

/* ---- Source link ---- */

.kegeln-source {
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.5rem;
  text-align: right;
}

.kegeln-source a {
  color: #888;
  text-decoration: underline;
}

.kegeln-source a:hover {
  color: var(--primary-color);
}

/* ---- Error ---- */

.kegeln-error {
  color: #c0392b;
  font-style: italic;
  padding: 1rem;
  background: #fdf0ef;
  border-left: 3px solid #c0392b;
  border-radius: 2px;
}

/* ==========================================================================
   Kegeln Ergebnisse (Match Results)
   ========================================================================== */

.kegeln-ergebnisse-wrapper {
  margin-bottom: 1.5rem;
}

.kegeln-col-sep {
  text-align: center;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
  font-weight: 600;
}

.kegeln-holz {
  font-weight: 600;
  min-width: 3rem;
}

.kegeln-col-date {
  font-size: 0.85rem;
  color: #666;
  white-space: nowrap;
}

.kegeln-col-ha {
  text-align: center;
  font-size: 0.85rem;
  color: #666;
}

.kegeln-col-result {
  width: 2rem;
  text-align: center;
  padding-left: 0.4rem;
  padding-right: 0.2rem;
}

/* ---- Win/Loss/Draw badges ---- */

.kegeln-badge {
  display: inline-block;
  width: 1.6rem;
  height: 1.6rem;
  line-height: 1.6rem;
  text-align: center;
  border-radius: 3px;
  font-weight: 700;
  font-size: 0.75rem;
  font-family: var(--heading-font);
  color: #fff;
}

.kegeln-badge.kegeln-result-win {
  background-color: #27ae60;
}

.kegeln-badge.kegeln-result-loss {
  background-color: #c0392b;
}

.kegeln-badge.kegeln-result-draw {
  background-color: #7f8c8d;
}

/* Subtle left border on result rows */

.kegeln-row.kegeln-result-win {
  border-left: 3px solid #27ae60;
}

.kegeln-row.kegeln-result-loss {
  border-left: 3px solid #c0392b;
}

.kegeln-row.kegeln-result-draw {
  border-left: 3px solid #7f8c8d;
}

/* ---- Responsive ---- */

@media screen and (max-width: 768px) {
  .kegeln-hide-mobile {
    display: none;
  }

  .kegeln-tabelle {
    font-size: 0.88rem;
  }

  .kegeln-tabelle thead th,
  .kegeln-tabelle tbody td {
    padding: 0.45rem 0.5rem;
  }

  .kegeln-col-team {
    white-space: normal;
    word-break: break-word;
  }
}
