main.container {
  display: unset;
}

/* Canvas full-size derrière les éléments */
#bg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Admin */
.admin-shell {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.admin-eyebrow {
  margin: 0 0 6px;
  color: #7dd3fc;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.admin-dashboard {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-workspace {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.admin-card {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 18px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  box-sizing: border-box;
  animation: fadeIn 0.35s ease-in-out;
}

.admin-command-card {
  position: sticky;
  top: 88px;
}

.logo-img {
  margin-top: 16px !important;
}

#user-avatar img {
  width: 52px !important;
  height: 52px !important;
  margin-top: 0px !important;
}

.admin-card h2 {
  font-size: 1.12rem;
  margin: 0 0 14px;
  text-transform: none;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-card-heading h2 {
  margin-bottom: 0;
}

.admin-icon {
  margin-right: 0;
  font-size: 1.15em;
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.admin-panel-nav {
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 12px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #f8fafc;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.admin-command-card .admin-btn {
  width: 100%;
  justify-content: flex-start;
}

.admin-btn:hover {
  background: rgba(51, 65, 85, 0.96);
  border-color: rgba(125, 211, 252, 0.42);
  transform: translateY(-1px);
}

.admin-btn:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.72);
  outline-offset: 2px;
}

/* Bouton de switch mode */
#toggle-mode-btn {
  margin-left: 1rem;
  background: linear-gradient(145deg, #8b5cf6, #6d28d9);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#toggle-mode-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

/* Bandeau de statut */
#mode-banner {
  position: fixed;
  bottom: 10px;
  left: 10px;
  padding: 6px 12px;
  background-color: rgba(108, 92, 231, 0.9);
  color: white;
  font-weight: bold;
  font-size: 14px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
#countdown-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Press Start 2P", monospace;
}

#countdown-number {
  font-size: 6rem;
  color: #fff;
  animation: pop 1s ease-in-out infinite;
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}
.section-admin {
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 48px;
  padding: 0;
  z-index: 10;
}
#draw-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#card-display {
  width: 300px;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
  animation: fadeIn 0.3s ease-in-out;
}

.card-item {
  width: 100%;
  height: 100%;
  background: #222;
  color: white;
  border-radius: 12px;
  padding: 20px;
  font-size: 1.4rem;
  text-align: center;
  backface-visibility: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  transform: rotateY(0deg);
  transition: transform 0.3s;
}

.card-winner {
  border: 3px solid gold;
  background: linear-gradient(135deg, #ffd700, #ffa500);
  color: black;
  font-weight: bold;
  font-size: 1.6rem;
}
.winner-card {
  transform: scale(1.1);
  border: 4px solid gold !important;
  animation: winner-glow 1s infinite alternate;
}

@keyframes winner-glow {
  from {
    box-shadow: 0 0 20px gold;
  }
  to {
    box-shadow: 0 0 40px orange;
  }
}

.profile-card-outer {
  background: linear-gradient(135deg, #1f1f1f, #2c2c2c);
  border: 2px dashed #9147ff;
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 0 20px rgba(145, 71, 255, 0.3);
  max-width: 500px;
  margin: 20px auto;
  color: #fff;
}

.profile-card-outer h3 {
  font-size: 1.8em;
  margin-bottom: 10px;
  color: #9147ff;
}

.profile-card-outer p {
  font-size: 1.1em;
  margin: 10px 0;
  line-height: 1.5;
}

.profile-card-outer a {
  display: inline-block;
  margin-top: 10px;
  background: #9147ff;
  color: white;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  transition: background 0.3s ease;
}

.profile-card-outer a:hover {
  background: #772ce8;
}

.profile-avatar img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid #9147ff;
  margin-bottom: 15px;
  box-shadow: 0 0 15px rgba(145, 71, 255, 0.4);
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(145, 71, 255, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 15px 10px rgba(145, 71, 255, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(145, 71, 255, 0);
  }
}

.profile-card-outer a {
  animation: pulse 2s infinite;
}

/* Live summary (connected) */
.live-summary-card {
  background: linear-gradient(135deg, #1b1b1b, #252525);
  border: 2px solid rgba(145, 71, 255, 0.35);
  border-radius: 16px;
  padding: 16px 18px;
  margin: 12px auto 20px;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  max-width: 520px;
}

.live-summary-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.live-summary-header h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.4px;
}

.live-summary-meta {
  font-size: 0.85rem;
  color: #cbd5f5;
  opacity: 0.9;
}

.live-summary-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1.2fr repeat(3, minmax(70px, 1fr));
  gap: 8px 12px;
  align-items: center;
}

.live-summary-cell.head {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #c4b5fd;
  opacity: 0.9;
}

.live-summary-cell.label {
  font-weight: 600;
  color: #e5e7eb;
}

.live-summary-cell.value {
  font-weight: 700;
  text-align: center;
  background: rgba(145, 71, 255, 0.12);
  border: 1px solid rgba(145, 71, 255, 0.3);
  border-radius: 8px;
  padding: 4px 6px;
}

.live-summary-empty {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #fcd34d;
}

.live-summary-presence {
  margin-top: 12px;
}

.live-summary-presence-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #c4b5fd;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.live-summary-presence-date {
  font-size: 0.78rem;
  color: #e5e7eb;
  text-transform: none;
  opacity: 0.9;
}

.live-summary-presence-list {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 96px;
  overflow: auto;
}

.live-summary-presence-chip {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(145, 71, 255, 0.18);
  border: 1px solid rgba(145, 71, 255, 0.35);
  color: #f4f4ff;
}
#card-explosion {
  position: fixed;
  inset: 0;
}

.card-fx {
  position: absolute;
  left: 50%;
  top: 60%;
  transform: translate(-50%, -50%) scale(0.5);
  opacity: 0;
  transition: transform 2s ease, opacity 1s ease;
}
.card-fx.exploded {
  transform: translate(-50%, -50%) translate(var(--x), var(--y)) scale(1);
  opacity: 1;
}

.orbiting-card {
  position: absolute;
  pointer-events: none;
  /* On centre toujours la carte sur left/top */
  transform: translate(-50%, -50%);
}
.returning {
  transition: transform 1s ease, opacity 1s ease;
  transform: translate(-50%, -50%) scale(0.5);
  opacity: 0;
}

.card {
  width: 100px;
  height: 140px;
  background: #fff;
  border: 2px solid #333;
  border-radius: 10px;
  text-align: center;
  line-height: 140px;
  font-weight: bold;
  font-family: sans-serif;
}
#orbit-center {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes rotate3d {
  0% {
    transform: translateX(300px) rotateY(0deg);
  }
  50% {
    transform: translateX(300px) rotateY(20deg);
  }
  100% {
    transform: translateX(300px) rotateY(0deg);
  }
}
/* overlay plein écran */
#winner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  animation: fadeIn 0.5s ease forwards;
}

/* flou et fondu des perdants */
.loser-blur {
  filter: blur(4px);
  opacity: 0.3;
  transition: filter 0.5s, opacity 0.5s;
}

/* zoom + légère rotation de la carte gagnante */
@keyframes popRotate {
  0% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.4) rotate(10deg);
  }
  100% {
    transform: translate(-50%, -50%) scale(1.2) rotate(0deg);
  }
}
.winner-zoom {
  animation: popRotate 0.8s ease-out forwards;
  z-index: 10001; /* au-dessus de l'overlay */
}
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10002;
}
.card-profile {
  width: 100% !important;
}
/* -- PANEL -- */
#stats-panel {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateX(-100%) translateY(-50%);
  width: 280px;
  /* on passe de max-height à height pour forcer une taille fixe */
  height: 70vh;
  background: linear-gradient(135deg, #2d2d83, #3b1d63);
  color: #fff;
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
  box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.5);
  padding: 16px;
  overflow-y: auto; /* scroll quand déborde */
  transition: transform 0.5s ease;
  z-index: 10000;
  padding-bottom: 80px; /* espace sous le tbody pour laisser place au footer */
}
#stats-panel.show {
  transform: translateX(0) translateY(-50%);
}

/* Header */
#stats-panel h3 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Table styling */
#stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

#stats-table th {
  text-align: left;
  padding: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
#stats-table td {
  padding: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
#stats-table img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #8b5cf6;
}

/* animation des lignes */
.stats-row {
  opacity: 0;
  transform: translateX(-20px);
  animation: slide-in 0.4s forwards ease-out;
}
@keyframes slide-in {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* pour bien voir le vol : */
.orbiting-card {
  z-index: 20000; /* au-dessus de tout */
}

/* petit effet bounce sur l'incrémentation */
@keyframes bounceUp {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

#stats-table td.update-bounce {
  animation: bounceUp 0.3s ease-in;
}
/* Footer du tableau avec le bouton Relancer */
#stats-table tfoot td {
  padding: 12px 6px;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  position: absolute;
  bottom: 1px;
  width: 87%;
}

.stats-relaunch-btn {
  width: 100%;
  max-width: 200px;
  padding: 8px 0;
  background: #8b5cf6;
  color: #fff;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.stats-relaunch-btn:hover {
  background: #a78bfa;
  transform: scale(1.02);
}

/* pulse doré sur toute la ligne */
#stats-table tbody tr.highlight-win {
  position: relative;
}
.wins {
  font-size: 27px;
  font-weight: bolder;
}
/* ———————————————————— */
/*  Slide la ligne au centre  */
/* ———————————————————— */
.slide-center {
  position: absolute;
  z-index: 20000;
}

/* ----------------------------- */
/* Popup “victory-card”          */
/* ----------------------------- */
.victory-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(29, 14, 60, 0.95);
  border: 3px solid #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  color: #fff;
  font-family: "Press Start 2P", monospace;
  opacity: 0;
  transform: scale(0.5);
  transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55),
    opacity 0.6s ease-out, box-shadow 4s ease-in-out infinite alternate;
  z-index: 20000;
  pointer-events: none;
}
/* avatar rond */
.victory-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #8b5cf6;
  box-shadow: 0 0 8px rgba(145, 71, 255, 0.6);
}
/* texte */
.victory-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.victory-name {
  font-size: 1.2rem;
  letter-spacing: 1px;
  color: #fff;
}
.victory-count {
  font-size: 1.6rem;
  font-weight: bold;
  color: #fcd34d;
  text-shadow: 0 0 6px #fbbf24;
  animation: popCount 1s ease-out;
}

/* petit “pop” sur le nombre */
@keyframes popCount {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* confettis CSS autour */
.victory-card::after {
  content: "";
  position: absolute;
  top: -16px;
  left: -16px;
  width: calc(100% + 32px);
  height: calc(100% + 32px);
  pointer-events: none;
  background-image: radial-gradient(
      circle at 20% 10%,
      #ff0057 4px,
      transparent 0
    ),
    radial-gradient(circle at 80% 30%, #37ff4f 5px, transparent 0),
    radial-gradient(circle at 30% 80%, #ffd700 6px, transparent 0),
    radial-gradient(circle at 60% 60%, #37d9ff 4px, transparent 0);
  background-repeat: repeat;
  animation: confettiMove 3s linear infinite;
}
@keyframes confettiMove {
  0% {
    background-position: 0 -50px, 50px -100px, 100px -80px, 150px -120px;
  }
  100% {
    background-position: 0 100%, 50px 120%, 100px 140px, 150px 160px;
  }
}
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  .spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fly-to-discord {
  to {
    transform: translate(var(--dx), var(--dy)) scale(0.5) rotate(15deg);
    opacity: 0;
  }
}
/* en haut de ton connected.css, ou à la fin */
#send-animation-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  width: 100%;
  height: auto;
  z-index: 10000;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.temp-card {
  width: 100%;
  height: 140px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.envelope {
  width: 80px;
  height: 60px;
  background: url("images/envelope.png") center/contain no-repeat;
  position: absolute;
}
.container {
  max-width: 100% !important;
}
/* === Structure & centrage === */
.navbar {
  position: relative;
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 2rem;
  background-size: 800% 800%;
}

.nav-logo {
  position: absolute;
  left: 2rem;
}

#user-avatar {
  position: absolute;
  right: 2rem;
}

/* Conteneur des liens centré */

/* === Animation du gradient de fond === */
@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
/* Container bottom fixed */
#bottom-controls {
  position: fixed;
  bottom: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
}

/* Remise à zéro des positionnements individuels */
#mode-banner,
#toggle-mode-btn {
  position: static;
  margin: 0;
  transform: none;
}

/* Ajustements visuels */
#toggle-mode-btn {
  background: linear-gradient(145deg, #8b5cf6, #6d28d9);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#toggle-mode-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}
.nav-item {
  display: inline-block;
  transform: perspective(500px) rotateX(20deg);
  transition: transform 0.4s cubic-bezier(0.6, -0.28, 0.735, 0.045);
}
.nav-item:hover {
  transform: perspective(500px) rotateX(0deg) translateY(-6px) scale(1.05);
}

/* nouveau style pour les images “full” */
.card-full-image {
  width: 200px; /* même taille que vos cartes */
  height: 316px; /* à ajuster selon ratio */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-full-image img {
  /* max-width: 169%; */
  /* max-height: 100%; */
  /* object-fit: contain; */
  min-width: 310px;
  /* min-height: 202px; */
  height: 357px;
}
/* 1) Définir la taille / ratio de la carte */
.card-3d.full-image {
  width: 200px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s;
  margin: 0 auto;
  height: 311px;
  border-radius: 8px;
}

/* 2) Les faces avant et arrière doivent remplir tout le container */
.card-3d.full-image .card-front,
.card-3d.full-image .card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

/* 3) Assurer que l’image prenne tout l’espace */
.card-3d.full-image .card-front img {
  width: 100%;
  height: 100%;
}

/* 5) Flip */
.card-3d.full-image.flipped {
  transform: rotateY(180deg);
}
#go-collection {
  position: relative; /* pour que le badge puisse se positionner par rapport au bouton */
}

.notification-badge {
  position: absolute;
  top: 0%;
  right: 0px;
  min-width: 18px;
  height: 21px;
  padding: 0 5px;
  font-size: 12px;
  line-height: 18px;
  color: #fff;
  background-color: #e74c3c;
  border-radius: 9px;
  text-align: center;
  pointer-events: none;
}

.panel {
  margin: 2rem;
  padding: 1rem;
  color: #fff;
  border-radius: 8px;
}
.leaderboard-filters button {
  margin-right: 0.5rem;
  padding: 0.3rem 0.6rem;
}
.leaderboard-filters .active {
  background: #9147ff;
  color: #fff;
}
#leaderboard-table,
#leaderboard-table th,
#leaderboard-table td {
  border: 1px solid #444;
  border-collapse: collapse;
  padding: 0.5rem;
}
.badge-top {
  margin-left: 0.5rem;
  font-size: 0.9em;
  color: gold;
}
.h2h-selectors {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
main.container {
  display: grid;
  grid-template-columns: 1fr 2fr; /* 2/3 pour le profil, 1/3 pour le classement */
  gap: 2rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 1200px) {
  main.container {
    grid-template-columns: 1fr; /* sur mobile on passe en colonne unique */
  }
}
/* Conteneur général du classement */
#leaderboard {
  background: #1b1b1b;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* TABLEAU =========================== */
#leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  background: #222;
  font-family: "Roboto", sans-serif;
}

/* EN-TÊTE ========================== */
#leaderboard-table thead {
  background: linear-gradient(135deg, #6d28d9, #8b5cf6);
}
#leaderboard-table th {
  padding: 12px 16px;
  color: #fff;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

/* LIGNES & CELLULES ================= */
#leaderboard-table tbody tr {
  transition: background 0.2s ease, transform 0.15s ease;
}
#leaderboard-table tbody tr:nth-child(odd) {
  background: #1e1e1e;
}
#leaderboard-table tbody tr:nth-child(even) {
  background: #2a2a2a;
}
#leaderboard-table tbody tr:hover {
  background: #3b3b3b;
  transform: scale(1.005);
}
#leaderboard-table td {
  padding: 12px 16px;
  color: #ccc;
  font-size: 0.9rem;
  vertical-align: middle;
}
/* Scrollbar custom (Webkit) */
#leaderboard {
  max-height: 500px;
  overflow-y: auto;
}
#leaderboard::-webkit-scrollbar {
  width: 8px;
}
#leaderboard::-webkit-scrollbar-track {
  background: transparent;
}
#leaderboard::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
#leaderboard::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Responsive : garde les cellules compactes */
@media (max-width: 768px) {
  #leaderboard-table th,
  #leaderboard-table td {
    padding: 8px 10px;
    font-size: 0.8rem;
  }
}
/* wrapper scrollable */
.table-wrapper {
  max-height: 500px; /* hauteur max de la zone scrollable */
  overflow-y: auto; /* active uniquement le scroll vertical */
}

/* conserve l’en-tête visible */
#leaderboard-table thead th {
  top: 0;
  background: #1b1b1b; /* même couleur que le fond du thead */
  z-index: 2;
}
/* ——— Table wrapper ——— */
.table-wrapper {
  border-radius: 12px;
  overflow: hidden; /* pour ne scroller que l’intérieur */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ——— Structure de base ——— */
#leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  background: #1a1a1a;
  font-size: 0.95rem;
  text-align: center;
}

/* ——— Header en dégradé ——— */
#leaderboard-table thead {
  background: linear-gradient(90deg, #8b5cf6, #6d28d9);
}
#leaderboard-table thead th {
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* ——— Lignes alternées et hover ——— */
#leaderboard-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.3s, transform 0.2s;
}
#leaderboard-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.03);
}
#leaderboard-table tbody tr:hover {
  background: rgba(108, 92, 231, 0.2);
  transform: translateX(4px);
}

/* ——— Cellules ——— */
#leaderboard-table td {
  padding: 12px 16px;
  color: #ddd;
}

/* ——— Badges pour le podium ——— */
.rank-cell[data-rank="1"]::before {
  content: "🥇 ";
}
.rank-cell[data-rank="2"]::before {
  content: "🥈 ";
}
.rank-cell[data-rank="3"]::before {
  content: "🥉 ";
}

/* ——— Barre de progression sous Niveau ——— */
/* On s’appuie sur une variable CSS --level (0–150) définie inline en JS */
#leaderboard-table td.level-cell {
  position: relative;
  font-weight: bold;
}
#leaderboard-table td.level-cell::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 16px;
  width: calc((100% - 32px) * var(--level) / 150);
  height: 4px;
  background: rgba(108, 92, 231, 0.8);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ——— Scroll uniquement sur le tbody ——— */
.table-wrapper {
  max-height: 500px;
  overflow-y: auto;
}
#leaderboard-table thead th {
  top: 0;
  z-index: 2;
}
#leaderboard-table .rankName {
  font-size: 14px;
  text-align: center;
}
.search-dropdown {
  display: flex;
  flex-direction: column;
  margin-right: 1rem;
  max-width: 200px;
}

.search-dropdown input {
  padding: 6px 10px;
  margin-bottom: 4px;
  border-radius: 4px;
  border: 1px solid #555;
  background: #222;
  color: #fff;
}

.search-dropdown input::placeholder {
  color: #888;
}

.search-dropdown select {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #555;
  background: #111;
  color: #fff;
}
.highlight-avatar-leaderboard {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fffb00;
  background: #000;
  position: relative;
  top: 2px;
}
#leaderboard-table th {
  white-space: nowrap;
}
#leaderboard-table th .th-sort {
  margin-left: 0.4rem;
  font: inherit;
  line-height: 1;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0.7;
  color: white;
}
#leaderboard-table th .th-sort:hover {
  opacity: 1;
}
:root {
  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
}

/* Base: bordure gauche + légère surbrillance de ligne */
#leaderboard-table tbody tr[class^="podium-"] {
  position: relative;
  isolation: isolate;
}
#leaderboard-table tbody tr.podium-1::after,
#leaderboard-table tbody tr.podium-2::after,
#leaderboard-table tbody tr.podium-3::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

/* 1er : or + léger “shine” */
#leaderboard-table tbody tr.podium-1 {
  box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.18);
  background-image: linear-gradient(
    90deg,
    rgba(255, 215, 0, 0.1),
    rgba(0, 0, 0, 0) 55%
  );
  animation: podium-shine 3s linear infinite;
}
#leaderboard-table tbody tr.podium-1::after {
  background: linear-gradient(180deg, var(--gold), #b38f00);
}
#leaderboard-table tbody tr.podium-1 .rank-cell {
  color: var(--gold);
  font-weight: 800;
}
#leaderboard-table tbody tr.podium-1 td:nth-child(2)::after {
  content: " 👑";
}

/* 2e : argent */
#leaderboard-table tbody tr.podium-2 {
  box-shadow: inset 0 0 0 1px rgba(192, 192, 192, 0.16);
  background-image: linear-gradient(
    90deg,
    rgba(192, 192, 192, 0.08),
    rgba(0, 0, 0, 0) 55%
  );
}
#leaderboard-table tbody tr.podium-2::after {
  background: linear-gradient(180deg, var(--silver), #7f7f7f);
}
#leaderboard-table tbody tr.podium-2 .rank-cell {
  color: var(--silver);
  font-weight: 700;
}

/* 3e : bronze */
#leaderboard-table tbody tr.podium-3 {
  box-shadow: inset 0 0 0 1px rgba(205, 127, 50, 0.16);
  background-image: linear-gradient(
    90deg,
    rgba(205, 127, 50, 0.08),
    rgba(0, 0, 0, 0) 55%
  );
}
#leaderboard-table tbody tr.podium-3::after {
  background: linear-gradient(180deg, var(--bronze), #7a431b);
}
#leaderboard-table tbody tr.podium-3 .rank-cell {
  color: var(--bronze);
  font-weight: 700;
}

/* Anneau autour de l’avatar */
#leaderboard-table tbody tr.podium-1 .highlight-avatar-leaderboard {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.28),
    0 0 18px rgba(255, 215, 0, 0.35);
}
#leaderboard-table tbody tr.podium-2 .highlight-avatar-leaderboard {
  border-color: var(--silver);
  box-shadow: 0 0 0 3px rgba(192, 192, 192, 0.25),
    0 0 14px rgba(192, 192, 192, 0.3);
}
#leaderboard-table tbody tr.podium-3 .highlight-avatar-leaderboard {
  border-color: var(--bronze);
  box-shadow: 0 0 0 3px rgba(205, 127, 50, 0.25),
    0 0 14px rgba(205, 127, 50, 0.28);
}

/* Brillance douce pour la 1ère place */
@keyframes podium-shine {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}
.rank-pseuod-leaderboard {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
/* Pourcentage de présence à côté du pseudo */
.progress-badge {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  opacity: 0.85;
  border: 1px solid rgba(255,255,255,0.25);
}

/* ===== Admin Goals ===== */
.admin-goals-card {
  width: min(960px, 92vw);
  max-width: 960px;
}

.section-admin .admin-goals-card,
.section-admin .planning-admin-card {
  width: 100%;
  max-width: none;
}

.admin-goals-card.is-collapsed {
  display: none;
}
.admin-goals-grid {
  display: grid;
  gap: 16px;
}

.admin-form {
  background: rgba(2, 6, 23, 0.34);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  padding: 16px;
}

.collection-card-mode-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.collection-card-mode-tab {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  background: transparent;
  color: rgba(226, 232, 240, 0.78);
  font-weight: 700;
  cursor: pointer;
}

.collection-card-mode-tab:hover,
.collection-card-mode-tab.is-active {
  background: rgba(34, 197, 94, 0.18);
  color: #dcfce7;
}

.collection-card-mode-panel[hidden] {
  display: none;
}

.collection-card-series-existing {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.collection-card-series-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.collection-card-series-toolbar h4 {
  margin: 0;
  font-size: 0.95rem;
}

.collection-card-game-series-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.collection-card-game-series-empty {
  margin: 0;
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.82rem;
}

.collection-card-game-series-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.collection-card-game-series-item.is-selected {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(20, 83, 45, 0.24);
}

.collection-card-game-series-title {
  margin: 0;
  font-weight: 800;
  color: #e0f2fe;
}

.collection-card-game-series-meta {
  margin: 4px 0 0;
  font-size: 0.76rem;
  color: rgba(226, 232, 240, 0.82);
}

.collection-card-game-series-add {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
}

.collection-card-game-selected-series {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.38);
  color: #dcfce7;
  font-size: 0.82rem;
}

.collection-card-game-selected-series-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.collection-card-game-selected-series-title {
  margin: 0;
  font-weight: 800;
}

.collection-card-game-selected-series-meta {
  margin: 0;
  color: rgba(220, 252, 231, 0.82);
  font-size: 0.76rem;
}

.collection-card-game-selected-series-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.collection-card-game-selected-series-empty {
  margin: 0;
  color: rgba(220, 252, 231, 0.82);
}

.collection-card-game-selected-series-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.34);
  border: 1px solid rgba(220, 252, 231, 0.16);
}

.collection-card-game-selected-series-card img {
  width: 42px;
  height: 58px;
  border-radius: 5px;
  object-fit: cover;
  background: rgba(15, 23, 42, 0.7);
}

.collection-card-game-selected-series-card.is-without-image {
  grid-template-columns: 1fr;
}

.collection-card-game-selected-series-card-title {
  margin: 0;
  color: #f0fdf4;
  font-weight: 800;
}

.collection-card-game-selected-series-card-meta {
  margin: 2px 0 0;
  color: rgba(220, 252, 231, 0.78);
  font-size: 0.74rem;
}

.collection-card-game-selected-series-card code {
  display: block;
  margin-top: 4px;
  color: #bbf7d0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collection-card-series-main {
  grid-template-columns:
    minmax(180px, 1fr)
    minmax(120px, 0.45fr)
    minmax(140px, 0.55fr);
}

.collection-card-series-rows {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.collection-card-series-row {
  display: grid;
  grid-template-columns:
    minmax(74px, 0.35fr)
    minmax(120px, 0.5fr)
    minmax(92px, 0.4fr)
    minmax(190px, 1fr)
    minmax(220px, 1.1fr);
  gap: 10px;
  align-items: end;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.collection-card-series-row > strong {
  min-height: 34px;
  display: flex;
  align-items: center;
  color: #bfdbfe;
}

.collection-card-series-row input[readonly] {
  color: rgba(226, 232, 240, 0.7);
}

.collection-card-series-summary {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: rgba(241, 245, 249, 0.9);
  font-size: 0.82rem;
}

.collection-card-series-summary.is-created {
  border-color: rgba(34, 197, 94, 0.42);
  background: rgba(20, 83, 45, 0.24);
}

.collection-card-series-summary p {
  margin: 0 0 8px;
}

.collection-card-series-summary p:last-child {
  margin-bottom: 0;
}

.collection-card-series-summary ul {
  margin: 0;
  padding-left: 18px;
}

.collection-card-series-summary li {
  margin: 4px 0;
}

.collection-card-series-summary li.is-conflict {
  color: #fca5a5;
}

.admin-panel-section {
  display: grid;
  gap: 10px;
}

.admin-form-divider {
  margin-top: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.9);
}

.admin-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-form-header h3 {
  margin: 0;
  font-size: 1rem;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: #e2e8f0;
}

.admin-form input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 10, 20, 0.7);
  color: #fff;
}

.admin-form textarea {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 10, 20, 0.7);
  color: #fff;
  resize: vertical;
  min-height: 96px;
}

.admin-form select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 10, 20, 0.7);
  color: #fff;
}

.admin-readonly-value {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 10, 20, 0.7);
  color: #fff;
}

.admin-form input:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.7);
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.2);
}

.admin-form textarea:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.7);
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.2);
}

.admin-form select:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.7);
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.2);
}

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

.admin-inline input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 10, 20, 0.7);
  color: #fff;
}

.admin-inline input:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.7);
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.2);
}

.admin-inline input {
  flex: 1;
}

.admin-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}

.admin-form-label {
  margin-top: 12px;
}

.admin-goal-list {
  display: grid;
  gap: 14px;
}

.admin-goal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-list-item span {
  flex: 1;
}

.admin-remove-btn {
  border: 0;
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.admin-remove-btn:hover {
  background: rgba(239, 68, 68, 0.35);
}

.admin-status {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: #fcd34d;
}

.admin-checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.admin-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
}

.admin-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.admin-panel-note {
  margin: 12px 0 0;
  font-size: 0.78rem;
  color: rgba(241, 245, 249, 0.84);
  line-height: 1.35;
}

.admin-panel-note code {
  color: #f5d0fe;
}

.planning-admin-card {
  width: min(1080px, 95vw);
  max-width: 1080px;
}

.planning-admin-form {
  display: grid;
  gap: 14px;
}

.planning-admin-toolbar {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.planning-admin-actions {
  justify-content: flex-start;
}

.planning-days-list {
  display: grid;
  gap: 12px;
}

.planning-day-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(2, 8, 23, 0.4);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.planning-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.planning-day-header h3 {
  margin: 0;
  font-size: 0.96rem;
}

.planning-day-counter {
  font-size: 0.75rem;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.45);
  border-radius: 999px;
  padding: 3px 8px;
}

.planning-day-slots {
  display: grid;
  gap: 10px;
}

.planning-day-empty {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(226, 232, 240, 0.82);
}

.planning-slot-row {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
  padding: 10px;
}

.planning-slot-grid {
  display: grid;
  grid-template-columns:
    minmax(110px, 150px)
    minmax(110px, 150px)
    minmax(210px, 1fr)
    minmax(170px, 1fr)
    auto;
  gap: 10px;
  align-items: end;
}

.planning-slot-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: #dbeafe;
}

.planning-slot-remove {
  min-height: 38px;
  align-self: end;
}

.quests-admin-card {
  width: min(1080px, 95vw);
  max-width: 1080px;
}

.quests-admin-card .admin-panel-section {
  order: 1;
}

.quest-admin-editor {
  order: 0;
  max-height: 2800px;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height 0.34s ease,
    opacity 0.24s ease,
    transform 0.34s ease,
    padding 0.34s ease,
    border-color 0.34s ease,
    margin 0.34s ease;
}

.quest-admin-editor.is-collapsed {
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  border-color: transparent;
}

.quest-admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.quest-icon-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: #e2e8f0;
}

.admin-form .quest-icon-field > label {
  display: block;
  font-size: inherit;
  color: inherit;
}

.quest-icon-combobox {
  position: relative;
}

.quest-icon-combobox input {
  width: 100%;
  padding-right: 44px;
}

.quest-icon-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  place-items: center;
  width: 31px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
  font-size: 1rem;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}

.quest-icon-toggle:hover,
.quest-icon-toggle[aria-expanded="true"] {
  background: rgba(34, 197, 94, 0.32);
}

.quest-icon-picker {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 8px;
  max-height: 190px;
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  background: rgba(8, 13, 28, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.26);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
}

.quest-icon-picker[hidden] {
  display: none;
}

.quest-icon-option {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  font-size: 1.15rem;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.quest-icon-option:hover,
.quest-icon-option.is-selected {
  transform: translateY(-1px);
  border-color: rgba(34, 197, 94, 0.58);
  background: rgba(20, 83, 45, 0.32);
}

.quest-icon-picker-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.8rem;
}

.quest-tiers-section {
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.34);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.quest-tiers-section[hidden] {
  display: none;
}

.quest-tiers-list {
  display: grid;
  gap: 10px;
}

.quest-tier-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(84px, 0.45fr) minmax(84px, 0.45fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border-radius: 8px;
  background: rgba(2, 8, 23, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.quest-tier-row.is-disabled {
  opacity: 0.58;
}

.quest-tier-row > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 700;
}

.quest-tier-enabled {
  align-self: center;
  min-height: 38px;
  margin: 0;
}

.quest-tier-empty {
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  color: rgba(226, 232, 240, 0.78);
  background: rgba(2, 8, 23, 0.32);
}

.quests-admin-list {
  display: grid;
  gap: 12px;
}

.quest-admin-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
  background: rgba(2, 8, 23, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.quest-admin-item.is-disabled {
  opacity: 0.58;
}

.quest-admin-item.is-editing {
  border-color: rgba(34, 197, 94, 0.52);
  background:
    linear-gradient(90deg, rgba(34, 197, 94, 0.14), transparent 44%),
    rgba(2, 8, 23, 0.46);
}

.quest-admin-title {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  margin: 0;
  color: #f8fafc;
  font-weight: 800;
}

.quest-admin-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.16);
  border: 1px solid rgba(125, 211, 252, 0.22);
}

.quest-admin-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quest-admin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.quest-admin-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: rgba(226, 232, 240, 0.88);
  font-size: 0.74rem;
  font-weight: 700;
}

.quest-admin-pill.is-active {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(20, 83, 45, 0.24);
}

.quest-admin-pill.is-muted {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.34);
  background: rgba(127, 29, 29, 0.22);
}

.quest-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.quest-admin-empty {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.42);
  color: rgba(226, 232, 240, 0.82);
}

@media (max-width: 980px) {
  .section-admin {
    width: min(1180px, calc(100% - 20px));
    margin-top: 16px;
  }

  .admin-dashboard {
    grid-template-columns: 1fr;
  }

  .admin-command-card {
    position: static;
  }
}

@media (max-width: 768px) {
  .admin-form-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-checkbox-grid {
    flex-direction: column;
    align-items: stretch;
  }

  .collection-card-mode-tabs {
    width: 100%;
  }

  .collection-card-mode-tab {
    flex: 1;
  }

  .collection-card-series-main,
  .collection-card-series-row {
    grid-template-columns: 1fr;
  }

  .collection-card-series-row > strong {
    min-height: auto;
  }

  .planning-slot-grid {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .quest-tier-row {
    grid-template-columns: 1fr;
  }

  .planning-slot-remove {
    justify-self: stretch;
    width: 100%;
  }

  .quest-admin-item {
    grid-template-columns: 1fr;
  }

  .quest-admin-actions {
    justify-content: flex-start;
  }
}

/* Compact desktop header override for connected and collection pages */
@media (min-width: 769px) {
  header .navbar {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas: "brand center actions";
    align-items: center;
    justify-content: normal;
    width: min(100%, 1460px);
    min-height: 68px;
    height: auto;
    margin: 0 auto;
    padding: 6px clamp(12px, 1.45vw, 22px);
    gap: 0 clamp(8px, 1vw, 14px);
  }

  header .navbar > * {
    min-width: 0;
  }

  header .nav-logo {
    grid-area: brand;
    position: static;
    inset: auto;
    margin: 0;
    transform: none;
    justify-self: start;
  }

  header .logo-img {
    height: clamp(50px, 4vw, 58px) !important;
    margin: 0 !important;
  }

  header .navbar > .nav-links {
    grid-area: center;
    justify-self: center;
    position: static !important;
    inset: auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    gap: clamp(6px, 0.8vw, 9px);
    transform: none !important;
  }

  header .navbar .header-social-slot {
    grid-area: actions;
    justify-self: end;
    margin: 0 !important;
  }

  header .navbar .pops-wallet {
    grid-area: actions;
    justify-self: end;
    min-height: 34px;
    gap: 6px;
    padding: 5px 10px 5px 8px;
    font-size: 0.78rem;
  }

  header #user-avatar {
    grid-area: actions;
    position: static;
    inset: auto;
    margin: 0 !important;
    transform: none;
    justify-self: end;
  }

  header #user-avatar img[src]:not([src=""]):not([src="about:blank"]) {
    width: 40px !important;
    height: 40px !important;
  }

  header .navbar :is(.nav-links a, .nav-item, .twitch-login-btn) {
    min-height: 34px;
    margin: 0 !important;
    padding: 7px 13px;
    font-size: 0.82rem;
    line-height: 1;
    white-space: nowrap;
  }

  header .header-social-slot .social-topbar.is-in-header {
    --social-gap: 6px;
    --social-pill-size: 34px;
    --social-icon-size: 16px;
    margin: 0;
    padding: 5px 6px;
    border-radius: 16px;
  }

  header > #bg-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }
}

@media (min-width: 769px) and (max-width: 1180px) {
  header .navbar {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    min-height: 62px;
    padding-inline: 12px;
    gap: 0 8px;
  }

  header .logo-img {
    height: 48px !important;
  }

  header .navbar :is(.nav-links a, .nav-item, .twitch-login-btn) {
    min-height: 32px;
    padding: 6px 11px;
    font-size: 0.78rem;
  }

  header .header-social-slot .social-topbar.is-in-header {
    --social-gap: 4px;
    --social-pill-size: 30px;
    --social-icon-size: 15px;
    padding: 4px;
  }

  header .pops-wallet {
    min-height: 32px;
    padding: 4px 8px 4px 7px;
    font-size: 0.75rem;
  }

  header #user-avatar img[src]:not([src=""]):not([src="about:blank"]) {
    width: 36px !important;
    height: 36px !important;
  }
}

@media (min-width: 769px) {
  body.collection-page header .navbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas: "brand nav actions";
    align-items: center;
    justify-content: normal;
    width: min(100%, 1500px);
    min-height: 70px;
    height: auto;
    margin: 0 auto;
    padding: 8px clamp(12px, 1.55vw, 22px);
    gap: clamp(8px, 1vw, 16px);
  }

  body.collection-page header .navbar .nav-logo {
    grid-area: brand;
    position: static !important;
    inset: auto !important;
    margin: 0 !important;
    transform: none !important;
    justify-self: start;
  }

  body.collection-page header .navbar .logo-img {
    height: clamp(48px, 3.8vw, 58px) !important;
    margin: 0 !important;
  }

  body.collection-page header .navbar > .nav-links {
    grid-area: nav;
    justify-self: center;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    margin: 0;
    padding: 0;
    gap: clamp(6px, 0.75vw, 10px);
    overflow: visible;
    transform: none !important;
  }

  body.collection-page header .navbar .nav-links .mobile-nav-only {
    display: none !important;
  }

  body.collection-page header .navbar .nav-links .desktop-nav-only {
    display: inline-flex;
  }

  body.collection-page header .navbar .site-nav-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
    gap: clamp(7px, 0.75vw, 10px);
  }

  body.collection-page header .navbar .mobile-primary-nav {
    display: none !important;
  }

  body.collection-page header .navbar #user-avatar {
    display: flex !important;
    position: static !important;
    margin: 0 !important;
  }
}

@media (min-width: 769px) and (max-width: 1180px) {
  body.collection-page header .navbar {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    min-height: 64px;
    padding-inline: 12px;
    gap: 8px;
  }

  body.collection-page header .navbar .logo-img {
    height: 46px !important;
  }
}
