/* LBRECORDS 테마 변수
   모든 기존 다크 모드 색상값 유지. 아래 변수 값만 바꾸면 테마별 색상을 수정할 수 있습니다.
*/
:root {
  --bg-color: #090d19;
  --header-color: #0d1221;
  --card-color: #111729;
  --text-color: #e5e7f0;
  --subtext-color: #a5abc2;
  --border-color: #292f43;
  --panel-border-color: #303448;
  --point-color: #f472d0;
  --divider-color: #252a3a;
  --header-divider-color: #42316b;
  --control-text-color: #f5f5fa;
  --input-bg-color: #171923;
  --input-border-color: #3a4056;
  --placeholder-bg-color: #161d31;
  --muted-color: #858da8;
  --icon-muted-color: #929bb7;
  --logo-subcolor: #9298b3;
  --data-text-color: #dce0ee;
  --dropdown-text-color: #d9dced;
  --heading-soft-color: #f0eaff;
  --intro-title-color: #f4e9f5;
  --intro-description-color: #b9bed2;
  --description-soft-color: #aaa5c7;
  --stat-label-color: #969fba;
  --badge-bg-color: #29213e;
  --level-bg-color: #3a2946;
  --card-hover-color: #151b2e;
  --row-hover-color: #191d30;
  --menu-hover-bg-color: #38243d;
  --menu-active-bg-color: #2a1930;
  --point-hover-color: #f08dd4;
  --point-strong-color: #ff4fc3;
  --shadow-strong-color: #0005;
  --shadow-soft-color: #0004;
}

html[data-theme="light"] {
  --bg-color: #f7f7fa;
  --header-color: #ffffff;
  --card-color: #ffffff;
  --text-color: #22222b;
  --subtext-color: #737382;
  --border-color: #e5e5eb;
  --panel-border-color: #d5d8e4;
  --point-color: #c02688;
  --divider-color: #e9ebf2;
  --header-divider-color: #e5e5eb;
  --control-text-color: #22222b;
  --input-bg-color: #f7f7fa;
  --input-border-color: #d5d8e4;
  --placeholder-bg-color: #eff1f8;
  --muted-color: #737d93;
  --icon-muted-color: #7b849b;
  --logo-subcolor: #737d93;
  --data-text-color: #292c3a;
  --dropdown-text-color: #333545;
  --heading-soft-color: #30293e;
  --intro-title-color: #30293e;
  --intro-description-color: #68728a;
  --description-soft-color: #6e7285;
  --stat-label-color: #737b91;
  --badge-bg-color: #f9e7f2;
  --level-bg-color: #f9e1ef;
  --card-hover-color: #f9f6fc;
  --row-hover-color: #faf3f8;
  --menu-hover-bg-color: #fbe8f3;
  --menu-active-bg-color: #f7ddeb;
  --point-hover-color: #b3247d;
  --point-strong-color: #a91b70;
  --shadow-strong-color: #1118271c;
  --shadow-soft-color: #11182714;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: Arial, sans-serif;
}

/* 2. 공통 페이지 틀 */
.site-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1200px;
  min-height: 100vh;
  margin: 0 auto;
  border: none;
}

.layout {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 650px;
}

main {
  flex: 1;
  min-width: 0;
  padding: 26px;
}

/* 3. 상단 메뉴 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: 64px;
  align-items: center;
  column-gap: 28px;
  padding: 0 26px;
  background: var(--header-color);
}
.topbar::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 1px;
  background: var(--header-divider-color);
}
.topbar::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  background: var(--header-color);
  z-index: -1;
}
.logo {
  margin: 0;
  color: var(--point-color);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.logo a {
  color: inherit;
  text-decoration: none;
}

.logo span {
  margin-left: 8px;
  color: var(--logo-subcolor);
  font-size: 11px;
  letter-spacing: 2.5px;
}

.topbar nav {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 24px;
}

/* 사용자 메뉴가 있는 홈에서는 내비게이션을 로고 쪽에 붙임 */
.topbar:has(.topbar-actions) nav {
  justify-self: start;
}

.topbar nav a {
  color: var(--subtext-color);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.topbar nav a:hover,
.topbar nav a.active {
  color: var(--point-color);
}

.topbar nav a.active {
  border-bottom: 2px solid var(--point-color);
}

/* 4. 헤더 오른쪽 검색 / 사용자 메뉴 */
.topbar-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 20px;
}

.search-dropdown,
.user-dropdown {
  color: var(--control-text-color);
  font-size: 13px;
}

.search-dropdown {
  position: static;
}

.user-dropdown {
  position: relative;
}

.search-dropdown summary,
.user-dropdown summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 4px;
  color: inherit;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.search-dropdown summary::-webkit-details-marker,
.user-dropdown summary::-webkit-details-marker {
  display: none;
}

.search-dropdown summary::marker,
.user-dropdown summary::marker {
  content: "";
}

.search-dropdown summary:hover,
.user-dropdown summary:hover,
.search-dropdown[open] summary,
.user-dropdown[open] summary {
  color: var(--point-color);
}

/* 검색을 누르면 상단바 높이가 늘어나 본문이 아래로 내려감 */
.topbar:has(.search-dropdown[open]) {
  padding-bottom: 70px;
}

/* 캡처처럼 상단바 바로 밑, 상단바 너비 전체의 검색 영역 */
.search-dropdown form {
  position: absolute;
  top: calc(100% - 70px);
  left: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  width: 100%;
  height: 70px;
  padding: 14px 26px;
  background-color: var(--header-color);
  border-top: 1px solid var(--divider-color);
  box-shadow: 0 10px 24px var(--shadow-strong-color);
}

.search-dropdown input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--input-border-color);
  border-radius: 8px;
  outline: none;
  background-color: var(--input-bg-color);
  color: var(--control-text-color);
  font: inherit;
  font-size: 13px;
}

.search-dropdown input::placeholder {
  color: var(--muted-color);
}

.search-dropdown input:focus {
  border-color: var(--point-color);
}

/* CSS로 만든 작은 돋보기 아이콘 */
.search-dropdown form::before {
  content: "";
  position: absolute;
  left: 42px;
  top: 25px;
  width: 11px;
  height: 11px;
  border: 1.7px solid var(--icon-muted-color);
  border-radius: 50%;
  pointer-events: none;
}

.search-dropdown form::after {
  content: "";
  position: absolute;
  left: 53px;
  top: 37px;
  width: 7px;
  height: 1.7px;
  background-color: var(--icon-muted-color);
  transform: rotate(45deg);
  transform-origin: left center;
  pointer-events: none;
}

/* 기존 HTML의 검색 버튼은 숨기고 Enter로 검색 가능 */
.search-dropdown button {
  display: none;
}

/* 사용자명 클릭 시 나오는 작은 메뉴 */
.user-dropdown .dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 210;
  width: 190px;
  padding: 6px;
  background-color: var(--input-bg-color);
  border: 1px solid var(--panel-border-color);
  border-radius: 10px;
  box-shadow: 0 8px 24px var(--shadow-soft-color);
}

.user-dropdown .dropdown-menu a {
  display: block;
  padding: 11px 12px;
  border-radius: 6px;
  color: var(--dropdown-text-color);
  font-size: 13px;
  text-decoration: none;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.user-dropdown .dropdown-menu a:hover {
  color: var(--point-color);
  background-color: var(--badge-bg-color);
}

/* 5. index.html: 가로형 바로가기 메뉴 */
.sidebar {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
  width: 100%;
  padding: 12px 24px;
  background-color: var(--header-color);
  border-bottom: 1px solid var(--divider-color);
}

.sidebar .menu {
  display: block;
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--subtext-color);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.sidebar .menu:hover {
  color: var(--point-hover-color);
  background-color: var(--menu-hover-bg-color);
}

.sidebar .menu.active,
.sidebar .menu.active:hover {
  color: var(--point-color);
  background-color: var(--menu-active-bg-color);
}

/* 6. index.html: 소개 / 통계 / 최근 기록 */
.welcome {
  padding: 24px;
  background-color: var(--card-color);
  border: 1px solid var(--border-color);
  border-radius: 9px;
}

.welcome > p:first-child {
  margin-bottom: 10px;
  color: var(--point-color);
  font-size: 10px;
  letter-spacing: 2.5px;
}

.welcome h2 {
  margin: 0 0 12px;
  color: var(--heading-soft-color);
  font-size: 23px;
  letter-spacing: -0.7px;
}

.welcome p:not(:first-child) {
  margin-bottom: 0;
  color: var(--description-soft-color);
  font-size: 13px;
  line-height: 1.7;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.stat-card {
  padding: 18px;
  background-color: var(--card-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: background-color 0.2s;
}

.stat-card:hover {
  background-color: var(--card-hover-color);
}

.stat-card p {
  margin: 0 0 12px;
  color: var(--stat-label-color);
  font-size: 12px;
}

.stat-card h3 {
  margin: 0;
  color: var(--point-color);
  font-size: 22px;
  letter-spacing: -0.5px;
}

.recent-records {
  margin-top: 22px;
  padding: 20px;
  background-color: var(--card-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-header h2 {
  margin: 0;
  color: var(--text-color);
  font-size: 17px;
  letter-spacing: -0.3px;
}

.section-header a {
  color: var(--point-color);
  font-size: 12px;
  text-decoration: none;
}

.section-header a:hover {
  text-decoration: underline;
}

/* 성과표 테이블 */
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--divider-color);
}

th {
  color: var(--icon-muted-color);
  font-size: 12px;
  font-weight: normal;
}

td {
  color: var(--data-text-color);
  font-size: 13px;
}

thead {
  background-color: var(--header-color);
}

th:first-child,
td:first-child {
  padding-left: 18px;
}

tbody tr:hover {
  background-color: var(--row-hover-color);
}

tbody tr:last-child td {
  border-bottom: none;
}

.song-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-align: left;
}

.song-image {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 6px;
}

.difficulty-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 40px;
  padding: 9px 4px;
  background-color: var(--badge-bg-color);
  border: 1px solid var(--point-color);
  border-radius: 5px;
  flex-shrink: 0;
}

.difficulty-stars {
  color: var(--point-color);
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}

.song-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.song-title {
  overflow: hidden;
  color: var(--data-text-color);
  font-size: 13px;
  font-weight: bold;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-artist {
  overflow: hidden;
  opacity: 0.8;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.performance-score {
  white-space: nowrap;
}

.earned-score {
  color: var(--point-color);
  font-size: 13px;
  font-weight: 600;
}

.max-score {
  margin-left: 2px;
  opacity: 0.65;
  color: var(--subtext-color);
  font-size: 11px;
}

/* 7. home.html: 홈 화면 (참고 이미지 레이아웃) */
.home-layout {
  display: block;
  min-height: 650px;
}

.home-main {
  width: 100%;
  min-width: 0;
  padding: 24px;
}

/* 화면 가운데 두 열: 넓은 왼쪽 / 좁은 오른쪽 */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.8fr) minmax(280px, 1fr);
  align-items: start;
  gap: 22px;
}

.home-left,
.home-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* 왼쪽: 중간 두 열과 아래 두 열 */
.home-middle,
.home-bottom {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* 홈 카드 공통 스타일 */
.home-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--panel-border-color);
  border-radius: 10px;
  background: var(--card-color);
}

.home-panel h2 {
  margin: 0;
  font-size: 16px;
}

.home-panel p {
  font-size: 13px;
  line-height: 1.6;
}

.home-panel a {
  color: var(--point-color);
  text-decoration: none;
}

.home-panel a:hover {
  text-decoration: underline;
}

/* 소개 카드 */
.home-intro-panel {
  min-height: 150px;
  padding: 17px 20px;
}

.home-intro-panel h2 {
  margin-bottom: 12px;
  color: var(--intro-title-color);
  font-size: 16px;
}

.home-intro-panel p {
  margin: 4px 0;
  color: var(--intro-description-color);
}

/* 랭킹 표시할 자리 - 현재는 빈 네모 */
.home-ranking-placeholder {
  min-height: 365px;
  background-color: var(--placeholder-bg-color);
}

/* 리스트 카드 공통 */
.home-panel .section-header {
  gap: 12px;
  margin-bottom: 14px;
}

.home-panel .section-header h2 {
  font-size: 14px;
}

.notice-item,
.update-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 0;
}

.notice-item p,
.update-item p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-date,
.update-item span {
  flex-shrink: 0;
  color: var(--muted-color);
  font-size: 11px;
}

/* 공지사항: 가운데 오른쪽 */
.home-notice {
  min-height: 365px;
}

.home-notice .notice-item {
  padding: 11px 0;
}

/* 변경 내역 / 랭킹 공지: 왼쪽 하단 */
.home-bottom .home-panel {
  min-height: 224px;
}

.home-bottom .update-item {
  padding: 8px 0;
}

/* 오른쪽 위: 내 성과표 바로가기 */
.home-summary,
.home-recent {
  padding: 0;
  overflow: hidden;
}

.home-summary .section-header,
.home-recent .section-header {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 0 16px;
  border-bottom: 1px solid var(--panel-border-color);
}

.home-summary .section-header a {
  color: var(--text-color);
  font-size: 14px;
}

.home-summary .section-header a:hover {
  color: var(--point-color);
  text-decoration: none;
}

/* 요약을 넣을 자리 - 현재는 빈 네모 */
.summary-placeholder {
  height: 219px;
  margin: 14px;
  border: 1px solid var(--panel-border-color);
  border-radius: 8px;
  background-color: var(--placeholder-bg-color);
}

/* 오른쪽 아래: 최근 등록 기록 */
.recent-song-list {
  padding: 10px 13px;
}

.recent-song-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 0;
  font-size: 12px;
}

.recent-level {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  height: 18px;
  padding: 0;
  border-radius: 4px;
  background-color: var(--level-bg-color);
  color: var(--point-color);
  font-size: 10px;
  font-weight: 700;
}

.recent-song-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-color);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-song-score {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 60px;
  height: 18px;
  padding: 0;
  border-radius: 4px;
  background-color: var(--badge-bg-color);
  color: var(--point-color);
  font-size: 10px;
  font-weight: 700;
}

.recent-more {
  display: block;
  padding: 13px;
  border-top: 1px solid var(--panel-border-color);
  text-align: center;
  font-size: 12px;
}

/* 8. 공통 푸터 */
.footer {
  padding: 14px 20px;
  border-top: 1px solid var(--divider-color);
  background-color: var(--header-color);
  text-align: center;
}

.footer > p {
  margin: 0 0 3px;
  color: var(--point-color);
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1.3px;
}

.footer > span {
  display: block;
  color: var(--muted-color);
  font-size: 11px;
  line-height: 1.3;
}

.footer .copyright {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--divider-color);
  color: var(--muted-color);
  font-size: 11px;
  line-height: 1.8;
  text-align: center;
}

.footer .copyright p {
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: normal;
  letter-spacing: normal;
}

.footer .copyright .copyright-notice {
  margin-top: 10px;
}

.footer .copyright a {
  display: inline-block;
  margin-top: 6px;
  color: var(--point-color);
  text-decoration: none;
}

.footer .copyright a:hover {
  text-decoration: underline;
}
.recent-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.recent-more svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.8;
}
.home-panel .recent-more:hover {
  text-decoration: none;
  color: var(--point-strong-color);
  font-weight: 700;
}

.home-panel .recent-more:hover svg {
  stroke-width: 2.5;
}

.home-panel .recent-more {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 13px;
  border-top: 1px solid var(--panel-border-color);
  text-decoration: none;
}
.user-dropdown .dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-14px) scale(0.97);
  transform-origin: top right;
  pointer-events: none;

  transition:
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.45s;
}
.user-dropdown.is-visible .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.logo-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.logo-caption {
  margin: 0;
  color: var(--muted-color);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 5px;
  line-height: 1.3;
}
.user-dropdown summary svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  transform: translateY(1px);
}
.search-dropdown summary svg {
  width: 20px;
  height: 20px;
}
.home-notice .section-header,
.home-history .section-header,
.home-ranking-notice .section-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--panel-border-color);
  margin-bottom: 8px;
}
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 38px;
  height: 38px;
  flex-shrink: 0;

  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 50%;

  background: var(--card-color);
  color: var(--text-color);

  cursor: pointer;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}
.theme-icon-moon {
  display: none;
}
html[data-theme="light"] .theme-icon-sun {
  display: none;
}

html[data-theme="light"] .theme-icon-moon {
  display: block;
}

/* 9. 반응형 */
@media (max-width: 900px) {
  main {
    padding: 20px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-grid {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 16px;
  }

  .home-middle,
  .home-bottom {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 750px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 52px auto;
    column-gap: 12px;
    padding: 0 16px;
  }

  .logo-group {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    margin-left: 0;
  }

  .topbar-actions {
    grid-column: 2;
    grid-row: 1;
    gap: 12px;
  }

  .topbar nav,
  .topbar:has(.topbar-actions) nav {
    grid-column: 1 / -1;
    grid-row: 2;

    width: 100%;
    box-sizing: border-box;

    justify-self: stretch;
    justify-content: space-evenly;
    align-items: center;
    flex-wrap: wrap;

    padding-bottom: 12px;
  }

  .search-dropdown form {
    padding: 14px 16px;
  }

  .search-dropdown form::before {
    left: 32px;
  }

  .search-dropdown form::after {
    left: 43px;
  }

  .home-main {
    padding: 16px;
  }

  .home-grid,
  .home-middle,
  .home-bottom {
    grid-template-columns: 1fr;
  }

  .home-ranking-placeholder {
    min-height: 280px;
  }
}

@media (max-width: 600px) {
  .logo span {
    display: block;
    margin: 3px 0 0;
    font-size: 9px;
    letter-spacing: 1.5px;
  }

  .sidebar {
    gap: 6px;
    padding: 10px 12px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar .menu {
    padding: 10px 14px;
    font-size: 12px;
  }

  main {
    padding: 16px;
  }

  .welcome {
    padding: 20px;
  }

  .welcome h2 {
    font-size: 20px;
  }

  .stats {
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-card h3 {
    font-size: 19px;
  }

  .recent-records {
    padding: 14px;
    overflow-x: auto;
  }

  table {
    min-width: 480px;
  }

  .user-dropdown .dropdown-menu {
    width: 170px;
  }
}

@media (max-width: 400px) {
  .home-main {
    padding: 12px;
  }

  .home-panel:not(.home-summary):not(.home-recent) {
    padding: 16px;
  }
}
html,
body {
  overflow-x: clip;
}

/* =========================
   서열표 페이지
========================= */

/* 서열표 상단 */
.tier-header {
  padding: 20px;
  background: var(--card-color);
  border: 1px solid var(--panel-border-color);
  border-radius: 10px;
}

.tier-header h2 {
  margin: 0;
  color: var(--text-color);
  font-size: 20px;
  font-weight: 700;
}

/* 난이도별 섹션 간격 */
.tier-section + .tier-section {
  margin-top: 24px;
}

/* 15, 14, 13 ... 레벨 제목 */
.tier-level {
  text-align: center;
  margin: 0 0 10px;
  padding: 10px 14px;
  background: var(--menu-hover-bg-color);
  border-left: 3px solid var(--point-color);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 15px;
  font-weight: 700;
}

/* 곡 목록: 가로 3열 */
.tier-song-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

/* 개별 곡 카드 */
.tier-song {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px;
  background: var(--card-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition:
    background-color 0.2s,
    border-color 0.2s;
}

.tier-song:hover {
  background: var(--card-hover-color);
  border-color: var(--panel-border-color);
}

/* 앨범 사진 영역 */
.tier-cover {
  position: relative;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
}

.tier-cover .song-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

/* 앨범 사진에 겹치는 표시 공통 */
.tier-star,
.tier-difficulty {
  position: absolute;
  padding: 3px 4px;
  background: color-mix(in srgb, var(--badge-bg-color) 75%, transparent);

  border-radius: 4px;
  color: var(--point-color);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

/* 왼쪽 위: 별 난이도 */
.tier-star {
  top: 3px;
  left: 3px;
}

/* 오른쪽 아래: 서열 */
.tier-difficulty {
  right: 3px;
  bottom: 3px;
}

/* 곡 정보 */
.tier-song .song-text {
  flex: 1;
  min-width: 0;
}

/* 곡 제목 */
.tier-song .song-title {
  font-size: 12px;
  line-height: 1.4;
}

/* 가수명 + BPM */
.tier-song-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--subtext-color);
  font-size: 10px;
  white-space: nowrap;
}

.tier-song-meta .song-artist {
  min-width: 0;
  font-size: inherit;
}

.tier-song-meta span:not(.song-artist) {
  flex-shrink: 0;
}

/* 반응형 */
@media (max-width: 1000px) {
  .tier-song-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .tier-song-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================
   서열표 디자인 수정
========================= */

/* 상단 제목과 안내 */
.tier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* 안내 버튼 */
.tier-guide {
  position: relative;
  flex-shrink: 0;
}

.tier-guide summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--subtext-color);
  font-size: 12px;
  cursor: pointer;
  list-style: none;
}

.tier-guide summary::-webkit-details-marker {
  display: none;
}

.tier-guide summary::marker {
  content: "";
}

.tier-guide summary:hover {
  color: var(--point-color);
}

.tier-guide summary svg {
  width: 15px;
  height: 15px;
}

/* 안내 클릭 시 나오는 설명 */
.tier-guide-content {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: 260px;
  padding: 16px;
  background: var(--card-color);
  border: 1px solid var(--panel-border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px var(--shadow-soft-color);
}

.tier-guide-content p {
  margin: 0 0 10px;
  color: var(--text-color);
  font-size: 13px;
  font-weight: 700;
}

.tier-guide-content span {
  color: var(--subtext-color);
  font-size: 12px;
  line-height: 1.7;
}

/* 레벨 구분 박스 */
.tier-level {
  padding: 10px 14px;
  border: none;
  border-radius: 6px;
  background: var(--menu-hover-bg-color);
  color: var(--text-color);
  font-size: 15px;
}

/* 곡 목록 간격 */
.tier-song-grid {
  column-gap: 12px;
  row-gap: 16px;
}

/* 곡별 상자 제거 */
.tier-song {
  padding: 4px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tier-song:hover {
  border: none;
  background: transparent;
}

/* 앨범 사진 크기 확대 */
.tier-cover {
  width: 68px;
  height: 68px;
}

/* 별 난이도 숨기기 */
.tier-star {
  display: none;
}

/* 오른쪽 아래 서열은 유지 */
.tier-difficulty {
  right: 3px;
  bottom: 3px;
  padding: 4px 5px;

  background: color-mix(in srgb, #f472d0 50%, transparent);

  border-radius: 4px;

  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

/* 곡 정보 영역 */
.tier-song .song-text {
  flex: 1;
  min-width: 0;
  gap: 5px;
}

/* 곡 제목 */
.tier-song .song-title {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  font-size: 13px;
  line-height: 1.4;
}

/* 가수명과 BPM */
.tier-song-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 11px;
}

/* 가수명이 길면 ... 처리 */
.tier-song-meta .song-artist {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

/* BPM과 구분점은 잘리지 않도록 */
.tier-song-meta span:not(.song-artist) {
  flex-shrink: 0;
}
/* 세부 서열 구분선 */
.tier-divider {
  grid-column: 1 / -1;
  height: 1px;
  margin: 4px 0;
  background: color-mix(in srgb, var(--point-color) 25%, var(--border-color));
}
.tier-cover-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background: var(--placeholder-bg-color);
  color: var(--muted-color);
  font-size: 24px;
}

/* =========================
   서열표 확장 레이아웃
========================= */

/* 본문 + 오른쪽 사이드바 */
.tier-page .home-grid {
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
}

/* 화면이 넓으면 오른쪽으로 영역 확장 */
@media (min-width: 1200px) {
  .tier-page .home-grid {
    width: min(calc(100% + 302px), calc(50vw + 552px));
  }
}

/* 곡을 한 줄에 4개씩 배치 */
.tier-page .tier-song-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* 오른쪽 사이드바 스크롤 따라오기 */
.tier-page .home-right {
  position: sticky;
  top: 84px;
  align-self: start;
}

/* 반응형: 중간 화면 */
@media (max-width: 1199px) {
  .tier-page .home-grid {
    width: 100%;
  }

  .tier-page .tier-song-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 작은 화면 */
@media (max-width: 900px) {
  .tier-page .tier-song-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 모바일 */
@media (max-width: 750px) {
  .tier-page .home-grid {
    grid-template-columns: 1fr;
  }

  .tier-page .home-right {
    position: static;
  }
}

@media (max-width: 520px) {
  .tier-page .tier-song-grid {
    grid-template-columns: 1fr;
  }
}
/* 푸터 배경 화면 전체 너비로 확장 */
.footer {
  position: relative;
  isolation: isolate;
  background: transparent;
  border-top: none;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);

  background: var(--header-color);
  border-top: 1px solid var(--divider-color);
  z-index: -1;
}
/* 검색창 바깥 배경, 테두리, 그림자 제거 */
.search-dropdown form {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* 검색창이 열렸을 때 하단 구분선 제거 */
.topbar:has(.search-dropdown[open])::after {
  display: none;
}
.tier-page:has(.search-dropdown[open]) .home-right {
  top: 154px;
}
.tier-page .home-right {
  transition: top 0.25s ease;
}
@media (max-width: 750px) {
  /* 오른쪽 사이드바 숨기기 */
  .tier-page .home-right {
    display: none;
  }

  /* 본문이 전체 너비 사용 */
  .tier-page .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* =========================
   홈페이지 확장 레이아웃
========================= */

/* 본문과 사이드바 배치 */
.home-page .home-grid {
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
}

/* 넓은 화면에서는 전체 영역을 오른쪽으로 확장 */
@media (min-width: 1200px) {
  .home-page .home-grid {
    width: min(calc(100% + 302px), calc(50vw + 552px));
  }
}

/* 사이드바 스크롤 따라오기 */
.home-page .home-right {
  position: sticky;
  top: 84px;
  align-self: start;
  transition: top 0.25s ease;
}

/* 검색창이 열렸을 때 */
.home-page:has(.search-dropdown[open]) .home-right {
  top: 154px;
}

/* 중간 크기 화면 */
@media (max-width: 1199px) {
  .home-page .home-grid {
    width: 100%;
  }
}

@media (min-width: 751px) and (max-width: 900px) {
  .home-page .home-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 16px;
  }
}

/* 700px 이하에서는 사이드바 숨기기 */
@media (max-width: 750px) {
  .home-page .home-right {
    display: none;
  }

  .home-page .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
