/* ==========================================================================
   JerkCraft — Player Statistics Stylesheet (/mc/stats/)
   Coherent with mc.css Minecraft aesthetic. Hand-crafted CSS bevels and panels.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Header Banner & Brand
   -------------------------------------------------------------------------- */
.stats-header-banner {
  background: linear-gradient(180deg, #090212 0%, #17072a 100%);
  border-bottom: 3px solid var(--mc-bevel-black);
  box-shadow: inset 0 -3px 0 var(--mc-bevel-dark);
  padding: 1.75rem 1.5rem;
}

.stats-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.stats-brand-wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stats-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stats-page-title {
  font-family: var(--mc-font-heading);
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  letter-spacing: 0.08em;
  color: #ffffff;
  text-shadow: 
    3px 3px 0 #000000,
    -1px -1px 0 var(--mc-magenta),
    1px 1px 0 var(--mc-cyan);
}

.stats-page-subtitle {
  font-family: var(--mc-font-body);
  font-size: 1.3rem;
  color: var(--mc-cyan-light);
  letter-spacing: 0.05em;
}

.stats-meta-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stats-meta-item {
  font-family: var(--mc-font-heading);
  font-size: 0.7rem;
  color: #ffff55;
  background: #140824;
  border: 2px solid var(--mc-bevel-black);
  padding: 0.5rem 0.85rem;
  box-shadow: 
    inset 2px 2px 0 var(--mc-cyan-light),
    inset -2px -2px 0 var(--mc-magenta-dark),
    2px 2px 0 #000000;
  text-shadow: 1px 1px 0 #000;
}

/* --------------------------------------------------------------------------
   Minecraft Inventory Hotbar Navigation
   -------------------------------------------------------------------------- */
.mc-hotbar-nav {
  max-width: 1200px;
  margin: 1.5rem auto 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.mc-hotbar-container {
  display: inline-flex;
  background: #2b2b2b;
  border: 4px solid var(--mc-bevel-black);
  box-shadow: 
    inset 3px 3px 0 var(--mc-bevel-gray),
    inset -3px -3px 0 var(--mc-bevel-dark),
    4px 4px 0 #000000;
  padding: 4px;
  gap: 4px;
}

.mc-hotbar-slot {
  position: relative;
  width: 145px;
  height: 52px;
  background: #8b8b8b;
  border: 3px solid var(--mc-bevel-black);
  box-shadow: 
    inset 3px 3px 0 var(--mc-bevel-dark),
    inset -3px -3px 0 var(--mc-bevel-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #ffffff;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.1s ease;
  padding: 0 4px;
}

.mc-hotbar-slot:hover {
  background: #9d9d9d;
}

.mc-hotbar-slot.active {
  background: #4a4a58;
  border-color: #ffffff;
  box-shadow: 
    inset 3px 3px 0 #181822,
    inset -3px -3px 0 #727288,
    0 0 0 2px #000000;
}

.mc-hotbar-key {
  position: absolute;
  top: 3px;
  left: 5px;
  font-family: var(--mc-font-heading);
  font-size: 0.55rem;
  color: #aaaaaa;
  pointer-events: none;
}

.mc-hotbar-slot.active .mc-hotbar-key {
  color: var(--mc-cyan-light);
}

.mc-hotbar-label {
  font-family: var(--mc-font-heading);
  font-size: 0.7rem;
  color: #ffffff;
  text-shadow: 1px 1px 0 #000;
  margin-top: 6px;
}

.mc-hotbar-slot.active .mc-hotbar-label {
  color: #ffff55;
  text-shadow: 2px 2px 0 #000000;
}

/* --------------------------------------------------------------------------
   Main Content Layout
   -------------------------------------------------------------------------- */
.stats-main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 5rem 1.5rem;
  width: 100%;
  flex: 1;
}

/* --------------------------------------------------------------------------
   Warming-up / State Panels
   -------------------------------------------------------------------------- */
.stats-state-panel {
  background-color: var(--mc-stone-bg);
  border: 3px solid var(--mc-bevel-black);
  box-shadow: 
    inset 3px 3px 0 var(--mc-bevel-light),
    inset -3px -3px 0 var(--mc-bevel-dark),
    5px 5px 0 #000000;
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 760px;
  margin: 3rem auto;
}

.stats-state-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.stats-state-title {
  font-family: var(--mc-font-heading);
  font-size: 1.25rem;
  color: #ffff55;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 0 #000;
}

.stats-state-desc {
  font-family: var(--mc-font-body);
  font-size: 1.4rem;
  color: #d0d4e0;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.stats-loading-panel {
  text-align: center;
  padding: 4rem 1rem;
}

.stats-loading-text {
  font-family: var(--mc-font-heading);
  font-size: 0.9rem;
  color: var(--mc-cyan-light);
  text-shadow: 2px 2px 0 #000;
}

/* --------------------------------------------------------------------------
   Roster View
   -------------------------------------------------------------------------- */
.roster-controls {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.roster-search-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.roster-search-input {
  flex: 1;
  background: #000000;
  border: 3px solid var(--mc-bevel-black);
  box-shadow: 
    inset 3px 3px 0 var(--mc-bevel-dark),
    inset -3px -3px 0 var(--mc-bevel-gray);
  color: #55ffff;
  font-family: var(--mc-font-body);
  font-size: 1.6rem;
  padding: 0.7rem 1.2rem;
  outline: none;
}

.roster-search-input:focus-visible {
  border-color: var(--mc-cyan);
  box-shadow: 
    inset 3px 3px 0 var(--mc-cyan-deep),
    inset -3px -3px 0 var(--mc-cyan-light),
    0 0 0 2px var(--mc-cyan);
}

.roster-result-count {
  font-family: var(--mc-font-heading);
  font-size: 0.75rem;
  color: #aaaaaa;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 1.5rem;
}

.roster-card {
  position: relative;
  background-color: var(--mc-deepslate-bg);
  border: 3px solid var(--mc-bevel-black);
  box-shadow: 
    inset 3px 3px 0 var(--mc-bevel-mid),
    inset -3px -3px 0 var(--mc-bevel-dark),
    4px 4px 0 #000000;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  text-decoration: none;
  color: #ffffff;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.roster-card:hover {
  transform: translateY(-2px);
  box-shadow: 
    inset 3px 3px 0 var(--mc-cyan-light),
    inset -3px -3px 0 var(--mc-magenta-dark),
    6px 6px 0 #000000;
}

.roster-card:focus-visible {
  outline: 3px solid var(--mc-cyan);
}

.roster-avatar-slot {
  width: 56px;
  height: 56px;
  background: #373737;
  border: 3px solid #111111;
  box-shadow: 
    inset 3px 3px 0 #1e1e1e,
    inset -3px -3px 0 #8b8b8b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.mc-avatar {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  display: block;
}

.mc-avatar-fallback {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  display: block;
}

.roster-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}

.roster-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.roster-player-name {
  font-family: var(--mc-font-heading);
  font-size: 0.95rem;
  color: #ffff55;
  text-shadow: 2px 2px 0 #000000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roster-card:hover .roster-player-name {
  color: #ffffff;
}

.mc-online-pip {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: #55ff55;
  border: 1px solid #000000;
  box-shadow: 0 0 6px #55ff55;
  flex-shrink: 0;
}

.roster-online-badge {
  font-family: var(--mc-font-heading);
  font-size: 0.55rem;
  color: #000000;
  background: #55ff55;
  padding: 0.15rem 0.4rem;
  border: 1px solid #000000;
  text-shadow: none;
}

.roster-meta-line {
  font-family: var(--mc-font-body);
  font-size: 1.25rem;
  color: #aaaaaa;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.roster-meta-line span {
  color: var(--mc-cyan-light);
}

/* --------------------------------------------------------------------------
   Profile View
   -------------------------------------------------------------------------- */
.profile-view {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.profile-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mc-font-heading);
  font-size: 0.75rem;
  color: var(--mc-cyan);
  text-decoration: none;
  background: #140824;
  border: 2px solid var(--mc-bevel-black);
  padding: 0.5rem 0.85rem;
  box-shadow: 
    inset 2px 2px 0 var(--mc-cyan-light),
    inset -2px -2px 0 var(--mc-cyan-dark);
  align-self: flex-start;
}

.profile-breadcrumb:hover {
  color: #ffffff;
  background: #200d38;
}

/* Profile Hero Panel */
.profile-hero-panel {
  background-color: var(--mc-stone-bg);
  border: 3px solid var(--mc-bevel-black);
  box-shadow: 
    inset 3px 3px 0 var(--mc-bevel-light),
    inset -3px -3px 0 var(--mc-bevel-dark),
    5px 5px 0 #000000;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.profile-hero-top {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.profile-avatar-slot {
  width: 88px;
  height: 88px;
  background: #373737;
  border: 4px solid #111111;
  box-shadow: 
    inset 3px 3px 0 #1e1e1e,
    inset -3px -3px 0 #8b8b8b,
    3px 3px 0 #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-player-name {
  font-family: var(--mc-font-heading);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  color: #ffffff;
  text-shadow: 
    3px 3px 0 #000000,
    -1px -1px 0 var(--mc-magenta),
    1px 1px 0 var(--mc-cyan);
}

.profile-status-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--mc-font-body);
  font-size: 1.3rem;
  color: #cccccc;
}

/* First-Glance Tiles Grid */
.profile-glance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.profile-tile {
  background: #14121a;
  border: 3px solid #111111;
  box-shadow: 
    inset 3px 3px 0 #1e1a28,
    inset -3px -3px 0 #3a3248,
    2px 2px 0 #000000;
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  position: relative;
  overflow: hidden;
}

.profile-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--mc-cyan);
}

.profile-tile-magenta::before {
  background: var(--mc-magenta);
}

.profile-tile-green::before {
  background: #55ff55;
}

.profile-tile-yellow::before {
  background: #ffff55;
}

.profile-tile-value {
  font-family: var(--mc-font-heading);
  font-size: clamp(0.85rem, 1.8vw, 1.15rem);
  color: #ffffff;
  text-shadow: 2px 2px 0 #000000;
  white-space: nowrap;
}

.profile-tile-label {
  font-family: var(--mc-font-body);
  font-size: 1.2rem;
  color: #aaaaaa;
  text-transform: uppercase;
}

/* Movement Breakdown Section */
.profile-section-panel {
  background-color: var(--mc-deepslate-bg);
  border: 3px solid var(--mc-bevel-black);
  box-shadow: 
    inset 3px 3px 0 var(--mc-bevel-mid),
    inset -3px -3px 0 var(--mc-bevel-dark),
    4px 4px 0 #000000;
  padding: 1.75rem;
}

.profile-section-title {
  font-family: var(--mc-font-heading);
  font-size: 1.1rem;
  color: #ffff55;
  text-shadow: 2px 2px 0 #000000;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.profile-section-total {
  font-family: var(--mc-font-body);
  font-size: 1.3rem;
  color: var(--mc-cyan-light);
}

.profile-section-subtitle {
  font-family: var(--mc-font-body);
  font-size: 1.25rem;
  color: #aaaaaa;
  margin-bottom: 1.25rem;
}

.movement-bar-container {
  height: 32px;
  background: #0d0d14;
  border: 3px solid #000000;
  box-shadow: 
    inset 2px 2px 0 #050508,
    inset -2px -2px 0 #2a2a3a;
  display: flex;
  width: 100%;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.movement-bar-segment {
  height: 100%;
  min-width: 2px;
  transition: width 0.3s ease;
  position: relative;
}

.movement-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 0.85rem;
}

.movement-legend-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mc-font-body);
  font-size: 1.25rem;
  color: #cccccc;
}

.movement-legend-swatch {
  width: 14px;
  height: 14px;
  border: 2px solid #000000;
  flex-shrink: 0;
}

.movement-legend-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movement-legend-dist {
  font-weight: bold;
  color: #ffffff;
  white-space: nowrap;
}

/* Category Sections & Ranked Bar Lists */
.category-bars-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.category-bar-row {
  display: grid;
  grid-template-columns: 180px 1fr 100px;
  align-items: center;
  gap: 1rem;
}

.category-item-name {
  font-family: var(--mc-font-body);
  font-size: 1.3rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-namespace {
  color: #777777;
  font-size: 0.9em;
  margin-right: 0.35rem;
}

.category-bar-track {
  height: 20px;
  background: #111116;
  border: 2px solid #000000;
  box-shadow: inset 1px 1px 0 #08080c, inset -1px -1px 0 #282838;
  position: relative;
  overflow: hidden;
}

.category-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3cd2e6 0%, #55ff55 100%);
  border-right: 2px solid #ffffff;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.4);
}

.category-item-val {
  font-family: var(--mc-font-heading);
  font-size: 0.75rem;
  color: #ffff55;
  text-align: right;
  text-shadow: 1px 1px 0 #000;
}

.category-expand-btn {
  margin-top: 1rem;
  align-self: flex-start;
  font-size: 0.7rem;
  padding: 0.5rem 1rem;
}

/* Custom Stats Table */
.custom-table-container {
  width: 100%;
  overflow-x: auto;
  margin-top: 1rem;
  border: 3px solid var(--mc-bevel-black);
  box-shadow: 3px 3px 0 #000000;
}

.mc-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mc-font-body);
  font-size: 1.35rem;
  text-align: left;
  min-width: 480px;
}

.mc-stats-table th {
  background: #1e1132;
  color: #ffff55;
  font-family: var(--mc-font-heading);
  font-size: 0.75rem;
  padding: 0.85rem 1.2rem;
  border-bottom: 3px solid var(--mc-bevel-black);
  cursor: pointer;
  user-select: none;
}

.mc-stats-table th:hover {
  background: #2b1748;
  color: #ffffff;
}

.mc-stats-table th.sort-active {
  color: var(--mc-cyan-light);
}

.mc-stats-table td {
  padding: 0.7rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
}

.mc-stats-table tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.02);
}

.mc-stats-table tbody tr:hover {
  background-color: rgba(60, 210, 230, 0.08);
}

.table-val-cell {
  font-family: var(--mc-font-heading);
  font-size: 0.75rem;
  text-align: right;
  color: #ffff55;
}

/* --------------------------------------------------------------------------
   Leaderboards View & Podium
   -------------------------------------------------------------------------- */
.leaderboard-controls {
  background-color: var(--mc-stone-bg);
  border: 3px solid var(--mc-bevel-black);
  box-shadow: 
    inset 3px 3px 0 var(--mc-bevel-light),
    inset -3px -3px 0 var(--mc-bevel-dark),
    4px 4px 0 #000000;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.leaderboard-select-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.leaderboard-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 240px;
}

.leaderboard-field-label {
  font-family: var(--mc-font-heading);
  font-size: 0.75rem;
  color: #ffff55;
  text-shadow: 1px 1px 0 #000;
}

.leaderboard-select {
  background: #000000;
  border: 3px solid var(--mc-bevel-black);
  box-shadow: 
    inset 3px 3px 0 var(--mc-bevel-dark),
    inset -3px -3px 0 var(--mc-bevel-gray);
  color: #55ffff;
  font-family: var(--mc-font-body);
  font-size: 1.5rem;
  padding: 0.6rem 1rem;
  outline: none;
  cursor: pointer;
}

.leaderboard-select:focus-visible {
  border-color: var(--mc-cyan);
}

/* 3-Step Minecraft Block Podium */
.podium-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1.5rem;
  margin: 3rem 0 3.5rem 0;
  padding-top: 2rem;
}

.podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 220px;
  position: relative;
}

.podium-step-1 { order: 2; }
.podium-step-2 { order: 1; }
.podium-step-3 { order: 3; }

.podium-player-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  text-decoration: none;
  color: #ffffff;
}

.podium-rank-badge {
  font-family: var(--mc-font-heading);
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border: 2px solid #000000;
  box-shadow: 2px 2px 0 #000000;
}

.rank-gold {
  background: #ffcc00;
  color: #000000;
}

.rank-iron {
  background: #e0e0e0;
  color: #000000;
}

.rank-copper {
  background: #d46c3b;
  color: #ffffff;
}

.podium-avatar-slot {
  width: 64px;
  height: 64px;
  background: #2a2a2a;
  border: 3px solid #000000;
  box-shadow: 
    inset 2px 2px 0 #181818,
    inset -2px -2px 0 #666666,
    3px 3px 0 #000000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.podium-name {
  font-family: var(--mc-font-heading);
  font-size: 0.85rem;
  color: #ffffff;
  text-shadow: 2px 2px 0 #000000;
  text-align: center;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium-val {
  font-family: var(--mc-font-heading);
  font-size: 0.8rem;
  color: #ffff55;
  text-shadow: 1px 1px 0 #000;
  text-align: center;
}

/* Pure CSS Minecraft Blocks */
.podium-block {
  width: 100%;
  border: 4px solid #000000;
  box-shadow: 4px 4px 0 #000000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.podium-block::after {
  content: '';
  position: absolute;
  top: 15%;
  left: 15%;
  right: 15%;
  bottom: 15%;
  border: 2px solid rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

/* Gold Block (Center, Rank 1) */
.podium-block-gold {
  height: 200px;
  background: #f4be1b;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.15) 0px, rgba(255, 255, 255, 0.15) 4px, transparent 4px, transparent 8px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.15) 0px, rgba(0, 0, 0, 0.15) 4px, transparent 4px, transparent 8px);
  box-shadow: 
    inset 6px 6px 0 #ffe875,
    inset -6px -6px 0 #9c6e00,
    4px 4px 0 #000000;
}

/* Iron Block (Left, Rank 2) */
.podium-block-iron {
  height: 150px;
  background: #d8d8d8;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.25) 0px, rgba(255, 255, 255, 0.25) 4px, transparent 4px, transparent 8px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.15) 0px, rgba(0, 0, 0, 0.15) 4px, transparent 4px, transparent 8px);
  box-shadow: 
    inset 6px 6px 0 #ffffff,
    inset -6px -6px 0 #7b7b7b,
    4px 4px 0 #000000;
}

/* Copper Block (Right, Rank 3) */
.podium-block-copper {
  height: 110px;
  background: #c2653e;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.12) 0px, rgba(255, 255, 255, 0.12) 4px, transparent 4px, transparent 8px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0px, rgba(0, 0, 0, 0.2) 4px, transparent 4px, transparent 8px);
  box-shadow: 
    inset 6px 6px 0 #e68d65,
    inset -6px -6px 0 #6e2e12,
    4px 4px 0 #000000;
}

/* Ranked List Below Podium */
.leaderboard-list-panel {
  background-color: var(--mc-deepslate-bg);
  border: 3px solid var(--mc-bevel-black);
  box-shadow: 
    inset 3px 3px 0 var(--mc-bevel-mid),
    inset -3px -3px 0 var(--mc-bevel-dark),
    4px 4px 0 #000000;
  padding: 1.75rem;
}

.leaderboard-list-title {
  font-family: var(--mc-font-heading);
  font-size: 1.1rem;
  color: #ffffff;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 0 #000000;
}

.leaderboard-rows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 50px 48px 180px 1fr 120px;
  align-items: center;
  gap: 1rem;
  background: #14121c;
  border: 2px solid var(--mc-bevel-black);
  box-shadow: 
    inset 2px 2px 0 #282438,
    inset -2px -2px 0 #0a0810;
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: #ffffff;
  transition: transform 0.1s ease;
}

.leaderboard-row:hover {
  transform: translateX(4px);
  border-color: var(--mc-cyan);
}

.leaderboard-rank-num {
  font-family: var(--mc-font-heading);
  font-size: 0.85rem;
  color: #aaaaaa;
}

.leaderboard-row:hover .leaderboard-rank-num {
  color: #ffff55;
}

.leaderboard-avatar-slot {
  width: 36px;
  height: 36px;
  background: #2a2a2a;
  border: 2px solid #000000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.leaderboard-name {
  font-family: var(--mc-font-heading);
  font-size: 0.8rem;
  color: #ffff55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-bar-track {
  height: 14px;
  background: #08080c;
  border: 1px solid #000000;
  overflow: hidden;
}

.leaderboard-bar-fill {
  height: 100%;
  background: var(--mc-cyan);
}

.leaderboard-val {
  font-family: var(--mc-font-heading);
  font-size: 0.75rem;
  color: #ffffff;
  text-align: right;
  text-shadow: 1px 1px 0 #000;
}

/* --------------------------------------------------------------------------
   Accessibility & Reduced Motion
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--mc-cyan);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* --------------------------------------------------------------------------
   Mobile Responsive Adjustments (tested down to 375px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .stats-header-banner {
    padding: 1.25rem 1rem;
  }

  .stats-banner-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .mc-hotbar-container {
    width: 100%;
    display: flex;
  }

  .mc-hotbar-slot {
    flex: 1;
    width: auto;
    padding: 0 2px;
  }

  .mc-hotbar-label {
    font-size: 0.52rem;
    letter-spacing: 0;
  }

  .mc-hotbar-key {
    font-size: 0.5rem;
    top: 2px;
    left: 3px;
  }

  .stats-main-content {
    padding: 1.25rem 1rem 4rem 1rem;
  }

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

  .profile-glance-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .category-bar-row {
    grid-template-columns: 110px 1fr 70px;
    gap: 0.5rem;
  }

  .category-item-name {
    font-size: 1.1rem;
  }

  .category-item-val {
    font-size: 0.65rem;
  }

  .podium-container {
    gap: 0.5rem;
  }

  .podium-step {
    width: 105px;
  }

  .podium-avatar-slot {
    width: 48px;
    height: 48px;
  }

  .podium-name {
    font-size: 0.65rem;
    max-width: 95px;
  }

  .podium-val {
    font-size: 0.65rem;
  }

  .podium-block-gold {
    height: 130px;
  }

  .podium-block-iron {
    height: 95px;
  }

  .podium-block-copper {
    height: 70px;
  }

  .leaderboard-row {
    grid-template-columns: 32px 36px 1fr 70px;
    gap: 0.6rem;
  }

  .leaderboard-bar-track {
    display: none;
  }

  .leaderboard-name {
    font-size: 0.7rem;
  }

  .leaderboard-val {
    font-size: 0.65rem;
  }
}

@media (max-width: 420px) {
  .profile-glance-grid {
    grid-template-columns: 1fr;
  }

  .category-bar-row {
    grid-template-columns: 90px 1fr 60px;
  }
}

/* Narrow phones: keep the top bar inside the viewport */
@media (max-width: 480px) {
  .mc-topbar { flex-wrap: wrap; gap: 0.5rem; }
  .mc-topbar .mc-version-badge { max-width: 100%; white-space: normal; }
  html, body { overflow-x: hidden; }
}

/* Grid items must be allowed to shrink below their longest player name */
.roster-card { min-width: 0; }
.roster-card > * { min-width: 0; }
.roster-card h3, .roster-card [class*="name"] { overflow-wrap: anywhere; }
.profile-title-group { min-width: 0; max-width: 100%; }
.profile-player-name { overflow-wrap: anywhere; }

/* ==========================================================================
   Stats Layout Wrapper & Sticky Ad Sidebar (>= 1280px)
   ========================================================================== */
.stats-layout-wrapper {
  display: block;
  width: 100%;
}

.stats-sidebar {
  display: none;
}

@media (min-width: 1280px) {
  .stats-layout-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 308px;
    gap: 2.5rem;
    max-width: 1560px;
    margin: 0 auto;
    padding: 0 1.5rem;
    align-items: start;
    box-sizing: border-box;
  }

  .stats-layout-wrapper .stats-main-content {
    max-width: 100%;
    margin: 0;
    padding: 1.5rem 0 5rem 0;
  }

  .stats-sidebar {
    display: block;
    width: 308px;
    box-sizing: border-box;
    margin-top: 1.5rem;
  }

  .stats-sidebar-sticky {
    position: sticky;
    top: 2rem;
  }
}
