/* Dark theme */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #1e1e1e;
    color: #f0f0f0;
}
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 16px;
    background-color: #2a2a2a;
    border-bottom: 1px solid #333;
}
.header-left h1 {
    margin: 0;
    font-size: 20px;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-logo {
  height: 120px;
  margin-left: 12px;
}
.user-info {
  font-size: 14px;
  display: flex;
  align-items: center;
}
.user-details {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: bold;
  font-size: 15px;
  color: #f0f0f0;
}
#user-nickname {
  font-weight: bold;
  color: #4caf50;
  margin-right: 4px;
}
.separator {
  color: #888;
}
#refresh-rating {
    padding: 8px 12px;
    background-color: #4caf50;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}
#refresh-rating:hover {
    background-color: #45a049;
}
#auth-steam {
    padding: 8px 12px;
    background-color: #2a475e ;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}
#signout-steam {
    padding: 8px 12px;
    background-color: #c90721;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}
#signout-steam:hover {
    background-color: #c90721;
}
nav {
    display: flex;
    background-color: #2a2a2a;
    border-bottom: 1px solid #333;
}
nav button {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 16px;
}
nav button.active {
    color: #fff;
    border-bottom: 2px solid #4caf50;
}
.tab-content {
    padding: 8px 16px 16px 16px;
    height: calc(100vh - 140px);
    overflow-y: auto;
    margin-top: 0px;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}
th, td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #333;
}
th {
    background-color: #2a2a2a;
    color: #aaa;
    position: sticky;
    top: 0;
}
tr:hover {
    background-color: #333;
}
.more-row {
    text-align: center;
    font-size: 18px;
    color: #777;
}
#notification {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background-color: #4caf50;
  color: white;
  padding: 12px 24px;
  border-radius: 0 0 6px 6px;
  font-size: 14px;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s ease;
}
.highlight {
  font-weight: bold;
  background-color: #333;
}
#load-more-leaderboard {
  background-color: #444;
  color: #fff;
  border: 1px solid #666;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}

#load-more-leaderboard:hover {
  background-color: #555;
}
.hero-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

.hero-table thead {
  border-bottom: 2px solid #444;
  background-color: #2a2a2a;
}

.hero-table th, .hero-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-table th {
  cursor: pointer;
  user-select: none;
  color: #aaa;
}

.hero-table th.active {
  color: #3498db;
}

.sort-indicator {
  margin-left: 4px;
  font-size: 0.8em;
  color: #888;
}

.hero-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-icon {
  width: 37px;
  height: 27px;
  border-radius: 4px;
}

.hero-name {
  font-weight: bold;
  color: #f0f0f0;
}

.value {
  display: inline-block;
  font-weight: bold;
  margin-bottom: 4px;
}

.green-text {
  color: #27ae60;
}

.yellow-text {
  color: #f39c12;
}

.bar {
  height: 5px;
  border-radius: 2px;
  background-color: #444;
  margin-top: 2px;
  position: relative;
  overflow: hidden;
}

.bar.green::before,
.bar.yellow::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  transition: width 0.3s ease;
}

.bar.green::before {
  background-color: #27ae60;
  width: var(--bar-width, 0%);
}

.bar.yellow::before {
  background-color: #f39c12;
  width: var(--bar-width, 0%);
}

.stat-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.subtext {
  font-size: 12px;
  color: #888;
}

th {
  cursor: pointer;
  user-select: none;
}

th.active {
  color: #3498db;
}

.sort-indicator {
  margin-left: 4px;
  font-size: 0.8em;
  color: #aaa;
}

.filter-buttons {
  text-align: center;
  margin: 15px 0;
}

.filter-buttons .pos-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.filter-buttons .pos-btn img {
  width: 32px;
  height: 32px;
  object-fit: contain; /* ключевой момент */
  display: block;
}

.filter-buttons .pos-btn:hover {
  transform: scale(1.05);
}

.filter-buttons .pos-btn.active img {
  outline: 2px solid #5c9edb; /* активная рамка только по картинке */
  border-radius: 4px;
}

.hero-tier {
  background-color: #444;
  color: #fff;
  font-size: 0.8em;
  padding: 2px 6px;
  margin-left: 6px;
  border-radius: 6px;
  font-weight: bold;
}

.tier-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.85rem;
  text-transform: uppercase;
  background-color: #444;
  color: #fff;
  min-width: 32px;
  text-align: center;
}

/* TIER COLORS */
.tier-S {
  background-color: #7e3bf0; /* Gold */
  color: #000;
}
.tier-A {
  background-color: #0386ca; /* Silver */
  color: #000;
}
.tier-B {
  background-color: #059669; /* Bronze */
  color: #fff;
}
.tier-C {
  background-color: #d97706;
  color: #fff;
}
.tier-D {
  background-color: #e11d48;
  color: #fff;
}
