
/* Reset & base */
* {
  margin: 0; 
  padding: 0; 
  box-sizing: border-box;
}

body {
  background-color: #1a1a2e; /* same dark blue-ish background */
  font-family: 'Poppins', sans-serif;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: #101024;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #3a3a5e;
}
.logo {
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: 2px;
  color: #f7b733;
}
nav a {
  color: #bdbdbd;
  margin-left: 2rem;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.2s ease;
}
nav a:hover, nav a.active {
  color: #f7b733;
}

/* Tabs */
.tabs {
  display: flex;
  background: #141433;
  border-radius: 10px;
  padding: 0.5rem;
  margin: 1rem 2rem;
  width: fit-content;
}
.tab {
  color: #bdbdbd;
  background: transparent;
  border: none;
  font-weight: 600;
  padding: 0.5rem 1.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}
.tab a {
  color: #bdbdbd;
  text-decoration: none;
}
.tab a:hover {
  color: black;
  text-decoration: none;
}
.tab.active, .tab:hover {
  background: #f7b733;
  color: #101024;
}

/* Table */
main {
  flex-grow: 1;
  margin: 0 2rem 2rem;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #141433;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
}
thead tr {
  background: #101024;
}
thead th {
  padding: 1rem 1.5rem;
  color: #f7b733;
  text-align: left;
  font-weight: 600;
}
tbody tr {
  border-bottom: 1px solid #3a3a5e;
}
tbody tr:hover {
  background: #272742;
}
tbody td {
  padding: 1rem 1.5rem;
  color: #e0e0e0;
}

/* Player name with icon */
.player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.player img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

/* Tier badges (example) */
.tier {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
}
.tier.master {
  background: linear-gradient(45deg, #f7b733, #f7d633);
  color: #101024;
}
.tier.diamond {
  background: linear-gradient(45deg, #34e89e, #0f3443);
  color: white;
}

/* Responsive */
@media (max-width: 600px) {
  nav a {
    margin-left: 1rem;
    font-size: 0.9rem;
  }
  .tabs {
    margin: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Site Header (cleaned & grid layout) */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem 2rem;
  background-color: #101024;
  border-bottom: 1px solid #3a3a5e;
  position: relative;
}

/* Left Logo */
.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.logo-img {
  height: 36px;
}
.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f7b733;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Center Discord */
.discord-container {
  display: flex;
  justify-content: center;
}

.discord-dropdown {
  position: relative;
}

.discord-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  background: #141433;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: background 0.3s;
}
.discord-button:hover {
  background: #f7b733;
  color: #101024;
}
.discord-button img {
  width: 20px;
  height: 20px;
}

/* Dropdown Menu */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #141433;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(0,0,0,0.4);
  z-index: 999;
}
.discord-dropdown:hover .dropdown-menu {
  display: block;
}
.dropdown-menu a {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #e0e0e0;
  transition: background 0.2s;
  white-space: nowrap;
}
.dropdown-menu a:hover {
  background: #272742;
}

/* Right placeholders for spacing */
.center-placeholder,
.right-placeholder {
  visibility: hidden;
}

/* Tier Ranking Grid */
.tier-ranking-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  padding: 2rem;
}

.tier-column {
  background: #141433;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.tier-column h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: #f7b733;
}

/* Tier Icons */
.tier-icon {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  margin-right: 8px;
  flex-shrink: 0;
}

/* Specific Tier colors */
.tier-1 h2 {
  color: #ffaf00; /* Gold-like */
}
.tier-2 h2 {
  color: #a0acba; /* Grey */
}
.tier-3 h2 {
  color: #a15c2a; /* Greenish */
}
.tier-4 h2 {
  color: #bfbab1; /* Medium blue */
  padding-left: 28px; /* space for missing icon */
  position: relative;
}
.tier-4 h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: transparent;
}
.tier-5 h2 {
  color: #bfbab1; /* Darker blue */
  padding-left: 28px;
  position: relative;
}
.tier-5 h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: transparent;
}

/* Tier Cards */
.tier-card {
  margin: 0.5rem 0;
  padding: 0.75rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.httier {
  background-color: #101024; /* Dark Blue for HT */
}
.lttier {
  background-color: #272742; /* Light Blue for LT */
}

/* Player */
.player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.player img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

/* Modal Overlay */
.modal {
  display: none;
  position: fixed;
  z-index: 1000; /* above everything */
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease forwards;
}
.modal.show {
  display: flex;
}

/* Modal Box */
.modal-content {
  background: #1a1a2e;
  border-radius: 12px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  text-align: center;
  position: relative;
  color: #e0e0e0;
  animation: slideIn 0.3s ease forwards;
}
.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.popup-content {
  background: #1e1e1e;
  border-radius: 12px;
  padding: 30px;
  width: 300px;
  text-align: center;
  color: white;
  position: relative;
  font-family: 'Poppins', sans-serif;
}

.popup-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 10px;
}

.popup-region {
  background: #333;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 14px;
}

.popup-label {
  margin-top: 10px;
  font-size: 12px;
  color: #bbb;
}

.popup-rank {
  font-weight: 600;
  margin-bottom: 15px;
}

.popup-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  justify-content: center;
}

.tier-box {
  background: #333;
  border-radius: 8px;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: white;
  position: relative;
}

.tier-box[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: #444;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 22px;
  cursor: pointer;
}
tbody tr {
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}

tbody tr:hover {
  transform: scale(1.015);
  background-color: #2a2a2e;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.15);
}
/* Popup overlay */
.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Popup card */
.popup-card {
  background: #1a1a1d;
  color: white;
  border-radius: 16px;
  padding: 30px;
  width: 350px;
  position: relative;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  text-align: center;
}

/* Player avatar */
.popup-card img.avatar {
  border-radius: 50%;
  border: 3px solid gold;
  width: 100px;
  height: 100px;
  margin-bottom: 10px;
}

/* Player name */
.popup-card .name {
  font-size: 22px;
  font-weight: bold;
}

/* Player region badge */
.popup-card .region {
  font-size: 14px;
  background: #2f2f32;
  color: #ccc;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 6px;
}

/* Position text */
.popup-card .position {
  font-size: 14px;
  margin-top: 20px;
  font-weight: bold;
  color: #ccc;
}
.popup-card .position strong {
  font-size: 18px;
  color: white;
}

/* Tier badges container */
.popup-card .tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

/* Tier badge style */
.tier-badge {
  padding: 6px 12px;
  border-radius: 8px;
  background: #2f2f32;
  font-weight: 600;
  font-size: 13px;
  color: #ffcc00;
  cursor: default;
  position: relative;
}

/* Tooltip on hover */
.tier-badge[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 1;
}

/* Empty slot if no tier */
.empty-box {
  width: 40px;
  height: 28px;
  background: #2f2f32;
  border-radius: 8px;
}

/* Close button */
.popup-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 20px;
  cursor: pointer;
  color: #888;
}
.tier-entry {
  display: flex;
  align-items: center;
  background: #222236;
  border-radius: 10px;
  padding: 6px 10px;
  gap: 8px;
  transition: transform 0.2s ease, background 0.2s ease;
}
.tier-entry:hover {
  transform: translateY(-3px);
  background: #2c2c40;
}
.tier-icon {
  width: 24px;
  height: 24px;
}
.tier-text {
  font-weight: 600;
  color: #f7b733;
}
/* Popup overlay */
.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Card container */
.popup-card {
  background: #1a1a1d;
  color: white;
  border-radius: 16px;
  padding: 30px;
  width: 350px;
  position: relative;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  text-align: center;
}

/* Close button (X) */
.popup-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 20px;
  cursor: pointer;
  color: #888;
  transition: color 0.2s;
}
.popup-close:hover {
  color: #ccc;
}

/* Avatar */
.popup-card img.avatar {
  border-radius: 50%;
  border: 3px solid gold;
  width: 100px;
  height: 100px;
  margin-bottom: 10px;
}

/* Name and region */
.popup-card .name {
  font-size: 22px;
  font-weight: bold;
}
.popup-card .region {
  font-size: 14px;
  background: #2f2f32;
  color: #ccc;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 6px;
}

/* Position */
.popup-card .position {
  font-size: 14px;
  margin-top: 20px;
  font-weight: bold;
  color: #ccc;
}
.popup-card .position strong {
  font-size: 18px;
  color: white;
}

/* Tiers layout */
.popup-card .tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

/* Tier entry (with icon and text) */
.tier-entry {
  display: flex;
  align-items: center;
  background: #2f2f32;
  border-radius: 8px;
  padding: 4px 8px;
  gap: 6px;
  font-weight: 600;
  color: #ffcc00;
  font-size: 13px;
  position: relative;
  transition: background 0.2s;
}
.tier-entry:hover {
  background: #3a3a3f;
}

/* Tooltip on hover */
.tier-entry[data-tooltip]:hover::after,
.empty-box[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 10;
}

/* Tier icon inside the box */
.tier-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
}

/* Empty box for unranked gamemodes */
.empty-box {
  width: 40px;
  height: 28px;
  background: #2f2f32;
  border-radius: 8px;
  position: relative;
}
.empty-box:hover {
  background: #3a3a3f;
}
/* Section label */
.tiers-label {
  margin-top: 20px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid #444;
  padding-bottom: 4px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* Tier container */
.popup-card .tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

/* Active Tier Box (MCTiers-style) */
.tier-entry {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  background: linear-gradient(145deg, #facc15, #eab308); /* gold */
  color: #000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  position: relative;
  transition: all 0.2s ease;
}
.tier-entry:hover {
  transform: scale(1.05);
  background: linear-gradient(145deg, #fde047, #facc15);
}

/* Tier icon */
.tier-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
}

/* Tooltip for both */
.tier-entry[data-tooltip]:hover::after,
.empty-box[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

/* Empty tier box */
.empty-box {
  width: 40px;
  height: 28px;
  background: #2f2f32;
  border-radius: 10px;
  position: relative;
  transition: background 0.2s ease;
}
.empty-box:hover {
  background: #3a3a3f;
}
.popup-card .tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}

.tier-entry {
  display: flex;
  align-items: center;
  padding: 6px 10px 6px 8px;
  border-radius: 8px;
  background: linear-gradient(135deg, #333 0%, #222 100%);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.05);
  font-weight: 600;
  font-size: 13px;
  color: #fdd835;
  position: relative;
  transition: transform 0.2s ease, background 0.3s ease;
}

.tier-entry:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #444 0%, #2b2b2b 100%);
}

.tier-icon {
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 4px;
}

.tier-text {
  color: #fff;
  font-weight: 600;
}

.empty-box {
  width: 48px;
  height: 30px;
  border-radius: 8px;
  background: #1f1f22;
  opacity: 0.5;
  position: relative;
}

.tier-entry[data-tooltip]:hover::after,
.empty-box[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: #444;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 10;
  opacity: 1;
}
.tier-badge {
  background: #1a1a1a;
  border: 2px solid gold;
  border-radius: 50px;
  width: 60px;
  height: 75px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 4px;
  padding: 5px 0;
  transition: transform 0.2s ease;
}

.tier-badge:hover {
  transform: scale(1.05);
  background-color: #222;
}

.tier-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
}

.tier-label {
  font-weight: 700;
  color: gold;
  font-size: 14px;
}
.tier-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  align-items: center;
}

.tier-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #2f2f32;
  border-radius: 10px;
  padding: 6px;
  width: 50px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: #ffcc00;
  font-size: 12px;
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
  transition: transform 0.2s ease;
}

.tier-badge:hover {
  transform: scale(1.05);
  background: #3a3a3d;
}

.tier-badge img {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  border-radius: 4px;
}
/* Center the tiers grid and reduce spacing */
.popup-card .tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 16px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

/* Smaller tier box style */
.tier-entry {
  display: flex;
  align-items: center;
  background: #2f2f32;
  border-radius: 6px;
  padding: 2px 6px;
  gap: 4px;
  font-weight: 600;
  color: #ffcc00;
  font-size: 11px;
  position: relative;
}

/* Smaller gamemode icons */
.tier-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

/* Optional: Smaller player avatar */
.popup-card img.avatar {
  border-radius: 50%;
  border: 3px solid gold;
  width: 90px;
  height: 90px;
  margin-bottom: 6px;
}
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;   /* center vertically */
  justify-content: center; /* center horizontally */
  z-index: 9999;
}

.popup-card {
  background: #1e1e1e;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  color: white;
  width: 340px;
  max-width: 90%;
  position: relative;
  box-shadow: 0 0 15px rgba(0,0,0,0.6);
}
.tier-icon {
  width: 26px;
  height: 26px;
  margin-right: 6px;
  vertical-align: middle;
}
/* GAMEMODE TIER BOX IN TABLE */
.tier-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #131420;
  border: 2px solid gold;
  border-radius: 10px;
  padding: 6px 6px;
  margin: 0 4px;
  width: 40px;
  transition: transform 0.2s;
}

.tier-box:hover {
  transform: scale(1.1);
}

/* ICON INSIDE TIER BOX */
.tier-box img {
  width: 24px;
  height: 24px;
  margin-bottom: 3px;
}

/* HT1, LT2 TEXT UNDER ICON */
.tier-box span {
  font-size: 10px;
  font-weight: bold;
  color: #ffc;
  text-shadow: 0 0 2px rgba(0,0,0,0.5);
}
.tier-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #131420;
  border: 2px solid gold;
  border-radius: 10px;
  padding: 4px;
  margin: 0 4px;
  width: 36px;
  transition: transform 0.2s;
}

.tier-box:hover {
  transform: scale(1.1);
}

.tier-box img {
  width: 20px;
  height: 20px;
  margin-bottom: 3px;
}

.tier-box span {
  font-size: 10px;
  font-weight: bold;
  color: #ffc;
  text-shadow: 0 0 2px rgba(0,0,0,0.5);
}
#playerPopup {
  display: none; /* hidden by default */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1e1e1e;
  border: 2px solid gold;
  border-radius: 12px;
  padding: 20px;
  z-index: 9999;
  color: white;
  width: 350px;
  max-width: 90%;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}
