@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css");

html {
    font-size: 16px; /* 기본 폰트 크기 복원 (스크린샷 기준) */
}

body {
    margin: 0 auto;
    padding: 0 5px; /* 좌우 여백 최소화 */
    background: #f5f5f5;
    font-family: "Pretendard Variable", Pretendard, Arial, sans-serif;
    max-width: 1110px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* 로그인/회원가입 스타일 (변경 없음) */
.login-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 350px;
    text-align: center;
    margin: 50px auto;
}

h2 {
    margin-bottom: 20px;
    color: #ff77b2;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

input {
    width: 90%;
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #ffccde;
    border-radius: 5px;
    font-size: 16px;
    outline: none;
}

input:focus {
    border-color: #ff77b2;
}

input.error {
    border: 2px solid red;
}

button {
    width: 90%;
    padding: 8px;
    background-color: #ff77b2;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

button:hover {
    background-color: #ff3366;
}

#refreshProfile, #toggleSegaCredentials {
    width: 150px;
    height: 32px;
    padding: 6px 12px;
    font-size: 12px;
    background-color: #9d63f0;
    border-radius: 4px;
    line-height: 20px;
    font-weight: 600;
}

#refreshProfile:hover, #toggleSegaCredentials:hover {
    background-color: #7a4cc0;
}


#sega-credentials-form button {
    width: 100px;
    height: 32px;
    padding: 6px 12px;
    font-size: 12px;
}

p {
    margin-top: 10px;
    font-size: 14px;
}

a {
    color: #ff77b2;
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
}

.error-message, #error-message {
    color: red;
    font-size: 14px;
    margin-top: 5px;
    text-align: center;
    width: 90%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* 메인 페이지 스타일 */


.rating-summary {
    font-size: 50px;
    color: #888;
    margin-left: auto;
    margin-right: 8px;
    font-weight: 800;
}
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rating-summary-box {
  text-align: right;
  height: 4px;
  font-size: 17px;
  color: #888;
  margin-bottom: -10px;
  margin-top: 20px;
  padding-right: 8px;
}












/* ─── body 너비 조정 ─── */
*, *::before, *::after { box-sizing: border-box; }

.container {
    max-width: 1110px;
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

/* ─── 프로필 섹션 (fixed 다크 UI) ─── */
.profile-section {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    padding: 20px;
    margin: 12px 0;
    color: #fff;
    gap: 12px;
    flex-wrap: wrap;
}

.profile-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.2);
    object-fit: cover;
    flex-shrink: 0;
}


.profile-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.friend-code {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    gap: 6px;
}

.username {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
}

.rating-container {
    position: relative;
    min-width: 120px;
    height: 46px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 4px 8px;
    overflow: visible;
}
/* 레이팅 프레임 이미지: object-fit:contain으로 원본 비율을 유지한 채
   잘리지 않고 전체가 보이도록 함 (이전에는 background-size:cover 때문에 사진이 네모나게 잘렸음) */
.rating-frame-img {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 100%;
    width: auto;
    max-width: none;
    object-fit: contain;
    z-index: 1;
    pointer-events: none;
}

.rating {
    font-size: 1.3rem;
    font-weight: 900;
    color: #f5a623;
    z-index: 2;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    padding-left: 63px;
    letter-spacing: 3.3px;
}

.trophy-block {
    margin: 2px 0;
}

.update-time {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
}

.play-count {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 갱신 버튼 스타일 */
#howToUpdateBtn {
    width: auto;
    padding: 8px 16px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
#howToUpdateBtn:hover { background: rgba(255,255,255,0.25); }

#myPageBtn {
    width: auto;
    padding: 8px 16px;
    background: rgba(157,99,240,0.6);
    border: none;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
#myPageBtn:hover { background: rgba(157,99,240,0.9); }

/* 게임 전환(마이마이 ⇄ 사볼) 버튼 */
.game-switch-btn {
    width: auto;
    padding: 8px 16px;
    background: rgba(78,204,163,0.25);
    border: 1px solid rgba(78,204,163,0.5);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}
.game-switch-btn:hover { background: rgba(78,204,163,0.4); }

/* ─── 모달 ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-box h3 { font-size: 1.2rem; margin-bottom: 16px; color: #1a1a2e; }
.modal-box ol { margin: 0 0 16px 20px; line-height: 1.8; color: #444; }
.modal-box a  { color: #9d63f0; }
.modal-note   { font-size: 0.82rem; color: #888; margin: 12px 0 0; }
.modal-box button {
    width: auto;
    margin-top: 20px;
    padding: 10px 24px;
    background: #9d63f0;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* ─── 북마클릿 코드 박스 ─── */
.bookmarklet-box {
    background: #f7f5fb;
    border: 1px dashed #9d63f0;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 4px;
}
.bookmarklet-drag-btn {
    display: inline-block;
    width: auto;
    background: #9d63f0;
    color: #fff !important;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    cursor: grab;
    margin-bottom: 12px;
}
.bookmarklet-drag-btn:hover { background: #8a4de0; }
.bookmarklet-code-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.bookmarklet-code-input {
    flex: 1;
    width: auto;
    min-width: 0;
    font-family: monospace;
    font-size: 11px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #555;
}
.bookmarklet-code-row button {
    width: auto;
    margin: 0;
    padding: 8px 14px;
    font-size: 13px;
    flex-shrink: 0;
}
.bookmarklet-copy-msg {
    font-size: 0.78rem;
    color: #2e9e4f;
    margin: 8px 0 0;
    min-height: 1em;
}

/* ─── 공유 탭 ─── */
.share-section { padding: 16px 0; }
.share-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.share-url-box { display: flex; gap: 8px; }
.share-url-box input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.85rem;
    background: #f9f9f9;
    outline: none;
    width: auto;
}
.share-url-box button {
    width: auto;
    padding: 10px 20px;
    background: #9c27b0;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 0;
}
#shareMsg { font-size: 0.8rem; color: #4caf50; margin-top: 8px; }

.share-section + .share-section { border-top: 1px solid #eee; margin-top: 4px; }
.share-desc { font-size: 0.8rem; color: #888; margin: -4px 0 12px; line-height: 1.5; }
.share-section button#downloadRatingImageBtn,
.share-section button#tierImgBtn,
.share-section button#sxtImgBtn,
.share-section button#downloadLevelSummaryImageBtn {
    width: auto;
    padding: 10px 20px;
    background: #9c27b0;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 4px;
}
.share-section button#downloadRatingImageBtn:disabled,
.share-section button#tierImgBtn:disabled,
.share-section button#sxtImgBtn:disabled,
.share-section button#downloadLevelSummaryImageBtn:disabled { opacity: 0.6; cursor: not-allowed; }
.share-img-msg { font-size: 0.8rem; color: #4caf50; margin-top: 8px; min-height: 1em; }
.share-img-msg.error { color: #e53935; }
.share-preview-wrap { margin-top: 12px; }
.share-preview-img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    display: block;
}
.level-range-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.level-range-picker input[type="number"] {
    width: 90px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.level-summary-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.level-summary-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f5f5f7;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    user-select: none;
}
.level-summary-checkbox input { width: auto; margin: 0; cursor: pointer; }
.level-summary-checkbox.checked { background: #f3e5f9; border-color: #9c27b0; color: #7b1fa2; font-weight: 700; }

/* ─── 빈 메시지 ─── */
.empty-msg {
    text-align: center;
    color: #aaa;
    padding: 40px 20px;
    font-size: 0.9rem;
}

.toggle-label {
    font-size: 14px;
    color: #333;
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #cdaaff;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.refresh-button {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background-color: #9d63f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
    width: 100px;
    height: 32px;
    line-height: 20px;
}

.refresh-button:hover {
    background-color: #7a4cc0;
}

#loadMore {
    display: block;
    text-align: center;
    padding: 10px;
    margin: 10px 0;
}
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    text-align: center;
    display: block;
    font-size: 16px;
    color: #fff;
    padding: 20px;
    background: #333;
    border-radius: 10px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.tab-menu {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.tab-link {
    padding: 8px 15px;
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.3s;
    cursor: pointer;
}

.tab-link:hover {
    background-color: #c0c0c0;
    color: #000;
}

.tab-link.active {
    background-color: #d3d3d3;
    color: #000;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section-title {
    display: flex;
    align-items: center;
    margin: 30px 0 20px;
}

.title-text {
    background: #ffffff;
    color: #181818;
    padding: 5px;
    border-radius: 20px;
    font-weight: 700;
    width: 100px;
    height: 20px;
    text-align: center;
    line-height: 19px;
    position: relative;
    top: -2px;
    box-shadow: 0px 2px 5px rgba(153, 153, 153, 0.3);
}

.right-title-line {
    flex: 1;
    height: 7px;
    background: #e4e4e4;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
}

.left-title-line {
    flex: 1;
    height: 7px;
    background: #e4e4e4;
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}




.sort-search-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-controls label {
    font-size: 14px;
    text-align: right;
    width: 70px;
    color: #333;
}

.sort-controls select {
    padding: 5px;
    margin-left: 2px;
    font-size: 14px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.sort-order-btn {
    width: 80px;
    padding: 5px;
    font-size: 14px;
    border-radius: 5px;
    margin-bottom: 10px;
    margin-left: 2px;
    border: 1px solid #ccc;
    background-color: #f5f5f5;
    cursor: pointer;
    color: black;
}

.sort-order-btn:hover {
    background-color: #c0c0c0;
}

.search-container {
    display: flex;
    align-items: center;
}

.search-container input {
    padding: 5px;
    font-size: 14px;
    border-radius: 5px;
    border: 1px solid #ccc;
    width: 200px;
}

.record-blocks {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
/* 화면이 넓을 때(데스크톱)는 한 줄에 한 곡씩만 있으면 좌우로 너무 길어서 2열로
   나눠서 보여줌. 좁은 화면(태블릿/모바일)에서는 그냥 기존처럼 1열. */
@media (min-width: 1000px) {
    .record-blocks {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px 14px;
    }
    /* 방어적 하드닝: flex 아이템(.record-block 등)의 기본 min-width는 'auto'라서,
       안의 내용(긴 곡명, 고정 flex-basis를 가진 배지들 등)의 내재 폭 합이 그리드
       컬럼(1fr) 폭보다 크면 컬럼 자체가 늘어나 오른쪽으로 삐져나갈 수 있다(일부
       기기/폭에서 보고된 "기록 탭이 오른쪽으로 밀려서 다른 요소와 안 맞는다" 증상의
       전형적인 원인). 재현은 못 했지만, 그리드 트랙 폭을 넘지 않도록 모든 그리드
       자식에 min-width:0을 강제해서 원천 차단해둔다.
       (CSS Grid/Flexbox의 "min-width: auto" 함정 — MDN: "min-size defaults to auto") */
    .record-blocks > * {
        min-width: 0;
    }
}

.record-block {
    display: flex;
    align-items: center;
    min-width: 0;
    box-sizing: border-box;
    max-width: 100%;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s;
    min-height: 84px;
}

.record-block:hover {
    background: #f0f0f0;
}

.record-jacket {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 10px;
    align-self: center;
}
.record-marks {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-left: 10px;
    align-self: center;
}

.record-clear-mark,
.record-sync-mark {
    width: 38px;
    height: 37px; /* jacket 크기(76px)의 절반에 맞춤 */
    object-fit: contain;
}

.record-constant-box {
    width: 50px;
    height: 76px;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    margin-right: 20px;
    font-size: 16px;
    font-weight: 900;
    color: #fff;
    text-align: center;
    box-sizing: border-box;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    align-self: center;
}


.record-constant-box span {
    margin: 0;
    padding: 0;
    display: inline-block;
    line-height: normal;
}

.basic-constant-box {
    background: #78c954;
}

.advanced-constant-box {
    background: #f8d548;
}

.expert-constant-box {
    background: #ff6060;
}

.master-constant-box {
    background: #9d63f0;
}

.remaster-constant-box {
    background: #cdaaff;
}

.record-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: 0px;
    padding-top: 5px;
    align-self: center;
}

.record-song-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-top: 5px;
}

.record-song-type {
    height: 13px;
    width: 45px;
}

.record-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.record-song-score {
    font-size: 16px;
    font-weight: 700;
    color: #27005e;
}

.record-rank {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.record-rate {
    font-size: 12px;
    color: #888;
}

/* 카드 공통 스타일 */
.master-song-type,
.remaster-song-type,
.basic-song-type,
.advanced-song-type,
.expert-song-type
 {
    display: flex;
    position: absolute;
    bottom: 7px;
    left: 7px;
    z-index: 5;
    height: 13px;
    width: 45px;
}

@keyframes rainbow-border {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.no-border::after {
    display: none !important;
}

.no-border {
    box-shadow: none;
}

.song-name {
    position: absolute;
    margin-top: 15px;
    font-weight: 600;
    margin-right: 3px;
    font-size: 11px;
    text-shadow: 0px 1px 4px rgb(0, 0, 0);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    text-align: left;
    max-width: 90%;
}

.song-rank {
    display: flex;
    position: absolute;
    margin-top: 25px;
    font-weight: 600;
    margin-right: 3px;
    font-size: 10px;
    text-shadow: 0px 1px 4px rgb(0, 0, 0);
}

.song-score {
    display: flex;
    position: absolute;
    margin-top: 35px;
    font-weight: 500;
    margin-right: 3px;
    font-size: 7px;
    text-shadow: 0px 1px 4px rgb(0, 0, 0);
}

.jacket_img {
    width: 100%;
    height: 99%;
    object-fit: cover;
    border-radius: 18px;
    position: relative;
    z-index: 1;
}

.song-info {
    position: absolute;
    height: 60px;
    bottom: 0;
    left: 0;
    width: 70%;
    padding: 0px;
    box-sizing: border-box;
    color: white;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.no-border .advanced-score-info,
.no-border .basic-score-info,
.no-border .expert-score-info,
.no-border .master-score-info,
.no-border .remaster-score-info {
    margin-right: -2px;
    margin-bottom: -2px;
}


.master-card-container.border-black::after,
.basic-card-container.border-black::after,
.advanced-card-container.border-black::after,
.expert-card-container.border-black::after,
.remaster-card-container.border-black::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 4px;
  pointer-events: none;
  background: black;  /* 검정색 단색 테두리 */
  /* 안쪽을 투명 처리해 테두리만 보이도록 */
  mask:
    linear-gradient(white, white) content-box,
    linear-gradient(white, white);
  mask-composite: exclude;
}



.advanced-score-info,
.basic-score-info,
.expert-score-info,
.master-score-info,
.remaster-score-info {
    margin-right: 0;
    margin-bottom: 0;
}

/* 난이도별 카드 스타일 */
.advanced-card-container {
    position: relative;
    border-radius: 16px;
    width: 170px;
    height: 120px;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 0 20px #f8d548;
}

.advanced-card-container::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 4px;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0) 10%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.7) 70%),
        linear-gradient(135deg,
            #0aff60, #85e1e1, #ff002b, #ea29a0, #ff50a8, #FF4500, #ffd446,
            #e430e4, #c28ee7, #1313ff, #2f73fc, #698cf5, #e430e4, #c28ee7,
            #FF4500, #ffd446, #0aff60, #85e1e1);
    background-size: 1000% 1000%;
    animation: rainbow-border 3s ease-in-out infinite;
    mask: linear-gradient(white, white) content-box, linear-gradient(white, white);
    mask-composite: exclude;
}

.advanced-song-info-bg {
    position: absolute;
    left: 0;
    width: 129%;
    height: 50%;
    background: linear-gradient(to top, rgba(112, 90, 0, 0.9), rgba(112, 90, 0, 0.4), rgba(112, 90, 0, 0));
    z-index: 2;
    pointer-events: none;
    bottom: 0;
}

.advanced-score-info {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 26%;
    height: 43%;
    padding: 5px;
    box-sizing: border-box;
    background: #f8d548;
    border-top-left-radius: 16px;
    border-bottom-right-radius: 12px;
    margin-right: 4px;
    margin-bottom: 4px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}

.advanced-constant {
    color: #705a00;
    font-size: 10px;
    margin-bottom: 0;
    margin: 0;
    display: flex;
    position: absolute;
    margin-bottom: 15px; /* 아래로 이동: 17px → 15px */
    margin-right: 2px; /* 왼쪽으로 이동: -1px → 2px */
    font-weight: 700;
}

.advanced-song-rating {
    color: #705a00;
    font-size: 16px;
    display: flex;
    position: absolute;
    margin-bottom: 3px; /* 아래로 이동: 7px → 3px */
    margin-right: 3px; /* 왼쪽으로 이동: 0px → 3px */
    font-weight: 900;
}

.basic-card-container {
    position: relative;
    border-radius: 16px;
    width: 170px;
    height: 120px;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 0 20px #78c954;
}

.basic-card-container::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 4px;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0) 10%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.7) 70%),
        linear-gradient(135deg,
            #0aff60, #85e1e1, #ff002b, #ea29a0, #ff50a8, #FF4500, #ffd446,
            #e430e4, #c28ee7, #1313ff, #2f73fc, #698cf5, #e430e4, #c28ee7,
            #FF4500, #ffd446, #0aff60, #85e1e1);
    background-size: 1000% 1000%;
    animation: rainbow-border 3s ease-in-out infinite;
    mask: linear-gradient(white, white) content-box, linear-gradient(white, white);
    mask-composite: exclude;
}

.basic-song-info-bg {
    position: absolute;
    left: 0;
    width: 129%;
    height: 50%;
    background: linear-gradient(to top, rgba(25, 65, 7, 0.9), rgba(25, 65, 7, 0.4), rgba(25, 65, 7, 0));
    z-index: 2;
    pointer-events: none;
    bottom: 0;
}

.basic-score-info {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 26%;
    height: 43%;
    padding: 5px;
    box-sizing: border-box;
    background: #78c954;
    border-top-left-radius: 16px;
    border-bottom-right-radius: 12px;
    margin-right: 4px;
    margin-bottom: 4px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}

.basic-constant {
    color: #194107;
    font-size: 10px;
    margin-bottom: 0;
    margin: 0;
    display: flex;
    position: absolute;
    margin-bottom: 15px; /* 아래로 이동: 17px → 15px */
    margin-right: 2px; /* 왼쪽으로 이동: -1px → 2px */
    font-weight: 700;
}

.basic-song-rating {
    color: #194107;
    font-size: 16px;
    display: flex;
    position: absolute;
    margin-bottom: 3px; /* 아래로 이동: 7px → 3px */
    margin-right: 3px; /* 왼쪽으로 이동: 0px → 3px */
    font-weight: 900;
}

.expert-card-container {
    position: relative;
    border-radius: 16px;
    width: 170px;
    height: 120px;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 0 20px #ff6060;
}

.expert-card-container::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 4px;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0) 10%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.7) 70%),
        linear-gradient(135deg,
            #0aff60, #85e1e1, #ff002b, #ea29a0, #ff50a8, #FF4500, #ffd446,
            #e430e4, #c28ee7, #1313ff, #2f73fc, #698cf5, #e430e4, #c28ee7,
            #FF4500, #ffd446, #0aff60, #85e1e1);
    background-size: 1000% 1000%;
    animation: rainbow-border 3s ease-in-out infinite;
    mask: linear-gradient(white, white) content-box, linear-gradient(white, white);
    mask-composite: exclude;
}

.expert-song-info-bg {
    position: absolute;
    left: 0;
    width: 129%;
    height: 50%;
    background: linear-gradient(to top, rgba(103, 7, 7, 0.9), rgba(103, 7, 7, 0.4), rgba(103, 7, 7, 0));
    z-index: 2;
    pointer-events: none;
    bottom: 0;
}

.expert-score-info {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 26%;
    height: 43%;
    padding: 5px;
    box-sizing: border-box;
    background: #ff6060;
    border-top-left-radius: 16px;
    border-bottom-right-radius: 12px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    margin-right: 4px;
    margin-bottom: 4px;
}

.expert-constant {
    color: #670707;
    font-size: 10px;
    margin-bottom: 0;
    margin: 0;
    display: flex;
    position: absolute;
    margin-bottom: 15px; /* 아래로 이동: 17px → 15px */
    margin-right: 2px; /* 왼쪽으로 이동: -1px → 2px */
    font-weight: 700;
}

.expert-song-rating {
    color: #670707;
    font-size: 16px;
    display: flex;
    position: absolute;
    margin-bottom: 3px; /* 아래로 이동: 7px → 3px */
    margin-right: 3px; /* 왼쪽으로 이동: 0px → 3px */
    font-weight: 900;
}

.master-card-container {
    position: relative;
    border-radius: 16px;
    width: 170px;
    height: 120px;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 0 20px #9d63f0;
}

.master-card-container::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 4px;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0) 10%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.7) 70%),
        linear-gradient(135deg,
            #0aff60, #85e1e1, #ff002b, #ea29a0, #ff50a8, #FF4500, #ffd446,
            #e430e4, #c28ee7, #1313ff, #2f73fc, #698cf5, #e430e4, #c28ee7,
            #FF4500, #ffd446, #0aff60, #85e1e1);
    background-size: 1000% 1000%;
    animation: rainbow-border 3s ease-in-out infinite;
    mask: linear-gradient(white, white) content-box, linear-gradient(white, white);
    mask-composite: exclude;
}

.master-song-info-bg {
    position: absolute;
    left: 0;
    width: 129%;
    height: 50%;
    background: linear-gradient(to top, rgba(39, 0, 94, 0.9), rgba(39, 0, 94, 0.4), rgba(39, 0, 94, 0));
    z-index: 2;
    pointer-events: none;
    bottom: 0;
}

.master-score-info {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 26%;
    height: 43%;
    padding: 5px;
    box-sizing: border-box;
    background: #9d63f0;
    border-top-left-radius: 16px;
    border-bottom-right-radius: 12px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    margin-right: 4px;
    margin-bottom: 4px;
}

.master-constant {
    color: #27005e;
    font-size: 10px;
    margin-bottom: 0;
    margin: 0;
    display: flex;
    position: absolute;
    margin-bottom: 15px; /* 아래로 이동: 17px → 15px */
    margin-right: 2px; /* 왼쪽으로 이동: -1px → 2px */
    font-weight: 700;
}

.master-song-rating {
    color: #27005e;
    font-size: 16px;
    display: flex;
    position: absolute;
    margin-bottom: 3px; /* 아래로 이동: 7px → 3px */
    margin-right: 3px; /* 왼쪽으로 이동: 0px → 3px */
    font-weight: 900;
}

.remaster-card-container {
    position: relative;
    border-radius: 16px;
    width: 170px;
    height: 120px;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 0 20px rgba(205, 170, 255, 0.9);
}

.remaster-card-container::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 4px;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0) 10%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.7) 70%),
        linear-gradient(135deg,
            #0aff60, #85e1e1, #ff002b, #ea29a0, #ff50a8, #FF4500, #ffd446,
            #e430e4, #c28ee7, #1313ff, #2f73fc, #698cf5, #e430e4, #c28ee7,
            #FF4500, #ffd446, #0aff60, #85e1e1);
    background-size: 1000% 1000%;
    animation: rainbow-border 3s ease-in-out infinite;
    mask: linear-gradient(white, white) content-box, linear-gradient(white, white);
    mask-composite: exclude;
}

.remaster-song-info-bg {
    position: absolute;
    left: 0;
    width: 129%;
    height: 50%;
    background: linear-gradient(to top, rgba(157, 99, 240, 0.9), rgba(157, 99, 240, 0.4), rgba(157, 99, 240, 0));
    z-index: 2;
    pointer-events: none;
    bottom: 0;
}

.remaster-score-info {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 26%;
    height: 43%;
    padding: 5px;
    box-sizing: border-box;
    background: #cdaaff;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    border-top-left-radius: 16px;
    border-bottom-right-radius: 12px;
    margin-right: 4px;
    margin-bottom: 4px;
}

.remaster-constant {
    color: #27005e;
    font-size: 10px;
    margin-bottom: 0;
    margin: 0;
    display: flex;
    position: absolute;
    margin-bottom: 15px; /* 아래로 이동: 17px → 15px */
    margin-right: 2px; /* 왼쪽으로 이동: -1px → 2px */
    font-weight: 700;
}

.remaster-song-rating {
    color: #27005e;
    font-size: 16px;
    display: flex;
    position: absolute;
    margin-bottom: 3px; /* 아래로 이동: 7px → 3px */
    margin-right: 3px; /* 왼쪽으로 이동: 0px → 3px */
    font-weight: 900;
}










/* ───── 구리/은/금/연한금 테두리 : 메탈 반짝임 ───── */
/* ── 하이라이트 강도 낮춘 radial-gradient ── */
.master-card-container.border-copper::after,
.master-card-container.border-silver::after,
.master-card-container.border-gold::after,
.master-card-container.border-gold-light::after {
  padding: 4px;   
  background-image:
    /* 불투명도 조정: 50%→20%, 70%→40% */
    radial-gradient(circle,
      rgba(255,255,255,0)   10%,
      rgba(255,255,255,0.2) 50%,
      rgba(255,255,255,0.4) 70%
    ),
    /* 아래는 기존 메탈 그라데이션 그대로 */
    linear-gradient(135deg,
      /* 컬러 스톱 예시(구리색) */
      #9c5f25 0%, #af6f2a 25%, #9c5f25 50%, #af6f2a 75%, #9c5f25 100%
    );
}

/* ─ metal 색상 진하게 조정 ─ */
/* 구리색(동색) */
/* ─ metal 색상 진하게 조정 ─ */
/* 구리색(동색) */
/* ── 하이라이트 축소 & 메탈 비율 ↑ radial-gradient ── */
  
/* 구리색 */
.master-card-container.border-copper::after,
.remaster-card-container.border-copper::after,
.basic-card-container.border-copper::after,
.advanced-card-container.border-copper::after,
.expert-card-container.border-copper::after
 {
  padding: 4px;   
  background-image:
    /* radial: 투명→약한 화이트→약한 화이트→투명 */
    radial-gradient(circle,
      rgba(255,255,255,0)   5%,
      rgba(255,255,255,0.1) 20%,
      rgba(255,255,255,0.2) 35%,
      rgba(255,255,255,0)   40%
    ),
    /* 메탈 구리 그라데이션 (기존 값 유지) */
    linear-gradient(135deg,
      #9c5f25 0%, #af6f2a 25%, #9c5f25 50%, #af6f2a 75%, #9c5f25 100%
    );
}

/* 은색 */
.master-card-container.border-silver::after,
.remaster-card-container.border-silver::after,
.basic-card-container.border-silver::after,
.advanced-card-container.border-silver::after,
.expert-card-container.border-silver::after {
  padding: 4px;   
  background-image:
    radial-gradient(circle,
      rgba(255,255,255,0)   5%,
      rgba(255,255,255,0.1) 20%,
      rgba(255,255,255,0.2) 35%,
      rgba(255,255,255,0)   40%
    ),
    linear-gradient(135deg,
      #A8A8A8 0%, #C0C0C0 25%, #A8A8A8 50%, #C0C0C0 75%, #A8A8A8 100%
    );
}

/* 금색 */
.master-card-container.border-gold::after,
.remaster-card-container.border-gold::after,
.basic-card-container.border-gold::after,
.advanced-card-container.border-gold::after,
.expert-card-container.border-gold::after {
  padding: 4px;   
  background:
    /* 라디얼 하이라이트 유지 */
    radial-gradient(circle,
      rgba(255,255,255,0)    5%,
      rgba(255,255,255,0.01) 20%,
      rgba(255,255,255,0)   40%
    ),
    /* 단색 골드 */
    #ffe553dc;
  background-size:
    300% 300%, /* 하이라이트용 */
    auto;      /* 단색은 사이즈 불필요 */
  animation:
    shine-highlight 1.5s linear infinite,
    metal-shine    6s ease-in-out infinite;
}



/* 연한 금색 */
.master-card-container.border-gold-light::after,
.remaster-card-container.border-gold-light::after,
.basic-card-container.border-gold-light::after,
.advanced-card-container.border-gold-light::after,
.expert-card-container.border-gold-light::after{
  padding: 4px;   
  background-image:
    /* 하이라이트 거의 제거 */
    radial-gradient(circle,
      rgba(255,255,255,0)    5%,
      rgba(255,255,255,0.05) 15%,
      rgba(255,255,255,0)   25%
    ),
    /* ✨채도 있는 연한 골드✨ */
    linear-gradient(135deg,
      #ffe992 0%,   /* 라이트 골드(중간) */
      #FFE066 25%,  /* 풀 골드(하이라이트) */
      #ffe992 50%,
      #FFD54F 75%,
      #FFE066 100%
    );
}
/* ───── 정적 무지개 테두리 ───── */
/* ───── 진한 정적 무지개 테두리 ───── */
/* ───── 선명한 정적 무지개 테두리 (border-image 사용) ───── */
/* ───── 둥근 정적 무지개 테두리 ───── */
.master-card-container.border-rainbow-static::after,
.remaster-card-container.border-rainbow-static::after,
.basic-card-container.border-rainbow-static::after,
.advanced-card-container.border-rainbow-static::after,
.expert-card-container.border-rainbow-static::after{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;   /* 기존과 동일한 반경 */
  padding: 4px;           /* 테두리 두께 */
  pointer-events: none;
  background:
    /* 기존 라디얼 하이라이트 (필요 없으면 불투명도 낮추거나 제거 가능) */
    radial-gradient(circle,
      rgba(255,255,255,0)   5%,
      rgba(255,255,255,0.2) 20%,
      rgba(255,255,255,0)   25%
    ),
    /* static 무지개 conic-gradient */
    conic-gradient(
      red   0%,
      orange 14%,
      yellow 28%,
      green  42%,
      blue   56%,
      indigo 70%,
      violet 84%,
      red   100%
    );
  background-size: cover;
  /* 애니메이션 비활성화 */
  animation: none !important;
  /* 내부를 투명 처리해 테두리만 보이도록 */
  mask:
    linear-gradient(white, white) content-box,
    linear-gradient(white, white);
  mask-composite: exclude;
}



/* ───── 애니메이션 정의 ───── */
/* 무지개 이동 */
@keyframes rainbow-border {
  0%   { background-position:   0%   0%; }
  50%  { background-position: 100% 100%; }
  100% { background-position:   0%   0%; }
}
/* 라디얼 하이라이트 이동 */
@keyframes shine-highlight {
  0%   { background-position:   0% 50%, 0% 0%; }
  50%  { background-position: 100% 50%, 0% 0%; }
  100% { background-position:   0% 50%, 0% 0%; }
}
/* 메탈 그라데이션 미묘한 이동 */
@keyframes metal-shine {
  0%   { background-position:   0%   0%; }
  50%  { background-position: 200% 200%; }
  100% { background-position:   0%   0%; }
}


.sega-credentials-section {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    display: none; /* 기본 숨김 */
}

.sega-credentials-section h3 {
    margin: 0 0 10px;
    font-size: 1.2em;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* 히스토리 블록 스타일 (수정된 부분) */
.history-block {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s;
    min-height: 84px;
    margin-bottom: 10px; /* 블록 간 간격 추가 */
    width: 100%; /* 컨테이너 너비에 맞춤 */
    box-sizing: border-box;
}

.history-block:hover {
    background: #f0f0f0;
}

.history-changes {
    display: flex;
    flex-direction: column;
    gap: 8px; /* 간격 약간 늘림 */
    font-size: 14px; /* 가독성 위해 폰트 크기 증가 */
    color: #333;
    max-width: 350px; /* 텍스트 넘침 방지 */
    margin-left: 10px; /* 곡 정보와 간격 */
}

.history-change-item {
    display: flex;
    align-items: center;
    gap: 8px; /* 이미지와 텍스트 간격 조정 */
}

.history-change-item img {
    width: 24px; /* 이미지 크기 약간 키움 */
    height: 24px;
    object-fit: contain;
}

#sega-credentials-message {
    margin-top: 10px;
    font-size: 0.9em;
    color: #333;
}

.history-blocks {
    margin: 20px 0;
    min-height: 100px; /* 빈 경우 공간 확보 */
    width: 100%; /* 컨테이너 너비에 맞춤 */
}

#loadMoreHistory {
    display: block;
    text-align: center;
    padding: 10px;
    margin: 20px 0;
    font-size: 16px;
    color: #007bff;
    cursor: pointer;
}

#loadMoreHistory:hover {
    text-decoration: underline;
}

.new-label {
    color: #ff4d4d;
    font-weight: bold;
    font-size: 12px;
    margin-left: 8px; /* 곡명과 간격 조정 */
}

/* 곡 버전 표시 배지 (NEW/OLD와는 별개로 실제 버전명을 항상 표시) */
/* record-info 등 flex-column 부모 안에 놓이면 기본 align-items:stretch 때문에
   글자 길이와 상관없이 가로로 쭉 늘어나 보이는 문제가 있어서,
   width:fit-content + align-self:flex-start로 글자 크기만큼만 감싸게 고정함. */
.version-label {
    display: inline-block;
    width: fit-content;
    align-self: flex-start;
    white-space: nowrap;
    color: #9d63f0;
    background: rgba(157, 99, 240, 0.12);
    border: 1px solid rgba(157, 99, 240, 0.4);
    font-weight: 600;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 999px;
    margin-left: 0; /* 더 왼쪽으로 붙도록 (곡명 등 다른 줄과 왼쪽 끝이 맞게) */
    vertical-align: middle;
}


.logout-button {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}
.logout-button:hover {
    background-color: #d32f2f;
}


/* =================== 친구 탭 전용 스타일 =================== */
/* ===========================
   친구 탭 (버튼/입력창 크기 통일)
   - 전역 input{width:90%}, button{width:90%} 규칙이
     이 영역까지 새어 들어와서 크기가 제각각이었던 문제를 모두 width:auto로 고정
=========================== */
.friend-add-section, .friend-requests-section, .friend-list-section {
    background: #fff;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.friend-add-section h3,
.friend-requests-section h3,
.friend-list-section h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

.friend-add-section {
    display: flex;
    flex-wrap: wrap;          /* 좁은 화면에서는 줄바꿈 */
    align-items: center;
    gap: 8px;
}
.friend-add-section h3 {
    width: 100%;              /* 제목은 항상 한 줄 전체 차지 */
}
.friend-add-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}
.friend-add-heading-row h3 {
    width: auto;               /* 위의 전체 폭 규칙을 여기서만 풀어서 오른쪽에 내 아이디를 붙임 */
    margin: 0;
}
.my-id-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #888;
    flex: 0 0 auto;
}
.my-id-display strong {
    color: #333;
    font-size: 13px;
}

.friend-add-section input {
    width: 220px;
    max-width: 100%;
    flex: 0 1 220px;
    padding: 8px 10px;
    margin: 0;
    font-size: 14px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.friend-add-section button {
    width: auto;
    flex: 0 0 auto;
    padding: 8px 16px;
    margin: 0;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
}
.friend-add-section button:hover {
    background-color: #45a049;
}

.friend-add-section .error-message {
    flex-basis: 100%;         /* 메시지는 항상 새 줄에 표시 */
    width: auto;
    margin: 4px 0 0;
    text-align: left;
}

.incoming-request, .friend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    background: #fafafa;
    padding: 8px 10px;
    border-radius: 8px;
}
.incoming-request:last-child, .friend-item:last-child {
    margin-bottom: 0;
}
.incoming-request img, .friend-item img {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0;
}
.incoming-request .request-info, .friend-item .friend-info {
    flex: 1;
    min-width: 0;             /* 긴 이름/텍스트 줄바꿈 방지용 */
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
}
.incoming-request .request-info strong,
.friend-item .friend-info strong {
    font-size: 14px;
}
.friend-item .friend-name-link {
    cursor: pointer;
}
.friend-item .friend-name-link:hover {
    text-decoration: underline;
}

.incoming-request button,
.friend-item button {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
}
.incoming-request .accept-btn {
    background-color: #4CAF50;
    color: white;
}
.incoming-request .decline-btn {
    background-color: #f44336;
    color: white;
}
.friend-item .vs-btn {
    background-color: #2196F3;
    color: white;
}
.friend-item .delete-btn {
    background-color: #f44336;
    color: white;
}


.record-toggle-container {
    display: flex;
    flex-wrap: nowrap; 
    align-items: center; /* ✅ 수직 가운데 정렬 */
    gap: 8px;
  }
  
  .record-toggle-label {
    font-size: 14px;
    flex-wrap: nowrap;
    text-align: left !important; 
    color: #333;
    line-height: 1;
    padding-top: 1px;     /* ✅ 미세하게 내려줌 */
    display: inline-block;
  }
  
  .record-toggle-switch {
    position: relative;
    width: 50px !important;
    height: 18px !important;
    display: inline-block;
    flex-shrink: 0;
  }
  
  .record-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  .record-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 999px;
  }
  
  .record-slider:before {
    content: "";
    position: absolute;
    height: 14px !important;
    width: 14px !important;
    left: 2px;
    top: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
  }
  
  .record-toggle-switch input:checked + .record-slider {
    background-color: #9d63f0;
  }
  
  .record-toggle-switch input:checked + .record-slider:before {
    transform: translateX(32px);
  }
  
/* ───────────────────────────────
   세부 판정 기록 모달
─────────────────────────────── */
.note-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 16px;
}
.note-modal-box {
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  width: 560px; max-width: 98vw;
  max-height: 90vh; max-height: 90dvh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  overflow: hidden;
}
.note-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.note-modal-title {
  font-size: 1rem; font-weight: 800; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; margin-right: 12px;
}
.note-modal-close {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.1);
  border: none; border-radius: 8px;
  color: #fff; cursor: pointer;
  font-size: 1rem; display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 0; padding: 0;
}
.note-modal-close:hover { background: rgba(255,255,255,0.2); }
.note-modal-body {
  overflow-y: auto; padding: 16px 20px;
  flex: 1;
}
.note-modal-loading, .note-modal-empty {
  text-align: center; color: rgba(255,255,255,0.45);
  padding: 32px 0; font-size: 0.9rem; line-height: 1.8;
}
.note-record-item {
  background: rgba(255,255,255,0.05);
  border-radius: 12px; padding: 14px;
  margin-bottom: 12px;
}
.note-record-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.note-record-rate {
  font-size: 1.3rem; font-weight: 900;
  background: linear-gradient(45deg,#ffeb3b,#ff9800);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.note-record-date {
  font-size: 0.78rem; color: rgba(255,255,255,0.4);
}
.note-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.82rem;
}
.note-table th, .note-table td {
  padding: 5px 8px; text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
}
.note-table th { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.7); }
.note-table .note-loss { color: #ff8a65; font-weight: 700; font-size: 0.7rem; white-space: nowrap; }
.note-table .loss-h { color: #ff8a65; }
.note-table .note-loss-total td { background: rgba(255,138,101,0.08); }
.note-table .note-loss-total .note-loss { font-size: 0.78rem; }
.note-table .nt { color: rgba(255,255,255,0.6); font-weight: 700; text-align: left; }
.note-table .nc { font-size: 0.72rem; }
.note-table .crit  { background: rgba(255,249,196,0.15); color: #fff9c4; }
.note-table .perf  { background: rgba(255,235,59,0.15);  color: #ffeb3b; }
.note-table .great { background: rgba(248,187,217,0.15); color: #f8bbd9; }
.note-table .good  { background: rgba(165,214,167,0.15); color: #a5d6a7; }
.note-table .miss  { background: rgba(117,117,117,0.15); color: #bbb; }
.note-table td { color: #eee; }

/* ─── 세부기록 목록 hover ─── */
.note-list-item:hover { background: rgba(255,255,255,0.1) !important; }

/* 세부기록 모달 버튼 크기 고정 */
.note-delete-btn,
.note-back-btn,
.note-analyzer-btn {
  width: auto !important;
  margin-top: 0 !important;
}
/* ===========================
   숙제(챌린지) 탭
=========================== */
.challenge-hint {
    color: #888;
    font-size: 13px;
    margin-bottom: 14px;
}
.challenge-hint-inline {
    color: #999;
    font-size: 12px;
    font-weight: 400;
}
/* 세트 카드를 펼쳤을 때 맨 위에 뜨는 곡 정렬 드롭다운 (세트별로 독립적으로 기억됨) */
.card-sort-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.card-sort-row label {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
}
.card-sort-select {
    max-width: 180px;
    font-size: 12px;
    padding: 4px 6px;
}
/* 세트 "목록" 자체를 달성도 순으로 정렬하는 드롭다운 (목록 맨 위에 한 번만 표시) */
.set-sort-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.set-sort-row label {
    font-size: 13px;
    color: #666;
    font-weight: 600;
    white-space: nowrap;
}
.set-sort-select {
    max-width: 200px;
    font-size: 13px;
    padding: 5px 8px;
}
.challenge-subtab-menu {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.challenge-subtab-link {
    padding: 6px 14px;
    background: #f5f5f5;
    color: #555;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.challenge-subtab-link.active {
    background: #ff77b2;
    color: #fff;
}
.challenge-subtab-content { display: none; }

.challenge-form-box {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.challenge-form-box h3 { margin-top: 0; }
.challenge-form-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0;
}
.challenge-form-row label {
    font-size: 13px;
    color: #555;
    min-width: 70px;
}
.challenge-form-row input[type="text"],
.challenge-form-row input[type="number"] {
    flex: 1;
    min-width: 160px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}
.challenge-form-row select {
    padding: 6px;
    border-radius: 5px;
    border: 1px solid #ccc;
}
.challenge-form-box > button {
    width: auto;
    padding: 8px 18px;
    margin-top: 4px;
}
.challenge-form-msg {
    font-size: 13px;
    color: #ff3366;
    min-height: 16px;
}

/* 숙제/목표 등록용 곡 검색 결과 — 기록 탭의 record-block과 동일한 형식으로 표시 */
.song-search-results {
    max-height: 340px;
    overflow-y: auto;
    border-radius: 6px;
    padding: 2px;
}
.song-search-empty,
.song-search-more-hint {
    padding: 10px;
    font-size: 13px;
    color: #999;
    text-align: center;
}

/* record-block 재사용 + 선택용 커서/선택 표시만 추가 */
.song-pick-block {
    cursor: pointer;
    border: 2px solid transparent;
}
.song-pick-block.is-selected {
    border-color: #ff77b2;
    background: #fff0f6;
}

.song-pick-diff-tag {
    display: inline-block;
    align-self: flex-start;   /* record-info(flex column)의 기본 stretch를 막아 텍스트 크기만큼만 차지 */
    width: auto;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    padding: 1px 8px;
    border-radius: 8px;
    margin-top: 2px;
}
.basic-diff-tag     { background: #78c954; }
.advanced-diff-tag  { background: #f0b300; }
.expert-diff-tag    { background: #ff6060; }
.master-diff-tag    { background: #9d63f0; }
.remaster-diff-tag  { background: #b98cf2; }

.song-picked-info {
    margin-top: 8px;
    padding: 8px 10px;
    background: #fdf1f6;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
}
.song-picked-info .picked-song-name { font-weight: 700; font-size: 14px; color: #333; }
.song-picked-info .picked-type-diff { margin-left: 6px; color: #ff77b2; font-weight: 600; }

.challenge-grade-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 6px;
}
.grade-preset-btn {
    width: auto;
    padding: 3px 10px;
    font-size: 12px;
    background: #eee;
    color: #333;
    border-radius: 14px;
    margin: 0;
}
.grade-preset-btn:hover { background: #ffccde; }

.diff-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 8px;
}
.diff-filter-btn {
    width: auto;
    padding: 3px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 14px;
    border: 2px solid transparent;
    background: #eee;
    color: #888;
    margin: 0;
    cursor: pointer;
}
.diff-filter-btn.basic-diff-filter    { color: #78c954; }
.diff-filter-btn.advanced-diff-filter { color: #d69900; }
.diff-filter-btn.expert-diff-filter   { color: #ff6060; }
.diff-filter-btn.master-diff-filter   { color: #9d63f0; }
.diff-filter-btn.remaster-diff-filter { color: #b98cf2; }

.diff-filter-btn.basic-diff-filter.is-active    { background: #78c954; color: #fff; border-color: #78c954; }
.diff-filter-btn.advanced-diff-filter.is-active { background: #f0b300; color: #fff; border-color: #f0b300; }
.diff-filter-btn.expert-diff-filter.is-active   { background: #ff6060; color: #fff; border-color: #ff6060; }
.diff-filter-btn.master-diff-filter.is-active   { background: #9d63f0; color: #fff; border-color: #9d63f0; }
.diff-filter-btn.remaster-diff-filter.is-active { background: #b98cf2; color: #fff; border-color: #b98cf2; }

.assignee-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.assignee-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 14px;
    cursor: pointer;
}

.challenge-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.challenge-card {
    background: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-left: 4px solid #ccc;
}
.challenge-card.is-done { border-left-color: #4CAF50; }
.challenge-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.challenge-card-jacket {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.challenge-song-info { flex: 1; min-width: 0; }
.challenge-song-info strong { font-size: 15px; }
.challenge-diff-tag {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}
.challenge-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
}
.challenge-badge.done { background: #e6f7e9; color: #2e9e47; }
.challenge-badge.pending { background: #f5f5f5; color: #888; }
.challenge-target-line, .challenge-current-line {
    font-size: 13px;
    color: #555;
    margin-top: 6px;
}
.challenge-cond {
    display: inline-block;
    font-size: 11px;
    background: #f0e6ff;
    color: #7a4cc0;
    border-radius: 8px;
    padding: 1px 6px;
    margin-left: 4px;
}
.challenge-by {
    font-size: 12px;
    color: #ff77b2;
    font-weight: 600;
    margin-top: 6px;
}
.challenge-note-text {
    font-size: 12px;
    color: #777;
    margin-top: 6px;
    font-style: italic;
}
.challenge-del-btn {
    width: auto;
    padding: 4px 10px;
    font-size: 11px;
    background: #f44336;
    margin-top: 8px;
}

/* ===========================
   숙제 세트(homework set) — 여러 곡을 하나로 묶어서 관리
=========================== */
.challenge-subheading {
    margin: 18px 0 6px;
    font-size: 14px;
    color: #555;
}

/* 세트 만들기 2단계 마법사 */
.set-wizard-active-header {
    background: #fdf1f6;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 6px;
    font-size: 14px;
}
.set-wizard-active-header .admin-set-note {
    margin-left: 8px;
}
.set-wizard-final-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}
.set-wizard-final-actions button {
    width: auto;
    margin: 0;
}
/* 마법사 안 버튼들은 .challenge-form-box 의 직계 자식이 아니라 이제 전역 button{width:90%}가
   새어 들어올 수 있으므로, 각 버튼을 ID로 명시해 크기를 고정한다 */
#createSetBtn, #addToSetBtn, #saveSetBtn {
    width: auto;
    padding: 8px 18px;
    margin-top: 4px;
}
.secondary-btn {
    background: #e0e0e0 !important;
    color: #555 !important;
}
.secondary-btn:hover {
    background: #cfcfcf !important;
}

/* 관리자용 곡 카트(여러 곡 담기) */
.song-cart-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.song-cart-empty {
    padding: 14px;
    text-align: center;
    color: #999;
    font-size: 13px;
}
.song-cart-item {
    cursor: default;
    position: relative;
    padding-right: 70px; /* 삭제 버튼 자리 확보 */
}
.song-cart-remove-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 5px 10px;
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    background: #f44336;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* 세트 하나 = 카드 하나 */
.admin-sets-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.admin-set-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.admin-set-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}
.admin-set-name { font-size: 16px; }

/* 숙제 세트 아코디언 토글 (이름만 보이다가 누르면 곡 목록이 펼쳐짐) — 공용 */
.hw-set-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    user-select: none;
}
.hw-set-toggle:hover { opacity: 0.85; }
.hw-set-toggle-arrow {
    font-size: 11px;
    color: #999;
    transition: transform 0.15s ease;
}
.hw-set-body { margin-top: 10px; }
.admin-set-note {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}
.admin-set-delete-btn {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
    padding: 6px 12px;
    font-size: 12px;
    background: #f44336;
}
.admin-set-share-btn {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
    padding: 6px 12px;
    font-size: 12px;
    background: #4c8bf5;
}
.admin-set-copy-btn {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
    padding: 6px 12px;
    font-size: 12px;
    background: #4caf50;
}

.admin-set-items {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.admin-set-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 10px;
    background: #fafafa;
    border-radius: 6px;
    font-size: 13px;
}
.admin-set-item-song { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.admin-set-item-target { color: #777; flex: 1; }
.admin-set-item-jacket {
    width: 32px;
    height: 32px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
    vertical-align: middle;
}
.admin-set-item-del-btn {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
    padding: 4px 10px;
    font-size: 11px;
    background: #f44336;
}

/* 진행 현황 매트릭스: 곡 × 사람 한눈에 보기 */
.set-progress-table-wrap {
    margin-top: 14px;
    overflow-x: auto;
}
.set-progress-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.set-progress-table th,
.set-progress-table td {
    padding: 6px 10px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}
.set-progress-table th {
    color: #888;
    font-weight: 600;
    font-size: 12px;
}
.set-progress-song {
    text-align: left !important;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.diff-mini {
    font-size: 10px;
    color: #999;
    margin-left: 4px;
}
.set-progress-table td.is-done { background: #e6f7e9; }
.set-progress-ach {
    display: inline-block;
    font-size: 11px;
    color: #888;
    margin-right: 4px;
}
.set-progress-table td.is-done .set-progress-ach { color: #2e9e47; font-weight: 600; }

.admin-set-assignees {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.admin-set-assignee-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 12px;
}
.admin-set-unassign-btn {
    width: auto;
    margin: 0;
    padding: 0 4px;
    font-size: 11px;
    background: transparent;
    color: #f44336;
    border: none;
}

.admin-set-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}
.admin-set-toggle-btn {
    width: auto;
    margin: 0;
    padding: 6px 12px;
    font-size: 12px;
    background: #9d63f0;
}
.admin-set-toggle-btn:hover { background: #7a4cc0; }

.admin-set-inline-panel {
    margin-top: 12px;
    padding: 12px;
    background: #fdf1f6;
    border-radius: 8px;
}
.inline-add-target-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}
.inline-add-target-row input,
.inline-add-target-row select {
    margin: 0;
    padding: 6px 8px;
    font-size: 13px;
    border-radius: 5px;
    border: 1px solid #ccc;
}
.inline-add-target-row input { width: 140px; }
.inline-add-presets { margin-bottom: 8px; }
.inline-add-msg {
    font-size: 12px;
    color: #ff3366;
    min-height: 14px;
    margin: 6px 0 0;
}
.inline-assign-btn {
    width: auto;
    margin-top: 4px;
    padding: 6px 14px;
    font-size: 13px;
    background: #4CAF50;
}
.inline-assignee-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

/* 내 숙제(배정받은 세트) 카드 */
.my-hw-sets-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.my-hw-set-card {
    background: #fff;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.my-hw-set-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.my-hw-set-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    cursor: pointer;
}
.my-hw-set-header strong { font-size: 16px; }
.my-hw-set-delete-btn {
    width: auto;
    margin: 0;
    padding: 6px 12px;
    font-size: 12px;
    background: #f44336;
    flex: 0 0 auto;
}
.my-hw-set-progress {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #9d63f0;
    padding: 3px 10px;
    border-radius: 12px;
}
.my-hw-set-from {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}
.my-hw-set-items {
    margin-top: 12px;
}

/* ===========================
   관리자: 세트별 보기 / 사람별 보기 토글 + 사람별 카드
=========================== */
.admin-view-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.admin-view-heading { margin: 0; }
.admin-view-toggle {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}
.admin-view-toggle-btn {
    width: auto;
    margin: 0;
    padding: 6px 14px;
    font-size: 13px;
    background: #f0f0f0;
    color: #666;
}
.admin-view-toggle-btn.active {
    background: #9d63f0;
    color: #fff;
}

.admin-by-person-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.admin-person-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.admin-person-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.admin-person-name { font-size: 16px; }
.admin-person-total-progress {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #9d63f0;
    padding: 3px 10px;
    border-radius: 12px;
}
.admin-person-set-block {
    margin-top: 12px;
    padding-top: 10px;
}
.admin-person-set-block:not(:first-of-type) {
    border-top: 1px dashed #eee;
}
.admin-person-set-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 6px;
}
.admin-person-set-progress {
    font-size: 11px;
    color: #9d63f0;
    font-weight: 700;
    background: #f6f0fd;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ===========================
   자유 목표: 사람 선택 칩 목록
=========================== */
.free-goals-person-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 16px;
}
.free-goals-person-chip {
    width: auto;
    margin: 0;
    padding: 7px 14px;
    font-size: 13px;
    background: #f0f0f0;
    color: #555;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.free-goals-person-chip.active {
    background: #9d63f0;
    color: #fff;
}
.free-goals-person-count {
    font-size: 11px;
    font-weight: 700;
    background: rgba(0,0,0,0.08);
    padding: 1px 7px;
    border-radius: 10px;
}
.free-goals-person-chip.active .free-goals-person-count {
    background: rgba(255,255,255,0.25);
}

/* ===========================
   업적 탭: 레벨별 달성률 바
=========================== */
.achievement-levels-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
}
.level-achievement {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.level-title {
    font-size: 17px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 10px;
}
.achv-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.achv-bar-row:last-of-type { margin-bottom: 0; }
.achv-bar-label {
    flex: 0 0 66px;
    font-size: 11px;
    font-weight: 700;
    color: #666;
}
.achievement-bar {
    position: relative;
    flex: 1;
    height: 22px;
    background: #f0f0f0;
    border-radius: 11px;
    overflow: hidden;
}
.achievement-bar .progress {
    height: 100%;
    background: #9d63f0;
    border-radius: 11px;
    transition: width 0.3s ease;
}
.achievement-bar .progress.bar-play     { background: #6db4f2; }
.achievement-bar .progress.bar-s        { background: #8bc98f; }
.achievement-bar .progress.bar-splus    { background: #5fae8f; }
.achievement-bar .progress.bar-ss       { background: #d7c34a; }
.achievement-bar .progress.bar-ssplus   { background: #e0a83a; }
.achievement-bar .progress.bar-sss      { background: #f5a623; }
.achievement-bar .progress.bar-sssplus  { background: linear-gradient(90deg,#ff6ec4,#9d63f0); }
.achievement-bar .progress.bar-ap       { background: #7ec9e0; }
.achievement-bar .progress.bar-applus   { background: linear-gradient(90deg,#4fd1e8,#7a5cf0); }
.achievement-bar .progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #333;
    text-shadow: 0 1px 2px rgba(255,255,255,0.6);
    white-space: nowrap;
}
.toggle-thresholds {
    width: auto;
    margin-top: 10px;
    padding: 6px 14px;
    font-size: 12px;
    background: #f0f0f0;
    color: #666;
}
.toggle-thresholds:hover { background: #e4e4e4; }
.achv-detail-list {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #eee;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.achv-detail-block { padding-left: 4px; }
.achv-detail-title {
    font-size: 13px;
    font-weight: 700;
    color: #9d63f0;
    margin-bottom: 6px;
}

/* ─── 기록 탭: 필터 패널 ─── */
.record-filter-panel { margin: 10px 0 16px; }
.filter-toggle-btn {
    width: auto;
    padding: 8px 16px;
    margin: 0;
    background: #f0f0f0;
    color: #555;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.filter-toggle-btn:hover { background: #e4e4e4; }
.filter-toggle-btn.active { background: #ecdcfb; color: #7b1fa2; }
.record-filter-body {
    margin-top: 10px;
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.filter-group-title {
    font-size: 13px;
    font-weight: 700;
    color: #555;
    margin-bottom: 8px;
}
.filter-checkbox-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.filter-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f5f5f7;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    user-select: none;
}
.filter-checkbox input { width: auto; margin: 0; cursor: pointer; }
.filter-checkbox.checked { background: #f3e5f9; border-color: #9c27b0; color: #7b1fa2; font-weight: 700; }
.filter-range-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.82rem;
    color: #777;
}
.filter-range-input {
    width: 90px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 13px;
}
.filter-select {
    padding: 6px 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 13px;
}
.filter-reset-btn { width: auto; align-self: flex-start; padding: 8px 16px; margin: 0; }

/* ══════════════════════════════════════════════════════════
   반응형 (모바일/태블릿)
   -- 이 파일의 다른 모든 규칙보다 뒤에 위치해야 우선순위를 가짐
      (동일 우선순위일 때는 미디어쿼리 여부와 무관하게 소스 순서가
      나중인 규칙이 이기기 때문) --
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .container { padding: 0 10px; }

    /* 탭 메뉴: 항목이 많아지므로 가로 스크롤로 전환 (줄바꿈되어 세로로 길어지는 것 방지) */
    .tab-menu {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        margin-bottom: 14px;
        gap: 8px;
    }
    .tab-link { white-space: nowrap; flex-shrink: 0; }
}

@media (max-width: 600px) {
    body { padding: 0 4px; }
    .container { padding: 0 6px; }

    /* ── 프로필 섹션 ── */
    .profile-section { flex-direction: column; align-items: stretch; padding: 14px; }
    .profile-left { gap: 10px; }
    .profile-pic { width: 84px; height: 84px; }
    .username { font-size: 1.1rem; }
    .rating-container { min-width: 0; height: 40px; }
    .rating { font-size: 1.3rem; padding-left: 60px; letter-spacing: 2px; }
    .friend-code { font-size: 11px; flex-wrap: wrap; }

    /* ── 탭 메뉴 ── */
    .tab-link { font-size: 0.75rem; padding: 6px 10px; }

    /* ── 정렬/검색 ── */
    .sort-search-container { flex-direction: column; align-items: stretch; gap: 10px; }
    .sort-controls { flex-wrap: wrap; }
    .sort-controls label { width: auto; text-align: left; }
    .search-container { width: 100%; }
    .search-container input { width: 100%; box-sizing: border-box; }

    /* ── 난이도별 카드 그리드 (레이팅 탭): 고정폭(170px) 카드는 그대로 두고
       grid 대신 flex-wrap으로 화면 폭에 맞게 줄바꿈되게 전환 ── */
    .cards {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    /* ── 기록 목록 (히스토리/전곡 목록) ── */
    .record-block { padding: 8px; gap: 4px; min-height: 64px; }
    .record-jacket { width: 58px; height: 58px; margin-right: 6px; }
    .record-constant-box { width: 38px; height: 58px; min-height: 58px; font-size: 13px; margin-right: 10px; }
    .record-marks { margin-left: 4px; }
    .record-clear-mark, .record-sync-mark { width: 28px; height: 27px; }
    .record-song-name { font-size: 13px; margin-top: 0; }
    .record-song-score { font-size: 13px; }
    .record-rank { font-size: 12px; }
    .record-rate { font-size: 11px; }
    .record-stats { flex-wrap: wrap; gap: 6px; }

    /* ── 모달 ── */
    .modal-box { padding: 18px; width: 92%; }
    .note-modal-box { width: 96vw; max-height: 94vh; max-height: 94dvh; }
    .note-table { font-size: 0.7rem; }
    .note-table th, .note-table td { padding: 3px 4px; }

    /* ── 업적 탭 ── */
    .achv-bar-row { gap: 6px; }
    .achv-bar-label { flex-basis: 58px; font-size: 11px; }
    .achievement-bar .progress-text { font-size: 10px; }
    .level-achievement { padding: 12px; }

    /* ── 공유 탭 ── */
    .share-url-box { flex-direction: column; }
    .share-url-box input, .share-url-box button { width: 100%; box-sizing: border-box; }
    .level-summary-checkboxes { gap: 6px; }

    /* ── 도전과제(챌린지) ── */
    .challenge-list { grid-template-columns: 1fr; }
    .challenge-form-row label { min-width: 0; width: 100%; }
    .challenge-form-row input[type="text"],
    .challenge-form-row input[type="number"] { min-width: 0; }

    /* ── 친구 추가/목록 ── */
    .friend-add-section input { width: 100%; flex-basis: 100%; }

    /* ── 관리자(숙제 세트) ── */
    .admin-view-toggle-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .set-progress-table th, .set-progress-table td { padding: 4px 6px; font-size: 12px; }

    /* ── 북마클릿/코드 박스 ── */
    .bookmarklet-code-row { flex-direction: column; align-items: stretch; }

    /* ── 기록 탭 필터 패널 ── */
    .record-filter-body { padding: 12px; gap: 12px; }
    .filter-range-row { flex-wrap: wrap; }
    .filter-range-input { width: 80px; }

    /* ── 공유 탭 미리보기 ── */
    .share-preview-img { max-width: 100%; }
}

@media (max-width: 380px) {
    .cards .advanced-card-container,
    .cards .basic-card-container,
    .cards .expert-card-container,
    .cards .master-card-container,
    .cards .remaster-card-container {
        transform: scale(0.9);
        margin: -6px -9px;
    }
}

/* ─── 스크롤 여유 공간 — 세트 목록 등이 화면 딱 맞게 끝나서 답답하지 않도록 아래쪽에 여백 추가 ─── */
.container {
    padding-bottom: 140px;
}

/* ─── 숙제/목표 세트 카드 — "펼치기 전엔 네모 타일 2개씩, 펼치면 한 줄 전체" 그리드 레이아웃 ─── */
.admin-set-cards,
.my-goal-set-cards,
.free-goals-set-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
}
.admin-set-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.admin-set-card.expanded {
    grid-column: 1 / -1;
}
.admin-set-card .admin-set-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.admin-set-card .admin-set-name {
    display: block;
    word-break: break-word;
}
@media (max-width: 420px) {
    .admin-set-cards,
    .my-goal-set-cards,
    .free-goals-set-cards {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .admin-set-card {
        padding: 12px;
    }
}

/* 공유/삭제 버튼을 하나의 그룹으로 묶어서 서로 붙어 보이게 함 (space-between인
   .admin-set-header에 title-row와 이 그룹, 딱 2개의 자식만 있게 되어 버튼끼리 떨어지지 않음) */
.admin-set-header-btns {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}
.admin-set-header-btns .admin-set-share-btn,
.admin-set-header-btns .admin-set-copy-btn,
.admin-set-header-btns .admin-set-delete-btn {
    margin: 0;
}

.admin-set-assignee-chip.is-pending {
    background: #fff4dd;
    color: #a06a00;
    border: 1px dashed #e0b060;
}

/* ─── "세트 생성" 등 폼 버튼을 짧게, 한쪽으로 정렬 ─── */
.form-actions-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}
.btn-compact {
    width: auto;
    padding: 8px 22px;
}
.form-box-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.form-box-header-row h3 { margin: 0; }
.form-box-header-row button {
    margin-top: 0;
    font-size: 12px;
    padding: 7px 12px;
    white-space: nowrap;
}

/* ─── 받은 숙제 요청 (수락/거절 대기) ─── */
.pending-hw-requests-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}
.pending-hw-request-card {
    background: #fffaf0;
    border: 1px solid #f0d9a0;
    border-radius: 10px;
    padding: 12px 14px;
}
.pending-hw-request-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.pending-hw-request-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
    cursor: pointer;
}
.pending-hw-request-info .hw-set-toggle-arrow {
    color: #c99a3a;
}
.pending-hw-request-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}
.pending-hw-request-actions button {
    width: auto;
    padding: 6px 16px;
}
.pending-hw-accept-btn { background: #4CAF50; }
.pending-hw-decline-btn { background: #999; }
.pending-hw-request-card .hw-set-body {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e0c98a;
}

/* ─── 곡 목록 보기 방식 토글(액자식/그리드) — 탭마다 하나씩(자유 목표/받은 숙제/내가 낸 숙제),
   .admin-view-toggle-row 안에 붙여서 오른쪽에 배치함. 클래스는 .admin-view-toggle-btn과
   따로 둬서(디자인만 동일하게) 기존 세트별/사람별 토글의 클릭 핸들러(document 전체에서
   .admin-view-toggle-btn을 찾아 active를 지웠다 켜는 방식)와 서로 간섭하지 않게 함. ─── */
.admin-view-toggle-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.song-list-view-btn {
    width: auto;
    margin: 0;
    padding: 6px 14px;
    font-size: 13px;
    background: #f0f0f0;
    color: #666;
}
.song-list-view-btn.active {
    background: #9d63f0;
    color: #fff;
}
/* 그리드(한 줄 목록) 행에 현재 기록/완료 뱃지를 붙일 때 쓰는 미니 스타일 */
.admin-set-item-current {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
}
.challenge-badge.mini {
    font-size: 11px;
    padding: 2px 8px;
}

/* 세부 기록 모달 하단: 갱신 방법 안내 버튼 */
.note-modal-footer {
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  flex-shrink: 0;
}
.note-howto-btn {
  padding: 9px 16px;
  background: rgba(157,99,240,0.22);
  border: 1px solid rgba(157,99,240,0.55);
  border-radius: 10px;
  color: #e5d6ff;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0;
  width: auto;
}
.note-howto-btn:hover { background: rgba(157,99,240,0.38); }

/* 세부 기록 모달 - 직접 입력 버튼 + 입력 화면(iframe) */
.note-custom-btn {
  padding: 6px 12px;
  margin: 0 8px 0 0;
  width: auto;
  background: rgba(76,175,80,0.2);
  border: 1px solid rgba(76,175,80,0.55);
  border-radius: 8px;
  color: #b9f6ca;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}
.note-custom-btn:hover { background: rgba(76,175,80,0.35); }
.custom-input-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  display: none; align-items: center; justify-content: center;
  z-index: 10002;
  padding: 12px;
}
.custom-input-box {
  position: relative;
  width: 1120px; max-width: 100%;
  height: 92vh;
  background: #0a0a0a;
  border-radius: 14px;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7);
}
.custom-input-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; flex-shrink: 0;
  background: #1a1a2e; color: #fff; font-size: 0.85rem; font-weight: 800;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.custom-input-box iframe { width: 100%; flex: 1; border: 0; display: block; min-height: 0; }
.custom-input-close {
  padding: 5px 12px; margin: 0; width: auto;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px; color: #fff; cursor: pointer;
  font-size: 0.8rem; font-weight: 700;
}

/* 세부 기록 목록: 선택 삭제 툴바 / 이름 수정 */
.note-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.note-toolbar-all { font-size: 0.82rem; color: #fff; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.note-toolbar-count { font-size: 0.78rem; color: rgba(255,255,255,0.55); flex: 1; }
.note-toolbar-btn {
  padding: 6px 12px; margin: 0; width: auto;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px; color: #fff; cursor: pointer; font-size: 0.78rem; font-weight: 700;
}
.note-toolbar-btn.danger { background: rgba(239,68,68,0.28); border-color: rgba(239,68,68,0.6); color: #fecaca; }
.note-toolbar-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.note-mini-btn {
  padding: 4px 8px; margin: 0 0 0 8px; width: auto; flex-shrink: 0;
  background: rgba(255,255,255,0.1); border: none; border-radius: 7px;
  color: #fff; cursor: pointer; font-size: 0.75rem; white-space: nowrap;
}
.note-mini-btn.ok { background: rgba(76,175,80,0.45); }

/* ===========================
   업적 탭 개편 (레벨별/버전별 바 + 난이도표)
=========================== */
.achievement-container { --achv-empty: #e6e8ee; }
.achv-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
    margin-bottom: 10px;
}
.achv-switch {
    display: inline-flex; background: #eceef3; border-radius: 10px; padding: 3px;
}
.achv-switch button {
    border: 0; background: transparent; padding: 7px 16px; border-radius: 8px;
    font-size: 13px; font-weight: 700; color: #667; cursor: pointer;
}
.achv-switch button.active { background: #fff; color: #1a1a2e; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.achv-filter { display: flex; align-items: center; gap: 8px; }
.achv-filter-label, .achv-minconst { font-size: 12px; font-weight: 700; color: #667; }
.achv-fchips { display: flex; gap: 4px; flex-wrap: wrap; }
.achv-fchip {
    border: 1px solid #d5d8e0; background: #fff; border-radius: 14px; padding: 4px 10px;
    font-size: 12px; font-weight: 700; color: #667; cursor: pointer;
}
.achv-fchip.active { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }
.achv-minconst select { margin-left: 4px; padding: 5px 8px; border-radius: 8px; border: 1px solid #d5d8e0; }

.achv-legend {
    display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px;
    font-size: 11px; color: #667;
}
.achv-legend-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.achv-legend-group b { width: 44px; color: #333; }
.achv-chip { display: inline-flex; align-items: center; gap: 4px; }
.achv-chip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.achievement-levels-list.achv-mode-bars { gap: 0; margin-top: 0; }
.achv-group { background: #fff; border-bottom: 1px solid #eceef3; }
.achv-mode-bars > .achv-group:first-child { border-radius: 10px 10px 0 0; }
.achv-mode-bars > .achv-group:last-child { border-radius: 0 0 10px 10px; border-bottom: 0; }
.achv-group-head {
    display: grid; grid-template-columns: 190px 1fr 22px; align-items: center; gap: 14px;
    padding: 12px 16px;
}
.achv-group-head.has-children { cursor: pointer; }
.achv-group-head.has-children:hover { background: #f7f8fb; }
.achv-g-label { font-size: 20px; font-weight: 800; color: #1a1a2e; line-height: 1.15; }
.achv-g-sub { font-size: 11px; color: #889; margin: 2px 0 5px; }
.achv-g-avg { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #333; font-variant-numeric: tabular-nums; }
.achv-grade {
    display: inline-block; min-width: 38px; text-align: center; padding: 2px 8px;
    border-radius: 12px; color: #fff; font-size: 11px; font-weight: 800;
}
.achv-g-bars { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.achv-bar-line { display: flex; align-items: center; gap: 8px; }
.achv-bar-tag { flex: 0 0 38px; font-size: 10px; font-weight: 700; color: #99a; text-align: right; }
.achv-bar-track {
    flex: 1; height: 14px; display: flex; background: var(--achv-empty);
    border-radius: 7px; overflow: hidden; gap: 0;
}
.achv-seg { min-width: 2px; height: 100%; cursor: default; }
.achv-seg:hover { filter: brightness(1.15); }
.achv-seg + .achv-seg { box-shadow: -1px 0 0 rgba(255,255,255,.55); }
.achv-seg-empty { background: var(--achv-empty); }
.achv-chev { color: #99a; transition: transform .15s; text-align: center; }
.achv-group.open > .achv-group-head .achv-chev { transform: rotate(180deg); }
.achv-children { background: #fafbfd; border-top: 1px solid #eceef3; }
.achv-sub { background: transparent; }
.achv-sub .achv-group-head { padding: 8px 16px 8px 34px; grid-template-columns: 170px 1fr 22px; }
.achv-sub .achv-g-label { font-size: 15px; }
.achv-sub .achv-bar-track { height: 10px; border-radius: 5px; }
.achv-sub .achv-g-sub { margin-bottom: 2px; }

.achv-tip {
    position: fixed; z-index: 9999; display: none; pointer-events: none;
    background: rgba(20,20,35,.95); color: #fff; font-size: 12px; line-height: 1.5;
    padding: 7px 10px; border-radius: 8px; white-space: pre-line; max-width: 280px;
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
}

/* 난이도표 */
.achievement-levels-list.achv-mode-chart { gap: 0; margin-top: 0; }
.achv-ct-block {
    display: flex; gap: 14px; padding: 14px 16px; background: #fff;
    border-bottom: 1px solid #eceef3;
}
.achv-mode-chart > .achv-ct-block:first-child { border-radius: 10px 10px 0 0; }
.achv-mode-chart > .achv-ct-block:last-child { border-radius: 0 0 10px 10px; border-bottom: 0; }
.achv-ct-head { flex: 0 0 76px; }
.achv-ct-const { font-size: 22px; font-weight: 800; color: #1a1a2e; }
.achv-ct-count { font-size: 11px; color: #889; line-height: 1.4; }
.achv-ct-count span { color: #aab; }
.achv-ct-rows { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.achv-ct-row { display: flex; gap: 8px; align-items: flex-start; }
.achv-ct-rank {
    flex: 0 0 46px; min-height: 38px; border-radius: 8px; color: #fff; font-size: 12px; font-weight: 800;
    display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15;
    text-align: center; padding: 2px;
}
.achv-ct-rank small { font-size: 10px; font-weight: 600; opacity: .85; }
.achv-ct-tiles { flex: 1; display: flex; flex-wrap: wrap; gap: 3px; min-width: 0; }
.achv-tile {
    position: relative; width: 38px; height: 38px; border-radius: 5px; overflow: hidden;
    border: 2px solid #999; background: #222; flex: 0 0 auto;
}
.achv-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.achv-tile::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.05) 25%, rgba(0,0,0,.72));
}
.achv-tile.unplayed img { filter: grayscale(1) brightness(.75); }
.achv-tile.d-basic    { border-color: #3cb06a; }
.achv-tile.d-advanced { border-color: #f0a020; }
.achv-tile.d-expert   { border-color: #ee5a6a; }
.achv-tile.d-master   { border-color: #a24bd6; }
.achv-tile.d-re_master{ border-color: #e8c6fb; }
.achv-tile .t-type {
    position: absolute; top: 0; right: 0; z-index: 2; font-size: 7px; font-weight: 800; color: #fff;
    background: rgba(0,0,0,.6); padding: 0 2px; border-bottom-left-radius: 3px; line-height: 1.3;
}
.achv-tile .t-score {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; text-align: center;
    font-size: 8px; line-height: 1; font-weight: 700; color: #fff; letter-spacing: -.2px;
    text-shadow: 0 0 2px #000; padding-bottom: 1px; font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
    .achv-group-head { grid-template-columns: 1fr 18px; gap: 8px; padding: 10px 12px; }
    .achv-g-info { grid-column: 1 / 2; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
    .achv-g-sub { margin: 0; }
    .achv-g-bars { grid-column: 1 / 3; grid-row: 2; }
    .achv-chev { grid-column: 2; grid-row: 1; }
    .achv-sub .achv-group-head { grid-template-columns: 1fr 18px; padding-left: 20px; }
    .achv-ct-block { flex-direction: column; gap: 8px; padding: 12px; }
    .achv-ct-head { flex: none; display: flex; align-items: baseline; gap: 10px; }
    .achv-tile { width: 32px; height: 32px; }
    .achv-tile .t-score { font-size: 7px; }
    .achv-ct-rank { flex-basis: 40px; }
}
.achv-switch button, .achv-fchip { width: auto; margin: 0; flex: 0 0 auto; }
.achv-switch button { background: transparent; color: #667; }
.achv-switch button:hover { background: rgba(255,255,255,.6); }
.achv-switch button.active, .achv-switch button.active:hover { background: #fff; color: #1a1a2e; }
.achv-fchip { background: #fff; color: #667; padding: 4px 10px; border-radius: 14px; }
.achv-fchip:hover { background: #f1f2f6; }
.achv-fchip.active, .achv-fchip.active:hover { background: #1a1a2e; color: #fff; }
.achv-ct-rank { flex: 0 0 54px; white-space: nowrap; font-size: 11px; }
@media (max-width: 720px) { .achv-ct-rank { flex-basis: 48px; } }
.achv-minconst { display: flex; align-items: center; gap: 6px; }
.achv-minconst select, .achv-minconst input { padding: 5px 8px; border-radius: 8px; border: 1px solid #d5d8e0; font-size: 13px; width: auto; }
.achv-minconst input { width: 68px; }
.achv-tile { width: 50px; height: 50px; border-radius: 6px; }
.achv-tile .t-type { font-size: 8px; }
.achv-tile .t-score { font-size: 10px; line-height: 1.05; }
.achv-ct-rank { min-height: 50px; }
@media (max-width: 720px) {
    .achv-tile { width: 42px; height: 42px; }
    .achv-tile .t-score { font-size: 8.5px; }
    .achv-ct-rank { min-height: 42px; }
}
.achv-tile .sx-dot {
    position: absolute; top: 3px; left: 3px; z-index: 2; width: 9px; height: 9px;
    border-radius: 50%; border: 1px solid #fff;
}

/* 곡명이 너무 길면 한 줄로 … 처리 (마이마이 기록/히스토리/검색 카드 공통) */
.record-info { min-width: 0; }
.record-song-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 숙제/자유목표 탭: 곡 줄 안에서 버전 배지는 한 줄 인라인으로, 앞에 여백 */
.admin-set-item-song .version-label,
.set-progress-song .version-label { margin-left: 6px; vertical-align: middle; }
.challenge-song-info .version-label { margin-top: 3px; }

/* 도구 모달: 달성률 분석기 설명 사진 */
.tool-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 14px; }
.tool-shots figure { margin: 0; }
.tool-shots img { width: 100%; display: block; border-radius: 10px; border: 1px solid #ddd; }
.tool-shots figcaption { font-size: 12px; color: #666; line-height: 1.5; margin-top: 6px; }
@media (max-width: 560px) { .tool-shots { grid-template-columns: 1fr; } }


/* 세부기록 팝업 상단 요약 */
.note-summary { padding: 12px 18px 4px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.note-summary:empty { display: none; }
.ns-level { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ns-type { background: #fff; color: #111; font-size: 0.7rem; font-weight: 800; padding: 2px 6px; border-radius: 4px; }
.ns-diff { color: #fff; font-size: 0.78rem; font-weight: 800; padding: 2px 8px; border-radius: 4px; background: #8b5cf6; }
.ns-diff-basic { background: #3aa655; } .ns-diff-advanced { background: #e0a100; }
.ns-diff-expert { background: #e5484d; } .ns-diff-master { background: #9b5de5; }
.ns-diff-remaster, .ns-diff-re_master { background: #c9b6f2; color: #3b1d6e; }
.ns-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ns-grade { color: #fff; font-weight: 900; font-size: 0.95rem; padding: 3px 14px; border-radius: 999px; min-width: 64px; text-align: center; }
.ns-score { font-size: 1.9rem; font-weight: 800; line-height: 1; color: #fff; }
.ns-score small { font-size: 1.15rem; opacity: 0.7; font-weight: 700; }
.ns-chip { color: #fff; font-weight: 800; font-size: 0.8rem; padding: 3px 10px; border-radius: 999px; }
.ns-chip-sync { background: transparent; border: 1px solid rgba(255,255,255,0.35); color: rgba(255,255,255,0.8); }
.ns-dx { display: flex; align-items: center; gap: 8px; margin: 8px 0 10px; color: #fff; font-size: 0.95rem; }
.ns-star { font-weight: 800; font-size: 0.8rem; padding: 2px 14px; border-radius: 999px; color: #fff; }
.ns-dxpct { color: rgba(255,255,255,0.55); font-size: 0.8rem; }
.ns-empty { color: rgba(255,255,255,0.5); font-size: 0.85rem; padding-bottom: 10px; }

.ns-max { color: rgba(255,255,255,0.45); font-size: 0.8rem; font-weight: 700; }

/* 곡 블록 DX 스코어 */
.record-stats { flex-direction: column; align-items: flex-start; gap: 3px; }
.record-stats-row { display: flex; align-items: center; gap: 10px; }
.record-dx { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #555; line-height: 1.2; }
span.record-dx { display: inline-flex; vertical-align: middle; margin-left: 4px; }
.record-dx-pct { color: #999; font-size: 11px; }
.dx-chip { font-weight: 800; font-size: 11px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.dx-target-wrap { margin: 4px 0; }
.inline-add-dx { max-width: 140px; }
@media (max-width: 640px) { .record-stats-row { flex-wrap: wrap; gap: 6px; } }

.achv-tile .t-score .t-dim { color: #9aa1ab; font-weight: 600; }

.achv-bar-tag { white-space: nowrap; }

.achv-avg-label { font-size: 11px; font-weight: 600; color: #777; white-space: nowrap; }
.achv-g-avg-dx { margin-top: 2px; }
.achv-g-avg { flex-wrap: wrap; row-gap: 2px; }
.achv-group-head { grid-template-columns: 215px 1fr 22px; }
@media (max-width: 720px) { .achv-group-head { grid-template-columns: 1fr 18px; } }

.ns-max-toggle { cursor: pointer; border-bottom: 1px dotted rgba(255,255,255,0.35); user-select: none; }

/* ─── 세트 수정 모달 ─── */
.admin-set-header-btns .admin-set-edit-btn { margin: 0; }
.admin-set-edit-btn {
    width: auto; flex: 0 0 auto; margin: 0; padding: 6px 12px;
    font-size: 12px; background: #f08a24;
}
.set-edit-box { max-width: 720px; width: 94%; padding: 22px; display: flex; flex-direction: column; max-height: 90vh; }
.set-edit-box h3 { margin-bottom: 10px; }
.set-edit-scroll { overflow-y: auto; flex: 1 1 auto; min-height: 0; padding-right: 4px; }
.set-edit-meta { display: flex; flex-direction: column; gap: 6px; }
.set-edit-meta input, .set-edit-box .song-search-input {
    width: 100%; margin: 0; padding: 8px 10px; font-size: 14px;
    border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box;
}
.set-edit-section-title { font-size: 13px; font-weight: 700; color: #444; margin: 16px 0 6px; }
.set-edit-section-title span { font-weight: 400; color: #999; font-size: 11px; }
.set-edit-bulk { background: #fdf1f6; border-radius: 8px; padding: 10px; }
.set-edit-box .se-apply-all, .set-edit-box .set-edit-actions button {
    margin-top: 8px; padding: 7px 16px; font-size: 13px;
}
.set-edit-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.set-edit-actions button { margin-top: 0 !important; }
.set-edit-actions .se-cancel { background: #aaa; }
.set-edit-actions .se-save { background: #4CAF50; }
.se-row { border: 1px solid #e6e1ef; border-radius: 8px; padding: 8px; margin-bottom: 6px; background: #fff; }
.se-row-head { display: flex; align-items: center; gap: 8px; }
.se-jacket { width: 40px; height: 40px; border-radius: 5px; object-fit: cover; flex: 0 0 auto; }
.se-title { flex: 1 1 auto; min-width: 0; }
.se-song-name { font-size: 13px; font-weight: 700; color: #222; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.se-song-sub { display: flex; align-items: center; gap: 5px; margin-top: 2px; flex-wrap: wrap; }
.se-type { height: 14px; }
.se-const { font-size: 11px; color: #777; }
.set-edit-box .se-del {
    margin: 0; padding: 5px 10px; font-size: 12px; background: #e5484d; flex: 0 0 auto;
}
.se-row-targets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.se-row-targets input, .se-row-targets select {
    margin: 0; padding: 6px 8px; font-size: 13px; border: 1px solid #ccc; border-radius: 5px;
}
.se-row-targets input { width: 100px; }
.set-edit-box .song-pick-block.is-picked { opacity: .45; }
@media (max-width: 600px) {
    .set-edit-box { padding: 14px; }
    .se-row-targets input { width: calc(50% - 3px); box-sizing: border-box; }
    .se-row-targets select { flex: 1 1 calc(50% - 6px); }
}
/* .modal-box button 공통 스타일이 칩/필터 버튼 모양을 덮어쓰지 않게 되돌림 */
.set-edit-box .grade-preset-btn,
.set-edit-box .diff-filter-btn {
    margin: 0; border-radius: 14px; font-size: 12px; font-weight: 700;
}
.set-edit-box .grade-preset-btn { padding: 3px 10px; background: #eee; color: #333; font-weight: 600; }
.set-edit-box .grade-preset-btn:hover { background: #ffccde; }
.set-edit-box .diff-filter-btn { padding: 3px 12px; }
.set-edit-box .diff-filter-btn:not(.is-active) { background: #eee; }
.set-edit-box .diff-filter-row { margin: 8px 0; }
.set-edit-box .challenge-grade-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; font-size: 12px; color: #666; }
.set-edit-box .se-apply-all { margin-top: 6px; }
.set-edit-box .sdvx-challenge-score-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.admin-set-actions .admin-set-edit-btn { padding: 6px 14px; }

/* 난이도표 곡 자켓 왼쪽 위 콤보 마크 */
.achv-tile .t-combo {
    position: absolute; top: 0; left: 0; z-index: 2; font-size: 7px; font-weight: 800; color: #fff;
    padding: 0 2px; border-bottom-right-radius: 3px; line-height: 1.3; letter-spacing: -.2px;
    text-shadow: 0 0 2px rgba(0,0,0,.6);
}
@media (max-width: 720px) { .achv-tile .t-combo { font-size: 6px; padding: 0 1px; } }

/* 모바일에서도 레이팅 프레임/숫자를 PC와 같은 고정 크기로 */
@media (max-width: 600px) {
    .rating-container { min-width: 120px; width: max-content; height: 46px; flex: none; }
    .rating { font-size: 1.3rem; padding-left: 63px; letter-spacing: 3.3px; white-space: nowrap; }
}

/* ─── 서열표 ─── */
.achv-source { max-width: 100%; }
.achv-source .achv-switch { flex-wrap: wrap; }
.achv-source-admin { display: flex; gap: 6px; flex-wrap: wrap; }
.tier-admin-btn {
    width: auto; margin: 0; padding: 6px 12px; font-size: 12px; font-weight: 700;
    background: #f08a24; color: #fff; border: 0; border-radius: 8px; cursor: pointer;
}
.tier-block .tier-title { font-size: 1.1rem; }
.tier-empty { font-size: 12px; color: #999; padding: 8px 4px; }
.tier-missing { font-size: 12px; color: #c0392b; margin: 8px 0 0; }

/* 서열표 편집 */
.tier-edit-box { max-width: 860px; }
.te-name { width: 100%; margin: 0 0 4px; padding: 8px 10px; font-size: 14px; border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box; }
.te-tier { border: 1px solid #e6e1ef; border-radius: 8px; margin-bottom: 8px; background: #fff; overflow: hidden; }
.te-tier-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: #f7f5fb; }
.te-tier-head input[type=color] { width: 32px; height: 28px; padding: 0; border: 1px solid #ccc; border-radius: 5px; background: #fff; margin: 0; flex: 0 0 auto; }
.te-tier-head .te-tname { flex: 1 1 auto; min-width: 0; margin: 0; padding: 6px 8px; font-size: 14px; font-weight: 700; border: 1px solid #ccc; border-radius: 5px; }
.te-count { font-size: 12px; color: #777; flex: 0 0 auto; }
.tier-edit-box .te-tier-head button {
    margin: 0; padding: 4px 9px; font-size: 12px; background: #9aa1ab; flex: 0 0 auto;
}
.tier-edit-box .te-tier-head button:disabled { opacity: .35; cursor: default; }
.tier-edit-box .te-tier-head .te-del-tier { background: #e5484d; }
.te-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; min-height: 40px; }
.te-chip {
    position: relative; width: 62px; border: 2px solid #999; border-radius: 6px; overflow: hidden;
    background: #222; cursor: pointer; user-select: none;
}
.te-chip img, .te-chip .te-noimg { width: 100%; height: 58px; object-fit: cover; display: block; }
.te-chip .te-noimg { display: flex; align-items: center; justify-content: center; color: #fff; background: #555; }
.te-chip.d-basic { border-color: #3cb06a; } .te-chip.d-advanced { border-color: #f0a020; }
.te-chip.d-expert { border-color: #ee5a6a; } .te-chip.d-master { border-color: #a24bd6; }
.te-chip.d-re_master { border-color: #e8c6fb; }
.te-chip-type { position: absolute; top: 0; right: 0; font-size: 8px; font-weight: 800; color: #fff; background: rgba(0,0,0,.6); padding: 0 2px; border-bottom-left-radius: 3px; }
.te-chip-const { position: absolute; top: 0; left: 0; font-size: 8px; font-weight: 800; color: #fff; background: rgba(0,0,0,.6); padding: 0 2px; border-bottom-right-radius: 3px; }
.te-chip-name { display: block; font-size: 9px; line-height: 1.2; color: #fff; background: rgba(0,0,0,.8); padding: 2px 3px; height: 22px; overflow: hidden; }
.te-chip.sel { outline: 3px solid #4c8bf5; outline-offset: -1px; }
.te-chip.sel::after { content: '✓'; position: absolute; right: 2px; bottom: 24px; font-size: 14px; font-weight: 900; color: #fff; background: #4c8bf5; border-radius: 50%; width: 18px; height: 18px; line-height: 18px; text-align: center; }
.te-chip.missing { opacity: .6; border-style: dashed; }
.tier-edit-box .te-add-tier { margin: 0 0 6px; padding: 7px 14px; font-size: 13px; background: #6c7a96; }
.te-add-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 6px; font-size: 12px; color: #555; }
.te-add-row input, .te-add-row select { margin: 0; padding: 5px 7px; font-size: 13px; border: 1px solid #ccc; border-radius: 5px; }
.te-add-row input[type=number] { width: 70px; }
.te-selbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; margin-top: 6px;
    background: #eaf1ff; border-radius: 8px; font-size: 13px; font-weight: 700; color: #2b4a8a;
}
.te-selbar select { margin: 0; padding: 5px 7px; border: 1px solid #b8c8ea; border-radius: 5px; }
.tier-edit-box .te-selbar button { margin: 0; padding: 6px 12px; font-size: 12px; background: #4c8bf5; }
.tier-edit-box .te-selbar .te-remove { background: #e5484d; }
.tier-edit-box .te-selbar .te-unsel { background: #9aa1ab; }
.tier-edit-box .set-edit-actions { align-items: center; }
.tier-edit-box .te-delete-list { background: #e5484d; margin: 0; }
@media (max-width: 600px) { .te-chip { width: 56px; } .te-chip img, .te-chip .te-noimg { height: 52px; } }
.tier-levels { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.tier-levels .achv-fchip { width: auto; margin: 0; }
.te-levels { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.te-levels .achv-fchip { width: auto; margin: 0; }
.te-level-edit { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.te-level-edit .te-lname { flex: 1 1 auto; min-width: 0; margin: 0; padding: 6px 8px; font-size: 14px; font-weight: 700; border: 1px solid #ccc; border-radius: 5px; }
.tier-edit-box .te-level-edit button { margin: 0; padding: 5px 10px; font-size: 12px; background: #9aa1ab; flex: 0 0 auto; }
.tier-edit-box .te-level-edit button:disabled { opacity: .35; cursor: default; }
.tier-edit-box .te-level-edit .te-ldel { background: #e5484d; }
.tier-edit-box .achv-fchip { background: #fff; color: #667; padding: 4px 12px; margin: 0; }
.tier-edit-box .achv-fchip.active { background: #1a1a2e; color: #fff; }
.tier-edit-box .achv-fchip.te-add-level { background: #f0f2f7; }
/* 서열표 편집: 끌어서 순서 바꾸기 */
.te-chip { cursor: grab; }
.te-chip.dragging { opacity: .35; }
.te-chip.drop-before { box-shadow: -4px 0 0 0 #4c8bf5; }
.te-chip.drop-after { box-shadow: 4px 0 0 0 #4c8bf5; }
.te-chips.drop-end { background: #eaf1ff; }
.tier-edit-box .te-selbar .te-shift-l, .tier-edit-box .te-selbar .te-shift-r { background: #6c7a96; }
.te-hide-placed { display: block; font-size: 12px; color: #555; margin: 4px 0 6px; cursor: pointer; }
.te-hide-placed input { margin: 0 4px 0 0; vertical-align: middle; }
/* 검색 숨기기 체크박스: 전역 input/label 스타일 때문에 줄바꿈이 깨지던 것을 한 줄로 고정 */
.tier-edit-box .te-hide-placed {
    display: flex; align-items: center; gap: 6px; width: auto; margin: 6px 0 8px;
    font-size: 12px; color: #555; cursor: pointer; text-align: left;
}
.tier-edit-box .te-hide-placed input[type=checkbox] {
    width: 16px; height: 16px; min-width: 16px; margin: 0; padding: 0; flex: 0 0 auto;
}

/* ─── 난이도표 "체크" 표시 방식 ─── */
.achv-checkbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 10px;
    padding: 8px 12px; background: #fff3f3; border: 1px solid #f3c6c6; border-radius: 10px;
    font-size: 12px; font-weight: 700; color: #7a2b2b;
}
.achv-checkbar label { display: inline-flex; align-items: center; gap: 4px; margin: 0; width: auto; }
.achv-checkbar input[type=number] { width: 78px; margin: 0; padding: 5px 7px; font-size: 13px; border: 1px solid #d9b3b3; border-radius: 6px; }
.achv-checkbar select { margin: 0; padding: 5px 7px; font-size: 13px; border: 1px solid #d9b3b3; border-radius: 6px; width: auto; }
.achv-ck-title { flex: 1 1 100%; color: #b23a3a; }
.achv-ck-summary { flex: 1 1 100%; font-weight: 600; color: #8a5a5a; }
.achv-tile .t-check {
    position: absolute; inset: 2px; z-index: 3; border: 3px solid #ff2a2a; border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255,255,255,.55), inset 0 0 0 1px rgba(255,255,255,.35); pointer-events: none;
}
@media (max-width: 720px) { .achv-tile .t-check { border-width: 2px; inset: 1px; } }
.achv-ck-reset { width: auto; margin: 0; padding: 4px 10px; font-size: 12px; font-weight: 700; background: #b23a3a; color: #fff; border: 0; border-radius: 8px; cursor: pointer; }
.te-check { background: #fff3f3; border: 1px solid #f3c6c6; border-radius: 8px; padding: 8px 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; font-weight: 700; color: #7a2b2b; }
.te-check label { display: inline-flex; align-items: center; gap: 4px; margin: 0; width: auto; }
.te-check input[type=number] { width: 80px; margin: 0; padding: 5px 7px; font-size: 13px; border: 1px solid #d9b3b3; border-radius: 6px; }
.te-check select { margin: 0; padding: 5px 7px; font-size: 13px; border: 1px solid #d9b3b3; border-radius: 6px; width: auto; }
.te-check-presets { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.tier-edit-box .te-check-presets button { margin: 0; padding: 4px 12px; font-size: 12px; background: #b23a3a; border-radius: 14px; }
.tier-edit-box .te-check-presets button[data-ck="clear"] { background: #9aa1ab; }

/* 체크 모드: 두 번째 기준 */
.achv-ck-add2 { width: auto; margin: 0; padding: 4px 10px; font-size: 12px; font-weight: 700; background: #fff; color: #b23a3a; border: 1px dashed #b23a3a; border-radius: 8px; cursor: pointer; }
.achv-ck-row2 { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-top: 8px; border-top: 1px dashed #e3b8b8; }
.achv-ck-title2 { font-weight: 800; color: #b23a3a; }
.achv-checkbar input[type=color] { width: 34px; height: 26px; padding: 0; margin: 0; border: 1px solid #d9b3b3; border-radius: 6px; background: #fff; cursor: pointer; }
.achv-ck-del2 { width: auto; margin: 0; padding: 4px 10px; font-size: 12px; font-weight: 700; background: #7b8794; color: #fff; border: 0; border-radius: 8px; cursor: pointer; }
.achv-tile .t-check.inner { inset: 7px; }
@media (max-width: 720px) { .achv-tile .t-check.inner { inset: 5px; } }
.ck-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 3px; border: 1.5px solid #fff; vertical-align: -1px; box-sizing: border-box; }

/* 여러 기준: 동그라미를 안쪽으로 겹쳐서 */
.achv-ck-extra { flex: 1 1 100%; display: flex; flex-direction: column; gap: 6px; }
.achv-ck-extra .achv-ck-row2 { flex: 1 1 100%; }
.achv-tile .t-check { inset: calc(2px + var(--i, 0) * 5px); }
@media (max-width: 720px) { .achv-tile .t-check { inset: calc(1px + var(--i, 0) * 3.5px); } }

.achv-sortopt { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-size: 12px; font-weight: 700; color: #667; cursor: pointer; width: auto; white-space: nowrap; }
.achv-sortopt input[type=checkbox] { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: #4a7bd6; }

.tier-img-row { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 10px; }
.tier-img-row label { display: inline-flex; align-items: center; gap: 6px; margin: 0; width: auto; font-size: 13px; font-weight: 700; }
.tier-img-row select { width: auto; margin: 0; padding: 6px 8px; border-radius: 8px; border: 1px solid #d5d8e0; font-size: 13px; }

/* ===========================================================================
   디자인 정리 — 아이콘 / 헤더 버튼 / 탭 / 체크박스
   =========================================================================== */
/* 아이콘 색·움직임 */
.ic.ok { color: #2fb86a; }
.ic.off { color: #c3c8d4; }
.hw-set-toggle-arrow { display: inline-flex; align-items: center; }
.hw-set-toggle-arrow .ic { width: 14px; height: 14px; transition: transform .18s ease; }
.hw-set-toggle-arrow.open .ic { transform: rotate(90deg); }
.achv-ck-title .ic, .achv-ct-count .ic { color: #e0334a; }
.achv-chev .ic { width: 16px; height: 16px; }
.filter-toggle-btn .ic { width: 14px; height: 14px; vertical-align: -0.15em; }
.note-modal-close .ic { width: 16px; height: 16px; }
.set-edit-box h3 .ic, .modal-box h3 .ic { color: #9d63f0; vertical-align: -0.17em; }
td.is-done .ic.ok, td .ic.off { width: 18px; height: 18px; }
.ck-dot { box-shadow: 0 0 0 1px rgba(0,0,0,.08); }

/* 헤더 버튼: 하나의 세트로 통일 */
.toggle-container .game-switch-btn,
.toggle-container #howToUpdateBtn,
.toggle-container #sdvxHowToUpdateBtn,
.toggle-container #openToolsBtn,
.toggle-container #myPageBtn,
.toggle-container #sdvxMyPageBtn,
.toggle-container .logout-button {
    display: inline-flex; align-items: center; gap: 7px; width: auto; margin: 0;
    padding: 8px 14px; font-size: 13px; font-weight: 600; line-height: 1.2; color: #fff;
    background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18); border-radius: 10px;
    text-decoration: none; cursor: pointer; box-shadow: none;
    transition: background .18s ease, transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.toggle-container .game-switch-btn:hover,
.toggle-container #howToUpdateBtn:hover,
.toggle-container #sdvxHowToUpdateBtn:hover,
.toggle-container #openToolsBtn:hover,
.toggle-container #myPageBtn:hover,
.toggle-container #sdvxMyPageBtn:hover,
.toggle-container .logout-button:hover {
    background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.32); transform: translateY(-1px);
}
.toggle-container #howToUpdateBtn,
.toggle-container #sdvxHowToUpdateBtn {
    background: linear-gradient(135deg, #ff77b2, #9d63f0); border-color: transparent;
    box-shadow: 0 4px 14px rgba(157,99,240,.35);
}
.toggle-container #howToUpdateBtn:hover,
.toggle-container #sdvxHowToUpdateBtn:hover { background: linear-gradient(135deg, #ff6aa9, #8d52e6); box-shadow: 0 6px 18px rgba(157,99,240,.45); }
.toggle-container #myPageBtn,
.toggle-container #sdvxMyPageBtn { background: rgba(157,99,240,.35); border-color: rgba(157,99,240,.55); }
.toggle-container .logout-button { background: transparent; color: #ff9aa2; border-color: rgba(255,120,130,.4); font-size: 12px; }
.toggle-container .logout-button:hover { background: rgba(255,90,100,.18); color: #ffb3b8; }

/* 탭: 알약 모양, 선택된 탭은 포인트 색 */
.tab-link {
    background: transparent; color: #5b6073; border-radius: 999px; padding: 8px 16px; font-weight: 600;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.tab-link:hover { background: #eceef6; color: #222; }
.tab-link.active {
    background: linear-gradient(135deg, #ff77b2, #9d63f0); color: #fff;
    box-shadow: 0 4px 12px rgba(157,99,240,.32);
}

/* 버튼 공통: 눌렀을 때 살짝 들어가고, 키보드 포커스가 보이게 */
button:active:not(:disabled) { transform: translateY(1px); }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
    outline: 2px solid rgba(157,99,240,.55); outline-offset: 2px;
}
button:disabled { opacity: .5; cursor: not-allowed; }

/* 체크박스: 둥근 네모 + 체크 표시 (토글 스위치는 그대로) */
input[type=checkbox]:not(.toggle-switch input) {
    -webkit-appearance: none; appearance: none;
    width: 18px; height: 18px; min-width: 18px; margin: 0; padding: 0; flex: none;
    display: inline-grid; place-content: center; vertical-align: middle; cursor: pointer;
    background: #fff; border: 1.6px solid #b8bed0; border-radius: 6px;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
input[type=checkbox]:not(.toggle-switch input)::after {
    content: ""; width: 11px; height: 11px; transform: scale(0); transition: transform .14s ease;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
input[type=checkbox]:not(.toggle-switch input):hover { border-color: #9d63f0; }
input[type=checkbox]:not(.toggle-switch input):checked {
    background: linear-gradient(135deg, #ff77b2, #9d63f0); border-color: transparent;
    box-shadow: 0 2px 6px rgba(157,99,240,.35);
}
input[type=checkbox]:not(.toggle-switch input):checked::after { transform: scale(1); }
input[type=checkbox]:not(.toggle-switch input):disabled { opacity: .45; cursor: not-allowed; }
.proxy-toggle-row input[type="checkbox"] { width: 18px !important; height: 18px !important; }
.achv-sortopt input[type=checkbox], .tier-edit-box .te-hide-placed input[type=checkbox] { width: 18px; height: 18px; min-width: 18px; }

/* 토글 스위치: 켜졌을 때 포인트 색 + 부드럽게 */
.slider { transition: background-color .25s ease; }
.slider:before { transition: transform .25s ease; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
input:checked + .slider { background: linear-gradient(135deg, #b77dff, #9d63f0); }

/* 선택 칩(체크박스가 들어있는 알약): 선택되면 확실히 보이게 */
.filter-checkbox { transition: background .15s ease, border-color .15s ease, color .15s ease; }
.filter-checkbox:hover { border-color: #c9a6e6; }
.achv-sortopt { padding: 4px 10px 4px 8px; border: 1px solid #e0e3ec; border-radius: 999px; background: #fff; transition: border-color .15s ease; }
.achv-sortopt:hover { border-color: #c9a6e6; }

.toggle-label, .toggle-container label { white-space: nowrap; }

/* 기준 추가 버튼: 전역 button 스타일에 덮이지 않게 */
button.achv-ck-add2, #achvCheckBar button.achv-ck-add2, #sxCheckBar button.achv-ck-add2 {
  width: auto !important; margin: 0 !important; padding: 4px 11px !important; font-size: 12px; font-weight: 700;
  background: #fff !important; color: #b23a3a !important; border: 1.5px dashed #d98a8a !important; border-radius: 999px !important;
  box-shadow: none !important; display: inline-flex; align-items: center; gap: 5px;
}
button.achv-ck-add2:hover { background: #fff3f3 !important; border-color: #b23a3a !important; transform: none; }

/* ── 필터 체크박스 → 업적탭 난이도 필터처럼 "글자 칩 + 선택 시 배경색 변경" ── */
.filter-checkbox, .achv-sortopt {
  position: relative; display: inline-flex; align-items: center; gap: 0;
  background: #fff; border: 1px solid #d5d8e0; border-radius: 14px;
  padding: 4px 11px; font-size: 12px; font-weight: 700; color: #667;
  cursor: pointer; user-select: none; transition: background .15s, color .15s, border-color .15s;
}
.filter-checkbox:hover, .achv-sortopt:hover { background: #f1f2f6; border-color: #d5d8e0; }
.filter-checkbox input[type=checkbox], .achv-sortopt input[type=checkbox] {
  position: absolute !important; opacity: 0; width: 0 !important; height: 0 !important; min-width: 0 !important;
  margin: 0 !important; padding: 0 !important; pointer-events: none; border: 0 !important;
}
.filter-checkbox input[type=checkbox]::after, .achv-sortopt input[type=checkbox]::after { display: none; }
.filter-checkbox.checked, .filter-checkbox:has(input:checked),
.achv-sortopt:has(input:checked) {
  background: #1a1a2e; color: #fff; border-color: #1a1a2e; font-weight: 700;
}
.filter-checkbox.checked:hover, .filter-checkbox:has(input:checked):hover, .achv-sortopt:has(input:checked):hover { background: #2a2a44; }
.filter-checkbox:has(input:focus-visible), .achv-sortopt:has(input:focus-visible) { outline: 2px solid #b77dff; outline-offset: 2px; }
.filter-checkbox-list { gap: 6px; }

/* ── 아이콘 전용 버튼(삭제 / 공유 / 복사) ── */
.delete-btn, .challenge-del-btn, .my-hw-set-delete-btn, .admin-set-delete-btn, .admin-set-item-del-btn,
.admin-set-share-btn, .se-del, .achv-ck-del2, .te-del-tier, .note-delete-btn, #copyMyIdBtn, #sdvxCopyMyIdBtn, .song-cart-remove-btn {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 0;
}
.admin-set-delete-btn, .my-hw-set-delete-btn, .admin-set-share-btn, .admin-set-item-del-btn,
.challenge-del-btn, .delete-btn, .se-del, .song-cart-remove-btn, .note-delete-btn {
  width: 32px !important; height: 32px; padding: 0 !important; border-radius: 9px; font-size: 15px;
}
.admin-set-delete-btn, .my-hw-set-delete-btn, .admin-set-item-del-btn, .challenge-del-btn, .delete-btn { background: #fff0f0 !important; color: #e5484d !important; border: 1px solid #f6c9cb !important; }
.admin-set-delete-btn:hover, .my-hw-set-delete-btn:hover, .admin-set-item-del-btn:hover, .challenge-del-btn:hover, .delete-btn:hover { background: #e5484d !important; color: #fff !important; }
.admin-set-share-btn { background: #eef4ff !important; color: #3b6fd8 !important; border: 1px solid #c9daf8 !important; }
.admin-set-share-btn:hover { background: #4c8bf5 !important; color: #fff !important; }
.achv-ck-del2, .te-del-tier { width: 30px !important; height: 30px; padding: 0 !important; border-radius: 8px; }
#copyMyIdBtn, #sdvxCopyMyIdBtn { width: 34px !important; height: 34px; padding: 0 !important; }
.song-cart-remove-btn { background: #fff0f0 !important; color: #e5484d !important; border: 1px solid #f6c9cb !important; }
.note-delete-btn { background: rgba(239,68,68,.2) !important; color: #fca5a5 !important; border: 0 !important; }

/* ── 기록 탭: 곡 블럭은 한 줄에 하나씩 + 설정 패널은 옆에 ── */
.record-layout { display: flex; flex-direction: column-reverse; gap: 12px; }   /* 좁은 화면: 패널이 목록 위 */
.record-main { min-width: 0; }
.record-side { display: flex; flex-direction: column; gap: 12px; }
.record-layout .record-blocks { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 1000px) {
  .record-layout { flex-direction: row; align-items: flex-start; gap: 18px; }
  .record-main { flex: 1 1 0; }
  .record-side {
    flex: 0 0 290px; width: 290px; position: sticky; top: 12px;
    max-height: calc(100vh - 24px); overflow-y: auto; scrollbar-width: thin;
  }
}
.record-side-card, .record-side .record-filter-body {
  background: #fff; border-radius: 14px; box-shadow: 0 1px 6px rgba(26,26,46,.08); padding: 14px;
}
.record-side-card { display: flex; flex-direction: column; gap: 10px; }
.record-search { position: relative; }
.record-search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #99a; width: 16px; height: 16px; pointer-events: none; }
.record-search input {
  width: 100%; box-sizing: border-box; margin: 0; padding: 9px 12px 9px 34px; font-size: 14px;
  border: 1px solid #e0e3ec; border-radius: 10px; background: #f7f8fb;
}
.record-search input:focus { outline: none; border-color: #b77dff; background: #fff; box-shadow: 0 0 0 3px rgba(183,125,255,.15); }
.record-sort-row { display: flex; gap: 8px; }
.record-sort-row select {
  flex: 1 1 auto; min-width: 0; margin: 0; padding: 8px 10px; font-size: 14px;
  border: 1px solid #e0e3ec; border-radius: 10px; background: #f7f8fb; color: #1a1a2e;
}
.record-side .sort-order-btn {
  flex: 0 0 38px; width: 38px !important; height: 38px; margin: 0 !important; padding: 0 !important;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
  border: 1px solid #e0e3ec !important; border-radius: 10px !important; background: #f7f8fb !important; color: #1a1a2e !important;
}
.record-side .sort-order-btn:hover { background: #ecdcfb !important; border-color: #c9a6e6 !important; }
.record-played-row { display: flex; align-items: center; justify-content: space-between; font-size: 14px; color: #333; cursor: pointer; margin: 0; padding: 2px 2px 0; }
.record-side .record-filter-panel { margin: 0; }
.record-side .record-filter-body { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.record-side .filter-group-title { font-size: 12px; color: #889; letter-spacing: .02em; margin-bottom: 7px; }
.record-side .filter-range-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: #889; }
.record-side .filter-range-row > span:first-child { display: none; }
.record-side .filter-range-input { flex: 1 1 0; min-width: 0; width: auto; padding: 6px 8px; border: 1px solid #e0e3ec; border-radius: 8px; box-sizing: border-box; }
.record-side .filter-reset-btn { width: 100%; margin: 0; }
.record-side .filter-toggle-btn { display: none; }
@media (max-width: 999px) {
  .record-side .filter-toggle-btn { display: inline-flex; align-items: center; gap: 4px; }
  .record-side .record-filter-body { display: none; margin-top: 10px; }
}

/* 세트 복사 버튼: 아이콘만 */
.admin-set-copy-btn { display: inline-flex !important; align-items: center; justify-content: center; width: 32px !important; height: 32px; padding: 0 !important; border-radius: 9px; font-size: 15px;
  background: #f3ecff !important; color: #7b3fd0 !important; border: 1px solid #dac6f7 !important; }
.admin-set-copy-btn:hover { background: #9d63f0 !important; color: #fff !important; }

/* 공유 탭: 이미지 종류 선택 */
.share-img-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.share-img-head h3 { margin: 0; }
.share-kind-sel { min-width: 200px; padding: 9px 12px; font-size: 14px; font-weight: 700; color: #1a1a2e; background: #f7f8fb; border: 1px solid #e0e3ec; border-radius: 10px; cursor: pointer; }
.share-kind-sel:focus { outline: none; border-color: #b77dff; box-shadow: 0 0 0 3px rgba(183,125,255,.15); }
.share-kind-sec > h3 { display: none; }
.share-kind-sec { border-top: 0 !important; margin-top: 0 !important; }

/* 곡 상세(세부기록) 모달: 채보 노트 수 */
.note-chartinfo { margin: 8px 16px 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.note-chartinfo .nci-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255,255,255,.65); margin-bottom: 8px; }
.note-chartinfo .nci-head b { color: #fff; font-size: 14px; margin-left: 2px; }
.note-chartinfo .nci-row { display: flex; flex-wrap: wrap; gap: 6px; }
.note-chartinfo .nci-cell { display: inline-flex; flex-direction: column; align-items: center; min-width: 58px; padding: 5px 8px; border-radius: 9px; background: rgba(255,255,255,.07); }
.note-chartinfo .nci-cell i { font-style: normal; font-size: 10px; letter-spacing: .04em; color: rgba(255,255,255,.55); }
.note-chartinfo .nci-cell b { font-size: 14px; color: #fff; }
.note-chartinfo .nci-break b { color: #ffb74d; }
.note-chartinfo .nci-slide b { color: #7ec8ff; }
.note-chartinfo .nci-hold b { color: #ffd166; }
.note-chartinfo .nci-touch b { color: #7ee0a8; }

/* 클릭해서 가리는 숫자 (친구 코드/크레딧) */
.secret-num { cursor: pointer; border-radius: 4px; padding: 0 2px; transition: background .15s; }
.secret-num:hover { background: rgba(127,127,127,.18); }
.secret-num.secret-hidden { letter-spacing: 1px; }

.share-img-sels { display: flex; gap: 8px; flex-wrap: wrap; }
.share-img-sels .share-kind-sel { min-width: 140px; }
html[data-theme="dark"] .share-kind-sel { color: #e8e9ef; background: #181a28; border-color: #3a3d58; }

/* ── 히스토리 서브탭 + 레이팅 성장 그래프 ── */
.hist-subtab-menu { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.hist-subtab-link { padding: 6px 14px; background: #f5f5f5; color: #555; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; }
.hist-subtab-link.active { background: #ff77b2; color: #fff; }
.growth-box { background: #fff; border-radius: 14px; box-shadow: 0 1px 6px rgba(26,26,46,.08); padding: 14px; }
.growth-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.growth-title { font-weight: 800; font-size: 15px; color: #1a1a2e; }
.growth-xsw { display: inline-flex; gap: 4px; background: #f0f0f4; border-radius: 9px; padding: 3px; }
.growth-xbtn { margin: 0; width: auto; padding: 5px 12px; border: none; border-radius: 7px; background: transparent; color: #667; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.growth-xbtn.active { background: #fff; color: #7b1fa2; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.growth-chart { width: 100%; }
.growth-chart svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.growth-chart .g-grid { stroke: #e6e8ef; stroke-width: 1; }
.growth-chart .g-axis { fill: #889; font-size: 11px; }
.growth-chart .g-line { fill: none; stroke: #9d63f0; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.growth-chart .g-area { fill: rgba(157,99,240,.12); stroke: none; }
.growth-chart .g-dot { fill: #fff; stroke: #9d63f0; stroke-width: 2; }
.growth-chart .g-hover { fill: #ff77b2; stroke: #fff; stroke-width: 2; }
.growth-chart .g-cross { stroke: #c9a6e6; stroke-dasharray: 3 3; }
.growth-info { min-height: 38px; margin-top: 8px; font-size: 13px; color: #556; line-height: 1.5; }
.growth-info b { color: #7b1fa2; font-size: 15px; }
.growth-note { margin: 8px 0 0; font-size: 11.5px; color: #99a; }
@media (max-width: 480px) { .growth-box { padding: 12px 10px; } }

/* ── 업적 변화 ── */
.achvh-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.achvh-controls select { margin: 0; width: auto; min-width: 96px; padding: 7px 10px; border: 1px solid #e0e3ec; border-radius: 9px; background: #f7f8fb; color: #1a1a2e; font-size: 13.5px; }
.achvh-legend { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 6px; }
.achvh-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; border: 1.5px solid var(--c); color: #445; background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; user-select: none; }
.achvh-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.achvh-chip.on { background: var(--c); color: #fff; }
.achvh-chip.on .dot { background: #fff; }
.growth-chart .g-line2 { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.achvh-table-wrap { margin-top: 10px; overflow-x: auto; }
.achvh-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.achvh-table th, .achvh-table td { padding: 6px 8px; border-bottom: 1px solid #eceef5; text-align: right; white-space: nowrap; }
.achvh-table th:first-child, .achvh-table td:first-child { text-align: left; font-weight: 700; }
.achvh-table th { color: #889; font-weight: 600; }
.achvh-up { color: #1a9d57; font-weight: 700; }
.achvh-zero { color: #99a; }

/* ── 버전 플레이트 (업적 탭) ── */
.plate-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.plate-card { background: #fff; border-radius: 14px; box-shadow: 0 1px 6px rgba(26,26,46,.08); padding: 12px 12px 8px; }
.plate-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.plate-kanji { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 9px; background: linear-gradient(135deg, #ff77b2, #9d63f0); color: #fff; font-weight: 900; font-size: 17px; }
.plate-vname { font-weight: 800; font-size: 14px; color: #1a1a2e; flex: 1; min-width: 0; }
.plate-total { font-size: 11.5px; color: #99a; flex: none; }
.plate-row { border-top: 1px solid #eceef5; }
.plate-row > summary { list-style: none; display: grid; grid-template-columns: 38px 1fr auto; grid-template-rows: auto 6px; column-gap: 8px; row-gap: 4px; align-items: center; padding: 8px 2px; cursor: pointer; }
.plate-row > summary::-webkit-details-marker { display: none; }
.plate-badge { grid-row: 1 / span 2; display: inline-flex; align-items: center; justify-content: center; height: 28px; border-radius: 8px; color: #fff; font-weight: 900; font-size: 12.5px; }
.plate-kname { font-size: 13px; font-weight: 700; color: #1a1a2e; }
.plate-kname small { color: #99a; font-weight: 600; margin-left: 4px; }
.plate-count { font-size: 12.5px; font-weight: 800; color: #556; }
.plate-bar { grid-column: 2 / span 2; height: 6px; border-radius: 99px; background: #eceef5; overflow: hidden; }
.plate-bar i { display: block; height: 100%; border-radius: 99px; }
.plate-done .plate-count { color: #1a9d57; }
.plate-left { padding: 2px 2px 8px 46px; max-height: 260px; overflow-y: auto; }
.plate-left-item { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 3px 0; border-bottom: 1px dashed #eceef5; }
.plate-left-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #334; }
.plate-left-meta { flex: none; color: #889; }
.plate-note { grid-column: 1 / -1; font-size: 11.5px; color: #99a; margin: 4px 2px 0; line-height: 1.5; }
@media (max-width: 480px) { .plate-wrap { grid-template-columns: 1fr; } .plate-left { padding-left: 4px; } }
/* 플레이트/프레임 이미지 */
.plate-row > summary { grid-template-rows: auto auto 6px; }
.plate-img, .frame-img { grid-column: 1 / -1; grid-row: 1; width: 100%; height: auto; display: block; border-radius: 8px; filter: grayscale(.85) opacity(.5); transition: filter .2s; }
.frame-img { aspect-ratio: 720 / 301; object-fit: cover; }
.plate-img { aspect-ratio: 720 / 116; }
.plate-done .plate-img, .plate-done .frame-img { filter: none; }
.plate-row > summary .plate-badge { grid-row: 2 / span 2; }
.plate-section { grid-column: 1 / -1; margin: 14px 2px 0; font-size: 16px; font-weight: 800; color: #1a1a2e; }
.frame-card .plate-head { margin-bottom: 4px; }
@media (max-width: 480px) { .plate-img, .frame-img { border-radius: 6px; } }
.frame-row > summary { grid-template-columns: 52px 1fr auto; }
.frame-row .plate-badge { white-space: nowrap; font-size: 11.5px; }
.frame-row .plate-left { padding-left: 60px; }
@media (max-width: 480px) { .frame-row .plate-left { padding-left: 4px; } }
.achv-seg-jump { cursor: pointer; }
/* 플레이트/프레임: 구간 막대 / 난이도별 막대 / 총 채보 링크 */
.plate-bar { display: flex; height: 8px; }
.plate-bar .achv-seg { height: 100%; }
.plate-bar .achv-seg:first-child { border-radius: 99px 0 0 99px; }
.plate-bar .achv-seg:last-child { border-radius: 0 99px 99px 0; }
.plate-bar .achv-seg:only-child { border-radius: 99px; }
.plate-bar .achv-seg-empty { background: #eceef5; }
.plate-diffs { padding: 2px 2px 6px 4px; display: grid; gap: 6px; }
.plate-diff-row { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; align-items: center; }
.plate-diff-name { font-size: 11.5px; font-weight: 800; color: #667; }
.plate-diff-count { font-size: 11.5px; font-weight: 700; color: #667; text-align: right; }
.plate-bar-diff { height: 8px; }
.plate-total-jump { cursor: pointer; color: #6a5bd6; font-weight: 700; }
.plate-total-jump:hover { text-decoration: underline; }
.plate-filter-note { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #efeafd; color: #4b3a99; font-size: 12.5px; font-weight: 700; }
.plate-filter-note button { border: 0; background: transparent; color: inherit; font-weight: 800; cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.plate-diff-row .plate-bar { grid-column: auto; }
.record-filter-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.record-result-count { font-size: 13px; font-weight: 800; color: #6a5bd6; }

/* ── S-레이팅 탭 ── */
.srating-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 8px; padding: 0 4px; }
.srating-main { min-width: 0; }
.srating-label { font-size: 12px; font-weight: 800; letter-spacing: .12em; color: #8a8fa8; }
.srating-total { font-size: 44px; font-weight: 900; line-height: 1.1; color: #e08a00; font-variant-numeric: tabular-nums; }
.srating-sub { font-size: 13px; color: #777b92; margin-top: 2px; }
.srating-btn { padding: 9px 16px; border-radius: 10px; border: 1px solid #c9ccdd; background: #fff; color: #333; font-weight: 700; cursor: pointer; }
.srating-btn:hover { background: #f3f4fa; }
.srating-desc { font-size: 13px; color: #6b6f86; margin: 4px 4px 10px; line-height: 1.5; }
@media (max-width: 600px) {
  .srating-total { font-size: 36px; }
  .srating-btn { width: 100%; }
}
#sratingCards [class$="song-rating"] { font-size: 13px !important; letter-spacing: -.2px; }
@media (max-width: 600px) { #sratingCards [class$="song-rating"] { font-size: 11px !important; } }
.song-rank-ap { color: #ffcf33; font-weight: 900; font-size: 11px; margin-top: 23px; text-shadow: 0 0 6px rgba(255, 196, 0, .55), 0px 1px 4px rgb(0, 0, 0); }

/* S-레이팅 탭 곡 블록 (이미지표와 같은 카드 디자인) */
#sratingCards.cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.srating-card { cursor: pointer; line-height: 0; }
.srating-card canvas { width: 100%; height: auto; display: block; }
@media (max-width: 900px) { #sratingCards.cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { #sratingCards.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; } }

/* 레이팅 포텐셜 */
.record-pot-switch { display: flex; width: 100%; }
.record-pot-kind { margin-bottom: 6px; }
.record-pot-switch button { flex: 1; white-space: nowrap; }
.record-pot { margin-top: 4px; display: flex; flex-direction: column; gap: 1px; }
.record-pot-row { display: grid; grid-template-columns: 56px 82px 44px; gap: 8px; align-items: baseline; font-size: 12px; font-variant-numeric: tabular-nums; color: #666; text-align: right; }
.record-pot-target { text-align: right; }
.record-pot-target.is-ap { color: #c98a00; font-weight: 700; }
.record-pot-gap { color: #999; }
.record-pot-gain { color: #1f9d55; font-weight: 800; }

/* 친구 목록 이름 검색 */
.friend-search { width: 100%; box-sizing: border-box; margin: 0 0 12px; padding: 9px 14px; font-size: 14px; border: 1px solid #d9d9e3; border-radius: 10px; background: #fff; color: #222; }
.friend-search:focus { outline: 2px solid #c9a7f5; border-color: #9d63f0; }
.friend-search-empty { color: #888; font-size: 13px; }

/* ─── 히스토리 블록 리디자인 (마이마이/사볼 공통) ─── */
.history-block {
    flex-wrap: wrap; gap: 12px 14px; padding: 14px 16px; border-radius: 14px;
    border: 1px solid #ececf3; border-left: 4px solid #9d63f0;
    box-shadow: 0 2px 10px rgba(30,20,60,.06); transition: box-shadow .18s ease, transform .18s ease, background-color .18s ease;
}
.history-block:hover { background: #fff; box-shadow: 0 6px 18px rgba(30,20,60,.12); transform: translateY(-1px); }
.history-block .record-jacket { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
.history-block .record-info { flex: 1 1 160px; min-width: 0; padding-top: 0; gap: 6px; }
.history-block .record-song-name { margin-top: 0; font-size: 15px; }
.history-block .history-changes {
    flex: 2 1 330px; max-width: none; margin-left: 0; font-size: 13px;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px;
}
.hc-cell { background: #f6f5fb; border-radius: 10px; padding: 7px 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hc-wide { grid-column: 1 / -1; }
.hc-label { font-size: 10px; font-weight: 700; letter-spacing: .4px; color: #8b8da3; }
.hc-val { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.hc-old { color: #9a9cb0; font-size: 12px; }
.hc-arrow { color: #b9bbcc; font-size: 11px; }
.hc-new-v { color: #2a2a40; font-size: 14px; font-weight: 800; }
.hc-val img { width: 26px; height: 26px; object-fit: contain; }
.hc-badge { align-self: flex-start; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; }
.hc-up { background: #dff5e6; color: #1f8a4c; }
.hc-down { background: #fde3e6; color: #c23a4a; }
.hc-new { background: #ece0ff; color: #7a3fd0; }
@media (max-width: 600px) {
    .history-block { padding: 12px; }
    .history-block .history-changes { flex-basis: 100%; grid-template-columns: repeat(2, 1fr); }
    .hc-cell { padding: 6px 8px; }
    .hc-val { gap: 4px; flex-wrap: nowrap; }
    .hc-old { font-size: 11px; }
    .hc-new-v { font-size: 13px; }
}

/* ─── 곡별 성장 기록 (어두운 곡 창 안) ─── */
.note-growth { padding: 0 18px; }
.sg-box { background: rgba(255,255,255,.05); border-radius: 12px; padding: 12px 14px; margin: 10px 0 12px; }
.sg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sg-title { font-size: .85rem; font-weight: 800; color: #fff; }
.sg-sum { font-size: .75rem; color: rgba(255,255,255,.65); }
.sg-sum b { color: #ffeb3b; }
.sg-spark { width: 100%; height: 44px; margin-top: 8px; display: block; }
.sg-spark path { fill: none; stroke: #b98cf2; stroke-width: 2; vector-effect: non-scaling-stroke; }
.sg-spark circle { fill: #ffeb3b; }
.sg-list { margin-top: 10px; max-height: 260px; overflow-y: auto; padding-right: 4px; }
.sg-item { display: flex; gap: 10px; padding: 0 0 12px; position: relative; }
.sg-item:not(:last-child)::before { content: ''; position: absolute; left: 4px; top: 12px; bottom: 0; width: 2px; background: rgba(255,255,255,.12); }
.sg-dot { width: 10px; height: 10px; border-radius: 50%; background: #9d63f0; margin-top: 4px; flex: 0 0 auto; }
.sg-dot-first { background: #ffeb3b; }
.sg-body { min-width: 0; flex: 1; }
.sg-date { font-size: .72rem; color: rgba(255,255,255,.5); }
.sg-first { margin-left: 8px; font-size: .65rem; font-weight: 800; color: #3b2a00; background: #ffeb3b; border-radius: 999px; padding: 1px 7px; }
.sg-cells { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.sg-cell { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.07); border-radius: 8px; padding: 4px 9px; font-size: .78rem; color: #fff; }
.sg-label { font-size: .65rem; font-weight: 800; color: rgba(255,255,255,.45); }
.sg-val { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.sg-old { color: rgba(255,255,255,.55); }
.sg-arrow { color: rgba(255,255,255,.35); font-size: .7rem; }
.sg-badge { font-size: .68rem; font-weight: 800; border-radius: 999px; padding: 0 7px; }
.sg-up { background: rgba(63,191,127,.2); color: #6fe3a0; }
.sg-down { background: rgba(255,90,100,.2); color: #ff8c9a; }
.sg-empty { font-size: .78rem; color: rgba(255,255,255,.5); padding: 10px 0 4px; }

/* 성장 그래프: 값 전환 + X축 전환 버튼이 한 줄에 안 들어가면 줄바꿈 */
.growth-head .growth-xsw { flex-wrap: wrap; }
