:root {
    --primary-color: #fd5a00;
    --secondary-color: #1e40af;
    --dark-bg: #161616;
    --darker-bg: #0f0f0f;
    --light-text: #f3f4f6;
    --border-color: #2d2d2d;
    --card-bg: #232020;
    --hover-color: #fd7a30;
    --stat-bg: #1a1a1a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--dark-bg);
  color: var(--light-text);
  min-height: 100vh;
}

.navbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--primary-color);
}

.navbar a {
  color: white;
  margin-left: 1.5rem;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.navbar a:hover {
  opacity: 0.8;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.search-container {
  background-color: var(--darker-bg);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.search-container h1 {
  font-size: 2rem;
}
.search-container h2 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 200;
}

.search-box {
  display: flex;
  max-width: 600px;
  margin: 0 auto;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px 0 0 6px;
  font-size: 1rem;
  background-color: var(--card-bg);
  color: var(--light-text);
}

.search-button {
  padding: 0.75rem 1.5rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.search-button:hover {
  background-color: var(--hover-color);
}

.results-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.profile-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.profile-card2 {
  background-color: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.profile-header {
  background-color: var(--stat-bg);
  padding: 1rem;
  height: 75px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.profile-header img {
  height: 40px;
}

.profile-content {
  padding: 1.5rem;
}
.profile-content2 {
  padding: 1.5rem;
}
.profile-info {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  margin-right: 1rem;
  object-fit: cover;
}

.profile-details h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.profile-stats {
  margin-bottom: 1.5rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.map-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.map-card {
  background-color: var(--stat-bg);
  border-radius: 6px;
  overflow: hidden;
}

.map-image {
  width: 100%;
  height: 80px;
  object-fit: cover;
}

.map-details {
  padding: 0.75rem;
  font-size: 0.875rem;
}

.map-name {
  margin-bottom: 0.5rem;
  font-weight: 500;
  text-align: center;
}

.map-stat {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.view-profile-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-weight: 500;
  margin-top: 1rem;
  transition: background-color 0.2s ease;
}

.view-profile-btn:hover {
  background-color: var(--hover-color);
}

.steam-ids {
  margin-top: 1.5rem;
}

.steam-id-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  background-color: var(--stat-bg);
  padding: 1.2rem;
  border-radius: 4px;
}

.steam-id-label {
  flex: 0 0 120px;
  font-weight: bold;
  font-size: 0.875rem;
}

.steam-id-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-family: monospace;
}

.copy-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
}

.loader {
  display: none;
  text-align: center;
  margin: 2rem auto;
}

.loader div {
  width: 10px;
  height: 10px;
  background-color: var(--primary-color);
  border-radius: 50%;
  display: inline-block;
  margin: 0 3px;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loader div:nth-child(1) {
  animation-delay: -0.32s;
}

.loader div:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

.error-message {
  color: #ef4444;
  text-align: center;
  margin: 1rem 0;
  display: none;
}

.hidden {
  display: none;
}

@media (max-width: 768px) {
  .results-container {
    grid-template-columns: 1fr;
  }
  
  .map-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 1rem;
  }
  
  .map-stats {
    grid-template-columns: 1fr;
  }
}

/* Przełącznik trybu ciemnego */
.dark-mode-toggle {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  margin-left: 1.5rem;
}

/* Klasa dla trybu jasnego */
body.light-mode {
  --dark-bg: #f3f4f6;
  --darker-bg: #e5e7eb;
  --light-text: #1f2937;
  --border-color: #d1d5db;
  --card-bg: #ffffff;
}

body.light-mode .profile-header,
body.light-mode .map-card,
body.light-mode .steam-id-row,
body.light-mode .stat-box {
  background-color: #dbd9d9;
}

body.light-mode .search-input {
  background-color: #ffffff;
  color: #1f2937;
}
/* Statystyki w boxach */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-box {
  background-color: var(--stat-bg);
  padding: 1rem;
  border-radius: 6px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.85rem;
  color: #aaa;
}
.recent-results {
  display: flex;
  gap: 5px;
}

.recent-results .win {
  background-color: #4caf50;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
}

.recent-results .loss {
  background-color: #f44336;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
}
/* 5 kolumn o równej szerokości */
.profile-card .faceit-top-section {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.profile-card2 .faceit-top-section {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 1168px) {
  .profile-card .faceit-top-section {
    grid-template-columns: 1fr; 
  }
}
/* --- Układ szeroki (powyżej 1168px) --- */
.profile-card2 .faceit-top-section {
  display: grid;
  /* 5 kolumn: 
     - "Profile Created" będzie span 2 kolumn (1/2), 
     - pozostałe 3 boxy (Avatar, Status, Visibility) po 1 kolumnie (3,4,5). */
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Profile Created -> kolumny 1-2 */
.profile-card2 .faceit-top-section .faceit-join-date {
  grid-column: 1 / span 2;
}

/* Avatar -> kolumna 3 (opcjonalnie możesz ustawić, ale nie zawsze potrzebne) */
.profile-card2 .faceit-top-section .faceit-avatar {
  grid-column: 3 / span 1;
}
/* Status -> kolumna 4 */
.profile-card2 .faceit-top-section .faceit-level {
  grid-column: 4 / span 1;
}
/* Visibility -> kolumna 5 */
.profile-card2 .faceit-top-section .faceit-elo {
  grid-column: 5 / span 1;
}

/* --- Od 1168px w dół: wszystko w 1 kolumnie (każdy box na osobnym wierszu) --- */
@media (max-width: 1168px) {
  .profile-card2 .faceit-top-section {
    grid-template-columns: 1fr; /* tylko 1 kolumna */
  }
  .profile-card2 .faceit-top-section .stat-box {
    /* Każdy stat-box zajmuje cały wiersz */
    grid-column: 1 / span 1;
  }
}


/* Każdy .stat-box w górnej sekcji – wyśrodkowanie i min. wysokość */
.profile-card .faceit-top-section .stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-height: 80px;
  min-width: 80px;
}
.profile-card2 .faceit-top-section .stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-height: 80px;
  min-width: 80px;
}

/* Avatar – ustawienia rozmiaru */
.profile-card .faceit-avatar .profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  margin-right: 0 !important;
  object-fit: cover;
}
.profile-card2 .faceit-avatar .profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  margin-right: 0 !important;
  object-fit: cover;
}
/* Jeśli nie chcesz ciemnego tła w boxie z avatarem: */
.profile-card .faceit-avatar {
  background-color: transparent !important;
  box-shadow: none !important;
  border: none !important;
}
.profile-card2 .faceit-avatar {
  background-color: transparent !important;
  box-shadow: none !important;
  border: none !important;
}
.stat-valuenick {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 0.1rem;
}

.stat-valuelatest {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 1rem;
}
.profile-card .faceit-nick {
  margin-bottom: 1rem;
  text-align: center;
}
.profile-card2 .faceit-nick {
  margin-bottom: 1rem;
  text-align: center;
}