:root {
  --bg: #0b0c10;
  --surface: #13151b;
  --surface-2: #191c23;
  --tile: #1f222b;
  --tile-hover: #272b36;
  --tile-now: #2c3140;
  --line: #262a34;
  --text: #f3f4f6;
  --muted: #9ba1ad;
  --faint: #6b7280;
  --accent: #7b61ff;
  --accent-2: #22d3ee;
  --live: #ff3b5c;
  --radius: 10px;
  --ch-col: 220px;
  --ph: 46vh;          /* player height; dragging the bar above the guide changes it */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---------- nav ---------- */
.nav { display: flex; align-items: center; gap: 28px; padding: 12px 24px; border-bottom: 1px solid var(--line); flex: none; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: -0.5px; }
.brand .mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 17px; }
.tabs { display: flex; gap: 4px; }
.tab { background: none; border: 0; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { color: var(--text); background: var(--tile-now); }
.clock { margin-left: auto; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }

.btn { background: var(--tile); border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 600; }
.btn:hover { background: var(--tile-hover); }
.btn.primary { background: var(--text); color: #0b0c10; }
.btn.primary:hover { background: #fff; }

/* ---------- live page ---------- */
.live { flex: 1; display: flex; min-height: 0; position: relative; }
.live-main { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.hero { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 24px; padding: 20px 24px 12px; flex: none; }

.player { position: relative; aspect-ratio: 16 / 9; width: min(100%, calc(var(--ph) * 16 / 9)); background: #000; border-radius: var(--radius); overflow: hidden; justify-self: start; }
.player video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; cursor: pointer; }
video::cue { font-family: Inter, Arial, sans-serif; font-size: 0.85em; background: rgba(0, 0, 0, .72); color: #fff; }

.spinner { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.18); border-top-color: #fff; animation: spin .8s linear infinite; display: none; }
.player.loading .spinner { display: block; }
.player.loading video { opacity: .25; }
@keyframes spin { to { transform: rotate(360deg); } }

.slate { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px; background: #0d0f14; color: var(--muted); }
.slate strong { color: var(--text); font-size: 16px; }
.unmute { position: absolute; left: 16px; top: 16px; z-index: 3; border: 0; border-radius: 999px; padding: 9px 16px;
  background: rgba(255,255,255,.92); color: #0b0c10; font-weight: 700; }
.numentry { position: absolute; right: 18px; top: 14px; font-size: 40px; font-weight: 800; text-shadow: 0 2px 12px rgba(0,0,0,.8); z-index: 3; }

/* overlay: only while watching full screen */
.overlay { position: absolute; inset: 0; display: none; flex-direction: column; justify-content: space-between; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.65), transparent 22%, transparent 55%, rgba(0,0,0,.85)); opacity: 0; transition: opacity .25s; }
.overlay > * { pointer-events: auto; }
.ov-top { display: flex; align-items: center; gap: 12px; padding: 22px 28px; }
.live-pill { background: var(--live); color: #fff; font-weight: 800; font-size: 11px; letter-spacing: .8px; padding: 4px 8px; border-radius: 5px; }
.ov-ch { font-weight: 600; font-size: 16px; }
.ov-ch b { color: var(--muted); margin-right: 4px; }
.ov-bottom { padding: 0 28px 24px; }
.ov-title { font-size: 34px; font-weight: 800; letter-spacing: -0.6px; }
.ov-sub { color: #d1d5db; font-size: 16px; margin-top: 4px; }
.ov-progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: #d1d5db; font-variant-numeric: tabular-nums; }
.ov-progress .bar { flex: 1; }
.ov-controls { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.ov-next { flex: 1; color: var(--muted); padding-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); font-size: 15px; }
.icon:hover { background: rgba(255,255,255,.26); }

.bar { height: 4px; background: rgba(255,255,255,.14); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 4px; }

/* details panel */
.details { display: flex; flex-direction: column; min-width: 0; padding-top: 4px; max-height: max(var(--ph), 200px); overflow: hidden; }
.details > * { flex-shrink: 0; }   /* when the player is small, cut off the bottom instead of squishing */

/* drag bar between the player and the guide */
.splitter { flex: none; height: 14px; margin: 0 24px; cursor: row-resize; display: grid; place-items: center; touch-action: none; }
.splitter::before { content: ''; width: 48px; height: 4px; border-radius: 4px; background: var(--line); transition: background .15s, width .15s; }
.splitter:hover::before, .splitter.dragging::before { background: var(--accent); width: 72px; }
body.resizing { cursor: row-resize; user-select: none; }
body.resizing video { pointer-events: none; }

/* account menu */
.account { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 500; }
.account .who { color: var(--text); font-weight: 600; }
.account .btn { padding: 7px 14px; }
.d-channel { display: flex; align-items: center; gap: 12px; }
.logo-tile { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; }
.d-chname { font-weight: 700; font-size: 16px; }
.d-tag { color: var(--muted); margin-top: 2px; }
.d-label { color: var(--faint); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; margin-top: 20px; }
.d-title { font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -0.5px; margin: 6px 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.d-sub { color: var(--muted); font-size: 15px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.d-progress .bar { flex: 1; }
.d-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.upnext { list-style: none; margin: 8px 0 0; padding: 0; overflow: hidden; }
.upnext li { display: flex; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.upnext li:last-child { border-bottom: 0; }
.upnext time { color: var(--muted); font-variant-numeric: tabular-nums; width: 64px; flex: none; }
.upnext .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upnext .s { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upnext div { min-width: 0; }

/* category chips */
.chips { display: flex; gap: 8px; padding: 6px 24px 12px; overflow-x: auto; flex: none; scrollbar-width: none; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--text); color: #0b0c10; border-color: var(--text); }

/* ---------- guide ---------- */
.guide { flex: 1; display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--line); }
.guide-head { display: flex; flex: none; background: var(--bg); border-bottom: 1px solid var(--line); }
.gh-ch { width: var(--ch-col); flex: none; }
.gh-times { position: relative; flex: 1; height: 36px; color: var(--muted); font-weight: 600; font-size: 13px; }
.gh-times span { position: absolute; top: 0; line-height: 36px; padding-left: 10px; }
.guide-body { flex: 1; overflow-y: auto; scrollbar-color: var(--tile) transparent; }
.row { display: flex; height: 68px; cursor: pointer; }
.row-ch { width: var(--ch-col); flex: none; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 24px; }
.row-ch .logo-tile { width: 44px; height: 44px; border-radius: 10px; font-size: 14px; }
.row-ch .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-ch .no { color: var(--faint); font-size: 12px; margin-top: 2px; }
.row-ch > div:not(.logo-tile) { min-width: 0; }
.row-track { position: relative; flex: 1; overflow: hidden; margin-right: 24px; }
.cell { position: absolute; top: 6px; bottom: 6px; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; overflow: hidden; white-space: nowrap; }
.row:hover .cell { background: var(--tile); }
.cell .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.cell .s { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.cell.now { background: var(--tile); }
.cell .fill { position: absolute; left: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.row.selected { background: var(--surface); }
.row.selected .row-ch .nm { color: #fff; }
.row.selected .cell.now { background: var(--tile-now); box-shadow: inset 0 0 0 2px rgba(123, 97, 255, .7); }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--live); z-index: 2; pointer-events: none; }

/* favorite stars */
.fav { margin-left: auto; flex: none; border: 0; background: none; color: var(--faint); font-size: 18px; width: 30px; height: 30px; border-radius: 50%; opacity: 0; }
.row:hover .fav, .fav.on, .row.selected .fav { opacity: 1; }
.fav:hover { background: var(--tile); color: var(--text); }
.fav.on { color: #fbbf24; }
#fav-btn.on { color: #fbbf24; }
.guide-empty { padding: 40px 24px; color: var(--muted); text-align: center; }

/* ---------- On Demand ---------- */
.ondemand { flex: 1; overflow-y: auto; padding-bottom: 40px; scrollbar-color: var(--tile) transparent; }
.od-top { display: flex; align-items: center; gap: 12px; padding: 16px 24px 4px; flex-wrap: wrap; }
.od-chips { padding: 0; flex: 1; min-width: 0; }
.od-search { width: 280px; max-width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; }
.od-search:focus { outline: none; border-color: var(--accent); }
.od-row { margin-top: 18px; }
.od-row h3 { margin: 0 24px 10px; font-size: 17px; font-weight: 700; }
.od-row h3 span { color: var(--faint); font-weight: 500; font-size: 14px; margin-left: 6px; }
.od-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 240px; gap: 14px; overflow-x: auto; padding: 0 24px 8px; scroll-padding-inline: 24px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--tile) transparent; }
.od-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px 14px; padding: 0 24px; }
.od-card { border: 0; background: none; padding: 0; text-align: left; min-width: 0; scroll-snap-align: start; }
.od-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; display: grid; place-items: center; transition: transform .15s, box-shadow .15s; }
.od-card:hover .od-thumb, .od-card:focus-visible .od-thumb { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--accent); }
.od-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.od-initial { padding: 0 14px; font-weight: 800; font-size: 17px; text-align: center; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.5);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.od-save { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 16px;
  background: rgba(0,0,0,.6); color: #fff; opacity: 0; transition: opacity .15s; }
.od-card:hover .od-save, .od-card:focus-visible .od-save, .od-save.on { opacity: 1; }
.od-save:hover { background: rgba(0,0,0,.85); }
.od-save.on, #ts-fav.on { color: #fbbf24; }
.od-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.25); }
.od-prog b { display: block; height: 100%; background: var(--accent); }
.od-name { margin-top: 8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-meta { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* title details */
.title-sheet { z-index: 70; background: rgba(5, 6, 9, .82); }
.ts-inner { max-width: 1000px; margin: 40px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.ts-hero { position: relative; min-height: 300px; display: flex; align-items: flex-end; background-size: cover; background-position: center; }
.ts-close { position: absolute; right: 16px; top: 16px; background: rgba(0,0,0,.5); }
.ts-text { padding: 28px; max-width: 600px; }
.ts-kicker { color: var(--accent-2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; }
.ts-text h2 { margin: 8px 0 6px; font-size: 34px; font-weight: 800; letter-spacing: -0.6px; line-height: 1.1; }
.ts-sub { color: #d1d5db; }
.ts-seasons { padding: 18px 28px 4px; }
.ts-eps { list-style: none; margin: 0; padding: 8px 16px 20px; }
.ts-eps li { display: flex; gap: 16px; align-items: center; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.ts-eps li:hover { background: var(--surface-2); }
.ep-thumb { position: relative; width: 160px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; flex: none; display: grid; place-items: center; }
.ep-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ep-play { position: relative; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; font-size: 13px; opacity: 0; transition: opacity .15s; }
.ts-eps li:hover .ep-play { opacity: 1; }
.ep-text { min-width: 0; }
.ep-name { font-weight: 600; }
.ep-meta { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* On Demand player */
.vod { position: fixed; inset: 0; z-index: 80; background: #000; cursor: none; }
.vod.show-ui { cursor: default; }
.vod video { width: 100%; height: 100%; object-fit: contain; display: block; }
.vod.loading .spinner { display: block; }
.vod-ui { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 20%, transparent 65%, rgba(0,0,0,.85)); }
.vod.show-ui .vod-ui { opacity: 1; }
.vod-ui > * { pointer-events: auto; }
.vod-top { display: flex; align-items: center; gap: 16px; padding: 22px 28px; }
.vod-title { font-size: 22px; font-weight: 800; }
.vod-sub { color: #d1d5db; margin-top: 2px; }
.vod-bottom { padding: 0 28px 24px; }
.vod-seek { position: relative; padding: 10px 0; cursor: pointer; touch-action: none; }
.vod-seek .bar { height: 5px; }
.vod-knob { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: #fff; }
.vod-controls { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.vod-time { flex: 1; color: #d1d5db; font-variant-numeric: tabular-nums; padding-left: 8px; }
.vod-next { background: rgba(255,255,255,.14); }

/* ---------- avatars ---------- */
.avatar { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
  color: #fff; font-weight: 800; font-size: 15px; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
/* online (green) or offline (gray) */
.avatar[data-on]::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 28%; height: 28%; min-width: 9px; min-height: 9px; border-radius: 50%;
  background: #6b7280; box-shadow: 0 0 0 2px var(--surface); }
.avatar[data-on="1"]::after { background: #22c55e; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.xl { width: 96px; height: 96px; font-size: 38px; border: 4px solid var(--surface); }
.me-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 10px 4px 4px; border-radius: 999px; }
.me-btn:hover { background: var(--surface-2); }

/* ---------- chat ---------- */
.chat { width: 340px; flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); min-height: 0; }
body.chat-hidden .chat { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.chat-title b { font-weight: 700; }
.chat-viewers { color: var(--muted); font-size: 12px; margin-left: 8px; }
.chat-viewers::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-right: 5px; vertical-align: 1px; }
.chat-viewers:empty::before { display: none; }
.icon.sm { width: 30px; height: 30px; font-size: 12px; background: transparent; }
.icon.sm:hover { background: var(--tile); }
.chat-tabs { display: flex; gap: 4px; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.chat-tab { flex: 1; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 13px; padding: 6px; border-radius: 8px; }
.chat-tab:hover { color: var(--text); }
.chat-tab.active { background: var(--tile); color: var(--text); }
.people-list { display: none; flex: 1; overflow-y: auto; padding: 4px 10px 12px; scrollbar-width: thin; scrollbar-color: var(--tile) transparent; }
.people-list h4 { margin: 12px 6px 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.chat.people-on .people-list { display: block; }
.chat.people-on .chat-log, .chat.people-on .react-bar, .chat.people-on .chat-form { display: none; }
.chat-log { flex: 1; overflow-y: auto; padding: 8px 0; scrollbar-width: thin; scrollbar-color: var(--tile) transparent; }
.chat-empty { color: var(--faint); text-align: center; padding: 30px 16px; }
.msg { position: relative; display: flex; gap: 10px; padding: 6px 14px; }
.msg:hover { background: var(--surface-2); }
.msg-av, .msg-name { background: none; border: 0; padding: 0; }
.msg-body { min-width: 0; flex: 1; }
.msg-top { display: flex; align-items: baseline; gap: 8px; }
.msg-name { font-weight: 700; font-size: 13px; }
.msg-name:hover { text-decoration: underline; }
.msg-top time { color: var(--faint); font-size: 11px; }
.msg-text { overflow-wrap: anywhere; line-height: 1.4; margin-top: 1px; }
.msg-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.react-chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.react-chip.mine { border-color: var(--accent); background: rgba(123, 97, 255, .18); }
.msg-tools { position: absolute; right: 10px; top: -12px; display: none; background: var(--tile); border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px; }
.msg:hover .msg-tools { display: flex; }
.msg-tools button { border: 0; background: none; padding: 3px 5px; border-radius: 6px; font-size: 14px; }
.msg-tools button:hover { background: var(--tile-hover); }
.react-bar { display: flex; justify-content: space-between; padding: 8px 12px 0; border-top: 1px solid var(--line); }
.react-bar button { border: 0; background: none; font-size: 22px; padding: 4px 6px; border-radius: 10px; transition: transform .1s; }
.react-bar button:hover { background: var(--tile); transform: scale(1.15); }
.react-bar button:active { transform: scale(.9); }
.chat-form { display: flex; gap: 8px; padding: 10px 12px 14px; }
.chat-form input { flex: 1; min-width: 0; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; }
.chat-form input:focus { outline: none; border-color: var(--accent); }
.chat-form .btn { padding: 9px 16px; }
.chat-open { position: absolute; right: 16px; top: 16px; z-index: 5; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 18px; }
.chat-open:hover { background: var(--tile); }

/* reactions floating up the video */
.float-emoji { position: absolute; bottom: 12%; font-size: 34px; z-index: 4; pointer-events: none; animation: float-up 3s ease-out forwards; }
@keyframes float-up {
  0% { transform: translate(0, 0) scale(.6); opacity: 0; }
  12% { opacity: 1; transform: translate(0, -20px) scale(1.1); }
  100% { transform: translate(var(--drift), -260px) scale(1); opacity: 0; }
}

/* ---------- profile cards ---------- */
.modal-sheet { z-index: 88; background: rgba(5, 6, 9, .78); display: grid; place-items: center; padding: 24px 16px; }
.profile-card { position: relative; width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.pc-banner { height: 140px; background-size: cover; background-position: center; }
.pc-body { padding: 0 24px 24px; margin-top: -48px; position: relative; }
.pc-name { font-size: 22px; font-weight: 800; margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.pc-badge { font-size: 11px; font-weight: 700; background: var(--accent); border-radius: 6px; padding: 2px 7px; }
.pc-status { margin-top: 6px; color: #d1d5db; overflow-wrap: anywhere; }
.pc-status.muted { color: var(--faint); font-style: italic; }
.pc-meta { margin-top: 12px; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pc-meta .sep { margin: 0 4px; color: var(--faint); }
.pc-badge.banned { background: var(--live); }
.avatar .pc-hint { border-radius: 50%; }
.admin h3 { font-size: 15px; color: var(--muted); font-weight: 700; margin: 24px 0 10px; }
.admin-row { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-row .ed-input { flex: 1; min-width: 200px; }
.admin-users { display: grid; gap: 4px; margin-top: 10px; }
.admin-user { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: var(--surface); flex-wrap: wrap; }
.admin-user b { cursor: pointer; }
.admin-user b:hover { text-decoration: underline; }
.admin-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-acts .btn { padding: 6px 12px; font-size: 13px; }
.toast code { background: var(--bg); border-radius: 6px; padding: 2px 8px; user-select: all; font-size: 15px; }
.pc-none { margin-top: 16px; color: var(--faint); font-size: 13px; }
.pc-sec { margin-top: 18px; }
.pc-sec h4 { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.pc-chs { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-ch { display: flex; align-items: center; gap: 7px; background: var(--surface-2); border: 0; border-radius: 999px; padding: 4px 12px 4px 4px; font-size: 13px; font-weight: 600; }
.pc-ch:hover { background: var(--tile-hover); }
.pc-ch .logo-tile { width: 24px; height: 24px; border-radius: 50%; font-size: 9px; }
.pc-titles { display: grid; grid-auto-flow: column; grid-auto-columns: 130px; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; scrollbar-color: var(--tile) transparent; }
.pc-title { background: none; border: 0; padding: 0; text-align: left; min-width: 0; }
.pc-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; }
.pc-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pc-title:hover .pc-thumb { box-shadow: 0 0 0 2px var(--accent); }
.pc-tname { display: block; margin-top: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-right: 6px; }
.dot.on { background: #22c55e; }
.btn.danger { background: rgba(255, 59, 92, .15); color: #ff6b84; }
.btn.danger:hover { background: rgba(255, 59, 92, .28); }
.editable { cursor: pointer; position: relative; }
.pc-hint { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; font-size: 13px; font-weight: 600; opacity: 0; transition: opacity .15s; text-shadow: none; }
.editable:hover .pc-hint { opacity: 1; }
.avatar.xl .pc-hint { font-size: 12px; }
.ed-label { display: block; color: var(--muted); font-weight: 600; font-size: 13px; margin: 16px 0 6px; }
.ed-input { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ed-input:focus { outline: none; border-color: var(--accent); }
.ed-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(255,255,255,.4); }
.ed-remove { display: flex; gap: 16px; margin-top: 14px; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; text-decoration: underline; }
.link:hover { color: var(--text); }
.error { color: var(--live); margin-top: 12px; min-height: 1.2em; font-size: 13px; }

/* ---------- games ---------- */
.games-panel { position: fixed; left: 20px; bottom: 20px; z-index: 86; width: 300px; max-height: calc(100vh - 40px); overflow-y: auto; cursor: default;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.55); padding: 12px 14px 14px; }
.games-grid { display: grid; gap: 4px; margin-top: 6px; }
.game-card { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.gc-icon { font-size: 18px; flex: none; }
.game-card h4 { margin: 0; font-size: 14px; font-weight: 600; flex: 1; min-width: 0; }
.gc-btns { display: flex; gap: 4px; flex: none; }
.gc-btns .btn { padding: 5px 10px; font-size: 12px; }
.games-online-h { font-size: 12px; color: var(--muted); font-weight: 700; margin: 12px 0 6px; }
.online-list { display: grid; gap: 2px; }
.online-list .chat-empty { padding: 8px 4px; font-size: 13px; text-align: left; }
.online-row { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; cursor: pointer; }
.online-row:hover { background: var(--surface-2); }
.online-row .btn { padding: 5px 12px; font-size: 12px; }
.or-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.or-text span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.gw-drag { cursor: move; touch-action: none; user-select: none; }
.game-win { position: fixed; left: 20px; bottom: 20px; z-index: 85; width: 250px; cursor: default; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55); padding: 12px 14px 14px; }
.gw-head { display: flex; align-items: center; gap: 4px; }
.gw-head span { color: var(--muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gw-status { margin: 6px 0 10px; font-weight: 600; min-height: 1.3em; }
.gw-foot { display: flex; gap: 8px; margin-top: 12px; }
.gw-foot:empty { display: none; }
.ttt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cell-t { aspect-ratio: 1; border: 0; border-radius: 10px; background: var(--surface-2); font-size: 28px; font-weight: 800; color: var(--text); }
.cell-t.open:hover { background: var(--tile-hover); }
.cell-t.win { background: rgba(123, 97, 255, .35); }
.c4 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; background: #1d3fae; padding: 6px; border-radius: 12px; }
.c4-col { border: 0; background: none; padding: 0; display: grid; gap: 3px; border-radius: 8px; }
.c4.my-turn .c4-col:hover { background: rgba(255,255,255,.12); }
.disc { aspect-ratio: 1; border-radius: 50%; background: #0b1435; }
.disc.p0 { background: #ff3b5c; }
.disc.p1 { background: #fbbf24; }
.disc.last { box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.disc.win { box-shadow: 0 0 0 3px #fff; }
.rps { text-align: center; }
.rps-score { font-size: 15px; color: var(--muted); }
.rps-score b { color: var(--text); font-size: 20px; }
.rps-last { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.rps-last b { color: var(--text); }
.rps-picks { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.rps-btn { width: 60px; height: 60px; border: 0; border-radius: 14px; background: var(--surface-2); font-size: 28px; transition: transform .1s; }
.rps-btn:not(:disabled):hover { background: var(--tile-hover); transform: translateY(-2px); }
.rps-btn:disabled { opacity: .45; cursor: default; }
.rps-btn.on { opacity: 1; box-shadow: 0 0 0 2px var(--accent); }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 20px; top: 70px; z-index: 90; display: grid; gap: 10px; width: min(340px, calc(100vw - 32px)); }
.toast { background: var(--tile); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: 0 12px 34px rgba(0,0,0,.5); animation: toast-in .2s ease-out; }
.toast-text { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toast-actions { display: flex; gap: 8px; margin-top: 10px; }
.toast-actions .btn { padding: 7px 14px; }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } }

/* ---------- watching full screen ---------- */
body.watching .player { position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
body.watching .overlay { display: flex; }
body.watching.show-ui .overlay { opacity: 1; }
body.watching { cursor: none; }
body.watching.show-ui { cursor: default; }
body.watching .chat { display: none; }
body.watching.chat-on .chat { display: flex; position: fixed; right: 0; top: 0; bottom: 0; z-index: 45; background: rgba(19, 21, 27, .92); backdrop-filter: blur(6px); cursor: default; }
body.watching .chat-open { display: none; }

/* ---------- all channels sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(5, 6, 9, .96); overflow-y: auto; }
.sheet-inner { max-width: 1200px; margin: 0 auto; padding: 24px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sheet-head h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.sheet-head h2 span { color: var(--faint); font-size: 16px; font-weight: 500; margin-left: 6px; }
.dir-section h3 { font-size: 15px; color: var(--muted); font-weight: 700; margin: 26px 0 12px; }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.dir-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; cursor: pointer; transition: border-color .15s, transform .15s; }
.dir-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.dir-card .top { display: flex; align-items: center; gap: 12px; }
.dir-card .logo-tile { width: 48px; height: 48px; font-size: 15px; }
.dir-card h4 { margin: 0; font-size: 15px; }
.dir-card .no { color: var(--faint); font-size: 12px; }
.dir-card p { margin: 10px 0 8px; color: var(--muted); }
.dir-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.dir-card li { background: var(--surface-2); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: #d1d5db; }

@media (max-width: 860px) {
  .live { display: block; }
  .chat { width: auto; height: 440px; border-left: 0; border-top: 1px solid var(--line); }
  .chat-open { position: fixed; top: auto; bottom: 16px; }
  .game-win, .games-panel { left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 60vh; overflow-y: auto; }
  .ttt, .c4 { max-width: 240px; margin: 0 auto; }
  .msg-tools { display: flex; position: static; background: none; border: 0; padding: 0; margin-left: auto; align-self: flex-start; }
  .msg-tools button { font-size: 12px; padding: 2px; }
  body { overflow: auto; display: block; }
  :root { --ch-col: 76px; }
  .nav { padding: 10px 16px; gap: 14px; }
  .clock { display: none; }
  .account { margin-left: auto; }
  .account .who { display: none; }
  .splitter { display: none; }
  .details { max-height: none; }
  .fav { opacity: 1; }
  .row-ch > .fav { display: none; }
  .od-top { padding: 12px 16px 4px; }
  .od-search { width: 100%; }
  .od-row h3 { margin: 0 16px 10px; }
  .od-strip { grid-auto-columns: 62%; padding: 0 16px 8px; }
  .od-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 16px; }
  .ts-inner { margin: 0; border-radius: 0; border: 0; min-height: 100%; }
  .ts-text h2 { font-size: 26px; }
  .ep-thumb { width: 120px; }
  .vod-top, .vod-bottom { padding-left: 16px; padding-right: 16px; }
  .hero { grid-template-columns: 1fr; padding: 12px 16px; gap: 14px; }
  .player { width: 100%; }
  .d-title { font-size: 22px; }
  .chips { padding: 4px 16px 10px; }
  .row-ch { padding: 0 8px 0 16px; }
  .row-ch > div:not(.logo-tile) { display: none; }
  .row-track { margin-right: 8px; }
  .guide-body { overflow: visible; }
}
