* {
	font-family: "Montserrat", serif;
	box-sizing: border-box;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	background-color: var(--background-color);
	color: var(--text-color);
	scroll-behavior: smooth;
}

:root {
  --background-color: #f5f6f8;
  --header-footer-bg: #ffffff;
  --header-shadow: rgba(0, 0, 0, 0.08);
  --text-color: #000000;
  --button-theme-color: #0077FF;
  --button-theme-border: #cbcbcb;
  --button-search-color: #5181B8;
  --card-background: #ffffff;      
  --card-shadow: rgba(0, 0, 0, 0.35);
  --link-color: #3c4247;     
  --link-hover: #0057b8;           
  --table-border: #b7b7b7 ;         
  --table-shadow: transparent;    
}

body.black {
	--background-color: #292929;
	--header-footer-bg: #313131;
	--header-shadow: #3d3d3d;
	--text-color: #E0E1DD;
	--button-theme-color: #616161;
	--button-theme-border: #cbcbcb;
  --button-search-color: #616161;
	--card-background: #3f3f3f;
	--card-shadow: #c5c5c5;
	--link-color: #E0E1DD;
	--link-hover: #D0D0D0;
	--table-border: #b7b7b7;
	--table-shadow: #b7b7b7;
}

header {
	background-color: var(--header-footer-bg);
	color: white;
	padding: 10px 0;
	height: 80px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0px 2px 3px var(--header-shadow);
}

nav ul {
	list-style-type: none;
	padding: 0;
	text-align: center;
}

nav ul li {
	display: inline;
	margin: 0 15px;
}

nav ul li a {
	display: flex;
	justify-content: center;
	align-items: center;
	color: black;
	text-decoration: none;
}

body.black nav ul li a {
	display: flex;
	justify-content: center;
	align-items: center;
	color: white;
	text-decoration: none;
}

main.about {
	text-align: center;
  width: 70%;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: center;
}

footer {
	background-color: var(--header-footer-bg);
	text-align: center;
	padding: 20px 0;
	margin-top: auto;
	display: inline-block;
	box-shadow: 0px -2px 3px var(--header-shadow);
  width: 100%;
}

.footer-content {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	max-width: 1500px;
	margin: 0 auto;
	padding: 0 20px;
}

.results-container .card {
	color: var(--text-color);
	margin: 10px;
	display: flex;
	background-color: var(--card-background);
	border-radius: 20px;
	padding: 15px;
	text-align: center;
	transition: transform 0.2s;
	box-shadow: 2px 2px 5px var(--card-shadow);
	justify-content: center;
	align-items: center;
	flex-direction: column;
}

.results-container .card:hover {
	transform: scale(1.05);
	box-shadow: 7px 7px 7px var(--card-shadow);
}

.results-container .card a {
	text-decoration: none;
	color: var(--link-hover);
}

.results-container .card a:hover {
	text-decoration: underline;
	text-decoration-color: var(--link-hover);
}

.results-container .card img {
	margin-bottom: 0;
}

.results-container .card h3 {
	margin: 10px;
}

table {
	width: 60%;
	margin: 50px auto;
	border: 2px solid var(--table-border);
	box-shadow: 0px 0px 8px var(--table-shadow);
}

.menu-toggle {
	display: none;
	z-index: 9999;
	position: relative;
}

.menu {
	display: flex;
	justify-content: center;
	align-items: center;
}

/* ИСПРАВЛЕНИЯ ДЛЯ ЦЕНТРИРОВАНИЯ НА МОБИЛЬНЫХ */
.findermatch {
  display: flex;
  text-align: center;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: 100%;
}

.findermatch_text {
  text-align: center;
  width: 90%;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.results-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.input-300px {
  margin: 10px auto;
  display: block;
}

.fetchMatchbtn {
  margin: 10px auto;
  display: block;
}

/* Центрирование для страницы героев */
.mainheroes {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.heroesContent {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

#heroesTable {
  margin: 20px auto;
}

/* Центрирование для профиля */
.profile-container {
  margin: 50px auto;
}

/* Центрирование для поиска */
.search-results-container {
  margin: 30px auto;
  text-align: center;
}

.players-list {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.player-card {
  margin: 10px auto;
}

@media (max-width: 1305px) {
  .cursor-circle {
      display: none !important;
  }

  .history-table {
      display: flex;
      flex-direction: column;
  }
  
  .history-table thead {
      display: none;
  }
  
  .history-table tbody {
      display: flex;
      flex-direction: column;
      gap: 20px;
  }
  
  .history-table tr {
      display: flex;
      flex-direction: column;
      background: #3a3a3a;
      border-radius: 10px;
      overflow: hidden;
      box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  }
  
  .history-table td {
      padding: 15px 10px;
      text-align: center;
      position: relative;
  }
  
  .history-table td:before {
      content: attr(data-label);
      font-weight: bold;
      display: block;
      margin-bottom: 8px;
      color: #4CAF50;
      font-size: 0.9em;
  }
  
  .history-table td:not(:last-child) {
      border-bottom: 1px solid #4a4a4a;
  }

  .history-table td:first-child {
      background: #2a2a2a;
      padding-top: 18px;
      padding-bottom: 18px;
  }
  
  .history-table td:first-child:before {
      color: #4CAF50;
      font-size: 1em;
  }

  .auth-container{
    margin-top: auto;
    margin-bottom: 20px;
    width: 90%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;		
    padding: 10px;
  }

  .profile-container {
    margin-bottom: 20px;
    width: 90%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 20px;
    padding: 10px;
  }
		
  .menu-toggle.active + .menu {
    display: flex;
  }
		
  .menu-toggle {
    display: block;
  }

  .menu {
    display: none;
    flex-direction: column;
    position: fixed;
    top: -15px;
    left: 0;
    right: 0;
    bottom: -15px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 2px #ccc solid;
    padding-inline-start: 0px;
    z-index: 1000;
  }

  .menu.active {
    display: flex;
  }
	
  #results {
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
    max-height: 970px;
    display: flex;
    flex-direction: row;
    white-space: nowrap;
    justify-content: center;
  }

  .results-container .card {
    width: 250px;
    height: 300px;
    margin: 10px;
  }
}

@media (max-width: 1300px) {
  #heroesTable {
    margin-bottom: 20px;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 10px;
    overflow: hidden;
  }
  #heroesTable thead {
    border: 1px solid #ccc;
    border-radius: 10px;
    overflow: hidden;
  }

  #heroesTable tr {
    display: flex;
    flex-direction: column;
    border: none;
    border-bottom: 1px solid #ccc;
    overflow: hidden;
    border-radius: 20px;
  }

  #heroesTable th,
  #heroesTable td {
    padding: 10px;
    text-align: center;
    overflow: hidden;
  }

  #heroesTable th {
    font-family: "Montserrat", serif;
    color: var(--text-color);
    overflow: hidden;
  }

  #heroesTable tbody {
    color: var(--text-color);
    overflow: hidden;
  }

  #heroesTable tr:hover {
    color: var(--link-color);
  }

  #heroesTable td:hover {
    color: var(--link-color);
  }
}

@media (max-width: 1200px) {
  header {
    height: 80px;
  }
	
  .menu-toggle {
    display: block;
  }

  .menu {
    display: none; 
  }

  .menu.active {
    display: flex;
  }

  nav ul li {
    margin: 0 10px;
  }

  .footer-content {
    flex-direction: column;
    align-items: center;
  }

  .match-info,
  .players-info {
    margin-bottom: 20px;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 10px;
  }

  .match-info tr,
  .players-info tr {
    display: flex;
    flex-direction: column;
    border: none;
    border-bottom: 1px solid #ccc;
  }

  .match-info th,
  .players-info th,
  .match-info td,
  .players-info td {
    padding: 10px;
    text-align: center;
  }

  .player {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
  }

  .player-icon {
    margin-right: 10px;
  }

  .player-details {
    display: flex;
    flex-direction: column;
  }

  .player-details div {
    margin: 2px 0;
  }

  table {
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--table-border);
  }
}

@media (max-width: 768px) {
  .page-wrapper {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
  }

  .main-content {
      padding: 15px;
      display: flex;
      flex-direction: column;
      align-items: center;
  }

  .findermatch {
      margin: 15px 0;
      width: 100%;
      text-align: center;
  }

  .findermatch_text {
      padding: 10px;
      text-align: center;
      width: 95%;
      margin: 0 auto;
  }

  .ad-container {
      margin: 10px 0;
  }

  #results {
      margin: 10px auto;
      padding: 10px;
      justify-content: center;
  }
  
  .search-results-container {
      padding: 15px;
      margin: 20px auto;
      text-align: center;
      width: 95%;
  }
  
  .players-list {
      grid-template-columns: 1fr;
      gap: 15px;
      display: flex;
      flex-direction: column;
      align-items: center;
  }
  
  .player-card {
      padding: 12px;
      flex-direction: column;
      text-align: center;
      width: 100%;
      max-width: 400px;
      margin: 10px auto;
  }
  
  .player-avatar {
      margin-right: 0;
      margin-bottom: 10px;
      width: 50px;
      height: 50px;
  }
  
  .player-info {
      width: 100%;
      text-align: center;
  }
  
  .player-username,
  .player-steamid {
      white-space: normal;
      text-overflow: clip;
      text-align: center;
  }
  
  .no-results {
      padding: 20px 10px;
      font-size: 16px;
      text-align: center;
      width: 100%;
  }
  
  .search-container {
      margin-left: auto;
      margin-right: auto;
      text-align: center;
  }
  
  .search-input {
      width: 160px;
      padding: 6px 12px;
      margin: 0 auto;
  }
  
  .search-input:focus {
      width: 180px;
  }

  /* Центрирование карточек на мобильных */
  .results-container {
    justify-content: center;
    align-items: center;
    flex-direction: column;
  }

  .results-container .card {
    margin: 10px auto;
    width: 90%;
    max-width: 300px;
  }
}

@media (max-width: 600px) {
  .a_username {
      padding: 0px !important;
      padding-right: 0px !important;
  }
  
  .rank-image1, .rank-info {
      height: 80px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
  }

  /* Центрирование таблицы героев */
  #heroesTable {
    width: 95%;
    margin: 20px auto;
  }

  /* Центрирование контента "О нас" */
  main.about {
    width: 95%;
    margin: 0 auto;
  }

  .contactsabout {
    width: 95%;
    margin: 0 auto;
    text-align: center;
  }
}

@media (max-width: 480px) {
  header, footer {
      width: 100%;
  }
  
  .search-results-container h1 {
      font-size: 1.5rem;
      margin-bottom: 20px;
      text-align: center;
  }
  
  .player-card {
      padding: 10px;
      width: 95%;
  }

  /* Центрирование всех элементов на очень маленьких экранах */
  .findermatch_text {
    width: 100%;
    padding: 10px 5px;
  }

  .input-300px {
    width: 95%;
  }

  .fetchMatchbtn {
    width: 95%;
  }

  .results-container .card {
    width: 95%;
  }
}