/* ============================================================
   Детская витрина «как YouTube» — стили
   ============================================================ */

/* Тёмная тема — по умолчанию (её ставит инлайн-скрипт в <head>) */
:root, :root[data-theme="dark"] {
    --bg: #0f0f0f;
    --bg-soft: #1c1c1c;
    --fg: #f1f1f1;
    --muted: #aaaaaa;
    --line: #2a2a2a;
    --chip: #272727;
    --chip-hover: #3f3f3f;
    --chip-active-bg: #f1f1f1;
    --chip-active-fg: #0f0f0f;
    --thumb-bg: #222222;
    --toast-bg: #323232;
    --toast-fg: #ffffff;
    --shadow: rgba(0, 0, 0, .6);
    --accent: #ff0033;
    --accent-dark: #cc0029;
    --radius: 16px;
    --header-h: 64px;
    --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* Светлая тема */
:root[data-theme="light"] {
    --bg: #ffffff;
    --bg-soft: #f7f7f8;
    --fg: #0f0f0f;
    --muted: #606060;
    --line: #e5e5e5;
    --chip: #f2f2f2;
    --chip-hover: #e5e5e5;
    --chip-active-bg: #0f0f0f;
    --chip-active-fg: #ffffff;
    --thumb-bg: #e9e9e9;
    --toast-bg: #222222;
    --toast-fg: #ffffff;
    --shadow: rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; min-height: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--fg);
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    overscroll-behavior-y: none;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation; /* без задержки тапа и двойного зума */
}

img { -webkit-user-drag: none; user-drag: none; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---------- Шапка ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.home-btn {
    width: 48px; height: 48px;
    border: 0; border-radius: 50%;
    background: var(--chip);
    display: inline-flex; align-items: center; justify-content: center;
    flex: none;
    transition: background .15s, transform .1s;
}
.home-btn[hidden] { display: none; }
.home-btn:hover { background: var(--chip-hover); }
.home-btn:active { transform: scale(.94); }
.home-btn svg { width: 28px; height: 28px; fill: var(--fg); }

/* Переключатель темы */
.theme-btn {
    width: 44px; height: 44px; flex: none;
    border: 0; border-radius: 50%;
    background: var(--chip);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, transform .1s;
}
.theme-btn:hover { background: var(--chip-hover); }
.theme-btn:active { transform: scale(.94); }
.theme-btn svg { width: 24px; height: 24px; fill: var(--fg); }
.theme-btn .ic-sun { display: none; }
:root[data-theme="light"] .theme-btn .ic-sun { display: block; }
:root[data-theme="light"] .theme-btn .ic-moon { display: none; }
.topbar .spacer { flex: 1; }

.logo {
    display: inline-flex; align-items: center; gap: 8px;
    text-decoration: none; font-weight: 800; font-size: 22px; letter-spacing: -.3px;
}
.logo-mark {
    width: 36px; height: 26px; border-radius: 8px;
    background: var(--accent);
    display: inline-flex; align-items: center; justify-content: center;
}
.logo-mark svg { width: 22px; height: 22px; fill: #fff; }

/* ---------- Чипсы категорий ---------- */
.chips {
    position: sticky;
    top: var(--header-h);
    z-index: 15;
    display: flex; gap: 10px;
    padding: 12px 16px;
    background: var(--bg);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: none;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--chip);
    font-size: 17px; font-weight: 600;
    text-decoration: none; white-space: nowrap;
    transition: background .15s, transform .1s;
}
.chip:hover { background: var(--chip-hover); }
.chip:active { transform: scale(.96); }
.chip.active { background: var(--chip-active-bg); color: var(--chip-active-fg); }
.chip .emoji { font-size: 18px; }

/* ---------- Сетка карточек ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 28px 16px;
    padding: 12px 16px 40px;
    max-width: 1600px;
    margin: 0 auto;
}
.card {
    display: block;
    text-decoration: none;
    border-radius: var(--radius);
    outline: none;
}
.card:focus-visible .thumb { box-shadow: 0 0 0 4px var(--accent); }
.thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: var(--thumb-bg);
    transition: transform .15s ease;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card:hover .thumb { transform: scale(1.02); }
.card:active .thumb { transform: scale(.98); }
.badge {
    position: absolute; right: 8px; bottom: 8px;
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(0,0,0,.65); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; padding-left: 3px;
}
.card-title {
    margin-top: 10px;
    font-size: 16px; font-weight: 600; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}

/* пустой список */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); font-size: 18px; }
.empty-emoji { font-size: 72px; }
.empty-hint { font-size: 14px; }
.empty code { background: var(--chip); padding: 2px 6px; border-radius: 6px; }

/* ---------- Экран просмотра ---------- */
.watch {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 0 0 40px;
    max-width: 1500px;
    margin: 0 auto;
}
@media (min-width: 700px) { .watch { padding: 20px 20px 40px; } }
@media (min-width: 1100px) {
    .watch { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
}
.watch-main { min-width: 0; }
.watch-title {
    font-size: 20px; font-weight: 700; line-height: 1.3;
    margin: 14px 16px 0;
}
@media (min-width: 700px) { .watch-title { margin: 14px 0 0; font-size: 22px; } }

.player-box {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
    border-radius: 0;
    isolation: isolate;
}
@media (min-width: 700px) { .player-box { border-radius: 16px; } }
.player-host, .player-box iframe {
    position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.player-host { z-index: 1; }

/* Щит: всегда над iframe, ловит все клики */
.shield { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
/* «Дырка» в центре: открываем только если браузер запретил автозапуск,
   чтобы ребёнок мог нажать родную кнопку ▶ YouTube. Верх (заголовок/ссылки) и низ (логотип) остаются закрыты. */
.shield.hole {
    -webkit-clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, 32% 30%, 68% 30%, 68% 70%, 32% 70%, 32% 30%);
    clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, 32% 30%, 68% 30%, 68% 70%, 32% 70%, 32% 30%);
    cursor: default;
}

/* Подсказка */
.hint {
    position: absolute; left: 0; right: 0; top: 12%;
    z-index: 5; text-align: center; pointer-events: none;
}
.hint span {
    display: inline-block; padding: 10px 18px; border-radius: 999px;
    background: rgba(255,255,255,.95); color: #000; font-weight: 700; font-size: 18px;
    animation: bounce 1s infinite;
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* Шторка */
.curtain {
    position: absolute; inset: 0; z-index: 3;
    background: #000;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.curtain-bg {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.curtain-shade { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.curtain.mode-loading .curtain-shade { background: rgba(0,0,0,.25); }
.curtain.mode-next .curtain-shade,
.curtain.mode-ended .curtain-shade,
.curtain.mode-error .curtain-shade { background: rgba(0,0,0,.72); }

.big-play {
    position: relative; z-index: 2;
    width: 104px; height: 104px; border-radius: 50%; border: 0;
    background: var(--accent); color: #fff;
    display: none; align-items: center; justify-content: center;
    box-shadow: 0 8px 30px rgba(0,0,0,.45);
    transition: transform .12s, background .15s;
}
.big-play svg { width: 60px; height: 60px; fill: #fff; margin-left: 6px; }
.big-play:hover { background: var(--accent-dark); transform: scale(1.06); }
.big-play:active { transform: scale(.95); }
.curtain.mode-paused .big-play { display: flex; }
.curtain.mode-paused { cursor: pointer; }

.spinner {
    width: 56px; height: 56px; border-radius: 50%;
    border: 5px solid rgba(255,255,255,.35); border-top-color: #fff;
    animation: spin .8s linear infinite;
    position: relative; z-index: 2;
    display: none;
}
.curtain.mode-loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Панель «дальше / конец / ошибка» */
.end-panel {
    position: relative; z-index: 2;
    display: none; flex-direction: column; align-items: center; gap: 14px;
    color: #fff; text-align: center; padding: 12px 12px 64px; /* снизу место под панель управления */
    max-width: 100%;
}
.curtain.mode-next .end-panel,
.curtain.mode-ended .end-panel,
.curtain.mode-error .end-panel { display: flex; }
.end-msg { font-size: 20px; font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.end-msg small { display: block; font-size: 12px; font-weight: 400; opacity: .7; margin-top: 4px; }
.end-msg:empty { display: none; }

.next-card {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    text-decoration: none; color: #fff;
    width: min(46vw, 300px);
}
.next-card .thumb { width: 100%; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.next-card:hover .thumb { transform: scale(1.03); }
.next-label { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; opacity: .8; }
.next-title {
    font-size: 16px; font-weight: 700; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ring {
    position: absolute; inset: 0; margin: auto;
    width: 38%; aspect-ratio: 1; max-width: 96px;
    display: flex; align-items: center; justify-content: center;
}
.ring > svg:first-child { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: rgba(0,0,0,.55); stroke: rgba(255,255,255,.35); stroke-width: 6; }
.ring-bar   { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round;
              stroke-dasharray: 100; stroke-dashoffset: 100; }
.ring-bar.run { animation: ring var(--dur, 5s) linear forwards; }
@keyframes ring { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
.ring-icon { position: relative; width: 44%; height: 44%; fill: #fff; margin-left: 6%; }

.end-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.pill {
    border: 0; border-radius: 999px;
    padding: 12px 22px; font-size: 17px; font-weight: 700;
    background: rgba(255,255,255,.92); color: #000;
    box-shadow: 0 4px 16px rgba(0,0,0,.35);
    transition: transform .12s, background .15s;
}
.pill:hover { background: #fff; transform: scale(1.04); }
.pill:active { transform: scale(.96); }

/* маленький экран — панель компактнее */
@media (max-height: 460px), (max-width: 480px) {
    .end-panel { gap: 8px; }
    .end-msg { font-size: 16px; }
    .next-card { width: min(40vw, 220px); }
    .next-label { display: none; }
    .next-title { font-size: 13px; -webkit-line-clamp: 1; }
    .pill { padding: 9px 16px; font-size: 15px; }
    .big-play { width: 80px; height: 80px; }
    .big-play svg { width: 46px; height: 46px; }
}

/* ---------- Панель управления ---------- */
.controls {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
    padding: 18px 12px 8px;
    background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0));
    color: #fff;
    opacity: 0; pointer-events: none;
    transition: opacity .2s;
}
.controls.show { opacity: 1; pointer-events: auto; }
.progress {
    position: relative; height: 22px; cursor: pointer;
    display: flex; align-items: center;
    touch-action: none;
}
.progress::before {
    content: ""; position: absolute; left: 0; right: 0; height: 6px;
    background: rgba(255,255,255,.35); border-radius: 3px;
    transition: height .1s;
}
.progress:hover::before, .progress.dragging::before { height: 9px; }
.progress-fill {
    position: absolute; left: 0; height: 6px; width: 0;
    background: var(--accent); border-radius: 3px;
    transition: height .1s;
}
.progress:hover .progress-fill, .progress.dragging .progress-fill { height: 9px; }
.progress-knob {
    position: absolute; left: 0; width: 18px; height: 18px; margin-left: -9px;
    border-radius: 50%; background: var(--accent);
    transform: scale(0); transition: transform .1s;
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.progress:hover .progress-knob, .progress.dragging .progress-knob { transform: scale(1); }
.controls-row { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.ctl {
    width: 46px; height: 46px; border: 0; border-radius: 50%;
    background: transparent; display: inline-flex; align-items: center; justify-content: center;
    flex: none;
}
.ctl:hover { background: rgba(255,255,255,.15); }
.ctl:active { transform: scale(.92); }
.ctl svg { width: 28px; height: 28px; fill: #fff; }
.time { font-size: 14px; font-variant-numeric: tabular-nums; margin: 0 6px; white-space: nowrap; }
.spacer { flex: 1; }
.volume {
    width: 90px; accent-color: #fff; cursor: pointer;
    margin: 0 4px;
}
@media (pointer: coarse) { .volume { display: none; } }
@media (max-width: 480px) { .volume { display: none; } }

/* переключение иконок */
.ic-pause, .ic-mute, .ic-unfs { display: none; }
.player-box.is-playing .ic-play { display: none; }
.player-box.is-playing .ic-pause { display: block; }
.player-box.is-muted .ic-vol { display: none; }
.player-box.is-muted .ic-mute { display: block; }
.player-box.is-fs .ic-fs { display: none; }
.player-box.is-fs .ic-unfs { display: block; }

/* полноэкранный режим */
.player-box:fullscreen,
.player-box:-webkit-full-screen,
.player-box.pseudo-fs {
    aspect-ratio: auto; border-radius: 0;
    width: 100%; height: 100%;
}
.player-box.pseudo-fs { position: fixed; inset: 0; z-index: 1000; }
.player-box:fullscreen .controls, .player-box.pseudo-fs .controls { padding-bottom: 14px; }

/* ---------- Полный экран: панель «Ещё мультики» (свайп вверх) ---------- */

/* подсказка-стрелка внизу по центру — только в полном экране */
.sheet-handle {
    position: absolute; left: 50%; bottom: 8px; z-index: 5;
    transform: translateX(-50%);
    display: none; align-items: center; gap: 6px;
    padding: 8px 16px 8px 12px;
    border: 0; border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    color: #fff; font-size: 14px; font-weight: 600;
    backdrop-filter: blur(4px);
    animation: nudge 2.4s ease-in-out infinite;
}
.sheet-handle svg { width: 20px; height: 20px; fill: #fff; }
.player-box.is-fs .sheet-handle { display: inline-flex; }
.player-box.is-fs.sheet-open .sheet-handle,
.player-box.is-fs.curtain-end .sheet-handle { display: none; }
@keyframes nudge { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }

.sheet {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 7;
    height: min(58%, 340px);
    display: flex; flex-direction: column;
    background: rgba(12, 12, 12, .93);
    backdrop-filter: blur(10px);
    border-top-left-radius: 16px; border-top-right-radius: 16px;
    transform: translateY(101%);
    transition: transform .28s cubic-bezier(.25, .8, .3, 1);
    will-change: transform;
    color: #fff;
}
.player-box.sheet-open .sheet { transform: translateY(0); }
/* вне полного экрана панель не нужна: внизу страницы и так есть список */
.player-box:not(.is-fs) .sheet { display: none; }

.sheet-grip {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px 6px;
    flex: none;
    touch-action: none;
    cursor: grab;
}
.sheet-bar {
    position: absolute; left: 50%; top: 5px; transform: translateX(-50%);
    width: 46px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .35);
}
.sheet-title { font-size: 16px; font-weight: 700; margin-top: 6px; }
.sheet-close {
    margin-left: auto; margin-top: 4px;
    width: 36px; height: 36px; flex: none;
    border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    display: inline-flex; align-items: center; justify-content: center;
}
.sheet-close:hover { background: rgba(255, 255, 255, .26); }
.sheet-close svg { width: 20px; height: 20px; fill: #fff; }

.sheet-list {
    flex: 1; min-height: 0;
    display: flex; gap: 12px;
    overflow-x: auto; overflow-y: hidden;
    padding: 4px 14px 14px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.sheet-list .card { flex: none; width: min(46vw, 230px); }
.sheet-list .card-title { color: #fff; font-size: 14px; margin-top: 6px; }

/* ---------- Список «ещё» ---------- */
.upnext { min-width: 0; padding: 0 16px; }
@media (min-width: 700px) { .upnext { padding: 0; } }
.upnext-heading { font-size: 18px; margin: 20px 0 12px; }
@media (min-width: 1100px) { .upnext-heading { margin-top: 0; } }
.upnext-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
    gap: 20px 14px;
}
@media (min-width: 1100px) {
    .upnext-list { grid-template-columns: 1fr; gap: 12px; }
    .upnext-list .card { display: grid; grid-template-columns: 168px 1fr; gap: 10px; align-items: start; }
    .upnext-list .card-title { margin-top: 2px; font-size: 15px; -webkit-line-clamp: 3; }
}

/* кнопка «перемешать» под списком */
.more-btn {
    display: block; width: 100%;
    margin: 16px 0 0;
    padding: 12px 18px;
    border: 1px solid var(--line); border-radius: 999px;
    background: var(--chip); color: var(--fg);
    font-size: 16px; font-weight: 600;
    transition: background .15s, transform .1s;
}
.more-btn:hover { background: var(--chip-hover); }
.more-btn:active { transform: scale(.98); }

/* ---------- Подвал ---------- */
.footer { text-align: center; padding: 20px 0 30px; }
.parents-link { color: var(--muted); opacity: .65; font-size: 12px; text-decoration: none; }
.parents-link:hover { color: var(--muted); text-decoration: underline; }
body.watching .footer { display: none; }

/* ---------- Загрузка / уведомления ---------- */
.loading {
    position: fixed; inset: 0; z-index: 100;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
}
.loading .spinner { display: block; border-color: var(--line); border-top-color: var(--accent); }
.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
    z-index: 200; max-width: 90vw;
    background: var(--toast-bg); color: var(--toast-fg); padding: 12px 18px; border-radius: 12px;
    font-size: 15px; box-shadow: 0 6px 24px rgba(0,0,0,.3);
}

/* ============================================================
   Добавления KidsTube: обычный (законный) режим, выход по PIN
   ============================================================ */

/* Кнопка выхода для родителей */
.exit-btn {
    width: 44px; height: 44px; flex: none;
    border: 0; border-radius: 50%;
    background: var(--chip); color: var(--fg);
    font-size: 18px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, transform .1s;
}
.exit-btn:hover { background: var(--chip-hover); }
.exit-btn:active { transform: scale(.94); }

/* В обычном режиме плеер YouTube работает как есть:
   ни щита, ни шторки, ни своих контролов — только наша витрина вокруг. */
body.mode-legal .shield,
body.mode-legal .curtain,
body.mode-legal .controls,
body.mode-legal .sheet,
body.mode-legal .sheet-handle,
body.mode-legal .hint { display: none !important; }
body.mode-legal .player-host { z-index: 3; }

/* Модальное окно PIN */
.modal {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(0, 0, 0, .72);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.modal-box {
    background: var(--bg); color: var(--fg);
    border: 1px solid var(--line); border-radius: 16px;
    padding: 24px; width: min(92vw, 360px);
    box-shadow: 0 12px 40px var(--shadow);
    text-align: center;
}
.modal-box h2 { margin: 0 0 8px; font-size: 20px; }
.modal-hint { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.modal-box input {
    width: 100%; font-size: 22px; text-align: center; letter-spacing: 4px;
    padding: 12px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--chip); color: var(--fg); box-sizing: border-box;
}
.modal-err { color: #ff6b81; font-size: 14px; margin-top: 8px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .pill { flex: 1; }
.pill.primary { background: var(--accent); color: #fff; }
.pill.primary:hover { background: var(--accent-dark); }

/* Плашка «обычный режим» под плеером */
.mode-note {
    margin: 10px 16px 0; padding: 10px 14px;
    border: 1px solid var(--line); border-radius: 12px;
    background: var(--bg-soft); color: var(--muted); font-size: 13px;
}
@media (min-width: 700px) { .mode-note { margin: 10px 0 0; } }

/* ============================================================
   Обычный режим: панель управления ПОД плеером (не поверх!)
   Плеер YouTube остаётся нетронутым — мы ничего не закрываем.
   ============================================================ */

.legal-bar { display: none; }
body.mode-legal .legal-bar {
    display: block;
    margin: 0 16px;
    padding: 10px 12px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 16px 16px;
}
@media (min-width: 700px) { body.mode-legal .legal-bar { margin: 0; } }

.lb-progress {
    position: relative; height: 20px; display: flex; align-items: center;
    cursor: pointer; touch-action: none;
}
.lb-progress::before {
    content: ""; position: absolute; left: 0; right: 0; height: 8px;
    background: var(--chip); border-radius: 4px;
}
.lb-fill {
    position: absolute; left: 0; height: 8px; width: 0;
    background: var(--accent); border-radius: 4px;
}
.lb-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.lb-row .spacer { flex: 1; }
.lb-btn {
    width: 52px; height: 52px; flex: none;
    border: 0; border-radius: 50%;
    background: var(--chip); color: var(--fg);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, transform .1s;
}
.lb-btn:hover { background: var(--chip-hover); }
.lb-btn:active { transform: scale(.94); }
.lb-btn svg { width: 30px; height: 30px; fill: var(--fg); }
.lb-main {
    width: 68px; height: 68px;
    background: var(--accent);
}
.lb-main:hover { background: var(--accent-dark); }
.lb-main svg { width: 38px; height: 38px; fill: #fff; }
.lb-time { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* иконки переключаются теми же классами, что и в строгом режиме */
body.mode-legal .legal-bar .ic-pause,
body.mode-legal .legal-bar .ic-mute,
body.mode-legal .legal-bar .ic-unfs { display: none; }
body.mode-legal .player-box.is-playing ~ .legal-bar .ic-play { display: none; }
body.mode-legal .player-box.is-playing ~ .legal-bar .ic-pause { display: block; }
body.mode-legal .player-box.is-muted ~ .legal-bar .ic-vol { display: none; }
body.mode-legal .player-box.is-muted ~ .legal-bar .ic-mute { display: block; }
body.mode-legal .player-box.is-fs ~ .legal-bar .ic-fs { display: none; }
body.mode-legal .player-box.is-fs ~ .legal-bar .ic-unfs { display: block; }

/* в обычном режиме углы плеера сверху, панель продолжает его снизу */
@media (min-width: 700px) {
    body.mode-legal .player-box { border-radius: 16px 16px 0 0; }
}

/* ============================================================
   Блокировка из кабинета родителя + автоповорот
   ============================================================ */

.blocked-screen {
    position: fixed; inset: 0; z-index: 500;
    background: #0b0b0b;
    display: flex; align-items: center; justify-content: center;
    padding: 24px; text-align: center;
    -webkit-user-select: none; user-select: none;
}
.blocked-box { max-width: 520px; }
.blocked-emoji { font-size: 84px; line-height: 1; }
.blocked-screen h2 { font-size: 26px; margin: 16px 0 8px; color: #fff; }
.blocked-hint { color: #9a9a9a; font-size: 16px; margin: 0; }

/* Полный экран по повороту телефона: плеер занимает экран,
   а наши кнопки (обычный режим) идут полосой ПОД видео — плеер не перекрываем. */
.player-box.pseudo-fs { position: fixed; inset: 0; z-index: 1000; border-radius: 0; }
body.mode-legal .player-box.pseudo-fs { bottom: 66px; }
body.mode-legal .legal-bar.fs-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001;
    margin: 0; border-radius: 0; border: 0;
    background: #101010;
    padding: 6px 10px 8px;
}
body.mode-legal .legal-bar.fs-bar .lb-btn { width: 44px; height: 44px; }
body.mode-legal .legal-bar.fs-bar .lb-main { width: 52px; height: 52px; }
body.mode-legal .legal-bar.fs-bar .lb-btn svg { width: 24px; height: 24px; }
body.mode-legal .legal-bar.fs-bar .lb-main svg { width: 28px; height: 28px; }
body.mode-legal .legal-bar.fs-bar .lb-progress { height: 16px; }

/* иконки в детском интерфейсе */
.ic { vertical-align: -0.15em; flex: none; }
.exit-btn .ic, .more-btn .ic { vertical-align: -0.2em; }
.blocked-emoji .ic { opacity: .9; }

/* полный экран: панель автоскрывается, снизу остаётся тонкая полоса-ручка */
body.mode-legal .legal-bar.fs-bar {
    transition: transform .25s ease, opacity .25s ease;
}
body.mode-legal .legal-bar.fs-bar.is-hidden {
    transform: translateY(calc(100% - 18px));
    opacity: .92;
}
body.mode-legal .legal-bar.fs-bar.is-hidden::before {
    content: "";
    position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
    width: 54px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.5);
}
body.mode-legal .legal-bar.fs-bar.is-hidden .lb-row,
body.mode-legal .legal-bar.fs-bar.is-hidden .lb-progress { pointer-events: none; }
body.mode-legal .player-box.pseudo-fs.bar-hidden { bottom: 18px; }

/* «маяк» подгрузки карточек — невидимая метка в конце сетки */
.grid-sentinel { grid-column: 1 / -1; height: 4px; }
