/* 창: 관리 창(배지·회원·기록·아바타·피드백), 공개 플레이리스트, 사용법 안내 (화면 스타일은 public/css/의 파일 여러 개를 index.html이 이 순서로 불러온다: theme.css → base.css → stage.css → playlist.css → side.css → dialogs.css → misc.css) */
/* ---------- 방장·관리자 ---------- */
.badge {
  display: inline-block;
  flex: none;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-owner { background: var(--grab); color: #170a28; }
.badge-admin { background: color-mix(in srgb, var(--grab) 22%, transparent); color: var(--grab); }
.dancer.is-admin .dancer-name { color: var(--grab); }
.btn-admin { border-color: color-mix(in srgb, var(--grab) 55%, transparent); color: var(--grab); }
.btn-danger { color: var(--danger-text); }
.btn-danger.is-armed { background: var(--meh); border-color: transparent; color: #1a0509; }

.row-who { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; }
.row-tools { display: flex; gap: 4px; flex: none; }
.mini {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: none;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  cursor: pointer;
}
.mini:hover { color: var(--fg); border-color: var(--line-hover); }

.msg { position: relative; }
.msg-del {
  position: absolute;
  top: 0;
  right: 0;
  opacity: 0;
  background: var(--panel);
}
.msg:hover .msg-del, .msg-del:focus-visible { opacity: 1; }
@media (hover: none) { .msg-del { opacity: 0.7; } }

/* 주소 옮김 안내(move.js): 눈에 잘 띄게 크게, 가운데 */
.dialog.dialog-moved { width: min(calc(100% - 2 * var(--gutter)), 420px); text-align: center; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent), 0 20px 60px rgba(0, 0, 0, 0.6); }
.dialog-moved .moved-emoji { margin: 0; font-size: 44px; line-height: 1.1; }
.dialog-moved .moved-title { margin: 8px 0 4px; font-size: 21px; line-height: 1.35; }
.dialog-moved .moved-addr { margin: 0 0 10px; font-size: 18px; }
.dialog-moved .moved-addr b { color: var(--accent); font-size: 22px; }
.dialog-moved .dialog-actions { justify-content: center; }
/* .dialog(320px)보다 뒤에 와도 이기도록 두 클래스로 쓴다 */
.dialog.dialog-wide {
  width: min(calc(100% - 2 * var(--gutter)), 560px);
  max-height: min(85vh, 760px);
  overflow-y: auto;
}
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.admin-head h2 { margin: 0; font-size: 18px; }
/* 관리·공개 플리 창: 스크롤해도 제목과 닫기 버튼은 위에 붙어 있다.
   고정 위치는 창 안쪽 여백(20px) 안쪽 기준이라, 여백만큼 끌어올려(-20px) 창 가장자리에 붙인다 */
.dialog-wide .admin-head,
.dialog-settings .admin-head {
  position: sticky;
  top: -20px;
  z-index: 2;
  margin: -20px -20px 0;
  padding: 20px 20px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
/* 관리 창 탭: 제목 줄 아래, 같이 위에 붙어 있다. 좁으면 두 줄로 내려간다 */
.admin-head { flex-wrap: wrap; row-gap: 10px; }
.admin-tabs { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: -13px; }
.admin-tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.admin-tab:hover { color: var(--fg); }
.admin-tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.admin-tab .count { background: var(--grab); color: #170a28; }
#admin { min-height: min(70vh, 560px); }
.admin-panel > .admin-sec:first-child { border-top: 0; }
.admin-sec { display: flex; flex-direction: column; gap: 8px; padding-block: 14px; border-top: 1px solid var(--line); }
.admin-sec .panel-label { margin: 0; }
.admin-sec p { margin: 0; }
.admin-sec > .btn { align-self: flex-start; }
.dialog .row-form { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.row-form .input { flex: 1 1 160px; width: auto; min-width: 0; }
.members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.member {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--panel-2);
}
.member-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.member-info { flex: 1; min-width: 0; }
.member-name { display: flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.member-name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-meta { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 12px; color: var(--muted); }
.member-meta .on { color: var(--woot); }
.member-meta .lock { color: var(--danger-text); }
.member-tools { display: flex; flex-wrap: wrap; gap: 6px; }
/* 관리 창 "기록" 탭 */
.act-stats { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 13px; }
.act-stat { display: flex; align-items: baseline; gap: 6px; }
.act-label { font-size: 12px; color: var(--muted); }
.act-sessions summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.act-sessions ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.dialog-note { margin: -4px 0 0; }
.btn-admin .count { background: var(--grab); color: #170a28; }
.fb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fb-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--panel-2);
  box-shadow: inset 2px 0 0 transparent;
}
.fb-item.is-unread { box-shadow: inset 2px 0 0 var(--grab); }
.fb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; font-size: 12px; color: var(--muted); }
.fb-meta b { color: var(--fg); font-weight: 600; }
.fb-new { color: var(--grab); font-weight: 600; }
.fb-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-item.is-read .fb-text { color: var(--muted); }
.fb-tools { display: flex; gap: 6px; }
.fb-av-tag { color: var(--accent); font-weight: 600; }
.fb-av-body { display: flex; gap: 12px; align-items: flex-start; }
.fb-av-orig { flex: none; display: block; }
.fb-av-orig img { display: block; width: 96px; height: 96px; object-fit: contain; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); }
.fb-av-words { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fb-av-words p { margin: 0; }

/* ---------- 공개 플레이리스트 ---------- */
.pl-tab-pub {
  padding: 0 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}
.pl-bar-info .pub { color: var(--accent); font-weight: 600; }
/* 깡통 라디오가 트는 관리자 플레이리스트 */
.pl-tab-radio {
  padding: 0 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--woot) 18%, transparent);
  color: var(--woot);
  font-size: 10px;
  font-weight: 700;
}
.pl-bar-info .radio { color: var(--woot); font-weight: 600; }
.pub-sec { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.pub-sec p { margin: 0; }
.pub-lists {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.pub-card {
  width: 100%;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  text-align: left;
  cursor: pointer;
}
.pub-card:hover { border-color: var(--line-hover); }
.pub-cover { width: 64px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; background: #000; }
.pub-card-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-card-meta { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--muted); }
.pub-card-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-back { align-self: flex-start; padding-left: 0; }
.pub-name { margin: 0; font-size: 16px; }
.pub-owner { margin-top: 2px !important; }
.pub-target { display: flex; align-items: center; gap: 10px; }
.pub-target .field-label { flex: none; }
.pub-target select { flex: 1; width: auto; min-width: 0; }
.pub-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pub-check-all { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.pub-actions-right { display: flex; gap: 6px; flex-wrap: wrap; }
.pub-items { max-height: 50vh; overflow-y: auto; }
.pl-item.pub-item { grid-template-columns: 18px 64px minmax(0, 1fr); cursor: pointer; }
.pub-item input, .pub-check-all input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

/* ---------- 사용법 안내 ---------- */
.tour { position: fixed; inset: 0; z-index: 100; }
/* 비출 부분 바깥을 큰 그림자로 어둡게 칠한다. 비출 곳이 없으면 크기 0으로 화면 전체가 어두워진다 */
.tour-spot {
  position: absolute;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(4, 5, 9, 0.74), 0 0 0 2px var(--accent);
  pointer-events: none;
  transition: left 0.22s ease, top 0.22s ease, width 0.22s ease, height 0.22s ease;
}
.tour-spot.is-none { box-shadow: 0 0 0 9999px rgba(4, 5, 9, 0.74); }
.tour-card {
  position: absolute;
  width: min(380px, calc(100vw - 2 * var(--gutter)));
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.tour-step { margin: 0; font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.04em; }
.tour-card h3 { margin: 0; font-size: 16px; text-wrap: balance; }
.tour-card #tour-body { margin: 0; line-height: 1.65; color: var(--fg-soft); }
.tour-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.tour-skip { margin-right: auto; padding-left: 0; }
@media (prefers-reduced-motion: reduce) {
  .tour-spot { transition: none; }
}
