@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&family=Space+Grotesk:wght@500;700&display=swap');

/* ===== Phone web UI — shares the desktop palette (style.css) ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --mc-bg-0: #060b12;
  --mc-bg-1: #0a131f;
  --mc-surface: rgba(255, 255, 255, 0.045);
  --mc-surface-2: rgba(255, 255, 255, 0.08);
  --mc-border: rgba(255, 255, 255, 0.09);
  --mc-text: #ecf4ff;
  --mc-muted: #9ab1c7;
  --mc-dim: #6f8296;
  --mc-accent: #4bc0ff;
  --mc-highlight: #f8bf4b;
  --mc-live: #e74c3c;
  --mc-error: #ff6b6b;
  /* Sports colours from the Android TV app */
  --sp-accent: #2ecc71;
  --sp-card: #121a22;
  --sp-card-border: #1c2830;
  --sp-home: #67e8a5;
  --sp-away: #ffc857;
  --sp-4k: #b388ff;
  --top-h: 52px;
  --tabbar-h: 58px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  color: var(--mc-text);
  background:
    radial-gradient(circle at 12% 0%, rgba(75, 192, 255, 0.16), transparent 42%),
    linear-gradient(170deg, var(--mc-bg-0), var(--mc-bg-1) 55%, #050911 100%) fixed;
  background-color: var(--mc-bg-0);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; }
input, select { font: inherit; color: inherit; }
img { display: block; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ===== Top bar ===== */
.m-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: calc(var(--top-h) + var(--safe-top));
  padding: var(--safe-top) 8px 0 16px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(5, 12, 21, 0.92);
  border-bottom: 1px solid rgba(124, 177, 219, 0.18);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.m-brand {
  font-family: 'Space Grotesk', 'Manrope', sans-serif; font-weight: 700; font-size: 15px;
  background: linear-gradient(110deg, var(--mc-highlight), var(--mc-accent));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.m-top-title { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; color: var(--mc-muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--mc-muted); }
.m-icon-btn svg { fill: currentColor; stroke: none; }
.m-icon-btn:active { background: var(--mc-surface-2); }

.m-menu {
  position: fixed; z-index: 60; right: 10px; top: calc(var(--top-h) + var(--safe-top) + 4px);
  min-width: 220px; padding: 6px; border-radius: 14px;
  background: #101b28; border: 1px solid var(--mc-border); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
.m-menu-item { display: block; width: 100%; text-align: left; padding: 13px 14px; border-radius: 10px; color: var(--mc-text); text-decoration: none; font-weight: 600; }
.m-menu-item:active { background: var(--mc-surface-2); }

/* ===== Main + tabs ===== */
.m-main {
  padding: calc(var(--top-h) + var(--safe-top)) 0 calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
}
.m-tab { display: none; }
.m-tab.active { display: block; }

.m-toolbar {
  position: sticky; top: calc(var(--top-h) + var(--safe-top)); z-index: 20;
  padding: 10px 16px 8px; display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(var(--mc-bg-0) 75%, rgba(6, 11, 18, 0));
}
.m-search {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--mc-border); background: var(--mc-surface);
  font-size: 16px; /* 16px stops iOS zooming into the field */
  -webkit-appearance: none; appearance: none;
}
.m-search:focus { outline: none; border-color: var(--mc-accent); }
.m-chips { display: flex; gap: 8px; align-items: center; }
.m-chips-scroll { overflow-x: auto; scrollbar-width: none; padding: 0 16px 10px; }
.m-chips-scroll::-webkit-scrollbar { display: none; }
.m-chip {
  flex-shrink: 0; height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--mc-border); background: var(--mc-surface);
  font-size: 13px; font-weight: 700; color: var(--mc-muted); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.m-chip.active { background: var(--mc-accent); border-color: var(--mc-accent); color: #04121d; }
.m-chip img { width: 18px; height: 18px; object-fit: contain; }
.m-chip .m-live-count { background: var(--mc-live); color: #fff; border-radius: 999px; padding: 1px 6px; font-size: 10px; }
.m-select-wrap { flex: 1; min-width: 0; }
.m-select {
  width: 100%; height: 34px; padding: 0 30px 0 12px; border-radius: 999px;
  border: 1px solid var(--mc-border); background: var(--mc-surface);
  font-size: 13px; font-weight: 700; color: var(--mc-muted);
  -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--mc-muted) 50%), linear-gradient(135deg, var(--mc-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.m-select.active { border-color: var(--mc-accent); color: var(--mc-text); }
.m-select option { background: #0a131f; color: var(--mc-text); }

.m-list-status { padding: 28px 16px; text-align: center; color: var(--mc-dim); font-size: 14px; }
.m-list-status.error { color: var(--mc-error); }
.m-list-status button { margin-top: 12px; }
.m-sentinel { height: 1px; }

/* ===== Bottom tab bar ===== */
.m-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(5, 12, 21, 0.95); border-top: 1px solid rgba(124, 177, 219, 0.18);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.m-tabbar-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--mc-dim); font-size: 11px; font-weight: 700; }
.m-tabbar-btn.active { color: var(--mc-accent); }
.m-tabbar-btn[data-tab="sports"].active { color: var(--sp-accent); }

/* ===== Buttons ===== */
.m-btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 12px;
  background: linear-gradient(135deg, #3aa8f0, #5b8cff); color: #fff; font-weight: 800; font-size: 15px;
}
.m-btn-primary:disabled { opacity: 0.45; }
.m-btn-secondary { height: 38px; padding: 0 16px; border-radius: 10px; background: var(--mc-surface-2); font-weight: 700; font-size: 14px; }

/* ===== Live TV channel list ===== */
.m-channel-list { list-style: none; padding: 0 12px; transition: opacity 0.15s; }
.m-channel-list.stale { opacity: 0.45; pointer-events: none; }
.m-ch { display: flex; align-items: stretch; gap: 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.m-ch-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 11px 4px; text-align: left; }
.m-ch-main:active { background: var(--mc-surface); border-radius: 12px; }
.m-logo {
  width: 52px; height: 40px; flex-shrink: 0; border-radius: 8px;
  background: rgba(255, 255, 255, 0.06); display: grid; place-items: center; overflow: hidden;
  font-weight: 800; color: var(--mc-dim); font-size: 16px;
}
.m-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.m-ch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.m-ch-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-ch-now { font-size: 13px; color: var(--mc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-ch-next { font-size: 12px; color: var(--mc-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-progress { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.m-progress i { display: block; height: 100%; background: var(--mc-accent); border-radius: 3px; }
.m-ch.down .m-ch-name { color: var(--mc-dim); }
.m-tag { display: inline-block; vertical-align: 2px; margin-left: 6px; padding: 1px 5px; border-radius: 4px; font-size: 10px; font-weight: 800; color: #000; background: var(--sp-4k); }
.m-tag.down { background: rgba(255, 107, 107, 0.2); color: var(--mc-error); }
.m-fav { width: 44px; flex-shrink: 0; font-size: 22px; color: var(--mc-dim); }
.m-fav.active { color: var(--mc-highlight); }

/* ===== Sports ===== */
.m-sports { background: linear-gradient(180deg, rgba(3, 20, 10, 0.9), transparent 320px); min-height: 60vh; }
.m-sports-head { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px 10px; }
.m-sports-title { font-family: 'Space Grotesk', 'Manrope', sans-serif; font-weight: 700; font-size: 18px; letter-spacing: 0.5px; }
.m-sports-note { font-size: 12px; color: var(--mc-dim); }
.m-sports .m-chip.active { background: var(--sp-accent); border-color: var(--sp-accent); color: #04140a; }
#sports-body { padding: 0 12px; }
.m-league { display: flex; align-items: center; gap: 10px; padding: 16px 4px 8px; }
.m-league img { width: 28px; height: 28px; object-fit: contain; }
.m-league-name { font-weight: 800; font-size: 15px; letter-spacing: 1.2px; text-transform: uppercase; }
.m-league-meta { font-size: 12px; color: var(--mc-dim); }
.m-pill-live { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--mc-live); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.8px; }
.m-pill-upset { padding: 2px 8px; border-radius: 999px; background: #b71c1c; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.8px; }
.m-pill-final { padding: 2px 7px; border-radius: 4px; background: #1f2a33; color: var(--mc-dim); font-size: 10px; font-weight: 800; letter-spacing: 1.2px; }

.m-game {
  display: block; width: 100%; text-align: left; margin-bottom: 10px;
  padding: 12px 14px; border-radius: 14px; background: var(--sp-card); border: 1px solid var(--sp-card-border);
}
.m-game:active { background: #1b2a35; }
.m-game.upset { border: 2px solid #ff6b6b; }
.m-game.live { border-color: rgba(231, 76, 60, 0.45); }
.m-game-main { display: flex; align-items: center; gap: 12px; }
.m-game-teams { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.m-team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.m-team-logo { width: 26px; height: 26px; flex-shrink: 0; object-fit: contain; }
.m-team-logo.empty { border-radius: 50%; background: #22303a; }
.m-team-name { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; color: #c9c9da; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-team.winner .m-team-name { color: #fff; font-weight: 800; }
.m-team-rank { color: var(--sp-accent); font-size: 11px; font-weight: 800; margin-right: 4px; }
.m-team-score { font-weight: 800; font-size: 18px; min-width: 30px; text-align: right; }
.m-team.winner .m-team-score { color: var(--sp-accent); }
.m-game-status { width: 92px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.m-game-time { color: var(--sp-accent); font-weight: 800; font-size: 14px; }
.m-game-detail { font-size: 11px; color: var(--mc-dim); line-height: 1.3; }
.m-game-detail.live { color: #fff; font-weight: 600; }
.m-game-streams { display: flex; align-items: center; gap: 6px; margin-top: 10px; min-width: 0; }
.m-stream-chip {
  min-width: 0; flex: 0 1 auto; max-width: 48%;
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 8px;
  background: #0d1218; border: 1px solid #26323c; font-size: 12px; font-weight: 600; color: #b8b8cc;
}
.m-stream-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-stream-more, .m-stream-none { font-size: 11px; color: var(--mc-dim); white-space: nowrap; }
.m-stream-none { color: #55556a; }
.m-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: #8a8aa0; }
.m-dot.ok { background: #6fcf97; }
.m-dot.ok4k { background: #ffc857; }
.m-dot.fail { background: #ff6b6b; }
.m-game.final { padding: 10px 14px; }
.m-game.final .m-team-name { font-size: 14px; color: #8a94a6; }
.m-game.final .m-team.winner .m-team-name { color: #fff; }
.m-game.final .m-team-logo { width: 22px; height: 22px; }

/* Now playing banner: games other viewers are watching (joining shares their stream) */
.m-now-playing { margin: 4px 0 6px; padding: 10px 14px 2px; border-radius: 14px; background: linear-gradient(135deg, rgba(46, 204, 113, 0.12), rgba(75, 192, 255, 0.06)); border: 1px solid rgba(46, 204, 113, 0.32); }
.m-np-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.m-np-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--sp-accent); box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.22); }
.m-np-title { font-weight: 800; font-size: 12px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--sp-accent); }
.m-np-note { margin-left: auto; font-size: 11px; color: var(--mc-dim); white-space: nowrap; }
.m-np-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "teams join" "meta join"; gap: 5px 12px; align-items: center; width: 100%; text-align: left; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.m-np-head + .m-np-row { border-top: 0; }
.m-np-row:active { opacity: 0.7; }
.m-np-teams { grid-area: teams; display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; }
.m-np-team { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.m-np-abbr { font-weight: 700; font-size: 14px; color: #c9c9da; }
.m-np-team b { font-size: 15px; font-weight: 800; color: #fff; }
.m-np-logo { width: 20px; height: 20px; flex-shrink: 0; object-fit: contain; }
.m-np-logo.empty { border-radius: 50%; background: #22303a; }
.m-np-at { color: var(--mc-dim); font-size: 12px; }
.m-np-meta { grid-area: meta; display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--mc-muted); white-space: nowrap; }
.m-np-live { flex-shrink: 0; padding: 1px 6px; border-radius: 4px; background: var(--mc-live); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.6px; }
.m-np-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: #fff; font-weight: 600; }
.m-np-viewers { flex-shrink: 0; color: var(--sp-home); font-weight: 700; }
.m-np-status + .m-np-viewers::before, .m-np-live + .m-np-viewers::before { content: "·"; margin-right: 6px; color: var(--mc-dim); }
.m-np-join { grid-area: join; padding: 6px 14px; border-radius: 999px; background: var(--sp-accent); color: #062312; font-weight: 800; font-size: 13px; }
.m-stream-row.watched { box-shadow: inset 0 0 0 1px rgba(46, 204, 113, 0.55); }
.m-stream-watching { margin-top: 2px; font-size: 11px; font-weight: 700; color: var(--sp-home); }

/* Game sheet */
.m-gs-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.m-gs-head img { width: 26px; height: 26px; object-fit: contain; }
.m-gs-league { flex: 1; font-size: 12px; font-weight: 800; letter-spacing: 1.4px; color: var(--mc-dim); text-transform: uppercase; }
.m-gs-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.m-gs-team { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-width: 0; }
.m-gs-team img { width: 52px; height: 52px; object-fit: contain; }
.m-gs-team-name { font-weight: 700; font-size: 14px; line-height: 1.2; }
.m-gs-team-abbr { font-size: 11px; color: var(--mc-dim); }
.m-gs-score { font-weight: 800; font-size: 32px; }
.m-gs-team.winner .m-gs-score { color: var(--sp-accent); }
.m-gs-vs { color: var(--mc-dim); text-align: center; font-size: 13px; }
.m-gs-detail { margin-top: 10px; text-align: center; font-size: 12px; color: var(--mc-dim); line-height: 1.5; }
.m-sheet-section { margin: 16px 0 8px; font-size: 12px; font-weight: 800; letter-spacing: 1.4px; color: var(--mc-dim); text-transform: uppercase; }
.m-stream-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 11px 12px; margin-bottom: 6px; border-radius: 12px; background: #17212b;
}
.m-stream-row:active { background: #2b624a; }
.m-stream-row img { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.m-stream-text { flex: 1; min-width: 0; }
.m-stream-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-stream-prog { font-size: 12px; color: var(--mc-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-stream-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.m-health { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; }
.m-health.ok { color: #6fcf97; } .m-health.ok4k { color: #ffc857; } .m-health.fail { color: #ff6b6b; } .m-health.unknown { color: #8a8aa0; }
.m-qbadge { padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 800; color: #000; background: #6fcf97; }
.m-qbadge.k4 { background: var(--sp-4k); }
.m-side { padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 800; color: #000; background: var(--sp-home); }
.m-side.away { background: var(--sp-away); }

/* ===== Movies / Series ===== */
.m-shelf { margin: 6px 0 18px; }
.m-shelf-title { padding: 0 16px 8px; font-family: 'Space Grotesk', 'Manrope', sans-serif; font-weight: 700; font-size: 16px; }
.m-shelf-title span { color: var(--mc-dim); font-weight: 500; font-size: 12px; margin-left: 4px; }
.m-shelf-row { display: flex; gap: 10px; overflow-x: auto; padding: 0 16px; scroll-padding: 0 16px; scroll-snap-type: x proximity; scrollbar-width: none; }
.m-shelf-row::-webkit-scrollbar { display: none; }
.m-poster { flex-shrink: 0; width: 112px; scroll-snap-align: start; text-align: left; }
.m-poster-img { width: 100%; aspect-ratio: 2 / 3; border-radius: 10px; background: rgba(255, 255, 255, 0.06); overflow: hidden; display: grid; place-items: center; font-size: 28px; position: relative; }
.m-poster-img img { width: 100%; height: 100%; object-fit: cover; }
.m-poster-rating { position: absolute; top: 6px; right: 6px; padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.72); color: var(--mc-highlight); font-size: 11px; font-weight: 800; }
.m-poster-title { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--mc-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.m-poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px 10px; padding: 4px 16px; }
.m-poster-grid .m-poster { width: auto; }

.m-detail-top { display: flex; gap: 14px; }
.m-detail-poster { width: 108px; flex-shrink: 0; aspect-ratio: 2 / 3; border-radius: 10px; object-fit: cover; background: rgba(255, 255, 255, 0.06); }
.m-detail-title { font-family: 'Space Grotesk', 'Manrope', sans-serif; font-size: 20px; font-weight: 700; line-height: 1.2; }
.m-detail-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.m-detail-meta span { padding: 2px 8px; border-radius: 6px; background: var(--mc-surface-2); font-size: 12px; font-weight: 700; color: var(--mc-muted); }
.m-detail-meta .imdb { background: #f5c518; color: #000; }
.m-detail-plot { margin-top: 14px; font-size: 14px; line-height: 1.55; color: #c8d6e5; }
.m-detail-cast { margin-top: 10px; font-size: 13px; color: var(--mc-dim); line-height: 1.5; }
.m-detail-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.m-note { font-size: 13px; color: var(--mc-highlight); line-height: 1.45; background: rgba(248, 191, 75, 0.08); border: 1px solid rgba(248, 191, 75, 0.25); border-radius: 10px; padding: 10px 12px; }
.m-seasons { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 8px; }
.m-seasons::-webkit-scrollbar { display: none; }
.m-episode { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.m-episode:active { background: var(--mc-surface); }
.m-episode:disabled { opacity: 0.55; }
.m-episode-num { width: 34px; flex-shrink: 0; font-weight: 800; color: var(--mc-dim); text-align: center; }
.m-episode-text { flex: 1; min-width: 0; }
.m-episode-title { font-weight: 700; font-size: 14px; }
.m-episode-meta { font-size: 12px; color: var(--mc-dim); margin-top: 2px; }
.m-episode-play { width: 32px; height: 32px; border-radius: 50%; background: var(--mc-surface-2); display: grid; place-items: center; flex-shrink: 0; }
.m-episode-play svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }

/* ===== Bottom sheet ===== */
.m-sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, 0.6); }
.m-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 71;
  max-height: calc(100vh - var(--safe-top) - 40px); max-height: calc(100dvh - var(--safe-top) - 40px);
  display: flex; flex-direction: column;
  background: #0f1821; border-top: 1px solid #2a3a44; border-radius: 20px 20px 0 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
  animation: m-sheet-in 0.22s ease-out;
}
@keyframes m-sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
/* The close button lives in its own non-scrolling header: overlapping the scroll body
   let iOS's touch-scroll layer swallow taps meant for it. */
.m-sheet-head { position: relative; flex-shrink: 0; height: 50px; }
.m-sheet-grip { position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: #33424e; }
/* 48px tap target; content-box background keeps the visible circle at 36px */
.m-sheet-close {
  position: absolute; top: 2px; right: 4px; z-index: 1; width: 48px; height: 48px; padding: 6px;
  border-radius: 50%; background: var(--mc-surface-2) content-box; background-clip: content-box;
  font-size: 22px; line-height: 1; color: var(--mc-muted); touch-action: manipulation;
}
.m-sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 16px calc(20px + var(--safe-bottom)); overscroll-behavior: contain; }

/* ===== Player ===== */
.m-player { position: fixed; inset: 0; z-index: 90; background: #000; display: flex; flex-direction: column; }
.m-player-top { display: flex; align-items: center; gap: 6px; padding: calc(var(--safe-top) + 6px) 10px 8px 4px; background: #05080d; }
.m-player-back { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; flex-shrink: 0; }
.m-player-back svg { width: 26px; height: 26px; stroke-width: 2.4; }
.m-player-titles { min-width: 0; }
.m-player-title { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-player-sub { font-size: 12px; color: var(--mc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-player-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; flex-shrink: 0; }
.m-player-stage video { width: 100%; height: 100%; display: block; background: #000; }
.m-player-status {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 20px; text-align: center; font-size: 14px; color: var(--mc-muted); background: rgba(0, 0, 0, 0.55); pointer-events: none;
}
.m-player-status.error { color: var(--mc-error); pointer-events: auto; }
.m-player-status button { pointer-events: auto; }
.m-spinner { width: 28px; height: 28px; border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: var(--mc-accent); border-radius: 50%; animation: m-spin 0.7s linear infinite; }
@keyframes m-spin { to { transform: rotate(360deg); } }
.m-player-info { flex: 1; overflow-y: auto; padding: 16px 16px calc(16px + var(--safe-bottom)); background: linear-gradient(#070d14, #05080d); }
.m-pi-live { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: var(--mc-live); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.m-pi-title { margin-top: 10px; font-size: 18px; font-weight: 800; line-height: 1.3; }
.m-pi-time { margin-top: 4px; font-size: 13px; color: var(--mc-muted); }
.m-pi-desc { margin-top: 10px; font-size: 14px; line-height: 1.55; color: #c8d6e5; }
.m-pi-next { margin-top: 20px; }
.m-pi-row { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 14px; }
.m-pi-row time { width: 64px; flex-shrink: 0; color: var(--mc-accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.m-pi-row span { min-width: 0; color: #c8d6e5; }

/* Landscape phone: video fills the screen */
@media (orientation: landscape) and (max-height: 520px) {
  .m-player-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; background: linear-gradient(rgba(0, 0, 0, 0.7), transparent); padding-left: max(4px, env(safe-area-inset-left)); }
  .m-player-stage { aspect-ratio: auto; flex: 1; height: 100%; }
  .m-player-info { display: none; }
}

/* ===== Access token screen ===== */
.m-auth {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(circle at 18% 18%, rgba(75, 192, 255, 0.22), transparent 40%), linear-gradient(135deg, #07101b, #060b12 50%, #0d1626);
}
.m-auth-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 10px; padding: 28px 22px; border-radius: 18px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--mc-border); }
.m-auth-logo { font-family: 'Space Grotesk', 'Manrope', sans-serif; text-align: center; font-size: 26px; font-weight: 700; margin-bottom: 8px; background: linear-gradient(110deg, var(--mc-highlight), var(--mc-accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.m-auth-label { font-size: 12px; font-weight: 800; letter-spacing: 0.6px; color: var(--mc-muted); text-transform: uppercase; }
#auth-input { height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--mc-border); background: rgba(255, 255, 255, 0.05); font-size: 17px; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: 0.5px; }
#auth-input:focus { outline: none; border-color: var(--mc-accent); }
.m-auth-hint { font-size: 12px; line-height: 1.5; color: var(--mc-dim); }
.m-auth-hint code { color: var(--mc-muted); }
.m-auth-error { min-height: 18px; font-size: 13px; color: var(--mc-error); }
