* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0a0a0a;
  color: #e0e0e0;
  font-family: 'Segoe UI', 'Inter', Arial, sans-serif;
  min-height: 100vh;
  padding: 0 0 60px 0;
}

header {
  text-align: center;
  padding: 30px 20px 20px;
}
header h1 {
  font-size: 2rem;
  background: linear-gradient(135deg, #ff3333, #ffdd33, #33cc33, #33ccff, #9933ff, #ff66cc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 3px;
}
header p {
  color: #888;
  margin-top: 6px;
  font-size: 0.95rem;
}

/* ===== Tier Board ===== */
#tier-board {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tier-row {
  display: flex;
  min-height: 80px;
  border-radius: 8px;
  overflow: hidden;
}

.tier-label {
  width: 64px;
  min-width: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 900;
  color: #0a0a0a;
  background: var(--tier-color);
  user-select: none;
}

.tier-drop-zone {
  flex: 1;
  background: #141414;
  border: 2px solid #222;
  border-radius: 0 8px 8px 0;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  padding: 8px;
  min-height: 80px;
  transition: border-color 0.2s, background 0.2s;
}
.tier-drop-zone.drag-over {
  border-color: var(--tier-color, #fff);
  background: #1a1a1a;
}

/* ===== Tier Card ===== */
.tier-card {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: #222;
  cursor: grab;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
  flex-shrink: 0;
}
.tier-card:hover {
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(255,255,255,0.15);
  z-index: 10;
}
.tier-card.dragging {
  opacity: 0;
  pointer-events: none;
}
.tier-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tier-card .card-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  color: #fff;
  font-size: 0.55rem;
  text-align: center;
  padding: 3px 2px 2px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tier-card .card-delete {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,50,50,0.8);
  color: #fff;
  font-size: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}
.tier-card:hover .card-delete {
  display: flex;
}

/* placeholder image */
.tier-card.no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.tier-card.no-img .card-name {
  font-size: 0.6rem;
}

/* Unranked row */
.unranked-row .tier-label {
  background: #333;
  color: #999;
  font-size: 1.4rem;
}
.unranked-row {
  margin-top: 4px;
  border-top: 1px dashed #333;
  padding-top: 6px;
}

/* ===== Creator ===== */
#creator {
  max-width: 900px;
  margin: 30px auto 0;
  background: #111;
  border: 1px solid #282828;
  border-radius: 12px;
  padding: 24px 28px;
}
#creator h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  color: #ccc;
}
.creator-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) {
  .creator-form { grid-template-columns: 1fr; }
}
.creator-field label {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 4px;
}
.creator-field input[type="text"],
.creator-field input[type="file"],
.creator-field select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #333;
  background: #1a1a1a;
  color: #e0e0e0;
  font-size: 0.9rem;
}
.creator-field input:focus,
.creator-field select:focus {
  outline: none;
  border-color: #555;
}
#create-btn {
  grid-column: 1 / -1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff3333, #ff9933, #ffdd33);
  color: #0a0a0a;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.12s;
}
#create-btn:hover {
  transform: scale(1.02);
  opacity: 0.9;
}
#create-btn:active {
  transform: scale(0.98);
}
.creator-hint {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #666;
  text-align: center;
}

/* ===== Delete Zone ===== */
#delete-zone {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(180, 30, 30, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  z-index: 100;
  transition: opacity 0.3s, transform 0.3s;
  transform: translateY(100%);
  pointer-events: none;
}
#delete-zone.visible {
  transform: translateY(0);
  pointer-events: auto;
}
#delete-zone.drag-over {
  background: rgba(220, 50, 50, 1);
  font-size: 1.5rem;
}

/* ===== Tooltip ===== */
.card-tooltip {
  position: fixed;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 10px 14px;
  color: #ddd;
  font-size: 0.85rem;
  max-width: 220px;
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.card-tooltip .tt-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
}
.card-tooltip .tt-desc {
  color: #999;
  font-size: 0.8rem;
}

/* ===== Image Preview Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  cursor: pointer;
}
.modal-overlay img {
  max-width: 80vw;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
}
