/* =================================================
   THEME VARIABLES
   ================================================= */
:root {
  --bg-main: #1f1f1f;
  --bg-card: #2a2a2a;
  --bg-header: #000000;
  --text-main: #e6e6e6;
  --text-muted: #b0b0b0;
  --accent-yellow: #f5c542;
  --border-dark: #111111;
}

/* =================================================
   GLOBAL RESET / BASE
   ================================================= */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: Arial, sans-serif;
}

/* =========================
   FILTER / SORT CONTROLS
   ========================= */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.controls select {
  padding: 6px 10px;
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-dark);
  border-radius: 6px;
  font-size: 14px;
}

/* =================================================
   LAYOUT
   ================================================= */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

/* =================================================
   TYPOGRAPHY
   ================================================= */
h1 {
  margin-bottom: 10px;
}

p {
  color: var(--text-muted);
}

/* =================================================
   HEADER / NAVIGATION
   ================================================= */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-header);
  padding: 14px 24px;
  border-bottom: 2px solid var(--accent-yellow);
}

.logo {
  font-size: 18px;
  font-weight: bold;
  color: var(--accent-yellow);
}

.nav-links a {
  margin-left: 24px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--accent-yellow);
}

/* =================================================
   HOME PAGE (UID ENTRY)
   ================================================= */
.home-center {
  height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.uid-input {
  margin-top: 16px;
  padding: 10px 12px;
  width: 260px;
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-dark);
  border-radius: 6px;
  font-size: 16px;
}

/* =================================================
   BUTTONS
   ================================================= */
.primary-button {
  margin-top: 20px;
  padding: 10px 16px;
  background-color: var(--accent-yellow);
  color: #000;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.primary-button:hover {
  opacity: 0.9;
}

/* =================================================
   COUNTER + PROGRESS BAR
   ================================================= */
#counter {
  margin: 10px 0;
  font-weight: bold;
}

.progress-container {
  max-width: 400px;
  height: 18px;
  margin-bottom: 20px;
  background-color: #111;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-dark);
}

#progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--accent-yellow);
  transition: width 0.3s ease;
}

/* =================================================
   OPERATOR GRID
   ================================================= */
.operator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 20px;
}

/* =================================================
   OPERATOR CARD
   ================================================= */
.operator-card {
  background-color: var(--bg-card);
  padding: 10px;
  border-radius: 12px;
  max-width: 180px;
  margin: 0 auto;
  text-align: center;
  cursor: pointer;
}

/* =================================================
   PORTRAIT + ICON OVERLAY
   ================================================= */
.portrait-wrapper {
  position: relative;
  width: 100%;
}

/* ONLY the character portrait */
.portrait-wrapper > img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid transparent;
  filter: grayscale(100%);
  opacity: 0.35;
  transition:
    filter 0.25s ease,
    opacity 0.25s ease,
    border 0.25s ease,
    transform 0.15s ease;
}

/* Owned state */
.operator-card.owned .portrait-wrapper > img {
  filter: grayscale(0%);
  opacity: 1;
  border-color: var(--accent-yellow);
}

/* Hover feedback */
.operator-card:hover .portrait-wrapper > img {
  transform: scale(1.05);
}

/* =================================================
   ROLE / ELEMENT ICONS (CIRCLES ONLY)
   ================================================= */
.icon {
  position: absolute;
  width: 30px;
  height: 30px;
  background-color: #000;
  border: 1px solid var(--accent-yellow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.role-icon {
  bottom: 8px;
  left: 8px;
}

.element-icon {
  bottom: 8px;
  right: 8px;
}

/* ICON IMAGE — NEVER styled like portraits */
.icon-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 0;
  filter: none;
  opacity: 1;
}

/* =================================================
   OPERATOR NAME
   ================================================= */
.operator-name {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-main);
}

/* =================================================
   FOOTER
   ================================================= */
footer {
  margin-top: 40px;
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}
