/* SpyMeLive: экран видеочата (телефон, планшет, компьютер). */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.v-app { background: #07080f; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
body.v-app input { -webkit-user-select: text; user-select: text; }

.app {
  position: fixed; left: 0; right: 0;
  top: var(--vvt, 0px);
  height: var(--vvh, 100dvh);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background:
    radial-gradient(700px 400px at 100% 0, rgba(255, 106, 77, .12), transparent 60%),
    radial-gradient(700px 400px at 0 100%, rgba(45, 212, 191, .10), transparent 60%),
    #07080f;
}

/* Верхняя панель */
.a-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 58px; padding: 0 16px; }
.a-top-r { display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); }
.icon-btn:hover { background: rgba(255, 255, 255, .12); }
.lang select { height: 38px; }

/* Основная область */
.a-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; padding: 0 16px; min-height: 0; }
.stage { position: relative; min-height: 0; border-radius: 26px; overflow: hidden; background: #05060b; border: 1px solid var(--line); isolation: isolate; }
.v-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #05060b; opacity: 0; transition: opacity .35s; }
[data-phase="connected"] .v-remote { opacity: 1; }
.scrim { position: absolute; inset: 0; pointer-events: none; z-index: 2; background: linear-gradient(180deg, rgba(0, 0, 0, .32), transparent 22%, transparent 70%, rgba(0, 0, 0, .4)); opacity: 0; transition: opacity .3s; }
[data-phase="connected"] .scrim { opacity: 1; }

/* Своя камера: большая на экране "готов", маленькая в разговоре */
.pip { position: absolute; z-index: 4; overflow: hidden; background: #0d1020; border-radius: 18px; border: 2px solid rgba(255, 255, 255, .22); box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .8); top: 14px; right: 14px; width: clamp(104px, 20%, 190px); aspect-ratio: 3 / 4; transition: all .45s var(--ease); display: none; }
.pip video { width: 100%; height: 100%; object-fit: cover; }
.mirror { transform: scaleX(-1); }
[data-phase="searching"] .pip, [data-phase="connecting"] .pip, [data-phase="connected"] .pip { display: block; }
[data-phase="ready"] .pip { display: block; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border: 0; border-radius: 0; box-shadow: none; }
.pip-off, .pip-mute { position: absolute; display: flex; align-items: center; justify-content: center; }
.pip-off { inset: 0; background: rgba(13, 16, 32, .92); color: var(--muted); }
.pip-off .ic { width: 34px; height: 34px; }
.pip-mute { left: 8px; bottom: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: var(--danger); }
.pip-mute .ic { width: 16px; height: 16px; }
[data-phase="ready"] .pip-off .ic { width: 64px; height: 64px; }

/* Экраны поверх сцены */
.ov { position: absolute; inset: 0; z-index: 5; display: none; align-items: center; justify-content: center; text-align: center; padding: 24px; }
[data-phase="camera"] .ov-cam, [data-phase="ready"] .ov-ready, [data-phase="searching"] .ov-search, [data-phase="connecting"] .ov-search { display: flex; }
.ov h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.03em; }
.ov p { margin-top: 10px; color: var(--muted); }
.ov-ic { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 22px; background: rgba(255, 184, 77, .13); color: var(--amber); margin-bottom: 20px; }
.ov-ic .ic { width: 30px; height: 30px; }
.ov-card { max-width: 420px; }
.ov-cam .btn { margin-top: 22px; }
.ov-cam[data-state="wait"] .ov-ic { animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.08); } }

.ov-ready { align-items: flex-end; padding: 0 20px 28px; background: linear-gradient(180deg, transparent 30%, rgba(7, 8, 15, .88) 100%); }
.ready-card { width: min(440px, 100%); }
.ready-card h2 { font-size: clamp(24px, 3.4vw, 32px); }
.seg { display: flex; gap: 6px; margin: 22px auto 0; padding: 5px; width: max-content; max-width: 100%; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); }
.seg-b { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; }
.seg-b.on { background: var(--text); color: #14111a; }
.seg-b .ic { width: 14px; height: 14px; }
.seg-b.lock { opacity: .7; }
.btn-go { width: 100%; margin-top: 22px; }
.ov-ready .fine { margin-top: 12px; font-size: 13px; }

.ov-search { flex-direction: column; background: radial-gradient(600px 360px at 50% 40%, rgba(255, 106, 77, .16), transparent 70%), rgba(7, 8, 15, .78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.radar { position: relative; width: 150px; height: 150px; margin-bottom: 28px; }
.radar i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 184, 77, .55); animation: ripple 2.4s var(--ease) infinite; opacity: 0; }
.radar i:nth-child(2) { animation-delay: .8s; } .radar i:nth-child(3) { animation-delay: 1.6s; }
.radar span { position: absolute; inset: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--grad); color: #21120c; box-shadow: 0 10px 30px -6px rgba(255, 106, 77, .6); }
.radar span .ic { width: 30px; height: 30px; }
@keyframes ripple { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }

.remote-off { position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none; flex-direction: column; align-items: center; gap: 12px; padding: 22px 28px; border-radius: 24px; background: rgba(13, 16, 32, .82); color: var(--muted); text-align: center; font-weight: 600; }
.remote-off.show { display: flex; }
.remote-off .ic { width: 38px; height: 38px; }
[data-phase="connected"] .remote-off.show { display: flex; }
:not([data-phase="connected"]) > .a-main .remote-off { display: none !important; }
.tap-play { position: absolute; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 26px; border-radius: 999px; border: 0; background: var(--grad); color: #21120c; font-weight: 800; font-size: 16px; }

.float { position: absolute; z-index: 4; left: 12px; right: 12px; bottom: 14px; display: none; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; }
.float li { max-width: 86%; padding: 9px 14px; border-radius: 16px; background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font-size: 15px; font-weight: 500; animation: rise .3s var(--ease); word-break: break-word; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* Чат */
.chat { display: flex; flex-direction: column; min-height: 0; border-radius: 26px; background: var(--surf); border: 1px solid var(--line); overflow: hidden; }
.chat-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px 20px; }
.chat-h h2 { font-size: 17px; font-weight: 700; }
.chat-h .icon-btn { display: none; }
.msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 16px; display: flex; flex-direction: column; gap: 8px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.msgs li { max-width: 84%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.4; word-break: break-word; }
.msgs .me { align-self: flex-end; background: var(--grad); color: #21120c; border-bottom-right-radius: 6px; font-weight: 500; }
.msgs .them { align-self: flex-start; background: var(--surf-2); border-bottom-left-radius: 6px; }
.msgs .sys { align-self: center; max-width: 100%; padding: 4px 10px; font-size: 13px; color: var(--muted); }
.msgs-empty { position: absolute; }
.chat { position: relative; }
.msgs-empty { left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; color: var(--muted); font-size: 14px; padding: 0 24px; pointer-events: none; }
.chat-f { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-f input { flex: 1; min-width: 0; height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); font-size: 16px; }
.chat-f input:disabled { opacity: .45; }
.chat-f input::placeholder { color: var(--muted); }
.send { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--grad); color: #21120c; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.send:disabled { opacity: .4; }

/* Панель управления */
.dock { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 16px 16px; }
[data-phase="gate"] .dock, [data-phase="camera"] .dock { display: none; }
.dk { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 58px; height: 58px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .07); transition: transform .15s var(--ease), background .15s; }
.dk:hover { background: rgba(255, 255, 255, .14); }
.dk:active { transform: scale(.94); }
.dk .ic { width: 25px; height: 25px; }
.dk .off { display: none; }
.dk.is-off { background: rgba(255, 84, 112, .18); border-color: rgba(255, 84, 112, .5); color: #ff8fa3; }
.dk.is-off .on { display: none; } .dk.is-off .off { display: inline-flex; }
.dk-next { width: auto; padding: 0 30px; height: 60px; border: 0; border-radius: 999px; background: var(--grad); color: #21120c; font-weight: 800; font-size: 18px; box-shadow: 0 12px 30px -8px rgba(255, 106, 77, .6); }
.dk-next:hover { background: var(--grad); filter: brightness(1.06); }
.dk-stop { color: #ff8fa3; border-color: rgba(255, 84, 112, .4); }
.dk-next, .dk-chat, .dk-report, .dk-stop { display: none; }
[data-phase="searching"] .dk-next, [data-phase="connecting"] .dk-next, [data-phase="connected"] .dk-next,
[data-phase="searching"] .dk-stop, [data-phase="connecting"] .dk-stop, [data-phase="connected"] .dk-stop { display: inline-flex; }
[data-phase="connected"] .dk-report { display: inline-flex; }
[data-phase="connected"] .dk-chat { display: inline-flex; }
.dk-chat { display: none; }
.unread { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

/* Окна */
body.modal-open .app > *:not(.modal):not(.toast):not(.banner) { filter: blur(3px); }
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(5, 6, 12, .78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.modal[hidden] { display: none !important; }
.modal-card { position: relative; width: min(480px, 100%); max-height: calc(100% - 20px); overflow-y: auto; padding: 32px 28px 26px; border-radius: 30px; background: var(--surf); border: 1px solid var(--line-2); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .9); animation: pop .3s var(--ease); }
.modal-sm { width: min(400px, 100%); text-align: center; }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.modal-card h2 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.m-lead { margin-top: 10px; color: var(--muted); }
.badge-18 { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: 16px; border-radius: 50%; background: var(--grad); color: #21120c; font-weight: 800; font-size: 19px; }
.checks { display: grid; gap: 10px; margin: 20px 0 6px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.checks .ic { color: var(--teal); width: 20px; height: 20px; margin-top: 2px; }
.zero { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 84, 112, .1); border: 1px solid rgba(255, 84, 112, .3); font-size: 14px; color: #ffc1cd; }
.zero a { color: #fff; }
.m-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.reasons { display: grid; gap: 8px; margin-top: 18px; }
.reason { text-align: left; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); font-weight: 600; }
.reason.on { border-color: var(--coral); background: rgba(255, 106, 77, .14); }

.toast { position: fixed; z-index: 120; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); max-width: min(92vw, 460px); padding: 12px 20px; border-radius: 999px; background: rgba(21, 25, 48, .95); border: 1px solid var(--line-2); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .8); font-weight: 600; font-size: 15px; text-align: center; opacity: 0; }
.toast.show { animation: toastin .28s var(--ease) forwards; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.banner { position: fixed; z-index: 110; left: 0; right: 0; top: env(safe-area-inset-top); padding: 8px 16px; background: var(--danger); color: #fff; text-align: center; font-weight: 700; font-size: 14px; }

/* Компьютер: чат всегда виден сбоку */
@media (min-width: 960px) {
  .float { display: none !important; }
  .dk-chat { display: none !important; }
  .a-top { padding: 0 24px; } .a-main { padding: 0 24px; } .dock { padding-bottom: 20px; }
}

/* Планшет и телефон: сцена во весь экран, чат выезжает снизу */
@media (max-width: 959px) {
  .a-top { height: 52px; padding: 0 12px; }
  .a-top .logo-t { font-size: 17px; }
  .a-main { display: block; position: relative; padding: 0; }
  .stage { position: absolute; inset: 0; border-radius: 0; border: 0; }
  .chat { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: min(62%, 520px); border-radius: 26px 26px 0 0; border-bottom: 0; transform: translateY(105%); transition: transform .35s var(--ease); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -20px 60px rgba(0, 0, 0, .6); }
  .app[data-chat="1"] .chat { transform: none; }
  .chat-h .icon-btn { display: inline-flex; }
  .float { display: flex; }
  .app[data-chat="1"] .float { display: none; }
  .dock { position: absolute; z-index: 20; left: 0; right: 0; bottom: 0; padding: 0 12px calc(12px + env(safe-area-inset-bottom)); gap: 10px; }
  [data-phase="ready"] .dock { z-index: 6; }
  .app[data-chat="1"] .dock { display: none; }
  .ov-ready { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .float { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .dk { width: 54px; height: 54px; }
  .dk-next { height: 56px; padding: 0 24px; }
  .pip { top: 10px; right: 10px; width: clamp(88px, 26vw, 132px); border-radius: 16px; }
  .lang select { padding-left: 32px; }
  [data-phase="connected"] .scrim { background: linear-gradient(180deg, rgba(0, 0, 0, .35), transparent 22%, transparent 55%, rgba(0, 0, 0, .55)); }
}
@media (max-width: 520px) {
  .lang > .ic { display: none; } .lang select { padding-left: 14px; }
  .pill { padding: 0 10px; font-size: 12px; }
}
/* Ландшафт на телефоне: низкий экран */
@media (max-height: 480px) and (orientation: landscape) {
  .a-top { height: 44px; } .radar { width: 100px; height: 100px; margin-bottom: 14px; } .radar span { inset: 25px; }
  .ov-ready { padding-bottom: 76px; } .ready-card h2 { font-size: 20px; } .ready-card > p { display: none; } .seg { margin-top: 10px; } .btn-go { margin-top: 10px; height: 46px; }
  .dk { width: 46px; height: 46px; } .dk-next { height: 48px; } .dock { padding-bottom: 8px; }
}
/* Выбор «Я» и «Кого ищем»: девушка / парень / пара */
.seg-l { margin: 16px 0 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.seg-l + .seg { margin-top: 6px; }
.seg.need { box-shadow: 0 0 0 2px #FF6A4D; animation: seg-need .45s; }
@keyframes seg-need { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.seg-b.lock::after { content: "\1F512"; font-size: 11px; }
@media (max-width: 480px) {
  .seg-l { margin-top: 10px; font-size: 11px; }
  .seg { gap: 2px; padding: 4px; }
  .seg-b { padding: 0 11px; height: 36px; font-size: 13px; }
}
@media (max-height: 480px) and (orientation: landscape) { .seg-l { margin-top: 6px; } .seg-l + .seg { margin-top: 4px; } }
@media (prefers-reduced-motion: reduce) { .seg.need { animation: none; } }
