/*
 * Hype CodeX — quiet embed for the neko web client (React client, neko >= 3.2,
 * NEKO_LEGACY=false). For the old Vue client see quiet.legacy.css.
 *
 * Inside Hype's browser panel only the picture is shown: nothing of neko's own
 * colour around it, no play / unmute overlay, no floating buttons. Everything
 * around the picture is transparent, so before the first frame the panel shows
 * Hype's own background (and Hype's own status).
 *
 * The client is Tailwind-built: class names are utility lists and the asset
 * hashes change with every release, so nothing here may depend on a generated
 * class. The anchors used below are the three stable ones:
 *   - `.video-container`      hand-written in the client's own index.html;
 *   - `[data-testid="player"]` / `[data-testid="player-overlay"]` — test ids;
 *   - the element names video / canvas / textarea inside the player.
 * `[class~="…"]` matches one Tailwind utility inside the class list regardless
 * of order. If even those disappear, the picture still works — it just gets
 * neko's own dark background back.
 */

/* ── no colour of neko's own around the picture ─────────────────────────── */
html,
body,
#root,
#neko,
.video-container,
.video-container [class~="bg-black"],
.video-container [class~="bg-black/40"],
.video-container [class~="bg-black/20"] {
    background: transparent !important;
    background-color: transparent !important;
}

html,
body {
    margin: 0 !important;
    min-width: 0 !important;
    color-scheme: normal;
    overflow: hidden !important;
}

/* ── the picture keeps its proportions ───────────────────────────────────
 * `contain` is the starting point; quiet.js switches a tab to `cover` when the
 * panel and the remote screen differ by under a few percent, so a hair of a
 * mismatch does not leave a band of panel colour under the address row
 * (27.10.2026). Hence `object-fit` is NOT marked important here — the script
 * must be able to change it. Whatever band is left stays transparent. */
.video-container video {
    object-fit: contain;
    background: transparent !important;
}

/* ── play / unmute overlay ───────────────────────────────────────────────
 * It covers the whole picture, so a click on it never reaches the remote
 * Chrome. Hidden with display:none (not opacity) so the touch falls through
 * to the client's input textarea; quiet.js clicks this button itself on the
 * first gesture, which is the client's own unmute path. */
[data-testid="player-overlay"] {
    display: none !important;
}

/* ── floating buttons over the picture ───────────────────────────────────
 * Fullscreen / picture-in-picture are already off with `cast=1`; this is the
 * safety net for them and for anything a future release floats over the
 * player. The player itself (video / canvas / textarea) is not a button. */
.video-container button,
.video-container ul {
    display: none !important;
}

/* ── nothing of the client's but the picture ─────────────────────────────
 * The blanket rule, and the reason the list above can never be complete: the
 * client draws its own screens over the player — the «n.eko» cat with the
 * green circle while it connects or reconnects, error boxes, future ones we
 * have not seen. Naming them one by one loses to the next release, so instead
 * EVERYTHING the client renders is invisible and only the picture itself is
 * brought back: the video, the cursor canvas and the input textarea.
 * `visibility` (not `display`) keeps the layout — the player still measures
 * and positions the video — and a child may override an invisible parent,
 * which `display: none` would not allow. Hype draws its own «подключаюсь…»
 * on the panel underneath, so nothing is lost. */
#root * {
    visibility: hidden !important;
}

#root video,
#root canvas,
#root textarea {
    visibility: visible !important;
}

/* ── the rest of neko's chrome ───────────────────────────────────────────
 * header, sidebar, chat, control bar, about box and dialogs are already off
 * with `embed=1`; kept in case a release renders them anyway. */
#neko > aside,
#neko > nav,
#neko > header,
#neko > footer,
[role="dialog"],
[data-testid="about"],
noscript {
    display: none !important;
}

/*
 * ПЛАШКИ-УВЕДОМЛЕНИЯ КЛИЕНТА (29.10.2026, владелец прислал снимок: «откуда крестик кривой»).
 * У клиента neko есть свои всплывающие сообщения («соединение восстановлено» и подобные), и
 * рисуются они ПОРТАЛОМ — вне `#root`, поэтому правило `#root * { visibility: hidden }` их не
 * доставало. Текст плашки при этом не читался (её фон прозрачен нашими правилами), а крестик
 * «закрыть» оставался на виду — он и висел поверх картинки непонятным значком. Сообщения эти
 * нам не нужны: состояние связи Hype показывает сам, своими словами.
 */
[role="status"],
[aria-live="polite"],
[aria-live="assertive"] {
    display: none !important;
}
