* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #0e0e10; color: #E6E6E7; height: 100vh; display: flex; overflow: hidden; }

.app-container { width: 100vw; height: 100vh; display: flex; flex-direction: column; position: relative; background: #000; overflow: hidden; }

/* Верхний блок для ПК (занимает всё пространство, кроме нижних 160px) */
.video-screens { display: flex; flex-grow: 1; height: calc(100vh - 160px); width: 100vw; background: #000; overflow: hidden; }

/* Каждый экран зажат строго в 50% ширины */
.screen-block { width: 50vw; min-width: 50vw; max-width: 50vw; height: 100%; position: relative; background: #141416; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid #000; }

/* Видео не имеет права распирать свои 50% контейнера */
video { width: 100% !important; height: 100% !important; object-fit: cover !important; display: block; max-width: 100%; max-height: 100%; }
#localVideo { transform: scaleX(-1); }

.video-label { position: absolute; bottom: 15px; left: 15px; background: rgba(0,0,0,0.6); padding: 6px 14px; border-radius: 20px; font-size: 12px; backdrop-filter: blur(5px); z-index: 5; border: 1px solid rgba(255,255,255,0.05); }

/* Счетчик онлайн */
.online-badge { position: absolute; top: 15px; left: 15px; z-index: 10; background: rgba(30, 30, 36, 0.7); border: 1px solid rgba(0, 255, 240, 0.2); padding: 6px 14px; border-radius: 20px; font-size: 13px; color: #00fff0; font-weight: 600; backdrop-filter: blur(5px); }
.online-dot { width: 8px; height: 8px; background: #00ff66; border-radius: 50%; display: inline-block; margin-right: 6px; box-shadow: 0 0 8px #00ff66; }

/* Нижний блок на всю ширину экрана */
.bottom-bar { height: 160px; min-height: 160px; max-height: 160px; width: 100vw; background: #18181c; border-top: 2px solid #0e0e10; display: flex; padding: 15px 20px; gap: 20px; z-index: 10; align-items: center; overflow: hidden; }

.action-buttons { display: flex; gap: 12px; align-items: center; height: 100%; }
.btn-main { width: 160px; height: 100%; font-size: 20px; font-weight: 800; border: none; border-radius: 12px; cursor: pointer; transition: all 0.2s; color: #fff; text-transform: uppercase; }
.btn-start { background: #00cc66; display: block; }
.btn-start:hover { background: #00b359; }
.btn-stop { background: #ff3333; display: none; }
.btn-stop:hover { background: #e60000; }

.btn-mute { width: 70px; height: 100%; border-radius: 12px; background: #2a2a32; border: 1px solid #3a3a44; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 24px; transition: all 0.2s; color: #fff; }
.btn-mute:hover { background: #3a3a44; }
.btn-mute.muted { background: #ff3333; border-color: #ff3333; }

/* Чат внутри подвала */
.bar-chat-wrap { flex-grow: 1; height: 100%; display: flex; flex-direction: column; background: #141416; border-radius: 12px; border: 1px solid #2a2a32; overflow: hidden; }
.chat-messages { flex-grow: 1; padding: 10px 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.msg { padding: 6px 12px; border-radius: 6px; max-width: 85%; word-break: break-word; line-height: 1.3; }
.msg-system { background: rgba(255,255,255,0.03); color: #8a8a93; text-align: center; max-width: 100%; font-style: italic; }
.msg-me { background: #007bff; color: #fff; align-self: flex-end; }
.msg-peer { background: #2a2a32; color: #E6E6E7; align-self: flex-start; }

.chat-input-area { display: flex; border-top: 1px solid #2a2a32; background: #18181c; }
.chat-input { flex-grow: 1; background: transparent; border: none; padding: 12px 15px; color: #fff; font-size: 13px; outline: none; }
.btn-send { background: #00fff0; color: #141416; font-weight: 700; border: none; padding: 0 20px; cursor: pointer; font-size: 13px; transition: background 0.2s; }
.btn-send:hover { background: #00e6d8; }

/* Админка */
#adminPanel { display: none; position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(14,14,16,0.96); z-index: 1000; padding: 40px; overflow-y: auto; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid #2a2a32; padding-bottom: 10px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; }
.pair-card { background: #1e1e24; border: 1px solid #00fff0; padding: 15px; border-radius: 8px; text-align: center; }

/* ======================================================== */
/* МОБИЛЬНАЯ АДАПТАЦИЯ (для экранов меньше 768px) */
/* ======================================================== */
@media (max-width: 768px) {
    .video-screens { flex-direction: column; height: calc(100vh - 200px); width: 100vw; }
    .screen-block { width: 100vw; min-width: 100vw; max-width: 100vw; height: 50%; }

    .bottom-bar { height: 200px; min-height: 200px; max-height: 200px; flex-direction: column; padding: 10px; gap: 10px; }
    .action-buttons { width: 100%; justify-content: space-between; height: 50px; }
    
    .btn-main { flex-grow: 1; height: 100%; font-size: 16px; }
    .btn-mute { width: 60px; height: 100%; }

    .bar-chat-wrap { width: 100%; flex-grow: 1; }
    .chat-messages { height: 70px; padding: 8px; }
    .chat-input-area { padding: 6px; }
}
