/* NitroPvP - Statistics - Town & Nation Wars */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  color: #fff;
  overflow-x: hidden;
}

/* Arka plan - tam ekran cover */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('/pngs/background.png') center/cover no-repeat;
}

/* Logo - sol üst köşe (daire/border yok) */
.site-logo {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 10;
  width: 100px;
  height: 100px;
  object-fit: contain;
}

/* Ana konteynır */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  padding-top: 8rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Başlık kutusu - mavi, yuvarlak köşeler */
.title-box {
  background: #4F46E5;
  border: 1px solid #4338ca;
  border-radius: 12px;
  padding: 1rem 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.title-box h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
}

.title-box .subtitle {
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  margin-top: 0.25rem;
}

/* İstatistik kutusu - şeffaf gri, kaydırılabilir (scrollbar her zaman görünür) */
.stats-box {
  width: 100%;
  max-width: 800px;
  max-height: 60vh;
  overflow-y: scroll;
  background: rgba(80, 80, 80, 0.75);
  border: 1px solid rgba(100, 100, 100, 0.8);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Scrollbar stilleri */
.stats-box::-webkit-scrollbar {
  width: 10px;
}

.stats-box::-webkit-scrollbar-track {
  background: rgba(60, 60, 60, 0.5);
  border-radius: 5px;
}

.stats-box::-webkit-scrollbar-thumb {
  background: rgba(100, 100, 100, 0.9);
  border-radius: 5px;
}

.stats-box::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 120, 120, 0.95);
}

/* Savaş listesi */
.fight-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.fight-card {
  display: block;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s, border-color 0.2s;
  font-weight: 600;
}

.fight-card:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
}

.fight-card .atk { color: #e74c3c; font-weight: 700; }
.fight-card .vs { opacity: 0.7; margin: 0 0.5rem; font-weight: 600; }
.fight-card .def { color: #3498db; font-weight: 700; }
.fight-card .meta {
  display: block;
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 0.35rem;
  font-weight: 600;
}

.loading, .empty, .error {
  text-align: center;
  opacity: 0.95;
  padding: 2rem;
  font-weight: 600;
}

.error { color: #e74c3c; }

/* Footer */
.site-footer {
  position: fixed;
  bottom: 1rem;
  right: 1.5rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
}

.back-link {
  display: inline-block;
  margin-top: 1.5rem;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.back-link:hover { color: #fff; }

/* Fight detay sayfası - daha yüksek kutu (grafikler için) */
.fight-page .container { padding-top: 8rem; }
.fight-detail-box { max-height: 85vh; }

.fight-detail-box .fight-header {
  background: #4F46E5;
  border: 1px solid #4338ca;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.fight-detail-box .fight-header h1 { color: #fff; }
.fight-detail-box .fight-header .subtitle { color: rgba(255,255,255,0.95); }

.fight-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.fight-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.fight-header .subtitle {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 0.5rem;
  font-weight: 600;
}

.teams-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.team-card {
  padding: 1rem;
  text-align: center;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.25);
  font-weight: 600;
}

.team-card.atk { border-color: rgba(231,76,60,0.5); }
.team-card.def { border-color: rgba(52,152,219,0.5); }
.team-card.winner { box-shadow: 0 0 20px rgba(255,215,0,0.25); }

.team-card h2 { font-size: 1.2rem; margin-bottom: 0.25rem; font-weight: 700; }
.team-card .role { font-size: 0.8rem; display: block; font-weight: 600; }
.team-card.atk .role { color: #e74c3c; }
.team-card.def .role { color: #3498db; }
.team-card .result { font-size: 0.9rem; font-weight: 700; display: block; margin-top: 0.5rem; }
.team-card.winner .result { color: #f1c40f; }
.team-card:not(.winner) .result { color: #95a5a6; }

.stats-card {
  background: rgba(80, 80, 80, 0.6);
  border: 1px solid rgba(100, 100, 100, 0.7);
  border-radius: 10px;
  padding: 1rem;
  overflow-x: auto;
  font-weight: 600;
}

.stats-table { width: 100%; border-collapse: collapse; }
.stats-table th, .stats-table td { padding: 0.5rem 0.75rem; text-align: center; font-weight: 600; }
.stats-table th { font-size: 0.8rem; opacity: 0.95; }
.stats-table .player-cell { text-align: left; }
.stats-table .player-cell.def { text-align: right; }
.stats-table .player-cell .avatar {
  width: 36px;
  height: 36px;
  vertical-align: middle;
  margin-right: 0.5rem;
}

.stats-table .player-cell.def .avatar { margin-right: 0; margin-left: 0.5rem; }
.stats-table .icon-cell { font-size: 0.9rem; opacity: 0.95; }
.stats-table .kda .k { color: #2ecc71; }
.stats-table .kda .d { color: #e74c3c; }
.stats-table .kda .a { color: #95a5a6; }

.expandable {
  margin-top: 1rem;
  padding: 0.75rem;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
  opacity: 0.85;
  font-weight: 600;
}

.expandable .chevron { margin-left: 0.5rem; font-size: 0.7rem; }

/* Fight detay: stats-box scroll yerine sayfa scroll (Battle Breakdown için) */
.fight-page .fight-detail-box {
  max-height: none;
  overflow: visible;
}

/* Battle Breakdown - EldritchBot tarzı grafikler */
.battle-breakdown {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.battle-breakdown .breakdown-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  margin-bottom: 0.25rem;
  letter-spacing: 0.08em;
}

.battle-breakdown .title-line {
  height: 2px;
  background: #4F46E5;
  margin-bottom: 1.25rem;
  width: 80px;
}

.battle-breakdown .breakdown-charts { margin-top: 1rem; }
.battle-breakdown .chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.battle-breakdown .chart-box {
  background: rgba(60, 60, 60, 0.5);
  border-radius: 8px;
  padding: 1rem;
  min-height: 180px;
}

.battle-breakdown .chart-box.pie-box { min-height: 200px; }
.battle-breakdown .chart-box h3 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-align: center;
  letter-spacing: 0.05em;
}

.battle-breakdown .breakdown-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.battle-breakdown .breakdown-actions button,
.battle-breakdown .btn-save-raw,
.battle-breakdown .btn-share {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
}

.battle-breakdown .breakdown-actions button:hover,
.battle-breakdown .btn-save-raw:hover,
.battle-breakdown .btn-share:hover {
  background: rgba(255,255,255,0.2);
}

@media (max-width: 600px) {
  .site-logo { width: 70px; height: 70px; top: 1rem; left: 1rem; }
  .container { padding-top: 6rem; }
  .teams-overview { grid-template-columns: 1fr; }
  .stats-table { font-size: 0.85rem; }
  .stats-table th:nth-child(n+2):nth-child(-n+7),
  .stats-table td:nth-child(n+2):nth-child(-n+7) { display: none; }
}
