:root {
  --bg: #070a0f;
  --panel: #101722;
  --panel2: #141d2a;
  --line: rgba(255,255,255,.08);
  --text: #edf4ff;
  --muted: #90a0b6;
  --blue: #36a3ff;
  --blue2: #67d7ff;
  --green: #35d07f;
  --offline: #6e7b8c;
  --danger: #ff6370;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; min-height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", Arial, sans-serif; }
body { overscroll-behavior: none; }
button { font: inherit; }
.screen { min-height: 100vh; padding: max(16px, env(safe-area-inset-top)) 14px max(20px, env(safe-area-inset-bottom)); }
.center-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.brand-mark { width: 74px; height: 74px; display: grid; place-items: center; border-radius: 22px; background: linear-gradient(135deg, rgba(54,163,255,.98), rgba(103,215,255,.8)); color: #00101d; font-weight: 900; letter-spacing: 1px; box-shadow: 0 22px 70px rgba(54, 163, 255, .22); }
.loading-text { color: var(--muted); font-size: 15px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.title-block { min-width: 0; }
.title { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -0.3px; }
.subtitle { margin-top: 5px; color: var(--muted); font-size: 13px; }
.pill { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.04); color: var(--muted); font-size: 13px; white-space: nowrap; }
.rooms-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.room-card { border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02)); border-radius: var(--radius); overflow: hidden; padding: 0; color: inherit; text-align: left; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.16); -webkit-tap-highlight-color: transparent; }
.room-card:active { transform: scale(.99); }
.cover { position: relative; aspect-ratio: 16 / 10; background: radial-gradient(circle at 30% 20%, rgba(54,163,255,.35), transparent 28%), linear-gradient(135deg, #111b29, #09101a); display: grid; place-items: center; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-fallback { font-size: 14px; color: rgba(255,255,255,.6); font-weight: 700; letter-spacing: 1px; }
.room-meta { padding: 10px 10px 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.room-name { font-weight: 700; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; flex: 0 0 auto; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.status.online { color: var(--green); }
.status.offline { color: var(--offline); }
.member-box { width: min(420px, 100%); padding: 22px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025)); box-shadow: 0 30px 100px rgba(0,0,0,.24); }
.member-title { font-size: 23px; margin: 0 0 8px; }
.member-desc { margin: 0 0 20px; color: var(--muted); line-height: 1.55; }
.btn { width: 100%; height: 48px; border: 0; border-radius: 14px; background: linear-gradient(135deg, var(--blue), var(--blue2)); color: #00101d; font-weight: 800; cursor: pointer; }
.btn.secondary { margin-top: 10px; color: var(--text); background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.error-box { color: #ffd5d9; background: rgba(255, 99, 112, .08); border: 1px solid rgba(255, 99, 112, .25); padding: 12px; border-radius: 14px; font-size: 13px; line-height: 1.5; }
.player-screen { min-height: 100vh; height: 100vh; display: flex; flex-direction: column; padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); overflow: hidden; }
.player-header { display: flex; align-items: center; gap: 10px; padding: 4px 0 10px; flex: 0 0 auto; }
.icon-btn { min-width: 42px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--text); cursor: pointer; }
.now-title { min-width: 0; flex: 1; }
.now-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-title span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.video-shell { position: relative; width: 100%; background: #000; border-radius: 16px; overflow: hidden; border: 1px solid rgba(255,255,255,.08); flex: 0 0 auto; }
.player-host { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.player-host video { width: 100%; height: 100%; display: block; background: #000; }
.xg-player-box, .xgplayer { width: 100% !important; height: 100% !important; background: #000 !important; }
.xgplayer video { object-fit: contain; }
.play-overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.32); }
.play-overlay.show { display: flex; }
.play-overlay button { width: auto; padding: 0 22px; }
.android-full-btn { display: none; position: absolute; right: 10px; bottom: 10px; width: auto; height: 36px; padding: 0 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.16); background: rgba(0,0,0,.55); color: #fff; }
body.is-android .android-full-btn { display: inline-flex; align-items: center; justify-content: center; }
.more-title { display: flex; align-items: center; justify-content: space-between; padding: 14px 2px 9px; color: var(--muted); font-size: 13px; flex: 0 0 auto; }
.more-list { flex: 1 1 auto; overflow-y: auto; padding-bottom: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; -webkit-overflow-scrolling: touch; }
.mini-room { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text); text-align: left; cursor: pointer; }
.mini-room.active { border-color: rgba(54,163,255,.7); background: rgba(54,163,255,.14); }
.mini-room small { color: var(--green); white-space: nowrap; }
body.android-page-fullscreen .player-screen { padding: 0; }
body.android-page-fullscreen .player-header,
body.android-page-fullscreen .more-title,
body.android-page-fullscreen .more-list { display: none; }
body.android-page-fullscreen .video-shell { position: fixed; inset: 0; z-index: 9999; border-radius: 0; border: 0; width: 100vw; height: 100vh; }
body.android-page-fullscreen .player-host, body.android-page-fullscreen .xgplayer { width: 100vw !important; height: 100vh !important; aspect-ratio: auto; }
body.android-page-fullscreen .player-host video { width: 100vw; height: 100vh; object-fit: contain; }
body.android-page-fullscreen .android-full-btn { z-index: 10000; }

/* xgplayer live UI: hide timeline/progress for live streams where possible. */
.xgplayer .xgplayer-progress,
.xgplayer .xgplayer-progress-btn,
.xgplayer .xgplayer-time,
.xgplayer .xgplayer-time-current,
.xgplayer .xgplayer-time-duration { display: none !important; }
body.is-android .xgplayer .xgplayer-fullscreen { display: flex !important; }

/* Hide live timeline where WebView allows it. iOS native controls may ignore these rules. */
video::-webkit-media-controls-timeline { display: none !important; }
video::-webkit-media-controls-current-time-display { display: none !important; }
video::-webkit-media-controls-time-remaining-display { display: none !important; }
video::-webkit-media-controls-seek-back-button { display: none !important; }
video::-webkit-media-controls-seek-forward-button { display: none !important; }
@media (min-width: 760px) {
  .screen { max-width: 920px; margin: 0 auto; }
  .rooms-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .player-screen { max-width: 920px; margin: 0 auto; }
  .more-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (orientation: landscape) and (max-height: 520px) {
  .player-screen { padding: 6px; }
  .player-header { padding-bottom: 6px; }
  .video-shell video { max-height: 58vh; }
}

/* xgplayer only mode */
.player-host,
.xg-player-box,
.xgplayer {
  width: 100% !important;
  height: 100% !important;
  background: #000;
}
.xgplayer video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}
.xgplayer .xgplayer-progress,
.xgplayer .xgplayer-time,
.xgplayer .xgplayer-time-preview,
.xgplayer .xgplayer-progress-preview {
  display: none !important;
}
