/* ============================================================
   Variables
   ============================================================ */

:root {
  --bg-fade-stop: 60%; /* how far down before fully transparent */
  --bg-top: #2b0e05;
  --bg-bottom: #07111d;
  --line: #50d9ff;
  --line-soft: rgba(80, 217, 255, 0.28);
  --text: #dce5f2;

  --yellow: #efe84d;
  --cyan: #1fe2ff;
  --cyan-soft: #93f4ff;
  --orange: #ff922f;
  --red: #ff3d3d;
  --white-glow: rgba(255,255,255,0.1);

  --panel: rgba(14, 28, 49, 0.92);
  --panel-dark: rgba(9, 18, 33, 0.95);
  --muted: #98a9c9;
}


/* ============================================================
   Base / Reset
   ============================================================ */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 24px;
  color: var(--text);
  font-family: ui-monospace, monospace;
  background:
    radial-gradient(circle at top center, rgba(120, 30, 0, 0.35), transparent 30%),
    linear-gradient(180deg, var(--bg-top) 0%, #10131a 25%, var(--bg-bottom) 100%);
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../../assets/img/bg/bg-highscores1.jpg');
  background-size: cover;
  background-position: center top;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) var(--bg-fade-stop));
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) var(--bg-fade-stop));
  pointer-events: none;
  z-index: -1;
}


/* ============================================================
   Page Title
   ============================================================ */

h1.player-title {
  margin-top: 100px;
  margin-bottom: 30px;
  text-align: center;
  font-size: 108px;

  font-weight: 700;
  font-variant-caps: all-small-caps;
  letter-spacing: 1px;

  /* Metallic gold gradient */
  background:
  repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.28) 0px,
      rgba(255,255,255,0.28) 1px,
      rgba(0,0,0,0.26) 1px,
      rgba(0,0,0,0.26) 2px
    ),
    linear-gradient(
    to bottom,
    #ffffff 0%,
    #fff4b0 10%,
    #ffe680 20%,
    #ffd700 30%,
    #fff2a0 40%,
    #ffcc33 52%,
    #f0b000 65%,
    #c89600 80%,
    #8a6500 100%
  );

  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;

  /* stronger metallic outline */
  -webkit-text-stroke: 1.5px #2b1f00;

  /* subtle bevel effect */
  text-shadow:
    0 1px 0 rgba(255,255,255,0.5),
    0 0 6px rgba(255, 215, 0, 0.25);
}

@media (max-width: 1200px) {
  h1.player-title {
    font-size: 90px;
  }
}

@media (max-width: 800px) {
  h1.player-title {
    margin-top: 50px;
    margin-bottom: 10px;
    font-size: 66px;
  }
}

@media (max-width: 520px) {
  h1.player-title {
    margin-top: 50px;
    margin-bottom: 10px;
    font-size: 54px;
  }
}


/* ============================================================
   Sheet
   ============================================================ */

.sheet {
  width: min(800px, 100%);
  margin: 0 auto;
  margin-bottom: 100px;
  border: 3px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)),
    rgba(5, 12, 22, 0.92);
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.05) inset,
    0 0 28px rgba(80,217,255,0.18),
    0 0 60px rgba(80,217,255,0.08);
  overflow: hidden;
  position: relative;
}

.sheet::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  pointer-events: none;
}


/* ============================================================
   Bars
   ============================================================ */

.topbar {
  padding: 14px 28px 10px;
  font-size: clamp(20px, 1.8vw, 38px);
  border-bottom: 2px solid var(--line-soft);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-shadow: 0 0 10px rgba(239,232,77,0.12);
}

.topbar .left {
  text-align: left;
}

.topbar .center {
  text-align: center;
}

.topbar .right {
  text-align: right;
  color: var(--red);
}

.bottombar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px 28px 14px;
  border-top: 2px solid var(--line-soft);
  color: var(--yellow);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: clamp(12px, 1.8vw, 20px);
  text-shadow: 0 0 10px rgba(239,232,77,0.12);
}


/* ============================================================
   Content / Panel
   ============================================================ */

.content {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.panel {
  background: linear-gradient(180deg, rgba(31, 48, 78, 0.85), rgba(11, 21, 38, 0.96));
  border: 2px solid var(--line-soft);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 0 18px rgba(80,217,255,0.08);
}

.panel-header {
  padding: 10px 18px;
  color: var(--cyan);
  font-size: clamp(16px, 1.2vw, 24px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0));
}

#scroll-mirror {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 12px;
}

#scroll-mirror > div {
  height: 1px;
}

.panel-body {
  padding: 12px;
  overflow-x: auto;
}

#scroll-mirror::-webkit-scrollbar,
.panel-body::-webkit-scrollbar {
  height: 10px;
}

#scroll-mirror::-webkit-scrollbar-track,
.panel-body::-webkit-scrollbar-track {
  background: #a8d4f5;
  border-radius: 4px;
}

#scroll-mirror::-webkit-scrollbar-thumb,
.panel-body::-webkit-scrollbar-thumb {
  background: #2e6fa8;
  border-radius: 4px;
  border: 2px solid #a8d4f5;
}

#scroll-mirror::-webkit-scrollbar-thumb:hover,
.panel-body::-webkit-scrollbar-thumb:hover {
  background: #1d5080;
}

#scroll-mirror::-webkit-scrollbar-button,
.panel-body::-webkit-scrollbar-button {
  background: #2e6fa8;
  border-radius: 2px;
}

#scroll-mirror::-webkit-scrollbar-button:hover,
.panel-body::-webkit-scrollbar-button:hover {
  background: #1d5080;
}

#scroll-mirror,
.panel-body {
  scrollbar-color: #2e6fa8 #a8d4f5;
}

/* ============================================================
   Table
   ============================================================ */

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-family: 'Consolas', 'Lucida Console', monospace;
}

th {
  text-align: left;
  color: var(--yellow);
  font-size: clamp(8px, 1.8vw, 14px);
  text-transform: uppercase;
  padding: 6px 8px 8px;
  letter-spacing: 0.4px;
}

td {
  padding: 4px 8px;
  font-size: clamp(10px, 1.8vw, 16px);
  color: var(--text);
  vertical-align: top;
  white-space: nowrap;
}

tbody tr + tr td {
  border-top: 1px solid rgba(255,255,255,0.035);
}

tbody tr:hover td {
  background: rgba(80, 217, 255, 0.07);
  cursor: pointer;
}


/* ============================================================
   Stats Page — Layout
   ============================================================ */

.top-grid {
  display: grid;
  grid-template-columns: 55% 44%;
  gap: 14px;
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr 0.8fr;
  gap: 14px;
}

.stats-layout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.left-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 0 1 55%;
  max-width: 55%;
}

.right-column {
  flex: 1 1 auto;
}

@media (max-width: 1100px) {
  .top-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .stats-layout {
    flex-direction: column;
  }

  .left-column,
  .right-column {
    flex: 1 0 auto;
    width: 100%;
    max-width: none;
  }
}


/* ============================================================
   Highscores Page — Layout
   ============================================================ */

.leaderboard-layout {
  display: grid;
  grid-template-columns: 220px minmax(700px, 900px) 220px;
  gap: 24px;
  align-items: start;
  justify-content: center;
  width: 100%;
  margin: 0 auto;
  margin-top: 50px;
}

.left-sidebar,
.right-sidebar,
.center-content {
  min-width: 0;
}

.category-links-wrap {
  width: 80%;
  margin: 0 auto 18px auto;
}

.category-links {
  display: grid;
  /*grid-template-columns: repeat(7, 1fr);*/
  gap: 6px;
}

.category-btn {
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 5px 6px;
  min-height: 24px;

  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;

  color: #e7c66a;
  text-decoration: none;

  background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0));
  border: 1px solid rgba(231,198,106,0.4);
  border-radius: 4px;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 0 6px rgba(231,198,106,0.08);

  transition: all 0.15s ease;
}

.category-btn:hover {
  background: linear-gradient(180deg, #3a301d 0%, #21180d 100%);
  border-color: rgba(231,198,106,0.85);
  box-shadow: 0 0 8px rgba(231,198,106,0.18);
}

.category-btn.active {
  background: linear-gradient(180deg, #6f5720 0%, #3f2f10 100%);
  color: #fff1b5;
  border-color: rgba(255, 223, 124, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 0 18px rgba(255, 215, 100, 0.22);
}

@media (max-width: 1200px) {
  .leaderboard-layout {
    grid-template-columns: 1fr;
  }

  .category-links {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .sheet {
    margin-bottom: 0px;
  }
}

@media (max-width: 800px) {
  .category-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .category-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ============================================================
   Highscores Page — Sidebar Categories
   ============================================================ */

h6.categories {
  position: relative;
  text-align: center;
}

.left-sidebar h6.categories:first-of-type::before,
.right-sidebar h6.categories:first-of-type::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -110%);
  width: 80px;
  height: 80px;
  background-image: url('../img/normal/trophy.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}


/* ============================================================
   Highscores Page — Data
   ============================================================ */

#category {
  text-align: center;
}

.rank {
  color: var(--yellow);
  font-weight: 900;
  width: 60px;
}

.rank-1 { color: #ffd700; }
.rank-2 { color: #c0c0c0; }
.rank-3 { color: #cd7f32; }

.rank-1::after,
.rank-2::after,
.rank-3::after {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.rank-1::after {
  background: radial-gradient(circle at 35% 35%, #fff5a0, #ffd700 55%, #b8860b);
  box-shadow: 0 0 5px rgba(255, 215, 0, 0.6);
}
.rank-2::after {
  background: radial-gradient(circle at 35% 35%, #ffffff, #c0c0c0 55%, #808080);
  box-shadow: 0 0 5px rgba(192, 192, 192, 0.5);
}
.rank-3::after {
  background: radial-gradient(circle at 35% 35%, #f0c07a, #cd7f32 55%, #8b4513);
  box-shadow: 0 0 5px rgba(205, 127, 50, 0.5);
}

.username {
  color: #d5dbe6;
  font-weight: 400;
  text-transform: uppercase;
}

.score {
  color: var(--yellow);
  font-weight: 400;
  text-align: right;
}

.error {
  text-align: center;
  color: var(--red);
  padding: 20px;
  font-weight: 700;
  text-transform: uppercase;
}


/* ============================================================
   Stats Page — Data
   ============================================================ */

.name {
  color: #d5dbe6;
  font-weight: 800;
  text-transform: uppercase;
}

.value {
  color: var(--yellow);
  font-weight: 400;
}

.value-orange {
  color: var(--orange);
  font-weight: 900;
}

.rank-orange {
  color: var(--orange);
  font-weight: 900;
  text-transform: uppercase;
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  color: var(--cyan-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.18);
}

.footer-team {
  text-align: center;
  padding: 0 0 14px;
  color: var(--orange);
  font-size: clamp(12px, 1.8vw, 20px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
}
