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

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

#tier-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* Tier Row */
.tier-row {
  display: flex;
  align-items: stretch;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Label Holder (Tier Label) */
.label-holder {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 24px;
  color: var(--text-heading);
  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 Container (Character Row) */
.tier.sort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px;
  flex: 1;
  background: var(--surface-2);
}

/* 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(--text);
  text-decoration: underline;
}

/* Dark theme link colors */
html[data-theme="dark"] .tier-row a,
html[data-theme="dark"] #tier-container a {
  color: var(--text-heading);
}

html[data-theme="dark"] .tier-row a:hover,
html[data-theme="dark"] #tier-container a:hover {
  color: var(--text);
}

/* Character Items */
.character {
  width: 100px;
  height: 100px;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid var(--border);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: var(--t);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.character:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  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 Adjustments */
html[data-theme="dark"] .tier-row {
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .label-holder {
  border-right-color: var(--border);
}

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

html[data-theme="dark"] .character {
  border-color: var(--border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .character:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

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

  .label-holder {
    min-width: 100%;
    min-height: 60px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

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

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

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