/* ─────────────────────────────────────────────
   피터새노래방 - style.css
   컨셉: 파스텔 보라 배경 + 흰 카드 3단 노래방 콘솔
   ───────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Jua&family=Noto+Sans+KR:wght@400;500;700;900&display=swap');

/* ─────────────────────────────────────────────
   테마
   ── 테마마다 실제로 다시 정의하는 값은 --accent 3개 + --page-bg 뿐이다.
   그 밖의 파스텔 톤(카드 배경, 테두리, 그림자 등)은 전부 --accent에서
   color-mix()로 계산해서 쓰므로, 새 테마를 추가할 때 그 4개만 채우면
   앱 전체가 자동으로 맞춰진다. (계산식은 :root 아래쪽에 한 번만 정의)

   색상은 대부분 순수 계산값이지만, 아주 옅은 배경 톤 몇 개는 원래 디자인
   시안의 값과 정확히 겹치도록 %를 역산해서 골랐다(예: 8% → 기존 --accent-soft).
   ───────────────────────────────────────────── */

/* 기본(블루) — 사진 없이 그라디언트만 쓰는 테마.
   data-theme가 없거나 모르는 값일 때도 여기로 떨어지므로 :root에도 같이 건다. */
:root,
:root[data-theme="blue"] {
  --accent:      #2F6FED;
  --accent-deep: #1D4FC4;
  --accent-alt:  #16327E; /* 링크/보조 버튼(+예약 등)에 쓰는 두 번째 색 */

  --page-bg:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.22), transparent 45%),
    radial-gradient(circle at 88% 4%, rgba(255, 255, 255, 0.12), transparent 45%),
    linear-gradient(170deg, #3E7BF2 0%, #2660DE 55%, #1B4FC4 100%);
}

/* ── 배경 사진 테마 (img/bg/) ──
   사진을 그라디언트 "위에" 얹어서, 파일이 없거나 아직 안 받아졌어도
   아래 그라디언트가 그대로 보이며 화면이 깨지지 않는다.
   사진마다 아래쪽에 캐릭터가 그려져 있어서, 화면이 납작해 잘릴 때
   위가 먼저 잘리도록 center bottom으로 붙인다. */

/* 구름 하늘 — 햇살과 뭉게구름 */
:root[data-theme="sky"] {
  --accent:      #1273CC;
  --accent-deep: #0C58A6;
  --accent-alt:  #0A4A8C;

  --page-bg:
    url("img/bg/bg-sky.jpg") center bottom / cover no-repeat,
    linear-gradient(170deg, #6FB6F5 0%, #A6D8F9 45%, #D8EDFB 100%);
}

/* 봄 들판 — 파스텔 하늘과 튤립밭 (보조색은 튤립 분홍) */
:root[data-theme="lightBlue"] {
  --accent:      #1E7BC8;
  --accent-deep: #1461A6;
  --accent-alt:  #C93F78;

  --page-bg:
    url("img/bg/bg-lightBlue.jpg") center bottom / cover no-repeat,
    linear-gradient(170deg, #CDEAFA 0%, #E3F3FC 55%, #F2FAE9 100%);
}

/* 초록 숲 — 햇빛 드는 숲길 */
:root[data-theme="green"] {
  --accent:      #1E8542;
  --accent-deep: #14682F;
  --accent-alt:  #0E7490;

  --page-bg:
    url("img/bg/bg-green.jpg") center bottom / cover no-repeat,
    linear-gradient(170deg, #A9DE8E 0%, #C6E9AC 50%, #E4F5D2 100%);
}

/* 밤하늘 — 호숫가 불꽃놀이 (보조색은 불꽃 보라) */
:root[data-theme="navy"] {
  --accent:      #3B5BD9;
  --accent-deep: #2A3FA8;
  --accent-alt:  #8B4FE0;

  --page-bg:
    url("img/bg/bg-navy.jpg") center bottom / cover no-repeat,
    linear-gradient(170deg, #10205E 0%, #172B78 55%, #24408F 100%);
}

/* 사진 테마 4종은 아래쪽에 캐릭터가 그려져 있으므로 띠를 그 높이에 맞춘다.
   근거 — 4종 모두 캐릭터가 원본 이미지(1440×1024)의 아래 약 136px 안에 들어간다.
   cover는 가로·세로 중 모자란 쪽에 맞춰 확대하므로 scale = max(vw/1440, vh/1024)이고,
   화면에서 캐릭터가 차지하는 높이도 같은 비율로 커진다 → 136 × scale.
     136/1440 = 9.5vw   (가로가 긴 창 — 맥북에어 13"처럼 납작한 화면이 여기)
     136/1024 = 13.4vh  (세로가 긴 창)
   둘 중 큰 쪽이 실제로 필요한 높이라 max()로 고른다. */
:root[data-theme="sky"],
:root[data-theme="lightBlue"],
:root[data-theme="green"],
:root[data-theme="navy"] {
  --bottom-band: clamp(90px, max(9.5vw, 13.4vh), 200px);
}

:root {
  /* --accent에서 자동으로 계산되는 파스텔 스케일.
     테마를 추가해도 이 아래는 다시 손댈 필요가 없다. */
  --accent-50:    color-mix(in srgb, var(--accent) 3%,  white);
  --accent-soft:  color-mix(in srgb, var(--accent) 8%,  white);
  --accent-100:   color-mix(in srgb, var(--accent) 13%, white);
  --accent-150:   color-mix(in srgb, var(--accent) 18%, white);
  --accent-200:   color-mix(in srgb, var(--accent) 21%, white);
  --accent-250:   color-mix(in srgb, var(--accent) 27%, white);
  --accent-muted: color-mix(in srgb, var(--accent) 47%, white);
  --accent-ink:   color-mix(in srgb, var(--accent) 57%, black); /* 그림자용 진한 톤 */

  --green:       #22C55E;
  --green-deep:  #16A34A;
  --red:         #EF4444;
  --red-soft:    #FFECEC;
  /* 인기차트 전용 강조색 — 순위(메달) 느낌이라 테마 색과 무관하게 항상 금빛 주황 */
  --hot:         #FFA426;
  --hot-deep:    #F07C0A;
  --hot-soft:    #FFF1DC;
  --ink:         #241E45;
  --ink-soft:    #6E6893;
  --white:       #FFFFFF;
  --line:        rgba(60, 40, 130, 0.10);
  --shadow-card: 0 6px 20px rgba(80, 55, 160, 0.10);
  --shadow-pop:  0 20px 60px rgba(50, 30, 110, 0.35);
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  /* 배경 사진 아래쪽 캐릭터가 가려지지 않도록 화면 맨 아래에 비워두는 띠의 높이.
     배경이 background-attachment: fixed라 캐릭터는 늘 화면(뷰포트) 맨 아래에 붙어 있고,
     PC에서는 내용이 이 띠 위 공간에 맞춰지므로 창 크기와 상관없이 항상 보인다.

     여기 값은 캐릭터가 없는 단색 테마(블루)용 — 그냥 화면 아래 숨 쉴 공간이다.
     사진 테마는 아래에서 캐릭터 높이에 맞춰 훨씬 크게 다시 잡는다. */
  --bottom-band: clamp(56px, 8vh, 96px);
}

* { box-sizing: border-box; }

/* js/icons.js가 data-icon 자리에 끼워 넣는 PNG — 칸 크기에 맞춰 비율 그대로 들어간다 */
.icon-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* flex/grid 레이아웃 규칙이 hidden 속성을 덮어쓰지 않도록 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--ink);
}

body {
  background: var(--page-bg);
  background-attachment: fixed;
  min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; }
input  { font-family: inherit; }

.app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 20px 24px;
  /* 마스코트(.theme-decor)보다 위에 오도록 쌓임 순서를 만든다 */
  position: relative;
  z-index: 1;
}

/* ── 테마 장식 마스코트 ──
   화면 아래에 고정되어 카드 사이·아래 여백으로 빼꼼 보이는 캐릭터들.
   장식일 뿐이라 클릭을 가로채지 않고(pointer-events: none), 화면이 좁으면 숨긴다. */
.theme-decor {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 0;
  pointer-events: none;
}
.theme-decor__mascot {
  position: absolute;
  bottom: 0;
  width: clamp(84px, 11vw, 168px);
  height: auto;
}
.theme-decor__mascot--left  { left: clamp(8px, 6vw, 120px); }
.theme-decor__mascot--right { right: clamp(8px, 6vw, 120px); }

/* 좁은 화면은 세로로 길게 쌓이는 구조라, 고정 장식이 내용을 가려 방해가 된다 */
@media (max-width: 940px) {
  .theme-decor { display: none; }
}

/* ── 상단바 ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* 로고 + 테마 견본 5개 + 버튼이 좁은 폭에서 밖으로 삐져나가지 않도록 */
  flex-wrap: wrap;
  gap: 16px;
  padding: 4px 4px 12px;
}

.topbar__brand { max-width: 100%; }
.topbar__heading { margin: 0; font-size: inherit; line-height: 1; }
.topbar__intro {
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--ink);
}

.topbar__logo {
  display: block;
  height: 62px;
  width: auto;
  filter: drop-shadow(0 6px 12px rgba(60, 40, 130, 0.28));
}

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

/* ── 테마 선택 ── */
.theme-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  background: var(--white);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
}
.theme-swatch {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  /* 견본(단색·그라디언트·배경 썸네일)은 js/theme.js가 --swatch-color로 채운다 */
  background: var(--swatch-color, var(--accent));
  /* 옅은 배경 썸네일이 흰 패널에 묻히지 않도록 안쪽에 가느다란 테두리 */
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
  display: grid;
  place-items: center;
  position: relative;
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.theme-swatch:hover { transform: translateY(-1px) scale(1.06); }
.theme-swatch.is-active { border-color: var(--ink); }
/* 사진 견본 위에서도 체크가 보이도록 어둡게 깔고 그 위에 얹는다 */
.theme-swatch.is-active::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.34);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.topbar__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border: none;
  border-radius: 999px;
  /* 위를 살짝 밝게 해서 유리알처럼 볼록해 보이게 한다 */
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent-deep));
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  /* 그림자 네 겹을 겹쳐서 "빛나는" 느낌을 만든다. 위에 적은 것이 위에 그려진다.
       1) 윗변 안쪽 흰 선 — 빛을 받아 반짝이는 모서리
       2) 아랫변 안쪽 어두운 선 — 반대편이라 그늘진 모서리
       3~4) 바깥으로 번지는 밝은 파랑 — 발광. 테두리에 붙는 얇은 링 + 넓게 퍼지는 빛
       5) 아래로 떨어지는 어두운 그림자 — 페이지 위에 떠 있는 느낌 */
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 0 rgba(0, 0, 0, 0.10),
    0 0 0 1px color-mix(in srgb, var(--accent-muted) 45%, transparent),
    0 0 16px color-mix(in srgb, var(--accent-muted) 60%, transparent),
    0 8px 18px color-mix(in srgb, var(--accent-ink) 35%, transparent);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
/* 올려두면 빛이 더 세진다 */
.topbar__btn:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.65),
    inset 0 -2px 0 rgba(0, 0, 0, 0.10),
    0 0 0 1px color-mix(in srgb, var(--accent-muted) 65%, transparent),
    0 0 24px color-mix(in srgb, var(--accent-muted) 80%, transparent),
    0 12px 22px color-mix(in srgb, var(--accent-ink) 42%, transparent);
}
.topbar__btn:active { transform: translateY(0); }
.topbar__btn--fullscreen { padding-inline: 14px; }
.topbar__btn-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 7px;
  font-size: 12px;
}
/* 아이콘 PNG는 원본이 무슨 색이든 파란 버튼 위에서 보이도록 흰색으로 칠해서 쓴다 */
.topbar__btn-icon .icon-img { filter: brightness(0) invert(1); }

/* ── 3단 레이아웃 ──
   flexbox + order를 쓴다: 폭(flex-basis)이 "몇 번째 칸인지"가 아니라
   컬럼 자신(.col--left/center/right)에 묶여 있으므로, order로 순서만 바꿔도
   각 컬럼의 크기는 그대로 유지된다. */
.layout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* 좌/중앙/우 컬럼 드래그 위치 이동 핸들 — PC(3단 나란히 배치) 화면에서만 보인다.
   (모바일·태블릿은 반응형 규칙이 각 컬럼 위치를 직접 지정하므로 손대지 않는다) */
.col__drag-handle {
  display: none;
}
.col.is-dragging { opacity: 0.4; }
.col.is-drop-target {
  outline: 3px dashed var(--accent);
  outline-offset: 6px;
  border-radius: var(--r-lg);
}

@media (min-width: 941px) {
  /* 내용을 화면 높이에 맞추고 아래 --bottom-band 만큼을 비워둔다.
     페이지 자체는 스크롤되지 않고, 넘치는 컬럼만 컬럼 안에서 스크롤된다. */
  .app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--bottom-band);
  }
  .layout { flex: 1; min-height: 0; }
  /* 안쪽 여백은 카드 글로우가 스크롤 영역 경계에서 잘리지 않게 두는 것이고,
     그만큼 컬럼 폭을 키우고 음수 마진으로 당겨서 카드 크기·간격은 그대로 유지한다. */
  .col {
    max-height: 100%;
    overflow-y: auto;
    padding: 8px;
    margin: -8px;
  }

  /* 각 컬럼의 폭은 정체성(클래스)에 고정 — order로 위치가 바뀌어도 크기는 그대로다.
     우측은 기본이 좁다. 세로가 넉넉하면 설정 카드를 그냥 쌓아도 들어가므로,
     남는 폭은 가운데 영상에 주는 편이 낫다. (낮은 창에서의 처리는 아래 블록 참고) */
  .col--left   { flex: 0 0 316px; }
  .col--center { flex: 1 1 0%; }
  .col--right  { flex: 0 0 176px; }

  /* auto-fit이라 칸이 하나만 들어갈 만큼 좁아지면 저절로 예전처럼 세로 한 줄이 된다 —
     공연 모드의 260px 설정 칸이 그 경우다. */
  /* 120px으로 잡으면 좁은 쪽 단계(286px 컬럼, 안쪽 폭 244px)에서 두 칸이 못 들어가
     조용히 1열로 되돌아간다 — 그러면 카드가 다시 길어져 넘친다. 112px이 그 경계 아래다. */
  .col--right .ctl__options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  }
  /* 홀수 개(키·반복은 3개)일 때 마지막 하나가 왼쪽에 덩그러니 남는다 — 한 줄을 다 쓰게 한다.
     속도는 4개라 2×2로 딱 떨어지므로 이 규칙에 걸리지 않는다. */
  .col--right .opt:last-child:nth-child(odd) { grid-column: 1 / -1; }

  /* ── 영상 크기는 폭이 아니라 "남은 높이"가 정한다 ──
     16:9라 컬럼 폭을 다 채우면 높이가 따라 커진다. 1437×783 같은 납작한 창에서는
     그것만으로 511px이라 컬럼이 넘치고 아래 캐릭터 띠까지 잡아먹었다. 그래서 순서를 뒤집는다.
       · 가운데 컬럼이 세로를 꽉 채우고 (스크롤 대신 안에서 크기를 맞춘다)
       · .stage가 예약 목록을 뺀 나머지 높이를 전부 가져가고
       · 화면은 그 높이에 맞춰 16:9로 폭을 거꾸로 계산해 가운데 정렬된다.
     남는 좌우 여백에는 고정 배경이 그대로 비쳐서 배경 그림이 오히려 더 드러난다.
     창 크기가 뭐든 자동으로 맞으므로 화면별 예외 규칙을 둘 필요가 없다. */
  .col--center {
    align-self: stretch;
    /* .col의 max-height/overflow는 "넘치면 스크롤"용이라 여기서는 방해가 된다 */
    max-height: none;
    overflow: visible;
  }
  .col--center .queue { flex: 0 0 auto; }
  /* .stage는 컬럼 폭 그대로 둔다. align-self:center로 내용 폭에 맞추면 재생 컨트롤 바의
     최소 폭이 영상 폭을 눌러 16:9가 깨진다(531×372로 측정됨). 재생바가 영상보다 조금
     넓게 깔리는 대신, 영상 비율은 어떤 창 크기에서도 정확히 유지된다. */
  .col--center .stage { flex: 0 1 auto; min-height: 0; }
  .col--center .transport { flex: 0 0 auto; }

  /* 예약 목록과 재생바를 뺀 "영상 칸". 여기서만 실제 상자가 된다.
     aspect-ratio로 자기 폭에서 높이를 얻고 flex-grow는 0 — "필요한 만큼만" 차지한다.
     세로가 모자라면 flex-shrink로 줄어들고, 그 줄어든 높이가 아래 100cqh에 그대로 반영된다.
     (grow를 켜두면 세로가 남을 때 칸만 늘어나고 영상은 폭에 묶여 그대로라, 그 차이가
      영상과 재생바 사이 빈 공간으로 벌어진다 — 아이패드 프로 세로 1024×1366에서 313px이었다) */
  .col--center .stage__viewport {
    display: flex;
    flex: 0 1 auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
    align-items: center;
    justify-content: center;
    /* 이 칸의 높이를 100cqh로 읽기 위한 선언. 높이가 폭과 flex로 정해져서
       내용에 의존하지 않으므로 순환 참조가 생기지 않는다.
       (size 컨테인먼트는 잘라내기(paint)를 포함하지 않아 화면 둘레의 네온 발광은 그대로 번진다) */
    container-type: size;
  }
  /* 폭 = min(칸 폭, 칸 높이 × 16/9).
     세로가 남을 때는 칸이 이미 16:9라 두 값이 같아 폭에 딱 맞고,
     세로가 모자라 칸이 눌리면 높이 쪽이 작아져 영상이 비율을 지킨 채 함께 줄어든다.
     높이는 aspect-ratio가 폭에서 따라 계산한다.
     (flex:1로 높이를 채우게 하면, 컬럼이 좁을 때 폭만 잘리고 세로는 늘어난 채로 남아 비율이 깨진다
      — 1920×1080에서 .app이 1440px로 묶이는 경우가 정확히 그랬다) */
  .col--center .stage__screen {
    flex: none;
    width: min(100%, calc(100cqh * 16 / 9));
    height: auto;
  }
  /* JS가 --col-order로 지정한 순서대로 배치된다 */
  .col { order: var(--col-order, 0); }

  /* 바텀시트 그립바 스타일의 작은 손잡이 — 칸 위에 살짝 얹혀 있는 느낌으로 */
  .col__drag-handle {
    display: flex;
    align-self: center;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 18px;
    margin-bottom: -6px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: grab;
  }
  .col__drag-handle::before {
    content: "";
    width: 32px;
    height: 5px;
    border-radius: 999px;
    background: var(--accent-250);
    transition: background 0.15s ease, width 0.15s ease;
  }
  .col__drag-handle:hover::before { width: 40px; background: var(--accent); }
  .col__drag-handle:active { cursor: grabbing; }
  .col__drag-handle:active::before { background: var(--accent-deep); }
}

/* ── 좌측 콘솔·우측 설정의 세로 여백을 창 높이에 따라 연속적으로 줄인다 ──
   영상은 위 "높이 우선" 규칙이 알아서 맞춰지지만, 이 두 컬럼은 내용 높이가 사실상 고정이라
   창이 낮으면 그대로 넘친다.

   예전에는 max-height: 930px 한 단계로 끊어 줄였는데, 그 경계 아래로는 창이 아무리 더
   낮아져도 더는 줄지 않아 결국 넘쳤다(1100×700에서 좌 41px·우 125px 초과). clamp로 바꿔
   단계 자체를 없앤다. 세로 여백과 버튼 높이만 건드리고 글자 크기는 그대로라 읽기 어려워지지 않는다.

   ⚠ 선택자에 .col--left / .col--right를 반드시 붙일 것.
   .key·.panel--ctl 같은 기본 규칙이 파일 아래쪽에 있어서, 같은 특이도로 쓰면
   미디어 쿼리 안이라도 나중 규칙에 덮여 조용히 무시된다.
   (실제로 예전 블록의 .panel--ctl·.ctl__head 두 줄이 이 이유로 동작하지 않고 있었다) */
@media (min-width: 941px) {
  .col { gap: clamp(8px, 1.28vh, 12px); }


  .col--left .panel { padding: clamp(10px, 1.5vh, 14px); }
  .col--left .screen { margin-bottom: clamp(7px, 1.15vh, 12px); }
  .col--left .screen__body { min-height: clamp(42px, 6.4vh, 56px); }
  .col--left .tabs { margin-bottom: clamp(8px, 1.28vh, 14px); }
  .col--left .keypad { gap: clamp(6px, 0.9vh, 8px); }
  .col--left .key { height: clamp(32px, 4.9vh, 46px); }
  .col--left .keypad__actions { margin-top: clamp(8px, 1.28vh, 12px); }
  .col--left .action { height: clamp(36px, 5.2vh, 46px); }
  .col--left .guide { padding: clamp(8px, 1.4vh, 12px) 14px; }
  /* 구절 검색·인기 TOP7 탭의 목록도 같이 줄어야 키패드 탭과 높이가 비슷하게 유지된다 */
  .col--left .song-list { max-height: clamp(180px, 38vh, 340px); }

  .col--right .panel--ctl { padding: clamp(10px, 1.5vh, 15px) 13px; }
  .col--right .ctl__head { margin-bottom: clamp(7px, 1.15vh, 12px); }
  .col--right .ctl__options { gap: clamp(6px, 0.9vh, 8px); }
  .col--right .opt { padding: clamp(7px, 1vh, 11px) 8px; }
}

/* 창이 아주 낮을 때(1280×650처럼 13인치 노트북을 꽉 채운 경우)는 위 clamp가 바닥값에
   닿아도 좌측 콘솔이 60px쯤 넘친다. 그러면 맨 아래 [가이드] 카드가 반쯤 잘린 채
   배경 위에 걸쳐 보여서 오히려 지저분하다. 여기서는 카드를 한 줄짜리 띠로 접는다 —
   캐릭터 그림과 설명 줄을 접고 제목만 남긴다. */
@media (min-width: 941px) and (max-height: 700px) {
  .col--left .panel { padding: 8px; }
  .col--left .panel__caption { margin-bottom: 6px; }
  .col--left .screen__body { min-height: 38px; }
  .col--left .keypad { gap: 5px; }
  .col--left .key { height: 30px; }
  .col--left .keypad__actions { margin-top: 6px; }
  .col--left .guide { padding: 8px 12px; gap: 10px; }
  .col--left .guide__char { width: 34px; }
  .col--left .guide__text small { display: none; }
}

/* 공연 모드의 설정 칸은 멀리서도 눌러야 해서 버튼을 크게 유지한다 — 세로 한 줄로 되돌린다 */
body.is-player-fullscreen .col--right .ctl__options {
  display: flex;
  flex-direction: column;
}

.panel {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 14px;
}

/* ── 좌측 탭 ── */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--accent-50);
  border: 2px solid var(--accent-150);
  border-radius: 12px;
  margin-bottom: 14px;
}
.tab {
  padding: 8px 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease;
}
.tab:hover { color: var(--accent); }
.tab.is-active {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: var(--white);
  box-shadow: 0 3px 8px color-mix(in srgb, var(--accent-ink) 32%, transparent);
}
/* 인기 TOP7만 순위 색(금빛 주황)으로 — 시안에서 이 탭만 따로 강조돼 있다 */
.tab[data-mode="popular"].is-active {
  background: linear-gradient(180deg, var(--hot), var(--hot-deep));
  box-shadow: 0 3px 8px rgba(200, 100, 0, 0.32);
}

.panel__caption {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

/* ── 번호 표시 스크린 ── */
.screen {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.screen__body {
  flex: 1;
  min-width: 0;
  min-height: 56px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--accent-50);
  border: 2px solid var(--accent-150);
  border-radius: var(--r-md);
}
.screen__display {
  font-family: 'Jua', sans-serif;
  font-size: 24px;
  letter-spacing: 3px;
  color: var(--accent-deep);
  line-height: 1.1;
}
.screen__display.is-empty { color: var(--accent-muted); }
.screen__status {
  font-size: 10.5px;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.screen__speaker {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 12px;
  background: transparent;
  font-size: 20px;
  transition: background 0.15s ease;
}
.screen__speaker:hover { background: var(--accent-soft); }

/* ── 키패드 ── */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.key {
  height: 46px;
  border: 2px solid var(--accent-100);
  border-radius: var(--r-md);
  background: var(--white);
  color: var(--accent);
  font-family: 'Jua', sans-serif;
  font-size: 20px;
  box-shadow: 0 2px 0 var(--accent-150);
  transition: transform 0.08s ease, background 0.12s ease, box-shadow 0.08s ease;
}
.key:hover { background: var(--accent-50); }
.key:active { transform: translateY(2px); box-shadow: none; }
.key--clear {
  color: var(--red);
  background: var(--red-soft);
  border-color: #FBD8D8;
  box-shadow: 0 2px 0 #F5CFCF;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 13px;
  font-weight: 700;
}
.key--fn {
  background: var(--accent-soft);
  border-color: var(--accent-200);
  box-shadow: 0 2px 0 var(--accent-250);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.keypad__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.action {
  height: 46px;
  border: none;
  border-radius: var(--r-md);
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.1s ease, filter 0.12s ease;
}
.action:hover { transform: translateY(-2px); filter: brightness(1.05); }
.action:active { transform: translateY(0); }
.action--reserve {
  background: linear-gradient(180deg, #4A57D6, #3239B5);
  box-shadow: 0 5px 12px rgba(50, 60, 190, 0.32);
}
.action--start {
  background: linear-gradient(180deg, #2FD16E, #16A34A);
  box-shadow: 0 5px 12px rgba(25, 165, 80, 0.32);
}

/* ── 검색 ── */
.searchbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 7px;
  background: var(--white);
  border: 2px solid var(--accent-150);
  border-radius: 999px;
  color: var(--ink-soft);
}
.searchbox:focus-within { border-color: var(--accent); }
/* 왼쪽 마이크 — 노래방 검색이라는 걸 한눈에 보여주는 표식 */
.searchbox__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: var(--white);
}
.searchbox input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  color: var(--ink);
}
.searchbox__clear {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--accent-150);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
}
.searchbox__clear:hover { background: var(--accent); }
.searchbox__clear[hidden] { display: none; }

.list-label {
  margin: 12px 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}

/* ── 곡 리스트 (검색결과 / 인기 TOP7) ── */
.song-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
}
.song-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 2px solid var(--accent-100);
  border-radius: var(--r-sm);
  background: var(--white);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.song-item:hover { border-color: var(--accent); background: var(--accent-50); transform: translateX(2px); }
.song-item__badge {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 7px;
  background: var(--accent-100);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
}
/* 인기차트는 순위표라 배지를 금빛으로 꽉 채워 등수가 먼저 눈에 들어오게 한다 */
.song-list--rank .song-item__badge {
  background: linear-gradient(180deg, var(--hot), var(--hot-deep));
  box-shadow: 0 2px 4px rgba(200, 100, 0, 0.30);
  color: var(--white);
  font-family: 'Jua', sans-serif;
  font-size: 13px;
}

/* 행 오른쪽 버튼 묶음 (예약 + 시작) */
.song-item__actions { display: flex; align-items: center; gap: 5px; }
.song-item__add,
.song-item__start {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px 9px;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition: filter 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.song-item__start {
  background: linear-gradient(180deg, var(--green), var(--green-deep));
  color: var(--white);
  box-shadow: 0 2px 5px rgba(22, 163, 74, 0.30);
}
.song-item__start:hover { filter: brightness(1.06); }
.song-item__body { min-width: 0; }
.song-item__title {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-item__ref {
  display: block;
  font-size: 11px;
  color: var(--ink-soft);
}
.song-item__add {
  background: var(--accent-100);
  color: var(--accent-alt);
}
.song-item__add:hover { background: var(--accent-alt); color: var(--white); }
.song-item__action-icon {
  display: grid;
  place-items: center;
  width: 12px;
  height: 12px;
}
.song-item__action-icon svg { display: block; }

.empty-state {
  padding: 26px 10px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.6;
}
.empty-state__icon { font-size: 28px; }

/* ── 가이드 카드 ──
   시안대로 연두색 흰 카드가 아니라 그라디언트 카드에 새 캐릭터가 들어간다.
   색을 고정하지 않고 --accent에서 계산하므로 초록 숲·밤하늘 테마에서는 그 테마 색으로 나온다. */
.guide {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: none;
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 82%, white), var(--accent-deep));
  /* 다른 요소와 같은 발광 어법 — 윗변 하이라이트 + 얇은 링 + 번지는 빛 + 그림자 */
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.45),
    0 0 0 1px color-mix(in srgb, var(--accent-muted) 45%, transparent),
    0 0 18px color-mix(in srgb, var(--accent-muted) 50%, transparent),
    var(--shadow-card);
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.guide:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.55),
    0 0 0 1px color-mix(in srgb, var(--accent-muted) 65%, transparent),
    0 0 26px color-mix(in srgb, var(--accent-muted) 70%, transparent),
    0 10px 22px color-mix(in srgb, var(--accent-ink) 35%, transparent);
}
.guide__char { width: 60px; height: auto; }
.guide__text strong {
  display: block;
  font-family: 'Jua', sans-serif;
  font-size: 19px;
  color: var(--white);
}
.guide__text small {
  display: block;
  font-size: 11.5px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.88);
}
/* 글자 "›"는 문장부호라 획이 얇고 글자 상자 안에서 위로 치우쳐 있어, 원 안에 넣으면
   작고 삐뚤어져 보인다. 그래서 도형으로 그린다(닫기 ✕와 같은 이유). */
.guide__chev {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--white);
  color: var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  transition: transform 0.12s ease;
}
.guide__chev svg { display: block; }
/* 카드 전체가 버튼이라, 카드에 마우스를 올리면 화살표가 살짝 나아간다 */
.guide:hover .guide__chev { transform: translateX(2px); }

/* ── 예약 목록 ── */
.queue {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 12px 14px;
}
.queue__title {
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 700;
}
.queue__title span { color: var(--accent); }
.queue__row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.queue__list {
  flex: 1;
  min-width: 0;
  list-style: none;
  margin: 0;
  padding: 2px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}
.queue__item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 260px;
  padding: 7px 8px 7px 12px;
  border: 2px solid var(--accent-100);
  border-radius: 11px;
  background: var(--white);
  font-size: 13px;
  font-weight: 500;
  cursor: grab;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.queue__item:hover { border-color: var(--accent); }
.queue__item.is-dragging { opacity: 0.45; }
.queue__item.is-over { border-color: var(--accent); transform: translateX(4px); }
.queue__item.is-playing { border-color: var(--green); background: #F3FCF6; }
.queue__item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue__item-del {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: none;
  border-radius: 7px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11.5px;
  font-weight: 700;
}
.queue__item-del:hover { background: var(--red); color: var(--white); }
.queue__empty {
  flex: 0 0 auto;
  padding: 8px 4px;
  color: var(--ink-soft);
  font-size: 12.5px;
}
.queue__clear {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border: 2px solid #FBD8D8;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}
.queue__clear:hover { background: var(--red); color: var(--white); border-color: var(--red); }
/* display:flex가 hidden 속성의 display:none을 덮어쓰므로 명시적으로 되돌린다 */
.queue__clear[hidden] { display: none; }

/* ── 플레이어 ── */
/* 시안대로 영상 화면을 흰 카드 없이 페이지 배경 위에 바로 올린다.
   흰 바탕이 있으면 아래 .stage__screen의 네온 발광이 흰색에 묻혀 안 보인다. */
.stage {
  display: flex;
  flex-direction: column;
}
/* 상자를 만들지 않아 기본 구조는 .stage > .stage__screen 그대로다.
   PC(3단) 레이아웃에서만 실제 상자가 되어 영상이 쓸 수 있는 높이의 기준이 된다. */
.stage__viewport { display: contents; }
.stage__screen {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  overflow: hidden;
  /* 시안의 네온 화면 테두리 — 밝은 테두리선에 안팎으로 빛이 번진다.
     안쪽 발광(1)은 영상이 재생되면 영상에 가려지고, 곡을 안 고른 대기 화면에서만 보인다.
     바깥 발광(3~4)은 항상 보이므로 여기가 이 효과의 핵심이다. */
  border: 2px solid color-mix(in srgb, var(--accent) 28%, white);
  box-shadow:
    inset 0 0 14px color-mix(in srgb, var(--accent-muted) 55%, transparent),
    0 0 0 3px color-mix(in srgb, var(--accent-muted) 45%, transparent),
    0 0 22px color-mix(in srgb, var(--accent-muted) 70%, transparent),
    0 0 46px color-mix(in srgb, var(--accent-muted) 45%, transparent);
  background: linear-gradient(180deg, #9FD7FF, #CFE9FF);
}
.stage__screen video,
.stage__screen .youtube-wrap,
.stage__screen iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}
.stage__screen video { object-fit: contain; }
.stage__screen video[hidden],
.stage__screen .youtube-wrap[hidden] { display: none; }

.stage__idle {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  color: #2C5C86;
}
.stage__idle img { width: 78px; height: auto; margin-bottom: 4px; }
.stage__idle-title { margin: 0; font-family: 'Jua', sans-serif; font-size: 22px; }
.stage__idle-desc { margin: 0; font-size: 13px; line-height: 1.6; opacity: 0.85; }

.stage__local {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(20, 15, 45, 0.82);
  color: var(--white);
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
}

.stage__tag {
  position: absolute;
  left: 12px;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(25, 18, 55, 0.62);
  color: var(--white);
  font-size: 12.5px;
  backdrop-filter: blur(4px);
}
.stage__tag-ref { opacity: 0.8; }
.stage__tag-title { font-weight: 700; }

/* ── 완주 결과 ──
   영상 폭을 기준으로 시안(846×472)의 캐릭터·점수·문구·버튼 비율을 유지한다. */
.stage__screen { container: score-stage / inline-size; }
.song-result {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 0;
  overflow: hidden;
  color: #fff;
  background: #0579ef url('img/score/score1_bg.png') center / cover no-repeat;
  animation: song-result-in 0.34s ease-out both;
}
.song-result[hidden] { display: none; }
.song-result[data-design="2"] {
  background-color: #7310ef;
  background-image: url('img/score/score2_bg.png');
}
.song-result__character {
  position: absolute;
  left: 5.5%;
  top: 9%;
  width: 31.3%;
  height: 75%;
  object-fit: contain;
}
.song-result[data-design="2"] .song-result__character { left: 4.4%; width: 33%; }
/* 곡 제목은 스크린 리더 설명으로 남기고 화면은 디자이너의 배치를 따른다. */
.song-result__song {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.song-result__score {
  position: absolute;
  left: 38%;
  top: 22%;
  width: 25%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8cqw;
  text-align: center;
}
.song-result__score-label {
  font-family: Arial, sans-serif;
  font-size: 4.7cqw;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 0.3cqw 0.4cqw rgba(0, 35, 98, 0.35);
}
.song-result__number { display: block; width: 100%; overflow: visible; }
.song-result__number text {
  font-family: Arial, sans-serif;
  font-size: 205px;
  font-weight: 900;
  letter-spacing: -10px;
  fill: url('#scoreGradient1');
  stroke: #fff;
  stroke-width: 4.5px;
  stroke-linejoin: round;
  paint-order: stroke fill;
}
.song-result[data-design="2"] .song-result__number text { fill: url('#scoreGradient2'); }
.song-result[data-digits="3"] .song-result__number text { font-size: 140px; letter-spacing: -7px; }
.song-result__title {
  position: absolute;
  left: 66%;
  top: 40%;
  width: 32%;
  margin: 0;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 3.8cqw;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.2cqw;
  text-align: left;
  text-shadow: 0 0.25cqw 0.45cqw rgba(30, 20, 95, 0.3);
}
.song-result__title.song-result__title--long { font-size: 3.2cqw; }
.song-result__actions {
  position: absolute;
  left: 38.7%;
  right: 18.6%;
  bottom: 16.5%;
  display: flex;
  gap: 0.9cqw;
  height: 13.6%;
}
.song-result__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1cqw;
  min-width: 0;
  padding: 0 2cqw;
  border: 0.24cqw solid rgba(0, 47, 144, 0.36);
  border-radius: 999px;
  color: #fff;
  font-size: 2.9cqw;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.song-result__btn svg { width: 3.2cqw; height: 3.2cqw; flex: none; }
.song-result__btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.song-result__btn--sub { flex: 1.4; background: rgba(0, 82, 239, 0.86); }
.song-result__btn--main { flex: 1; background: rgba(0, 183, 65, 0.94); }
.song-result__btn:focus-visible { outline: 3px solid #fff3b0; outline-offset: 2px; }
.song-result__countdown {
  position: absolute;
  left: 38.7%;
  right: 18.6%;
  bottom: 8%;
  margin: 0;
  color: #fff;
  font-size: clamp(9px, 1.8cqw, 16px);
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 20, 80, 0.8);
}
.song-result__countdown[hidden] { display: none; }
@container score-stage (max-width: 420px) {
  .song-result__character { top: 7%; height: 70%; }
  .song-result__score { top: 17%; }
  .song-result__title { top: 32%; font-size: 4cqw; }
  .song-result__actions { left: 36%; right: 4%; bottom: 7%; height: 44px; gap: 1.5cqw; }
  .song-result__btn { padding: 0 1.5cqw; font-size: 3.5cqw; }
  .song-result__btn svg { width: 4cqw; height: 4cqw; }
  .song-result__countdown { left: 36%; right: 4%; bottom: 0.5%; }
}
@keyframes song-result-in {
  from { opacity: 0; transform: scale(1.025); }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .song-result { animation: none; }
  .song-result__btn { transition: none; }
}

/* 컨트롤 바
   흰 카드를 걷어냈으므로 이 바가 스스로 바탕을 갖는다. 어두운 반투명이라
   밝은 봄 들판 배경에서도, 어두운 밤하늘 배경에서도 흰 글씨가 그대로 읽힌다. */
.transport {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(14, 22, 48, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.transport__btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-size: 16px;
  transition: background 0.12s ease;
}
.transport__btn:hover { background: rgba(255, 255, 255, 0.18); }
.transport__btn svg { display: block; }
/* [취소]만 글자를 함께 단다 — 다른 버튼과 달리 "누르면 부르던 곡이 끊긴다"라
   아이콘만으로는 실수로 누르기 쉽다. 그래서 정사각형 틀에서 벗어나 알약 모양이 된다. */
.transport__btn--cancel {
  width: auto;
  gap: 5px;
  padding: 0 11px 0 8px;
  display: flex;
  align-items: center;
  border-radius: 999px;
}
.transport__btn-label {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
/* [취소]는 부르던 곡을 중단시키는 버튼이라 hover에서 붉게 물들여 한 번 더 알려준다 */
.transport__btn--cancel:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.32);
  color: var(--white);
}
/* 재생 중이 아닐 때 — 자리는 지키되 눌리지 않는다는 게 보이게 흐린다 */
.transport__btn:disabled {
  opacity: 0.34;
  cursor: default;
}
.transport__btn:disabled:hover { background: transparent; }
.transport__time {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
  font-variant-numeric: tabular-nums;
}
.transport__seek { flex: 1; min-width: 0; }
.transport__volume { display: flex; align-items: center; gap: 4px; }
.transport__vol-range { width: 72px; }

/* 슬라이더도 어두운 바 위에 얹히므로 흰 계열로 뒤집는다 */
.transport input[type="range"] { background: rgba(255, 255, 255, 0.28); }
.transport input[type="range"]::-webkit-slider-thumb {
  background: var(--white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.transport input[type="range"]::-moz-range-thumb { background: var(--white); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-150);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 5px color-mix(in srgb, var(--accent-deep) 35%, transparent);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

/* ── 우측 컨트롤 패널 ── */
/* 시안처럼 흰 카드 둘레에 옅은 빛을 두른다. 영상 화면보다 약하게 — 여기까지 세게 하면
   화면 오른쪽이 너무 번쩍여서 정작 봐야 할 영상에서 눈이 분산된다. */
.panel--ctl {
  padding: 15px 13px;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-muted) 40%, transparent),
    0 0 18px color-mix(in srgb, var(--accent-muted) 45%, transparent),
    var(--shadow-card);
}
.ctl__head {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
/* 자리 크기를 고정해서, 기본 SVG든 나중에 얹는 PNG든 같은 자리에 맞게 들어간다 */
.ctl__head-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--accent);
}
.ctl__options { display: flex; flex-direction: column; gap: 8px; }
.opt {
  padding: 11px 8px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--accent-100);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  /* "0.75 배속"이 좁은 칸에서 두 줄로 접히지 않도록 */
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.opt:hover { border-color: var(--accent); background: var(--accent-50); color: var(--accent); }
.opt.is-active {
  border-color: transparent;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: var(--white);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--accent-ink) 32%, transparent);
}
.opt:disabled { opacity: 0.45; cursor: not-allowed; }
.ctl__warning {
  margin: 8px 0 0;
  font-size: 10.5px;
  line-height: 1.45;
  color: #C2410C;
}

/* ── 모달 공통 ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(35, 22, 75, 0.55);
  backdrop-filter: blur(3px);
}
.overlay[hidden] { display: none; }
/* 닫기(✕) — 글자 "✕"는 폰트마다 굵기·중심이 어긋나서 투박해 보이므로 도형으로 그린다.
   누르면 90° 돌면서 색이 차오른다. */
.overlay__close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--accent-100);
  color: var(--accent-deep);
  /* 흰 배경 위에서 원의 윤곽이 사라지지 않게 안쪽에 가느다란 테 */
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}
.overlay__close svg { display: block; }
.overlay__close:hover {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: var(--white);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--accent-ink) 32%, transparent);
  transform: rotate(90deg);
}
.overlay__close:active { transform: rotate(90deg) scale(0.94); }
/* 브라우저 기본 초점 테두리는 원형 버튼에 각지게 걸려서 지저분하다 — 테마 색 링으로 바꾼다 */
.overlay__close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 38%, transparent);
}

/* 전체 곡 목록 위에 겹쳐 뜨는 팝업(인기 곡)은 아래 모달보다 위에 있어야 한다 */
.overlay--nested { z-index: 60; }

/* ── 첫 방문 앱 보기 안내 ── */
.overlay--welcome { z-index: 70; }
.app-mode {
  position: relative;
  width: min(440px, 100%);
  padding: 32px 30px 26px;
  overflow: hidden;
  text-align: center;
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% -15%, var(--accent-100), transparent 52%),
    var(--white);
  box-shadow: var(--shadow-pop);
}
.app-mode__character {
  display: block;
  width: 92px;
  height: 92px;
  margin: -8px auto 5px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px color-mix(in srgb, var(--accent-ink) 18%, transparent));
}
.app-mode__eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.app-mode__heading {
  margin: 0;
  font-family: 'Jua', sans-serif;
  font-size: clamp(23px, 5vw, 29px);
  line-height: 1.25;
  color: var(--ink);
  word-break: keep-all;
}
.app-mode__desc {
  max-width: 340px;
  margin: 10px auto 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
  word-break: keep-all;
}
.app-mode__hint {
  margin: 14px 0 0;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--accent-50);
  color: var(--accent-deep);
  font-size: 13px;
  line-height: 1.55;
  word-break: keep-all;
}
.app-mode__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  margin-top: 20px;
}
.app-mode__start,
.app-mode__later {
  min-height: 46px;
  padding: 10px 16px;
  border: 0;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 800;
}
.app-mode__start {
  color: var(--white);
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  box-shadow: 0 6px 14px color-mix(in srgb, var(--accent-ink) 30%, transparent);
}
.app-mode__later { color: var(--ink-soft); background: var(--accent-50); }
.app-mode__start:hover { filter: brightness(1.06); }
.app-mode__later:hover { color: var(--accent-deep); background: var(--accent-100); }
.app-mode__start:active,
.app-mode__later:active { transform: translateY(1px); }
.app-mode__start:focus-visible,
.app-mode__later:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 2px;
}
.app-mode__snooze {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}
.app-mode__snooze input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}
.app-mode__snooze input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 32%, transparent);
  outline-offset: 2px;
}
.app-fullscreen-exit {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: var(--white);
  background: rgba(20, 15, 45, 0.78);
  box-shadow: 0 5px 16px rgba(20, 15, 45, 0.25);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 800;
  transform: translateX(-50%);
}
.app-fullscreen-exit[hidden] { display: none; }
.app-fullscreen-exit:hover { background: rgba(20, 15, 45, 0.94); }
.app-fullscreen-exit:focus-visible { outline: 3px solid var(--white); outline-offset: 2px; }

@media (max-width: 480px) {
  .app-mode { padding: 26px 18px 18px; border-radius: 22px; }
  .app-mode__character { width: 78px; height: 78px; }
  .app-mode__actions { grid-template-columns: 1fr; }
  .app-mode__later { order: 2; }
}

/* ── 인기 곡 팝업 ──
   순위만 잠깐 보는 작은 창이라 전체 곡 목록 모달보다 훨씬 좁게 잡는다. */
.peek {
  position: relative;
  width: min(430px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  padding: 22px 22px 18px;
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow-pop);
}
.peek__heading {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding-right: 44px; /* 닫기 버튼 자리 */
  font-family: 'Jua', sans-serif;
  font-size: 20px;
  color: var(--ink);
}
/* 순위 배지와 같은 금빛으로 맞춰서 "이 창은 순위표"라는 걸 색으로도 알려준다 */
.peek__heading-icon { display: grid; place-items: center; flex: none; color: var(--hot-deep); }
.peek__desc {
  margin: 6px 0 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
  word-break: keep-all;
}
/* .song-list의 max-height(340px) 대신 팝업 높이에 맞춰 늘었다 줄었다 하게 둔다 */
.peek__list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

/* ── 전체 곡 목록 ──
   왼쪽에서 장을 고르면 오른쪽 목록의 해당 장으로 스크롤되는 2단 구조. */
.songbook {
  position: relative;
  width: min(1180px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 22px 24px 20px;
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow-pop);
}

.songbook__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  /* 좁은 화면에서 범례가 제목을 밀어 눌러 제목이 깨지지 않도록, 범례를 아래 줄로 내린다 */
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-right: 48px; /* 닫기 버튼 자리 */
  margin-bottom: 16px;
}
.songbook__heading {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 9px;
  font-family: 'Jua', sans-serif;
  font-size: 22px;
  color: var(--ink);
}
.songbook__heading-icon { display: grid; place-items: center; flex: none; color: var(--accent); }
.songbook__total { color: var(--accent); font-size: 17px; white-space: nowrap; }
.songbook__desc {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}
/* 한글은 기본값이면 어절 한가운데에서도 줄이 바뀐다("전체 노 / 래 목록").
   keep-all은 띄어쓰기에서만 줄을 바꾼다. */
.songbook__heading,
.songbook__desc { word-break: keep-all; }
/* 단순한 범례가 아니라 눌러서 인기 순위를 여는 버튼이다 —
   눌리는 것처럼 보이도록 알약 모양 테두리를 두르고 hover에 반응시킨다. */
.songbook__legend {
  flex: 0 0 auto;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 6px;
  border: 2px solid var(--accent-100);
  border-radius: 999px;
  background: var(--white);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.songbook__legend:hover {
  border-color: var(--accent);
  background: var(--accent-50);
  color: var(--accent-deep);
}
.songbook__legend:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 32%, transparent);
}

/* 좌: 장 선택 / 우: 곡 목록 */
.songbook__body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 14px;
}

.songbook__chapters {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  border: 2px solid var(--accent-100);
  border-radius: var(--r-lg);
  background: var(--accent-50);
}
.songbook__chapters-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.songbook__chapter-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  align-content: start;
}
.songbook__chapter-btn {
  padding: 11px 4px;
  border: 2px solid var(--accent-100);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.songbook__chapter-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.songbook__chapter-btn.is-active {
  border-color: transparent;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: var(--white);
  box-shadow: 0 3px 8px color-mix(in srgb, var(--accent-ink) 30%, transparent);
}
/* 곡이 아직 한 곡도 없는 장 */
.songbook__chapter-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.songbook__content {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}
.songbook__content:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.songbook__group + .songbook__group { margin-top: 18px; }
.songbook__group-head {
  margin: 0 0 8px;
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.songbook__group-count { font-size: 12.5px; font-weight: 500; color: var(--ink-soft); }

.songbook__list {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 2px solid var(--accent-100);
  border-radius: var(--r-lg);
  background: var(--accent-50);
}
.songbook__row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 2px solid transparent;
  border-radius: var(--r-md);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.songbook__row:hover { border-color: var(--accent); transform: translateX(2px); }

/* 자리 크기를 고정해서, 기본 이퀄라이저든 나중에 얹는 PNG든 같은 자리에 맞게 들어간다 */
.songbook__row-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--accent);
}
/* 목소리(가이드 보컬) 계열 곡 — 아직 분류 데이터가 없어 기본은 이퀄라이저다 */
.songbook__row-icon.is-vocal { color: var(--red); }

/* 번호가 장·절 코드(4자리 또는 6자리)라 자리를 넉넉히 잡아둔다.
   폭을 고정해야 행마다 제목 시작 위치가 들쭉날쭉해지지 않는다. */
.songbook__row-num {
  min-width: 46px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.songbook__row-body { min-width: 0; }
.songbook__row-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.songbook__row-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.songbook__row-flags { display: flex; align-items: center; gap: 6px; }
.songbook__tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
}
.songbook__star {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--hot-soft);
  color: var(--hot-deep);
  font-size: 14px;
}

.songbook__row-actions { display: flex; align-items: center; gap: 8px; }
/* 시안대로 둘 다 색이 꽉 찬 버튼 — [예약]은 파랑, [시작]은 초록.
   (초록 [시작]은 검색 결과 목록의 버튼과도 같은 색이라 앱 안에서 의미가 일관된다) */
.songbook__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border: none;
  border-radius: 11px;
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: filter 0.12s ease, box-shadow 0.12s ease, transform 0.08s ease;
}
/* 아이콘 자리는 크기를 고정해서, 기본 도형이든 나중에 얹는 PNG든 같게 들어간다 */
.songbook__btn-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
}
/* PNG는 원본이 무슨 색이든 색 찬 버튼 위에서 보이도록 흰색으로 칠해서 쓴다 */
.songbook__btn-icon .icon-img { filter: brightness(0) invert(1); }
.songbook__btn--reserve {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  box-shadow: 0 3px 8px color-mix(in srgb, var(--accent-ink) 30%, transparent);
}
.songbook__btn--start {
  background: linear-gradient(180deg, var(--green), var(--green-deep));
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.30);
}
.songbook__btn:hover { filter: brightness(1.07); }
.songbook__btn:active { transform: translateY(1px); }

.songbook__empty {
  padding: 40px 10px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

/* 좁은 화면: 장 선택을 목록 위 가로 스크롤 줄로 내린다 */
@media (max-width: 860px) {
  .songbook__body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .songbook__chapters { padding: 10px; }
  .songbook__chapter-grid {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
  }
  .songbook__chapter-btn { flex: 0 0 auto; padding: 9px 14px; }
}

/* 가이드 팝업 */
.guide-modal {
  position: relative;
  width: min(540px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 24px;
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow-pop);
}
.guide-modal__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 2px dashed var(--accent-100);
}
.guide-modal__head img { width: 64px; height: auto; }
.guide-modal__head h2 {
  margin: 0;
  font-family: 'Jua', sans-serif;
  font-size: 22px;
  color: var(--accent-deep);
}
.guide-modal__head p { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.guide-modal__steps {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.guide-modal__steps li { display: flex; gap: 12px; }
.guide-modal__num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  box-shadow: 0 2px 4px color-mix(in srgb, var(--accent-ink) 25%, transparent);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
}
.guide-modal__steps strong { display: block; font-size: 14.5px; margin-bottom: 2px; }
.guide-modal__steps p { margin: 0; font-size: 13px; line-height: 1.65; color: var(--ink-soft); }
.guide-modal__steps p + p { margin-top: 8px; }
.guide-modal__steps b { color: var(--accent); }

/* ── 토스트 ── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  z-index: 90;
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(30, 20, 60, 0.92);
  color: var(--white);
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ── 전체 화면(공연 모드) ──
   ⛶ 버튼을 누르면 영상만이 아니라 .layout 전체를 전체 화면으로 띄우고,
   왼쪽 검색/키패드 콘솔만 숨겨서 예약 목록·재생 화면·속도/키/반복 설정이
   함께 크게 보이도록 한다. */
body.is-player-fullscreen .layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  grid-template-rows: 1fr;
  align-items: stretch;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  gap: 20px;
  padding: 22px 26px;
  background:
    radial-gradient(circle at 12% 6%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 44%),
    radial-gradient(circle at 88% 92%, color-mix(in srgb, var(--accent-deep) 30%, transparent), transparent 48%),
    linear-gradient(
      155deg,
      color-mix(in srgb, var(--accent-deep) 58%, #10152B),
      color-mix(in srgb, var(--accent) 24%, #0B1022)
    );
}
/* 사이트 전체화면 안에서 공연 모드를 켠 경우 .layout만 Fullscreen API의 대상이 아니므로,
   상단바와 .app 여백을 직접 접어 네이티브 공연 모드와 같은 화면 크기를 만든다. */
body.is-site-player-mode .app { max-width: none; height: 100vh; padding: 0; }
body.is-site-player-mode .topbar { display: none; }
body.is-player-fullscreen .col--left { display: none; }
body.is-player-fullscreen .col--center {
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
  order: 1; /* 좌/중앙/우 위치를 바꿔둔 상태여도 전체 화면에서는 항상 영상이 넓은 칸에 온다 */
}
body.is-player-fullscreen .col--right {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  justify-content: center;
  overflow-y: auto;
  order: 2;
}
body.is-player-fullscreen .queue { flex: 0 0 auto; }
body.is-player-fullscreen .stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* 공연 모드는 비율을 풀고 칸을 꽉 채우므로 "남은 높이" 계산이 필요 없다 —
   칸을 없애서 PC 규칙(.col--center .stage__viewport / .stage__screen)을 통째로 되돌린다. */
body.is-player-fullscreen .stage__viewport { display: contents; }
body.is-player-fullscreen .stage__screen {
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
  width: auto;
}
/* 공연 모드는 멀리서도 보이도록 예약 목록 · 재생 컨트롤 · 우측 설정을 키운다 */
body.is-player-fullscreen .queue__title { font-size: 16px; }
body.is-player-fullscreen .queue__item { padding: 10px 12px 10px 16px; font-size: 15px; }
body.is-player-fullscreen .transport { margin-top: 14px; padding: 11px 18px; gap: 14px; }
body.is-player-fullscreen .transport__btn { width: 42px; height: 42px; }
/* 위 규칙이 정사각형 크기를 다시 못 박으므로, 글자가 들어가는 [취소]만 되돌린다 */
body.is-player-fullscreen .transport__btn--cancel { width: auto; padding: 0 14px 0 11px; }
body.is-player-fullscreen .transport__btn-label { font-size: 14px; }
/* 공연 모드는 버튼이 커지므로 아이콘 도형도 같이 키운다 (글자가 아니라 font-size로는 안 커진다) */
body.is-player-fullscreen .transport__btn svg { width: 22px; height: 22px; }
body.is-player-fullscreen .transport__btn--play svg { width: 26px; height: 26px; }
body.is-player-fullscreen .transport__time { font-size: 14px; }
body.is-player-fullscreen .panel--ctl { padding: 16px 14px; }
body.is-player-fullscreen .ctl__head { font-size: 15px; margin-bottom: 12px; }
body.is-player-fullscreen .opt { padding: 13px 8px; font-size: 15px; }

/* Fullscreen API가 없는 환경(iOS 홈 화면 웹앱, 아이폰 사파리)에서 쓰는 대체 공연 모드.
   API가 해주던 일은 "이 요소를 화면 가득 띄우기" 하나뿐이라 직접 고정하면 된다.
   나머지 공연 모드 모양새는 위 body.is-player-fullscreen 규칙들이 그대로 처리한다.
   (js/player.js의 canUseNativeFullscreen 참고)

   · margin: 0 — .layout은 화면 크기별로 -8px 음수 마진을 갖는데, inset:0과 겹치면
     고정 위치가 그만큼 밀린다.
   · z-index 40 — .app(z-index:1) 안쪽에서만 겹치는 값이다. 모달(.overlay 50)과
     토스트(90)는 body 직속이라 이 값과 무관하게 계속 위에 뜬다. */
body.is-fullscreen-fallback { overflow: hidden; }
body.is-fullscreen-fallback .layout {
  position: fixed;
  inset: 0;
  margin: 0;
  z-index: 40;
}

/* 휴대폰 공연 모드 — 좁은 화면용 sticky 규칙(영상을 위에 붙여두기)을 여기서는 끈다.
   그 규칙은 .col--center에 position:sticky + z-index:20 과 함께
   "body와 같은 고정 배경"(하늘 사진)을 입혀서 카드 사이로 아래 내용이 비치지 않게 하는데,
   공연 모드는 .layout이 스스로 어두운 배경(#17122E)을 갖는다.
   그래서 어두운 화면 위에 하늘 사진 조각이 네모나게 얹히고, 그 위로 설정 카드가
   지나가면서 [속도 조절]이 영상 뒤로 겹쳐 보였다.
   공연 모드에서는 스크롤 양도 100px 남짓이라 영상을 굳이 고정할 이유가 없다. */
@media (max-width: 619px) {
  body.is-player-fullscreen .col--center {
    position: static;
    z-index: auto;
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
  }
}

/* 좁은 화면에서 전체 화면에 들어가면 우측 설정을 영상 아래로 내린다 */
@media (max-width: 760px) {
  body.is-player-fullscreen .layout {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }
  body.is-player-fullscreen .col--right { overflow-y: visible; }
  body.is-player-fullscreen .stage__screen { aspect-ratio: 16 / 9; flex: none; }

  /* 위쪽 공연 모드 규칙들의 flex:1 / min-height:0 은 "높이가 정해진 칸을 꽉 채워라"는 뜻이라
     칸이 가로로 나뉘는 넓은 화면에서만 맞다. 여기처럼 세로로 쌓여 높이가 내용으로 정해지는
     배치에서는 정반대로 작동한다 — 칸이 내용보다 짧게 줄어들고, min-height:0 때문에
     자동 최소 크기 보호까지 풀려서 영상과 재생바가 칸 밖으로 삐져나온다.
     (측정: .col--center 259px 안에 예약 목록 + 화면 181px + 재생바 64px이 들어가 있었고,
      삐져나온 만큼이 아래 [속도 조절] 카드 위에 겹쳐 보였다)
     세로 배치에서는 전부 내용 크기 그대로 두고, 넘치면 .layout이 스크롤한다. */
  body.is-player-fullscreen .col--center,
  body.is-player-fullscreen .col--right,
  body.is-player-fullscreen .stage {
    flex: none;
    min-height: auto;
  }
}

/* ── 반응형 ── */
@media (max-width: 1180px) {
  .topbar__logo { height: 54px; }
}
/* 여기 값도 .col의 좌우 안쪽 여백(8px씩)만큼 더해져 있다 — 카드 실폭은 270 / 140 */
@media (min-width: 941px) and (max-width: 1180px) {
  .col--left  { flex-basis: 286px; }
  .col--right { flex-basis: 156px; }
}

/* 창이 낮으면 설정 카드 3장을 세로로 쌓을 높이가 없다 — 좁은 우측 컬럼에서는 속도 4 + 키 3 +
   반복 3이 전부 한 줄씩 쌓여 600px 가까이 된다. 컬럼을 넓혀 버튼을 2열로 눕히면 385px로 줄어든다.
   넓혀서 오히려 짧아지는 구간이라, 여기서만 좌측과 같은 폭까지 키운다.

   30vw 상한이 있는 이유 — 960px처럼 좁고 낮은 창에서 316px을 그대로 주면 가운데가 너무 얇아진다.
   동시에 하한 역할도 한다: 이보다 더 좁히면 버튼 두 칸이 못 들어가 1열로 되돌아가 다시 넘친다.

   세로가 넉넉하면 위 기본값(176 / 156px)이 그대로 남고, 그 폭은 가운데 영상으로 간다.
   폭 구간 규칙보다 뒤에 와야 두 구간 모두에서 이긴다 — 순서를 바꾸지 말 것. */
@media (min-width: 941px) and (max-height: 930px) {
  .col--right { flex-basis: min(316px, 30vw); }
}

/* ── 좁은 화면: 한 줄로 쌓고 영상은 위에 고정 ── */
@media (max-width: 940px) {
  /* grid → flex: sticky가 움직일 공간을 가지려면 부모가 컨테이닝 블록이어야 한다
     (grid + align-items:start 에서는 각 칸 높이가 내용과 같아져 sticky가 동작하지 않음) */
  .layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* 기본 규칙의 align-items:start는 flex 컬럼에서 가로 폭을 내용에 맞춰 줄여버린다 */
    align-items: stretch;
  }
  .col--center { order: -1; }

  /* auto-fit: 한 줄에 들어갈 만큼만 칸을 만들고 빈 칸은 접히므로
     4개(속도)든 3개(키·반복)든 폭을 꽉 채워 한 줄로 놓인다 */
  .col--right .ctl__options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
    gap: 6px;
  }
  .col--right .opt { padding: 10px 6px; font-size: 13px; }
  .panel--ctl { padding: 12px 14px; }
  .ctl__head { margin-bottom: 8px; }

  .song-list { max-height: none; }
  .key { height: 52px; }
  .action { height: 50px; }
}

/* 태블릿: 세로로 쌓으면 영상이 너무 커지므로 왼쪽 콘솔 + 오른쪽 영상 2단으로 */
@media (min-width: 620px) and (max-width: 940px) {
  .layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: start;
    /* 아래에서 .layout이 flex:1로 늘어나 높이가 내용보다 커지는데, 그리드의 기본
       align-content: stretch가 남는 높이를 행 사이에 나눠 넣는다. 그러면 영상과
       [속도 조절] 사이가 벌어져 카드가 따로 노는 것처럼 보인다
       (820×1180에서 183px이 두 행에 91px씩 들어갔다).
       start로 고정해 카드는 위에 붙이고, 남는 높이는 아래 배경으로 흘려보낸다. */
    align-content: start;
    gap: 14px;
  }
  .col--left   { grid-column: 1; grid-row: 1 / span 2; }
  .col--center { grid-column: 2; grid-row: 1; }
  .col--right  { grid-column: 2; grid-row: 2; }

  /* 좁은 태블릿에서는 왼쪽 콘솔이 280px을 고정으로 가져가서 영상 칸이 많이 좁다.
     그 폭에 재생 컨트롤이 다 못 들어가면 재생바(flex:1)가 0px까지 눌려 못 쓰게 된다
     (620px 폭에서 102px 초과, 재생바 0px으로 측정됨).
     음량은 기기 볼륨으로 대신할 수 있는 유일한 항목이라 여기서만 접는다.
     780px은 음량을 뺀 나머지가 딱 들어가기 시작하는 지점. */
  @media (max-width: 780px) {
    .transport__volume { display: none; }
  }
  /* 더 좁아지면 음량을 접어도 재생바가 8px까지 눌린다.
     휴대폰(max-width:560px)과 같은 방식으로 컨트롤을 촘촘하게 해서 재생바 자리를 만든다. */
  @media (max-width: 700px) {
    .transport { gap: 7px; padding: 7px 10px; }
    .transport__btn--cancel { padding: 0 8px 0 5px; gap: 3px; }
    .transport__btn-label { font-size: 11.5px; }
    .transport__time { font-size: 11.5px; }
  }

  /* PC와 같은 방식으로 화면 아래 --bottom-band 만큼을 비워둔다.
     페이지 대신 안쪽 내용이 스크롤되므로, 예약 목록이 길어져도 배경 캐릭터가 가려지지 않는다.
     (dvh를 쓰는 건 태블릿 브라우저의 주소창이 접혔다 펴질 때 100vh가 어긋나기 때문) */
  .app {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--bottom-band);
  }
  .layout {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    /* 카드 글로우가 스크롤 영역 경계에서 잘리지 않도록 (PC 컬럼과 같은 처리) */
    padding: 8px;
    margin: -8px;
  }
}

/* 휴대폰 가로(844×390 등)도 폭만 보면 위 태블릿 구간에 걸린다.
   그런데 세로가 짧아서 안쪽 스크롤 영역이 232px밖에 안 되고, 키패드 윗줄과 영상 윗부분만
   보이는 상태가 된다. 이럴 때는 휴대폰처럼 페이지 스크롤로 되돌리는 편이 훨씬 낫다 —
   전체를 훑을 수 있고, 끝까지 내리면 아래 띠에서 배경 캐릭터가 그대로 드러난다. */
@media (min-width: 620px) and (max-width: 940px) and (max-height: 620px) {
  .app { height: auto; }
  .layout { overflow-y: visible; }
}

/* 휴대폰 세로: 스크롤해도 영상이 계속 보이도록 위에 고정
   (가로 모드에서는 영상이 화면을 다 덮어버리므로 min-height로 제외) */
@media (max-width: 619px) and (min-height: 620px) {
  .col--center {
    position: sticky;
    top: 0;
    z-index: 20;
    /* 카드 사이 틈으로 아래 내용이 비쳐 지나가지 않도록 화면 폭 전체를 덮는다.
       배경은 body와 동일한 고정 배경이라 경계가 보이지 않는다 */
    margin: 0 -20px;
    padding: 8px 20px 10px;
    background: var(--page-bg);
    background-attachment: fixed;
    transition: box-shadow 0.15s ease;
  }
  /* 아래 카드가 이 블록 뒤로 미끄러져 들어가는데, 경계가 없으면 카드가 잘린 것처럼 보인다.
     아래쪽에만 떨어지는 그림자를 둬서 "위에 떠 있는 판"으로 읽히게 한다.
     (음수 spread라 좌우·위로는 거의 안 번진다)

     실제로 화면 위에 붙어 있는 동안에만 켠다 — js/sticky.js가 is-stuck을 붙인다.
     항상 켜두면 스크롤 맨 위에서 가릴 게 없는데도 배경에 줄이 그어진 것처럼 보인다. */
  .col--center.is-stuck {
    box-shadow: 0 14px 18px -10px rgba(0, 0, 0, 0.45);
  }
}

@media (max-width: 560px) {
  .app { padding: 10px 12px 20px; }
  /* 로고 + 테마 견본 5개 + [전체 노래 목록]이 한 줄에 다 안 들어간다.
     줄바꿈을 허용해서 넘치는 대신 아래로 내려오게 한다. */
  .topbar { padding: 2px 2px 10px; flex-wrap: wrap; justify-content: center; gap: 8px 12px; }
  .topbar__brand { text-align: center; }
  .topbar__heading { display: flex; justify-content: center; }
  .topbar__logo { height: 44px; }
  .topbar__right { gap: 6px; }
  .topbar__btn { padding: 8px 14px; font-size: 12px; }
  .topbar__btn-icon { width: 22px; height: 22px; }
  /* 테마가 5개라 좁은 화면에서는 견본과 간격을 함께 줄인다 */
  .theme-picker { gap: 4px; padding: 4px; }
  .theme-swatch { width: 24px; height: 24px; font-size: 11px; }

  .col--center { margin: 0 -12px; padding: 8px 12px 10px; }

  .transport { gap: 8px; margin-top: 8px; padding: 7px 10px; }
  .transport__volume { display: none; }
  .transport__btn { width: 38px; height: 38px; }
  /* 위 규칙이 정사각형 크기를 다시 못 박으므로, 글자가 들어가는 [취소]만 되돌린다 */
  .transport__btn--cancel { width: auto; gap: 3px; padding: 0 9px 0 6px; }
  .transport__btn-label { font-size: 11.5px; }
  .transport__time { font-size: 11.5px; }

  .queue { padding: 10px 12px; }
  .queue__title { margin-bottom: 6px; font-size: 12.5px; }
  .queue__clear { padding: 8px 10px; font-size: 11.5px; }
  .queue__empty { font-size: 11.5px; }

  .stage { padding: 8px; }
  .stage__idle img { width: 54px; }
  .stage__idle-title { font-size: 18px; }
  .stage__idle-desc { font-size: 12px; }
  .stage__tag { left: 8px; top: 8px; padding: 5px 10px; font-size: 11.5px; }


  .tabs { margin-bottom: 12px; }
  .tab { font-size: 12px; }
  .screen__body { min-height: 52px; }
  .screen__display { font-size: 22px; }
  .guide__char { width: 52px; }

  .overlay { padding: 12px; }
  .songbook, .guide-modal { padding: 18px 16px; }
  /* 제목이 한 줄에 들어가도록 조금 줄인다 */
  .songbook__heading { font-size: 19px; }
  .songbook__total { font-size: 15px; }
  .songbook__legend { font-size: 11.5px; }
  .peek { padding: 18px 16px 16px; }
  .peek__heading { font-size: 18px; }
  /* 휴대폰에서만 [예약]·[시작]을 아랫줄로 내린다. 한 줄에 다 넣기엔 폭이 모자란다.
     내려간 버튼은 오른쪽에 몰리지 않고 줄 폭을 반씩 나눠 갖는다. */
  .songbook__row {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    row-gap: 8px;
    padding: 10px;
  }
  .songbook__row-actions { grid-column: 1 / -1; }
  .songbook__btn { flex: 1; justify-content: center; }
  .guide-modal__head img { width: 52px; }
  .guide-modal__head h2 { font-size: 19px; }
}

/* 휴대폰: 세로로 길어 한 화면에 다 담을 수 없으므로 페이지 스크롤은 그대로 두고,
   맨 아래에만 띠를 둔다. 끝까지 내리면 배경 아래쪽 캐릭터가 드러난다.
   (여기서 태블릿처럼 안쪽 스크롤로 바꾸면 영상을 위에 고정해두는 sticky 동작과
    주소창 접힘이 어긋나서, 휴대폰에서는 일부러 페이지 스크롤을 유지한다) */
@media (max-width: 619px) {
  .app { padding-bottom: var(--bottom-band); }
}
