/* ================================================================
   platoshin. — color room
   Same design language as the portfolio: warm near-black, bone
   foreground, signal red, Rubik. Zero CDN.
   ================================================================ */

@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 400 900; font-display: swap; src: url('../../fonts/rubik-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 400 900; font-display: swap; src: url('../../fonts/rubik-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --bg: #0D0D0D; --bg-2: #161616; --panel: #1A1813;
  --ink: #F4EFE6; --ink-soft: #C9C2B5; --fg-dim: #8A8378;
  --line: #2A2722; --line-soft: #211E19;
  --red: #E8332B; --red-deep: #C2261F;
  --pad-x: 56px; --pad-x-mob: 20px;
  --easing: cubic-bezier(.2,.7,.1,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); overflow-x: hidden; overscroll-behavior: none; }
body { background: transparent; color: var(--ink); font-family: 'Rubik', system-ui, sans-serif; font-weight: 400; -webkit-font-smoothing: antialiased; overscroll-behavior: none; letter-spacing: -0.005em; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--ink); }
button { font: inherit; cursor: pointer; color: inherit; }
input { font: inherit; }
img, video { display: block; max-width: 100%; }
.mono { font-family: 'Rubik', sans-serif; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }

/* film grain — sits above the page, below the player (z 70) and modals */
body::after { content: ""; position: fixed; inset: -180px 0 0; pointer-events: none; z-index: 60; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/></svg>"); opacity: 0.06; mix-blend-mode: overlay; }

/* hide translatable text until the language is applied */
html:not(.i18n-ready) [data-i18n], html:not(.i18n-ready) [data-i18n-html] { visibility: hidden; }
body.lang-fade [data-i18n], body.lang-fade [data-i18n-html] { opacity: 0; transition: opacity .2s ease; }

/* ---------- ATMOSPHERE ---------- */
.atmosphere { position: fixed; inset: -180px 0 0; z-index: -1; pointer-events: none; overflow: hidden; }
.atmo-slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; filter: saturate(0.92) contrast(1.02); transition: opacity 1.8s ease; }
.atmo-slide.is-on { opacity: 0.22; }
body[data-app] .atmo-slide.is-on { opacity: 0.13; }
.atmosphere::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(from var(--bg) r g b / 0.93) 0%, rgb(from var(--bg) r g b / 0.76) 32%, rgb(from var(--bg) r g b / 0.70) 58%, rgb(from var(--bg) r g b / 0.92) 100%); }

/* ---------- NAV ---------- */
/* Height is content + safe-area, so the bar always clears the notch.
   On app pages it is a plain flex child of a non-scrolling shell —
   it physically cannot scroll out of view. */
nav.site-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding: calc(18px + env(safe-area-inset-top, 0px)) max(var(--pad-x), env(safe-area-inset-right)) 18px max(var(--pad-x), env(safe-area-inset-left)); }
body:not([data-app]) nav.site-nav::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 160px; background: var(--bg); pointer-events: none; }
body[data-app] nav.site-nav { position: static; flex: 0 0 auto; background: var(--bg); }
.brand { display: inline-flex; align-items: baseline; gap: 14px; }
.brand-word { font-family: 'Rubik', sans-serif; font-weight: 800; letter-spacing: -0.04em; font-size: 22px; color: var(--ink); display: inline-flex; align-items: baseline; }
.brand-word .dot { color: var(--red); }
.nav-tag { color: var(--fg-dim); }
nav.site-nav ul { display: flex; gap: 26px; list-style: none; align-items: center; }

/* status pill (watch / call pages) */
.status { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-soft); }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-dim); transition: background-color .4s ease; }
.status .status-text { font-family: 'Rubik', sans-serif; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }
.status[data-state="live"] { color: var(--ink); }
.status[data-state="live"] .dot { background: var(--red); animation: statusPulse 1.6s ease-in-out infinite; }
.status[data-state="connecting"] .dot { background: var(--ink-soft); animation: statusPulse 1.2s ease-in-out infinite; }
.status[data-state="connected"] { color: var(--ink); }
.status[data-state="connected"] .dot { background: var(--red); animation: statusPulse 1.6s ease-in-out infinite; }
.status[data-state="error"] { color: var(--red); }
.status[data-state="error"] .dot { background: var(--red); }
@keyframes statusPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.72); } }

/* language switch — underline style, same as portfolio */
.lang-switch { display: inline-flex; align-items: center; gap: 10px; }
.lang-opt { position: relative; background: none; border: none; cursor: pointer; outline: none; font-family: 'Rubik', system-ui, sans-serif; font-size: 14px; letter-spacing: -0.005em; font-weight: 500; color: var(--ink); text-transform: lowercase; padding: 8px 2px; transition: color .35s ease; will-change: transform; }
.lang-opt::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--easing); }
.lang-opt:hover::after { transform: scaleX(1); }
.lang-opt.is-active::after { transform: scaleX(1); }

/* ---------- BUTTONS ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 22px; border-radius: 999px; font-size: 14px; font-weight: 500; border: none; transition: background-color .4s ease, color .4s ease, border-color .4s ease, opacity .3s ease; will-change: transform; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-disabled { opacity: 0.35; pointer-events: none; }
.btn:disabled { opacity: 0.35; cursor: default; pointer-events: none; }

/* underline text button — shared language: tabs, copy/open, stat-toggle */
.ubtn { position: relative; display: inline-flex; align-items: center; gap: 7px; background: none; border: none; padding: 8px 2px; cursor: pointer; color: var(--ink); font-family: 'Rubik', sans-serif; font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; transition: color .3s ease; }
.ubtn::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--easing); }
.ubtn:hover::after { transform: scaleX(1); }
.ubtn:disabled, .ubtn.btn-disabled { opacity: 0.35; pointer-events: none; cursor: default; }

.btn-rect { border-radius: 11px; height: 49px; padding: 0 22px; font-family: 'Rubik', sans-serif; font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.btn-rect:hover { border-color: var(--ink-soft); }

/* ---------- HOST (generator) ---------- */
.host { max-width: 1060px; margin: 0 auto; padding: calc(118px + env(safe-area-inset-top, 0px)) var(--pad-x) 24px; width: 100%; }
.host-title { font-family: 'Rubik', sans-serif; font-weight: 800; font-size: clamp(46px, 6.6vw, 104px); line-height: 0.92; letter-spacing: -0.05em; color: var(--ink); }
.host-title .row { display: block; overflow: hidden; padding: 0.04em 0 0.14em; }
.host-title .row > span { display: inline-block; transform: translateY(110%); will-change: transform; }
.host-title .dot { color: var(--red); }
.host-title .accent, .host-title .accent .dot { color: var(--red); }
.host-sub { margin-top: 16px; max-width: 560px; color: var(--ink-soft); font-size: 16px; line-height: 1.5; text-wrap: pretty; }
.host-card { margin-top: 34px; background: rgb(from var(--bg-2) r g b / 0.55); border: 1px solid var(--line); border-radius: 18px; padding: 30px; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); display: flex; flex-direction: column; gap: 24px; }
.host-tabs { display: flex; gap: 20px; flex-wrap: wrap; }
.host-tab { color: var(--fg-dim); }
.host-tab:hover { color: var(--ink); }
.host-tab.active { color: var(--ink); }
.host-tab.active::after { transform: scaleX(1); }
.field { display: flex; flex-direction: column; gap: 10px; }
.field label { color: var(--fg-dim); }
.field input { width: 100%; background: rgb(from var(--bg) r g b / 0.55); border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; color: var(--ink); font-size: 15px; outline: none; transition: border-color .3s ease; }
.field input:focus { border-color: var(--red); }
.field input::placeholder { color: rgb(from var(--fg-dim) r g b / 0.65); }
.is-hidden { display: none !important; }
.host-detect { display: flex; align-items: center; gap: 10px; color: var(--fg-dim); }
.host-detect .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-dim); transition: background-color .35s ease; }
.host-detect[data-state="hls"] .dot, .host-detect[data-state="whep"] .dot, .host-detect[data-state="call"] .dot { background: var(--ink); animation: statusPulse 1.6s ease-in-out infinite; }
.host-detect[data-state="invalid"] .dot { background: var(--red); }
.host-detect .detect-value { color: var(--ink); }
.host-detect[data-state="invalid"] .detect-value { color: var(--red); }
.host-detect[data-state="hls"] .detect-value, .host-detect[data-state="whep"] .detect-value, .host-detect[data-state="call"] .detect-value { color: var(--ink); }
.host-detect[data-state="empty"] .detect-value { color: var(--fg-dim); }
.host-linkrow { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.host-linkrow .field { flex: 1; min-width: 260px; }
.host-linkrow input { color: var(--ink-soft); font-size: 13.5px; height: 49px; padding-top: 0; padding-bottom: 0; }
.host-actions { display: flex; gap: 12px; align-self: flex-end; align-items: center; min-height: 49px; }
.host-hint { color: var(--fg-dim); font-size: 13px; line-height: 1.5; max-width: 640px; text-wrap: pretty; }

/* ---------- FOOTER (slim, as in portfolio) ---------- */
footer.site-footer { padding: 26px var(--pad-x) max(26px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); margin-top: auto; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; color: var(--fg-dim); flex-wrap: wrap; gap: 14px; }

/* ---------- TOAST ---------- */
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(10px); z-index: 130; background: rgba(28,26,21,0.88); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 999px; padding: 11px 20px; font-family: 'Rubik', sans-serif; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; color: var(--ink); opacity: 0; pointer-events: none; transition: opacity .35s ease, transform .4s var(--easing); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* host page: normal flow, sized to the viewport (no scroll when it fits) */
body:not([data-app]) { min-height: 100svh; display: flex; flex-direction: column; }

/* ---------- APP LAYOUT (watch / call) ---------- */
/* svh = viewport with the browser UI shown → the shell always fits,
   so there is no page scroll and no rubber-banding to fight. */
body[data-app] { height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; }
main.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.dual-pane { flex: 1; min-height: 0; overflow: hidden; display: flex; gap: 18px; padding: 6px var(--pad-x) 0; }
.dual-pane [data-pane="player"] { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding-bottom: 6px; /* symmetric with .dual-pane's 6px top: equal gaps to the nav rule and the stats rule */ }
.dual-pane [data-pane="call"] { width: 35%; min-width: 320px; align-self: center; height: var(--call-h, 100%); margin-bottom: 6px; border-radius: 14px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); position: relative; z-index: 70; transition: width .55s var(--easing), min-width .55s var(--easing), opacity .4s ease; }
.dual-pane.split-collapsed [data-pane="call"] { width: 0; min-width: 0; opacity: 0; border-color: transparent; pointer-events: none; }
body.solo [data-pane="call"], body.solo .stat-toggle { display: none; }

/* mobile: button-switched tabs */
@media (max-width: 899px) {
  .dual-pane { position: relative; padding: 4px 14px; }
  .dual-pane.dual-pane-mobile [data-pane="player"], .dual-pane.dual-pane-mobile [data-pane="call"] { position: absolute; inset: 4px 14px; width: auto; min-width: 0; height: auto; align-self: auto; margin-bottom: 0; transition: transform .5s var(--easing), opacity .4s ease; }
  .dual-pane.dual-pane-mobile [data-pane="player"] { transform: translateX(0); }
  .dual-pane.dual-pane-mobile [data-pane="call"] { transform: translateX(104%); }
  .dual-pane.dual-pane-mobile.pane-call-active [data-pane="player"] { transform: translateX(-104%); }
  .dual-pane.dual-pane-mobile.pane-call-active [data-pane="call"] { transform: translateX(0); }
}

/* stats row */
.stats-row { display: flex; align-items: center; gap: 26px; padding: 16px var(--pad-x) max(20px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); flex-wrap: wrap; }
.stat { display: inline-flex; align-items: baseline; gap: 8px; color: var(--fg-dim); }
.stat b { font-family: 'Rubik', sans-serif; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat.pulse b { animation: statPulse 0.9s ease; }
@keyframes statPulse { from { color: var(--red); } }
.stats-row[data-kind="whep"] .stat-latency { display: none; }
.stat-toggle { margin-left: auto; background: transparent; border: 1px solid var(--line); border-radius: 11px; height: 35px; padding: 0 16px; color: var(--ink); font-family: 'Rubik', sans-serif; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; cursor: pointer; transition: color .3s ease, border-color .3s ease, background-color .15s ease; }
@media (hover: hover) {
  .stat-toggle:hover { border-color: var(--ink-soft); }
}
.stat-toggle:active { background: rgba(255,255,255,0.07); }

/* ---------- PLAYER ---------- */
.player { position: relative; z-index: 70; width: 100%; height: auto; max-height: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 36px 84px -42px rgba(0,0,0,0.9); }
/* container-driven fit: the box is the largest 16:9 rect that fits the
   pane, in both axes — no viewport-unit math, so svh/dvh can't bite. */
@supports (height: 1cqh) {
  .dual-pane [data-pane="player"] { container-type: size; }
  .player { width: auto; height: min(100cqh, calc(100cqw * 9 / 16)); max-height: none; }
}
.player:focus { outline: none; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

/* status screen (waiting / connecting / broken / no-url) */
.pl-screen { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; background: radial-gradient(circle at 50% 42%, #111110, #0A0A0A 78%); transition: opacity .5s ease; }
.pl-screen.hidden { opacity: 0; pointer-events: none; }
.pl-screen-k { color: var(--red); margin-bottom: 6px; }
.pl-screen-title { font-family: 'Rubik', sans-serif; font-weight: 700; font-size: clamp(19px, 2.4vw, 30px); letter-spacing: -0.03em; color: var(--ink); transition: opacity .2s ease; text-wrap: pretty; }
.pl-screen-sub { font-size: 14px; color: var(--ink-soft); max-width: 440px; line-height: 1.5; transition: opacity .2s ease; text-wrap: pretty; }
.text-swap { opacity: 0 !important; }

/* controls — hover reveal, auto-hide */
.pl-controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; align-items: center; gap: 14px; padding: 34px 18px 13px; background: linear-gradient(0deg, rgba(8,7,6,0.78), transparent); opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .4s var(--easing); user-select: none; -webkit-user-select: none; }
.player.controls-on.is-started .pl-controls { opacity: 1; transform: translateY(0); }
.pl-btn { position: relative; background: none; border: none; color: var(--ink); padding: 6px; display: flex; align-items: center; justify-content: center; transition: color .3s ease; }
.pl-btn:hover { color: var(--red); }
.pl-btn svg { width: 20px; height: 20px; stroke-width: 2.3; }
[data-ctl="snapshot"] svg { width: 22px; height: 22px; }
[data-ctl="reload"] svg { width: 18px; height: 18px; }
.pl-time { font-weight: 600; }
.pl-tip { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(5px); background: rgba(28,26,21,0.55); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); border-radius: 5px; padding: 4px 9px; font-family: 'Rubik', sans-serif; font-weight: 600; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; white-space: nowrap; opacity: 0; transition: opacity .3s ease, transform .35s var(--easing); pointer-events: none; }
.pl-btn:hover .pl-tip { opacity: 1; transform: translateX(-50%) translateY(0); }
.pl-btn.tip-l .pl-tip { left: 0; transform: translateY(5px); }
.pl-btn.tip-l:hover .pl-tip { transform: translateY(0); }
.pl-btn.tip-r .pl-tip { left: auto; right: 0; transform: translateY(5px); }
.pl-btn.tip-r:hover .pl-tip { transform: translateY(0); }
.snapshot-flash { animation: snapFlash 0.35s ease; }
@keyframes snapFlash { 30% { color: #fff; transform: scale(1.12); } }

/* time (VOD only) */
.pl-time { font-family: 'Rubik', sans-serif; font-weight: 600; font-size: 12px; letter-spacing: 0.05em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; display: none; }
.pl-time .cur { color: var(--red); }
.player[data-mode="vod"] .pl-time { display: block; }

/* seek line (VOD only) / spacer (live) */
.pl-line { position: relative; flex: 1; height: 24px; display: none; align-items: center; cursor: pointer; touch-action: none; }
.player[data-mode="vod"] .pl-line { display: flex; }
.pl-spacer { flex: 1; }
.player[data-mode="vod"] .pl-spacer { display: none; }
.pl-line::before { content: ""; position: absolute; left: 0; right: 0; height: 3px; border-radius: 2px; background: rgba(244,239,230,0.18); }
.pl-buffer { position: absolute; height: 3px; border-radius: 2px; background: rgba(244,239,230,0.28); width: 0; }
.pl-fill { position: absolute; height: 3px; border-radius: 2px; background: var(--red); width: 0; }
.pl-knob { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: var(--red); transform: translateX(-50%) scale(0); transition: transform .25s var(--easing); }
.pl-line:hover .pl-knob, .player.scrubbing .pl-knob { transform: translateX(-50%) scale(1); }
.pl-hovertip { position: absolute; bottom: calc(100% + 2px); left: 0; transform: translateX(-50%) translateY(4px); background: rgba(28,26,21,0.55); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); border-radius: 5px; padding: 4px 8px; font-family: 'Rubik', sans-serif; font-weight: 600; font-size: 9px; letter-spacing: 0.08em; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0; transition: opacity 0.25s ease; pointer-events: none; z-index: 2; }
.pl-line:hover .pl-hovertip, .player.scrubbing .pl-line .pl-hovertip, .pl-volline:hover .pl-hovertip, .player.voldrag .pl-volline .pl-hovertip { opacity: 1; }

/* LIVE chip (live streams) */
.pl-live { display: none; align-items: center; gap: 8px; background: none; border: none; padding: 6px 4px; font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 0.14em; color: var(--ink); transition: color .3s ease; position: relative; }
.player.is-live .pl-live { display: inline-flex; }
.pl-live .d { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: statusPulse 1.6s ease-in-out infinite; transition: background-color .3s ease; }
.pl-live.behind { color: var(--fg-dim); cursor: pointer; }
.pl-live.behind .d { background: var(--fg-dim); animation: none; }
.pl-live.behind:hover { color: var(--ink); }
.pl-live.behind:hover .d { background: var(--red); }
.pl-live .pl-tip { text-transform: uppercase; }
.pl-live:hover .pl-tip { opacity: 1; transform: translateX(-50%) translateY(0); }

/* volume */
.pl-vol { position: relative; display: flex; align-items: center; }
.pl-volline { position: relative; width: 64px; height: 24px; margin-left: 10px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.pl-volline::before { content: ""; position: absolute; left: 0; right: 0; height: 3px; border-radius: 2px; background: rgba(244,239,230,0.18); }
.pl-volfill { position: absolute; height: 3px; border-radius: 2px; background: var(--red); width: 100%; pointer-events: none; }
.pl-volknob { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--red); transform: translateX(-50%) scale(0); left: 100%; pointer-events: none; transition: transform .25s var(--easing); }
.pl-volline:hover .pl-volknob, .player.voldrag .pl-volknob { transform: translateX(-50%) scale(1); }

.player:fullscreen { border-radius: 0; max-width: none; }
.player:fullscreen:not(.controls-on), .player:fullscreen:not(.controls-on) * { cursor: none !important; }

/* ---------- CALL (page + pane) ---------- */
.call-stage { flex: 1; min-height: 0; position: relative; margin: 26px var(--pad-x) max(20px, env(safe-area-inset-bottom)); border-radius: 14px; overflow: hidden; background: var(--bg-2); z-index: 70; }
.jitsi-container { position: absolute; inset: 0; }
.jitsi-container iframe { width: 100%; height: 100%; border: 0; display: block; }
.call-loading, .call-error { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px; background: radial-gradient(circle at 50% 42%, #141311, #0C0C0B 78%); transition: opacity .4s ease; pointer-events: none; }
.call-loading span, .call-error span { color: var(--ink-soft); font-size: 14px; }
.call-error span { color: var(--ink); font-family: 'Rubik', sans-serif; font-weight: 700; font-size: clamp(19px, 2.4vw, 30px); letter-spacing: -0.03em; text-wrap: pretty; }
.call-error .ce-k { color: var(--red); margin-bottom: 4px; }
.call-error .ce-sub { font-size: 14px; color: var(--ink-soft); max-width: 440px; line-height: 1.5; text-wrap: pretty; font-family: 'Rubik', sans-serif; font-weight: 400; letter-spacing: 0; }
.call-loading .cl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: statusPulse 1.2s ease-in-out infinite; }
[data-pane="call"].loaded .call-loading { opacity: 0; }
.call-loading[hidden], .call-error[hidden] { display: none; }

/* ---------- NAME MODAL ---------- */
.name-modal-overlay, .snapshot-modal-overlay { position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgb(from var(--bg) r g b / 0.86); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); opacity: 0; transition: opacity .35s ease; }
.name-modal-overlay.show, .snapshot-modal-overlay.show { opacity: 1; }
.name-modal-overlay.hide, .snapshot-modal-overlay.hide { opacity: 0; }
.name-modal-card, .snapshot-modal-card { position: relative; background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: 0 50px 130px -40px rgba(0,0,0,0.92); transform: translateY(14px); opacity: 0; transition: transform .45s var(--easing), opacity .4s ease; }
.show .name-modal-card, .show .snapshot-modal-card { transform: translateY(0); opacity: 1; }
.name-modal-card { width: min(430px, 100%); display: flex; flex-direction: column; gap: 14px; }
.name-modal-title, .snapshot-modal-title { font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 22px; letter-spacing: -0.03em; color: var(--ink); }
.name-modal-sub, .snapshot-modal-sub { font-size: 14px; font-weight: 500; color: var(--ink-soft); line-height: 1.5; margin-top: -6px; }
.name-modal-input { width: 100%; background: rgb(from var(--bg) r g b / 0.55); border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; color: var(--ink); font-size: 15px; font-weight: 500; outline: none; transition: border-color .3s ease; }
.name-modal-input:focus { border-color: var(--red); }
.name-modal-input.shake { animation: nmShake 0.45s ease; border-color: var(--red); }
@keyframes nmShake { 20% { transform: translateX(-7px); } 45% { transform: translateX(6px); } 70% { transform: translateX(-4px); } 90% { transform: translateX(2px); } }
.name-modal-mic-row { display: flex; align-items: center; gap: 14px; }
.mic-toggle { width: 52px; height: 52px; border-radius: 13px; border: 1px solid var(--line); background: transparent; color: var(--ink-soft); display: flex; align-items: center; justify-content: center; transition: color .3s ease, border-color .3s ease, background-color .3s ease; }
.mic-toggle svg { width: 24px; height: 24px; }
.mic-toggle .mic-slash { transition: opacity .25s ease; }
.mic-toggle[aria-pressed="true"] { color: var(--red); border-color: var(--red); }
.mic-toggle[aria-pressed="true"] .mic-slash { opacity: 0; }
.mic-toggle:hover { border-color: var(--ink-soft); color: var(--red); }
.name-modal-mic-label { font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.name-modal-actions { display: flex; justify-content: flex-end; margin-top: 4px; }

.name-modal-actions .btn-rect:hover { border-color: var(--ink-soft); }

/* ---------- SNAPSHOT MODAL ---------- */
.snapshot-modal-card { width: min(760px, 100%); display: flex; flex-direction: column; gap: 12px; }
.snapshot-modal-close-x { position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--fg-dim); padding: 8px; display: flex; transition: color .3s ease; }
.snapshot-modal-close-x:hover { color: var(--red); }
.snapshot-modal-close-x svg { width: 20px; height: 20px; }
.snapshot-preview { border-radius: 11px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.snapshot-preview img { width: 100%; max-height: 56vh; object-fit: contain; }
.snapshot-modal-meta { font-family: 'Rubik', sans-serif; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; color: var(--fg-dim); font-variant-numeric: tabular-nums; }
.snapshot-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.snapshot-icon-btn { position: relative; width: 52px; height: 52px; border-radius: 11px; border: 1px solid var(--line); background: transparent; color: var(--ink); display: flex; align-items: center; justify-content: center; transition: background-color .35s ease, color .35s ease, border-color .35s ease; }
.snapshot-icon-btn svg { width: 20px; height: 20px; }
.snapshot-icon-btn-primary:hover, .snapshot-icon-btn-secondary:hover { border-color: var(--ink-soft); color: var(--red); }
.snapshot-icon-btn-ok, .snapshot-icon-btn-ok:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.snapshot-icon-btn[data-tooltip]::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%); background: rgba(28,26,21,0.7); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); border-radius: 5px; padding: 4px 9px; font-family: 'Rubik', sans-serif; font-weight: 600; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; white-space: nowrap; opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.snapshot-icon-btn:hover::after { opacity: 1; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  :root { --pad-x: var(--pad-x-mob); }
  nav.site-nav { padding: calc(13px + env(safe-area-inset-top, 0px)) var(--pad-x-mob) 13px; }
  nav.site-nav ul { gap: 16px; }
  .host { padding-top: calc(104px + env(safe-area-inset-top, 0px)); }
  .host-card { padding: 22px 18px; }
  .stats-row { gap: 16px; padding-top: 12px; }
  .dual-pane [data-pane="call"] { min-width: 280px; }
}
@media (max-width: 640px) {
  .brand-word { font-size: 20px; }
  .lang-opt { font-size: 12px; }
  .status .status-text { font-size: 10px; }
  .host-actions { width: 100%; justify-content: flex-start; gap: 26px; padding-bottom: 0; }
  .stats-row { flex-wrap: nowrap; gap: 14px; }
  .stat-bitrate, .stat-codec, .stat-fps, .stat-latency { display: none; }
  .stat-toggle { flex: none; height: 32px; padding: 0 13px; white-space: nowrap; }
  .pl-controls { gap: 10px; padding: 26px 12px 10px; }
}
@media (max-height: 700px) {
  .host { padding-top: calc(96px + env(safe-area-inset-top, 0px)); }
  .host-card { margin-top: 24px; }
}
@media (hover: none) {
  .pl-tip, .pl-hovertip { display: none; }
  .pl-volline { display: none; }
  .pl-btn { padding: 12px; }
  .pl-btn svg { width: 22px; height: 22px; }
  .pl-line { height: 44px; }
  .pl-knob { width: 15px; height: 15px; }
  .snapshot-icon-btn[data-tooltip]::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .status .dot, .pl-live .d, .call-loading .cl-dot { animation: none !important; }
}

/* icon state swaps (play/pause, vol/mute, fs enter/exit) */
[data-ctl="play"] .ic-pause, .player.is-playing [data-ctl="play"] .ic-play { display: none; }
.player.is-playing [data-ctl="play"] .ic-pause { display: block; }
[data-ctl="mute"] .ic-mute, .player.is-muted [data-ctl="mute"] .ic-vol { display: none; }
.player.is-muted [data-ctl="mute"] .ic-mute { display: block; }
[data-ctl="fs"] .ic-fs-exit, .player.is-fs [data-ctl="fs"] .ic-fs { display: none; }
.player.is-fs [data-ctl="fs"] .ic-fs-exit { display: block; }
