/* ============================================================
   伴唱機 · 共用樣式
   電視：黑底、大字、遠看
   手機：黑底、大按鈕、單手可點
   ============================================================ */
:root {
  --bg: #0a0c14; --bg2: #131826; --line: rgba(255, 255, 255, .13);
  --fg: #f2f5ff; --dim: #93a0bd; --dim2: #5f6b86;
  --hot: #ff4d8d; --hot2: #ffb03a; --ok: #35e0a1; --blue: #4fb3ff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--fg); overflow: hidden;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  user-select: none;
}
button { font-family: inherit; color: inherit; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px; font-size: 15px; cursor: pointer; }
button:active { background: #1c2334; }
button.primary { background: linear-gradient(180deg, #ff5f97, #e02f74); border-color: transparent; font-weight: 800; }
button.g { background: linear-gradient(180deg, #3ee6a9, #17b881); border-color: transparent; color: #04231a; font-weight: 800; }
button.ghost { background: transparent; }
button[disabled] { opacity: .45; }
input, textarea {
  font-family: inherit; font-size: 16px; color: var(--fg); background: #0d1120;
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%;
}
input:focus { outline: 2px solid var(--blue); }
.row { display: flex; gap: 8px; align-items: center; }
.sp { flex: 1; }
.dim { color: var(--dim); }
.tiny { font-size: 11px; }

/* ══════════════════ 電視 ══════════════════ */
body.tv { font-size: 20px; }
.tv-wrap { position: fixed; inset: 0; display: flex; flex-direction: column; }
.tv-main { flex: 1; display: flex; min-height: 0; }
.tv-stage { flex: 1; position: relative; min-width: 0; background: #000; }
.tv-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.tv-stage video.hide { display: none; }
.tv-lyr { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 3vh 4vw; }
.tv-lyr.hide { display: none; }
.lyr-l { line-height: 1.35; font-weight: 800; transition: color .18s, font-size .18s; }
.lyr-prev { font-size: 2.6vh; color: var(--dim2); min-height: 4vh; }
.lyr-cur { font-size: 8.2vh; color: #fff; text-shadow: 0 0 28px rgba(255, 77, 141, .35); }
.lyr-next { font-size: 3.4vh; color: var(--dim); min-height: 5vh; }
.tv-side { width: 27vw; min-width: 300px; border-left: 1px solid var(--line); padding: 2.4vh 1.6vw;
  display: flex; flex-direction: column; gap: 1.4vh; background: #0c101c; }
.tv-title { font-size: 3.2vh; font-weight: 800; }
.tv-singer { font-size: 2.2vh; color: var(--hot2); }
.tv-q { flex: 1; min-height: 0; overflow: hidden; }
.tv-q h4 { margin: .6em 0 .4em; font-size: 1.7vh; color: var(--dim); font-weight: 600; letter-spacing: .1em; }
.tv-q ol { margin: 0; padding-left: 1.4em; }
.tv-q li { font-size: 2vh; padding: .34em 0; line-height: 1.3; }
.tv-q li.cur { color: var(--ok); }
.tv-bar { height: 1.5vh; background: #1a2030; border-radius: 99px; overflow: hidden; }
.tv-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--hot), var(--hot2)); }
.tv-foot { display: flex; gap: 10px; align-items: center; font-size: 1.9vh; flex-wrap: wrap; }
.vu { width: 90px; height: 10px; background: #1a2030; border-radius: 99px; overflow: hidden; }
.vu i { display: block; height: 100%; width: 0; background: var(--ok); }
/* 待機畫面只蓋「畫面區」，不要把右側資訊欄蓋掉 ——
   不然開唱前就按不到「用電視的麥克風」 */
.idle { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4vh; }
.idle h1 { margin: 0; font-size: 4.4vh; letter-spacing: .04em; }
.idle .code { font-size: 17vh; font-weight: 900; letter-spacing: .12em; line-height: 1;
  background: linear-gradient(180deg, #fff, #9fb3d9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.idle img { width: 26vh; height: 26vh; background: #fff; border-radius: 14px; padding: 8px; }
.idle .qrbox { display: flex; gap: 5vh; align-items: center; }
.idle .hint { font-size: 2.4vh; color: var(--dim); text-align: center; line-height: 1.7; }
/* 播放中左下角的小 QR：讓別人隨時掃進來加入（半透明，不擋畫面；按 Q 可收起） */
.join { position: absolute; left: 2vh; bottom: 2vh; z-index: 6; display: flex; align-items: center; gap: 1.6vh;
  background: rgba(6, 8, 14, .62); border: 1px solid rgba(255, 255, 255, .13); border-radius: 1.6vh;
  padding: 1.4vh 1.8vh; pointer-events: none; opacity: .92; }
.join.hide { display: none; }
.join img { width: 15vh; height: 15vh; background: #fff; border-radius: 1vh; padding: 6px; }
.join-t { display: flex; flex-direction: column; gap: .5vh; }
.join-h { font-size: 1.7vh; color: var(--dim); letter-spacing: .08em; }
.join-code { font-size: 5vh; font-weight: 900; letter-spacing: .1em; line-height: 1; color: #fff; }
.join-h2 { font-size: 1.5vh; color: #5f6b86; }
.mics { display: flex; gap: 8px; }
.mic { padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); font-size: 2vh; }
.mic.on { border-color: var(--ok); color: var(--ok); }
.gate { position: fixed; inset: 0; background: rgba(6, 8, 14, .96); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3vh; z-index: 50; }
.gate h2 { font-size: 5vh; margin: 0; }
.gate button { font-size: 3vh; padding: 2vh 6vh; }
.toast { position: fixed; left: 50%; bottom: 4vh; transform: translateX(-50%); background: rgba(255, 77, 141, .95);
  color: #fff; padding: 1.4vh 3vh; border-radius: 99px; font-size: 2.4vh; font-weight: 700; opacity: 0;
  transition: opacity .25s; pointer-events: none; z-index: 40; }
.toast.show { opacity: 1; }
.fs { position: fixed; right: 2vh; top: 2vh; z-index: 30; }
