:root {
  --bg: #fff; --bg2: #f2f2f2; --bg3: #e5e5e5; --hover: rgba(0,0,0,.05);
  --text: #0f0f0f; --text2: #606060; --border: #ccc; --search-border: #c6c6c6;
  --brand: #ff0033; --blue: #065fd4; --chip: #0f0f0f; --chip-text: #fff;
  --font: Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  --top: 56px; --guide: 240px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f0f0f; --bg2: #272727; --bg3: #3f3f3f; --hover: rgba(255,255,255,.1);
    --text: #f1f1f1; --text2: #aaa; --border: #303030; --search-border: #303030;
    --blue: #3ea6ff; --chip: #f1f1f1; --chip-text: #0f0f0f; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.4 var(--font); -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg { fill: currentColor; }
.icon-btn { width: 40px; height: 40px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 8px; flex: none; }
.icon-btn:hover { background: var(--hover); }
.icon-btn svg { width: 24px; height: 24px; }

/* top bar */
.topbar { position: fixed; inset: 0 0 auto; height: var(--top); z-index: 30; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: var(--bg); gap: 16px; padding-top: env(safe-area-inset-top); height: calc(var(--top) + env(safe-area-inset-top)); }
.tb-start { display: flex; align-items: center; gap: 8px; }
.logo { display: flex; align-items: center; gap: 2px; padding: 0 8px 0 8px; height: 40px; }
.logo-mark { width: 29px; height: 20px; }
.logo-text { font-weight: 700; font-size: 19px; letter-spacing: -1px; font-family: "YouTube Sans", var(--font); }
.search { flex: 0 1 732px; display: flex; align-items: center; margin-left: 40px; }
.search-box { flex: 1; display: flex; height: 40px; border: 1px solid var(--search-border); border-right: 0; border-radius: 40px 0 0 40px; padding: 0 4px 0 16px; background: var(--bg); }
.search-box:focus-within { border-color: #1c62b9; box-shadow: inset 0 1px 2px rgba(0,0,0,.3); margin-left: 0; }
.search-box input { flex: 1; border: 0; outline: 0; background: none; font: 16px var(--font); color: var(--text); min-width: 0; }
.search-btn { width: 64px; height: 40px; border: 1px solid var(--search-border); border-radius: 0 40px 40px 0; background: var(--bg2); cursor: pointer; display: grid; place-items: center; }
.search-btn svg { width: 24px; height: 24px; }
.search-back, .search-open { display: none; }
.tb-end { display: flex; align-items: center; gap: 8px; }
.avatar-btn { width: 32px; height: 32px; border-radius: 50%; border: 0; background: #7b1fa2; color: #fff; display: grid; place-items: center; cursor: pointer; padding: 4px; margin: 0 8px; }
.avatar-btn.is-parent { background: var(--brand); }

/* guide (sidebar) */
.guide { position: fixed; top: calc(var(--top) + env(safe-area-inset-top)); bottom: 0; left: 0; width: var(--guide); overflow-y: auto; padding: 12px; z-index: 20; background: var(--bg); scrollbar-width: thin; }
.guide-item { display: flex; align-items: center; gap: 24px; height: 40px; padding: 0 12px; border-radius: 10px; white-space: nowrap; overflow: hidden; }
.guide-item:hover { background: var(--hover); }
.guide-item.active { background: var(--bg2); font-weight: 500; }
.guide-item svg { width: 24px; height: 24px; flex: none; }
.guide-item img { width: 24px; height: 24px; border-radius: 50%; flex: none; background: var(--bg2); object-fit: cover; }
.guide-item span { overflow: hidden; text-overflow: ellipsis; }
.guide h3 { font-size: 16px; font-weight: 500; margin: 0; padding: 6px 12px 4px; }
.guide hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
.guide-foot { color: var(--text2); font-size: 12px; padding: 16px 12px; }
body.guide-mini .guide { width: 72px; padding: 4px; }
body.guide-mini .guide-item { flex-direction: column; height: 74px; justify-content: center; gap: 6px; font-size: 10px; padding: 0; }
body.guide-mini .guide .full-only { display: none; }
.scrim { display: none; }

main { padding: calc(var(--top) + env(safe-area-inset-top)) 0 0 var(--guide); min-height: 100vh; outline: none; }
body.guide-mini main { padding-left: 72px; }
body.watch main { padding-left: 0; }
body.watch .guide { transform: translateX(-110%); transition: transform .2s; width: var(--guide); padding: 12px; }
body.watch.guide-open .guide { box-shadow: 0 0 20px rgba(0,0,0,.3); }
body.watch.guide-open .guide { transform: none; }
body.watch.guide-open .scrim, body.drawer.guide-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 15; }

/* chips */
.chips { display: flex; gap: 12px; padding: 12px 24px; overflow-x: auto; position: sticky; top: calc(var(--top) + env(safe-area-inset-top)); background: var(--bg); z-index: 10; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 12px; border-radius: 8px; background: var(--bg2); display: flex; align-items: center; font-weight: 500; border: 0; cursor: pointer; white-space: nowrap; }
.chip:hover { background: var(--bg3); }
.chip.on { background: var(--chip); color: var(--chip-text); }

/* grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 40px 16px; padding: 12px 24px 48px; }
@media (min-width: 1700px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.thumb { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: var(--bg2); display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.card:hover .thumb img { transform: scale(1.02); }
.badge { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.8); color: #fff; font-size: 12px; font-weight: 500; padding: 1px 4px; border-radius: 4px; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.5); }
.progress i { display: block; height: 100%; background: var(--brand); }
.meta { display: flex; gap: 12px; }
.meta .av { width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--bg2); object-fit: cover; }
.meta h3 { margin: 0 0 4px; font-size: 16px; font-weight: 500; line-height: 22px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sub { color: var(--text2); font-size: 14px; line-height: 20px; }
.sub a:hover { color: var(--text); }

/* watch page */
.watch-page { display: flex; gap: 24px; padding: 24px; max-width: 1754px; margin: 0 auto; }
.primary { flex: 1; min-width: 0; }
.secondary { width: 402px; flex: none; }
.player { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 12px; overflow: hidden; max-height: calc(100vh - 169px); width: 100%; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.watch-title { font-size: 20px; font-weight: 700; line-height: 28px; margin: 12px 0 0; }
.owner { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.owner .av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--bg2); }
.owner-name { font-size: 16px; font-weight: 500; }
.pill { height: 36px; padding: 0 16px; border-radius: 18px; background: var(--bg2); border: 0; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.pill:hover { background: var(--bg3); }
.pill.dark { background: var(--chip); color: var(--chip-text); }
.pill.red { background: var(--brand); color: #fff; }
.pill svg { width: 24px; height: 24px; }
.owner .actions { margin-left: auto; display: flex; gap: 8px; }
.desc { background: var(--bg2); border-radius: 12px; padding: 12px; margin-top: 12px; cursor: pointer; white-space: pre-wrap; word-break: break-word; }
.desc b { display: block; margin-bottom: 4px; }
.desc .body { max-height: 60px; overflow: hidden; }
.desc.open .body { max-height: none; }
.desc .more { font-weight: 500; margin-top: 4px; }
.compact { display: flex; gap: 8px; margin-bottom: 8px; }
.compact .thumb { width: 168px; flex: none; border-radius: 8px; }
.compact h3 { font-size: 14px; line-height: 20px; margin: 0 0 4px; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.compact .sub { font-size: 12px; line-height: 18px; }
.upnext { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-weight: 500; font-size: 16px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text2); cursor: pointer; }
.switch input { accent-color: var(--blue); width: 18px; height: 18px; }

/* channel page */
.ch-banner { height: 160px; margin: 0 24px; border-radius: 16px; background: linear-gradient(120deg, #ff0033, #ff7a00 50%, #ffd000); opacity: .85; }
.ch-head { display: flex; gap: 24px; align-items: center; padding: 16px 24px; max-width: 1284px; }
.ch-head img { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; background: var(--bg2); }
.ch-head h1 { font-size: 36px; margin: 0 0 8px; line-height: 1.2; }
.tabs { display: flex; gap: 24px; padding: 0 24px; border-bottom: 1px solid var(--border); }
.tabs span { padding: 12px 0; font-weight: 500; border-bottom: 2px solid var(--text); }

.page-title { font-size: 24px; font-weight: 700; padding: 24px 24px 0; margin: 0; }
.list-row { display: flex; gap: 16px; padding: 12px 24px; align-items: center; max-width: 1100px; }
.list-row img { width: 136px; height: 136px; border-radius: 50%; object-fit: cover; background: var(--bg2); flex: none; }
.list-row h3 { margin: 0 0 4px; font-size: 18px; font-weight: 400; }
.list-row p { color: var(--text2); margin: 4px 0 0; font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-row .grow { flex: 1; min-width: 0; }

.empty { text-align: center; padding: 80px 24px; color: var(--text2); }
.empty svg { width: 120px; height: 120px; opacity: .4; }
.empty h2 { color: var(--text); font-weight: 400; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; border: 1px solid var(--border); border-radius: 12px; padding: 40px 32px; text-align: center; }
.login-card .logo { justify-content: center; margin-bottom: 16px; }
.login-card .logo-mark { width: 44px; height: 30px; }
.login-card .logo-text { font-size: 28px; }
.field { width: 100%; height: 48px; border: 1px solid var(--border); border-radius: 8px; padding: 0 14px; font: 16px var(--font); background: var(--bg); color: var(--text); margin: 16px 0; }
.field:focus { outline: 2px solid var(--blue); border-color: transparent; }
.err { color: #e53935; min-height: 20px; font-size: 13px; }
body.bare .topbar, body.bare .guide, body.bare .pivot { display: none; }
body.bare main { padding: 0; }

/* parent */
.parent { padding: 0 24px 64px; max-width: 1200px; }
.parent h2 { font-size: 20px; margin: 32px 0 12px; }
.parent-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.parent-bar .field { flex: 1; margin: 0; min-width: 220px; height: 40px; border-radius: 20px; }
.p-row { display: flex; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.p-row img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--bg2); flex: none; }
.p-row .grow { flex: 1; min-width: 0; }
.p-row h3 { margin: 0; font-size: 16px; font-weight: 500; }
.p-row .btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.keep { width: 76px; height: 36px; border-radius: 18px; border: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 0 12px; font: inherit; }
.status-line { color: var(--text2); font-size: 13px; margin-top: 8px; }
.preview-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding: 8px 0 16px 80px; }
.preview-strip .card h3 { font-size: 13px; line-height: 18px; }
.vid-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; padding: 12px 0 16px 80px; }
.vid-admin .card.off { opacity: .4; }
.tip { background: var(--bg2); border-radius: 12px; padding: 16px; margin-top: 24px; line-height: 1.6; }
.tip code { background: var(--bg3); padding: 1px 6px; border-radius: 4px; }

.toast { position: fixed; left: 24px; bottom: 24px; background: #0f0f0f; color: #fff; padding: 14px 24px; border-radius: 8px; z-index: 50; transform: translateY(calc(100% + 40px)); visibility: hidden; transition: transform .2s, visibility .2s; max-width: calc(100% - 48px); }
@media (prefers-color-scheme: dark) { .toast { background: #f1f1f1; color: #0f0f0f; } }
.toast.on { transform: none; visibility: visible; }
.spin { width: 40px; height: 40px; margin: 64px auto; border: 3px solid var(--bg3); border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel .thumb, .skel .av { animation: pulse 1.2s ease-in-out infinite; }
.skel h3, .skel .sub { background: var(--bg2); border-radius: 4px; color: transparent; }
@keyframes pulse { 50% { opacity: .5; } }

.pivot { display: none; }

@media (max-width: 1312px) { main { padding-left: 72px; } .guide { width: 72px; padding: 4px; }
  .guide-item { flex-direction: column; height: 74px; justify-content: center; gap: 6px; font-size: 10px; padding: 0; }
  .guide .full-only { display: none; }
  body.drawer.guide-open .guide { width: var(--guide); padding: 12px; box-shadow: 0 0 20px rgba(0,0,0,.3); }
  body.drawer.guide-open .guide-item { flex-direction: row; height: 40px; justify-content: flex-start; gap: 24px; font-size: 14px; padding: 0 12px; }
  body.drawer.guide-open .guide .full-only { display: block; }
}
@media (max-width: 1016px) { .watch-page { flex-direction: column; } .secondary { width: auto; } }
@media (max-width: 792px) {
  :root { --top: 48px; }
  .guide { display: none; } main { padding-left: 0 !important; padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
  .tb-start .icon-btn#menuBtn { display: none; }
  .topbar { padding: 0 8px 0 12px; padding-top: env(safe-area-inset-top); }
  .search { display: none; margin: 0; }
  .search-open { display: grid; }
  body.searching .search { display: flex; position: absolute; inset: env(safe-area-inset-top) 0 0; background: var(--bg); padding: 0 8px; gap: 8px; z-index: 2; }
  body.searching .search-back { display: grid; }
  body.searching .search-box { border-radius: 20px; border-right: 1px solid var(--search-border); background: var(--bg2); border: 0; }
  body.searching .search-btn { display: none; }
  .grid { grid-template-columns: 1fr; padding: 0 0 24px; gap: 24px; }
  @media (min-width: 500px) { .grid { grid-template-columns: 1fr 1fr; padding: 0 16px 24px; gap: 24px 16px; } }
  .grid .thumb { border-radius: 0; }
  @media (min-width: 500px) { .grid .thumb { border-radius: 12px; } }
  .grid .meta { padding: 0 12px; }
  .chips { padding: 8px 12px; }
  .watch-page { padding: 0; gap: 0; }
  .player { border-radius: 0; position: sticky; top: calc(var(--top) + env(safe-area-inset-top)); z-index: 5; }
  .primary > :not(.player) { margin-left: 12px; margin-right: 12px; }
  .secondary { padding: 16px 12px; }
  .watch-title { font-size: 18px; line-height: 26px; }
  .owner .actions { margin-left: 0; width: 100%; overflow-x: auto; }
  .compact .thumb { width: 160px; }
  .pivot { display: flex; position: fixed; inset: auto 0 0; height: calc(48px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bg); border-top: 1px solid var(--border); z-index: 30; }
  .pivot a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; gap: 2px; }
  .pivot a svg { width: 24px; height: 24px; }
  .pivot a.active svg { color: var(--text); }
  .ch-banner { margin: 0; border-radius: 0; height: 90px; }
  .ch-head img { width: 72px; height: 72px; } .ch-head h1 { font-size: 24px; } .ch-head { padding: 16px 12px; gap: 16px; }
  .list-row { padding: 12px; } .list-row img { width: 64px; height: 64px; }
  .page-title { padding: 16px 12px 0; }
  .parent { padding: 0 12px 64px; }
  .preview-strip, .vid-admin { padding-left: 0; }
  .logo-text { font-size: 18px; }
}
/* TV / big screens viewed from the couch (e.g. AirPlay mirroring) */
@media (min-width: 1900px) { html { font-size: 16px; } }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 8px; }

/* ---------------- YouTube-style player ---------------- */
.ytp { position: relative; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; color: #fff; font-family: Roboto, Arial, sans-serif; }
.ytp video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.ytp-shade { position: absolute; inset: auto 0 0; height: 98px; background: linear-gradient(transparent, rgba(0,0,0,.7)); pointer-events: none; transition: opacity .25s; }
.ytp-bottom { position: absolute; left: 12px; right: 12px; bottom: 0; transition: opacity .25s; }
.ytp.idle { cursor: none; }
.ytp.idle .ytp-bottom, .ytp.idle .ytp-shade { opacity: 0; pointer-events: none; }
.ytp-bar { display: flex; align-items: center; height: 48px; }
.ytp-btn { width: 48px; height: 48px; padding: 0 6px; border: 0; background: none; color: #fff; cursor: pointer; opacity: .9; flex: none; display: grid; place-items: center; }
.ytp-btn:hover { opacity: 1; }
.ytp-btn svg { width: 36px; height: 36px; padding: 6px; fill: #fff; filter: drop-shadow(0 0 2px rgba(0,0,0,.5)); }
.ytp-vol { display: flex; align-items: center; }
.ytp-vol input { width: 0; opacity: 0; transition: width .2s, opacity .2s; -webkit-appearance: none; appearance: none; height: 3px; border-radius: 2px; cursor: pointer;
  background: linear-gradient(#fff, #fff) 0/var(--p, 100%) 100% no-repeat, rgba(255,255,255,.2); }
.ytp-vol:hover input, .ytp-vol input:focus { width: 64px; opacity: 1; margin-right: 8px; }
.ytp-vol input::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.ytp-vol input::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
.ytp-time { font-size: 13px; padding: 0 8px; white-space: nowrap; text-shadow: 0 0 2px rgba(0,0,0,.5); font-variant-numeric: tabular-nums; }
.ytp-sp { flex: 1; }
.ytp-progress { position: relative; height: 16px; display: flex; align-items: flex-end; cursor: pointer; touch-action: none; }
.ytp-rail { position: relative; width: 100%; height: 3px; background: rgba(255,255,255,.2); transition: height .1s; margin-bottom: 4px; }
.ytp-progress:hover .ytp-rail, .ytp.scrubbing .ytp-rail { height: 5px; }
.ytp-rail i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
.ytp-rail .buf { background: rgba(255,255,255,.4); }
.ytp-rail .hov { background: rgba(255,255,255,.5); opacity: 0; }
.ytp-progress:hover .hov { opacity: 1; }
.ytp-rail .cur { background: #f03; }
.ytp-scrub { position: absolute; bottom: 0; width: 13px; height: 13px; margin-left: -6.5px; border-radius: 50%; background: #f03; transform: scale(0); transition: transform .1s; bottom: -0.5px; }
.ytp-progress:hover .ytp-scrub, .ytp.scrubbing .ytp-scrub { transform: scale(1); }
.ytp-tip { position: absolute; bottom: 22px; transform: translateX(-50%); background: rgba(28,28,28,.9); padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; opacity: 0; pointer-events: none; }
.ytp-progress:hover .ytp-tip, .ytp.scrubbing .ytp-tip { opacity: 1; }
.ytp-big { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; border-radius: 14px; background: rgba(33,33,33,.8); display: none; place-items: center; cursor: pointer; }
.ytp-big svg { width: 36px; height: 36px; fill: #fff; }
.ytp.paused:not(.ended) .ytp-big { display: grid; }
.ytp:not(.paused) .ytp-big { display: none; }
.ytp-big:hover { background: #f03; }
.ytp-bezel { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px; border-radius: 50%; background: rgba(0,0,0,.5); display: grid; place-items: center; opacity: 0; pointer-events: none; }
.ytp-bezel svg { width: 36px; height: 36px; fill: #fff; }
.ytp-bezel.on { animation: bezel .5s linear; }
@keyframes bezel { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(2); } }
.ytp-spinner { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px; border: 4px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; display: none; pointer-events: none; }
.ytp.loading:not(.paused) .ytp-spinner { display: block; }
.ytp-seekfx { position: absolute; top: 0; bottom: 0; width: 40%; display: grid; place-items: center; opacity: 0; pointer-events: none; background: rgba(255,255,255,.12); }
.ytp-seekfx.left { left: 0; border-radius: 0 50% 50% 0 / 0 100% 100% 0; }
.ytp-seekfx.right { right: 0; border-radius: 50% 0 0 50% / 100% 0 0 100%; }
.ytp-seekfx span { display: flex; flex-direction: column; align-items: center; font-size: 12px; }
.ytp-seekfx svg { width: 32px; height: 32px; fill: #fff; }
.ytp-seekfx svg.flip, .ytp-seekfx .flip { transform: scaleX(-1); }
.ytp-seekfx.on { animation: seekfx .7s ease-out; }
@keyframes seekfx { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
.ytp-menu { position: absolute; right: 12px; bottom: 61px; min-width: 220px; max-height: 70%; overflow-y: auto; background: rgba(28,28,28,.92); border-radius: 12px; padding: 8px 0; z-index: 3; text-shadow: none; }
.ytp-menu-h { font-size: 12px; color: #aaa; padding: 8px 16px 4px; }
.ytp-mi { display: block; width: 100%; text-align: left; border: 0; background: none; color: #eee; padding: 8px 16px 8px 40px; font-size: 14px; cursor: pointer; position: relative; }
.ytp-mi:hover { background: rgba(255,255,255,.1); }
.ytp-mi.on::before { content: "✓"; position: absolute; left: 16px; }
.ytp.fs { border-radius: 0 !important; max-height: none !important; }
.ytp.fs .ytp-btn svg { width: 44px; height: 44px; }
.ytp.fs .ytp-bar { height: 60px; }
.ytp-endcard { position: absolute; inset: 0; background: rgba(0,0,0,.75); display: grid; place-items: center; z-index: 4; text-align: center; }
.ytp-endcard h3 { margin: 4px 0; font-size: 18px; max-width: 420px; }
.ytp-endcard .sub { color: #ddd; }
.ec-row { position: relative; margin: 12px auto; width: 240px; }
.ec-row img { width: 100%; border-radius: 8px; display: block; aspect-ratio: 16/9; object-fit: cover; }
.ec-play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px; border: 0; background: rgba(0,0,0,.6); border-radius: 50%; cursor: pointer; padding: 0; }
.ec-play svg { width: 100%; height: 100%; }
.ec-play .ring { fill: none; stroke: #fff; stroke-width: 2.5; stroke-dasharray: 100.5; stroke-dashoffset: 100.5; transform: rotate(-90deg); transform-origin: center; animation: ring 5s linear forwards; }
@keyframes ring { to { stroke-dashoffset: 0; } }
.ec-cancel { background: rgba(255,255,255,.15); color: #fff; }
body.theater .watch-page { flex-direction: column; padding-top: 0; max-width: none; }
body.theater .player { border-radius: 0; max-height: calc(100vh - 169px); height: 56.25vw; aspect-ratio: auto; }
body.theater .primary > :not(.player), body.theater .secondary { max-width: 1280px; width: 100%; margin-left: auto; margin-right: auto; }
@media (max-width: 792px) { .hide-sm { display: none; } .ytp-btn { width: 40px; } .ytp-btn svg { width: 32px; height: 32px; } .ytp-bottom { left: 4px; right: 4px; } .ytp-vol input { display: none; } }
body.offline .topbar::after { content: "Offline"; position: absolute; left: 50%; top: calc(100% + 4px); transform: translateX(-50%); background: #333; color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 10px; }
#dlBtn[disabled] { opacity: .8; }
