/* ---------- web app (iPhone / iPad Safari) ---------- */
#topbar { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
.view { top: calc(56px + env(safe-area-inset-top)); padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
#searchRow { top: calc(56px + env(safe-area-inset-top)); }
body.searching .view { top: calc(113px + env(safe-area-inset-top)); }
.addhome { margin-top: 22px; }
.err { color: #ff9a9a !important; }

#player { position: fixed; inset: 0; background: #000; z-index: 40; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.pbar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.pnow { min-width: 0; flex: 1; }
.ptitle { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.psub.err { color: #ff9a9a; }
.pservers { display: flex; gap: 8px; overflow-x: auto; padding: 0 10px 8px; scrollbar-width: none; }
.pservers::-webkit-scrollbar { display: none; }
.pservers button { flex: none; border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 8px 13px; font-size: 13px; }
.pservers button.on { background: var(--live); border-color: var(--live); color: #fff; font-weight: 600; }
.pstage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; }
#video { width: 100%; height: 100%; max-height: 100%; background: #000; object-fit: contain; }
.pmsg { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; color: #ddd; padding: 20px;
  font-size: 15px; pointer-events: none; text-shadow: 0 2px 6px #000; }
@media (orientation: landscape) and (max-height: 500px) {
  .pbar, .pservers { position: absolute; left: 0; right: 0; z-index: 2; background: linear-gradient(#000c, #0000); }
  .pservers { top: 52px; }
  #player.idle .pbar, #player.idle .pservers { opacity: 0; pointer-events: none; transition: opacity .4s; }
}

#lock { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: grid; place-items: center; padding: 24px; }
.lockbox { width: 100%; max-width: 360px; text-align: center; }
.lockbox img { width: 84px; height: 84px; border-radius: 20px; }
.lockbox h1 { margin: 14px 0 4px; font-size: 30px; }
.lockbox h1 b { color: var(--live); }
.lockbox form { display: flex; gap: 8px; margin-top: 14px; }
.lockbox input { flex: 1; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 0 14px; font-size: 16px; }
.lockbox .primary { height: 46px; }
