:root{
  --bg:#0e1116; --surface:#171b22; --line:#272d38;
  --text:#e8ecf2; --muted:#98a2b3; --accent:#3b82f6; --danger:#ef4444;
}
*{box-sizing:border-box}
/* 下面幾個容器都是 display:flex，會蓋過 UA 對 [hidden] 的 display:none，必須明確壓回去 */
[hidden]{display:none!important}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang TC","Noto Sans TC","Microsoft JhengHei",sans-serif;
  -webkit-font-smoothing:antialiased}

/* ---------- 首頁 ---------- */
.landing{min-height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:32px 20px;text-align:center;gap:8px}
.landing h1{font-size:clamp(28px,6vw,40px);margin:0;letter-spacing:-.02em}
.landing p{color:var(--muted);max-width:34rem;line-height:1.7;margin:4px 0 0}
.btn-primary{margin-top:28px;background:var(--accent);color:#fff;border:0;border-radius:12px;
  padding:16px 40px;font-size:17px;font-weight:600;cursor:pointer}
.btn-primary:hover{background:#2f6fd8}
.notes{margin-top:44px;display:grid;gap:14px;max-width:34rem;text-align:left;
  color:var(--muted);font-size:14px;line-height:1.6}
.notes div{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:14px 16px}
.notes b{color:var(--text);font-weight:600}

/* ---------- 通話頁 ---------- */
.stage{position:fixed;inset:0;background:#000}
#remote{width:100%;height:100%;object-fit:contain;background:#000}
#local{position:absolute;right:16px;bottom:104px;width:26vw;max-width:200px;min-width:110px;
  aspect-ratio:3/4;object-fit:cover;border-radius:12px;border:1px solid var(--line);
  background:#000;z-index:5;cursor:pointer}

/* 等待/錯誤等狀態蓋在畫面上，成功連上就整塊隱藏 */
.overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;
  justify-content:center;gap:14px;padding:24px;text-align:center;background:var(--bg);z-index:3}
.overlay h2{margin:0;font-size:20px;font-weight:600}
.overlay p{margin:0;color:var(--muted);font-size:14px;line-height:1.6;max-width:26rem}
.linkbox{display:flex;gap:8px;width:100%;max-width:26rem;margin-top:6px}
.linkbox input{flex:1;min-width:0;background:var(--surface);border:1px solid var(--line);
  color:var(--text);border-radius:10px;padding:12px 14px;font-size:14px}
.linkbox button{background:var(--accent);color:#fff;border:0;border-radius:10px;
  padding:12px 20px;font-weight:600;cursor:pointer;white-space:nowrap}

.controls{position:absolute;left:0;right:0;bottom:0;z-index:4;
  display:flex;gap:12px;justify-content:center;padding:20px 16px calc(20px + env(safe-area-inset-bottom))}
.ctl{width:56px;height:56px;border-radius:50%;border:1px solid var(--line);background:var(--surface);
  color:var(--text);cursor:pointer;display:grid;place-items:center;padding:0}
.ctl svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round}
.ctl.off{background:#fff;color:#111}          /* 關閉狀態反白，一眼看得出來 */
.ctl.hangup{background:var(--danger);color:#fff;border-color:var(--danger)}

/* 前鏡頭要鏡像。跟著「自己的畫面」走，所以是 class 不是綁在某個元素上 */
.mirror{transform:scaleX(-1)}

/* 美顏強度選單。打開時把自己的小畫面往上推，免得跟按鈕排重疊 */
.levels{position:absolute;left:0;right:0;bottom:96px;z-index:6;
  display:flex;gap:8px;justify-content:center;padding:0 16px}
.chip{background:var(--surface);border:1px solid var(--line);color:var(--text);
  border-radius:999px;padding:10px 20px;font-size:15px;cursor:pointer}
.chip.sel{background:#fff;color:#111;border-color:#fff;font-weight:600}
.stage.levels-open #local{bottom:168px}
