/* 랭킹 페이지 스타일 */
.rankings-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
  }
  
  .page-header {
    text-align: center;
    margin-bottom: 40px;
  }
  
  .page-header h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
  }
  
  .page-header p {
    color: var(--text-secondary);
    font-size: 1rem;
  }
  
  .rankings-content {
    position: relative;
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
  }
  
  /* 필터 섹션 */
  .rankings-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-end;
  }
  
  .filter-group {
    flex: 1;
    min-width: 200px;
  }
  
  .filter-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
  }
  
  .filter-group input,
  .filter-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-speed);
  }
  
  .filter-group input:focus,
  .filter-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(255, 177, 0, 0.3);
  }
  
  .filter-group input::placeholder {
    color: var(--text-tertiary);
  }
  
  .search-input {
    position: relative;
  }
  
  .search-input i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
  }
  
  .filter-btn {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
  }
  
  /* 결과 영역 */
  .rankings-results {
    position: relative;
    min-height: 300px;
  }
  
  /* 로딩 컨테이너 */
  .loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 0;
  }
  
  .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 177, 0, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
  }
  
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
  
  .loading-container p {
    color: var(--text-secondary);
  }
  
  /* 랭킹 테이블 */
  .rankings-table-container {
    overflow-x: auto;
    margin-bottom: 30px;
  }
  
  .rankings-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
  }
  
  .rankings-table th,
  .rankings-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
  }
  
  .rankings-table th {
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
  }
  
  .rankings-table tr:hover {
    background-color: rgba(255, 177, 0, 0.1);
    cursor: pointer;
  }
  
  .rankings-table .rank-column {
    width: 80px;
    text-align: center;
  }
  
  .rankings-table .player-column {
    width: 250px;
  }
  
  .rankings-table .score-column {
    width: 150px;
    text-align: right;
    font-family: 'Roboto Mono', monospace;
  }
  
  /* 플레이어 정보 */
  .player-info {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .player-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-primary);
  }
  
  .player-info .player-name {
    font-weight: 500;
    color: var(--text-primary);
  }

  /* 테이블 내의 플레이어 정보에서 하단 테두리 제거 */
  .rankings-table .player-info {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  /* 테이블 행 내에서 플레이어 관련 셀에는 하단 경계선 유지하되 내부 요소의 경계선 제거 */
  .rankings-table .player-column .player-info {
    border-bottom: none;
  }
  
  /* 곡 정보 */
  .song-info {
    display: flex;
    flex-direction: column;
  }
  
  .song-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 5px;
  }
  
  .song-difficulty {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }
  
  .difficulty-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
  }
  
  .difficulty-NM {
    background-color: rgba(116, 209, 80, 0.2);
    color: #74d150;
  }
  
  .difficulty-HD {
    background-color: rgba(87, 138, 255, 0.2);
    color: #578aff;
  }
  
  .difficulty-SHD {
    background-color: rgba(255, 152, 48, 0.2);
    color: #ff9830;
  }
  
  .difficulty-EX {
    background-color: rgba(255, 61, 61, 0.2);
    color: #ff3d3d;
  }
  
  /* 점수 표시 */
  .score {
    font-weight: 600;
    color: var(--accent-primary);
  }
  
  /* 페이지네이션 */
.rankings-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
  }
  
  .pagination-btn {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-speed);
    cursor: pointer;
  }
  
  .pagination-btn:hover:not(:disabled) {
    background-color: rgba(255, 177, 0, 0.1);
    color: var(--accent-primary);
  }
  
  .pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  .pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
  }
  
  /* 결과 없음 메시지 */
  .no-results {
    text-align: center;
    padding: 50px 0;
    color: var(--text-secondary);
  }
  
  .no-results i {
    font-size: 3rem;
    color: var(--text-tertiary);
    margin-bottom: 20px;
  }
  
  .no-results p {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }
  
  .no-results .sub-text {
    font-size: 0.9rem;
    color: var(--text-tertiary);
  }
  
/* 인증 필요 메시지 */
.auth-required {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  border-radius: var(--border-radius);
}
  
  .auth-message {
    text-align: center;
    padding: 40px;
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    max-width: 400px;
  }
  
  .auth-message i {
    font-size: 3rem;
    color: var(--accent-primary);
    margin-bottom: 20px;
  }
  
  .auth-message h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 15px;
  }
  
  .auth-message p {
    color: var(--text-secondary);
    margin-bottom: 20px;
  }
  
  /* 모달 */
  .ranking-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .ranking-modal.show {
    opacity: 1;
    visibility: visible;
  }
  
  .modal-content {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    animation: modalIn 0.3s ease-out;
  }
  
  @keyframes modalIn {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
  }
  
  .modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
  }
  
  .modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color var(--transition-speed);
  }
  
  .modal-close-btn:hover {
    color: var(--accent-primary);
  }
  
  .modal-body {
    padding: 20px;
  }
  
  /* 플레이어 정보 (모달) */
  .player-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
  }
  
  .player-info img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-primary);
  }
  
  .player-details h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 5px;
  }
  
  .player-details p {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
  }
  
  .player-details p i {
    color: var(--accent-primary);
  }
  
  /* 기록 정보 (모달) */
  .record-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
  }
  
  .info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  
  .info-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
  }
  
  .info-value {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
  }
  
  .info-value.score {
    color: var(--accent-primary);
    font-size: 1.3rem;
  }
  
  .info-value.grade {
    font-size: 1.4rem;
    font-weight: 700;
  }
  
  /* 기록 이미지 (모달) */
  .record-image {
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
  }
  
  .record-image img {
    width: 100%;
    height: auto;
    display: block;
  }
  
  /* 스크롤바 스타일 */
  .modal-content::-webkit-scrollbar {
    width: 8px;
  }
  
  .modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
  }
  
  .modal-content::-webkit-scrollbar-thumb {
    background-color: var(--accent-primary);
    border-radius: 4px;
  }
  
  /* 순위 배지 */
  .rank-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: 700;
  }
  
  .rank-1 {
    background-color: rgba(255, 215, 0, 0.2);
    color: #ffd700;
  }
  
  .rank-2 {
    background-color: rgba(192, 192, 192, 0.2);
    color: #c0c0c0;
  }
  
  .rank-3 {
    background-color: rgba(205, 127, 50, 0.2);
    color: #cd7f32;
  }
  
  /* 등급 색상 */
  .grade-S {
    color: #ffd700;
  }
  
  .grade-AAA {
    color: #00bfff;
  }
  
  .grade-AA {
    color: #00ff7f;
  }
  
  .grade-A {
    color: #1e90ff;
  }
  
  .grade-B {
    color: #9370db;
  }
  
  .grade-C {
    color: #ff69b4;
  }
  
  .grade-D {
    color: #ff6347;
  }
  
/* 모바일 기본 레이아웃 (768px 이하) */
@media (max-width: 768px) {
  /* 전체 컨테이너 */
  .rankings-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }
  
  /* 헤더 영역 */
  .page-header {
    padding: 10px 15px;
    margin: 0 0 5px 0;
    background-color: rgba(0, 0, 0, 0.2);
  }
  
  .page-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 3px;
    color: var(--accent-primary);
  }
  
  .page-header p {
    font-size: 0.8rem;
    opacity: 0.85;
    margin: 0;
  }
  
  /* 컨텐츠 영역 */
  .rankings-content {
    padding: 0;
    margin: 0;
    border-radius: 0;
    border: none;
    background-color: transparent;
    box-shadow: none;
  }
  
  /* 필터 영역 */
  .rankings-filters {
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 0;
    margin-bottom: 1px;
  }
  
  .filter-group {
    margin-bottom: 8px;
  }
  
  .filter-group:last-child {
    margin-bottom: 0;
  }
  
  .filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--accent-primary);
  }
  
  .filter-group input,
  .filter-group select {
    height: 36px;
    padding: 0 10px;
    font-size: 0.85rem;
    background-color: rgba(20, 20, 20, 0.8);
    border: 1px solid #333;
    border-radius: 4px;
  }
  
  .filter-btn {
    height: 36px;
    background-color: var(--accent-primary);
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 4px;
    width: 100%;
    margin-top: 5px;
  }
  
  /* 테이블 영역 전체 */
  .rankings-results {
    padding: 0;
  }
  
  /* 테이블 내용을 카드 형태로 변경 */
  .rankings-table-container {
    padding: 0;
    margin: 0;
    width: 100%;
  }
  
  .rankings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 1px;
  }
  
  /* 테이블 헤더 완전히 숨기기 */
  .rankings-table thead {
    display: none;
  }
  
  .rankings-table tbody tr {
    display: block;
    margin-bottom: 1px;
    background-color: rgba(30, 30, 30, 0.8);
    padding: 10px;
    position: relative;
  }
  
  .rankings-table th {
    display: none;
  }
  
  .rankings-table td {
    border: none;
    padding: 0;
  }
  
  /* 랭킹 카드 레이아웃 */
  .rankings-table .rank-column {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* 순위 배지 */
  .rank-badge {
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
  }

  /* 배지가 없는 일반 순위 표시 */
  .rankings-table .rank-column:not(:has(.rank-badge)) {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
  }
  
  /* 플레이어 정보 */
  .rankings-table .player-column {
    padding-left: 35px;
    margin-bottom: 6px;
  }
  
  .player-info {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .player-info img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--accent-primary);
  }
  
  .player-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
  }
  
  /* 곡 정보 */
  .rankings-table .song-column {
    padding-left: 35px;
    margin-bottom: 6px;
  }
  
  .song-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
  }
  
  .song-difficulty,
  .song-mode {
    display: inline-block;
    font-size: 0.75rem;
    margin-right: 8px;
  }
  
  .difficulty-badge {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 700;
  }
  
  /* 점수 정보 */
  .rankings-table .score-column {
    padding-left: 35px;
    text-align: left;
  }
  
  .score {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-primary);
  }
  
  /* 페이지네이션 */
  .rankings-pagination {
    padding: 10px;
    display: flex;
    justify-content: center;
    gap: 10px;
    background-color: rgba(30, 30, 30, 0.8);
    margin-top: 1px;
  }
  
  .pagination-btn {
    padding: 6px 12px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
  }
  
  .pagination-info {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
  }
  
  /* 작은 화면 추가 최적화 */
  @media (max-width: 360px) {
    .page-header h1 {
      font-size: 1.2rem;
    }
    
    .player-name {
      font-size: 0.85rem;
    }
    
    .song-title {
      font-size: 0.8rem;
    }
    
    .score {
      font-size: 1rem;
    }
  }
}

/* 더 큰 모바일 화면 (481px-768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .rankings-table tbody tr {
    display: flex;
    flex-wrap: wrap;
    padding: 8px 12px;
    align-items: center;
  }
  
  .rankings-table .rank-column {
    position: static;
    width: 40px;
    height: auto;
    margin-right: 10px;
  }

  .rankings-table .rank-column:not(:has(.rank-badge)) {
    font-size: 0.8rem; 
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    color: var(--text-secondary);
  }
  
  .rankings-table .player-column {
    padding-left: 0;
    width: calc(40% - 50px);
    margin-bottom: 0;
  }
  
  .rankings-table .song-column {
    padding-left: 0;
    width: 60%;
    margin-bottom: 0;
  }
  
  .rankings-table .score-column {
    padding-left: 0;
    width: 100%;
    text-align: right;
    margin-top: 5px;
  }
  
  .score {
    font-size: 1rem;
  }
}

/* 로딩 및 에러 메시지 */
.loading-container,
.no-results {
  padding: 30px 15px;
  text-align: center;
  background-color: rgba(30, 30, 30, 0.8);
}

.loading-spinner {
  margin: 0 auto 15px;
}

.no-results i {
  color: var(--accent-primary);
  font-size: 2rem;
  margin-bottom: 10px;
}

.no-results p {
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.no-results .sub-text {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* 모달 최적화 */
.ranking-modal .modal-content {
  width: 90%;
  max-width: 400px;
  background-color: rgba(20, 20, 20, 0.95);
  border: 1px solid #333;
}

.modal-header {
  padding: 10px 15px;
  border-bottom: 1px solid #333;
}

.modal-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

.modal-body {
  padding: 15px;
}

.modal-body .player-info {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #333;
}

.modal-body .player-info img {
  width: 50px;
  height: 50px;
}

.info-item {
  margin-bottom: 8px;
}

.info-label {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-bottom: 3px;
}

.info-value {
  font-size: 0.9rem;
  font-weight: 500;
}

.info-value.score {
  font-size: 1.1rem;
  color: var(--accent-primary);
}

/* 선택 시 가독성을 위해 색상 유지 */
.filter-group select:focus,
.filter-group select:hover {
  background-color: rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
}

/* 애니메이션 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.rankings-table tbody tr {
  animation: fadeIn 0.3s ease-in-out;
}

.hidden {
  display: none !important;
}



/* 곡 목록 스타일 */
.song-row {
  cursor: pointer;
  transition: background-color 0.2s;
}

.song-row:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.song-title-cell {
  font-weight: 500;
  padding: 12px 16px;
}

.song-modes-cell {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9em;
}

/* 뒤로가기 버튼 스타일 */
.back-to-songs-btn {
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 6px 12px;
  border-radius: var(--border-radius);
  font-size: 0.9em;
  transition: all 0.2s;
}

.back-to-songs-btn:hover {
  background-color: rgba(var(--primary-color-rgb), 0.1);
}

.back-to-songs-btn i {
  font-size: 0.8em;
}

/* 선택된 곡 제목 스타일 */
.selected-song-heading {
  margin: 10px 0;
  font-size: 1.3em;
  color: var(--primary-color);
}

/* 테이블 행 애니메이션 */
.rankings-table tbody tr {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 모바일 반응형 스타일 */
@media (max-width: 768px) {
  .song-modes-cell {
      display: none; /* 모바일에서는 모드 정보 숨김 */
  }
  
  .selected-song-heading {
      font-size: 1.1em;
  }
  
  .back-to-songs-btn {
      font-size: 0.8em;
      padding: 4px 8px;
  }
}
