* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Pretendard, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

:root {
  --mint: #b8fff1;
  --mint-strong: #89f5de;
  --accent: #3b6df6;
  --pink-bg: #fff3f8;
  --pink-soft: #ffeaf3;
  --black: #101010;
  --white: #ffffff;
  --glass: rgba(255, 255, 255, 0.62);
  --border: rgba(255, 255, 255, 0.45);
  --shadow: 0 10px 35px rgba(0, 0, 0, 0.12);
}

body {
  background: linear-gradient(180deg, #fff4f9 0%, #fff7fb 25%, #f4fffb 70%, #e9fff9 100%);
  color: var(--black);
  min-height: 100vh;
  overflow-x: hidden;
}

.layout {
  width: min(1320px, 96vw);
  margin: 20px auto 80px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.layout-main {
  min-width: 0;
}

.app-container {
  width: 100%;
  margin: 20px 0 0;
  padding-bottom: calc(46vh + 120px);
}

.page {
  display: none;
  position: relative;
}
.page.active {
  display: block;
}

.floating-nav {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
}

.top-right {
  position: sticky;
  top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.nav-icon {
  width: 21px;
  height: 21px;
  object-fit: contain;
  flex: 0 0 auto;
  display: block;
}

.floating-btn {
  border: none;
  border-radius: 18px;
  padding: 14px 18px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  color: var(--black);
  font-weight: 700;
  cursor: pointer;
  transition: 0.18s ease;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.floating-btn:hover {
  transform: translateY(-1px);
}

.floating-btn.black-btn {
  background: #101010;
  color: #fff;
  border-color: rgba(0, 0, 0, 0.4);
}

.floating-btn.compact-btn {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
}
.avail-open-btn{
  width: fit-content;
  padding: 6px 8px;
  height: 28px;
  border-radius: 10px;
  font-size: 12px;
}

/* small inline spinner for buttons */
.btn-spinner{
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,0.20);
  border-top-color: rgba(0,0,0,0.62);
  display:inline-block;
  vertical-align: -2px;
  margin-left: 2px;
  animation: mbspin 0.9s linear infinite;
}
.floating-btn.black-btn .btn-spinner{
  border-color: rgba(255,255,255,0.40);
  border-top-color: rgba(255,255,255,0.95);
}
@keyframes mbspin { to { transform: rotate(360deg); } }

.nav-btn.active {
  background: #101010;
  color: #fff;
}

.glass-card {
  background: var(--glass);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.banner-image {
  width: 100%;
  border-radius: 20px;
  display: block;
  max-height: 420px;
  object-fit: cover;
}

.user-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.session-badge {
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  font-weight: 1000;
  font-size: 12px;
  backdrop-filter: blur(12px);
}
.turner-badge {
  background: rgba(16, 16, 16, 0.88);
  color: #fff;
}

.profile-photo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.08);
  display: none;
}
.profile-photo.active {
  display: block;
}

.role-badge {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  backdrop-filter: blur(10px);
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 96px;
  font-size: 12px;
  font-weight: 700;
}
.user-meta span:first-child {
  font-size: 14px;
  font-weight: 900;
}
.user-meta span:last-child {
  opacity: 0.68;
}

.admin-menu {
  position: sticky;
  top: 74px;
  margin-left: auto;
  display: none;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(18px);
  z-index: 1000;
}
.admin-menu.active {
  display: flex;
}
.admin-menu .admin-status{
  flex: 1 1 100%;
  font-size: 12px;
  font-weight: 900;
  opacity: 0.75;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px dashed rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.55);
  min-width: 240px;
}

.songs-title-row {
  /* 타이틀 이미지는 검색 패널을 침범하지 않도록 일반 흐름에 배치 */
  position: relative;
  top: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  pointer-events: none;
  z-index: 1;
  margin: 6px 0 14px;
}

.songs-title-logo {
  height: 168px;
  width: auto;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.songs-title-text{
  font-size: 20px;
  font-weight: 1000;
  margin-left: 10px;
  margin-top: 18px;
  color: rgba(0,0,0,0.82);
  text-shadow: 0 1px 0 rgba(255,255,255,0.65);
}

/* 모바일에서는 너무 커지지 않게 */
@media (max-width: 520px){
  .songs-title-logo { height: 120px; }
  .songs-title-text{ font-size: 18px; margin-top: 12px; }
}

/* -------------------- Archive(개인 노래책) 모드 -------------------- */
/* 메인 송북의 컬럼/그리드 구조는 그대로 유지하고 "불필요한 패널만" 제거한다. */
body.archive-mode #mainPage{ display:none !important; }
body.archive-mode #requestDock{ display:none !important; }
body.archive-mode #requestShowBtn{ display:none !important; }
body.archive-mode #presencePanel{ display:none !important; }
body.archive-mode #presenceShowBtn{ display:none !important; }
body.archive-mode #availableVocalRow{ display:none !important; }
body.archive-mode #availableVocalSelectedRow{ display:none !important; }

/* 좌측 네비는 유지하되, 메인페이지 버튼/외부링크는 숨김(개인 노래책에서는 불필요) */
body.archive-mode #mainNavBtn{ display:none !important; }
body.archive-mode #chzzkBtn{ display:none !important; }
body.archive-mode #discordBtn{ display:none !important; }
body.archive-mode #youtubeBtn{ display:none !important; }
body.archive-mode #songsNavBtn{ display:none !important; }
body.archive-mode #availableVocalOpenBtn{ display:none !important; }

/* 개인 노래책: 역할 뱃지(SESSION/ADMIN) 표시는 불필요 */
body.archive-mode #roleBadge{ display:none !important; }
body.archive-mode #userRoleText{ display:none !important; }

/* 좌측 컬럼 타이틀 */
.archive-nav-title{
  padding: 6px 2px;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  font-size: 22px;
  font-weight: 1000;
  line-height: 1.12;
  letter-spacing: -0.03em;
  word-break: break-word;
}

/* GAS 원본: 검색 영역은 flex-wrap */
.search-grid{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.search-row{
  display:flex;
  gap:10px;
  align-items:center;
}
.search-row-1{
  flex-wrap:nowrap;
  overflow-x:hidden;
  padding-bottom:2px;
}
.search-row-1 .input{
  flex:1 1 360px;
  min-width:200px;
}
.search-row-1 .select{
  flex:0 0 120px;
  min-width:110px;
}
.avail-pick-btn{
  flex:0 0 auto;
  height: 36px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.88);
  font-weight: 1000;
  font-size: 12px;
  white-space:nowrap;
  cursor:pointer;
}
.search-row-vocal{
  align-items:flex-start;
}
.avail-selected-label{
  min-width: 76px;
  font-size:12px;
  font-weight:1000;
  opacity:0.75;
  padding-top: 7px;
  white-space:nowrap;
}
.avail-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  flex: 1 1 auto;
}
.avail-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.86);
  font-weight: 900;
  font-size: 12px;
}
.avail-chip button{
  border:0;
  background: transparent;
  color: rgba(0,0,0,0.55);
  cursor:pointer;
  font-weight: 1000;
  padding:0;
  line-height:1;
}
.avail-modal-list{
  margin-top:10px;
  display:grid;
  gap:8px;
  max-height: 48vh;
  overflow:auto;
  padding-right: 2px;
}
.avail-modal-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  border:1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.72);
}
.avail-modal-row label{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight: 900;
}
.avail-modal-row input[type="checkbox"]{
  width:18px;
  height:18px;
}
.search-row-2{
  justify-content:space-between;
  flex-wrap:wrap;
}
.search-actions{
  margin-left:auto;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
}

.input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.8);
  font-weight: 700;
  outline: none;
}

.select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.9);
  font-weight: 800;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 13px;
  opacity: 0.85;
}

.result-count {
  font-weight: 900;
}

.sort-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.sort-btn {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
}
.sort-btn.active {
  background: #101010;
  color: #fff;
}
.sort-actions {
  margin-left: auto;
}

.song-card-list{
  display:grid;
  grid-template-columns:repeat(auto-fill, 240px);
  gap:12px;
  align-items:stretch;
  justify-content:center;
  margin-bottom:16px;
}
.song-card-list.loading-dim{
  opacity: 0.55;
  transition: opacity 0.12s ease;
}
.song-card{
  background:rgba(255,255,255,0.86);
  border:2px solid rgba(59,109,246,0.55);
  border-radius:18px;
  padding:12px 14px;
  box-shadow:0 14px 38px rgba(0,0,0,0.10);
  display:flex;
  flex-direction:column;
  gap:10px;
  height:100%;
}
.song-card.clickable{ cursor:pointer; transition:0.15s; }
.song-card.clickable:hover{ transform:translateY(-1px); box-shadow:0 18px 48px rgba(0,0,0,0.12); }
.song-card-header{ display:flex; flex-direction:column; gap:8px; }
.song-card-top{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.song-card-actions{ flex:0 0 auto; display:flex; align-items:center; justify-content:flex-end; gap:6px; }
.song-card-avatars{ display:flex; align-items:center; justify-content:flex-start; }
.mini-avatars{ display:flex; gap:4px; align-items:center; flex-wrap:nowrap; justify-content:flex-start; }
.mini-avatar{
  width:22px; height:22px;
  border-radius:50%;
  overflow:hidden;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.10);
  font-size: 11px;
  font-weight: 1000;
  color: rgba(0,0,0,0.78);
}
.mini-avatar img{ width:100%; height:100%; object-fit:cover; display:block; }
.mini-avatar.more{
  background: rgba(59,109,246,0.12);
  border-color: rgba(59,109,246,0.22);
  color: rgba(20,45,120,0.85);
  width:26px;
}
.song-card-title{ font-size:17px; font-weight:1000; line-height:1.25; letter-spacing:-0.02em; word-break:break-word; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.song-card-artist{ margin-top:4px; font-size:12px; font-weight:900; opacity:0.62; word-break:break-word; }
.new-badge{ display:inline-flex; align-items:center; justify-content:center; padding:5px 8px; border-radius:999px; background:rgba(255,90,130,0.14); border:1px solid rgba(255,90,130,0.28); color:#c51b4f; font-size:11px; font-weight:1000; }

/* search highlight */
mark.hl{
  background: rgba(122,162,255,0.25);
  color: inherit;
  padding: 0 2px;
  border-radius: 4px;
}
.avail-box{ display:flex; align-items:center; gap:6px; padding:6px 8px; border-radius:14px; border:1px solid rgba(59,109,246,0.35); background:rgba(255,255,255,0.8); font-size:11px; font-weight:900; white-space:nowrap; max-width:100%; overflow:hidden; }
.avail-label{ display:none; }
.song-chips{ display:flex; gap:10px; flex-wrap:wrap; }
body.hide-tags .song-chips{ display:none; }
.chip{ padding:7px 10px; border-radius:12px; border:1px solid rgba(59,109,246,0.32); background:rgba(255,255,255,0.88); font-size:12px; font-weight:1000; white-space:nowrap; }
.chip.edit-chip{
  padding:6px 8px;
  font-size:11px;
  font-weight:1000;
  cursor:pointer;
  border-color: rgba(20,20,20,0.20);
  background: rgba(0,0,0,0.06);
}
.chip.edit-chip:hover{
  background: rgba(0,0,0,0.10);
}

/* Profile modal */
.profile-preview{ display:flex; justify-content:center; margin: 8px 0 10px; }
.profile-preview-image{ width: 92px; height: 92px; border-radius: 50%; object-fit: cover; background: rgba(0,0,0,0.06); border: 1px solid rgba(0,0,0,0.08); }
.profile-password-box{ display:flex; flex-direction:column; gap:10px; margin-top:10px; }

.paging-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.paging-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.paging-info {
  font-weight: 900;
}
.paging-label {
  font-weight: 900;
  opacity: 0.7;
  margin-right: 6px;
}

/* Request panel */
.request-dock{
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: min(288px, calc(100vw - 44px)); /* 기존 대비 1.2배 */
  z-index: 1700;
}
.request-dock .request-panel{
  overflow: hidden;
  padding: 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}
.request-dock .request-top-actions{
  position: absolute;
  right: 0;
  top: -10px;
  transform: translateY(-100%);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.floating-request-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: min(288px, calc(100vw - 44px)); /* legacy (no longer used) */
  z-index: 1700;
}
.request-panel.active {
  display: block;
}
.request-panel {
  display: block;
}
.request-panel-header .toolbar-right{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.request-panel-header .toolbar-right .floating-btn{ margin:0; }
.request-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.request-panel-title {
  font-size: 18px;
  font-weight: 1000;
}
.request-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  height: 312px; /* 5곡 기준 고정 높이(초과는 스크롤) */
  padding-right: 4px;
}
.req-row {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.req-row.selected {
  outline: 2px solid rgba(59, 109, 246, 0.5);
}
.req-title {
  font-weight: 1000;
}
.req-sub {
  font-size: 12px;
  opacity: 0.75;
  font-weight: 800;
  margin-top: 2px;
}
.req-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.request-manage-bar {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.request-manage-title {
  font-weight: 1000;
  margin-bottom: 8px;
}
.request-manage-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.request-mini-btn {
  width: 46px;
  justify-content: center;
}
.accept-btn {
  background: rgba(0, 200, 83, 0.18);
}
.danger-btn {
  background: rgba(244, 67, 54, 0.18);
}
.complete-blue-btn {
  background: rgba(59, 109, 246, 0.18);
}
.danger-strong-btn {
  background: rgba(244, 67, 54, 0.3);
}
.danger-solid-btn {
  background: rgba(244, 67, 54, 0.92);
  color: #fff;
}

.presence-show-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1701;
  display: none;
}

/* Presence panel */
.floating-presence-panel {
  position: fixed;
  left: 22px;
  bottom: 22px;
  width: min(240px, calc(100vw - 44px));
  max-height: 42vh;
  overflow: hidden;
  padding: 14px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
  z-index: 1700;
}

/* Session members panel (reuse presence styles, different position) */
.floating-session-panel {
  position: fixed;
  right: 22px;
  bottom: calc(22px + 52vh + 16px);
  width: min(360px, calc(100vw - 44px));
  max-height: 46vh;
  overflow: hidden;
  padding: 14px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
  z-index: 1700;
}
.presence-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.presence-title {
  font-size: 16px;
  font-weight: 1000;
}
.presence-actions {
  display: flex;
  gap: 8px;
}
.presence-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  max-height: calc(42vh - 72px);
  padding-right: 4px;
}
.presence-item {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 900;
}
.presence-sub {
  font-size: 12px;
  opacity: 0.7;
  font-weight: 800;
}

.presence-avatar{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.10);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size: 14px;
  font-weight: 1000;
  color: #fff;
  overflow: hidden;
  flex: 0 0 auto;
}
.presence-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
.modal-overlay.active {
  display: flex;
}
.modal {
  width: min(520px, 92vw);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}
.modal-title {
  font-size: 18px;
  font-weight: 1000;
  margin-bottom: 10px;
}
.modal-title-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.icon-btn{
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.04);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.icon-btn svg{
  width: 20px;
  height: 20px;
  fill: rgba(0,0,0,0.72);
}
.icon-btn:hover{
  background: rgba(0,0,0,0.06);
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
  flex-wrap: wrap;
}
.random-result {
  padding: 14px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.04);
  font-weight: 1000;
}
.random-candidates{
  margin-top: 10px;
  display:flex;
  flex-direction: column;
  gap: 10px;
}
.random-candidate{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.65);
}
.random-candidate .meta{
  min-width: 0;
}
.random-candidate .title{
  font-weight: 1000;
}
.random-candidate .sub{
  opacity: .7;
  font-size: 12px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.random-candidate .actions{
  display:flex;
  gap: 8px;
  flex-shrink: 0;
}

.form-row{
  display:flex;
  gap: 12px;
  align-items:flex-start;
  padding: 10px 0;
}
.form-label{
  width: 110px;
  font-weight: 1000;
  padding-top: 10px;
}
.form-control{
  flex:1;
  min-width: 0;
}

/* 랜덤 룰렛(슬롯머신 스타일) */
.roulette-multi{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 12px auto 10px;
  width: min(420px, 92vw);
}
.roulette-list-wrap{
  position: relative;
  width: 100%;
  /* 미니 룰렛: 후보가 많을 때(최대 5개) 모달이 넘치지 않도록 높이를 더 줄임 */
  height: 80px;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.04);
  overflow: hidden;
}
.roulette-list{
  position:absolute;
  left:0; right:0;
  top:0;
  will-change: transform;
}
.roulette-item{
  height: 28px;
  display:flex;
  align-items:center;
  padding: 0 14px;
  gap:10px;
  font-weight: 1000;
  font-size: 13px;
}
.roulette-item .sub{
  font-weight: 900;
  opacity: .65;
  font-size: 12px;
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 45%;
}
.roulette-fade{
  position:absolute; left:0; right:0;
  height: 34px;
  z-index: 2;
  pointer-events:none;
}
.roulette-fade.top{ top:0; background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0)); }
.roulette-fade.bottom{ bottom:0; background: linear-gradient(0deg, rgba(255,255,255,0.92), rgba(255,255,255,0)); }
.roulette-center-line{
  position:absolute;
  left:12px; right:12px;
  top:50%;
  transform: translateY(-50%);
  height: 0;
  border-top: 2px solid rgba(59,109,246,0.35);
  z-index: 3;
}

/* 가능곡 선택모드 하단 바 */
.availability-edit-bar{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  width: min(720px, calc(100vw - 32px));
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: 0 18px 46px rgba(0,0,0,0.18);
  backdrop-filter: blur(18px);
  z-index: 1900;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.availability-edit-title{ font-weight: 1000; }
.availability-edit-actions{ display:flex; gap:10px; }

.toast {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.86);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 900;
  z-index: 2100;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(2px);
}

.loading-screen {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  z-index: 2200;
  font-weight: 1000;
  font-size: 18px;
}
.loading-screen.active {
  display: grid;
}

/* Loading animation (private songbook) */
.loading-default{
  display:block;
}
.loading-anim{
  display:none;
}
body.archive-mode .loading-default{ display:none; }
body.archive-mode .loading-anim{ display:grid; }

.loading-anim{
  position: relative;
  width: min(720px, 92vw);
  justify-items:center;
  align-items:center;
  gap: 14px;
  padding: 26px 18px;
}
.loading-ring{
  position:absolute;
  width: 220px;
  height: 220px;
  left: 50%;
  top: 50%;
  margin-left: -110px;
  margin-top: -110px;
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,0.10);
  border-top-color: rgba(59,109,246,0.55);
  animation: mbspin 1.2s linear infinite;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,0.10));
  z-index: 0;
}
.loading-title-image{
  display:block;
  z-index: 1;
  max-width: min(680px, 92vw);
  max-height: 180px;
  border-radius: 18px;
  object-fit: cover;
  background: linear-gradient(90deg, rgba(0,0,0,0.06), rgba(0,0,0,0.03), rgba(0,0,0,0.06));
  background-size: 240% 100%;
  background-color: rgba(255,255,255,0.75);
  animation:
    mbLoadingDrop 1.25s cubic-bezier(0.16, 1, 0.3, 1) both,
    mbLoadingShimmer 1.4s ease-in-out infinite;
  box-shadow: 0 18px 46px rgba(0,0,0,0.10);
  border: 1px solid rgba(255,255,255,0.65);
}
.loading-profile{
  z-index: 1;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.70);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: 0 16px 44px rgba(0,0,0,0.10);
  animation: mbLoadingRise 1.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.loading-profile-image{
  display:block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(90deg, rgba(0,0,0,0.06), rgba(0,0,0,0.03), rgba(0,0,0,0.06));
  background-size: 240% 100%;
  background-color: rgba(0,0,0,0.06);
  animation: mbLoadingShimmer 1.4s ease-in-out infinite;
  border: 1px solid rgba(0,0,0,0.10);
}
.loading-nickname{
  font-size: 18px;
  font-weight: 1000;
  letter-spacing: -0.02em;
}
@keyframes mbLoadingDrop{
  0%{ transform: translateY(-80px); opacity: 0; }
  65%{ opacity: 1; }
  100%{ transform: translateY(0); opacity: 1; }
}
@keyframes mbLoadingRise{
  0%{ transform: translateY(80px); opacity: 0; }
  65%{ opacity: 1; }
  100%{ transform: translateY(0); opacity: 1; }
}
@keyframes mbLoadingShimmer{
  0%{ background-position: 0% 50%; }
  100%{ background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce){
  .loading-title-image, .loading-profile, .loading-ring{ animation: none !important; }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .layout-nav {
    order: 2;
  }
  .floating-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .search-grid .select{
    flex:1 1 120px;
  }
}
