:root {
  --bg-page: #f2f2f2;
  --bg-panel: linear-gradient(180deg, #ffffff, #eaeaea);
  --text-name: #111;
  --text-level: #ffd700;
  --overlay-dark: rgba(0,0,0,0.35);
  --text-outline: #fff;
}

body.dark {
  --bg-page: #0a0a0a;
  --bg-panel: linear-gradient(180deg, #222, #111);
  --text-name: #fff;
  --text-level: #ffd700;
  --overlay-dark: rgba(0,0,0,0.65);
  --text-outline: #000;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-page);
  color: var(--text-name);
  font-family: system-ui, sans-serif;
  transition: background 0.3s ease, color 0.3s ease;
}

h1 {
  font-family: Serif;
  text-align: center;
}

h3 {
  font-family: Serif;
  text-align: center;
  margin: 0px;
}


.theme-toggle {
  display: block;
  margin: 20px auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #444;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.3s ease, color 0.3s ease;
}

body.dark .theme-toggle {
  background: #ddd;
  color: #111;
}

/* ===== Background Panel ===== */
.tracker-bg {
  padding: 10px 1px;
  border-radius: 14px;
  background: var(--bg-panel);
  box-shadow:
    0 10px 30px rgba(0,0,0,0.4),
    inset 0 0 0 1px rgba(255,255,255,0.06);
  max-width: 900px;
  margin: 30px auto;
  transition: background 0.3s ease;
  max-height: 80vh; 
  overflow-y: auto; 
  padding: 10px;
  border: 1px solid #ccc;
  flex: 1;            
  max-width: 850px;   
  overflow-y: auto;  
}
}

#flex {
  display: flex;
  justify-content: center;
  gap: 1px;
  flex-wrap: wrap;
}

.lords-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  padding: 1px;
    flex: 1 1 600px;
}

.Characters {
  position: relative;
  width: 95px;
  height: 120px;
  overflow: visible;
  text-align: center;
  z-index: 1;
}

.Characters.break {
  flex-basis: 100%;
  height: 0;
}

.Characters img {
  width: 95px;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 3;
  transition: opacity 0.3s ease;
}

.Characters h2,
.Characters h3 {
  position: absolute;
  left: 0;
  width: 100%;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  transition:
    transform 0.35s cubic-bezier(.22,1,.36,1),
    opacity 0.35s ease;
  text-shadow:
    -1px -1px 0 var(--text-outline),
     1px -1px 0 var(--text-outline),
    -1px  1px 0 var(--text-outline),
     1px  1px 0 var(--text-outline);
}

.Characters h2 {
  top: -20px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  transform: translateY(20px);
  color: var(--text-name);
}

.Characters h3 {
  bottom: -10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-level);
  transform: translateY(-20px);
  transition-delay: 0.1s;
}

.Characters:hover h2,
.Characters:hover h3 {
  transform: translateY(0);
  opacity: 1;
}

.portrait {
  position: relative;
  width: 95px;
  height: 95px;
}

.badge {
  position: absolute;
  top: -30px;   
  right: 17px;
  width: 30px;
  height: 30px;
  z-index: 10;
  transition: transform 0.2s ease;
}

.badge.agent { width: 50px; height: 50px; }
.badge.knight { width: 50px; height: 50px; }
.badge.captain { width: 50px; height: 50px; }
.badge.centurion { width: 50px; height: 50px; }
.badge.lord { width: 50px; height: 50px; }
.badge.count { width: 50px; height: 50px; }

.inside2 {
  position: absolute;
  width: 200px;
  border: 1px solid #ccc;
  border-radius: 14px;
  padding: 10px;
  top: 50px;   
  right: 17px;
  max-height: 80vh;   
  overflow-y: auto;
}