/* Tower Defense Tier List Maker - Custom Styles */

/* Game card */
.game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px;
  border-radius: 0.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  width: 88px;
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.game-card img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 0.375rem;
  pointer-events: none;
}

.game-card .card-name {
  font-size: 0.625rem;
  text-align: center;
  margin-top: 2px;
  line-height: 1.2;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-card .card-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.5rem;
  padding: 1px 4px;
  border-radius: 0 0.375rem 0 0.25rem;
  font-weight: 600;
  line-height: 1.4;
}

.card-badge.badge-play {
  background: #22c55e;
  color: white;
}

.card-badge.badge-steam {
  background: #1b2838;
  color: white;
}

.card-badge.badge-mobile {
  background: #6366f1;
  color: white;
}

.card-badge.badge-roblox {
  background: #e11d48;
  color: white;
}

/* Tier row */
.tier-row {
  display: flex;
  align-items: stretch;
  margin-bottom: 2px;
  border-radius: 0.25rem;
  overflow: hidden;
}

.tier-label {
  flex-shrink: 0;
  width: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  color: #1f2937;
  text-shadow: 0 1px 1px rgba(255,255,255,0.3);
}

.tier-games {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  min-height: 96px;
  background-color: rgba(255,255,255,0.5);
  border: 1px solid #e5e7eb;
  align-content: flex-start;
}

/* Empty tier row placeholder */
.tier-games:empty::after {
  content: 'Drag games here';
  color: #9ca3af;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-style: italic;
}

/* SortableJS drag states */
.sortable-ghost {
  opacity: 0.4;
  background: #dbeafe !important;
  border: 2px dashed #3b82f6 !important;
}

.sortable-chosen {
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2);
  z-index: 10;
}

.sortable-drag {
  cursor: grabbing !important;
  opacity: 0.9;
}

/* Filter buttons */
.filter-btn {
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.filter-btn.active {
  background-color: #d97706;
  color: white;
}

.filter-btn:not(.active) {
  background-color: #e5e7eb;
  color: #374151;
}

.filter-btn:not(.active):hover {
  background-color: #d1d5db;
}

/* Unranked pool */
#unranked-pool {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  justify-items: center;
}

/* Toast notification */
#toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 12px 24px;
  border-radius: 0.5rem;
  background: #1f2937;
  color: white;
  font-weight: 500;
  font-size: 0.875rem;
  z-index: 100;
  transition: opacity 0.3s;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2);
}

#toast.toast-error {
  background: #dc2626;
}

/* Shared view overlay */
#shared-banner {
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  color: white;
  text-align: center;
  padding: 12px 16px;
}

#shared-banner a {
  display: inline-block;
  background: white;
  color: #3b82f6;
  padding: 6px 16px;
  border-radius: 0.375rem;
  font-weight: 600;
  margin-left: 12px;
  text-decoration: none;
  font-size: 0.875rem;
}

#shared-banner a:hover {
  background: #f0f0f0;
}

/* Game popup modal */
.game-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.game-popup {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 20rem;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.game-popup img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.game-popup h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.game-popup .platform-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.game-popup .platform-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: white;
  transition: opacity 0.2s;
}

.game-popup .platform-link:hover {
  opacity: 0.85;
}

.platform-link.link-browser { background: #22c55e; }
.platform-link.link-steam { background: #1b2838; }
.platform-link.link-ios { background: #007aff; }
.platform-link.link-android { background: #3ddc84; color: #1f2937; }
.platform-link.link-roblox { background: #e11d48; }

/* Export-specific styles */
#export-watermark {
  text-align: center;
  padding: 8px 0;
  font-size: 0.8rem;
  color: #78716c;
  background: #f5e6d3;
  border-top: 1px solid #d4a574;
  font-weight: 500;
}

#export-header {
  text-align: center;
  padding: 12px 0;
  background: linear-gradient(90deg, #d4a574, #c89968);
}

#export-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #3d2817;
}

/* Tier List Hub Cards */
.tier-hub-card {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 2px solid #e5e7eb;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
  color: inherit;
}

a.tier-hub-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px -5px rgba(0,0,0,0.15);
  border-color: #d97706;
}

.tier-hub-current {
  border-color: #d97706;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.tier-hub-img {
  position: relative;
  width: 100%;
  height: 120px;
  overflow: hidden;
}

.tier-hub-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tier-hub-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #d97706;
  color: white;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
}

.tier-hub-info {
  padding: 12px;
}

.tier-hub-info h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 4px;
  line-height: 1.3;
}

.tier-hub-info p {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.4;
  margin-bottom: 6px;
}

.tier-hub-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #d97706;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .game-card {
    width: 64px;
  }

  .game-card img {
    width: 56px;
    height: 56px;
  }

  .game-card .card-name {
    font-size: 0.5rem;
    max-width: 56px;
  }

  .tier-label {
    width: 40px;
    font-size: 1.125rem;
  }

  .tier-games {
    min-height: 68px;
    padding: 4px;
    gap: 4px;
  }

  #unranked-pool {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 4px;
  }

  .game-card .card-badge {
    font-size: 0.4rem;
    padding: 0 3px;
  }
}
