/* 노래방 — 목록은 여행 앱 '라군'(민트) 느낌, 노래 화면은 앨범 커버를 깐 어두운 무대 */
:root {
  --bg: #e6f5f3; --card: rgb(255 255 255 / .78); --line: rgb(16 84 96 / .12); --soft: rgb(16 84 96 / .07);
  --ink: #12343b; --ink2: #3e5f65; --muted: #6c8a8f; --accent: #ff6450; --sea: #13a3a0; --gold: #ffd54a;
  --sky: linear-gradient(165deg, #d4f4ee 0%, #e3efff 48%, #ffe9e0 100%);
  --font: "IBM Plex Sans KR", "Noto Sans SC", system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--sky) fixed, var(--bg); color: var(--ink); font: 500 15px/1.5 var(--font); }
body { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--sea); font-weight: 600; }
[hidden] { display: none !important; }
#app { position: relative; z-index: 2; min-height: 100vh; }

/* ───────── 목록 · 폼 ───────── */
.page { max-width: 600px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px 60px; }
.top { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; }
.top h1 { font-size: 25px; margin: 0; flex: 1; font-weight: 700; letter-spacing: -.02em; }
.chip { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 13px; cursor: pointer; font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip:disabled { opacity: .45; cursor: default; }
.tabs { display: flex; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.tabs .chip { font-size: 15px; padding: 8px 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; backdrop-filter: blur(10px); box-shadow: 0 8px 24px rgb(19 120 130 / .08); }
.field { display: block; margin: 0 0 12px; }
.field > span { display: block; font-size: 13px; color: var(--ink2); margin-bottom: 5px; font-weight: 600; }
.field input, .field select, .field textarea, .inp { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1.5px solid var(--line); background: rgb(255 255 255 / .9); font-size: 16px; }
.field textarea { line-height: 1.55; resize: vertical; }
.btn { border: 0; border-radius: 14px; padding: 11px 16px; background: var(--soft); cursor: pointer; font-weight: 700; white-space: nowrap; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.main { background: var(--accent); color: #fff; }
.btn.sea { background: var(--sea); color: #fff; }
.btn.red { background: #e2453c; color: #fff; }
.btn.wide { width: 100%; font-size: 17px; padding: 14px; }
.btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: #d63a2f; font-size: 14px; min-height: 1.2em; margin: 4px 0 10px; }
h3 { font-size: 15px; margin: 22px 4px 8px; color: var(--ink2); font-weight: 700; }
.songs { display: grid; gap: 10px; }
.song { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); cursor: pointer; text-align: left; width: 100%; transition: transform .1s; }
.song:active { transform: scale(.98); }
.song .cv { width: 56px; height: 56px; border-radius: 12px; flex: none; object-fit: cover; background: linear-gradient(135deg, #3fd0c9, #ff8f5a); display: grid; place-items: center; font-size: 24px; }
.song b { display: block; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 26px 10px; text-align: center; color: var(--muted); line-height: 1.7; }
.spin { display: inline-block; width: 20px; height: 20px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; padding: 60px 0; }
.icon { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--card); font-size: 18px; cursor: pointer; flex: none; display: grid; place-items: center; }
.covers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.covers button { padding: 0; border: 3px solid transparent; border-radius: 12px; overflow: hidden; background: none; cursor: pointer; text-align: left; }
.covers button.on { border-color: var(--accent); }
.covers img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.covers small { display: block; font-size: 11px; padding: 3px 4px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ───────── 노래 화면 (무대) ───────── */
body.stage-on { background: #0d0b16; color: #f4f1fb; }
#bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; display: none; overflow: hidden; }
body.stage-on #bg { display: block; background: radial-gradient(120% 80% at 50% 30%, #2b2050, #0d0b16); }
#bg .blur { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(28px) saturate(1.2); transform: scale(1.1); opacity: .75; }
#bg .sharp { position: absolute; left: 50%; top: 46%; width: min(100vw, 78vh); aspect-ratio: 1; object-fit: cover; transform: translate(-50%, -50%); border-radius: 0; opacity: .72; box-shadow: 0 20px 80px #000c; }
#bg .dim { position: absolute; inset: 0; background: radial-gradient(95% 38% at 50% 52%, #000a, #0000 100%), linear-gradient(#0009, #0004 25%, #0004 75%, #000d); } /* 가사 자리만 살짝 더 어둡게 */
.stage { position: fixed; inset: 0; display: flex; flex-direction: column; }
.stage .bar { display: flex; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 12px 6px; }
.stage .icon { background: #0007; color: #fff; }
.stage .ttl { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.stage .ttl img { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; box-shadow: 0 4px 14px #0008; }
.stage .ttl b { display: block; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 4px #000; }
.stage .ttl small { display: block; font-size: 12px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lyrics { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0 4vw; text-align: center; user-select: none; }
.band { display: flex; flex-direction: column; align-items: center; gap: 1.4vh; padding: 2.2vh 5vw; border-radius: 22px; max-width: 100%; }
body.band-on .band { background: rgb(8 6 18 / .55); backdrop-filter: blur(6px); box-shadow: 0 10px 40px #0006; }
.line { font-weight: 700; line-height: 1.28; letter-spacing: .01em; word-break: keep-all; overflow-wrap: anywhere; }
.line.cur { font-size: calc(var(--fs, 1) * clamp(30px, 7.6vw, 86px)); }
.line.next { font-size: calc(var(--fs, 1) * clamp(16px, 3.8vw, 40px)); color: #e9e6f5; opacity: .8; }
.line { color: #fff; -webkit-text-stroke: .07em #000c; paint-order: stroke fill; text-shadow: 0 0 6px #000, 0 0 18px #000c, 0 0 36px #0009, 0 3px 10px #000b; transition: color .12s; } /* 띠 없이도 읽히게: 부드러운 그림자 테두리 */
.line.cur.on { color: var(--gold); text-shadow: 0 0 6px #000, 0 0 18px #000c, 0 0 30px #ff6a0066, 0 3px 10px #000b; } /* 부르는 동안 한 줄 전체가 노란색 */
/* 다음 줄: 띠 아래 조금 떨어져서 작게 */
.nextbox { display: flex; flex-direction: column; align-items: center; gap: .8vh; margin-top: 3.5vh; padding: 1vh 4vw; border-radius: 16px; max-width: 100%; }
body.band-on .nextbox { background: rgb(8 6 18 / .5); backdrop-filter: blur(4px); }
.pron { font-size: calc(var(--fs, 1) * clamp(14px, 3vw, 30px)); font-weight: 600; color: #bdf5ef; -webkit-text-stroke: .1em #000c; paint-order: stroke fill; text-shadow: 0 0 5px #000, 0 0 14px #000b; }
.pron.hg { color: #ffd9c9; }
.pron.dim { opacity: .55; font-size: calc(var(--fs, 1) * clamp(12px, 2.4vw, 22px)); }
.dots { font-size: clamp(22px, 5vw, 44px); letter-spacing: .3em; color: var(--gold); text-shadow: 0 2px 4px #000; min-height: 1.3em; }
.songname { font-size: clamp(26px, 6vw, 62px); font-weight: 700; -webkit-text-stroke: .08em #000; paint-order: stroke fill; }
.bigcover { width: min(46vw, 34vh); aspect-ratio: 1; border-radius: 18px; object-fit: cover; box-shadow: 0 16px 50px #000a; margin-bottom: 2vh; }
.bottom { padding: 6px 14px max(14px, env(safe-area-inset-bottom)); background: linear-gradient(#0000, #000c 45%); }
.seek { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.seek input { flex: 1; accent-color: var(--gold); }
.ctrls { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.big { min-width: 60px; height: 60px; border-radius: 30px; border: 0; font-size: 24px; cursor: pointer; background: #ffffff26; color: #fff; padding: 0 16px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.big.play { background: var(--gold); color: #241a00; }
.big.rec { background: #e5484d; font-size: 16px; }
.big.rec.on { animation: pulse 1.2s ease infinite; }
.big.txt { font-size: 15px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px #e5484d44; } }
.status { text-align: center; font-size: 13px; min-height: 1.3em; margin-top: 6px; text-shadow: 0 1px 3px #000; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #e5484d; font-size: 13px; font-weight: 700; color: #fff; }
.badge.mix { background: #7b5cff; }

/* 아래에서 올라오는 판 */
.sheet-back { position: fixed; inset: 0; z-index: 20; background: #0007; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 600px; max-height: 88vh; overflow: auto; background: #fbfffe; color: var(--ink); border-radius: 22px 22px 0 0; padding: 14px 16px max(18px, env(safe-area-inset-bottom)); }
.sheet h2 { margin: 2px 0 12px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.sheet h2 span { flex: 1; }
.sheet .icon { background: var(--soft); }
.sec { margin: 0 0 16px; }
.lbl { font-size: 13px; color: var(--ink2); margin-bottom: 6px; font-weight: 600; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.lrow { display: flex; align-items: center; gap: 6px; padding: 9px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.lbtns { flex-basis: 100%; display: flex; gap: 5px; align-items: center; padding-left: 28px; flex-wrap: wrap; }
.lbtns .btn.sm { padding: 7px 9px; } /* 줄 아래: 원곡 · 합침 · 내 목소리 · ↶ · 다시 */
.lrow:first-child { border-top: 0; }
.lrow .n { width: 22px; text-align: right; font-size: 12px; color: var(--muted); flex: none; }
.lrow .t { flex: 1; min-width: 0; font-size: 15px; }
.lrow .t small { display: block; color: var(--muted); font-size: 12px; }
.lrow.has .n { color: var(--sea); font-weight: 700; }
.lrow.cur { background: #ffd54a33; border-radius: 10px; }
.shiftrow { display: flex; align-items: center; gap: 8px; }
.shiftrow input { flex: 1; accent-color: var(--accent); }
.shiftrow output { width: 58px; text-align: right; font-variant-numeric: tabular-nums; }
.setcard { border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.setcard.on { border-color: var(--accent); background: #ff645010; }

/* ⏱ 시간 맞추기 */
.eline { display: flex; gap: 10px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--line); cursor: pointer; font-size: 16px; }
.eline:first-child { border-top: 0; }
.eline .n { width: 24px; text-align: right; color: var(--muted); font-size: 12px; flex: none; }
.eline .tm { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.eline.cur { background: #ffd54a44; border-radius: 10px; box-shadow: inset 3px 0 0 var(--accent); }
.eline.playing .grow { color: var(--accent); font-weight: 700; }
.tapbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: rgb(251 255 254 / .96); border-top: 1px solid var(--line); padding: 8px 14px max(12px, env(safe-area-inset-bottom)); backdrop-filter: blur(10px); }
.tapbar .big { background: var(--soft); color: var(--ink); }
.tapbar .big.play { background: var(--gold); }
.tapbar .big.rec { background: var(--accent); color: #fff; }
.tapbar .big.rec.on { background: #ff8f5a; transform: scale(.97); }
.tapbar .seek { color: var(--ink2); }

/* 관리 */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl td { padding: 7px 4px; border-top: 1px solid var(--line); vertical-align: middle; }
.qr { width: 200px; height: 200px; display: block; margin: 8px auto; border-radius: 12px; }

#toast { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 40; background: #12343bee; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 90vw; text-align: center; }

@media (orientation: landscape) and (max-height: 500px) {
  .line.cur { font-size: calc(var(--fs, 1) * clamp(24px, 6vh + 2vw, 64px)); }
  .line.next { font-size: calc(var(--fs, 1) * clamp(15px, 3.4vh + 1vw, 34px)); }
  .big { height: 46px; min-width: 46px; font-size: 18px; }
  .bigcover { display: none; }
}
/* 노래 화면 아래 버튼: ▶ · 🔀 내 노래 · 🎤 녹음 · ⬇ mp3 */
.ctrls { gap: 8px; }
.big.mixb { background: #7b5cff; font-size: 15px; }
.big.rec { font-size: 15px; }
a.big { text-decoration: none; }

/* 앱 모양의 확인창 · 입력창 */
.dlg-back { position: fixed; inset: 0; z-index: 50; background: rgb(10 30 36 / .45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; }
.dlg { width: 100%; max-width: 360px; background: #fbfffe; color: var(--ink); border-radius: 22px; padding: 20px 18px 16px; box-shadow: 0 20px 60px rgb(0 0 0 / .3); animation: dlgIn .16s ease-out; }
.dlg-msg { margin: 0 0 14px; font-size: 16px; line-height: 1.55; white-space: pre-line; }
.dlg .inp { margin-bottom: 14px; }
.dlg-btns { display: flex; gap: 8px; justify-content: flex-end; }
.dlg-btns .btn { min-width: 84px; }
@keyframes dlgIn { from { transform: scale(.94); opacity: 0; } }
/* ⏮ ⏭ 이전 · 다음 줄 (진행 막대 양쪽) */
.seek .skip { border: 0; background: #ffffff1f; color: #fff; width: 38px; height: 34px; border-radius: 17px; font-size: 15px; cursor: pointer; flex: none; }
.big.mixb { color: #fff; }
