* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', -apple-system, sans-serif; }

:root {
  --accent: #a855f7;
  --accent-2: #6366f1;
  --tier-gold:   #f5c542;
  --tier-silver: #c0c0c0;
  --tier-bronze: #cd7f32;
  --tier-blue:   #3b82f6;
  --tier-pink:   #ec4899;
}

body {
  background: #0a0a0f;
  color: #e0e0e0;
  min-height: 100vh;
  overflow-x: hidden;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes pulse-glow-gold {
  0%, 100% { box-shadow: 0 0 14px rgba(245, 197, 66, 0.5); }
  50%      { box-shadow: 0 0 26px rgba(245, 197, 66, 0.95); }
}
@keyframes pulse-glow-silver {
  0%, 100% { box-shadow: 0 0 14px rgba(192, 192, 192, 0.4); }
  50%      { box-shadow: 0 0 26px rgba(192, 192, 192, 0.9); }
}
@keyframes pulse-glow-bronze {
  0%, 100% { box-shadow: 0 0 14px rgba(205, 127, 50, 0.5); }
  50%      { box-shadow: 0 0 26px rgba(205, 127, 50, 0.95); }
}

@keyframes medalFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-3px); }
}

.navbar {
  background: #101018;
  border-bottom: 1px solid #1e1e2e;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  animation: fadeIn 0.5s ease;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 65px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(90deg, #a855f7, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
  transition: transform 0.3s ease;
}

.logo:hover { transform: scale(1.05); }

nav a {
  color: #888;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.25s ease;
}

nav a:hover, nav a.active {
  color: #fff;
  background: #1e1e2e;
}

.server-banner {
  background: #101018;
  text-align: center;
  padding: 14px;
  border-bottom: 1px solid #1e1e2e;
  animation: fadeIn 0.7s ease;
}

.discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #5865F2, #4752c4);
  color: #fff;
  text-decoration: none;
  padding: 9px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

.discord-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(88, 101, 242, 0.55);
  background: linear-gradient(135deg, #6b76ff, #5865F2);
}

.discord-btn:active { transform: translateY(0); }

/* ============================
   TABS
============================ */
.tabs {
  max-width: 1400px;
  margin: 25px auto 0;
  padding: 0 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease;
}

.tab {
  position: relative;
  background: transparent;
  border: 1px solid #1e1e2e;
  color: #888;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 95px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tab .tab-text {
  display: inline-block;
  transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1) rotate(0deg);
  opacity: 1;
  white-space: nowrap;
}

.tab .tab-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  opacity: 0;
  transform: scale(0.3) rotate(-180deg);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.tab:hover .tab-text,
.tab.active .tab-text {
  opacity: 0;
  transform: scale(0.5) rotate(180deg);
}

.tab:hover .tab-icon,
.tab.active .tab-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.tab:hover {
  border-color: var(--accent);
  color: #e0e0e0;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.25);
}

.tab.active {
  background: linear-gradient(90deg, #a855f7, #6366f1);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.35);
}

.tab.active:hover .tab-icon {
  transform: scale(1.1) rotate(0deg);
}

/* ============================
   SEARCH
============================ */
.search-bar {
  max-width: 1400px;
  margin: 20px auto;
  padding: 0 20px;
  animation: fadeInUp 0.7s ease;
}

.search-bar input {
  width: 100%;
  padding: 12px 18px;
  background: #101018;
  border: 1px solid #1e1e2e;
  border-radius: 10px;
  color: #e0e0e0;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
}

.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

/* ============================
   RANKINGS TABLE
============================ */
.rankings-table {
  max-width: 1400px;
  margin: 0 auto 60px;
  padding: 0 20px;
}

.table-header {
  display: grid;
  grid-template-columns: 60px 80px 1fr 100px 1fr;
  padding: 15px 22px;
  color: #666;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  border-bottom: 1px solid #1e1e2e;
  animation: fadeIn 0.8s ease;
  align-items: center;
}

.table-header > div:nth-child(1) { text-align: center; }
.table-header > div:nth-child(2) { text-align: center; }
.table-header > div:nth-child(3) { text-align: left;   }
.table-header > div:nth-child(4) { text-align: center; }
.table-header > div:nth-child(5) { text-align: right;  }

/* ============================
   PLAYER ROW
============================ */
.player-row {
  display: grid;
  grid-template-columns: 60px 80px 1fr 100px 1fr;
  padding: 14px 22px;
  margin: 8px 0;
  background: linear-gradient(90deg, #13131c 0%, #0f0f17 100%);
  border: 1px solid #1a1a24;
  border-radius: 14px;
  align-items: center;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  opacity: 0;
  animation: fadeInUp 0.45s ease forwards;
  position: relative;
  overflow: hidden;
}

.player-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.player-row:hover::before { opacity: 1; }

.player-row:hover {
  background: linear-gradient(90deg, #1a1a28 0%, #13131c 100%);
  border-color: var(--accent);
  transform: translateX(6px);
  box-shadow:
    0 0 22px rgba(168, 85, 247, 0.25),
    0 8px 30px rgba(0, 0, 0, 0.5);
}

/* ============================
   RANK BOX
============================ */
.rank-box {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: #888;
  background: linear-gradient(145deg, #1a1a26, #101018);
  border: 1px solid #26263a;
  border-radius: 10px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  font-style: italic;
  position: relative;
  justify-self: center;
}

.rank-box.top-1 {
  color: #1a1200;
  background: linear-gradient(145deg, #ffd95c, #f5a623);
  border-color: #ffd95c;
  animation: pulse-glow-gold 2.2s ease-in-out infinite;
}
.rank-box.top-2 {
  color: #1a1a1a;
  background: linear-gradient(145deg, #e8e8e8, #a8a8a8);
  border-color: #e8e8e8;
  animation: pulse-glow-silver 2.2s ease-in-out infinite;
}
.rank-box.top-3 {
  color: #1a0f00;
  background: linear-gradient(145deg, #e39b52, #a85a1e);
  border-color: #e39b52;
  animation: pulse-glow-bronze 2.2s ease-in-out infinite;
}

.player-row:hover .rank-box:not(.top-1):not(.top-2):not(.top-3) {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.5);
}

/* ============================
   PLAYER AVATAR + MEDAL
============================ */
.player-avatar {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.player-skin {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: radial-gradient(circle at 50% 30%, #2a2a3e, #12121c);
  border: 2px solid rgba(168, 85, 247, 0.4);
  box-shadow:
    0 0 0 3px rgba(168, 85, 247, 0.08),
    0 0 14px rgba(168, 85, 247, 0.35);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.player-row:hover .player-skin {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px rgba(168, 85, 247, 0.18),
    0 0 22px rgba(168, 85, 247, 0.8),
    0 0 40px rgba(168, 85, 247, 0.35);
  transform: scale(1.08);
}

/* ============================
   TOP 3 SEAL (ختم)
============================ */
.player-medal {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: -0.5px;
  animation: medalFloat 2.5s ease-in-out infinite;
  border: 2px solid currentColor;
  box-shadow:
    0 0 8px currentColor,
    0 2px 6px rgba(0, 0, 0, 0.7),
    inset 0 0 0 2px rgba(0, 0, 0, 0.25),
    inset 0 0 8px rgba(0, 0, 0, 0.45);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45),
    0 -1px 1px rgba(0, 0, 0, 0.55);
}

.player-medal::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1px dashed rgba(0, 0, 0, 0.35);
}

.player-medal::after {
  content: '';
  position: absolute;
  top: 15%;
  left: 20%;
  width: 40%;
  height: 25%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.7), transparent 70%);
  pointer-events: none;
}

.player-medal.medal-gold {
  background:
    radial-gradient(circle at 35% 30%, #fff3b0, transparent 55%),
    linear-gradient(145deg, #ffe066, #d97706);
  color: #f5c542;
}

.player-medal.medal-silver {
  background:
    radial-gradient(circle at 35% 30%, #ffffff, transparent 55%),
    linear-gradient(145deg, #e8e8e8, #737373);
  color: #c0c0c0;
}

.player-medal.medal-bronze {
  background:
    radial-gradient(circle at 35% 30%, #ffd6a5, transparent 55%),
    linear-gradient(145deg, #e39b52, #8b4513);
  color: #cd7f32;
}

.player-row.top-1 .player-medal { width: 30px; height: 30px; font-size: 0.95rem; }
.player-row.top-2 .player-medal { width: 27px; height: 27px; font-size: 0.88rem; }
.player-row.top-3 .player-medal { width: 26px; height: 26px; font-size: 0.85rem; }

/* ============================
   PLAYER INFO
============================ */
.player-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.player-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  transition: color 0.3s ease;
}

.player-row:hover .player-name {
  color: var(--accent);
}

.player-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

.player-title .points {
  color: #888;
  font-weight: 400;
}

/* ============================
   TITLE ICONS
============================ */
.title-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
}

.title-img-modal {
  width: 28px;
  height: 28px;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
}

/* ============================
   REGION BADGE
============================ */
.player-region {
  text-align: center;
  display: flex;
  justify-content: center;
}

.region-badge {
  display: inline-block;
  padding: 5px 14px;
  background: linear-gradient(135deg, #1e3a8a, #1e40af);
  border: 1px solid #3b82f6;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.45);
  transition: all 0.3s ease;
}

.player-row:hover .region-badge {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.85);
  transform: scale(1.05);
}

/* ============================
   TIER CIRCLES
============================ */
.player-tiers {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
}

.tier-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: default;
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
}

.tier-circle-inner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.15), transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.05) 0%, #0a0a0f 100%);
  border: 2px solid var(--tier-color);
  box-shadow:
    0 0 10px var(--tier-color),
    inset 0 0 12px rgba(0,0,0,0.6);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.tier-circle-inner::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--tier-color) 0%, transparent 70%);
  opacity: 0.25;
  z-index: -1;
  pointer-events: none;
}

.tier-circle:hover .tier-circle-inner {
  transform: translateY(-3px) scale(1.08);
  box-shadow:
    0 0 18px var(--tier-color),
    0 0 34px var(--tier-color),
    inset 0 0 14px rgba(0,0,0,0.7);
}

.tier-circle .gm-img {
  width: 26px;
  height: 26px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
  transition: transform 0.3s ease;
}

.tier-circle:hover .gm-img {
  transform: rotate(-8deg) scale(1.1);
}

.tier-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--tier-color);
  text-shadow: 0 0 8px var(--tier-color);
}

.tier-circle.retired { opacity: 0.45; }
.tier-circle.retired .tier-label { text-decoration: line-through; }
.tier-circle.retired .tier-circle-inner { filter: grayscale(0.7); }

/* ============================
   LOADING / EMPTY
============================ */
.loading, .empty {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-size: 1rem;
  animation: pulse 1.5s ease infinite;
}

/* ============================
   MODAL
============================ */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.25s ease;
}

.modal.show { display: block; }

.modal-content {
  background: #101018;
  margin: 5% auto;
  padding: 30px;
  border-radius: 16px;
  max-width: 550px;
  border: 1px solid #1e1e2e;
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
  animation: fadeInUp 0.35s ease;
}

.close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.8rem;
  cursor: pointer;
  color: #666;
  transition: all 0.25s ease;
  z-index: 3;
  line-height: 1;
}

.close:hover {
  color: #ff4444;
  transform: rotate(90deg);
}

.modal h2 {
  color: #fff;
  margin-bottom: 8px;
}

.modal .subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.modal-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  background: radial-gradient(circle at 50% 30%, #2a2a3e, #12121c);
  border: 3px solid rgba(168, 85, 247, 0.5);
  box-shadow:
    0 0 0 6px rgba(168, 85, 247, 0.1),
    0 0 30px rgba(168, 85, 247, 0.6);
  margin-bottom: 12px;
}

.tier-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  margin: 8px 0;
  background: #14141c;
  border-radius: 10px;
  border-left: 3px solid var(--tier-color, var(--accent));
  opacity: 0;
  animation: fadeInUp 0.35s ease forwards;
  transition: all 0.25s ease;
}

.tier-row:hover {
  background: #1a1a26;
  transform: translateX(4px);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.2);
}

.tier-row.retired {
  border-left-color: #ff4444;
  opacity: 0.7;
}

.tier-name {
  font-weight: 600;
  color: #e0e0e0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tier-rank {
  font-weight: 800;
  font-size: 1.05rem;
  text-shadow: 0 0 8px currentColor;
}

.tier-row.retired .tier-rank { text-decoration: line-through; }

.gm-img-modal {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  vertical-align: middle;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.gm-icon {
  font-size: 0.9rem;
  line-height: 1;
}

/* ============================
   TIER COLUMNS (Kits View)
============================ */
.tier-columns {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  animation: fadeInUp 0.5s ease;
}

.tier-col {
  background: linear-gradient(180deg, #13131c 0%, #0f0f17 100%);
  border: 1px solid #1a1a24;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.tier-col-header {
  background: linear-gradient(180deg, var(--tier-accent) 0%, rgba(0,0,0,0.35) 100%);
  padding: 14px 16px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid rgba(0,0,0,0.4);
}

.tier-col-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), transparent 60%);
  pointer-events: none;
}

.tier-col-title {
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #1a1a1a;
  text-shadow: 0 1px 0 rgba(255,255,255,0.35);
  position: relative;
  z-index: 1;
}

.tier-col-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
  max-height: 70vh;
}

.tier-col-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(20, 20, 28, 0.6);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}

.tier-col-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 3px;
  border-radius: 3px;
  background: var(--tier-accent);
  opacity: 0.7;
}

.tier-col-row:hover {
  background: rgba(35, 35, 50, 0.9);
  border-color: var(--tier-accent);
  transform: translateX(3px);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}

.tier-col-skin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: radial-gradient(circle at 50% 30%, #2a2a3e, #12121c);
  border: 1px solid rgba(168, 85, 247, 0.35);
  flex-shrink: 0;
  pointer-events: none;
}

.tier-col-name {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tier-col-rank {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-shadow: 0 0 6px currentColor;
}

.tier-col-row.retired {
  opacity: 0.5;
}

.tier-col-row.retired .tier-col-name {
  text-decoration: line-through;
}

.tier-col-empty {
  padding: 20px;
  text-align: center;
  color: #555;
  font-size: 0.8rem;
  font-style: italic;
}

/* ============================
   RESPONSIVE
============================ */
@media (max-width: 1100px) {
  .tier-columns {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .table-header, .player-row {
    grid-template-columns: 50px 65px 1fr 70px;
  }
  .table-header div:nth-child(4),
  .player-row .player-region {
    display: none;
  }
  .player-tiers {
    justify-content: flex-start;
    margin-top: 8px;
    grid-column: 1 / -1;
    gap: 8px;
  }
  .tier-circle-inner { width: 38px; height: 38px; }
  .tier-circle .gm-img { width: 22px; height: 22px; }
  .tier-label { font-size: 0.65rem; }
}

@media (max-width: 700px) {
  .tier-columns {
    grid-template-columns: 1fr;
  }
  .tier-col-body {
    max-height: none;
  }
}