* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #0f1720;
    color: #e8eef5;
    min-height: 100vh;
}

.container {
    max-width: 560px;
    margin: 0 auto;
    padding: 60px 20px;
}

h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.subtitle {
    color: #94a3b8;
    margin-bottom: 32px;
}

.card {
    background: #1a2530;
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
}

label {
    display: block;
    margin-bottom: 8px;
    color: #94a3b8;
    font-size: 14px;
}

input[type=text] {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    background: #0f1720;
    color: #e8eef5;
    border: 1px solid #2c3a48;
    border-radius: 10px;
    outline: none;
    transition: border .15s;
}

input[type=text]:focus {
    border-color: #ffcc00;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.ctrl-btn {
    cursor: pointer;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    transition: .15s;
}

.btn-primary {
    background: #ffcc00;
    color: #1a1a1a;
    padding: 12px 20px;
    width: 100%;
    margin-top: 16px;
}

.btn-primary:hover {
    background: #ffd633;
}

.btn-secondary {
    background: #2c3a48;
    color: #e8eef5;
    padding: 12px 18px;
}

.btn-secondary:hover {
    background: #3a4a5a;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
    padding: 10px 18px;
}

.btn-danger:hover {
    background: #dc2626;
}

.result {
    margin-top: 24px;
}

.hidden {
    display: none !important;
}

.link-box {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.link-box input {
    flex: 1;
}

.muted {
    color: #94a3b8;
    font-size: 13px;
    margin-top: 10px;
}

.error {
    color: #f87171;
    margin-top: 12px;
}

/* Room */
.room-body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #1a2530;
    border-bottom: 1px solid #2c3a48;
}

.room-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse 1.6s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .4
    }
}

.room-actions {
    display: flex;
    gap: 10px;
}

.videos {
    flex: 1;
    display: grid;
    gap: 12px;
    padding: 16px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-content: start;
    overflow-y: auto;
}

.video-wrap {
    position: relative;
    background: #1a2530;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
}

.video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-wrap .name {
    position: absolute;
    left: 10px;
    bottom: 10px;
    background: rgba(0, 0, 0, .55);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 13px;
}

.video-wrap .mic-off {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: rgba(239, 68, 68, .85);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 13px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 16px;
    background: #1a2530;
    border-top: 1px solid #2c3a48;
}

.ctrl-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2c3a48;
    font-size: 22px;
    color: #e8eef5;
}

.ctrl-btn:hover {
    background: #3a4a5a;
}

.ctrl-btn.off {
    background: #ef4444;
}

.ctrl-btn.active {
    background: #ffcc00;
    color: #1a1a1a;
}

/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f1720;
    z-index: 100;
}

.overlay-card {
    background: #1a2530;
    padding: 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.overlay-card h2 {
    margin-bottom: 8px;
}

.overlay-card input {
    margin: 20px 0 0;
}

/* ============================================================
   Передача файлов
   ============================================================ */

.files-panel {
    position: fixed;
    right: 16px;
    top: 70px;
    width: 320px;
    max-height: 60vh;
    background: #1a2530;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
    display: flex;
    flex-direction: column;
    z-index: 50;
    overflow: hidden;
}

.files-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #0f1720;
    border-bottom: 1px solid #2c3a48;
    font-size: 14px;
    font-weight: 600;
}

.files-panel-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.files-panel-close:hover {
    color: #e8eef5;
}

.files-list {
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.file-item {
    background: #0f1720;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
}

.file-item .file-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    color: #e8eef5;
}

.file-item .file-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.file-progress {
    height: 4px;
    background: #2c3a48;
    border-radius: 2px;
    overflow: hidden;
}

.file-progress-fill {
    height: 100%;
    width: 0%;
    background: #ffcc00;
    transition: width .15s linear;
}

.file-item.incoming .file-progress-fill {
    background: #22c55e;
}

.file-item.done .file-progress-fill {
    width: 100% !important;
    background: #22c55e;
}

.file-item.error .file-progress-fill {
    background: #ef4444;
}

.file-item a {
    color: #ffcc00;
    text-decoration: none;
    font-size: 12px;
}

.file-item a:hover {
    text-decoration: underline;
}

/* Drag & drop */
.drop-zone {
    position: fixed;
    inset: 0;
    background: rgba(255, 204, 0, 0.15);
    border: 3px dashed #ffcc00;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.drop-zone-hint {
    background: #1a2530;
    padding: 20px 40px;
    border-radius: 14px;
    font-size: 20px;
    font-weight: 600;
    color: #ffcc00;
}

/* Кнопка отправки файла — активное состояние */
#fileBtn.active {
    background: #ffcc00;
    color: #1a1a1a;
}

@media (max-width: 600px) {
    .files-panel {
        width: calc(100% - 24px);
        right: 12px;
        top: 60px;
    }
}