:root {
  --bg: #1a1a1a;
  --bg-secondary: #222222;
  --surface: #252525;
  --surface-hover: #2d2d2d;
  --border: rgba(255, 255, 255, 0.08);
  --text-main: #f9fbff;
  --text-muted: #9aa3b7;
  --accent: #d4af37;
  --accent-secondary: #8b7e1a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d4af37, #8b7e1a);
  border-radius: 6px;
  border: 2px solid var(--surface);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #e0c968, #9b8e2a);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

/* Firefox Scrollbar */
* {
  scrollbar-color: linear-gradient(180deg, #d4af37, #8b7e1a) var(--bg);
  scrollbar-width: thin;
}

body {
  background: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

/* ===============================
   HEADER
   =============================== */

.header {
  background: linear-gradient(135deg, rgba(37, 37, 37, 0.8), rgba(39, 39, 39, 0.8));
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  margin-bottom: 32px;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.header-left {
  flex-shrink: 0;
}

.logo {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
}

.logo-long {
  height: 60px;
  object-fit: contain;
  width: 100%;
  transition: transform 0.25s ease, filter 0.25s ease;
  filter:
    drop-shadow(0 16px 30px rgba(0, 0, 0, 0.75))
    drop-shadow(0 0 40px rgba(212, 175, 55, 0.28))
    drop-shadow(0 0 18px rgba(212, 175, 55, 0.22));
}

.logo-long:hover {
  transform: translateY(-4px) scale(1.06);
  filter:
    drop-shadow(0 20px 36px rgba(0, 0, 0, 0.8))
    drop-shadow(0 0 50px rgba(212, 175, 55, 0.35))
    drop-shadow(0 0 22px rgba(212, 175, 55, 0.28));
}

.header-center {
  flex: 1;
}

.header-center h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.header-center p {
  font-size: 13px;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

/* ===============================
   SEARCH BAR
   =============================== */

.search-container {
  flex: 1;
  max-width: 400px;
  margin: 0 auto;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-radius: 20px;
  background: rgba(37, 37, 37, 0.8);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  z-index: 5;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: transparent;
  border: none;
  border-radius: 20px;
  color: var(--text-main);
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.search-input:hover {
  transform: scale(1.02);
}

.search-input:focus {
  transform: scale(1.04);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:-webkit-autofill,
.search-input:-webkit-autofill:hover,
.search-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-main);
  -webkit-box-shadow: 0 0 0 1000px rgba(37, 37, 37, 0.95) inset;
  box-shadow: 0 0 0 1000px rgba(37, 37, 37, 0.95) inset;
  border: 2px solid rgba(212, 175, 55, 0.3);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.3s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.search-input:focus ~ .search-icon {
  color: #d4af37;
}

.search-input:hover ~ .search-icon {
  transform: translateY(-50%) scale(1.02);
}

.search-input:focus ~ .search-icon {
  transform: translateY(-50%) scale(1.06);
}

.search-input-wrapper:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.55);
}

.search-input-wrapper:focus-within {
  border-color: #d4af37;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.4), inset 0 0 10px rgba(212, 175, 55, 0.1);
  transform: scale(1.04);
}

.search-results {
  position: absolute;
  top: 100%;
  transform: translateY(2px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-top: none;
  border-radius: 0 0 16px 16px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 20;
}

.search-input-wrapper {
  overflow: hidden;
}

.search-input-wrapper.open {
  overflow: visible;
}
.search-results.active {
  max-height: 500px;
  overflow-y: auto;
}

.search-results::-webkit-scrollbar {
  width: 10px;
}

.search-results::-webkit-scrollbar-track {
  background: rgba(20, 20, 20, 0.6);
  border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #444, #2c2c2c);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.35);
  transition: all 0.2s ease;
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #555, #3a3a3a);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.45);
}

.search-results {
  scrollbar-color: #3a3a3a rgba(20, 20, 20, 0.6);
  scrollbar-width: thin;
}
.search-result-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  cursor: pointer;
  transition: background 0.2s, transform 0.16s ease, box-shadow 0.16s ease;
}

.search-result-item:hover {
  background: rgba(212, 175, 55, 0.1);
  transform: translateX(3px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid rgba(212, 175, 55, 0.4);
  object-fit: cover;
  flex-shrink: 0;
  transition: border-color 0.2s;
}

.search-result-item:hover .search-result-avatar {
  border-color: #d4af37;
}

.search-result-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-name {
  color: #e7ebf5;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  transition: color 0.16s ease, text-shadow 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.search-result-tiers {
  font-size: 12px;
  color: #b7becf;
  font-weight: 600;
  transition: color 0.16s ease, text-shadow 0.16s ease;
}

.search-result-item:hover .search-result-name {
  color: #f2d572;
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.55);
}

.search-result-item:hover .search-result-tiers {
  color: #e0c25d;
  text-shadow: 0 0 6px rgba(212, 175, 55, 0.35);
}

.search-rank {
  font-weight: 800;
  font-size: 14px;
  min-width: 26px;
  text-align: right;
  color: #e7ebf5;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.rank-gold { color: #f6c14e; text-shadow: 0 0 8px rgba(246, 193, 78, 0.55); }
.rank-silver { color: #cfd6e3; text-shadow: 0 0 8px rgba(207, 214, 227, 0.45); }
.rank-bronze { color: #e3a05c; text-shadow: 0 0 8px rgba(227, 160, 92, 0.45); }
.rank-runner { color: #d9c27a; text-shadow: 0 0 6px rgba(217, 194, 122, 0.35); }

.search-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #d4af37, #8b7e1a);
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
}

.btn-discord {
  background: rgba(38, 196, 133, 0.18);
  color: #26c485;
  border: 1px solid rgba(38, 196, 133, 0.45);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-discord:hover {
  background: rgba(38, 196, 133, 0.28);
  border-color: rgba(38, 196, 133, 0.65);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(38, 196, 133, 0.35);
}

.btn-discord:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(38, 196, 133, 0.25);
}

.discord-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.45));
}

.small-discord-icon {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
}

.btn-secondary {
  background: rgba(212, 175, 55, 0.15);
  color: var(--text-main);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.btn-secondary:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: rgba(212, 175, 55, 0.5);
}

.btn-admin {
  background: rgba(100, 200, 100, 0.2);
  color: #64c864;
  border: 1px solid rgba(100, 200, 100, 0.4);
}

.btn-admin:hover {
  background: rgba(100, 200, 100, 0.3);
  border-color: rgba(100, 200, 100, 0.6);
}

.btn-logout {
  background: rgba(255, 100, 100, 0.2);
  color: #ff6464;
  border: 1px solid rgba(255, 100, 100, 0.4);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-logout:hover {
  background: rgba(255, 100, 100, 0.3);
  border-color: rgba(255, 100, 100, 0.6);
}

.btn-secondary {
  background: rgba(212, 175, 55, 0.15);
  color: #e6c742;
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.btn-secondary:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: rgba(212, 175, 55, 0.7);
  transform: translateY(-2px);
}

/* ===============================
   TABS
   =============================== */

.tabs-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0;
  margin-bottom: 32px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.tabs-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 8px;
  min-height: 48px;
  align-items: center;
}

.context-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.context-bar.hidden {
  display: none;
}

.server-ip-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(145deg, rgba(31, 31, 31, 0.9), rgba(22, 22, 22, 0.9));
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  min-height: 70px;
  position: relative;
  z-index: 5;
  overflow: visible;
}

.server-ip-card.animate-in {
  opacity: 0;
  transform: translateY(-50px);
  animation: tierDropFade 0.75s ease forwards;
}

.server-ip-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.server-ip-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.server-ip-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  width: 100%;
}

.server-ip-row {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  width: 100%;
}

.server-ip-label {
  font-size: 11px;
  letter-spacing: 0.6px;
  color: #d9d9d9;
  opacity: 0.8;
}

.server-ip-value {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #f3d984;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  height: 34px;
  box-sizing: border-box;
  border-radius: 0 10px 10px 0;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: visible;
  z-index: 20;
}

.server-ip-value:hover {
  background: rgba(212, 175, 55, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(212, 175, 55, 0.15);
}

.server-ip-value.copied {
  background: rgba(58, 209, 99, 0.2);
  border-color: rgba(58, 209, 99, 0.6);
  color: #b7ffd3;
  box-shadow: 0 0 10px rgba(58, 209, 99, 0.4);
}

.verified-servers {
  position: relative;
  width: 100%;
  max-width: 32px;
}

.verified-toggle {
  margin-top: 0;
  width: 32px;
  height: 34px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #f3d984;
  font-weight: 700;
  font-size: 14px;
  padding: 0;
  border-radius: 10px 0 0 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.verified-toggle:hover {
  background: rgba(212, 175, 55, 0.16);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(212, 175, 55, 0.12);
}

.verified-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: dropdownFade 0.22s ease forwards;
  z-index: 500;
  transform-origin: top left;
  backdrop-filter: blur(4px);
}

.verified-dropdown.open {
  display: flex;
  animation: dropdownFade 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.verified-header {
  padding: 10px 12px;
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #f3d984;
  background: rgba(212, 175, 55, 0.08);
  border-bottom: 1px solid rgba(212, 175, 55, 0.16);
  font-weight: 800;
}

.verified-option {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #f7f0d5;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  flex-wrap: wrap;
}

.verified-option:hover {
  background: rgba(212, 175, 55, 0.12);
  transform: translateX(2px);
}

.verified-name {
  flex: 1 1 auto;
  color: #fdf5d0;
  font-size: 14px;
  letter-spacing: 0.3px;
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.25);
}

.verified-ip {
  color: #b0ff6a;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.verified-copy-btn {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #b0ff6a;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: all 0.2s ease;
}

.verified-copy-btn:hover {
  background: rgba(176, 255, 106, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(176, 255, 106, 0.35), 0 8px 16px rgba(176, 255, 106, 0.18);
}

.verified-copy-btn.copied {
  background: rgba(176, 255, 106, 0.18);
  border-color: rgba(176, 255, 106, 0.65);
  color: #d6ffae;
  box-shadow: 0 0 16px rgba(176, 255, 106, 0.45);
}

.verified-copy-btn .copy-icon {
  width: 14px;
  height: 14px;
}

.verified-tooltip {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #f3d984;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
}

.verified-copy-btn:hover .verified-tooltip,
.verified-copy-btn.copied .verified-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}
@keyframes dropdownFade {
  0% { opacity: 0; transform: translateY(-10px) scale(0.95); filter: blur(2px); }
  60% { opacity: 1; transform: translateY(2px) scale(1.02); filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.verified-dropdown.closing {
  animation: dropdownClose 0.18s ease forwards;
}

@keyframes dropdownClose {
  0% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  100% { opacity: 0; transform: translateY(-8px) scale(0.97); filter: blur(2px); }
}

.server-discord-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: #cfd4ff;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, filter 0.2s ease;
  height: 28px;
  min-width: 28px;
  box-shadow: none;
  filter: drop-shadow(0 6px 12px rgba(88, 101, 242, 0.5));
  z-index: 1;
}

.server-discord-btn.animate-in {
  opacity: 1;
  transform: none;
  animation: none;
}

.server-discord-btn:hover {
  transform: translateY(-1px) scale(1.05);
  filter: drop-shadow(0 10px 18px rgba(88, 101, 242, 0.6));
}

.server-discord-btn .discord-icon {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 6px 12px rgba(88, 101, 242, 0.7));
}

.server-discord-tooltip {
  position: absolute;
  bottom: 120%;
  right: 0;
  background: rgba(26, 19, 52, 0.92);
  color: #b999ff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

.server-discord-btn:hover .server-discord-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.server-ip-copy-icon {
  width: 14px;
  height: 14px;
  opacity: 0.85;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.server-ip-value:hover .server-ip-copy-icon {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.35));
}

.server-ip-value .copy-text {
  display: inline-block;
}

.server-ip-value.copied .copy-text {
  visibility: visible;
}

.server-ip-tooltip {
  position: absolute;
  bottom: 120%;
  right: 0;
  background: rgba(0, 0, 0, 0.85);
  color: #f3d984;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  z-index: 200;
}

.server-ip-value:hover .server-ip-tooltip,
.server-ip-value.copied .server-ip-tooltip {
  opacity: 1;
  transform: translateY(0);
}

#tabLoadingBar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #d4af37, #8b7e1a);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
  transition: width 0.35s ease;
  pointer-events: none;
}

#tabActiveIndicator {
  position: absolute;
  bottom: 0;
  height: 3px;
  width: 0;
  background: #d4af37;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
  border-radius: 999px;
  transition: transform 0.25s ease, width 0.25s ease;
  pointer-events: none;
}

.tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  height: 48px;
  display: flex;
  align-items: center;
  font-family: inherit;
}

.tab:hover {
  color: #e6c742;
  transform: translateY(-1px);
}

.tab.active {
  color: var(--accent);
}

.tab img {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
  transition: transform 0.2s, filter 0.2s;
}

.tab:hover img,
.tab.active img {
  transform: translateY(-1px);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

/* ===============================
   MAIN CONTENT
   =============================== */

.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  margin-bottom: 60px;
}

.tiers-wrapper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  grid-auto-rows: max-content;
  width: 100%;
}

.overall-desktop-list,
.overall-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.overall-mobile-list {
  display: none;
}

@font-face {
  font-family: "Minecraft";
  src: url("/fonts/Minecraft.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.rank-info-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 14px;
  position: relative;
  width: 100%;
  z-index: 60;
  opacity: 0;
  transform: translateY(-20px);
  animation: infoDropFade 0.6s ease forwards;
  animation-delay: 0.05s;
}

.rank-info-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.08));
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.4px;
  box-shadow: 0 10px 22px rgba(212, 175, 55, 0.2), 0 0 12px rgba(212, 175, 55, 0.14);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.rank-info-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(212, 175, 55, 0.26), 0 0 16px rgba(212, 175, 55, 0.18);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.24), rgba(212, 175, 55, 0.12));
}

.rank-info-icon {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.45));
}

.rank-info-dropdown {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: rgba(14, 14, 14, 0.98);
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.65), 0 0 18px rgba(212, 175, 55, 0.22);
  width: 520px;
  max-width: 90vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.rank-info-dropdown.open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.rank-info-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  position: relative;
}

.rank-info-tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(40, 40, 40, 0.85);
  color: #f9f4e2;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.rank-info-tab.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.24), rgba(212, 175, 55, 0.12));
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.2);
}

.rank-info-tab-indicator {
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.85), rgba(212, 175, 55, 0.1));
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.45);
  border-radius: 999px;
  transition: width 0.25s ease, transform 0.25s ease;
}

.rank-info-panels {
  position: relative;
}

.rank-info-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.rank-info-panel.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.rank-info-dropdown ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rank-info-header {
  margin-bottom: 12px;
  text-align: center;
}

.rank-info-title {
  color: #fbeec2;
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0.6px;
  text-shadow: 0 1px 6px rgba(212, 175, 55, 0.45);
}

.rank-info-subtitle {
  color: #e0ded7;
  font-size: 13px;
  margin-top: 6px;
  line-height: 1.45;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.rank-info-divider {
  margin-top: 10px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.6), transparent);
}

.rank-info-item {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
}

.rank-info-points {
  color: #f4f4f4;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.rank-info-dropdown .combat-rank-pill {
  transform: none;
  box-shadow: none;
}

.rank-info-dropdown .combat-rank-pill::after {
  display: none;
}

.rank-achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.rank-achievement-card {
  background: rgba(25, 25, 25, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rank-achievement-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rank-achievement-icon {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.4));
  flex-shrink: 0;
}

.rank-achievement-title {
  color: #fbeec2;
  font-weight: 800;
  font-size: 13px;
}

.rank-achievement-desc {
  color: #e0ded7;
  font-size: 12px;
}

.kit-info-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  position: absolute;
  top: -54px;
  left: 0;
  width: 100%;
  z-index: 20;
  opacity: 0;
  transform: translateY(-20px);
  animation: infoDropFade 0.6s ease forwards;
  animation-delay: 0.05s;
}

@keyframes infoDropFade {
  0% {
    opacity: 0;
    transform: translateY(-14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.kit-info-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.08));
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.4px;
  box-shadow: 0 10px 22px rgba(212, 175, 55, 0.2), 0 0 12px rgba(212, 175, 55, 0.14);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  margin-left: 0;
  margin-top: 0;
}

.kit-info-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(212, 175, 55, 0.26), 0 0 16px rgba(212, 175, 55, 0.18);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.24), rgba(212, 175, 55, 0.12));
}

.kit-info-dropdown {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translate(-50%, -6px);
  background: rgba(18, 18, 18, 0.96);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35), 0 0 16px rgba(212, 175, 55, 0.18);
  width: 440px;
  max-width: 440px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.kit-info-dropdown.open {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.kit-info-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  position: relative;
}

.kit-tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(40, 40, 40, 0.85);
  color: #f9f4e2;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.kit-tab.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.24), rgba(212, 175, 55, 0.12));
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.2);
}

.kit-tab-indicator {
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.85), rgba(212, 175, 55, 0.1));
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.45);
  border-radius: 999px;
  transition: width 0.25s ease, transform 0.25s ease;
}

.kit-info-body {
  background: rgba(28, 28, 28, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 10px;
  padding: 12px;
}

.kit-panel {
  display: none;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.kit-panel.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.kit-info-title {
  color: #fbeec2;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-align: center;
}

.kit-info-subtitle {
  color: #e0ded7;
  font-size: 12px;
  text-align: center;
  line-height: 1.4;
}

.kit-info-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.6), transparent);
  margin: 6px 0 10px;
}

.kit-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.kit-preview img {
  width: 360px;
  height: auto;
  max-height: 320px;
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35), 0 0 12px rgba(212, 175, 55, 0.2);
}

.kit-contents-placeholder {
  color: #cfcfcf;
  text-align: center;
  font-style: italic;
  padding: 8px;
}

.tier-points-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px 12px;
}

.tier-points-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(22, 22, 22, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.3);
}

.tier-point-label {
  font-weight: 800;
  letter-spacing: 0.3px;
}

.tier-point-value {
  color: #f4f4f4;
  font-weight: 700;
}

.profile-card {
  width: 100%;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(139, 126, 26, 0.08));
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-card-title {
  color: #9aa3b7;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
}

.profile-card-icons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.achievements-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.achievement-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(30, 30, 30, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  color: #f3e8b3;
  font-weight: 800;
  letter-spacing: 0.2px;
  position: relative;
  cursor: default;
  overflow: visible;
}

.achievement-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.5));
}

.achievements-empty {
  color: #9aa3b7;
  text-align: center;
  font-style: italic;
  width: 100%;
}

/* Custom scrollbar (global) */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.7) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.75);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
  transition: background 0.2s ease;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.9);
}

.achievement-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: rgba(14, 14, 14, 0.98);
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45), 0 0 12px rgba(212, 175, 55, 0.25);
  padding: 10px 12px;
  border-radius: 10px;
  min-width: 220px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-align: center;
  z-index: 15;
}

.achievement-pill:hover .achievement-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.achievement-tooltip .ach-title {
  color: #fbeec2;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 6px rgba(212, 175, 55, 0.45);
}

.achievement-tooltip .ach-subtitle {
  color: #e0ded7;
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.35;
  font-weight: 700;
}

.achievement-tooltip .ach-date {
  color: #c7c7c7;
  font-size: 11px;
  margin-top: 6px;
  font-style: italic;
}
.overall-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 22px auto 10px;
  width: 100%;
  flex-wrap: wrap;
}

.pagination-button {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.14), rgba(212, 175, 55, 0.08));
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(212, 175, 55, 0.18), 0 0 14px rgba(212, 175, 55, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, opacity 0.25s ease;
}

.pagination-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 28px rgba(212, 175, 55, 0.25), 0 0 18px rgba(212, 175, 55, 0.16);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.12));
}

.pagination-button.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.pagination-status {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.4px;
}

#tiersContainer {
  width: 100%;
  position: relative;
}

#tiersContainer > .leaderboard-row {
  display: grid;
  grid-template-columns: 50px auto 1fr 1fr;
  margin-bottom: 12px;
}

.tier-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.tier-section:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.1);
}

.tier-section.animate-in {
  opacity: 0;
  transform: translateY(-60px);
  animation: tierDropFade 0.9s ease forwards;
  animation-delay: var(--tier-delay, 0ms);
}

@keyframes tierDropFade {
  0% {
    opacity: 0;
    transform: translateY(-60px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.tier-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(139, 126, 26, 0.12));
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.tier-label-badge {
  display: inline-block;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #f7e6b0;
  padding: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-align: center;
  width: 100%;
  gap: 10px;
}

.tier-label-badge::before {
  content: none;
  width: 22px;
  height: 22px;
  background: url("/assets/trophy.png") center/contain no-repeat;
  display: inline-block;
}

.tier-players {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  flex: 1;
  overflow: hidden;
}

.tier-player-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 0 8px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.tier-player-row:hover {
  transform: translateY(-1px);
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.tier-player-row .tier-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

.tier-player-name {
  color: var(--text-main);
  font-weight: 600;
  font-size: 13px;
  overflow: visible;
  white-space: normal;
  font-family: inherit;
}

.tier-rank-chip {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.tier-rank-high {
  color: #e6c742;
}

.tier-rank-low {
  color: #9aa3b7;
}

.tier-empty {
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

.overall-container {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tiers-wrapper > div[style*="width: 100%"] {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tier-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}

.tier-section:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.1);
}

.tier-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.tier-label-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  color: #fff8e5;
  padding: 0;
  border-radius: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.6px;
  margin-bottom: 0;
  box-shadow: none;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  width: 100%;
  text-align: center;
}

.tier-label-badge::before {
  content: none;
  width: 22px;
  height: 22px;
  background: url("/assets/trophy.png") center/contain no-repeat;
  display: inline-block;
}

.tier-section.tier-1 .tier-header {
  background: #3d3012;
  border-bottom-color: #5b461b;
}

.tier-section.tier-1 .tier-label-badge {
  background: transparent;
  color: #f6c14e;
  font-size: 30px;
  text-shadow: 0 0 12px rgba(246, 193, 78, 0.6), 0 0 18px rgba(246, 193, 78, 0.45);
}
.tier-section.tier-1 .tier-label-badge::before {
  content: "";
  filter: sepia(1) saturate(6) hue-rotate(10deg) brightness(1.05) drop-shadow(0 0 10px rgba(246, 193, 78, 0.6));
}


.tier-section.tier-2 .tier-header {
  background: #2f3441;
  border-bottom-color: #434a58;
}

.tier-section.tier-2 .tier-label-badge {
  background: transparent;
  color: #c7d2e2;
  font-size: 30px;
  text-shadow: 0 0 8px rgba(199, 210, 226, 0.35);
}
.tier-section.tier-2 .tier-label-badge::before {
  content: "";
  filter: grayscale(1) brightness(1.4) drop-shadow(0 0 8px rgba(199, 210, 226, 0.4));
}


.tier-section.tier-3 .tier-header {
  background: #3c291f;
  border-bottom-color: #5a3a2b;
}

.tier-section.tier-3 .tier-label-badge {
  background: transparent;
  color: #e3a05c;
  font-size: 30px;
  text-shadow: 0 0 8px rgba(227, 160, 92, 0.35);
}
.tier-section.tier-3 .tier-label-badge::before {
  content: "";
  filter: sepia(1) saturate(3) hue-rotate(-12deg) brightness(0.95) drop-shadow(0 0 8px rgba(227, 160, 92, 0.4));
}


.tier-section.tier-4 .tier-header,
.tier-section.tier-5 .tier-header {
  background: #1f2126;
  border-bottom-color: #2b2e35;
}

.tier-section.tier-4 .tier-label-badge,
.tier-section.tier-5 .tier-label-badge {
  background: transparent;
  color: #e2e5ea;
  font-size: 30px;
}
.tier-section.tier-4 .tier-label-badge::before,
.tier-section.tier-5 .tier-label-badge::before {
  content: none;
}

.tier-players {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  flex: 1;
}

.tier-player-badge {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--accent);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* High tier (brighter background) */
.tier-player-badge.high-tier {
  background: rgba(212, 175, 55, 0.25);
  border-color: rgba(212, 175, 55, 0.6);
  color: #e6c742;
}

.tier-player-badge:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: rgba(212, 175, 55, 0.5);
  transform: translateX(4px);
}

.tier-player-badge.high-tier:hover {
  background: rgba(212, 175, 55, 0.35);
  border-color: rgba(212, 175, 55, 0.8);
}

.tier-empty {
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

/* ===============================
   LEADERBOARD
   =============================== */

.leaderboard-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  grid-template-columns: 140px 2.4fr 3fr 110px;
  align-items: center;
  gap: 16px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease, border-color 0.35s ease, background 0.35s ease;
  cursor: pointer;
  margin-bottom: 12px;
  opacity: 1;
  transform: translateX(0) scale(1);
}

.leaderboard-row:hover {
  border-color: var(--accent);
  box-shadow: 0 16px 42px rgba(212, 175, 55, 0.32), 0 0 32px rgba(212, 175, 55, 0.22);
  transform: translateX(12px) scale(1.03);
  background: var(--surface-hover);
}

/* Medal ranks styling */
.leaderboard-row.medal-gold {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.35), rgba(212, 175, 55, 0.14));
  border: 2px solid #d4af37;
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.45), inset 0 0 12px rgba(212, 175, 55, 0.18);
  position: relative;
  overflow: visible;
}

.leaderboard-row.medal-gold:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.35), rgba(212, 175, 55, 0.15));
  border-color: #d4af37;
  box-shadow: 0 18px 48px rgba(212, 175, 55, 0.55), inset 0 0 18px rgba(212, 175, 55, 0.3), 0 0 36px rgba(212, 175, 55, 0.45);
  transform: translateX(12px) scale(1.03);
}

.leaderboard-row.medal-silver {
  background: linear-gradient(135deg, rgba(207, 214, 227, 0.28), rgba(207, 214, 227, 0.12));
  border: 2px solid #cfd6e3;
  box-shadow: 0 0 18px rgba(207, 214, 227, 0.45), inset 0 0 12px rgba(207, 214, 227, 0.14);
  position: relative;
  overflow: visible;
}

.leaderboard-row.medal-silver:hover {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.3), rgba(192, 192, 192, 0.12));
  border-color: #c0c0c0;
  box-shadow: 0 18px 44px rgba(192, 192, 192, 0.55), inset 0 0 18px rgba(192, 192, 192, 0.26), 0 0 32px rgba(192, 192, 192, 0.4);
  transform: translateX(12px) scale(1.03);
}

.leaderboard-row.medal-bronze {
  background: linear-gradient(135deg, rgba(228, 164, 106, 0.3), rgba(228, 164, 106, 0.12));
  border: 2px solid #e4a46a;
  box-shadow: 0 0 18px rgba(228, 164, 106, 0.45), inset 0 0 12px rgba(228, 164, 106, 0.14);
  position: relative;
  overflow: visible;
}

.leaderboard-row.medal-bronze:hover {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.3), rgba(205, 127, 50, 0.12));
  border-color: #cd7f32;
  box-shadow: 0 18px 44px rgba(205, 127, 50, 0.55), inset 0 0 18px rgba(205, 127, 50, 0.26), 0 0 32px rgba(205, 127, 50, 0.4);
  transform: translateX(12px) scale(1.03);
}


.leaderboard-row.runner-up::after,
.leaderboard-row:not(.medal-gold):not(.medal-silver):not(.medal-bronze)::after {
  display: none;
}

/* Runner-up ranks (4-10) - subtle pastel gold/yellow */

.leaderboard-row.medal-gold .player-info,
.leaderboard-row.medal-silver .player-info,
.leaderboard-row.medal-bronze .player-info,
.leaderboard-row.runner-up .player-info {
  margin-left: 32px;
}

.leaderboard-row.runner-up {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(212, 175, 55, 0.05));
  border: 1px solid rgba(212, 175, 55, 0.25);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.15), inset 0 0 8px rgba(212, 175, 55, 0.08);
}

.leaderboard-row.runner-up:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.08));
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow: 0 16px 40px rgba(212, 175, 55, 0.28), inset 0 0 14px rgba(212, 175, 55, 0.14), 0 0 26px rgba(212, 175, 55, 0.2);
  transform: translateX(12px) scale(1.03);
}

.leaderboard-row.animate-in {
  opacity: 0;
  transform: translateX(-80px);
  animation: rowSlideFade 1.2s ease forwards;
  animation-delay: var(--row-delay, 0ms);
}

@keyframes rowSlideFade {
  0% {
    opacity: 0;
    transform: translateX(-80px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.leaderboard-rank {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 76px;
  border-radius: 16px;
  font-size: 26px;
  font-weight: 800;
  color: #e7ebf5;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  gap: 8px;
}

.leaderboard-rank::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
  opacity: 0.65;
}

.leaderboard-rank::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -30%;
  width: 60%;
  height: 180%;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
  transform: skewX(-18deg);
  animation: shineSweep 3s ease-in-out infinite;
  pointer-events: none;
}

.leaderboard-rank.rank-gold { color: #f6c14e; text-shadow: 0 0 10px rgba(246, 193, 78, 0.65), 0 0 18px rgba(246, 193, 78, 0.35); }
.leaderboard-rank.rank-silver { color: #d9e0ee; text-shadow: 0 0 9px rgba(217, 224, 238, 0.55), 0 0 14px rgba(217, 224, 238, 0.25); }
.leaderboard-rank.rank-bronze { color: #e4a46a; text-shadow: 0 0 9px rgba(228, 164, 106, 0.55), 0 0 14px rgba(228, 164, 106, 0.25); }
.leaderboard-rank.rank-runner { color: #d8c077; text-shadow: 0 0 6px rgba(216, 192, 119, 0.35); }

.leaderboard-rank .rank-trophy {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}
.leaderboard-rank .rank-medal {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: sepia(1) saturate(3) hue-rotate(-15deg) brightness(1.05) drop-shadow(0 0 8px rgba(216, 192, 119, 0.4));
}

.leaderboard-rank .rank-trophy.trophy-gold {
  filter: sepia(1) saturate(6) hue-rotate(10deg) brightness(1.05) drop-shadow(0 0 10px rgba(246, 193, 78, 0.65));
}
.leaderboard-rank .rank-trophy.trophy-silver {
  filter: grayscale(1) brightness(1.35) drop-shadow(0 0 8px rgba(217, 224, 238, 0.45));
}
.leaderboard-rank .rank-trophy.trophy-bronze {
  filter: sepia(1) saturate(3) hue-rotate(-12deg) brightness(0.95) drop-shadow(0 0 8px rgba(228, 164, 106, 0.45));
}

.modal .rank-trophy {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}
.modal .rank-medal {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: sepia(1) saturate(3) hue-rotate(-15deg) brightness(1.05) drop-shadow(0 0 8px rgba(216, 192, 119, 0.4));
}
.modal .rank-trophy.trophy-gold {
  filter: sepia(1) saturate(6) hue-rotate(10deg) brightness(1.05) drop-shadow(0 0 10px rgba(246, 193, 78, 0.65));
}
.modal .rank-trophy.trophy-silver {
  filter: grayscale(1) brightness(1.35) drop-shadow(0 0 8px rgba(217, 224, 238, 0.45));
}
.modal .rank-trophy.trophy-bronze {
  filter: sepia(1) saturate(3) hue-rotate(-12deg) brightness(0.95) drop-shadow(0 0 8px rgba(228, 164, 106, 0.45));
}

/* Keep compact/plain ranks for 11+ */
.leaderboard-row:not(.medal-gold):not(.medal-silver):not(.medal-bronze):not(.runner-up) .leaderboard-rank {
  width: auto;
  height: auto;
  padding: 0;
  background: none;
  box-shadow: none;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.45);
}

.leaderboard-row:not(.medal-gold):not(.medal-silver):not(.medal-bronze):not(.runner-up) .leaderboard-rank::before,
.leaderboard-row:not(.medal-gold):not(.medal-silver):not(.medal-bronze):not(.runner-up) .leaderboard-rank::after {
  display: none;
}

@keyframes shineSweep {
  0% { transform: translateX(-60%) skewX(-18deg); opacity: 0; }
  20% { opacity: 0.9; }
  50% { transform: translateX(140%) skewX(-18deg); opacity: 0; }
  100% { transform: translateX(140%) skewX(-18deg); opacity: 0; }
}

.player-info {
  display: flex;
  align-items: center;
  gap: 12px;
  align-self: center;
  min-width: 0;
  position: relative;
}

.player-avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 2px solid var(--border);
  object-fit: cover;
  transition: all 0.2s;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5);
}

.player-info:hover .player-avatar {
  transform: scale(1.05);
}

.player-details {
  flex: 1;
}

.player-info::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  right: 0;
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  display: none;
}

.leaderboard-row.medal-gold .player-info::before,
.leaderboard-row.medal-silver .player-info::before,
.leaderboard-row.medal-bronze .player-info::before,
.leaderboard-row.runner-up .player-info::before {
  opacity: 0.7;
  transform: translateX(0);
  display: block;
}

.player-info:hover::before {
  opacity: 0.9;
}


.player-details h3 {
  margin-bottom: 4px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 700;
}

.player-details p {
  font-size: 12px;
  color: var(--text-muted);
}

.player-rank-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.combat-rank-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.3px;
  cursor: default;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  z-index: 1;
}

.combat-rank-pill::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -42px;
  left: 50%;
  transform: translateX(-50%) translateY(6px) scale(0.92);
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--tooltip-bg, rgba(15, 15, 15, 0.95));
  color: var(--tooltip-text, #f4f4f4);
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), 0 0 12px var(--tooltip-glow, rgba(212, 175, 55, 0.35));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-weight: 700;
  letter-spacing: 0.25px;
  z-index: 12;
}

.combat-rank-pill:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.combat-rank-pill:hover {
  transform: translateY(-2px) scale(1.02);
}

.combat-rank-pill.rank-rookie {
  background: #4b4b4b;
  color: #f2f2f2;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  --tooltip-bg: rgba(35, 35, 35, 0.95);
  --tooltip-text: #f2f2f2;
  --tooltip-glow: rgba(120, 120, 120, 0.45);
}

.combat-rank-pill.rank-beginner {
  background: #7f6be8;
  color: #f0e9ff;
  box-shadow: 0 0 14px rgba(127, 107, 232, 0.5);
  --tooltip-bg: rgba(80, 60, 180, 0.95);
  --tooltip-text: #f0e9ff;
  --tooltip-glow: rgba(127, 107, 232, 0.55);
}

.combat-rank-pill.rank-apprentice {
  background: #d64545;
  color: #ffe8e8;
  box-shadow: 0 0 16px rgba(214, 69, 69, 0.55);
  animation: rank-pulse-red 2.8s ease-in-out infinite;
  --tooltip-bg: rgba(140, 36, 36, 0.95);
  --tooltip-text: #ffe8e8;
  --tooltip-glow: rgba(214, 69, 69, 0.6);
}

.combat-rank-pill.rank-pro {
  background: #b02222;
  color: #ffe5e5;
  box-shadow: 0 0 18px rgba(176, 34, 34, 0.55);
  overflow: hidden;
  --tooltip-bg: rgba(126, 16, 16, 0.95);
  --tooltip-text: #ffe5e5;
  --tooltip-glow: rgba(176, 34, 34, 0.65);
}
.combat-rank-pill.rank-pro::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  box-shadow: 0 0 26px rgba(176, 34, 34, 0.6);
  opacity: 0.0;
  animation: pro-pulse 2.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.combat-rank-pill.rank-elite {
  background: #1f4bff;
  color: #e4f1ff;
  box-shadow: 0 0 20px rgba(31, 75, 255, 0.6);
  animation: rank-pulse-blue 3s ease-in-out infinite;
  --tooltip-bg: rgba(20, 40, 150, 0.95);
  --tooltip-text: #e4f1ff;
  --tooltip-glow: rgba(31, 75, 255, 0.7);
}

.combat-rank-pill.rank-champion {
  background: #f0c94a;
  color: #2d2100;
  box-shadow: 0 0 22px rgba(240, 201, 74, 0.75);
  animation: rank-pulse-gold 2.5s ease-in-out infinite;
  --tooltip-bg: rgba(110, 80, 0, 0.95);
  --tooltip-text: #fff7da;
  --tooltip-glow: rgba(240, 201, 74, 0.85);
}

.combat-rank-pill.rank-grand-champion {
  background: #d6a400;
  color: #1c1300;
  box-shadow: 0 0 24px rgba(214, 164, 0, 0.8);
  animation: rank-pulse-grand 2.2s ease-in-out infinite, rank-sparkle 4s ease-in-out infinite;
  overflow: hidden;
  --tooltip-bg: rgba(95, 70, 0, 0.95);
  --tooltip-text: #fff5c0;
  --tooltip-glow: rgba(214, 164, 0, 0.9);
}
.combat-rank-pill.rank-grand-champion::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.35), transparent 60%);
  opacity: 0.8;
  animation: rank-gleam 3.5s ease-in-out infinite;
}

@keyframes rank-pulse-red {
  0%, 100% { box-shadow: 0 0 16px rgba(214, 69, 69, 0.45); }
  50% { box-shadow: 0 0 24px rgba(214, 69, 69, 0.7); }
}
@keyframes rank-pulse-blue {
  0%, 100% { box-shadow: 0 0 18px rgba(31, 75, 255, 0.5); }
  50% { box-shadow: 0 0 26px rgba(31, 75, 255, 0.75); }
}
@keyframes rank-pulse-gold {
  0%, 100% { box-shadow: 0 0 20px rgba(240, 201, 74, 0.65); }
  50% { box-shadow: 0 0 28px rgba(240, 201, 74, 0.9); }
}
@keyframes rank-pulse-grand {
  0%, 100% { box-shadow: 0 0 22px rgba(214, 164, 0, 0.7); }
  50% { box-shadow: 0 0 30px rgba(214, 164, 0, 0.95); }
}
@keyframes rank-shine {
  0% { transform: translateX(-140%); }
  50% { transform: translateX(140%); }
  100% { transform: translateX(140%); }
}
@keyframes rank-gleam {
  0%, 100% { transform: translate(0,0) scale(1); opacity: 0.7; }
  50% { transform: translate(6px,-4px) scale(1.08); opacity: 1; }
}
@keyframes rank-sparkle {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(214,164,0,0.55)); }
  50% { filter: drop-shadow(0 0 14px rgba(255, 220, 120, 0.9)); }
}
@keyframes pro-pulse {
  0%, 100% { opacity: 0.0; transform: scale(0.95); }
  50% { opacity: 0.55; transform: scale(1.05); }
}

.player-tiers {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  width: auto;
  max-width: 100%;
  text-align: right;
  position: absolute;
  right: 130px;
  top: 50%;
  transform: translateY(-50%);
  padding-right: 0;
}

.tier-icon-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;

  position: relative;}

.tier-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(35, 35, 35, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45), inset 0 0 8px rgba(212, 175, 55, 0.1);
}

.tier-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.tier-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  transition: all 0.2s ease;
  color: #f5f7ff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 6px rgba(212, 175, 55, 0.35);
  font-family: "Minecraft", "Press Start 2P", "VT323", "PixelOperator", "Pixelated", "monospace";
}

.tier-tooltip {
  position: absolute;
  background: linear-gradient(135deg, #d4af37, #8b7e1a);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.4);
  z-index: 1000;
  top: -45px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px) scale(0.8);
}

.tier-icon-container:hover .tier-icon-badge {
  transform: scale(1.15) translateY(-4px);
  border-color: rgba(212, 175, 55, 0.8);
  box-shadow: 0 8px 22px rgba(212, 175, 55, 0.4), inset 0 0 12px rgba(212, 175, 55, 0.2);
}

.tier-icon-container:hover .tier-icon-img {
  filter: brightness(1.3) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 6px rgba(212, 175, 55, 0.6));
}

.tier-icon-container:hover .tier-label {
  opacity: 0.6;
  font-size: 10px;
}

.tier-icon-container:hover .tier-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-12px) scale(1);
}

.player-stats {
  display: flex;
  gap: 20px;
  text-align: right;
  justify-self: end;
  margin-left: auto;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .leaderboard-row {
    grid-template-columns: 1fr;
    gap: 12px;
    position: relative;
  }

  .player-stats {
    justify-self: start;
  }

  .stat {
    align-items: flex-start;
  }

  /* Compact gamemode icons on mobile */
  .player-tiers {
    position: static;
    right: auto;
    top: auto;
    transform: none;
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 8px;
    row-gap: 10px;
    padding-right: 0;
  }

  .tier-icon-badge {
    width: 34px;
    height: 34px;
  }

  .tier-icon-label {
    font-size: 11px;
  }

  .overall-pagination {
    margin: 18px auto 8px;
    gap: 8px;
  }

  .pagination-button {
    padding: 7px 12px;
    font-size: 13px;
  }
}

/* ===============================
   MODAL
   =============================== */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}

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

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1;
  animation: fadeIn 0.3s ease-out;
  cursor: pointer;
}

.modal.show .modal-overlay {
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: var(--surface);
  border: 2px solid #d4af37;
  border-radius: 12px;
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  z-index: 2;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(212, 175, 55, 0.2);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

@keyframes slideUp {
  from {
    transform: translateY(50px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal.closing .modal-overlay {
  animation: fadeOut 0.3s ease-out forwards;
}

.modal.closing .modal-content {
  animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

@keyframes slideDown {
  from {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateY(50px) scale(0.95);
    opacity: 0;
  }
}

.modal-header {
  padding: 24px 24px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(212, 175, 55, 0.05);
}

.modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #f9fbff;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 32px;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 6px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  pointer-events: auto;
}

.modal-close:hover {
  transform: scale(1.15);
  animation: bounceScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bounceScale {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1.15); }
}

.modal-body {
  padding: 24px;
}

.modal-tier-card {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.modal-tier-card:hover {
  background: rgba(212, 175, 55, 0.15) !important;
  border-color: #d4af37 !important;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.3), 0 0 20px rgba(212, 175, 55, 0.15) !important;
}

.modal-tiers-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-tier-section {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.modal-tier-label {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 100px;
  font-size: 12px;
  text-transform: uppercase;
}

.modal-tier-value {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===============================
   FOOTER
   =============================== */

.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.footer p {
  margin: 0;
}

/* ===============================
   RESPONSIVE
   =============================== */

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .header-center h1 {
    font-size: 24px;
  }

  .header-right {
    width: 100%;
    justify-content: center;
  }

  .tabs-container {
    padding: 0 12px;
  }

  .tiers-table th,
  .tiers-table td {
    padding: 12px 16px;
    font-size: 12px;
  }

  .tier-badge {
    padding: 3px 8px;
    font-size: 11px;
  }

  .modal-content {
    width: 95%;
  }
}

/* ===============================
   LEADERBOARD
   =============================== */

.leaderboard-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  grid-template-columns: 50px auto 1fr 1fr;
  align-items: center;
  gap: 16px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  transform: translateX(0) scale(1);
}

.leaderboard-row:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgba(212, 175, 55, 0.28), 0 0 18px rgba(212, 175, 55, 0.2);
  transform: translateX(10px) scale(1.025);
}

.leaderboard-rank {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  color: var(--accent);
}

/* Plain white ranks for 11+ */
.leaderboard-row:not(.medal-gold):not(.medal-silver):not(.medal-bronze):not(.runner-up) .leaderboard-rank {
  color: #e7ebf5;
  text-shadow: none;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 2px solid var(--border);
  object-fit: cover;
  transition: all 0.2s;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5);
}

.player-info:hover .player-avatar {
  transform: scale(1.05);
}

.player-details {
  flex: 1;
}

.player-details h3 {
  margin-bottom: 4px;
  font-size: 15px;
}

.player-details p {
  font-size: 12px;
  color: var(--text-muted);
}

.player-tiers {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.tier-icon-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tier-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(35, 35, 35, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 0 8px rgba(212, 175, 55, 0.1);
}

.tier-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  transition: all 0.3s ease;
}

.tier-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.tier-icon-container:hover .tier-icon-badge {
  transform: scale(1.15) translateY(-4px);
  border-color: rgba(212, 175, 55, 0.8);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4), inset 0 0 12px rgba(212, 175, 55, 0.2);
}

.tier-icon-container:hover .tier-icon-img {
  filter: brightness(1.3) drop-shadow(0 0 6px rgba(212, 175, 55, 0.6));
}

.tier-icon-container:hover .tier-label {
  transform: scale(1.1);
}

.player-stats {
  display: flex;
  gap: 20px;
  text-align: right;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .leaderboard-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .player-stats {
    justify-self: start;
  }

  .stat {
    align-items: flex-start;
  }
}

/* ===============================
   MEDIA QUERIES
   =============================== */

@media (max-width: 1200px) {
  .tiers-wrapper {
    grid-template-columns: repeat(4, 1fr);
  }

  .overall-desktop-list {
    display: flex;
  }

  .overall-mobile-list {
    display: none;
  }
}

@media (max-width: 900px) {
  .tiers-wrapper {
    grid-template-columns: repeat(3, 1fr);
  }

  .header {
    margin-bottom: 20px;
  }

  .logo {
    width: 48px;
    height: 48px;
  }

  .header-center h1 {
    font-size: 20px;
  }

  .header-center p {
    font-size: 12px;
  }

  .btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .tiers-table th,
  .tiers-table td {
    padding: 10px 12px;
    font-size: 11px;
  }
}

@media (max-width: 600px) {
  .tiers-wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .overall-desktop-list {
    display: none;
  }

  .overall-mobile-list {
    display: flex;
  }

  .tier-section {
    border-radius: 8px;
  }

  .tier-header {
    padding: 12px 12px;
  }

  .tier-label-badge {
    padding: 6px 12px;
    font-size: 12px;
    margin-bottom: 6px;
  }

  .tier-players {
    padding: 12px;
    gap: 6px;
  }

  .tier-player-badge {
    padding: 8px 10px;
    font-size: 11px;
  }

  .tier-badge {
    padding: 3px 8px;
    font-size: 11px;
  }

  .modal-content {
    width: 95%;
  }
}

@media (max-width: 480px) {
  .tiers-wrapper {
    grid-template-columns: 1fr;
  }
}
.leaderboard-row:not(.medal-gold):not(.medal-silver):not(.medal-bronze):not(.runner-up) .player-info::before {
  display: none !important;
}


.leaderboard-row .player-stats {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}
