/* TeleTalkie — style.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

.screen {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Экран входа ── */

#login-screen {
    align-items: center;
    justify-content: center;
}

.login-box {
    background: #16213e;
    border-radius: 16px;
    padding: 40px 32px;
    width: 320px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.login-box h1 {
    text-align: center;
    font-size: 28px;
    color: #e94560;
}

.login-box .subtitle {
    text-align: center;
    color: #888;
    font-size: 14px;
    margin-top: -8px;
}

.login-box input {
    padding: 12px 16px;
    border: 2px solid #2a2a4a;
    border-radius: 8px;
    background: #0f3460;
    color: #e0e0e0;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.login-box input:focus {
    border-color: #e94560;
}

.login-box input::placeholder {
    color: #666;
}

#join-btn {
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #e94560;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#join-btn:hover {
    background: #c73652;
}

#join-btn:active {
    background: #a82a43;
}

.error {
    color: #e94560;
    font-size: 13px;
    text-align: center;
}

/* ── Экран комнаты ── */

#room-screen {
    height: 100vh;
}

#room-screen header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #16213e;
    border-bottom: 1px solid #2a2a4a;
    flex-shrink: 0;
    gap: 12px;
}

#room-name {
    font-weight: 600;
    font-size: 16px;
    color: #e94560;
    flex: 1;
}

#room-name::before {
    content: "📻 ";
}

#user-name {
    font-size: 14px;
    color: #888;
}

#leave-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #0f3460;
    color: #e94560;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

#leave-btn:hover {
    background: #e94560;
    color: #fff;
}

#leave-btn:active {
    transform: scale(0.95);
}

/* Видео */

#video-container {
    flex: 1;
    position: relative;
    background: #0a0a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#remote-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#talker-label {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(233, 69, 96, 0.85);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

#unmute-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #e94560;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(233, 69, 96, 0.4);
    transition: all 0.2s;
    z-index: 10;
}

#unmute-btn:hover {
    background: #c73652;
    transform: translateX(-50%) scale(1.05);
}

#unmute-btn:active {
    transform: translateX(-50%) scale(0.98);
}

#no-stream {
    position: absolute;
    color: #555;
    font-size: 20px;
    pointer-events: none;
}

/* Управление */

#controls {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #16213e;
    border-top: 1px solid #2a2a4a;
    flex-shrink: 0;
}

#ptt-btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: #0f3460;
    color: #e0e0e0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    transition:
        background 0.15s,
        transform 0.1s;
}

#ptt-btn:not(:disabled):hover {
    background: #1a4a7a;
}

#ptt-btn:not(:disabled):active,
#ptt-btn.talking {
    background: #e94560;
    color: #fff;
    transform: scale(0.97);
}

#ptt-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#status {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
}

/* Панель участников */

#peers-panel {
    padding: 12px 20px;
    background: #16213e;
    border-top: 1px solid #2a2a4a;
    flex-shrink: 0;
    max-height: 120px;
    overflow-y: auto;
}

#peers-panel h3 {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#peers-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#peers-list li {
    background: #0f3460;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
}

#peers-list li.is-talker {
    background: #e94560;
    color: #fff;
}

/* ── Утилиты ── */

[hidden] {
    display: none !important;
}

/* Скроллбар */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #2a2a4a;
    border-radius: 3px;
}
