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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Экран входа */
.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 450px;
    margin: 0 auto;
}

.login-card h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #333;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.button-group {
    margin-top: 30px;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-bottom: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #4CAF50;
    color: white;
}

.btn-secondary:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.btn-danger {
    background: #f44336;
    color: white;
    padding: 10px 20px;
    width: auto;
}

.btn-danger:hover {
    background: #da190b;
}

.divider {
    margin: 20px 0;
    position: relative;
    text-align: center;
}

.divider span {
    background: white;
    padding: 0 15px;
    color: #999;
    position: relative;
    z-index: 1;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.join-section {
    display: flex;
    gap: 10px;
}

.join-section input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    text-align: center;
    letter-spacing: 3px;
    font-weight: bold;
}

.join-section input:focus {
    outline: none;
    border-color: #667eea;
}

.error-message {
    color: #f44336;
    margin-top: 15px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Экран комнаты */
.room-header {
    background: white;
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.room-info h2 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 5px;
}

.room-info #room-code-display {
    color: #667eea;
    font-weight: bold;
    letter-spacing: 3px;
}

.room-info p {
    color: #666;
    font-size: 0.9em;
}

.room-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.participants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    min-height: 200px;
}

.participant-card {
    background: #f5f5f5;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    position: relative;
    transition: transform 0.3s;
}

.participant-card:hover {
    transform: translateY(-5px);
}

.participant-card.self {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.participant-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    margin: 0 auto 15px;
}

.participant-name {
    font-weight: 600;
    margin-bottom: 10px;
    word-break: break-word;
}

.participant-status {
    font-size: 0.85em;
    opacity: 0.8;
}

.participant-card.muted .participant-status {
    color: #f44336;
}

.audio-element {
    display: none;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.control-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50px;
    padding: 20px 40px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.control-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.control-btn.muted {
    background: #f44336;
}

.control-btn.muted:hover {
    box-shadow: 0 5px 20px rgba(244, 67, 54, 0.4);
}

.control-btn .icon {
    font-size: 1.5em;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s infinite;
}

.status-dot.connecting {
    background: #ff9800;
}

.status-dot.disconnected {
    background: #f44336;
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@media (max-width: 768px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .join-section {
        flex-direction: column;
    }
    
    .room-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .participants-grid {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
}

