* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

html {
  height: 100%;
  margin: 0;
}

body {
  background: #121a24;
  color: #e3e8ef;
  font-family: "Poppins", "Segoe UI", sans-serif;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  margin: 0;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: #1c2530;
  flex-wrap: wrap;
  font-family: "Poppins", sans-serif;
}

.logo {
  font-size: 1.5em;
  font-weight: bold;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #ff3c00, #ff6a00, #ffcc00);
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 8px rgba(255, 85, 0, 0.363);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: #a5b6c8;
  font-size: 17px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  background: #2a3847;
  color: #ffffff9d;
}

.nav-links li {
  display: flex;
  align-items: center;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a5b6c8;
  font-size: 17px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.2s ease;
}

.nav-links a.active {
  color: #ffffff;
  background: #2a3847;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.footer {
  background-color: #1c2530;
  color: #ffffff;
  padding: 20px 40px;
  margin-top: auto;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.footer-logo {
  background: linear-gradient(90deg, #ff3c00, #ff6a00, #ffcc00);
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(255, 85, 0, 0.274);
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #ffffff85;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #f0c040;
}

.footer-text {
  font-size: 0.875rem;
  color: #aaa;
}

.mctiers-name {
  opacity: 0.5;
  font-weight: 800;
  font-size: 14px;
  background: linear-gradient(90deg, #facc15, #fb923c); /* vàng → cam */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.3px;
  transition: text-shadow 0.3s ease;
}

.mctiers-name:hover {
  text-shadow: 0 0 6px rgba(251, 146, 60, 0.6);
}

a .mctiers-name {
  font-weight: 600;
  background: linear-gradient(to right, #facc15, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

a,
a:visited,
a:hover,
a:focus,
a:active {
  text-decoration: none !important;
  color: inherit;
}

.nav-links a.active {
  color: #ffffff;
  background: #2f3f5086;
}

.search-wrapper {
  position: relative;
  display: inline-block;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
}

.search {
  background: #1f2a36;
  border: none;
  border-radius: 6px;
  padding: 8px 32px 8px 36px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  width: 200px;
  transition: box-shadow 0.2s ease;
}

.search:focus {
  outline: none;
  background: #263240;
  box-shadow: 0 0 0 2px #3b82f6;
}

.search-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #64748b;
  background: #1e293b;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #334155;
  pointer-events: none;
  font-family: monospace;
  user-select: none;
}

.tabs-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding: 12px 12px;
  box-sizing: border-box;
}

.tabs-container::-webkit-scrollbar {
  height: 6px;
}

.tabs-container::-webkit-scrollbar-thumb {
  background: #4c9aff;
  border-radius: 10px;
}

.tabs-container::-webkit-scrollbar-track {
  background: transparent;
}

.tabs {
  position: relative;
  display: flex;
  gap: 12px;
  min-width: max-content;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  outline: none;
  padding: 10px 14px;
  font-family: "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #ddddddd2;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 10px;
  transition: 0.2s;
  width: 90px;
  min-height: 72px;
  text-align: center;
  backface-visibility: hidden;
  will-change: transform;
}

.tab-btn:hover {
  color: #ffffffc9;
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
  box-shadow: 0 0 6px rgba(87, 99, 151, 0.164);
}

.tab-btn:active {
  transform: scale(0.98);
  transition: 0.1s;
}

.tab-btn.active {
  background: #273342;
  color: white;
  box-shadow: 0 0 8px rgba(28, 36, 63, 0.26);
}

.tab-icon {
  width: 26px;
  height: 26px;
  margin-bottom: 4px;
  opacity: 0.9;
}

.tab-btn:hover .tab-icon {
  transform: scale(1.05);
  transition: transform 0.25s ease;
}

.tab-underline {
  width: 100%;
  height: 2px;
  margin-top: 6px;
  background: #64cdfdb9;
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
}

.tab-btn.active .tab-underline {
  transform: scaleX(1);
  opacity: 1;
}

.leaderboard-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 20px;
  box-sizing: border-box;
}

table {
  width: 100%;
  background: #1f2938;
  background: linear-gradient(
    45deg,
    rgba(31, 41, 56, 1) 0%,
    rgba(32, 43, 54, 1) 100%
  );
  border-radius: 14px;
  overflow: hidden;
  border-collapse: separate;
  border: none;
  border-left: none;
  border-right: none;
  border-spacing: 0;
  margin-top: 0;
}

.table-scroll {
  border-radius: 12px;
  overflow-x: auto;
  width: 100%;
}

.fixed-table {
  width: 100%;
  min-width: 800px;
  margin-left: auto;
  margin-right: auto;
  border-collapse: collapse;
  table-layout: fixed;
}

.fixed-table thead th {
  text-align: center;
}

.fixed-table tr:hover {
  background-color: inherit !important;
  transition: none !important;
  cursor: default !important;
}

.fixed-table td:hover {
  background-color: inherit !important;
  transition: none !important;
}

.fixed-table th,
.fixed-table td {
  padding: 8px;
  min-width: 140px;
  text-align: center;
  white-space: nowrap;
}

th,
td {
  padding: 8px 16px;
  text-align: left;
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  font-family: "Poppins", "Segoe UI", sans-serif;
  vertical-align: middle;
}

th {
  color: #b7c9e6;
  font-weight: 600;
  font-family: "Poppins", "Segoe UI", sans-serif;
}

tr {
  background: #1f2938;
  background: linear-gradient(
    45deg,
    rgba(31, 41, 56, 1) 0%,
    rgba(32, 43, 54, 1) 100%
  );
}

tr.user-row {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

tr.user-row:hover {
  background: linear-gradient(
    to right,
    rgba(52, 70, 100, 0.3),
    rgba(31, 41, 56, 0.2)
  );
  transform: scale(1.01);
  cursor: pointer;
  z-index: 1;
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

tr.user-row:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tier-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 1;
  max-width: 60px;
  min-width: 44px;
}

.icon-circle {
  width: 36px;
  height: 36px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: #2e3e52;
}

.icon-circle img {
  width: 70%;
  height: 70%;
}

.tier-label {
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  min-width: unset;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tier-badge:not(.blank) .tier-label {
  font-weight: 800;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
}

.tier-badge.blank .icon-circle {
  opacity: 0.3;
  border: 2px dashed #cccccc7e;
  background-color: transparent;
}

.tier-badge.blank .tier-label {
  background-color: #40516618;
  color: #999999;
  font-weight: 800;
}

.avatar {
  width: 68px;
  object-fit: contain;
  object-position: center;
  border-radius: 2px;
  background-color: transparent;
  background: none;
  box-shadow: none;
  image-rendering: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
  transition: opacity 0.5s ease;
  opacity: 0.5;
}

.avatar[src^="https://render.crafty.gg"]
{
  opacity: 1;
}

.tier-columns {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.tier-columns {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: #4c9aff #202b36;
}

.tier-column h2 {
  font-size: 1rem;
  text-align: center;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 8px;
  background: #263447;
  color: #fff;
}

.player {
  padding: 8px 12px;
  background: #78b0eb27;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.player:hover {
  background: #9cccfb3a;
  transform: translateX(-7px);
}

.player img.avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
}

.player-name {
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  font-family: "Poppins", "Segoe UI", sans-serif;
  letter-spacing: 0.3px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tier-columns::-webkit-scrollbar {
  height: 8px;
}

.tier-columns::-webkit-scrollbar-thumb {
  background-color: #4c9aff;
  border-radius: 4px;
}

.tier-columns::-webkit-scrollbar-track {
  background-color: #202b36;
}

.LT1 .tier-label {
  background-color: #5a211e8c;
  color: #ea6a5a;
  text-shadow: 0 0 2px #ea6a5a55;
  box-shadow: 0 0 5px #5a211e44;
}

.LT2 .tier-label {
  background-color: #f2c74433;
  color: #ffdc73;
}

.LT3 .tier-label {
  background-color: #2c4d66bd;
  color: #81cdff;
  text-shadow: 0 0 1px #4b89b544;
}

.LT4 .tier-label {
  background-color: #56e28c33;
  color: #61db90;
}

.LT5 .tier-label {
  background-color: #7a8c9633;
  color: #919ea5;
}

.HT1 .tier-label {
  background-color: #e05b4a34;
  color: #ff7945;
  text-shadow: 0 0 2px #a7443b66;
  box-shadow: 0 0 6px #5e2b2744;
}

.HT2 .tier-label {
  background-color: #7a4e186b;
  color: #ffb347;
  text-shadow: 0 0 2px #ffb34766;
  box-shadow: 0 0 6px #7a4e1844;
}

.HT3 .tier-label {
  background-color: #1f3f53;
  color: #5df3f7;
  font-weight: 700 !important;
  text-shadow: 0 0 3px #5df3f766;
  box-shadow: 0 0 6px #1f3f5344;
}

.HT4 .tier-label {
  background-color: #00684259;
  color: #3acf98;
}

.HT5 .tier-label {
  background-color: #4a5c6457;
  color: #909da3;
}

.LT1 .icon-circle {
  border: 2px solid #d35446;
  background-color: #3a181673;
  box-shadow: 0 0 4px #ff967077;
}

.LT2 .icon-circle {
  border: 2px solid #ffd866;
  background-color: #3a270f4d;
  box-shadow: 0 0 5px #ffd9664b;
}

.LT3 .icon-circle {
  border: 2px solid #5993bd;
  background-color: #182b3a;
  box-shadow: 0 0 6px #6ac1ff59;
}

.LT4 .icon-circle {
  border: 2px solid rgb(0, 155, 52);
  background-color: rgba(71, 141, 82, 0.103);
  box-shadow: 0 0 6px rgba(62, 168, 97, 0.233);
}

.LT5 .icon-circle {
  border: 2px solid rgba(122, 140, 150, 0.342);
}

.HT1 .icon-circle {
  border: 2px solid #f2856d;
  background-color: #3a181673;
  box-shadow: 0 0 6px #f2856d6e;
}

.HT2 .icon-circle {
  border: 2px solid #ffae42;
  background-color: #3b260d4f;
  box-shadow: 0 0 6px #ffae4266;
}

.HT3 .icon-circle {
  border: 2px solid #79ffed;
  background-color: #10332fa4;
  box-shadow: 0 0 6px #6de6d659;
}

.HT4 .icon-circle {
  border: 2px solid rgb(95, 224, 177);
  background-color: rgba(61, 143, 75, 0.164);
  box-shadow: 0 0 8px rgba(95, 224, 177, 0.226);
}

.HT5 .icon-circle {
  border: 2px solid rgba(74, 92, 100, 0.986);
}

.player-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
}

#popup {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.card {
  background: #1b232e;
  background: linear-gradient(
    180deg,
    rgba(27, 35, 46, 1) 0%,
    rgba(21, 27, 36, 1) 100%
  );
  color: #f1f5f9;
  padding: 24px;
  border-radius: 18px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  font-family: "Segoe UI", sans-serif;
  animation: fadeIn 0.2s ease;
  margin: 0 auto;
  overflow: visible;
}

#view-count {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #94a3b8;
  user-select: none;
  cursor: default;
  pointer-events: none;
}

#view-count svg {
  stroke: #94a3b87e;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

#view-count-number {
  margin-left: 3px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(148, 163, 184, 0.1);
  border: none;
  border-radius: 50%;
  color: #94a3b8;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

#popup-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  margin-bottom: 12px;
  border: 2px solid #1e293b;
  opacity: 0.5;
  transition: opacity 0.5s ease;
}

#popup-avatar[src^="https://render.crafty.gg"]
{
  opacity: 1;
}

#popup-avatar.top-1 {
  border: 2px solid #facc15;
  box-shadow: 0 0 4px rgba(250, 204, 21, 0.6), 0 4px 8px rgba(250, 204, 21, 0.3);
}

#popup-avatar.top-2 {
  border: 2px solid #cbd5e1;
  box-shadow: 0 0 4px rgba(203, 213, 225, 0.5),
    0 4px 8px rgba(203, 213, 225, 0.25);
}

#popup-avatar.top-3 {
  border: 2px solid #d97706;
  box-shadow: 0 0 4px rgba(217, 119, 6, 0.5), 0 4px 8px rgba(217, 119, 6, 0.25);
}

.popup-rank-icon {
  width: 24px;
  height: 24px;
  transform: translateY(2px);
}

.username {
  font-size: 24px;
  font-weight: 600;
  margin: 4px 0 18px;
  color: #fff;
}

.position-box {
  background: #39465e21;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 20px;
}

.rank-number {
  font-size: 30px;
  font-weight: 700;
  color: #ffffff;
}

.position-label {
  font-size: 15px;
  margin-top: 4px;
  color: #cbd5e1;
}

.position-label .points {
  font-weight: 400;
  color: #94a3b8;
}

.tiers-section {
  background-color: #39465e21;
  border-radius: 14px;
  padding: 16px 18px;
  margin-top: 20px;
  box-shadow: inset 0 0 0 1px #334155;
}

.tiers-title {
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1a8;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tiers-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scroll-behavior: smooth;
}

.tiers-row::-webkit-scrollbar {
  height: 6px;
}

.tiers-row::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

#popup-category {
  font-weight: 500;
  letter-spacing: 1.5px;
  font-size: 18px;
  color: #ffe063;
  text-transform: uppercase;
  margin-left: 2px;
}

.tiers-footer {
  margin-top: 24px;
  font-size: 13px;
  font-weight: 500;
  color: #94a3b87e;
  text-align: center;
  letter-spacing: 0.8px;
  opacity: 0.8;
}

.tippy-box[data-theme~="tomato"] {
  background-color: #1e293b;
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  white-space: pre-line;
  cursor: default;
  pointer-events: none;
  min-width: max-content;
  max-width: 240px;
}

.tippy-box[data-theme~="tomato"] .tier-tooltip {
  text-align: center;
}

.tippy-box[data-theme~="tomato"] .tier-tooltip .title {
  font-weight: bold;
  font-size: 16px;
  color: white;
}

.tippy-box[data-theme~="tomato"] .tier-tooltip .desc {
  font-size: 12px;
  color: #ffffffa6;
  margin-top: 1px;
}

@media (max-width: 640px) {
  .navbar {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .search-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .search {
    width: 100%;
    max-width: 360px;
    font-size: 16px;
    padding-left: 36px;
    padding-right: 40px;
  }

  .search-icon {
    left: 12px;
    width: 18px;
    height: 18px;
  }

  .search-hint {
    right: 10px;
    font-size: 13px;
    padding: 2px 6px;
  }

  #leaderboard-wrapper {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 16px;
    border-radius: 14px;
    max-width: 320px;
  }

  #popup-avatar {
    width: 72px;
    height: 72px;
  }

  .username {
    font-size: 20px;
    margin-bottom: 14px;
  }

  .position-box {
    padding: 10px;
    margin-bottom: 16px;
  }

  .rank-number {
    font-size: 24px;
  }

  .position-label {
    font-size: 13px;
  }

  .tiers-title {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .close-btn {
    top: 12px;
    right: 14px;
    font-size: 22px;
  }

  .tiers-row {
    flex-wrap: nowrap;
  }

  .lb-card-tiers {
    column-gap: 0.5px !important;
    row-gap: 8px !important;
  }
}

.lb-card {
  background: #202b36;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    background-color 0.25s ease;
  will-change: transform, box-shadow;
}

.lb-card:hover {
  transform: translateX(-8px);
  background-color: #263445;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 12px rgba(0, 187, 255, 0.08);
}

.lb-card-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  position: relative;
}

.lb-card-rank {
  background: linear-gradient(135deg, #facc15, #fbbf24);
  color: #111827;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 4px 10px;
  border-radius: 9999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  font-family: "Inter", "Poppins", sans-serif;
  letter-spacing: 0.25px;
  user-select: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.2s ease-in-out;
}

.lb-card-rank:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.lb-card-avatar {
  width: 42px;
  border-radius: 6px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.5s ease;
}

.lb-card-avatar[src^="https://render.crafty.gg"]
{
  opacity: 1;
}

.lb-card-name {
  font-size: 20px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.lb-card-tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.lb-card-point {
  font-weight: 400;
  color: #94a3b896;
  font-size: 12px;
  margin-top: 4px;
}

.skeleton-box {
  position: relative;
  background: #39465e30 !important;
  overflow: hidden;
}

.skeleton-box::after,
.skeleton-avatar::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  height: 100%;
  width: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );
  animation: loading 1.2s infinite;
  border-radius: inherit;
  z-index: 1;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background-color: #334155;
  border-radius: 6px;
  margin-bottom: 6px;
}

.skeleton::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  height: 100%;
  width: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.12),
    transparent
  );
  animation: loading 1.2s infinite;
}

.skeleton-desktop {
  position: relative;
  overflow: hidden;
  background-color: #334155;
  border-radius: 6px;
}

.skeleton-desktop::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  height: 100%;
  width: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.12),
    transparent
  );
  animation: loading 1.2s infinite;
  border-radius: inherit;
}

.skeleton-player {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2a3847;
  padding: 6px 10px;
  gap: 10px;
  border-radius: 8px;
}

.skeleton-avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-name-sm {
  height: 14px;
  width: 70px;
  border-radius: 6px;
  flex: 1;
}

.skeleton-arrow-sm {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

.skeleton-rank {
  width: 40px;
  height: 20px;
  border-radius: 10px;
}

.skeleton-avatar {
  width: 42px;
  height: 38px;
  border-radius: 6px;
  flex-shrink: 0;
  position: relative;
  background-color: #39465e30;
  overflow: hidden;
}

.skeleton-name {
  height: 18px;
  width: 10px;
  border-radius: 6px;
  flex: 1;
}

.skeleton-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #334155;
  position: relative;
  overflow: hidden;
}

.skeleton-icon-circle::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: loading 1.2s infinite;
  border-radius: 50%;
}

.skeleton-tier-label {
  width: 36px;
  height: 20px;
  padding: 2px 6px;
  border-radius: 10px;
  background-color: #334155;
  position: relative;
  overflow: hidden;
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  box-sizing: border-box;
  white-space: nowrap;
}

.skeleton-tier-label::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: loading 1.2s infinite;
  border-radius: 10px;
}

.skeleton-popup {
  background-color: #33415540;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.skeleton-popup::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    left: -100%;
  }

  50% {
    left: 100%;
  }

  100% {
    left: 100%;
  }
}

#player-popup .tiers-section {
  padding: 10px 12px;
  border-radius: 10px;
  margin-top: 16px;
}

#player-popup .tier-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  min-width: 46px;
  max-width: 52px;
  padding: 4px 5px;
  box-sizing: border-box;
  border-radius: 6px;
}

#player-popup .icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#player-popup .icon-circle img {
  width: 72%;
  height: 72%;
}

#player-popup .tier-label {
  padding: 2px 5px;
  border-radius: 8px;
  font-size: 12px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.username-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.copy-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px;
  opacity: 0.7;
  display: flex;
  align-items: center;
}

.copy-btn:hover {
  opacity: 1;
}

.copy-icon {
  color: #cccccc44;
  cursor: pointer;
  transition: color 0.2s ease;
  transform: translateY(2px);
}

.copy-icon:focus {
  outline: none;
  border: none;
}

.copy-icon:hover {
  color: #ffffff;
  transform: translateY(2px) scale(1.1);
}

.share-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 1px;
  opacity: 0.7;
  display: flex;
  align-items: center;
}

.share-btn:hover {
  opacity: 1;
}

.share-icon {
  color: #cccccc44;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  transform: translateY(2px);
}

.share-icon:focus {
  outline: none;
  border: none;
}

.share-icon:hover {
  color: #ffffff;
  transform: translateY(2px) scale(1.1);
}

.history-big-card {
  background: #1b232e;
  background: linear-gradient(
    180deg,
    rgba(27, 35, 46, 1) 0%,
    rgba(21, 27, 36, 1) 100%
  );
  color: #f1f5f9;
  padding: 24px;
  border-radius: 18px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  font-family: "Segoe UI", sans-serif;
  animation: fadeIn 0.2s ease;
  margin: 0 auto;
  overflow: visible;
  height: 445px;
}

.history-big-card h2 {
  font-family: "Segoe UI", sans-serif;
  color: #f1f5f9;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.05);
  margin-bottom: 6px;
}

.history-big-card h3 {
  font-family: "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: rgba(203, 213, 225, 0.43);
  letter-spacing: 0.2px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-height: 290px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 6px;
  margin: 10px 0 12px;
  border-radius: 10px;
}

.history-grid::-webkit-scrollbar {
  width: 6px;
}

.history-grid::-webkit-scrollbar-track {
  background: transparent;
}

.history-grid::-webkit-scrollbar-thumb {
  background-color: #475569;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.history-grid:hover::-webkit-scrollbar-thumb {
  background-color: #64748b;
}

.history-card {
  background: linear-gradient(
    145deg,
    rgba(57, 70, 94, 0.15),
    rgba(57, 70, 94, 0.25)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  max-width: 160px;
  backdrop-filter: blur(6px);
}

.history-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25), 0 12px 40px rgba(0, 0, 0, 0.15);
  background: linear-gradient(
    145deg,
    rgba(57, 70, 94, 0.15),
    rgba(57, 70, 94, 0.25)
  );
}

.history-result {
  font-weight: bold;
  font-size: 32px;
  color: #4ade80;
  text-shadow: 0 0 8px #4ade8041, 0 0 16px #4ade8033; /* glow xanh */
  transition: transform 0.2s ease, text-shadow 0.2s ease;
}

.history-card.lose .history-result {
  color: #f87171;
  text-shadow: 0 0 8px #f871712d, 0 0 16px #f8717133; /* glow đỏ */
}

.history-card:hover .history-result {
  transform: scale(1.1);
}

.history-score {
  font-size: 28px;
  font-weight: bold;
  color: #e5e7eb;
}

.history-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 8px;
}

.history-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.history-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #3b4a63;
  transition: opacity 0.5s ease;
  opacity: 0.3;
}

.history-avatar[src^="https://render.crafty.gg"]
{
  opacity: 1;
}

.history-name {
  font-size: 10px;
  font-weight: 500;
  color: #d1d5db;
  text-align: center;
  max-width: 65px;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.history-label {
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1a8;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.history-time {
  font-size: 14px;
  font-weight: 600;
  color: #9ca3af;
  margin-top: 6px;
  border-top: 1px solid #374151;
  padding-top: 6px;
}

.history-footer-text {
  position: absolute;
  bottom: 16px;
  left: 0;
  width: 100%;
  text-align: center;

  font-size: 13px;
  font-weight: 500;
  color: rgba(148, 163, 184, 0.5);
  letter-spacing: 0.8px;
}

@media (max-width: 480px) {
  .history-big-card {
    height: 402px;
    padding: 16px;
    border-radius: 14px;
    max-width: 320px;
  }

  .history-card {
    padding: 8px;
  }

  .history-grid {
    max-height: 260px;
  }
}

@keyframes history-skeleton-shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: 200px 0;
  }
}

[class^="history-skeleton-"] {
  background: linear-gradient(
    90deg,
    #3a465633 25%,
    #4b55633d 50%,
    #3a465633 75%
  );
  background-size: 400px 100%;
  border-radius: 4px;
  animation: history-skeleton-shimmer 1.2s infinite linear;
}

.history-skeleton-title {
  width: 60%;
  height: 32px;
  margin: 0 auto 6px;
}
.history-skeleton-subtitle {
  margin-top: 12px;
  margin-bottom: 12px;
  width: 40%;
  height: 19px;
  margin: 0 auto;
}

.history-skeleton-result {
  width: 70px;
  height: 46px;
  margin: 0 auto 4px;
  border-radius: 6px;
}
.history-skeleton-score {
  margin-top: 12px;
  width: 60px;
  height: 28px;
  margin: 0 auto 8px;
  border-radius: 6px;
}

.history-skeleton-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
.history-skeleton-name {
  width: 40px;
  height: 10px;
  margin-top: 4px;
}

.history-skeleton-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.history-skeleton-time {
  width: 83px;
  height: 14px;
  margin: 18px auto 0;
}

.hidden {
  display: none;
}
