:root {
  --theme-hue: 270; /* PURPLE */
  --theme-color: hsl(var(--theme-hue), 95%, 65%);
  --theme-color-soft: hsl(var(--theme-hue), 95%, 75%);
  --theme-bg: hsl(245, 25%, 8%);
  --glass-bg: rgba(24, 18, 40, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text-main: #f5f3ff;
  --text-muted: #c4b5fd;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-lg: 0 10px 30px -5px rgba(124, 58, 237, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--theme-bg);
  background-image: url("bg.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10, 15, 30, 0.85), rgba(10, 15, 30, 0.95));
  z-index: -1;
  backdrop-filter: blur(8px);
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Header */
.header {
  text-align: center;
  padding: 10px 0 20px;
  animation: fadeInDown 0.6s ease-out;
}

.header h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(135deg, #fff 20%, var(--theme-color) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
  filter: drop-shadow(0 4px 12px rgba(249, 115, 22, 0.3));
}

.header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 8px;
  font-weight: 500;
}

/* Glass */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

/* Controls */
.controls {
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  animation: fadeInUp 0.6s ease-out 0.1s backwards;
}

.gamemodes {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gm-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #c4b5fd;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.gm-btn img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  opacity: 0.75;
  filter: grayscale(100%);
}

.gm-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateY(-1px);
}

.gm-btn:hover img {
  filter: grayscale(0%);
  opacity: 1;
}


.gm-btn:hover img {
  filter: grayscale(0%) opacity(1);
  transform: scale(1.1);
}

.gm-btn.active {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.45);
}

.gm-btn.active img {
  filter: brightness(0) invert(1);
  opacity: 1;
}

/* Search */
.search-wrap {
  flex-grow: 1;
  max-width: 350px;
}

.search {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.search:focus {
  outline: none;
  border-color: var(--theme-color);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.search::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Leaderboard */
.leaderboard {
  padding: 0;
  display: flex;
  flex-direction: column;
  animation: fadeInUp 0.6s ease-out 0.2s backwards;
  min-height: 400px;
}

.lb-header {
  display: grid;
  grid-template-columns: 180px 1.5fr 1fr 3fr;
  padding: 8px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--glass-border);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  align-items: center;
}

#playersList {
  max-height: 70vh;
  overflow-y: auto;
  padding-bottom: 20px;
}

#playersList::-webkit-scrollbar {
  width: 6px;
}

#playersList::-webkit-scrollbar-track {
  background: transparent;
}

#playersList::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

#playersList::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Row */
.row {
  display: grid;
  grid-template-columns: 140px 1.5fr 1fr 3fr;
  padding: 0;
  align-items: center;
  cursor: pointer;
  position: relative;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 6px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  overflow: visible;
  z-index: 1;
  min-height: 70px;
  animation: rowAppear 0.5s ease-out backwards;
}

@keyframes rowAppear {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: all 0.3s;
}

.row:hover {
  background: rgba(45, 55, 75, 0.7);
  transform: translateX(2px);
  border-color: rgba(249, 115, 22, 0.3);
  z-index: 10;
}

.row:hover::before {
  background: var(--theme-color);
  box-shadow: 0 0 10px var(--theme-color);
}

/* Rank Slant Container */
.rank-slant-container {
  grid-column: 1;
  display: flex;
  align-items: center;
  position: relative;
  height: 70px;
  padding-right: 1px;
  z-index: 1;
}

.rank-slant-container::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #334155;
  clip-path: polygon(0 0, 100% 0, 85% 100%, 0% 100%);
  z-index: -1;
  border-radius: 6px 0 0 6px;
}

.rank-number {
  font-size: 1.1rem;
  font-weight: 900;
  font-style: italic;
  color: #fff;
  margin-left: 12px;
  z-index: 2;
  line-height: 1;
}

/* UPDATED AVATAR STYLES FOR MC-API BUSTS */
.rank-avatar {
  width: auto;
  height: 60px; /* Adjusted for Bust size within row */
  margin-left: 10px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
  z-index: 3;
  transition: transform 0.2s;
}

.row:hover .rank-avatar {
  transform: scale(1.1) translateY(-2px);
}

/* Removed old .is-body overrides that were specific to fullbody renders */

.row-top1 .rank-slant-container::before {
  background: #f1b32b;
}

.row-top2 .rank-slant-container::before {
  background: #94a3b8;
}

.row-top3 .rank-slant-container::before {
  background: #c2612a;
}

/* Player Info */
.col-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 20px;
}

.col-region {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 10px;
}

.col-gamemodes {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 10px;
  gap: 30px;
}

.player-name {
  font-weight: 800;
  font-size: 1.0rem;
  margin-bottom: 0px;
}

.player-subtitle {
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.player-points-text {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
}

.points-pill {
  font-family: 'Inter', monospace;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(90deg, var(--theme-color), #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 0.9rem;
  gap: 10px;
  filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.3));
}

.badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.region-as {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.region-eu {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

.region-na {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

/* Gamemode Chips */
.gm-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 48px;
  flex-shrink: 0;
  margin-right: 25px;
}

.gm-icon-wrap {
  width: 36px;
  height: 36px;
  background: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #555;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
  position: relative;
}

.gm-icon {
  width: 22px;   /* ICON SIZE FIX */
  height: 22px;  /* ICON SIZE FIX */
  object-fit: contain;
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}

.gm-tier-label {
  font-size: 0.9rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 3;
}

/* Tier Colors */
.tier-ht1 .gm-icon-wrap { border-color: #6d5d2c; }
.tier-ht1 .gm-tier-label { background: #6d5d2c; color: #d8af36; }

.tier-lt1 .gm-icon-wrap { border-color: #584c24; }
.tier-lt1 .gm-tier-label { background: #584c24; color: #b09445; }

.tier-ht2 .gm-icon-wrap { border-color: #5e6a7a; }
.tier-ht2 .gm-tier-label { background: #5e6a7a; color: #c4d3e8; }

.tier-lt2 .gm-icon-wrap { border-color: #555c66; }
.tier-lt2 .gm-tier-label { background: #555c66; color: #8e94a0; }

.tier-ht3 .gm-icon-wrap { border-color: #6b4b36; }
.tier-ht3 .gm-tier-label { background: #6b4b36; color: #ee9a57; }

.tier-lt3 .gm-icon-wrap { border-color: #603a25; }
.tier-lt3 .gm-tier-label { background: #603a25; color: #bf7640; }

.tier-slate .gm-icon-wrap { border-color: #2b2c3d; }
.tier-slate .gm-tier-label { background: #2b2c3d; color: #8d82a7; }

.tier-1 .gm-icon-wrap { border-color: #ef4444; }
.tier-1 .gm-tier-label { background: #ef4444; }

.tier-2 .gm-icon-wrap { border-color: #f97316; }
.tier-2 .gm-tier-label { background: #f97316; }

.tier-3 .gm-icon-wrap { border-color: #a855f7; }
.tier-3 .gm-tier-label { background: #a855f7; }

.tier-4 .gm-icon-wrap { border-color: #3b82f6; }
.tier-4 .gm-tier-label { background: #3b82f6; }

.tier-5 .gm-icon-wrap { border-color: #22c55e; }
.tier-5 .gm-tier-label { background: #22c55e; }

.tier-def .gm-icon-wrap { border-color: #64748b; }
.tier-def .gm-tier-label { background: #64748b; }


/* MODAL STYLES */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-glass {
  background: rgba(20, 25, 35, 0.9);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  width: 100%;
  max-width: 500px;
  padding: 32px;
  position: relative;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-glass::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.modal-overlay.open .modal-glass {
  transform: scale(1) translateY(0);
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 10;
}

.close-btn:hover {
  color: #fff;
}

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

/* Updated Modal Skin for Bust Render */
.modal-skin {
  height: 180px; /* Slightly smaller height for bust */
  width: auto;
  filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.5));
  margin-bottom: 10px;
  animation: floatSkin 4s ease-in-out infinite;
  image-rendering: pixelated;
  object-fit: contain;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.8rem;
  background: linear-gradient(135deg, #fff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-header .pid {
  font-family: monospace;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
  display: block;
}

.modal-stats {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  justify-content: space-around;
  margin-bottom: 10px;
}

.stat-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.stat-val {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--theme-color);
}

.tiers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}

.tier-card {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 50px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.2s, background 0.2s;
}

.tier-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.tier-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.tier-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.tier-mode {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.tier-rank {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tier-eligible-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 0 5px rgba(255, 175, 0, 0.6));
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.15); opacity: 1; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatSkin {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.status {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}

.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.error-icon {
  font-size: 2.5rem;
  opacity: 0.8;
}

.retry-btn {
  background: var(--theme-color);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}

@media (max-width: 900px) {
  .lb-header, .row {
    grid-template-columns: 50px 1fr 90px;
    gap: 10px;
  }
  .lb-header span:nth-child(3),
  .lb-header span:nth-child(4),
  .lb-header span:nth-child(6),
  .row> :nth-child(3),
  .row> :nth-child(4),
  .row> :nth-child(6) {
    display: none;
  }
  .tiers-grid { grid-template-columns: 1fr; }
}

.tier-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  padding: 20px;
  overflow-x: auto;
  align-items: start;
}

.tier-col {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tier-col-header {
  text-align: center;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--theme-color);
  font-size: 1.1rem;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.tier-player-card {
  background: #334155;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.tier-player-card:hover {
  transform: translateY(-2px);
  background: #475569;
}

.tier-player-card.is-ht {
  background: #475569;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.tp-avatar {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  image-rendering: pixelated;
  flex-shrink: 0;
}

.tp-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.tp-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

@media (max-width: 1000px) {
  .tier-board {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

.chip-eligible-icon {
  width: 100px;
  height: 100px;
  vertical-align: middle;
  margin-left: 3px;
  margin-bottom: 2px;
  filter: drop-shadow(0 0 3px rgba(255, 175, 0, 0.5));
}
.title-badge {
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #111;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.4);
}

.title-icon {
  margin-top: 10px;
  height: 36px;          /* adjust if needed */
  width: auto;
  image-rendering: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
}

.title-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  margin-top: 10px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.08),
    0 6px 18px rgba(0,0,0,0.35);
}

.title-pill img {
  width: 20px;
  height: 20px;
}

/* COLORS */
.title-grandmaster { background: linear-gradient(135deg,#fde68a,#f59e0b); color:#111; }
.title-master      { background: linear-gradient(135deg,#facc15,#eab308); color:#111; }
.title-ace         { background: linear-gradient(135deg,#fb7185,#be123c); color:#fff; }
.title-specialist  { background: linear-gradient(135deg,#c084fc,#7c3aed); color:#fff; }
.title-cadet       { background: linear-gradient(135deg,#60a5fa,#3b82f6); color:#fff; }
.title-novice      { background: linear-gradient(135deg,#a5b4fc,#6366f1); color:#fff; }
.title-rookie      { background: linear-gradient(135deg,#64748b,#475569); color:#e5e7eb; }



/* ================= MODAL ================= */
.modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ================= TITLE PILL (FIXED) ================= */
.title-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 6px 14px;
  margin-top: 6px;

  border-radius: 999px;

  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1;

  white-space: nowrap;

  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.08),
    0 6px 18px rgba(0,0,0,0.35);
}

/* 🔥 THIS IS THE IMPORTANT FIX */
.title-pill img {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

/* ================= UUID ================= */
.modal-header .pid {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   GAMEMODE BAR OVERRIDE — MATCH IMAGE #1 (PILL STYLE)
   DO NOT TOUCH ANYTHING ELSE ABOVE
   ============================================================ */

.controls {
  padding: 12px 14px;
}

.gamemodes {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
}

/* Pill buttons */
.gm-btn {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 10px 18px;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);

  color: #d6ccff;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;

  cursor: pointer;

  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
}

/* Icons inside pills */
.gm-btn img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  opacity: 0.85;
  filter: grayscale(100%);
  transition: all 0.25s ease;
}

/* Hover */
.gm-btn:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.4);
  transform: translateY(-1px);
}

.gm-btn:hover img {
  filter: grayscale(0%);
  opacity: 1;
}

/* ACTIVE — MATCH IMAGE #1 EXACT VIBE */
.gm-btn.active {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #ffffff;
  border-color: rgba(168, 85, 247, 0.85);

  box-shadow:
    0 0 0 1px rgba(168, 85, 247, 0.6),
    0 8px 30px rgba(168, 85, 247, 0.55),
    inset 0 0 12px rgba(255, 255, 255, 0.15);
}

.gm-btn.active img {
  filter: brightness(0) invert(1);
  opacity: 1;
}

/* Prevent pills from shrinking */
.gm-btn {
  flex-shrink: 0;
}


/* ============================================================
   FINAL ICON COLOR FIX — ALWAYS SHOW REAL ICON COLORS
   SAFE OVERRIDE — NOTHING REMOVED
   ============================================================ */

.gm-btn img {
  filter: none !important;
  opacity: 1 !important;
  transform: none !important;
}

.gm-btn:hover img {
  filter: none !important;
  opacity: 1 !important;
  transform: scale(1.05);
}

.gm-btn.active img {
  filter: brightness(0) invert(1) !important;
  opacity: 1 !important;
}


/* ============================================================
   FIX: ACTIVE GAMEMODE ICON SHOULD KEEP REAL COLOR
   (NO WHITE ICON ON CLICK)
   SAFE OVERRIDE — NOTHING REMOVED
   ============================================================ */

/* Active button text stays white, icon keeps original color */
.gm-btn.active img {
  filter: none !important;
  opacity: 1 !important;
  transform: none !important;
}

