/* ✨ 설정 카드 아바타 업로드 행 */
.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: 4px;
}

.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid #3b2d5a;
  object-fit: cover;
  flex-shrink: 0;
  background: #0f0a1a;
}

.avatar-upload-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ✨ 프로필 아바타 변경 오버레이 */
.profile-avatar-container {
  position: relative;
  cursor: pointer;
  display: inline-block;
  flex-shrink: 0;
}

.avatar-edit-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.profile-avatar-container:hover .avatar-edit-overlay {
  opacity: 1;
}

/* ✨ 플레이어 모달 업로더 아바타 이미지 */
.uploader-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* ✨ 섹션 헤더 (타이틀 + 정렬 드롭다운) */
.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.section-header .section-title {
  margin-bottom: 0; /* section-header 안에서는 자체 margin 제거 */
}

.sort-dropdown {
  appearance: none;
  -webkit-appearance: none;
  background: #1a1025 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1.5px solid #3b2d5a;
  border-radius: 8px;
  color: #c4b5fd;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.5rem 2.2rem 0.5rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.sort-dropdown:hover {
  border-color: #8b5cf6;
}

.sort-dropdown:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.sort-dropdown option {
  background: #1a1025;
  color: #e2e8f0;
}

.game-card {
  background: #1a1025; border-radius: 12px; border: 2px solid #3b2d5a;
  overflow: hidden; cursor: pointer; transition: 0.3s;
}
.game-card:hover { transform: translateY(-5px); border-color: #8b5cf6; }

.game-thumbnail {
  height: 160px; background: linear-gradient(135deg, #2d1f4a, #1a1025);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.ai-badge {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  background: #7c3aed;
  padding: 4px 8px; 
  border-radius: 4px; 
  font-size: 0.75rem;
  font-weight: bold;
}
.card-badges {
  position: absolute; 
  top: 8px; 
  right: 8px; 
  display: flex; 
  gap: 6px;
}
.view-badge {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 8px; 
  border-radius: 4px; 
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.game-info { padding: 1rem; }
.game-title { font-size: 1rem; font-weight: 600; color: #e2e8f0; margin-bottom: 0.25rem; }
.modal-title { color: #a78bfa; font-size: 1.1rem; font-weight: 600; }
.player-title { color: #e2e8f0; font-size: 1.1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }

/* Modal */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.85); z-index: 1000; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal { background: #1a1025; border: 2px solid #8b5cf6; border-radius: 16px; width: 90%; max-width: 500px; }
.modal-header { padding: 1rem; border-bottom: 1px solid #3b2d5a; display: flex; justify-content: space-between; align-items: center; }
.close-btn { background: none; border: none; color: #888; font-size: 1.5rem; cursor: pointer; }

.modal-body { padding: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-label { display: block; margin-bottom: 0.5rem; color: #a78bfa; font-size: 0.9rem; font-weight: 500; }
.form-input { width: 100%; padding: 0.75rem; border-radius: 8px; background: #0f0a1a; border: 2px solid #3b2d5a; color: white; }

.file-input-wrapper { border: 2px dashed #3b2d5a; padding: 2rem; text-align: center; position: relative; }
.file-input-wrapper input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.submit-btn { width: 100%; padding: 1rem; background: #7c3aed; border: none; color: white; border-radius: 8px; cursor: pointer; }

/* Player Modal */
.player-modal { max-width: 1200px; height: 90vh; display: flex; flex-direction: column; width: 90%; }
.player-header { padding: 1rem; border-bottom: 1px solid #3b2d5a; display: flex; justify-content: space-between; align-items: center; }
.header-actions { display: flex; align-items: center; gap: 1rem; }

.fullscreen-btn {
  padding: 0.5rem 1rem;
  background-color: #3b2d5a;
  color: white;
  border: 1px solid #8b5cf6;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: 0.2s;
}
.fullscreen-btn:hover { background-color: #8b5cf6; }

.game-frame-container { flex: 1; background: #000; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }

.delete-game-btn {
  padding: 0.5rem 1rem;
  background-color: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: 0.2s;
}
.delete-game-btn:hover {
  background-color: #ef4444;
  color: white;
  border-color: #ef4444;
}

#gameFrame {
  width: 100%;
  height: 100%;
  border: none;
  display: none;
  background-color: white;
}

.game-placeholder { color: #666; text-align: center; }
.game-placeholder svg { width: 60px; opacity: 0.5; }

.game-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#uploadModal .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

/* 장르 리스트 */
.genre-list { list-style: none; }
.genre-item {
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(139, 92, 246, 0.1);
  color: #e2e8f0;
  transition: 0.2s;
  font-weight: 500;
}
.genre-item:hover, .genre-item.active {
  background: #7c3aed;
  color: white;
  transform: translateX(5px);
}

/* 게임 카드 내 태그 */
.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.tag-badge {
  background-color: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

/* ✨ 업로드 모달 태그 선택기 */
.tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}

.tag-option {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #3b2d5a;
  background: transparent;
  color: #a78bfa;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.15s ease;
  user-select: none;
}

.tag-option:hover {
  border-color: #8b5cf6;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.1);
}

.tag-option.selected {
  background: #7c3aed;
  border-color: #7c3aed;
  color: white;
  font-weight: 600;
}

/* 프로필 카드 액션 버튼 */
.profile-card-actions {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: white;
}

.edit-btn { background: rgba(59, 130, 246, 0.85); }
.edit-btn:hover { background: rgba(59, 130, 246, 1); transform: scale(1.1); }

.del-btn { background: rgba(239, 68, 68, 0.85); }
.del-btn:hover { background: rgba(239, 68, 68, 1); transform: scale(1.1); }

.game-thumbnail { position: relative; }

.game-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #1a1025;
  border-top: 1px solid #3b2d5a;
}

.uploader-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.2s ease;
}
.uploader-profile:hover { background: rgba(255, 255, 255, 0.1); }

.uploader-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
}

.uploader-name {
  font-size: 1rem;
  color: #fff;
  font-weight: bold;
}

.vote-container { display: flex; gap: 10px; }

.vote-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid #3b2d5a;
  background: rgba(0, 0, 0, 0.3);
  color: #e2e8f0;
  cursor: pointer;
  transition: 0.2s;
  font-size: 0.9rem;
}
.vote-btn:hover { background: #3b2d5a; }

.vote-btn.upvote.voted {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #3b82f6;
}
