* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

body {
    background-color: #0e0e10;
    color: #efeff1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Шапка */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: #18181b;
    border-bottom: 1px solid #2d2d30;
    flex-wrap: wrap;
    gap: 8px;
}

.logo {
    font-size: 1.3rem;
    font-weight: bold;
    color: #9147ff;
    white-space: nowrap;
}

.logo-icon {
    margin-right: 3px;
}

.search-bar {
    flex: 1;
    max-width: 300px;
}

.search-bar input {
    background-color: #2d2d30;
    border: 1px solid #3a3a3d;
    border-radius: 6px;
    padding: 6px 10px;
    width: 100%;
    color: white;
    outline: none;
    font-size: 14px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.subscribe-btn {
    background-color: #9147ff;
    border: none;
    color: white;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.subscribe-btn:hover {
    background-color: #7a2be0;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #9147ff;
    flex-shrink: 0;
}

/* Основной контейнер */
.container {
    display: flex;
    flex: 1;
    padding: 15px;
    gap: 15px;
}

.video-section {
    flex: 2.5;
    min-width: 0;
}

.video-player {
    width: 100%;
    background-color: black;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    aspect-ratio: 16 / 9;
    position: relative;
}

video {
    width: 100%;
    height: 100%;
    display: block;
}

/* Кнопка полноэкранного режима (кастомная) */
.fullscreen-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s;
}

.fullscreen-btn:hover {
    background-color: rgba(145, 71, 255, 0.8);
}

.fullscreen-btn span {
    font-size: 0.9rem;
}

/* Инфо под видео */
.video-info {
    padding: 5px 0;
}

.stream-title {
    font-size: 1.5rem;
    margin-bottom: 8px;
    line-height: 1.2;
    word-wrap: break-word;
}

.stream-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.live-badge {
    background-color: #ff0000;
    color: white;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.8rem;
}

.viewer-count {
    color: #9c9c9e;
    font-size: 0.9rem;
    font-weight: 500;
}

.streamer-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    background-color: #1f1f23;
    padding: 10px 12px;
    border-radius: 8px;
    flex-wrap: wrap;
}

.streamer-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    flex-shrink: 0;
}

.streamer-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.streamer-game {
    color: #9147ff;
    font-size: 0.85rem;
}

.follow-btn {
    background-color: #3a3a3d;
    border: none;
    color: white;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    margin-left: auto;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.follow-btn:hover {
    background-color: #4e4e54;
}

.stream-description {
    background-color: #18181b;
    padding: 15px;
    border-radius: 8px;
    line-height: 1.6;
    font-size: 0.95rem;
    word-wrap: break-word;
}

.stream-description p {
    margin-bottom: 8px;
}

.stream-description a {
    color: #9147ff;
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
}

.stream-description a:hover {
    text-decoration: underline;
}

/* Чат */
.chat-sidebar {
    flex: 1;
    background-color: #1b1a1e;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    max-width: 340px;
    height: fit-content;
    max-height: 600px;
}

.chat-header {
    padding: 12px;
    border-bottom: 1px solid #2d2d30;
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
}

.chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    min-height: 300px;
    max-height: 350px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-messages p {
    margin-bottom: 4px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.user-message {
    color: #9147ff;
    font-weight: 500;
}

.user-message strong {
    color: #9147ff;
}

.chat-input-container {
    padding: 12px;
    border-top: 1px solid #2d2d30;
    background-color: #1b1a1e;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.chat-form {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}

#chatInput {
    flex: 1;
    background-color: #2d2d30;
    border: 1px solid #3a3a3d;
    border-radius: 20px;
    padding: 10px 15px;
    color: white;
    outline: none;
    font-size: 0.9rem;
}

#chatInput:focus {
    border-color: #9147ff;
}

.chat-send-btn {
    background-color: #9147ff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background-color: #7a2be0;
}

.chat-privacy-note {
    font-size: 0.7rem;
    color: #9c9c9e;
    text-align: right;
    margin-top: 4px;
}

.chat-viewers {
    color: #9c9c9e;
}

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #18181b;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    border: 2px solid #9147ff;
    box-shadow: 0 0 30px rgba(145, 71, 255, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.modal-content h2 {
    color: #9147ff;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.modal-content p {
    color: #efeff1;
    margin-bottom: 25px;
    font-size: 1.1rem;
    line-height: 1.5;
}

.modal-close-btn {
    background-color: #9147ff;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-close-btn:hover {
    background-color: #7a2be0;
}

/* ===== АДАПТАЦИЯ ПОД МОБИЛЬНЫЕ ===== */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
        padding: 12px;
    }
    
    .chat-sidebar {
        max-width: 100%;
        margin-top: 10px;
        max-height: 450px;
    }
    
    .chat-messages {
        min-height: 200px;
        max-height: 250px;
    }
    
    .fullscreen-btn span {
        display: none; /* На мобильных показываем только иконку */
    }
    
    .fullscreen-btn {
        padding: 8px 10px;
    }
}

@media (max-width: 600px) {
    .navbar {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .logo {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }
    
    .search-bar {
        max-width: 100%;
        order: 3;
        margin-top: 5px;
    }
    
    .stream-title {
        font-size: 1.3rem;
    }
    
    .chat-sidebar {
        max-height: 400px;
    }
    
    .chat-messages {
        min-height: 150px;
        max-height: 200px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
    }
    
    .modal-content p {
        font-size: 1rem;
    }
}