/* ---------------------------
   Tier List
---------------------------- */

/* Container */
#tier-wrap {
  position: relative;
  clear: both;
  margin: 32px 0;
  width: 100%;
}

#tier-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Tier Row */
.tier-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}

.tier-row:last-child {
  border-bottom: none;
}

/* Label Holder (Tier Label) */
.label-holder {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  text-align: center;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  box-sizing: border-box;
}

.label-holder .label {
  display: block;
  line-height: 1;
  width: 100%;
  text-align: center;
}

/* Tier label colors — sharp, vibrant, fits the purple/indigo theme */
.tier-row:nth-child(1) .label-holder { background: #f59e0b !important; color: #fff !important; } /* S — electric gold */
.tier-row:nth-child(2) .label-holder { background: #22c55e !important; color: #fff !important; } /* A — vivid green */
.tier-row:nth-child(3) .label-holder { background: #6366f1 !important; color: #fff !important; } /* B — indigo (brand) */
.tier-row:nth-child(4) .label-holder { background: #8b5cf6 !important; color: #fff !important; } /* C — violet */
.tier-row:nth-child(5) .label-holder { background: #f97316 !important; color: #fff !important; } /* D — bright orange */
.tier-row:nth-child(6) .label-holder { background: #ef4444 !important; color: #fff !important; } /* F — red */

html[data-theme="dark"] .tier-row:nth-child(1) .label-holder { background: #d97706 !important; color: #fefce8 !important; }
html[data-theme="dark"] .tier-row:nth-child(2) .label-holder { background: #16a34a !important; color: #f0fdf4 !important; }
html[data-theme="dark"] .tier-row:nth-child(3) .label-holder { background: #4f46e5 !important; color: #e0e7ff !important; }
html[data-theme="dark"] .tier-row:nth-child(4) .label-holder { background: #7c3aed !important; color: #ede9fe !important; }
html[data-theme="dark"] .tier-row:nth-child(5) .label-holder { background: #ea580c !important; color: #fff7ed !important; }
html[data-theme="dark"] .tier-row:nth-child(6) .label-holder { background: #dc2626 !important; color: #fef2f2 !important; }

/* Tier Container (Character Row) */
.tier.sort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  flex: 1;
  min-height: 52px;
  background: var(--surface);
}

/* Links in tier rows */
.tier-row a,
#tier-container a {
  color: var(--text-heading);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: var(--t);
  font-weight: 500;
}

.tier-row a:hover,
#tier-container a:hover {
  color: var(--accent-text);
}

/* Character Items */
.character {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t), transform var(--t);
  cursor: pointer;
}

.character:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.character img.draggable-filler {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Settings Control (Hidden by default) */
.settings-control {
  display: none;
}

/* Overlay Logo */
#overlay-logo {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 300px;
  height: auto;
  display: none;
  z-index: 10;
}

/* Dark Theme */
html[data-theme="dark"] .tier.sort {
  background: var(--surface-2);
}

/* Dark mode label colors handled by nth-child rules above */

/* Responsive */
@media (max-width: 640px) {
  .tier-row {
    flex-direction: column;
    min-height: auto;
  }

  #tier-container {
    gap: 6px;
    border: none;
    border-radius: 0;
    overflow: visible;
  }

  .tier-row {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    border-bottom: 1px solid var(--border);
  }

  .label-holder {
    min-width: 100%;
    min-height: 40px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    padding: 6px;
  }

  .tier.sort {
    min-height: auto;
    padding: 6px;
    gap: 5px;
  }

  .character {
    width: 60px;
    height: 60px;
  }

  #overlay-logo {
    width: 200px;
    top: 10px;
    right: 10px;
  }
}
