/*
  Tier board/editor styles.
  This keeps the TierMaker-inspired board layout separate from global app styles.
*/

:root {
  --tier-thumb-w: 96px;
  --tier-thumb-h: 128px;
  --tier-row-h: calc(var(--tier-thumb-h) + 12px);
}

.tier-row {
  display: flex;
  gap: 0;
  align-items: stretch;
  margin-bottom: 0;
}

.tier-label {
  width: 160px;
  min-width: 120px;
  max-width: 220px;
  background: var(--card);
  border: 1px solid var(--card-outline);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  /* JS applies a coloured background + white text inline.
     The dark-mode body * override would wipe white → force it back. */
  color: var(--text);
  min-height: var(--tier-row-h);
  box-sizing: border-box;
  overflow: hidden;
}
/* When a tier has a coloured background applied by JS, keep white text legible */
html.dark-mode .tier-label[style*="background"],
.tier-label[style*="background"] {
  color: #fff !important;
}

.tier-title {
  display: block;
  width: 100%;
  text-align: center;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.tier-items {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: auto;
  padding: 6px 8px;
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--card-outline);
  min-height: var(--tier-row-h);
  align-items: flex-start;
  box-sizing: border-box;
}

.tier-item {
  width: var(--tier-thumb-w);
  height: var(--tier-thumb-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tier-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

html.dark-mode .tier-label,
html.dark-mode .tier-items {
  background: var(--card);
  border-color: var(--card-outline);
}

#delete-dropbox {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border: 2px dashed var(--card-outline);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.03), transparent);
  color: var(--muted);
  cursor: default;
  min-height: 64px;
  box-sizing: border-box;
}

#delete-dropbox.drag-over {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.09), rgba(239, 68, 68, 0.03));
  border-color: rgba(239, 68, 68, 0.9);
  color: #ef4444;
  transform: scale(1.02);
}

#delete-dropbox i {
  height: 20px;
  width: 20px;
  color: inherit;
}

@media (max-width: 640px) {
  .tier-row {
    flex-direction: column;
  }

  .tier-label,
  .tier-items {
    width: 100%;
  }
}
