.istatistikler-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center
}

.istatistikler-modal.active {
  display: flex
}

.istatistikler-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .85)
}

.istatistikler-content {
  position: relative;
  background: var(--card-bg);
  width: 96%;
  max-width: 1100px;
  max-height: 92vh;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-color)
}

.istatistikler-header {
  padding: 12px 16px;
  background: var(--secondary-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center
}

.istatistikler-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500
}

.istatistikler-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color .2s
}

.istatistikler-close:hover {
  color: var(--text-primary)
}

.istatistikler-tabs {
  display: flex;
  background: var(--primary-bg);
  padding: 8px;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
  min-height: 52px
}

.istatistikler-tabs::-webkit-scrollbar {
  height: 3px
}

.istatistikler-tabs::-webkit-scrollbar-thumb {
  background: var(--hover-bg);
  border-radius: 3px
}

.istatistik-tab {
  padding: 7px 16px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap
}

.istatistik-tab:hover {
  background: var(--secondary-bg);
  color: var(--text-primary);
  border-color: var(--border-color)
}

.istatistik-tab.active {
  background: #3b82f6;
  color: var(--text-primary);
  border-color: #3b82f6
}

.istatistikler-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: var(--primary-bg)
}

.istatistikler-body::-webkit-scrollbar {
  width: 6px
}

.istatistikler-body::-webkit-scrollbar-thumb {
  background: var(--hover-bg);
  border-radius: 3px
}

.istatistikler-loading,
.istatistikler-error,
.istatistikler-info {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px
}

.h2h-container {
  max-width: 100%
}

.h2h-sub-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  background: var(--secondary-bg);
  border-radius: 4px;
  padding: 2px;
  border: 1px solid var(--border-color)
}

.h2h-sub-tab {
  flex: 1;
  padding: 7px 12px;
  background: transparent;
  border: none;
  border-radius: 3px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s
}

.h2h-sub-tab:hover {
  color: var(--text-primary)
}

.h2h-sub-tab.active {
  background: #3b82f6;
  color: var(--text-primary)
}

.h2h-content {
  min-height: 300px
}

.h2h-matches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden
}

.h2h-team-headers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-bottom: 0;
  background: var(--border-color);
  grid-column: 1/-1
}

.h2h-team-header {
  padding: 10px 12px;
  background: var(--secondary-bg);
  text-align: center
}

.h2h-team-header h3 {
  margin: 0;
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px
}

.h2h-match {
  padding: 10px 12px;
  background: var(--card-bg);
  transition: background .2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px
}

.h2h-match:hover {
  background: var(--secondary-bg)
}

.match-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0
}

.match-date {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 60px
}

.match-teams {
  flex: 1;
  min-width: 0
}

.match-team {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4
}

.match-team.highlight {
  color: var(--text-primary);
  font-weight: 600
}

.match-right {
  display: flex;
  align-items: center;
  gap: 8px
}

.match-scores-vertical {
  display: flex;
  flex-direction: column;
  gap: 2px
}

.score-row {
  display: flex;
  gap: 4px;
  align-items: center
}

.iy-score {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  min-width: 18px;
  text-align: center
}

.ms-score {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 18px;
  text-align: center
}

.result-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.result-badge.win {
  background: #22c55e;
  color: var(--text-primary)
}

.result-badge.lose {
  background: #ef4444;
  color: var(--text-primary)
}

.result-badge.draw {
  background: #f59e0b;
  color: var(--text-primary)
}

.over-under-values {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  background: var(--secondary-bg);
  border-radius: 4px;
  padding: 6px;
  border: 1px solid var(--border-color)
}

.ou-value-btn {
  flex: 1;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s
}

.ou-value-btn:hover {
  background: var(--card-bg);
  color: var(--text-primary);
  border-color: var(--border-color)
}

.ou-value-btn.active {
  background: #3b82f6;
  color: var(--text-primary);
  border-color: #3b82f6
}

.result-badge-ou {
  min-width: 36px;
  height: 22px;
  border-radius: 11px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.result-badge-ou.win {
  background: #22c55e;
  color: var(--text-primary)
}

.result-badge-ou.lose {
  background: #ef4444;
  color: var(--text-primary)
}

.result-badge-ou.draw {
  background: #f59e0b;
  color: var(--text-primary)
}

.h2h-match.empty {
  background: transparent;
  min-height: 60px
}

.no-matches {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
  grid-column: 1/-1
}

/* Responsive - Tablet */

@media(max-width:900px) {
  .h2h-matches {
    grid-template-columns: 1fr;
  }
  /* Takım başlıkları mobilde yan yana kalsın */
  .h2h-team-headers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
  }
}

/* Responsive - Mobile */

@media(max-width:640px) {
  .istatistikler-content {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  .istatistikler-tabs {
    padding: 8px;
    gap: 6px;
    min-height: 56px;
  }
  .istatistik-tab {
    padding: 10px 14px;
    font-size: 12px;
  }
  /* Takım başlıkları mobilde yan yana - ZORUNLU */
  .h2h-team-headers {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1px;
  }
  .h2h-team-header {
    padding: 8px 6px;
  }
  .h2h-team-header h3 {
    font-size: 11px;
    flex-direction: column;
    gap: 3px;
  }
  /* Maçlar mobilde yan yana - 2 sütun */
  .h2h-matches {
    grid-template-columns: 1fr 1fr !important;
  }
  .h2h-match {
    padding: 8px 6px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .match-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
  }
  .match-date {
    font-size: 10px;
    min-width: auto;
  }
  .match-teams {
    width: 100%;
  }
  .match-team {
    font-size: 11px;
  }
  .match-right {
    width: 100%;
    justify-content: space-between;
  }
  .match-scores-vertical {
    gap: 1px;
  }
  .iy-score {
    font-size: 10px;
    min-width: 16px;
  }
  .ms-score {
    font-size: 14px;
    min-width: 16px;
  }
  .result-badge {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }
  .result-badge-ou {
    min-width: 32px;
    height: 20px;
    font-size: 9px;
    padding: 0 6px;
  }
}

/* Puan Durumu Stilleri */

.standings-container {
  padding: 0
}

.standings-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 15px;
  padding: 0 5px
}

.standings-table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color)
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px
}

.standings-table thead {
  background: var(--secondary-bg);
  position: sticky;
  top: 0;
  z-index: 1
}

.standings-table th {
  padding: 10px 8px;
  text-align: center;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap
}

.standings-table tbody tr {
  background: var(--card-bg);
  transition: background .2s
}

.standings-table tbody tr:hover {
  background: var(--secondary-bg)
}

.standings-table tbody tr.ev-highlight {
  background: var(--bg-primary-alpha);
  border-left: 3px solid #3b82f6
}

.standings-table tbody tr.dep-highlight {
  background: var(--bg-error-alpha);
  border-left: 3px solid #ef4444
}

.standings-table td {
  padding: 10px 8px;
  text-align: center;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color)
}

.standings-table .sira-col {
  font-weight: 600;
  color: var(--text-secondary);
  width: 40px
}

.standings-table .takim-col {
  text-align: left;
  font-weight: 500;
  min-width: 150px
}

.standings-table .puan-col {
  font-weight: 700;
  color: #3b82f6;
  width: 50px
}

.standings-table .averaj-col {
  font-weight: 600
}

.standings-table .averaj-col.positive {
  color: #22c55e
}

.standings-table .averaj-col.negative {
  color: #ef4444
}

@media(max-width:640px) {
  .standings-table {
    font-size: 11px;
    min-width: 500px
  }
  .standings-table th,
  .standings-table td {
    padding: 8px 5px
  }
  .standings-title {
    font-size: 14px
  }
}